# All files / server config.js

42.86% Statements 3/7
100% Branches 0/0
0% Functions 0/3
42.86% Lines 3/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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

     import { expose } from 'postmsg-rpc'
    import { pre } from 'prepost'
    import { preBufferFromJson } from '../serialization/buffer'

    export default function (getIpfs, opts) {
      return {
        set: expose('ipfs.config.set', pre(
          preBufferFromJson(1),
          opts.pre('config.set'),
          (...args) => getIpfs().config.set(...args)
        ), opts),
        get: expose('ipfs.config.get', pre(
          opts.pre('config.get'),
          (...args) => getIpfs().config.get(...args)
        ), opts),
        replace: expose('ipfs.config.replace', pre(
          opts.pre('config.replace'),
          (...args) => getIpfs().config.set(...args)
        ), opts)
      }
    }