# Code coverage report for mz/_promisify_all.js

## Statements: 90% (18 / 20) Branches: 78.57% (11 / 14) Functions: 100% (4 / 4) Lines: 93.33% (14 / 15) Ignored: none

All files » mz/ » _promisify_all.js

    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
    1

    1
    4
    40
    40
    40

    4
    189
    187
    147

    1
    229
    229
    2

    var promisify = require('./_promisify.js')

    module.exports = function (source, exports, methods) {
      methods.forEach(function (name) {
        Iif (deprecated(source, name)) return
        Eif (typeof source[name] === 'function')
          exports[name] = promisify(name, source[name])
      })

      // proxy the rest
      Object.keys(source).forEach(function (name) {
        if (deprecated(source, name)) return
        if (exports[name]) return
        exports[name] = source[name]
      })
    }

    function deprecated(source, name) {
      var desc = Object.getOwnPropertyDescriptor(source, name)
      if (!desc || !desc.get) return false
      Eif (desc.get.name === 'deprecated') return true
      return false
    }