Skip to content

Commit c54a84a

Browse files
committed
deps: glob@10.3.12
1 parent 6853531 commit c54a84a

File tree

14 files changed

+133
-74
lines changed

14 files changed

+133
-74
lines changed

node_modules/glob/dist/commonjs/ignore.js

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ class Ignore {
5757
if (!parsed || !globParts) {
5858
throw new Error('invalid pattern object');
5959
}
60+
// strip off leading ./ portions
61+
// https://github.com/isaacs/node-glob/issues/570
62+
while (parsed[0] === '.' && globParts[0] === '.') {
63+
parsed.shift();
64+
globParts.shift();
65+
}
6066
/* c8 ignore stop */
6167
const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform);
6268
const m = new minimatch_1.Minimatch(p.globString(), mmopts);
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{"type":"commonjs"}
1+
{
2+
"type": "commonjs"
3+
}

node_modules/glob/dist/commonjs/walker.js

+22-2
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,26 @@ class GlobUtil {
9696
e = rpc;
9797
}
9898
const needStat = e.isUnknown() || this.opts.stat;
99-
return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir);
99+
const s = needStat ? await e.lstat() : e;
100+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
101+
const target = await s.realpath();
102+
/* c8 ignore start */
103+
if (target && (target.isUnknown() || this.opts.stat)) {
104+
await target.lstat();
105+
}
106+
/* c8 ignore stop */
107+
}
108+
return this.matchCheckTest(s, ifDir);
100109
}
101110
matchCheckTest(e, ifDir) {
102111
return e &&
103112
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
104113
(!ifDir || e.canReaddir()) &&
105114
(!this.opts.nodir || !e.isDirectory()) &&
115+
(!this.opts.nodir ||
116+
!this.opts.follow ||
117+
!e.isSymbolicLink() ||
118+
!e.realpathCached()?.isDirectory()) &&
106119
!this.#ignored(e)
107120
? e
108121
: undefined;
@@ -118,7 +131,14 @@ class GlobUtil {
118131
e = rpc;
119132
}
120133
const needStat = e.isUnknown() || this.opts.stat;
121-
return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir);
134+
const s = needStat ? e.lstatSync() : e;
135+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
136+
const target = s.realpathSync();
137+
if (target && (target?.isUnknown() || this.opts.stat)) {
138+
target.lstatSync();
139+
}
140+
}
141+
return this.matchCheckTest(s, ifDir);
122142
}
123143
matchFinish(e, absolute) {
124144
if (this.#ignored(e))

node_modules/glob/dist/esm/ignore.js

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ export class Ignore {
5454
if (!parsed || !globParts) {
5555
throw new Error('invalid pattern object');
5656
}
57+
// strip off leading ./ portions
58+
// https://github.com/isaacs/node-glob/issues/570
59+
while (parsed[0] === '.' && globParts[0] === '.') {
60+
parsed.shift();
61+
globParts.shift();
62+
}
5763
/* c8 ignore stop */
5864
const p = new Pattern(parsed, globParts, 0, platform);
5965
const m = new Minimatch(p.globString(), mmopts);
+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{"type":"module"}
1+
{
2+
"type": "module"
3+
}

node_modules/glob/dist/esm/walker.js

+22-2
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,26 @@ export class GlobUtil {
9393
e = rpc;
9494
}
9595
const needStat = e.isUnknown() || this.opts.stat;
96-
return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir);
96+
const s = needStat ? await e.lstat() : e;
97+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
98+
const target = await s.realpath();
99+
/* c8 ignore start */
100+
if (target && (target.isUnknown() || this.opts.stat)) {
101+
await target.lstat();
102+
}
103+
/* c8 ignore stop */
104+
}
105+
return this.matchCheckTest(s, ifDir);
97106
}
98107
matchCheckTest(e, ifDir) {
99108
return e &&
100109
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
101110
(!ifDir || e.canReaddir()) &&
102111
(!this.opts.nodir || !e.isDirectory()) &&
112+
(!this.opts.nodir ||
113+
!this.opts.follow ||
114+
!e.isSymbolicLink() ||
115+
!e.realpathCached()?.isDirectory()) &&
103116
!this.#ignored(e)
104117
? e
105118
: undefined;
@@ -115,7 +128,14 @@ export class GlobUtil {
115128
e = rpc;
116129
}
117130
const needStat = e.isUnknown() || this.opts.stat;
118-
return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir);
131+
const s = needStat ? e.lstatSync() : e;
132+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
133+
const target = s.realpathSync();
134+
if (target && (target?.isUnknown() || this.opts.stat)) {
135+
target.lstatSync();
136+
}
137+
}
138+
return this.matchCheckTest(s, ifDir);
119139
}
120140
matchFinish(e, absolute) {
121141
if (this.#ignored(e))

node_modules/glob/package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me/)",
33
"name": "glob",
44
"description": "the most correct and second fastest glob implementation in JavaScript",
5-
"version": "10.3.10",
5+
"version": "10.3.12",
66
"type": "module",
77
"tshy": {
88
"main": true,
@@ -67,21 +67,22 @@
6767
},
6868
"dependencies": {
6969
"foreground-child": "^3.1.0",
70-
"jackspeak": "^2.3.5",
70+
"jackspeak": "^2.3.6",
7171
"minimatch": "^9.0.1",
72-
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
73-
"path-scurry": "^1.10.1"
72+
"minipass": "^7.0.4",
73+
"path-scurry": "^1.10.2"
7474
},
7575
"devDependencies": {
76-
"@types/node": "^20.3.2",
76+
"@types/node": "^20.11.30",
7777
"memfs": "^3.4.13",
7878
"mkdirp": "^3.0.1",
7979
"prettier": "^2.8.3",
8080
"rimraf": "^5.0.1",
8181
"sync-content": "^1.0.2",
82-
"tap": "^18.1.4",
83-
"tshy": "^1.2.2",
84-
"typedoc": "^0.25.1",
82+
"tap": "^18.7.2",
83+
"ts-node": "^10.9.2",
84+
"tshy": "^1.12.0",
85+
"typedoc": "^0.25.12",
8586
"typescript": "^5.2.2"
8687
},
8788
"tap": {

node_modules/path-scurry/dist/cjs/index.js node_modules/path-scurry/dist/commonjs/index.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@ const IFMT = 0b1111;
7575
// mask to unset low 4 bits
7676
const IFMT_UNKNOWN = ~IFMT;
7777
// set after successfully calling readdir() and getting entries.
78-
const READDIR_CALLED = 16;
78+
const READDIR_CALLED = 0b0000_0001_0000;
7979
// set after a successful lstat()
80-
const LSTAT_CALLED = 32;
80+
const LSTAT_CALLED = 0b0000_0010_0000;
8181
// set if an entry (or one of its parents) is definitely not a dir
82-
const ENOTDIR = 64;
82+
const ENOTDIR = 0b0000_0100_0000;
8383
// set if an entry (or one of its parents) does not exist
8484
// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
85-
const ENOENT = 128;
85+
const ENOENT = 0b0000_1000_0000;
8686
// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
8787
// set if we fail to readlink
88-
const ENOREADLINK = 256;
88+
const ENOREADLINK = 0b0001_0000_0000;
8989
// set if we know realpath() will fail
90-
const ENOREALPATH = 512;
90+
const ENOREALPATH = 0b0010_0000_0000;
9191
const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
92-
const TYPEMASK = 1023;
92+
const TYPEMASK = 0b0011_1111_1111;
9393
const entToType = (s) => s.isFile()
9494
? IFREG
9595
: s.isDirectory()
@@ -703,7 +703,7 @@ class PathBase {
703703
/* c8 ignore stop */
704704
try {
705705
const read = await this.#fs.promises.readlink(this.fullpath());
706-
const linkTarget = this.parent.resolve(read);
706+
const linkTarget = (await this.parent.realpath())?.resolve(read);
707707
if (linkTarget) {
708708
return (this.#linkTarget = linkTarget);
709709
}
@@ -732,7 +732,7 @@ class PathBase {
732732
/* c8 ignore stop */
733733
try {
734734
const read = this.#fs.readlinkSync(this.fullpath());
735-
const linkTarget = this.parent.resolve(read);
735+
const linkTarget = (this.parent.realpathSync())?.resolve(read);
736736
if (linkTarget) {
737737
return (this.#linkTarget = linkTarget);
738738
}
@@ -747,7 +747,9 @@ class PathBase {
747747
this.#type |= READDIR_CALLED;
748748
// mark all remaining provisional children as ENOENT
749749
for (let p = children.provisional; p < children.length; p++) {
750-
children[p].#markENOENT();
750+
const c = children[p];
751+
if (c)
752+
c.#markENOENT();
751753
}
752754
}
753755
#markENOENT() {

node_modules/path-scurry/dist/mjs/index.js node_modules/path-scurry/dist/esm/index.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ const IFMT = 0b1111;
4949
// mask to unset low 4 bits
5050
const IFMT_UNKNOWN = ~IFMT;
5151
// set after successfully calling readdir() and getting entries.
52-
const READDIR_CALLED = 16;
52+
const READDIR_CALLED = 0b0000_0001_0000;
5353
// set after a successful lstat()
54-
const LSTAT_CALLED = 32;
54+
const LSTAT_CALLED = 0b0000_0010_0000;
5555
// set if an entry (or one of its parents) is definitely not a dir
56-
const ENOTDIR = 64;
56+
const ENOTDIR = 0b0000_0100_0000;
5757
// set if an entry (or one of its parents) does not exist
5858
// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
59-
const ENOENT = 128;
59+
const ENOENT = 0b0000_1000_0000;
6060
// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
6161
// set if we fail to readlink
62-
const ENOREADLINK = 256;
62+
const ENOREADLINK = 0b0001_0000_0000;
6363
// set if we know realpath() will fail
64-
const ENOREALPATH = 512;
64+
const ENOREALPATH = 0b0010_0000_0000;
6565
const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
66-
const TYPEMASK = 1023;
66+
const TYPEMASK = 0b0011_1111_1111;
6767
const entToType = (s) => s.isFile()
6868
? IFREG
6969
: s.isDirectory()
@@ -675,7 +675,7 @@ export class PathBase {
675675
/* c8 ignore stop */
676676
try {
677677
const read = await this.#fs.promises.readlink(this.fullpath());
678-
const linkTarget = this.parent.resolve(read);
678+
const linkTarget = (await this.parent.realpath())?.resolve(read);
679679
if (linkTarget) {
680680
return (this.#linkTarget = linkTarget);
681681
}
@@ -704,7 +704,7 @@ export class PathBase {
704704
/* c8 ignore stop */
705705
try {
706706
const read = this.#fs.readlinkSync(this.fullpath());
707-
const linkTarget = this.parent.resolve(read);
707+
const linkTarget = (this.parent.realpathSync())?.resolve(read);
708708
if (linkTarget) {
709709
return (this.#linkTarget = linkTarget);
710710
}
@@ -719,7 +719,9 @@ export class PathBase {
719719
this.#type |= READDIR_CALLED;
720720
// mark all remaining provisional children as ENOENT
721721
for (let p = children.provisional; p < children.length; p++) {
722-
children[p].#markENOENT();
722+
const c = children[p];
723+
if (c)
724+
c.#markENOENT();
723725
}
724726
}
725727
#markENOENT() {

node_modules/path-scurry/package.json

+26-28
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "path-scurry",
3-
"version": "1.10.1",
3+
"version": "1.10.2",
44
"description": "walk paths fast and efficiently",
55
"author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me)",
6-
"main": "./dist/cjs/index.js",
7-
"module": "./dist/mjs/index.js",
6+
"main": "./dist/commonjs/index.js",
7+
"type": "module",
88
"exports": {
9+
"./package.json": "./package.json",
910
".": {
1011
"import": {
11-
"types": "./dist/mjs/index.d.ts",
12-
"default": "./dist/mjs/index.js"
12+
"types": "./dist/esm/index.d.ts",
13+
"default": "./dist/esm/index.js"
1314
},
1415
"require": {
15-
"types": "./dist/cjs/index.d.ts",
16-
"default": "./dist/cjs/index.js"
16+
"types": "./dist/commonjs/index.d.ts",
17+
"default": "./dist/commonjs/index.js"
1718
}
1819
}
1920
},
@@ -26,12 +27,11 @@
2627
"postversion": "npm publish",
2728
"prepublishOnly": "git push origin --follow-tags",
2829
"preprepare": "rm -rf dist",
29-
"prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
30-
"postprepare": "bash ./scripts/fixup.sh",
30+
"prepare": "tshy",
3131
"pretest": "npm run prepare",
3232
"presnap": "npm run prepare",
33-
"test": "c8 tap",
34-
"snap": "c8 tap",
33+
"test": "tap",
34+
"snap": "tap",
3535
"format": "prettier --write . --loglevel warn",
3636
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
3737
"bench": "bash ./scripts/bench.sh"
@@ -47,28 +47,19 @@
4747
"arrowParens": "avoid",
4848
"endOfLine": "lf"
4949
},
50-
"tap": {
51-
"coverage": false,
52-
"node-arg": [
53-
"--no-warnings",
54-
"--loader",
55-
"ts-node/esm"
56-
],
57-
"ts": false
58-
},
5950
"devDependencies": {
6051
"@nodelib/fs.walk": "^1.2.8",
61-
"@types/node": "^20.1.4",
62-
"@types/tap": "^15.0.7",
52+
"@types/node": "^20.11.30",
6353
"c8": "^7.12.0",
6454
"eslint-config-prettier": "^8.6.0",
6555
"mkdirp": "^3.0.0",
6656
"prettier": "^2.8.3",
6757
"rimraf": "^5.0.1",
68-
"tap": "^16.3.4",
69-
"ts-node": "^10.9.1",
70-
"typedoc": "^0.23.24",
71-
"typescript": "^5.0.4"
58+
"tap": "^18.7.2",
59+
"ts-node": "^10.9.2",
60+
"tshy": "^1.12.0",
61+
"typedoc": "^0.25.12",
62+
"typescript": "^5.4.3"
7263
},
7364
"engines": {
7465
"node": ">=16 || 14 >=14.17"
@@ -81,7 +72,14 @@
8172
"url": "git+https://github.com/isaacs/path-scurry"
8273
},
8374
"dependencies": {
84-
"lru-cache": "^9.1.1 || ^10.0.0",
75+
"lru-cache": "^10.2.0",
8576
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
86-
}
77+
},
78+
"tshy": {
79+
"exports": {
80+
"./package.json": "./package.json",
81+
".": "./src/index.ts"
82+
}
83+
},
84+
"types": "./dist/commonjs/index.d.ts"
8785
}

0 commit comments

Comments
 (0)