@storm-software/git-tools 2.104.47 → 2.104.49

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 (88) hide show
  1. package/README.md +1 -2
  2. package/bin/{chunk-MM5AJ3HN.js → chunk-23TCSI67.js} +26 -143
  3. package/bin/{chunk-LHINQG4H.cjs → chunk-34R4PCUS.cjs} +9 -35
  4. package/bin/chunk-3XEEEMLV.js +25 -0
  5. package/bin/{chunk-FDIL5LQQ.cjs → chunk-3YZZSIRA.cjs} +2 -8
  6. package/bin/{chunk-QVRLY7GO.js → chunk-5DZECCFZ.js} +1831 -3498
  7. package/bin/{chunk-C56ONEWE.cjs → chunk-A3QVIDKR.cjs} +2063 -4146
  8. package/bin/{chunk-RWG7K3L2.cjs → chunk-ANR3M366.cjs} +14 -46
  9. package/bin/{chunk-YCGKNXJZ.cjs → chunk-AQDYBQBF.cjs} +2 -12
  10. package/bin/{chunk-DNTOHRW4.js → chunk-BJYW7ISD.js} +78 -182
  11. package/bin/{chunk-YKGA2MVU.cjs → chunk-FY5QB5MQ.cjs} +13 -47
  12. package/bin/{chunk-DBXOSHV7.js → chunk-GIYWTOX5.js} +10 -44
  13. package/bin/{chunk-YS7O5BRI.cjs → chunk-H6RJC2EU.cjs} +29 -146
  14. package/bin/{chunk-IFBRUMYX.js → chunk-KTLBDGE7.js} +1 -11
  15. package/bin/{chunk-RJTSICHA.js → chunk-M3SPNRDT.js} +6 -32
  16. package/bin/{chunk-PW5R2BRU.cjs → chunk-MRCW7ZWW.cjs} +4 -5
  17. package/bin/{chunk-KD5ZCYX3.cjs → chunk-OQNZFKFJ.cjs} +22 -445
  18. package/bin/{chunk-OBE5IRH4.js → chunk-PAW5GJNL.js} +3 -4
  19. package/bin/{chunk-377YOE7Z.js → chunk-QROY5223.js} +4 -426
  20. package/bin/{chunk-QYSGMK4D.js → chunk-REUY4MDC.js} +10 -42
  21. package/bin/{chunk-JUU5ILZB.cjs → chunk-RHY34RLE.cjs} +4 -6
  22. package/bin/{chunk-PRG2N75Y.js → chunk-V3UDZCED.js} +1 -7
  23. package/bin/chunk-VNWRUK6N.cjs +25 -0
  24. package/bin/{chunk-EJRTGQIY.js → chunk-W2TU25OT.js} +2 -4
  25. package/bin/{chunk-V2L6QG6X.cjs → chunk-Z3K5JTIC.cjs} +88 -192
  26. package/bin/{dist-YVMKTFW6.cjs → dist-3B7RDNKI.cjs} +1097 -2113
  27. package/bin/{dist-AXJG5W3U.js → dist-BGCQPBHL.js} +2 -5
  28. package/bin/{dist-5TR4KAWC.cjs → dist-WGGNNSDG.cjs} +6 -9
  29. package/bin/{dist-KY7IAJSV.js → dist-YM6D424K.js} +417 -1489
  30. package/bin/{esm-MGSMO3WY.cjs → esm-6GE5MI4G.cjs} +249 -254
  31. package/bin/{esm-IZHFRARS.js → esm-WLHP7RVO.js} +246 -251
  32. package/bin/git.cjs +9757 -20881
  33. package/bin/git.js +4720 -13387
  34. package/bin/json5-ELADGSSP.js +10 -0
  35. package/bin/json5-FQPHMSAC.cjs +10 -0
  36. package/bin/jsonc-CTYQYPBR.cjs +15 -0
  37. package/bin/{jsonc-6643P3LC.js → jsonc-RUGZP2X2.js} +3 -3
  38. package/bin/{multipart-parser-Z3URKOGZ.cjs → multipart-parser-I4Y55UNL.cjs} +8 -14
  39. package/bin/{multipart-parser-HAF2WA3O.js → multipart-parser-MFV7BRF2.js} +3 -9
  40. package/bin/post-checkout.cjs +29 -23
  41. package/bin/post-checkout.js +19 -13
  42. package/bin/post-commit.cjs +29 -23
  43. package/bin/post-commit.js +19 -13
  44. package/bin/post-merge.cjs +29 -23
  45. package/bin/post-merge.js +19 -13
  46. package/bin/pre-commit.cjs +26 -20
  47. package/bin/pre-commit.js +17 -11
  48. package/bin/pre-install.cjs +22 -19
  49. package/bin/pre-install.js +13 -10
  50. package/bin/pre-push.cjs +55 -36
  51. package/bin/pre-push.js +40 -21
  52. package/bin/prepare.cjs +20 -17
  53. package/bin/prepare.js +13 -10
  54. package/bin/toml-IRXKI45Y.cjs +10 -0
  55. package/bin/toml-U3J6BEAR.js +10 -0
  56. package/bin/{utils-WL6G35GX.js → utils-6O4EJJM3.js} +2 -12
  57. package/bin/{utils-PZ3SHU7I.cjs → utils-GJRPR6GZ.cjs} +5 -15
  58. package/bin/version-warning.cjs +18 -15
  59. package/bin/version-warning.js +13 -10
  60. package/bin/yaml-CPOMXZOK.js +10 -0
  61. package/bin/yaml-WGJNEJ7V.cjs +10 -0
  62. package/dist/{chunk-232JIEVA.js → chunk-3MA2SHAT.js} +1 -1
  63. package/dist/chunk-3V3F7TB7.cjs +18 -0
  64. package/dist/{chunk-TFEV2FZY.js → chunk-D7HN6Y5M.js} +8 -9
  65. package/dist/{chunk-L2C6A3XV.cjs → chunk-EQZ3BKYL.cjs} +9 -10
  66. package/dist/{chunk-WTMYHIID.cjs → chunk-FX5G24P6.cjs} +3 -3
  67. package/dist/{chunk-W7SYRJE7.js → chunk-JVIJRTGD.js} +1 -1
  68. package/dist/commit/config.cjs +3 -3
  69. package/dist/commit/config.js +2 -2
  70. package/dist/commitlint/config.cjs +24 -103
  71. package/dist/commitlint/config.js +24 -103
  72. package/dist/index.cjs +4 -4
  73. package/dist/index.js +3 -3
  74. package/dist/release/config.cjs +3 -3
  75. package/dist/release/config.js +2 -2
  76. package/dist/types.cjs +2 -2
  77. package/dist/types.js +1 -1
  78. package/package.json +1 -1
  79. package/bin/chunk-5DWG2HXA.js +0 -22
  80. package/bin/chunk-7B6YVRI6.cjs +0 -22
  81. package/bin/json5-DQ2B7V4X.js +0 -10
  82. package/bin/json5-OV4LY5NN.cjs +0 -10
  83. package/bin/jsonc-SKJF3GPV.cjs +0 -15
  84. package/bin/toml-IP5GTCQW.cjs +0 -10
  85. package/bin/toml-KSQJ7SIB.js +0 -10
  86. package/bin/yaml-3NH46CEJ.cjs +0 -10
  87. package/bin/yaml-F3NXDIX4.js +0 -10
  88. package/dist/chunk-Y7XG7IJ6.cjs +0 -18
