# All files / src/server key.js

85.71% Statements 6/7
100% Branches 0/0
75% Functions 3/4
85.71% Lines 6/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    241x
    1x

    23x

    1x

    2x

    1x

     import { expose } from 'postmsg-rpc'
    import { pre } from 'prepost'

    export default function (getIpfs, opts) {
      return {
        gen: expose('ipfs.key.gen', pre(
          opts.pre('key.gen'),
          (...args) => getIpfs().key.gen(...args)
        ), opts),
        list: expose('ipfs.key.list', pre(
          opts.pre('key.list'),
          () => getIpfs().key.list()
        ), opts),
        rename: expose('ipfs.key.rename', pre(
          opts.pre('key.rename'),
          (...args) => getIpfs().key.rename(...args)
        ), opts),
        rm: expose('ipfs.key.rm', pre(
          opts.pre('key.rm'),
          (...args) => getIpfs().key.rm(...args)
        ), opts)
      }
    }