# All files / client repo.js

100% Statements 13/13
50% Branches 4/8
100% Functions 1/1
100% Lines 13/13

    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
    341x
    1x
    1x
    1x

    1x

    2x
    2x
    2x

    2x
    2x

    2x
    2x

    2x

     import { caller } from 'postmsg-rpc'
    import callbackify from 'callbackify'
    import { post } from 'prepost'
    import { isBigJson, bigFromJson } from '../serialization/big'

    export default function (opts) {
      return {
        gc: callbackify.variadic(caller('ipfs.repo.gc', opts)),
        stat: callbackify.variadic(
          post(
            caller('ipfs.repo.stat', opts),
            (stats) => {
              Eif (stats) {
                Eif (isBigJson(stats.numObjects)) {
                  stats.numObjects = bigFromJson(stats.numObjects)
                }

                Eif (isBigJson(stats.repoSize)) {
                  stats.repoSize = bigFromJson(stats.repoSize)
                }

                Eif (isBigJson(stats.storageMax)) {
                  stats.storageMax = bigFromJson(stats.storageMax)
                }
              }

              return stats
            }
          )
        ),
        version: callbackify(caller('ipfs.repo.version', opts))
      }
    }