@@ -1,7 +1,6 @@
1
1
  import {
2
- __name,
3
2
  init_esm_shims
4
- } from "./chunk-EJRTGQIY.js";
3
+ } from "./chunk-W2TU25OT.js";
5
4
 
6
5
  // ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js
7
6
  init_esm_shims();
@@ -23,8 +22,8 @@ var EntryTypes = {
23
22
  };
24
23
  var defaultOptions = {
25
24
  root: ".",
26
- fileFilter: /* @__PURE__ */ __name((_entryInfo) => true, "fileFilter"),
27
- directoryFilter: /* @__PURE__ */ __name((_entryInfo) => true, "directoryFilter"),
25
+ fileFilter: (_entryInfo) => true,
26
+ directoryFilter: (_entryInfo) => true,
28
27
  type: EntryTypes.FILE_TYPE,
29
28
  lstat: false,
30
29
  depth: 2147483648,
@@ -33,13 +32,7 @@ var defaultOptions = {
33
32
  };
34
33
  Object.freeze(defaultOptions);
35
34
  var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
36
- var NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set([
37
- "ENOENT",
38
- "EPERM",
39
- "EACCES",
40
- "ELOOP",
41
- RECURSIVE_ERROR_CODE
42
- ]);
35
+ var NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
43
36
  var ALL_TYPES = [
44
37
  EntryTypes.DIR_TYPE,
45
38
  EntryTypes.EVERYTHING_TYPE,
@@ -56,12 +49,14 @@ var FILE_TYPES = /* @__PURE__ */ new Set([
56
49
  EntryTypes.FILE_DIR_TYPE,
57
50
  EntryTypes.FILE_TYPE
58
51
  ]);
59
- var isNormalFlowError = /* @__PURE__ */ __name((error) => NORMAL_FLOW_ERRORS.has(error.code), "isNormalFlowError");
52
+ var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
60
53
  var wantBigintFsStats = process.platform === "win32";
61
- var emptyFn = /* @__PURE__ */ __name((_entryInfo) => true, "emptyFn");
62
- var normalizeFilter = /* @__PURE__ */ __name((filter) => {
63
- if (filter === void 0) return emptyFn;
64
- if (typeof filter === "function") return filter;
54
+ var emptyFn = (_entryInfo) => true;
55
+ var normalizeFilter = (filter) => {
56
+ if (filter === void 0)
57
+ return emptyFn;
58
+ if (typeof filter === "function")
59
+ return filter;
65
60
  if (typeof filter === "string") {
66
61
  const fl = filter.trim();
67
62
  return (entry) => entry.basename === fl;
@@ -71,29 +66,21 @@ var normalizeFilter = /* @__PURE__ */ __name((filter) => {
71
66
  return (entry) => trItems.some((f) => entry.basename === f);
72
67
  }
73
68
  return emptyFn;
74
- }, "normalizeFilter");
69
+ };
75
70
  var ReaddirpStream = class extends Readable {
76
- static {
77
- __name(this, "ReaddirpStream");
78
- }
79
71
  constructor(options = {}) {
80
72
  super({
81
73
  objectMode: true,
82
74
  autoDestroy: true,
83
75
  highWaterMark: options.highWaterMark
84
76
  });
85
- const opts = {
86
- ...defaultOptions,
87
- ...options
88
- };
77
+ const opts = { ...defaultOptions, ...options };
89
78
  const { root, type } = opts;
90
79
  this._fileFilter = normalizeFilter(opts.fileFilter);
91
80
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
92
81
  const statMethod = opts.lstat ? lstat : stat;
93
82
  if (wantBigintFsStats) {
94
- this._stat = (path) => statMethod(path, {
95
- bigint: true
96
- });
83
+ this._stat = (path) => statMethod(path, { bigint: true });
97
84
  } else {
98
85
  this._stat = statMethod;
99
86
  }
@@ -104,18 +91,14 @@ var ReaddirpStream = class extends Readable {
104
91
  this._root = presolve(root);
105
92
  this._isDirent = !opts.alwaysStat;
106
93
  this._statsProp = this._isDirent ? "dirent" : "stats";
107
- this._rdOptions = {
108
- encoding: "utf8",
109
- withFileTypes: this._isDirent
110
- };
111
- this.parents = [
112
- this._exploreDir(root, 1)
113
- ];
94
+ this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
95
+ this.parents = [this._exploreDir(root, 1)];
114
96
  this.reading = false;
115
97
  this.parent = void 0;
116
98
  }
117
99
  async _read(batch) {
118
- if (this.reading) return;
100
+ if (this.reading)
101
+ return;
119
102
  this.reading = true;
120
103
  try {
121
104
  while (!this.destroyed && batch > 0) {
@@ -126,8 +109,10 @@ var ReaddirpStream = class extends Readable {
126
109
  const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
127
110
  const awaited = await Promise.all(slice);
128
111
  for (const entry of awaited) {
129
- if (!entry) continue;
130
- if (this.destroyed) return;
112
+ if (!entry)
113
+ continue;
114
+ if (this.destroyed)
115
+ return;
131
116
  const entryType = await this._getEntryType(entry);
132
117
  if (entryType === "directory" && this._directoryFilter(entry)) {
133
118
  if (depth <= this._maxDepth) {
@@ -151,7 +136,8 @@ var ReaddirpStream = class extends Readable {
151
136
  break;
152
137
  }
153
138
  this.parent = await parent;
154
- if (this.destroyed) return;
139
+ if (this.destroyed)
140
+ return;
155
141
  }
156
142
  }
157
143
  } catch (error) {
@@ -167,22 +153,14 @@ var ReaddirpStream = class extends Readable {
167
153
  } catch (error) {
168
154
  this._onError(error);
169
155
  }
170
- return {
171
- files,
172
- depth,
173
- path
174
- };
156
+ return { files, depth, path };
175
157
  }
176
158
  async _formatEntry(dirent, path) {
177
159
  let entry;
178
160
  const basename3 = this._isDirent ? dirent.name : dirent;
179
161
  try {
180
162
  const fullPath = presolve(pjoin(path, basename3));
181
- entry = {
182
- path: prelative(this._root, fullPath),
183
- fullPath,
184
- basename: basename3
185
- };
163
+ entry = { path: prelative(this._root, fullPath), fullPath, basename: basename3 };
186
164
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
187
165
  } catch (err) {
188
166
  this._onError(err);
@@ -202,8 +180,10 @@ var ReaddirpStream = class extends Readable {
202
180
  return "";
203
181
  }
204
182
  const stats = entry[this._statsProp];
205
- if (stats.isFile()) return "file";
206
- if (stats.isDirectory()) return "directory";
183
+ if (stats.isFile())
184
+ return "file";
185
+ if (stats.isDirectory())
186
+ return "directory";
207
187
  if (stats && stats.isSymbolicLink()) {
208
188
  const full = entry.fullPath;
209
189
  try {
@@ -234,8 +214,10 @@ var ReaddirpStream = class extends Readable {
234
214
  };
235
215
  function readdirp(root, options = {}) {
236
216
  let type = options.entryType || options.type;
237
- if (type === "both") type = EntryTypes.FILE_DIR_TYPE;
238
- if (type) options.type = type;
217
+ if (type === "both")
218
+ type = EntryTypes.FILE_DIR_TYPE;
219
+ if (type)
220
+ options.type = type;
239
221
  if (!root) {
240
222
  throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
241
223
  } else if (typeof root !== "string") {
@@ -246,7 +228,6 @@ function readdirp(root, options = {}) {
246
228
  options.root = root;
247
229
  return new ReaddirpStream(options);
248
230
  }
249
- __name(readdirp, "readdirp");
250
231
 
251
232
  // ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/handler.js
252
233
  init_esm_shims();
@@ -257,8 +238,8 @@ import { type as osType } from "os";
257
238
  var STR_DATA = "data";
258
239
  var STR_END = "end";
259
240
  var STR_CLOSE = "close";
260
- var EMPTY_FN = /* @__PURE__ */ __name(() => {
261
- }, "EMPTY_FN");
241
+ var EMPTY_FN = () => {
242
+ };
262
243
  var pl = process.platform;
263
244
  var isWindows = pl === "win32";
264
245
  var isMacos = pl === "darwin";
@@ -278,18 +259,11 @@ var EVENTS = {
278
259
  };
279
260
  var EV = EVENTS;
280
261
  var THROTTLE_MODE_WATCH = "watch";
281
- var statMethods = {
282
- lstat: lstat2,
283
- stat: stat2
284
- };
262
+ var statMethods = { lstat: lstat2, stat: stat2 };
285
263
  var KEY_LISTENERS = "listeners";
286
264
  var KEY_ERR = "errHandlers";
287
265
  var KEY_RAW = "rawEmitters";
288
- var HANDLER_KEYS = [
289
- KEY_LISTENERS,
290
- KEY_ERR,
291
- KEY_RAW
292
- ];
266
+ var HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
293
267
  var binaryExtensions = /* @__PURE__ */ new Set([
294
268
  "3dm",
295
269
  "3ds",
@@ -553,51 +527,47 @@ var binaryExtensions = /* @__PURE__ */ new Set([
553
527
  "zip",
554
528
  "zipx"
555
529
  ]);
556
- var isBinaryPath = /* @__PURE__ */ __name((filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase()), "isBinaryPath");
557
- var foreach = /* @__PURE__ */ __name((val, fn) => {
530
+ var isBinaryPath = (filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase());
531
+ var foreach = (val, fn) => {
558
532
  if (val instanceof Set) {
559
533
  val.forEach(fn);
560
534
  } else {
561
535
  fn(val);
562
536
  }
563
- }, "foreach");
564
- var addAndConvert = /* @__PURE__ */ __name((main, prop, item) => {
537
+ };
538
+ var addAndConvert = (main, prop, item) => {
565
539
  let container = main[prop];
566
540
  if (!(container instanceof Set)) {
567
- main[prop] = container = /* @__PURE__ */ new Set([
568
- container
569
- ]);
541
+ main[prop] = container = /* @__PURE__ */ new Set([container]);
570
542
  }
571
543
  container.add(item);
572
- }, "addAndConvert");
573
- var clearItem = /* @__PURE__ */ __name((cont) => (key) => {
544
+ };
545
+ var clearItem = (cont) => (key) => {
574
546
  const set = cont[key];
575
547
  if (set instanceof Set) {
576
548
  set.clear();
577
549
  } else {
578
550
  delete cont[key];
579
551
  }
580
- }, "clearItem");
581
- var delFromSet = /* @__PURE__ */ __name((main, prop, item) => {
552
+ };
553
+ var delFromSet = (main, prop, item) => {
582
554
  const container = main[prop];
583
555
  if (container instanceof Set) {
584
556
  container.delete(item);
585
557
  } else if (container === item) {
586
558
  delete main[prop];
587
559
  }
588
- }, "delFromSet");
589
- var isEmptySet = /* @__PURE__ */ __name((val) => val instanceof Set ? val.size === 0 : !val, "isEmptySet");
560
+ };
561
+ var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
590
562
  var FsWatchInstances = /* @__PURE__ */ new Map();
591
563
  function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
592
- const handleEvent = /* @__PURE__ */ __name((rawEvent, evPath) => {
564
+ const handleEvent = (rawEvent, evPath) => {
593
565
  listener(path);
594
- emitRaw(rawEvent, evPath, {
595
- watchedPath: path
596
- });
566
+ emitRaw(rawEvent, evPath, { watchedPath: path });
597
567
  if (evPath && path !== evPath) {
598
568
  fsWatchBroadcast(sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath));
599
569
  }
600
- }, "handleEvent");
570
+ };
601
571
  try {
602
572
  return fs_watch(path, {
603
573
  persistent: options.persistent
@@ -607,21 +577,22 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
607
577
  return void 0;
608
578
  }
609
579
  }
610
- __name(createFsWatchInstance, "createFsWatchInstance");
611
- var fsWatchBroadcast = /* @__PURE__ */ __name((fullPath, listenerType, val1, val2, val3) => {
580
+ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
612
581
  const cont = FsWatchInstances.get(fullPath);
613
- if (!cont) return;
582
+ if (!cont)
583
+ return;
614
584
  foreach(cont[listenerType], (listener) => {
615
585
  listener(val1, val2, val3);
616
586
  });
617
- }, "fsWatchBroadcast");
618
- var setFsWatchListener = /* @__PURE__ */ __name((path, fullPath, options, handlers) => {
587
+ };
588
+ var setFsWatchListener = (path, fullPath, options, handlers) => {
619
589
  const { listener, errHandler, rawEmitter } = handlers;
620
590
  let cont = FsWatchInstances.get(fullPath);
621
591
  let watcher;
622
592
  if (!options.persistent) {
623
593
  watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter);
624
- if (!watcher) return;
594
+ if (!watcher)
595
+ return;
625
596
  return watcher.close.bind(watcher);
626
597
  }
627
598
  if (cont) {
@@ -629,11 +600,20 @@ var setFsWatchListener = /* @__PURE__ */ __name((path, fullPath, options, handle
629
600
  addAndConvert(cont, KEY_ERR, errHandler);
630
601
  addAndConvert(cont, KEY_RAW, rawEmitter);
631
602
  } else {
632
- watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
633
- if (!watcher) return;
603
+ watcher = createFsWatchInstance(
604
+ path,
605
+ options,
606
+ fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
607
+ errHandler,
608
+ // no need to use broadcast here
609
+ fsWatchBroadcast.bind(null, fullPath, KEY_RAW)
610
+ );
611
+ if (!watcher)
612
+ return;
634
613
  watcher.on(EV.ERROR, async (error) => {
635
614
  const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
636
- if (cont) cont.watcherUnusable = true;
615
+ if (cont)
616
+ cont.watcherUnusable = true;
637
617
  if (isWindows && error.code === "EPERM") {
638
618
  try {
639
619
  const fd = await open(path, "r");
@@ -665,9 +645,9 @@ var setFsWatchListener = /* @__PURE__ */ __name((path, fullPath, options, handle
665
645
  Object.freeze(cont);
666
646
  }
667
647
  };
668
- }, "setFsWatchListener");
648
+ };
669
649
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
670
- var setFsWatchFileListener = /* @__PURE__ */ __name((path, fullPath, options, handlers) => {
650
+ var setFsWatchFileListener = (path, fullPath, options, handlers) => {
671
651
  const { listener, rawEmitter } = handlers;
672
652
  let cont = FsWatchFileInstances.get(fullPath);
673
653
  const copts = cont && cont.options;
@@ -685,10 +665,7 @@ var setFsWatchFileListener = /* @__PURE__ */ __name((path, fullPath, options, ha
685
665
  options,
686
666
  watcher: watchFile(fullPath, options, (curr, prev) => {
687
667
  foreach(cont.rawEmitters, (rawEmitter2) => {
688
- rawEmitter2(EV.CHANGE, fullPath, {
689
- curr,
690
- prev
691
- });
668
+ rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
692
669
  });
693
670
  const currmtime = curr.mtimeMs;
694
671
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
@@ -708,11 +685,8 @@ var setFsWatchFileListener = /* @__PURE__ */ __name((path, fullPath, options, ha
708
685
  Object.freeze(cont);
709
686
  }
710
687
  };
711
- }, "setFsWatchFileListener");
688
+ };
712
689
  var NodeFsHandler = class {
713
- static {
714
- __name(this, "NodeFsHandler");
715
- }
716
690
  constructor(fsW) {
717
691
  this.fsw = fsW;
718
692
  this._boundHandleError = (error) => fsW._handleError(error);
@@ -733,7 +707,8 @@ var NodeFsHandler = class {
733
707
  const options = {
734
708
  persistent: opts.persistent
735
709
  };
736
- if (!listener) listener = EMPTY_FN;
710
+ if (!listener)
711
+ listener = EMPTY_FN;
737
712
  let closer;
738
713
  if (opts.usePolling) {
739
714
  const enableBin = opts.interval !== opts.binaryInterval;
@@ -763,13 +738,16 @@ var NodeFsHandler = class {
763
738
  const basename3 = sysPath.basename(file);
764
739
  const parent = this.fsw._getWatchedDir(dirname3);
765
740
  let prevStats = stats;
766
- if (parent.has(basename3)) return;
767
- const listener = /* @__PURE__ */ __name(async (path, newStats) => {
768
- if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
741
+ if (parent.has(basename3))
742
+ return;
743
+ const listener = async (path, newStats) => {
744
+ if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
745
+ return;
769
746
  if (!newStats || newStats.mtimeMs === 0) {
770
747
  try {
771
748
  const newStats2 = await stat2(file);
772
- if (this.fsw.closed) return;
749
+ if (this.fsw.closed)
750
+ return;
773
751
  const at = newStats2.atimeMs;
774
752
  const mt = newStats2.mtimeMs;
775
753
  if (!at || at <= mt || mt !== prevStats.mtimeMs) {
@@ -779,7 +757,8 @@ var NodeFsHandler = class {
779
757
  this.fsw._closeFile(path);
780
758
  prevStats = newStats2;
781
759
  const closer2 = this._watchWithNodeFs(file, listener);
782
- if (closer2) this.fsw._addPathCloser(path, closer2);
760
+ if (closer2)
761
+ this.fsw._addPathCloser(path, closer2);
783
762
  } else {
784
763
  prevStats = newStats2;
785
764
  }
@@ -794,10 +773,11 @@ var NodeFsHandler = class {
794
773
  }
795
774
  prevStats = newStats;
796
775
  }
797
- }, "listener");
776
+ };
798
777
  const closer = this._watchWithNodeFs(file, listener);
799
778
  if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
800
- if (!this.fsw._throttle(EV.ADD, file, 0)) return;
779
+ if (!this.fsw._throttle(EV.ADD, file, 0))
780
+ return;
801
781
  this.fsw._emit(EV.ADD, file, stats);
802
782
  }
803
783
  return closer;
@@ -825,7 +805,8 @@ var NodeFsHandler = class {
825
805
  this.fsw._emitReady();
826
806
  return true;
827
807
  }
828
- if (this.fsw.closed) return;
808
+ if (this.fsw.closed)
809
+ return;
829
810
  if (dir.has(item)) {
830
811
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
831
812
  this.fsw._symlinkPaths.set(full, linkPath);
@@ -847,14 +828,16 @@ var NodeFsHandler = class {
847
828
  _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
848
829
  directory = sysPath.join(directory, "");
849
830
  throttler = this.fsw._throttle("readdir", directory, 1e3);
850
- if (!throttler) return;
831
+ if (!throttler)
832
+ return;
851
833
  const previous = this.fsw._getWatchedDir(wh.path);
852
834
  const current = /* @__PURE__ */ new Set();
853
835
  let stream = this.fsw._readdirp(directory, {
854
- fileFilter: /* @__PURE__ */ __name((entry) => wh.filterPath(entry), "fileFilter"),
855
- directoryFilter: /* @__PURE__ */ __name((entry) => wh.filterDir(entry), "directoryFilter")
836
+ fileFilter: (entry) => wh.filterPath(entry),
837
+ directoryFilter: (entry) => wh.filterDir(entry)
856
838
  });
857
- if (!stream) return;
839
+ if (!stream)
840
+ return;
858
841
  stream.on(STR_DATA, async (entry) => {
859
842
  if (this.fsw.closed) {
860
843
  stream = void 0;
@@ -877,7 +860,8 @@ var NodeFsHandler = class {
877
860
  }
878
861
  }).on(EV.ERROR, this._boundHandleError);
879
862
  return new Promise((resolve3, reject) => {
880
- if (!stream) return reject();
863
+ if (!stream)
864
+ return reject();
881
865
  stream.once(STR_END, () => {
882
866
  if (this.fsw.closed) {
883
867
  stream = void 0;
@@ -891,7 +875,8 @@ var NodeFsHandler = class {
891
875
  this.fsw._remove(directory, item);
892
876
  });
893
877
  stream = void 0;
894
- if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler);
878
+ if (wasThrottled)
879
+ this._handleRead(directory, false, wh, target, dir, depth, throttler);
895
880
  });
896
881
  });
897
882
  }
@@ -920,10 +905,12 @@ var NodeFsHandler = class {
920
905
  if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
921
906
  if (!target) {
922
907
  await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
923
- if (this.fsw.closed) return;
908
+ if (this.fsw.closed)
909
+ return;
924
910
  }
925
911
  closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
926
- if (stats2 && stats2.mtimeMs === 0) return;
912
+ if (stats2 && stats2.mtimeMs === 0)
913
+ return;
927
914
  this._handleRead(dirPath, false, wh, target, dir, depth, throttler);
928
915
  });
929
916
  }
@@ -951,7 +938,8 @@ var NodeFsHandler = class {
951
938
  }
952
939
  try {
953
940
  const stats = await statMethods[wh.statMethod](wh.watchPath);
954
- if (this.fsw.closed) return;
941
+ if (this.fsw.closed)
942
+ return;
955
943
  if (this.fsw._isIgnored(wh.watchPath, stats)) {
956
944
  ready();
957
945
  return false;
@@ -961,20 +949,24 @@ var NodeFsHandler = class {
961
949
  if (stats.isDirectory()) {
962
950
  const absPath = sysPath.resolve(path);
963
951
  const targetPath = follow ? await fsrealpath(path) : path;
964
- if (this.fsw.closed) return;
952
+ if (this.fsw.closed)
953
+ return;
965
954
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
966
- if (this.fsw.closed) return;
955
+ if (this.fsw.closed)
956
+ return;
967
957
  if (absPath !== targetPath && targetPath !== void 0) {
968
958
  this.fsw._symlinkPaths.set(absPath, targetPath);
969
959
  }
970
960
  } else if (stats.isSymbolicLink()) {
971
961
  const targetPath = follow ? await fsrealpath(path) : path;
972
- if (this.fsw.closed) return;
962
+ if (this.fsw.closed)
963
+ return;
973
964
  const parent = sysPath.dirname(wh.watchPath);
974
965
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
975
966
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
976
967
  closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
977
- if (this.fsw.closed) return;
968
+ if (this.fsw.closed)
969
+ return;
978
970
  if (targetPath !== void 0) {
979
971
  this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);
980
972
  }
@@ -982,7 +974,8 @@ var NodeFsHandler = class {
982
974
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
983
975
  }
984
976
  ready();
985
- if (closer) this.fsw._addPathCloser(path, closer);
977
+ if (closer)
978
+ this.fsw._addPathCloser(path, closer);
986
979
  return false;
987
980
  } catch (error) {
988
981
  if (this.fsw._handleError(error)) {
@@ -1004,19 +997,20 @@ var DOUBLE_SLASH_RE = /\/\//;
1004
997
  var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
1005
998
  var REPLACER_RE = /^\.[/\\]/;
1006
999
  function arrify(item) {
1007
- return Array.isArray(item) ? item : [
1008
- item
1009
- ];
1000
+ return Array.isArray(item) ? item : [item];
1010
1001
  }
1011
- __name(arrify, "arrify");
1012
- var isMatcherObject = /* @__PURE__ */ __name((matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp), "isMatcherObject");
1002
+ var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
1013
1003
  function createPattern(matcher) {
1014
- if (typeof matcher === "function") return matcher;
1015
- if (typeof matcher === "string") return (string) => matcher === string;
1016
- if (matcher instanceof RegExp) return (string) => matcher.test(string);
1004
+ if (typeof matcher === "function")
1005
+ return matcher;
1006
+ if (typeof matcher === "string")
1007
+ return (string) => matcher === string;
1008
+ if (matcher instanceof RegExp)
1009
+ return (string) => matcher.test(string);
1017
1010
  if (typeof matcher === "object" && matcher !== null) {
1018
1011
  return (string) => {
1019
- if (matcher.path === string) return true;
1012
+ if (matcher.path === string)
1013
+ return true;
1020
1014
  if (matcher.recursive) {
1021
1015
  const relative3 = sysPath2.relative(matcher.path, string);
1022
1016
  if (!relative3) {
@@ -1029,19 +1023,21 @@ function createPattern(matcher) {
1029
1023
  }
1030
1024
  return () => false;
1031
1025
  }
1032
- __name(createPattern, "createPattern");
1033
1026
  function normalizePath(path) {
1034
- if (typeof path !== "string") throw new Error("string expected");
1027
+ if (typeof path !== "string")
1028
+ throw new Error("string expected");
1035
1029
  path = sysPath2.normalize(path);
1036
1030
  path = path.replace(/\\/g, "/");
1037
1031
  let prepend = false;
1038
- if (path.startsWith("//")) prepend = true;
1032
+ if (path.startsWith("//"))
1033
+ prepend = true;
1039
1034
  const DOUBLE_SLASH_RE2 = /\/\//;
1040
- while (path.match(DOUBLE_SLASH_RE2)) path = path.replace(DOUBLE_SLASH_RE2, "/");
1041
- if (prepend) path = "/" + path;
1035
+ while (path.match(DOUBLE_SLASH_RE2))
1036
+ path = path.replace(DOUBLE_SLASH_RE2, "/");
1037
+ if (prepend)
1038
+ path = "/" + path;
1042
1039
  return path;
1043
1040
  }
1044
- __name(normalizePath, "normalizePath");
1045
1041
  function matchPatterns(patterns, testString, stats) {
1046
1042
  const path = normalizePath(testString);
1047
1043
  for (let index = 0; index < patterns.length; index++) {
@@ -1052,7 +1048,6 @@ function matchPatterns(patterns, testString, stats) {
1052
1048
  }
1053
1049
  return false;
1054
1050
  }
1055
- __name(matchPatterns, "matchPatterns");
1056
1051
  function anymatch(matchers, testString) {
1057
1052
  if (matchers == null) {
1058
1053
  throw new TypeError("anymatch: specify first argument");
@@ -1066,15 +1061,14 @@ function anymatch(matchers, testString) {
1066
1061
  }
1067
1062
  return matchPatterns(patterns, testString);
1068
1063
  }
1069
- __name(anymatch, "anymatch");
1070
- var unifyPaths = /* @__PURE__ */ __name((paths_) => {
1064
+ var unifyPaths = (paths_) => {
1071
1065
  const paths = arrify(paths_).flat();
1072
1066
  if (!paths.every((p) => typeof p === STRING_TYPE)) {
1073
1067
  throw new TypeError(`Non-string provided as watch path: ${paths}`);
1074
1068
  }
1075
1069
  return paths.map(normalizePathToUnix);
1076
- }, "unifyPaths");
1077
- var toUnix = /* @__PURE__ */ __name((string) => {
1070
+ };
1071
+ var toUnix = (string) => {
1078
1072
  let str = string.replace(BACK_SLASH_RE, SLASH);
1079
1073
  let prepend = false;
1080
1074
  if (str.startsWith(SLASH_SLASH)) {
@@ -1087,26 +1081,23 @@ var toUnix = /* @__PURE__ */ __name((string) => {
1087
1081
  str = SLASH + str;
1088
1082
  }
1089
1083
  return str;
1090
- }, "toUnix");
1091
- var normalizePathToUnix = /* @__PURE__ */ __name((path) => toUnix(sysPath2.normalize(toUnix(path))), "normalizePathToUnix");
1092
- var normalizeIgnored = /* @__PURE__ */ __name((cwd = "") => (path) => {
1084
+ };
1085
+ var normalizePathToUnix = (path) => toUnix(sysPath2.normalize(toUnix(path)));
1086
+ var normalizeIgnored = (cwd = "") => (path) => {
1093
1087
  if (typeof path === "string") {
1094
1088
  return normalizePathToUnix(sysPath2.isAbsolute(path) ? path : sysPath2.join(cwd, path));
1095
1089
  } else {
1096
1090
  return path;
1097
1091
  }
1098
- }, "normalizeIgnored");
1099
- var getAbsolutePath = /* @__PURE__ */ __name((path, cwd) => {
1092
+ };
1093
+ var getAbsolutePath = (path, cwd) => {
1100
1094
  if (sysPath2.isAbsolute(path)) {
1101
1095
  return path;
1102
1096
  }
1103
1097
  return sysPath2.join(cwd, path);
1104
- }, "getAbsolutePath");
1098
+ };
1105
1099
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
1106
- var DirEntry = class DirEntry2 {
1107
- static {
1108
- __name(this, "DirEntry");
1109
- }
1100
+ var DirEntry = class {
1110
1101
  constructor(dir, removeWatcher) {
1111
1102
  this.path = dir;
1112
1103
  this._removeWatcher = removeWatcher;
@@ -1114,14 +1105,18 @@ var DirEntry = class DirEntry2 {
1114
1105
  }
1115
1106
  add(item) {
1116
1107
  const { items } = this;
1117
- if (!items) return;
1118
- if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item);
1108
+ if (!items)
1109
+ return;
1110
+ if (item !== ONE_DOT && item !== TWO_DOTS)
1111
+ items.add(item);
1119
1112
  }
1120
1113
  async remove(item) {
1121
1114
  const { items } = this;
1122
- if (!items) return;
1115
+ if (!items)
1116
+ return;
1123
1117
  items.delete(item);
1124
- if (items.size > 0) return;
1118
+ if (items.size > 0)
1119
+ return;
1125
1120
  const dir = this.path;
1126
1121
  try {
1127
1122
  await readdir2(dir);
@@ -1133,15 +1128,15 @@ var DirEntry = class DirEntry2 {
1133
1128
  }
1134
1129
  has(item) {
1135
1130
  const { items } = this;
1136
- if (!items) return;
1131
+ if (!items)
1132
+ return;
1137
1133
  return items.has(item);
1138
1134
  }
1139
1135
  getChildren() {
1140
1136
  const { items } = this;
1141
- if (!items) return [];
1142
- return [
1143
- ...items.values()
1144
- ];
1137
+ if (!items)
1138
+ return [];
1139
+ return [...items.values()];
1145
1140
  }
1146
1141
  dispose() {
1147
1142
  this.items.clear();
@@ -1154,9 +1149,6 @@ var DirEntry = class DirEntry2 {
1154
1149
  var STAT_METHOD_F = "stat";
1155
1150
  var STAT_METHOD_L = "lstat";
1156
1151
  var WatchHelper = class {
1157
- static {
1158
- __name(this, "WatchHelper");
1159
- }
1160
1152
  constructor(path, follow, fsw) {
1161
1153
  this.fsw = fsw;
1162
1154
  const watchPath = path;
@@ -1165,7 +1157,8 @@ var WatchHelper = class {
1165
1157
  this.fullWatchPath = sysPath2.resolve(watchPath);
1166
1158
  this.dirParts = [];
1167
1159
  this.dirParts.forEach((parts) => {
1168
- if (parts.length > 1) parts.pop();
1160
+ if (parts.length > 1)
1161
+ parts.pop();
1169
1162
  });
1170
1163
  this.followSymlinks = follow;
1171
1164
  this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
@@ -1175,7 +1168,8 @@ var WatchHelper = class {
1175
1168
  }
1176
1169
  filterPath(entry) {
1177
1170
  const { stats } = entry;
1178
- if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
1171
+ if (stats && stats.isSymbolicLink())
1172
+ return this.filterDir(entry);
1179
1173
  const resolvedPath = this.entryPath(entry);
1180
1174
  return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
1181
1175
  }
@@ -1184,9 +1178,6 @@ var WatchHelper = class {
1184
1178
  }
1185
1179
  };
1186
1180
  var FSWatcher = class extends EventEmitter {
1187
- static {
1188
- __name(this, "FSWatcher");
1189
- }
1190
1181
  // Not indenting methods for history sake; for now.
1191
1182
  constructor(_opts = {}) {
1192
1183
  super();
@@ -1202,10 +1193,7 @@ var FSWatcher = class extends EventEmitter {
1202
1193
  this._readyCount = 0;
1203
1194
  this._readyEmitted = false;
1204
1195
  const awf = _opts.awaitWriteFinish;
1205
- const DEF_AWF = {
1206
- stabilityThreshold: 2e3,
1207
- pollInterval: 100
1208
- };
1196
+ const DEF_AWF = { stabilityThreshold: 2e3, pollInterval: 100 };
1209
1197
  const opts = {
1210
1198
  // Defaults
1211
1199
  persistent: true,
@@ -1217,25 +1205,29 @@ var FSWatcher = class extends EventEmitter {
1217
1205
  usePolling: false,
1218
1206
  // useAsync: false,
1219
1207
  atomic: true,
1208
+ // NOTE: overwritten later (depends on usePolling)
1220
1209
  ..._opts,
1221
1210
  // Change format
1222
1211
  ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
1223
- awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? {
1224
- ...DEF_AWF,
1225
- ...awf
1226
- } : false
1212
+ awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
1227
1213
  };
1228
- if (isIBMi) opts.usePolling = true;
1229
- if (opts.atomic === void 0) opts.atomic = !opts.usePolling;
1214
+ if (isIBMi)
1215
+ opts.usePolling = true;
1216
+ if (opts.atomic === void 0)
1217
+ opts.atomic = !opts.usePolling;
1230
1218
  const envPoll = process.env.CHOKIDAR_USEPOLLING;
1231
1219
  if (envPoll !== void 0) {
1232
1220
  const envLower = envPoll.toLowerCase();
1233
- if (envLower === "false" || envLower === "0") opts.usePolling = false;
1234
- else if (envLower === "true" || envLower === "1") opts.usePolling = true;
1235
- else opts.usePolling = !!envLower;
1221
+ if (envLower === "false" || envLower === "0")
1222
+ opts.usePolling = false;
1223
+ else if (envLower === "true" || envLower === "1")
1224
+ opts.usePolling = true;
1225
+ else
1226
+ opts.usePolling = !!envLower;
1236
1227
  }
1237
1228
  const envInterval = process.env.CHOKIDAR_INTERVAL;
1238
- if (envInterval) opts.interval = Number.parseInt(envInterval, 10);
1229
+ if (envInterval)
1230
+ opts.interval = Number.parseInt(envInterval, 10);
1239
1231
  let readyCalls = 0;
1240
1232
  this._emitReady = () => {
1241
1233
  readyCalls++;
@@ -1291,16 +1283,20 @@ var FSWatcher = class extends EventEmitter {
1291
1283
  this._removeIgnoredPath(path);
1292
1284
  });
1293
1285
  this._userIgnored = void 0;
1294
- if (!this._readyCount) this._readyCount = 0;
1286
+ if (!this._readyCount)
1287
+ this._readyCount = 0;
1295
1288
  this._readyCount += paths.length;
1296
1289
  Promise.all(paths.map(async (path) => {
1297
1290
  const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, void 0, 0, _origAdd);
1298
- if (res) this._emitReady();
1291
+ if (res)
1292
+ this._emitReady();
1299
1293
  return res;
1300
1294
  })).then((results) => {
1301
- if (this.closed) return;
1295
+ if (this.closed)
1296
+ return;
1302
1297
  results.forEach((item) => {
1303
- if (item) this.add(sysPath2.dirname(item), sysPath2.basename(_origAdd || item));
1298
+ if (item)
1299
+ this.add(sysPath2.dirname(item), sysPath2.basename(_origAdd || item));
1304
1300
  });
1305
1301
  });
1306
1302
  return this;
@@ -1309,12 +1305,14 @@ var FSWatcher = class extends EventEmitter {
1309
1305
  * Close watchers or start ignoring events from specified paths.
1310
1306
  */
1311
1307
  unwatch(paths_) {
1312
- if (this.closed) return this;
1308
+ if (this.closed)
1309
+ return this;
1313
1310
  const paths = unifyPaths(paths_);
1314
1311
  const { cwd } = this.options;
1315
1312
  paths.forEach((path) => {
1316
1313
  if (!sysPath2.isAbsolute(path) && !this._closers.has(path)) {
1317
- if (cwd) path = sysPath2.join(cwd, path);
1314
+ if (cwd)
1315
+ path = sysPath2.join(cwd, path);
1318
1316
  path = sysPath2.resolve(path);
1319
1317
  }
1320
1318
  this._closePath(path);
@@ -1341,7 +1339,8 @@ var FSWatcher = class extends EventEmitter {
1341
1339
  const closers = [];
1342
1340
  this._closers.forEach((closerList) => closerList.forEach((closer) => {
1343
1341
  const promise = closer();
1344
- if (promise instanceof Promise) closers.push(promise);
1342
+ if (promise instanceof Promise)
1343
+ closers.push(promise);
1345
1344
  }));
1346
1345
  this._streams.forEach((stream) => stream.destroy());
1347
1346
  this._userIgnored = void 0;
@@ -1371,7 +1370,8 @@ var FSWatcher = class extends EventEmitter {
1371
1370
  }
1372
1371
  emitWithAll(event, args) {
1373
1372
  this.emit(event, ...args);
1374
- if (event !== EVENTS.ERROR) this.emit(EVENTS.ALL, event, ...args);
1373
+ if (event !== EVENTS.ERROR)
1374
+ this.emit(EVENTS.ALL, event, ...args);
1375
1375
  }
1376
1376
  // Common helpers
1377
1377
  // --------------
@@ -1384,14 +1384,16 @@ var FSWatcher = class extends EventEmitter {
1384
1384
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
1385
1385
  */
1386
1386
  async _emit(event, path, stats) {
1387
- if (this.closed) return;
1387
+ if (this.closed)
1388
+ return;
1388
1389
  const opts = this.options;
1389
- if (isWindows) path = sysPath2.normalize(path);
1390
- if (opts.cwd) path = sysPath2.relative(opts.cwd, path);
1391
- const args = [
1392
- path
1393
- ];
1394
- if (stats != null) args.push(stats);
1390
+ if (isWindows)
1391
+ path = sysPath2.normalize(path);
1392
+ if (opts.cwd)
1393
+ path = sysPath2.relative(opts.cwd, path);
1394
+ const args = [path];
1395
+ if (stats != null)
1396
+ args.push(stats);
1395
1397
  const awf = opts.awaitWriteFinish;
1396
1398
  let pw;
1397
1399
  if (awf && (pw = this._pendingWrites.get(path))) {
@@ -1400,10 +1402,7 @@ var FSWatcher = class extends EventEmitter {
1400
1402
  }
1401
1403
  if (opts.atomic) {
1402
1404
  if (event === EVENTS.UNLINK) {
1403
- this._pendingUnlinks.set(path, [
1404
- event,
1405
- ...args
1406
- ]);
1405
+ this._pendingUnlinks.set(path, [event, ...args]);
1407
1406
  setTimeout(() => {
1408
1407
  this._pendingUnlinks.forEach((entry, path2) => {
1409
1408
  this.emit(...entry);
@@ -1419,7 +1418,7 @@ var FSWatcher = class extends EventEmitter {
1419
1418
  }
1420
1419
  }
1421
1420
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
1422
- const awfEmit = /* @__PURE__ */ __name((err, stats2) => {
1421
+ const awfEmit = (err, stats2) => {
1423
1422
  if (err) {
1424
1423
  event = EVENTS.ERROR;
1425
1424
  args[0] = err;
@@ -1432,13 +1431,14 @@ var FSWatcher = class extends EventEmitter {
1432
1431
  }
1433
1432
  this.emitWithAll(event, args);
1434
1433
  }
1435
- }, "awfEmit");
1434
+ };
1436
1435
  this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
1437
1436
  return this;
1438
1437
  }
1439
1438
  if (event === EVENTS.CHANGE) {
1440
1439
  const isThrottled = !this._throttle(EVENTS.CHANGE, path, 50);
1441
- if (isThrottled) return this;
1440
+ if (isThrottled)
1441
+ return this;
1442
1442
  }
1443
1443
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
1444
1444
  const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path) : path;
@@ -1447,7 +1447,8 @@ var FSWatcher = class extends EventEmitter {
1447
1447
  stats2 = await stat3(fullPath);
1448
1448
  } catch (err) {
1449
1449
  }
1450
- if (!stats2 || this.closed) return;
1450
+ if (!stats2 || this.closed)
1451
+ return;
1451
1452
  args.push(stats2);
1452
1453
  }
1453
1454
  this.emitWithAll(event, args);
@@ -1476,27 +1477,25 @@ var FSWatcher = class extends EventEmitter {
1476
1477
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
1477
1478
  }
1478
1479
  const action = this._throttled.get(actionType);
1479
- if (!action) throw new Error("invalid throttle");
1480
+ if (!action)
1481
+ throw new Error("invalid throttle");
1480
1482
  const actionPath = action.get(path);
1481
1483
  if (actionPath) {
1482
1484
  actionPath.count++;
1483
1485
  return false;
1484
1486
  }
1485
1487
  let timeoutObject;
1486
- const clear = /* @__PURE__ */ __name(() => {
1488
+ const clear = () => {
1487
1489
  const item = action.get(path);
1488
1490
  const count = item ? item.count : 0;
1489
1491
  action.delete(path);
1490
1492
  clearTimeout(timeoutObject);
1491
- if (item) clearTimeout(item.timeoutObject);
1493
+ if (item)
1494
+ clearTimeout(item.timeoutObject);
1492
1495
  return count;
1493
- }, "clear");
1494
- timeoutObject = setTimeout(clear, timeout);
1495
- const thr = {
1496
- timeoutObject,
1497
- clear,
1498
- count: 0
1499
1496
  };
1497
+ timeoutObject = setTimeout(clear, timeout);
1498
+ const thr = { timeoutObject, clear, count: 0 };
1500
1499
  action.set(path, thr);
1501
1500
  return thr;
1502
1501
  }
@@ -1513,7 +1512,8 @@ var FSWatcher = class extends EventEmitter {
1513
1512
  */
1514
1513
  _awaitWriteFinish(path, threshold, event, awfEmit) {
1515
1514
  const awf = this.options.awaitWriteFinish;
1516
- if (typeof awf !== "object") return;
1515
+ if (typeof awf !== "object")
1516
+ return;
1517
1517
  const pollInterval = awf.pollInterval;
1518
1518
  let timeoutHandler;
1519
1519
  let fullPath = path;
@@ -1525,7 +1525,8 @@ var FSWatcher = class extends EventEmitter {
1525
1525
  function awaitWriteFinishFn(prevStat) {
1526
1526
  statcb(fullPath, (err, curStat) => {
1527
1527
  if (err || !writes.has(path)) {
1528
- if (err && err.code !== "ENOENT") awfEmit(err);
1528
+ if (err && err.code !== "ENOENT")
1529
+ awfEmit(err);
1529
1530
  return;
1530
1531
  }
1531
1532
  const now2 = Number(/* @__PURE__ */ new Date());
@@ -1542,15 +1543,14 @@ var FSWatcher = class extends EventEmitter {
1542
1543
  }
1543
1544
  });
1544
1545
  }
1545
- __name(awaitWriteFinishFn, "awaitWriteFinishFn");
1546
1546
  if (!writes.has(path)) {
1547
1547
  writes.set(path, {
1548
1548
  lastChange: now,
1549
- cancelWait: /* @__PURE__ */ __name(() => {
1549
+ cancelWait: () => {
1550
1550
  writes.delete(path);
1551
1551
  clearTimeout(timeoutHandler);
1552
1552
  return event;
1553
- }, "cancelWait")
1553
+ }
1554
1554
  });
1555
1555
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
1556
1556
  }
@@ -1559,18 +1559,14 @@ var FSWatcher = class extends EventEmitter {
1559
1559
  * Determines whether user has asked to ignore this path.
1560
1560
  */
1561
1561
  _isIgnored(path, stats) {
1562
- if (this.options.atomic && DOT_RE.test(path)) return true;
1562
+ if (this.options.atomic && DOT_RE.test(path))
1563
+ return true;
1563
1564
  if (!this._userIgnored) {
1564
1565
  const { cwd } = this.options;
1565
1566
  const ign = this.options.ignored;
1566
1567
  const ignored = (ign || []).map(normalizeIgnored(cwd));
1567
- const ignoredPaths = [
1568
- ...this._ignoredPaths
1569
- ];
1570
- const list = [
1571
- ...ignoredPaths.map(normalizeIgnored(cwd)),
1572
- ...ignored
1573
- ];
1568
+ const ignoredPaths = [...this._ignoredPaths];
1569
+ const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
1574
1570
  this._userIgnored = anymatch(list, void 0);
1575
1571
  }
1576
1572
  return this._userIgnored(path, stats);
@@ -1593,7 +1589,8 @@ var FSWatcher = class extends EventEmitter {
1593
1589
  */
1594
1590
  _getWatchedDir(directory) {
1595
1591
  const dir = sysPath2.resolve(directory);
1596
- if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
1592
+ if (!this._watched.has(dir))
1593
+ this._watched.set(dir, new DirEntry(dir, this._boundRemove));
1597
1594
  return this._watched.get(dir);
1598
1595
  }
1599
1596
  // File helpers
@@ -1602,7 +1599,8 @@ var FSWatcher = class extends EventEmitter {
1602
1599
  * Check for read permissions: https://stackoverflow.com/a/11781404/1358405
1603
1600
  */
1604
1601
  _hasReadPermissions(stats) {
1605
- if (this.options.ignorePermissionErrors) return true;
1602
+ if (this.options.ignorePermissionErrors)
1603
+ return true;
1606
1604
  return Boolean(Number(stats.mode) & 256);
1607
1605
  }
1608
1606
  /**
@@ -1616,7 +1614,8 @@ var FSWatcher = class extends EventEmitter {
1616
1614
  const path = sysPath2.join(directory, item);
1617
1615
  const fullPath = sysPath2.resolve(path);
1618
1616
  isDirectory = isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
1619
- if (!this._throttle("remove", path, 100)) return;
1617
+ if (!this._throttle("remove", path, 100))
1618
+ return;
1620
1619
  if (!isDirectory && this._watched.size === 1) {
1621
1620
  this.add(directory, item, true);
1622
1621
  }
@@ -1630,15 +1629,18 @@ var FSWatcher = class extends EventEmitter {
1630
1629
  this._symlinkPaths.delete(fullPath);
1631
1630
  }
1632
1631
  let relPath = path;
1633
- if (this.options.cwd) relPath = sysPath2.relative(this.options.cwd, path);
1632
+ if (this.options.cwd)
1633
+ relPath = sysPath2.relative(this.options.cwd, path);
1634
1634
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
1635
1635
  const event = this._pendingWrites.get(relPath).cancelWait();
1636
- if (event === EVENTS.ADD) return;
1636
+ if (event === EVENTS.ADD)
1637
+ return;
1637
1638
  }
1638
1639
  this._watched.delete(path);
1639
1640
  this._watched.delete(fullPath);
1640
1641
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
1641
- if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
1642
+ if (wasTracked && !this._isIgnored(path))
1643
+ this._emit(eventName, path);
1642
1644
  this._closePath(path);
1643
1645
  }
1644
1646
  /**
@@ -1654,12 +1656,14 @@ var FSWatcher = class extends EventEmitter {
1654
1656
  */
1655
1657
  _closeFile(path) {
1656
1658
  const closers = this._closers.get(path);
1657
- if (!closers) return;
1659
+ if (!closers)
1660
+ return;
1658
1661
  closers.forEach((closer) => closer());
1659
1662
  this._closers.delete(path);
1660
1663
  }
1661
1664
  _addPathCloser(path, closer) {
1662
- if (!closer) return;
1665
+ if (!closer)
1666
+ return;
1663
1667
  let list = this._closers.get(path);
1664
1668
  if (!list) {
1665
1669
  list = [];
@@ -1668,14 +1672,9 @@ var FSWatcher = class extends EventEmitter {
1668
1672
  list.push(closer);
1669
1673
  }
1670
1674
  _readdirp(root, opts) {
1671
- if (this.closed) return;
1672
- const options = {
1673
- type: EVENTS.ALL,
1674
- alwaysStat: true,
1675
- lstat: true,
1676
- ...opts,
1677
- depth: 0
1678
- };
1675
+ if (this.closed)
1676
+ return;
1677
+ const options = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
1679
1678
  let stream = readdirp(root, options);
1680
1679
  this._streams.add(stream);
1681
1680
  stream.once(STR_CLOSE, () => {
@@ -1695,11 +1694,7 @@ function watch(paths, options = {}) {
1695
1694
  watcher.add(paths);
1696
1695
  return watcher;
1697
1696
  }
1698
- __name(watch, "watch");
1699
- var esm_default = {
1700
- watch,
1701
- FSWatcher
1702
- };
1697
+ var esm_default = { watch, FSWatcher };
1703
1698
  export {
1704
1699
  FSWatcher,
1705
1700
  WatchHelper,