BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / graceful-fs / fs.js

fs.js

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
fs.js 429 B Download Raw
1'use strict'
2
3var fs = require('fs')
4
5module.exports = clone(fs)
6
7function clone (obj) {
8 if (obj === null || typeof obj !== 'object')
9 return obj
10
11 if (obj instanceof Object)
12 var copy = { __proto__: obj.__proto__ }
13 else
14 var copy = Object.create(null)
15
16 Object.getOwnPropertyNames(obj).forEach(function (key) {
17 Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
18 })
19
20 return copy
21}