# All files / lib/server key.js

55.56% Statements 5/9
100% Branches 0/0
20% Functions 1/5
55.56% Lines 5/9

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32

    1x

    1x
    19x

    1x

    1x'use strict';

    Object.defineProperty(exports, "__esModule", {
      value: true
    });

    exports.default = function (getIpfs, opts) {
      return {
        gen: (0, _postmsgRpc.expose)('ipfs.key.gen', (0, _prepost.pre)(opts.pre['key.gen'], function () {
          var _getIpfs$key;

          return (_getIpfs$key = getIpfs().key).gen.apply(_getIpfs$key, arguments);
        }), opts),
        list: (0, _postmsgRpc.expose)('ipfs.key.list', (0, _prepost.pre)(opts.pre['key.list'], function () {
          return getIpfs().key.list();
        }), opts),
        rename: (0, _postmsgRpc.expose)('ipfs.key.rename', (0, _prepost.pre)(opts.pre['key.rename'], function () {
          var _getIpfs$key2;

          return (_getIpfs$key2 = getIpfs().key).rename.apply(_getIpfs$key2, arguments);
        }), opts),
        rm: (0, _postmsgRpc.expose)('ipfs.key.rm', (0, _prepost.pre)(opts.pre['key.rm'], function () {
          var _getIpfs$key3;

          return (_getIpfs$key3 = getIpfs().key).rm.apply(_getIpfs$key3, arguments);
        }), opts)
      };
    };

    var _postmsgRpc = require('postmsg-rpc');

    var _prepost = require('prepost');