diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2021-02-08 21:58:37 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-02-08 23:24:48 +0300 |
commit | 9ab36aae429784df754211d5f086a515012b9bdd (patch) | |
tree | ae49b69b3d1f6c88e30393d54f3c789cdc7f2170 /node_modules/graceful-fs | |
parent | 54cd4c87a71c9381519d8ac52e306096066dc92e (diff) |
graceful-fs@4.2.5
Diffstat (limited to 'node_modules/graceful-fs')
-rw-r--r-- | node_modules/graceful-fs/clone.js | 6 | ||||
-rw-r--r-- | node_modules/graceful-fs/graceful-fs.js | 15 | ||||
-rw-r--r-- | node_modules/graceful-fs/package.json | 5 | ||||
-rw-r--r-- | node_modules/graceful-fs/polyfills.js | 3 |
4 files changed, 25 insertions, 4 deletions
diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js index 028356c96..dff3cc8c5 100644 --- a/node_modules/graceful-fs/clone.js +++ b/node_modules/graceful-fs/clone.js @@ -2,12 +2,16 @@ module.exports = clone +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } + var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js index de3df47fd..8218b1478 100644 --- a/node_modules/graceful-fs/graceful-fs.js +++ b/node_modules/graceful-fs/graceful-fs.js @@ -170,6 +170,21 @@ function patch (fs) { } } + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, cb) { + return fs$copyFile(src, dest, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([fs$copyFile, [src, dest, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json index 0a56eb73f..8eca6d66f 100644 --- a/node_modules/graceful-fs/package.json +++ b/node_modules/graceful-fs/package.json @@ -1,7 +1,7 @@ { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "4.2.4", + "version": "4.2.5", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" @@ -14,7 +14,8 @@ "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", - "test": "node test.js | tap -" + "test": "nyc --silent node test.js | tap -", + "posttest": "nyc report" }, "keywords": [ "fs", diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js index a5808d23f..56d08d180 100644 --- a/node_modules/graceful-fs/polyfills.js +++ b/node_modules/graceful-fs/polyfills.js @@ -19,6 +19,7 @@ process.chdir = function(d) { cwd = null chdir.call(process, d) } +if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) module.exports = patch @@ -132,7 +133,7 @@ function patch (fs) { } // This ensures `util.promisify` works as it does for native `fs.read`. - read.__proto__ = fs$read + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) |