Code coverage report for fs.js

# all files / __root__/ fs.js

81.82% Statements 9/11
66.67% Branches 4/6
100% Functions 2/2
81.82% Lines 9/11

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

    16×

    16×

    16×
    16×

    16×
    16×

    16×
    1352×

    16×

     'use strict'

    var fs = require('fs')

    module.exports = clone(fs)

    function clone (obj) {
      Iif (obj === null || typeof obj !== 'object')
        return obj

      Eif (obj instanceof Object)
        var copy = { __proto__: obj.__proto__ }
      else
        var copy = Object.create(null)

      Object.getOwnPropertyNames(obj).forEach(function (key) {
        Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
      })

      return copy
    }