@bleedingdev/modern-js-utils 3.9.3-ultramodern.1 → 3.9.3-ultramodern.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/compiled/address/provenance.json +1 -1
  2. package/dist/compiled/browserslist/index.js +7 -7
  3. package/dist/compiled/browserslist/provenance.json +1 -1
  4. package/dist/compiled/chalk/provenance.json +1 -1
  5. package/dist/compiled/chokidar/index.d.mts +18 -9
  6. package/dist/compiled/chokidar/index.d.ts +18 -9
  7. package/dist/compiled/chokidar/index.js +194 -171
  8. package/dist/compiled/chokidar/index.mjs +94 -71
  9. package/dist/compiled/chokidar/provenance.json +2 -2
  10. package/dist/compiled/commander/provenance.json +1 -1
  11. package/dist/compiled/debug/provenance.json +1 -1
  12. package/dist/compiled/dotenv-expand/LICENSE +11 -7
  13. package/dist/compiled/dotenv-expand/declaration-licenses/dotenv-expand/LICENSE +11 -7
  14. package/dist/compiled/dotenv-expand/index.js +5545 -61
  15. package/dist/compiled/dotenv-expand/licenses-cjs.txt +12 -7
  16. package/dist/compiled/dotenv-expand/package.json +1 -1
  17. package/dist/compiled/dotenv-expand/provenance.json +7 -7
  18. package/dist/compiled/execa/index.d.mts +67 -33
  19. package/dist/compiled/execa/index.d.ts +67 -33
  20. package/dist/compiled/execa/index.js +1848 -1369
  21. package/dist/compiled/execa/index.mjs +1851 -1372
  22. package/dist/compiled/execa/package.json +1 -1
  23. package/dist/compiled/execa/provenance.json +3 -3
  24. package/dist/compiled/filesize/index.js +26 -25
  25. package/dist/compiled/filesize/index.js.LICENSE.txt +1 -1
  26. package/dist/compiled/filesize/index.mjs +25 -24
  27. package/dist/compiled/filesize/index.mjs.LICENSE.txt +1 -1
  28. package/dist/compiled/filesize/package.json +1 -1
  29. package/dist/compiled/filesize/provenance.json +4 -4
  30. package/dist/compiled/fs-extra/provenance.json +1 -1
  31. package/dist/compiled/glob/provenance.json +3 -3
  32. package/dist/compiled/globby/index.js +431 -139
  33. package/dist/compiled/globby/index.mjs +576 -284
  34. package/dist/compiled/globby/provenance.json +1 -1
  35. package/dist/compiled/gzip-size/provenance.json +1 -1
  36. package/dist/compiled/import-lazy/provenance.json +1 -1
  37. package/dist/compiled/inquirer/index.d.mts +10 -0
  38. package/dist/compiled/inquirer/index.d.ts +10 -0
  39. package/dist/compiled/inquirer/index.js +112 -96
  40. package/dist/compiled/inquirer/index.mjs +98 -82
  41. package/dist/compiled/inquirer/licenses-cjs.txt +26 -0
  42. package/dist/compiled/inquirer/licenses-esm.txt +26 -0
  43. package/dist/compiled/inquirer/package.json +1 -1
  44. package/dist/compiled/inquirer/provenance.json +18 -18
  45. package/dist/compiled/js-yaml/index.js +258 -208
  46. package/dist/compiled/js-yaml/index.js.LICENSE.txt +1 -1
  47. package/dist/compiled/js-yaml/index.mjs +328 -278
  48. package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +1 -1
  49. package/dist/compiled/js-yaml/package.json +1 -1
  50. package/dist/compiled/js-yaml/provenance.json +4 -4
  51. package/dist/compiled/json5/provenance.json +1 -1
  52. package/dist/compiled/lodash/common/function.d.ts +2 -2
  53. package/dist/compiled/lodash/provenance.json +2 -2
  54. package/dist/compiled/mime-types/provenance.json +1 -1
  55. package/dist/compiled/minimist/provenance.json +1 -1
  56. package/dist/compiled/nanoid/index.d.mts +3 -3
  57. package/dist/compiled/nanoid/index.d.ts +3 -3
  58. package/dist/compiled/nanoid/index.js +10 -10
  59. package/dist/compiled/nanoid/index.mjs +10 -10
  60. package/dist/compiled/nanoid/package.json +1 -1
  61. package/dist/compiled/nanoid/provenance.json +4 -4
  62. package/dist/compiled/ora/index.js +310 -286
  63. package/dist/compiled/ora/index.mjs +651 -627
  64. package/dist/compiled/ora/provenance.json +1 -1
  65. package/dist/compiled/pkg-up/provenance.json +1 -1
  66. package/dist/compiled/semver/provenance.json +1 -1
  67. package/dist/compiled/signale/provenance.json +1 -1
  68. package/dist/compiled/slash/provenance.json +1 -1
  69. package/dist/compiled/strip-ansi/index.js +1 -1
  70. package/dist/compiled/strip-ansi/index.mjs +3 -3
  71. package/dist/compiled/strip-ansi/provenance.json +1 -1
  72. package/dist/compiled/tsconfig-paths/provenance.json +1 -1
  73. package/dist/compiled/upath/provenance.json +1 -1
  74. package/dist/compiled/url-join/index.js +56 -29
  75. package/dist/compiled/url-join/index.mjs +57 -30
  76. package/dist/compiled/url-join/package.json +1 -1
  77. package/dist/compiled/url-join/provenance.json +4 -4
  78. package/dist/types/cli/commands.d.ts +1 -1
  79. package/dist/types/cli/modulePath.d.ts +1 -1
  80. package/dist/types/compiled.d.ts +13 -13
  81. package/package.json +8 -8
