# All files / lib/server pin.js

70% Statements 7/10
100% Branches 0/0
25% Functions 1/4
70% Lines 7/10

    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
    33

    1x

    1x
    19x

    1x

    1x

    1x

    1x'use strict';

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

    exports.default = function (getIpfs, opts) {
      return {
        add: (0, _postmsgRpc.expose)('ipfs.pin.add', (0, _prepost.pre)((0, _buffer.preBufferFromJson)(0), (0, _cid.preCidFromJson)(0), opts.pre['pin.add'], function () {
          var _getIpfs$pin;

          return (_getIpfs$pin = getIpfs().pin).add.apply(_getIpfs$pin, arguments);
        }), opts),
        rm: (0, _postmsgRpc.expose)('ipfs.pin.rm', (0, _prepost.pre)((0, _buffer.preBufferFromJson)(0), (0, _cid.preCidFromJson)(0), opts.pre['pin.rm'], function () {
          var _getIpfs$pin2;

          return (_getIpfs$pin2 = getIpfs().pin).rm.apply(_getIpfs$pin2, arguments);
        }), opts),
        ls: (0, _postmsgRpc.expose)('ipfs.pin.ls', (0, _prepost.pre)((0, _buffer.preBufferFromJson)(0), (0, _cid.preCidFromJson)(0), opts.pre['pin.ls'], function () {
          var _getIpfs$pin3;

          return (_getIpfs$pin3 = getIpfs().pin).ls.apply(_getIpfs$pin3, arguments);
        }), opts)
      };
    };

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

    var _prepost = require('prepost');

    var _cid = require('../serialization/cid');

    var _buffer = require('../serialization/buffer');