Skip to content

Commit 69d8343

Browse files
committed
1 parent 71296d5 commit 69d8343

File tree

6 files changed

+69
-40
lines changed

6 files changed

+69
-40
lines changed

node_modules/graceful-fs/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The ISC License
22

3-
Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors
3+
Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
44

55
Permission to use, copy, modify, and/or distribute this software for any
66
purpose with or without fee is hereby granted, provided that the above

node_modules/graceful-fs/graceful-fs.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -191,24 +191,43 @@ function patch (fs) {
191191

192192
var fs$readdir = fs.readdir
193193
fs.readdir = readdir
194+
var noReaddirOptionVersions = /^v[0-5]\./
194195
function readdir (path, options, cb) {
195196
if (typeof options === 'function')
196197
cb = options, options = null
197198

199+
var go$readdir = noReaddirOptionVersions.test(process.version)
200+
? function go$readdir (path, options, cb, startTime) {
201+
return fs$readdir(path, fs$readdirCallback(
202+
path, options, cb, startTime
203+
))
204+
}
205+
: function go$readdir (path, options, cb, startTime) {
206+
return fs$readdir(path, options, fs$readdirCallback(
207+
path, options, cb, startTime
208+
))
209+
}
210+
198211
return go$readdir(path, options, cb)
199212

200-
function go$readdir (path, options, cb, startTime) {
201-
return fs$readdir(path, options, function (err, files) {
213+
function fs$readdirCallback (path, options, cb, startTime) {
214+
return function (err, files) {
202215
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
203-
enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()])
216+
enqueue([
217+
go$readdir,
218+
[path, options, cb],
219+
err,
220+
startTime || Date.now(),
221+
Date.now()
222+
])
204223
else {
205224
if (files && files.sort)
206225
files.sort()
207226

208227
if (typeof cb === 'function')
209228
cb.call(this, err, files)
210229
}
211-
})
230+
}
212231
}
213232
}
214233

node_modules/graceful-fs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graceful-fs",
33
"description": "A drop-in replacement for fs, making various improvements.",
4-
"version": "4.2.9",
4+
"version": "4.2.10",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com./isaacs/node-graceful-fs"

node_modules/graceful-fs/polyfills.js

+35-28
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ function patch (fs) {
7171
fs.lstatSync = statFixSync(fs.lstatSync)
7272

7373
// if lchmod/lchown do not exist, then make them no-ops
74-
if (!fs.lchmod) {
74+
if (fs.chmod && !fs.lchmod) {
7575
fs.lchmod = function (path, mode, cb) {
7676
if (cb) process.nextTick(cb)
7777
}
7878
fs.lchmodSync = function () {}
7979
}
80-
if (!fs.lchown) {
80+
if (fs.chown && !fs.lchown) {
8181
fs.lchown = function (path, uid, gid, cb) {
8282
if (cb) process.nextTick(cb)
8383
}
@@ -94,32 +94,38 @@ function patch (fs) {
9494
// CPU to a busy looping process, which can cause the program causing the lock
9595
// contention to be starved of CPU by node, so the contention doesn't resolve.
9696
if (platform === "win32") {
97-
fs.rename = (function (fs$rename) { return function (from, to, cb) {
98-
var start = Date.now()
99-
var backoff = 0;
100-
fs$rename(from, to, function CB (er) {
101-
if (er
102-
&& (er.code === "EACCES" || er.code === "EPERM")
103-
&& Date.now() - start < 60000) {
104-
setTimeout(function() {
105-
fs.stat(to, function (stater, st) {
106-
if (stater && stater.code === "ENOENT")
107-
fs$rename(from, to, CB);
108-
else
109-
cb(er)
110-
})
111-
}, backoff)
112-
if (backoff < 100)
113-
backoff += 10;
114-
return;
115-
}
116-
if (cb) cb(er)
117-
})
118-
}})(fs.rename)
97+
fs.rename = typeof fs.rename !== 'function' ? fs.rename
98+
: (function (fs$rename) {
99+
function rename (from, to, cb) {
100+
var start = Date.now()
101+
var backoff = 0;
102+
fs$rename(from, to, function CB (er) {
103+
if (er
104+
&& (er.code === "EACCES" || er.code === "EPERM")
105+
&& Date.now() - start < 60000) {
106+
setTimeout(function() {
107+
fs.stat(to, function (stater, st) {
108+
if (stater && stater.code === "ENOENT")
109+
fs$rename(from, to, CB);
110+
else
111+
cb(er)
112+
})
113+
}, backoff)
114+
if (backoff < 100)
115+
backoff += 10;
116+
return;
117+
}
118+
if (cb) cb(er)
119+
})
120+
}
121+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
122+
return rename
123+
})(fs.rename)
119124
}
120125

121126
// if read() returns EAGAIN, then just try it again.
122-
fs.read = (function (fs$read) {
127+
fs.read = typeof fs.read !== 'function' ? fs.read
128+
: (function (fs$read) {
123129
function read (fd, buffer, offset, length, position, callback_) {
124130
var callback
125131
if (callback_ && typeof callback_ === 'function') {
@@ -140,7 +146,8 @@ function patch (fs) {
140146
return read
141147
})(fs.read)
142148

143-
fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
149+
fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
150+
: (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
144151
var eagCounter = 0
145152
while (true) {
146153
try {
@@ -199,7 +206,7 @@ function patch (fs) {
199206
}
200207

201208
function patchLutimes (fs) {
202-
if (constants.hasOwnProperty("O_SYMLINK")) {
209+
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
203210
fs.lutimes = function (path, at, mt, cb) {
204211
fs.open(path, constants.O_SYMLINK, function (er, fd) {
205212
if (er) {
@@ -233,7 +240,7 @@ function patch (fs) {
233240
return ret
234241
}
235242

236-
} else {
243+
} else if (fs.futimes) {
237244
fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
238245
fs.lutimesSync = function () {}
239246
}

package-lock.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"columnify": "^1.6.0",
108108
"fastest-levenshtein": "^1.0.12",
109109
"glob": "^7.2.0",
110-
"graceful-fs": "^4.2.9",
110+
"graceful-fs": "^4.2.10",
111111
"hosted-git-info": "^5.0.0",
112112
"ini": "^3.0.0",
113113
"init-package-json": "^3.0.2",
@@ -3200,9 +3200,10 @@
32003200
}
32013201
},
32023202
"node_modules/graceful-fs": {
3203-
"version": "4.2.9",
3204-
"inBundle": true,
3205-
"license": "ISC"
3203+
"version": "4.2.10",
3204+
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
3205+
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
3206+
"inBundle": true
32063207
},
32073208
"node_modules/handlebars": {
32083209
"version": "4.7.7",
@@ -11925,7 +11926,9 @@
1192511926
"dev": true
1192611927
},
1192711928
"graceful-fs": {
11928-
"version": "4.2.9"
11929+
"version": "4.2.10",
11930+
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
11931+
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
1192911932
},
1193011933
"handlebars": {
1193111934
"version": "4.7.7",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"columnify": "^1.6.0",
7575
"fastest-levenshtein": "^1.0.12",
7676
"glob": "^7.2.0",
77-
"graceful-fs": "^4.2.9",
77+
"graceful-fs": "^4.2.10",
7878
"hosted-git-info": "^5.0.0",
7979
"ini": "^3.0.0",
8080
"init-package-json": "^3.0.2",

0 commit comments

Comments
 (0)