@@ -39,7 +39,7 @@ const h = {
39
39
  lstat: false,
40
40
  depth: 2147483648,
41
41
  alwaysStat: false,
42
- highWaterMark: 4096
42
+ highWaterMark: 256
43
43
  };
44
44
  Object.freeze(h);
45
45
  const c = "READDIRP_RECURSIVE_ERROR";
@@ -97,17 +97,19 @@ class ReaddirpStream extends a.Readable {
97
97
  _rdOptions;
98
98
  _fileFilter;
99
99
  _directoryFilter;
100
+ _relStart;
100
101
  constructor(t = {}){
101
102
  super({
102
103
  objectMode: true,
103
104
  autoDestroy: true,
104
- highWaterMark: t.highWaterMark
105
+ highWaterMark: t.highWaterMark ?? h.highWaterMark
105
106
  });
106
107
  const e = {
107
108
  ...h,
108
109
  ...t
109
110
  };
110
- const { root: s, type: i } = e;
111
+ const s = e.root ?? h.root;
112
+ const i = e.type ?? h.type;
111
113
  this._fileFilter = normalizeFilter(e.fileFilter);
112
114
  this._directoryFilter = normalizeFilter(e.directoryFilter);
113
115
  const a = e.lstat ? r.lstat : r.stat;
@@ -116,18 +118,24 @@ class ReaddirpStream extends a.Readable {
116
118
  });
117
119
  else this._stat = a;
118
120
  this._maxDepth = null != e.depth && Number.isSafeInteger(e.depth) ? e.depth : h.depth;
119
- this._wantsDir = i ? f.has(i) : false;
120
- this._wantsFile = i ? u.has(i) : false;
121
+ this._wantsDir = f.has(i);
122
+ this._wantsFile = u.has(i);
121
123
  this._wantsEverything = i === o.EVERYTHING_TYPE;
122
124
  this._root = (0, n.resolve)(s);
125
+ this._relStart = this._root.endsWith(n.sep) ? this._root.length : this._root.length + 1;
123
126
  this._isDirent = !e.alwaysStat;
124
127
  this._statsProp = this._isDirent ? "dirent" : "stats";
125
128
  this._rdOptions = {
126
129
  encoding: "utf8",
127
130
  withFileTypes: this._isDirent
128
131
  };
132
+ const c = {
133
+ path: this._root,
134
+ depth: 1
135
+ };
136
+ c.pending = this._exploreDir(this._root, 1);
129
137
  this.parents = [
130
- this._exploreDir(s, 1)
138
+ c
131
139
  ];
132
140
  this.reading = false;
133
141
  this.parent = void 0;
@@ -142,13 +150,17 @@ class ReaddirpStream extends a.Readable {
142
150
  if (s && s.length > 0) {
143
151
  const { path: i, depth: r } = e;
144
152
  const n = s.splice(0, t).map((t)=>this._formatEntry(t, i));
145
- const a = await Promise.all(n);
153
+ const a = this._isDirent ? n : await Promise.all(n);
146
154
  for (const e of a){
147
155
  if (!e) continue;
148
156
  if (this.destroyed) return;
149
- const s = await this._getEntryType(e);
157
+ let s = this._getEntryType(e);
158
+ if ("string" != typeof s) s = await s;
150
159
  if ("directory" === s && this._directoryFilter(e)) {
151
- if (r <= this._maxDepth) this.parents.push(this._exploreDir(e.fullPath, r + 1));
160
+ if (r <= this._maxDepth) this.parents.push({
161
+ path: e.fullPath,
162
+ depth: r + 1
163
+ });
152
164
  if (this._wantsDir) {
153
165
  this.push(e);
154
166
  t--;
@@ -166,7 +178,10 @@ class ReaddirpStream extends a.Readable {
166
178
  this.push(null);
167
179
  break;
168
180
  }
169
- this.parent = await t;
181
+ const e = t.pending ?? this._exploreDir(t.path, t.depth);
182
+ const s = this.parents[this.parents.length - 1];
183
+ if (s && !s.pending) s.pending = this._exploreDir(s.path, s.depth);
184
+ this.parent = await e;
170
185
  if (this.destroyed) return;
171
186
  }
172
187
  }
@@ -189,52 +204,57 @@ class ReaddirpStream extends a.Readable {
189
204
  path: t
190
205
  };
191
206
  }
192
- async _formatEntry(t, e) {
193
- let s;
194
- const i = this._isDirent ? t.name : t;
195
- try {
196
- const r = (0, n.resolve)((0, n.join)(e, i));
197
- s = {
198
- path: (0, n.relative)(this._root, r),
199
- fullPath: r,
200
- basename: i
201
- };
202
- s[this._statsProp] = this._isDirent ? t : await this._stat(r);
203
- } catch (t) {
204
- this._onError(t);
205
- return;
207
+ _formatEntry(t, e) {
208
+ const s = this._isDirent ? t.name : t;
209
+ const i = (0, n.join)(e, s);
210
+ const r = {
211
+ path: i.slice(this._relStart),
212
+ fullPath: i,
213
+ basename: s
214
+ };
215
+ if (this._isDirent) {
216
+ r.dirent = t;
217
+ return r;
206
218
  }
207
- return s;
219
+ return this._stat(i).then((t)=>{
220
+ r.stats = t;
221
+ return r;
222
+ }, (t)=>{
223
+ this._onError(t);
224
+ });
208
225
  }
209
226
  _onError(t) {
210
227
  if (isNormalFlowError(t) && !this.destroyed) this.emit("warn", t);
211
228
  else this.destroy(t);
212
229
  }
213
- async _getEntryType(t) {
214
- if (!t && this._statsProp in t) return "";
230
+ _getEntryType(t) {
231
+ if (!t || !(this._statsProp in t)) return "";
215
232
  const e = t[this._statsProp];
216
233
  if (e.isFile()) return "file";
217
234
  if (e.isDirectory()) return "directory";
218
- if (e && e.isSymbolicLink()) {
219
- const e = t.fullPath;
220
- try {
221
- const t = await (0, r.realpath)(e);
222
- const s = await (0, r.lstat)(t);
223
- if (s.isFile()) return "file";
224
- if (s.isDirectory()) {
225
- const s = t.length;
226
- if (e.startsWith(t) && e.substr(s, 1) === n.sep) {
227
- const s = new Error(`Circular symlink detected: "${e}" points to "${t}"`);
228
- s.code = c;
229
- return this._onError(s);
230
- }
231
- return "directory";
235
+ if (e.isSymbolicLink()) return this._getSymlinkEntryType(t);
236
+ return "";
237
+ }
238
+ async _getSymlinkEntryType(t) {
239
+ const e = t.fullPath;
240
+ try {
241
+ const t = await (0, r.realpath)(e);
242
+ const s = await (0, r.lstat)(t);
243
+ if (s.isFile()) return "file";
244
+ if (s.isDirectory()) {
245
+ const s = t.length;
246
+ if (e.startsWith(t) && e[s] === n.sep) {
247
+ const s = new Error(`Circular symlink detected: "${e}" points to "${t}"`);
248
+ s.code = c;
249
+ this._onError(s);
250
+ return "";
232
251
  }
233
- } catch (t) {
234
- this._onError(t);
235
- return "";
252
+ return "directory";
236
253
  }
254
+ } catch (t) {
255
+ this._onError(t);
237
256
  }
257
+ return "";
238
258
  }
239
259
  _includeAsFile(t) {
240
260
  const e = t && t[this._statsProp];
@@ -244,13 +264,16 @@ class ReaddirpStream extends a.Readable {
244
264
  function readdirp(t, e = {}) {
245
265
  let s = e.entryType || e.type;
246
266
  if ("both" === s) s = o.FILE_DIR_TYPE;
247
- if (s) e.type = s;
248
267
  if (t) {
249
268
  if ("string" != typeof t) throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
250
269
  else if (s && !d.includes(s)) throw new Error(`readdirp: Invalid type passed. Use one of ${d.join(", ")}`);
251
270
  } else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
252
- e.root = t;
253
- return new ReaddirpStream(e);
271
+ const i = {
272
+ ...e,
273
+ root: t
274
+ };
275
+ if (s) i.type = s;
276
+ return new ReaddirpStream(i);
254
277
  }
255
278
  const m = require("node:os");
256
279
  const w = "data";
@@ -276,19 +299,19 @@ const I = {
276
299
  };
277
300
  const F = I;
278
301
  const W = "watch";
279
- const x = {
302
+ const k = {
280
303
  lstat: r.lstat,
281
304
  stat: r.stat
282
305
  };
283
- const A = "listeners";
284
- const k = "errHandlers";
285
- const N = "rawEmitters";
286
- const S = [
306
+ const x = "listeners";
307
+ const A = "errHandlers";
308
+ const S = "rawEmitters";
309
+ const T = [
310
+ x,
287
311
  A,
288
- k,
289
- N
312
+ S
290
313
  ];
291
- const T = new Set([
314
+ const N = new Set([
292
315
  "3dm",
293
316
  "3ds",
294
317
  "3g2",
@@ -551,7 +574,7 @@ const T = new Set([
551
574
  "zip",
552
575
  "zipx"
553
576
  ]);
554
- const isBinaryPath = (t)=>T.has(n.extname(t).slice(1).toLowerCase());
577
+ const isBinaryPath = (t)=>N.has(n.extname(t).slice(1).toLowerCase());
555
578
  const foreach = (t, e)=>{
556
579
  if (t instanceof Set) t.forEach(e);
557
580
  else e(t);
@@ -581,7 +604,7 @@ function createFsWatchInstance(t, e, s, r, a) {
581
604
  a(e, i, {
582
605
  watchedPath: t
583
606
  });
584
- if (i && t !== i) fsWatchBroadcast(n.resolve(t, i), A, n.join(t, i));
607
+ if (i && t !== i) fsWatchBroadcast(n.resolve(t, i), x, n.join(t, i));
585
608
  };
586
609
  try {
587
610
  return (0, i.watch)(t, {
@@ -609,14 +632,14 @@ const setFsWatchListener = (t, e, s, i)=>{
609
632
  return c.close.bind(c);
610
633
  }
611
634
  if (h) {
612
- addAndConvert(h, A, n);
613
- addAndConvert(h, k, a);
614
- addAndConvert(h, N, o);
635
+ addAndConvert(h, x, n);
636
+ addAndConvert(h, A, a);
637
+ addAndConvert(h, S, o);
615
638
  } else {
616
- c = createFsWatchInstance(t, s, fsWatchBroadcast.bind(null, e, A), a, fsWatchBroadcast.bind(null, e, N));
639
+ c = createFsWatchInstance(t, s, fsWatchBroadcast.bind(null, e, x), a, fsWatchBroadcast.bind(null, e, S));
617
640
  if (!c) return;
618
641
  c.on(F.ERROR, async (s)=>{
619
- const i = fsWatchBroadcast.bind(null, e, k);
642
+ const i = fsWatchBroadcast.bind(null, e, A);
620
643
  if (h) h.watcherUnusable = true;
621
644
  if (P && "EPERM" === s.code) try {
622
645
  const e = await (0, r.open)(t, "r");
@@ -634,13 +657,13 @@ const setFsWatchListener = (t, e, s, i)=>{
634
657
  C.set(e, h);
635
658
  }
636
659
  return ()=>{
637
- delFromSet(h, A, n);
638
- delFromSet(h, k, a);
639
- delFromSet(h, N, o);
660
+ delFromSet(h, x, n);
661
+ delFromSet(h, A, a);
662
+ delFromSet(h, S, o);
640
663
  if (isEmptySet(h.listeners)) {
641
664
  h.watcher.close();
642
665
  C.delete(e);
643
- S.forEach(clearItem(h));
666
+ T.forEach(clearItem(h));
644
667
  h.watcher = void 0;
645
668
  Object.freeze(h);
646
669
  }
@@ -656,8 +679,8 @@ const setFsWatchFileListener = (t, e, s, r)=>{
656
679
  o = void 0;
657
680
  }
658
681
  if (o) {
659
- addAndConvert(o, A, n);
660
- addAndConvert(o, N, a);
682
+ addAndConvert(o, x, n);
683
+ addAndConvert(o, S, a);
661
684
  } else {
662
685
  o = {
663
686
  listeners: n,
@@ -677,8 +700,8 @@ const setFsWatchFileListener = (t, e, s, r)=>{
677
700
  z.set(e, o);
678
701
  }
679
702
  return ()=>{
680
- delFromSet(o, A, n);
681
- delFromSet(o, N, a);
703
+ delFromSet(o, x, n);
704
+ delFromSet(o, S, a);
682
705
  if (isEmptySet(o.listeners)) {
683
706
  z.delete(e);
684
707
  (0, i.unwatchFile)(e);
@@ -870,7 +893,7 @@ class NodeFsHandler {
870
893
  h.filterDir = (t)=>s.filterDir(t);
871
894
  }
872
895
  try {
873
- const s = await x[h.statMethod](h.watchPath);
896
+ const s = await k[h.statMethod](h.watchPath);
874
897
  if (this.fsw.closed) return;
875
898
  if (this.fsw._isIgnored(h.watchPath, s)) {
876
899
  o();
@@ -19,9 +19,9 @@
19
19
  },
20
20
  {
21
21
  "name": "readdirp",
22
- "version": "5.0.0",
22
+ "version": "5.1.1",
23
23
  "license": "MIT"
24
24
  }
25
25
  ],
26
- "lockfileSha256": "486928a3a1b80a640cc67d3eeba705a259b639085fe1299dd4f566602b51ede6"
26
+ "lockfileSha256": "b3ac341ea4d3fbd3adf92aa1683e1d5d49f8e7a90ee6b84d9af8904f4643cdd4"
27
27
  }
@@ -18,5 +18,5 @@
18
18
  "license": "MIT"
19
19
  }
20
20
  ],
21
- "lockfileSha256": "486928a3a1b80a640cc67d3eeba705a259b639085fe1299dd4f566602b51ede6"
21
+ "lockfileSha256": "b3ac341ea4d3fbd3adf92aa1683e1d5d49f8e7a90ee6b84d9af8904f4643cdd4"
22
22
  }
@@ -23,5 +23,5 @@
23
23
  "license": "MIT"
24
24
  }
25
25
  ],
26
- "lockfileSha256": "486928a3a1b80a640cc67d3eeba705a259b639085fe1299dd4f566602b51ede6"
26
+ "lockfileSha256": "b3ac341ea4d3fbd3adf92aa1683e1d5d49f8e7a90ee6b84d9af8904f4643cdd4"
27
27
  }
@@ -1,15 +1,20 @@
1
+ BSD 3-Clause License
2
+
1
3
  Copyright (c) 2016, Scott Motte
2
- All rights reserved.
3
4
 
4
5
  Redistribution and use in source and binary forms, with or without
5
6
  modification, are permitted provided that the following conditions are met:
6
7
 
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
9
14
 
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
13
18
 
14
19
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
20
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -21,4 +26,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
26
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
27
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
28
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
-
@@ -1,15 +1,20 @@
1
+ BSD 3-Clause License
2
+
1
3
  Copyright (c) 2016, Scott Motte
2
- All rights reserved.
3
4
 
4
5
  Redistribution and use in source and binary forms, with or without
5
6
  modification, are permitted provided that the following conditions are met:
6
7
 
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
9
14
 
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
13
18
 
14
19
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
20
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -21,4 +26,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
26
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
27
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
28
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
-