@bleedingdev/modern-js-utils 3.2.0-ultramodern.5 → 3.2.0-ultramodern.9

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 (271) hide show
  1. package/dist/types/cli/alias.d.ts +20 -0
  2. package/dist/types/cli/applyOptionsChain.d.ts +3 -0
  3. package/dist/types/cli/commands.d.ts +8 -0
  4. package/dist/types/cli/common.d.ts +9 -0
  5. package/dist/types/cli/config.d.ts +4 -0
  6. package/dist/types/cli/constants.d.ts +55 -0
  7. package/dist/types/cli/ensure.d.ts +8 -0
  8. package/dist/types/cli/fs.d.ts +7 -0
  9. package/dist/types/cli/get/config.d.ts +1 -0
  10. package/dist/types/cli/get/data.d.ts +6 -0
  11. package/dist/types/cli/get/index.d.ts +11 -0
  12. package/dist/types/cli/index.d.ts +23 -0
  13. package/dist/types/cli/is/config.d.ts +22 -0
  14. package/dist/types/cli/is/env.d.ts +8 -0
  15. package/dist/types/cli/is/index.d.ts +4 -0
  16. package/dist/types/cli/is/project.d.ts +39 -0
  17. package/dist/types/cli/is/type.d.ts +15 -0
  18. package/dist/types/cli/logger.d.ts +1 -0
  19. package/dist/types/cli/modulePath.d.ts +5 -0
  20. package/dist/types/cli/monorepo.d.ts +9 -0
  21. package/dist/types/cli/package.d.ts +5 -0
  22. package/dist/types/cli/path.d.ts +11 -0
  23. package/dist/types/cli/port.d.ts +12 -0
  24. package/dist/types/cli/prettyInstructions.d.ts +6 -0
  25. package/dist/types/cli/require.d.ts +9 -0
  26. package/dist/types/cli/route.d.ts +4 -0
  27. package/dist/types/cli/runtimeExports.d.ts +5 -0
  28. package/dist/types/cli/tsconfig.d.ts +1 -0
  29. package/dist/types/cli/version.d.ts +4 -0
  30. package/dist/types/cli/watch.d.ts +8 -0
  31. package/dist/types/compiled.d.ts +37 -0
  32. package/dist/types/import.d.ts +5 -0
  33. package/dist/types/index.d.ts +3 -0
  34. package/dist/types/universal/constants.d.ts +47 -0
  35. package/dist/types/universal/index.d.ts +1 -0
  36. package/dist/types/universal/path.d.ts +1 -0
  37. package/dist/types/universal/pluginDagSort.d.ts +1 -0
  38. package/package.json +2 -2
  39. package/dist/compiled/address/index.js +0 -171
  40. package/dist/compiled/address/lib/address.d.ts +0 -28
  41. package/dist/compiled/address/package.json +0 -1
  42. package/dist/compiled/browserslist/index.d.ts +0 -178
  43. package/dist/compiled/browserslist/index.js +0 -1329
  44. package/dist/compiled/browserslist/license +0 -20
  45. package/dist/compiled/browserslist/package.json +0 -1
  46. package/dist/compiled/chalk/index.d.ts +0 -415
  47. package/dist/compiled/chalk/index.js +0 -2368
  48. package/dist/compiled/chalk/license +0 -9
  49. package/dist/compiled/chalk/package.json +0 -1
  50. package/dist/compiled/chokidar/anymatch/index.d.ts +0 -19
  51. package/dist/compiled/chokidar/fsevents.node +0 -0
  52. package/dist/compiled/chokidar/index.js +0 -4162
  53. package/dist/compiled/chokidar/index.js.LICENSE.txt +0 -41
  54. package/dist/compiled/chokidar/license +0 -21
  55. package/dist/compiled/chokidar/package.json +0 -1
  56. package/dist/compiled/chokidar/types/index.d.ts +0 -188
  57. package/dist/compiled/commander/index.js +0 -1540
  58. package/dist/compiled/commander/index.mjs +0 -2
  59. package/dist/compiled/commander/license +0 -22
  60. package/dist/compiled/commander/package.json +0 -1
  61. package/dist/compiled/commander/typings/index.d.ts +0 -890
  62. package/dist/compiled/debug/index.d.ts +0 -54
  63. package/dist/compiled/debug/index.js +0 -621
  64. package/dist/compiled/debug/license +0 -20
  65. package/dist/compiled/debug/ms/index.d.ts +0 -25
  66. package/dist/compiled/debug/package.json +0 -1
  67. package/dist/compiled/dotenv/index.js +0 -101
  68. package/dist/compiled/dotenv/license +0 -23
  69. package/dist/compiled/dotenv/package.json +0 -1
  70. package/dist/compiled/dotenv/types/index.d.ts +0 -59
  71. package/dist/compiled/dotenv-expand/index.d.ts +0 -15
  72. package/dist/compiled/dotenv-expand/index.js +0 -54
  73. package/dist/compiled/dotenv-expand/license +0 -24
  74. package/dist/compiled/dotenv-expand/package.json +0 -1
  75. package/dist/compiled/execa/index.d.ts +0 -564
  76. package/dist/compiled/execa/index.js +0 -1738
  77. package/dist/compiled/execa/license +0 -9
  78. package/dist/compiled/execa/package.json +0 -1
  79. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
  80. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +0 -12
  81. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
  82. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +0 -20
  83. package/dist/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
  84. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
  85. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +0 -12
  86. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
  87. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +0 -16
  88. package/dist/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +0 -4
  89. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +0 -14
  90. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
  91. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
  92. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
  93. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +0 -30
  94. package/dist/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +0 -8
  95. package/dist/compiled/fast-glob/index.js +0 -4665
  96. package/dist/compiled/fast-glob/index.js.LICENSE.txt +0 -38
  97. package/dist/compiled/fast-glob/license +0 -21
  98. package/dist/compiled/fast-glob/out/index.d.ts +0 -27
  99. package/dist/compiled/fast-glob/out/managers/tasks.d.ts +0 -22
  100. package/dist/compiled/fast-glob/out/settings.d.ts +0 -164
  101. package/dist/compiled/fast-glob/out/types/index.d.ts +0 -31
  102. package/dist/compiled/fast-glob/package.json +0 -1
  103. package/dist/compiled/filesize/filesize.d.ts +0 -131
  104. package/dist/compiled/filesize/index.js +0 -198
  105. package/dist/compiled/filesize/index.js.LICENSE.txt +0 -7
  106. package/dist/compiled/filesize/license +0 -28
  107. package/dist/compiled/filesize/package.json +0 -1
  108. package/dist/compiled/fs-extra/index.d.ts +0 -563
  109. package/dist/compiled/fs-extra/index.js +0 -2222
  110. package/dist/compiled/fs-extra/license +0 -15
  111. package/dist/compiled/fs-extra/package.json +0 -1
  112. package/dist/compiled/glob/index.d.ts +0 -91
  113. package/dist/compiled/glob/index.js +0 -2011
  114. package/dist/compiled/glob/license +0 -21
  115. package/dist/compiled/glob/minimatch/index.d.ts +0 -204
  116. package/dist/compiled/glob/package.json +0 -1
  117. package/dist/compiled/globby/index.d.ts +0 -186
  118. package/dist/compiled/globby/index.js +0 -690
  119. package/dist/compiled/globby/license +0 -9
  120. package/dist/compiled/globby/package.json +0 -1
  121. package/dist/compiled/gzip-size/index.d.ts +0 -96
  122. package/dist/compiled/gzip-size/index.js +0 -157
  123. package/dist/compiled/gzip-size/license +0 -9
  124. package/dist/compiled/gzip-size/package.json +0 -1
  125. package/dist/compiled/import-lazy/index.d.ts +0 -26
  126. package/dist/compiled/import-lazy/index.js +0 -45
  127. package/dist/compiled/import-lazy/license +0 -9
  128. package/dist/compiled/import-lazy/package.json +0 -1
  129. package/dist/compiled/inquirer/index.d.ts +0 -997
  130. package/dist/compiled/inquirer/index.js +0 -20167
  131. package/dist/compiled/inquirer/index.js.LICENSE.txt +0 -7
  132. package/dist/compiled/inquirer/lib/objects/choice.d.ts +0 -65
  133. package/dist/compiled/inquirer/lib/objects/choices.d.ts +0 -206
  134. package/dist/compiled/inquirer/lib/objects/separator.d.ts +0 -37
  135. package/dist/compiled/inquirer/lib/ui/baseUI.d.ts +0 -37
  136. package/dist/compiled/inquirer/lib/ui/bottom-bar.d.ts +0 -65
  137. package/dist/compiled/inquirer/lib/ui/prompt.d.ts +0 -104
  138. package/dist/compiled/inquirer/license +0 -22
  139. package/dist/compiled/inquirer/package.json +0 -1
  140. package/dist/compiled/inquirer/through/index.d.ts +0 -25
  141. package/dist/compiled/js-yaml/index.d.ts +0 -154
  142. package/dist/compiled/js-yaml/index.js +0 -2191
  143. package/dist/compiled/js-yaml/index.mjs +0 -2167
  144. package/dist/compiled/js-yaml/index.mjs.LICENSE.txt +0 -1
  145. package/dist/compiled/js-yaml/license +0 -21
  146. package/dist/compiled/js-yaml/package.json +0 -1
  147. package/dist/compiled/json5/index.js +0 -983
  148. package/dist/compiled/json5/lib/index.d.ts +0 -4
  149. package/dist/compiled/json5/lib/parse.d.ts +0 -15
  150. package/dist/compiled/json5/lib/stringify.d.ts +0 -89
  151. package/dist/compiled/json5/package.json +0 -1
  152. package/dist/compiled/lodash/common/array.d.ts +0 -2126
  153. package/dist/compiled/lodash/common/collection.d.ts +0 -1930
  154. package/dist/compiled/lodash/common/common.d.ts +0 -280
  155. package/dist/compiled/lodash/common/date.d.ts +0 -23
  156. package/dist/compiled/lodash/common/function.d.ts +0 -1446
  157. package/dist/compiled/lodash/common/lang.d.ts +0 -1693
  158. package/dist/compiled/lodash/common/math.d.ts +0 -405
  159. package/dist/compiled/lodash/common/number.d.ts +0 -131
  160. package/dist/compiled/lodash/common/object.d.ts +0 -2519
  161. package/dist/compiled/lodash/common/seq.d.ts +0 -210
  162. package/dist/compiled/lodash/common/string.d.ts +0 -788
  163. package/dist/compiled/lodash/common/util.d.ts +0 -1220
  164. package/dist/compiled/lodash/index.d.ts +0 -46
  165. package/dist/compiled/lodash/index.js +0 -1
  166. package/dist/compiled/lodash/index.mjs +0 -1
  167. package/dist/compiled/lodash/license +0 -47
  168. package/dist/compiled/lodash/package.json +0 -1
  169. package/dist/compiled/mime-types/index.d.ts +0 -14
  170. package/dist/compiled/mime-types/index.js +0 -116
  171. package/dist/compiled/mime-types/index.js.LICENSE.txt +0 -13
  172. package/dist/compiled/mime-types/license +0 -23
  173. package/dist/compiled/mime-types/package.json +0 -1
  174. package/dist/compiled/minimist/index.d.ts +0 -95
  175. package/dist/compiled/minimist/index.js +0 -202
  176. package/dist/compiled/minimist/license +0 -18
  177. package/dist/compiled/minimist/package.json +0 -1
  178. package/dist/compiled/nanoid/index.d.ts +0 -91
  179. package/dist/compiled/nanoid/index.js +0 -83
  180. package/dist/compiled/nanoid/index.mjs +0 -69
  181. package/dist/compiled/nanoid/license +0 -20
  182. package/dist/compiled/nanoid/package.json +0 -1
  183. package/dist/compiled/ora/cli-spinners/index.d.ts +0 -125
  184. package/dist/compiled/ora/index.d.ts +0 -277
  185. package/dist/compiled/ora/index.js +0 -3936
  186. package/dist/compiled/ora/index.js.LICENSE.txt +0 -1
  187. package/dist/compiled/ora/license +0 -9
  188. package/dist/compiled/ora/package.json +0 -1
  189. package/dist/compiled/pkg-up/index.d.ts +0 -48
  190. package/dist/compiled/pkg-up/index.js +0 -15
  191. package/dist/compiled/pkg-up/license +0 -9
  192. package/dist/compiled/pkg-up/package.json +0 -1
  193. package/dist/compiled/semver/classes/comparator.d.ts +0 -17
  194. package/dist/compiled/semver/classes/range.d.ts +0 -21
  195. package/dist/compiled/semver/classes/semver.d.ts +0 -62
  196. package/dist/compiled/semver/functions/clean.d.ts +0 -8
  197. package/dist/compiled/semver/functions/cmp.d.ts +0 -16
  198. package/dist/compiled/semver/functions/coerce.d.ts +0 -12
  199. package/dist/compiled/semver/functions/compare-build.d.ts +0 -16
  200. package/dist/compiled/semver/functions/compare-loose.d.ts +0 -5
  201. package/dist/compiled/semver/functions/compare.d.ts +0 -20
  202. package/dist/compiled/semver/functions/diff.d.ts +0 -13
  203. package/dist/compiled/semver/functions/eq.d.ts +0 -9
  204. package/dist/compiled/semver/functions/gt.d.ts +0 -9
  205. package/dist/compiled/semver/functions/gte.d.ts +0 -9
  206. package/dist/compiled/semver/functions/inc.d.ts +0 -15
  207. package/dist/compiled/semver/functions/lt.d.ts +0 -9
  208. package/dist/compiled/semver/functions/lte.d.ts +0 -8
  209. package/dist/compiled/semver/functions/major.d.ts +0 -9
  210. package/dist/compiled/semver/functions/minor.d.ts +0 -9
  211. package/dist/compiled/semver/functions/neq.d.ts +0 -9
  212. package/dist/compiled/semver/functions/parse.d.ts +0 -12
  213. package/dist/compiled/semver/functions/patch.d.ts +0 -9
  214. package/dist/compiled/semver/functions/prerelease.d.ts +0 -12
  215. package/dist/compiled/semver/functions/rcompare.d.ts +0 -15
  216. package/dist/compiled/semver/functions/rsort.d.ts +0 -9
  217. package/dist/compiled/semver/functions/satisfies.d.ts +0 -14
  218. package/dist/compiled/semver/functions/sort.d.ts +0 -9
  219. package/dist/compiled/semver/functions/valid.d.ts +0 -11
  220. package/dist/compiled/semver/index.d.ts +0 -133
  221. package/dist/compiled/semver/index.js +0 -1779
  222. package/dist/compiled/semver/internals/identifiers.d.ts +0 -13
  223. package/dist/compiled/semver/license +0 -15
  224. package/dist/compiled/semver/package.json +0 -1
  225. package/dist/compiled/semver/ranges/gtr.d.ts +0 -14
  226. package/dist/compiled/semver/ranges/intersects.d.ts +0 -13
  227. package/dist/compiled/semver/ranges/ltr.d.ts +0 -14
  228. package/dist/compiled/semver/ranges/max-satisfying.d.ts +0 -14
  229. package/dist/compiled/semver/ranges/min-satisfying.d.ts +0 -14
  230. package/dist/compiled/semver/ranges/min-version.d.ts +0 -10
  231. package/dist/compiled/semver/ranges/outside.d.ts +0 -15
  232. package/dist/compiled/semver/ranges/simplify.d.ts +0 -14
  233. package/dist/compiled/semver/ranges/subset.d.ts +0 -13
  234. package/dist/compiled/semver/ranges/to-comparators.d.ts +0 -9
  235. package/dist/compiled/semver/ranges/valid.d.ts +0 -12
  236. package/dist/compiled/signale/index.d.ts +0 -162
  237. package/dist/compiled/signale/index.js +0 -1704
  238. package/dist/compiled/signale/package.json +0 -1
  239. package/dist/compiled/slash/index.d.ts +0 -25
  240. package/dist/compiled/slash/index.js +0 -32
  241. package/dist/compiled/slash/license +0 -9
  242. package/dist/compiled/slash/package.json +0 -1
  243. package/dist/compiled/strip-ansi/index.d.ts +0 -17
  244. package/dist/compiled/strip-ansi/index.js +0 -34
  245. package/dist/compiled/strip-ansi/license +0 -9
  246. package/dist/compiled/strip-ansi/package.json +0 -1
  247. package/dist/compiled/tsconfig-paths/index.js +0 -629
  248. package/dist/compiled/tsconfig-paths/index.mjs +0 -2
  249. package/dist/compiled/tsconfig-paths/lib/config-loader.d.ts +0 -33
  250. package/dist/compiled/tsconfig-paths/lib/filesystem.d.ts +0 -34
  251. package/dist/compiled/tsconfig-paths/lib/index.d.ts +0 -5
  252. package/dist/compiled/tsconfig-paths/lib/mapping-entry.d.ts +0 -18
  253. package/dist/compiled/tsconfig-paths/lib/match-path-async.d.ts +0 -21
  254. package/dist/compiled/tsconfig-paths/lib/match-path-sync.d.ts +0 -32
  255. package/dist/compiled/tsconfig-paths/lib/register.d.ts +0 -12
  256. package/dist/compiled/tsconfig-paths/lib/try-path.d.ts +0 -15
  257. package/dist/compiled/tsconfig-paths/lib/tsconfig-loader.d.ts +0 -28
  258. package/dist/compiled/tsconfig-paths/license +0 -21
  259. package/dist/compiled/tsconfig-paths/package.json +0 -1
  260. package/dist/compiled/upath/index.js +0 -135
  261. package/dist/compiled/upath/license +0 -22
  262. package/dist/compiled/upath/package.json +0 -1
  263. package/dist/compiled/upath/upath.d.ts +0 -241
  264. package/dist/compiled/url-join/index.d.ts +0 -17
  265. package/dist/compiled/url-join/index.js +0 -61
  266. package/dist/compiled/url-join/license +0 -21
  267. package/dist/compiled/url-join/package.json +0 -1
  268. package/dist/compiled/webpack-chain/index.js +0 -1475
  269. package/dist/compiled/webpack-chain/license +0 -373
  270. package/dist/compiled/webpack-chain/package.json +0 -1
  271. package/dist/compiled/webpack-chain/types/index.d.ts +0 -599
@@ -1,4162 +0,0 @@
1
- /*! LICENSE: index.js.LICENSE.txt */
2
- (()=>{
3
- var t = {
4
- 372: (t, e, s)=>{
5
- "use strict";
6
- Object.defineProperty(e, "__esModule", {
7
- value: true
8
- });
9
- const r = s(700);
10
- const i = s(498);
11
- const n = "!";
12
- const o = {
13
- returnIndex: false
14
- };
15
- const arrify = (t)=>Array.isArray(t) ? t : [
16
- t
17
- ];
18
- const createPattern = (t, e)=>{
19
- if ("function" == typeof t) return t;
20
- if ("string" == typeof t) {
21
- const s = r(t, e);
22
- return (e)=>t === e || s(e);
23
- }
24
- if (t instanceof RegExp) return (e)=>t.test(e);
25
- return (t)=>false;
26
- };
27
- const matchPatterns = (t, e, s, r)=>{
28
- const n = Array.isArray(s);
29
- const o = n ? s[0] : s;
30
- if (!n && "string" != typeof o) throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(o));
31
- const a = i(o);
32
- for(let t = 0; t < e.length; t++){
33
- const s = e[t];
34
- if (s(a)) return r ? -1 : false;
35
- }
36
- const u = n && [
37
- a
38
- ].concat(s.slice(1));
39
- for(let e = 0; e < t.length; e++){
40
- const s = t[e];
41
- if (n ? s(...u) : s(a)) return r ? e : true;
42
- }
43
- return r ? -1 : false;
44
- };
45
- const anymatch = (t, e, s = o)=>{
46
- if (null == t) throw new TypeError("anymatch: specify first argument");
47
- const i = "boolean" == typeof s ? {
48
- returnIndex: s
49
- } : s;
50
- const a = i.returnIndex || false;
51
- const u = arrify(t);
52
- const l = u.filter((t)=>"string" == typeof t && t.charAt(0) === n).map((t)=>t.slice(1)).map((t)=>r(t, i));
53
- const c = u.filter((t)=>"string" != typeof t || "string" == typeof t && t.charAt(0) !== n).map((t)=>createPattern(t, i));
54
- if (null == e) return (t, e = false)=>{
55
- const s = "boolean" == typeof e ? e : false;
56
- return matchPatterns(c, l, t, s);
57
- };
58
- return matchPatterns(c, l, e, a);
59
- };
60
- anymatch.default = anymatch;
61
- t.exports = anymatch;
62
- },
63
- 828: (t, e, s)=>{
64
- t.exports = s(600);
65
- },
66
- 570: (t, e, s)=>{
67
- "use strict";
68
- const r = s(625);
69
- const i = s(666);
70
- const n = s(183);
71
- const o = s(467);
72
- const braces = (t, e = {})=>{
73
- let s = [];
74
- if (Array.isArray(t)) for (let r of t){
75
- let t = braces.create(r, e);
76
- if (Array.isArray(t)) s.push(...t);
77
- else s.push(t);
78
- }
79
- else s = [].concat(braces.create(t, e));
80
- if (e && true === e.expand && true === e.nodupes) s = [
81
- ...new Set(s)
82
- ];
83
- return s;
84
- };
85
- braces.parse = (t, e = {})=>o(t, e);
86
- braces.stringify = (t, e = {})=>{
87
- if ("string" == typeof t) return r(braces.parse(t, e), e);
88
- return r(t, e);
89
- };
90
- braces.compile = (t, e = {})=>{
91
- if ("string" == typeof t) t = braces.parse(t, e);
92
- return i(t, e);
93
- };
94
- braces.expand = (t, e = {})=>{
95
- if ("string" == typeof t) t = braces.parse(t, e);
96
- let s = n(t, e);
97
- if (true === e.noempty) s = s.filter(Boolean);
98
- if (true === e.nodupes) s = [
99
- ...new Set(s)
100
- ];
101
- return s;
102
- };
103
- braces.create = (t, e = {})=>{
104
- if ("" === t || t.length < 3) return [
105
- t
106
- ];
107
- return true !== e.expand ? braces.compile(t, e) : braces.expand(t, e);
108
- };
109
- t.exports = braces;
110
- },
111
- 666: (t, e, s)=>{
112
- "use strict";
113
- const r = s(442);
114
- const i = s(456);
115
- const compile = (t, e = {})=>{
116
- let walk = (t, s = {})=>{
117
- let n = i.isInvalidBrace(s);
118
- let o = true === t.invalid && true === e.escapeInvalid;
119
- let a = true === n || true === o;
120
- let u = true === e.escapeInvalid ? "\\" : "";
121
- let l = "";
122
- if (true === t.isOpen) return u + t.value;
123
- if (true === t.isClose) return u + t.value;
124
- if ("open" === t.type) return a ? u + t.value : "(";
125
- if ("close" === t.type) return a ? u + t.value : ")";
126
- if ("comma" === t.type) return "comma" === t.prev.type ? "" : a ? t.value : "|";
127
- if (t.value) return t.value;
128
- if (t.nodes && t.ranges > 0) {
129
- let s = i.reduce(t.nodes);
130
- let n = r(...s, {
131
- ...e,
132
- wrap: false,
133
- toRegex: true
134
- });
135
- if (0 !== n.length) return s.length > 1 && n.length > 1 ? `(${n})` : n;
136
- }
137
- if (t.nodes) for (let e of t.nodes)l += walk(e, t);
138
- return l;
139
- };
140
- return walk(t);
141
- };
142
- t.exports = compile;
143
- },
144
- 487: (t)=>{
145
- "use strict";
146
- t.exports = {
147
- MAX_LENGTH: 65536,
148
- CHAR_0: "0",
149
- CHAR_9: "9",
150
- CHAR_UPPERCASE_A: "A",
151
- CHAR_LOWERCASE_A: "a",
152
- CHAR_UPPERCASE_Z: "Z",
153
- CHAR_LOWERCASE_Z: "z",
154
- CHAR_LEFT_PARENTHESES: "(",
155
- CHAR_RIGHT_PARENTHESES: ")",
156
- CHAR_ASTERISK: "*",
157
- CHAR_AMPERSAND: "&",
158
- CHAR_AT: "@",
159
- CHAR_BACKSLASH: "\\",
160
- CHAR_BACKTICK: "`",
161
- CHAR_CARRIAGE_RETURN: "\r",
162
- CHAR_CIRCUMFLEX_ACCENT: "^",
163
- CHAR_COLON: ":",
164
- CHAR_COMMA: ",",
165
- CHAR_DOLLAR: "$",
166
- CHAR_DOT: ".",
167
- CHAR_DOUBLE_QUOTE: '"',
168
- CHAR_EQUAL: "=",
169
- CHAR_EXCLAMATION_MARK: "!",
170
- CHAR_FORM_FEED: "\f",
171
- CHAR_FORWARD_SLASH: "/",
172
- CHAR_HASH: "#",
173
- CHAR_HYPHEN_MINUS: "-",
174
- CHAR_LEFT_ANGLE_BRACKET: "<",
175
- CHAR_LEFT_CURLY_BRACE: "{",
176
- CHAR_LEFT_SQUARE_BRACKET: "[",
177
- CHAR_LINE_FEED: "\n",
178
- CHAR_NO_BREAK_SPACE: " ",
179
- CHAR_PERCENT: "%",
180
- CHAR_PLUS: "+",
181
- CHAR_QUESTION_MARK: "?",
182
- CHAR_RIGHT_ANGLE_BRACKET: ">",
183
- CHAR_RIGHT_CURLY_BRACE: "}",
184
- CHAR_RIGHT_SQUARE_BRACKET: "]",
185
- CHAR_SEMICOLON: ";",
186
- CHAR_SINGLE_QUOTE: "'",
187
- CHAR_SPACE: " ",
188
- CHAR_TAB: "\t",
189
- CHAR_UNDERSCORE: "_",
190
- CHAR_VERTICAL_LINE: "|",
191
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\ufeff"
192
- };
193
- },
194
- 183: (t, e, s)=>{
195
- "use strict";
196
- const r = s(442);
197
- const i = s(625);
198
- const n = s(456);
199
- const append = (t = "", e = "", s = false)=>{
200
- let r = [];
201
- t = [].concat(t);
202
- e = [].concat(e);
203
- if (!e.length) return t;
204
- if (!t.length) return s ? n.flatten(e).map((t)=>`{${t}}`) : e;
205
- for (let i of t)if (Array.isArray(i)) for (let t of i)r.push(append(t, e, s));
206
- else for (let t of e){
207
- if (true === s && "string" == typeof t) t = `{${t}}`;
208
- r.push(Array.isArray(t) ? append(i, t, s) : i + t);
209
- }
210
- return n.flatten(r);
211
- };
212
- const expand = (t, e = {})=>{
213
- let s = void 0 === e.rangeLimit ? 1e3 : e.rangeLimit;
214
- let walk = (t, o = {})=>{
215
- t.queue = [];
216
- let a = o;
217
- let u = o.queue;
218
- while("brace" !== a.type && "root" !== a.type && a.parent){
219
- a = a.parent;
220
- u = a.queue;
221
- }
222
- if (t.invalid || t.dollar) return void u.push(append(u.pop(), i(t, e)));
223
- if ("brace" === t.type && true !== t.invalid && 2 === t.nodes.length) return void u.push(append(u.pop(), [
224
- "{}"
225
- ]));
226
- if (t.nodes && t.ranges > 0) {
227
- let o = n.reduce(t.nodes);
228
- if (n.exceedsLimit(...o, e.step, s)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
229
- let a = r(...o, e);
230
- if (0 === a.length) a = i(t, e);
231
- u.push(append(u.pop(), a));
232
- t.nodes = [];
233
- return;
234
- }
235
- let l = n.encloseBrace(t);
236
- let c = t.queue;
237
- let f = t;
238
- while("brace" !== f.type && "root" !== f.type && f.parent){
239
- f = f.parent;
240
- c = f.queue;
241
- }
242
- for(let e = 0; e < t.nodes.length; e++){
243
- let s = t.nodes[e];
244
- if ("comma" === s.type && "brace" === t.type) {
245
- if (1 === e) c.push("");
246
- c.push("");
247
- continue;
248
- }
249
- if ("close" === s.type) {
250
- u.push(append(u.pop(), c, l));
251
- continue;
252
- }
253
- if (s.value && "open" !== s.type) {
254
- c.push(append(c.pop(), s.value));
255
- continue;
256
- }
257
- if (s.nodes) walk(s, t);
258
- }
259
- return c;
260
- };
261
- return n.flatten(walk(t));
262
- };
263
- t.exports = expand;
264
- },
265
- 467: (t, e, s)=>{
266
- "use strict";
267
- const r = s(625);
268
- const { MAX_LENGTH: i, CHAR_BACKSLASH: n, CHAR_BACKTICK: o, CHAR_COMMA: a, CHAR_DOT: u, CHAR_LEFT_PARENTHESES: l, CHAR_RIGHT_PARENTHESES: c, CHAR_LEFT_CURLY_BRACE: f, CHAR_RIGHT_CURLY_BRACE: h, CHAR_LEFT_SQUARE_BRACKET: p, CHAR_RIGHT_SQUARE_BRACKET: d, CHAR_DOUBLE_QUOTE: _, CHAR_SINGLE_QUOTE: E, CHAR_NO_BREAK_SPACE: g, CHAR_ZERO_WIDTH_NOBREAK_SPACE: m } = s(487);
269
- const parse = (t, e = {})=>{
270
- if ("string" != typeof t) throw new TypeError("Expected a string");
271
- let s = e || {};
272
- let y = "number" == typeof s.maxLength ? Math.min(i, s.maxLength) : i;
273
- if (t.length > y) throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${y})`);
274
- let R = {
275
- type: "root",
276
- input: t,
277
- nodes: []
278
- };
279
- let w = [
280
- R
281
- ];
282
- let A = R;
283
- let b = R;
284
- let v = 0;
285
- let S = t.length;
286
- let C = 0;
287
- let x = 0;
288
- let T;
289
- const advance = ()=>t[C++];
290
- const push = (t)=>{
291
- if ("text" === t.type && "dot" === b.type) b.type = "text";
292
- if (b && "text" === b.type && "text" === t.type) {
293
- b.value += t.value;
294
- return;
295
- }
296
- A.nodes.push(t);
297
- t.parent = A;
298
- t.prev = b;
299
- b = t;
300
- return t;
301
- };
302
- push({
303
- type: "bos"
304
- });
305
- while(C < S){
306
- A = w[w.length - 1];
307
- T = advance();
308
- if (T === m || T === g) continue;
309
- if (T === n) {
310
- push({
311
- type: "text",
312
- value: (e.keepEscaping ? T : "") + advance()
313
- });
314
- continue;
315
- }
316
- if (T === d) {
317
- push({
318
- type: "text",
319
- value: "\\" + T
320
- });
321
- continue;
322
- }
323
- if (T === p) {
324
- v++;
325
- let e;
326
- while(C < S && (e = advance())){
327
- T += e;
328
- if (e === p) {
329
- v++;
330
- continue;
331
- }
332
- if (e === n) {
333
- T += advance();
334
- continue;
335
- }
336
- if (e === d) {
337
- v--;
338
- if (0 === v) break;
339
- }
340
- }
341
- push({
342
- type: "text",
343
- value: T
344
- });
345
- continue;
346
- }
347
- if (T === l) {
348
- A = push({
349
- type: "paren",
350
- nodes: []
351
- });
352
- w.push(A);
353
- push({
354
- type: "text",
355
- value: T
356
- });
357
- continue;
358
- }
359
- if (T === c) {
360
- if ("paren" !== A.type) {
361
- push({
362
- type: "text",
363
- value: T
364
- });
365
- continue;
366
- }
367
- A = w.pop();
368
- push({
369
- type: "text",
370
- value: T
371
- });
372
- A = w[w.length - 1];
373
- continue;
374
- }
375
- if (T === _ || T === E || T === o) {
376
- let t = T;
377
- let s;
378
- if (true !== e.keepQuotes) T = "";
379
- while(C < S && (s = advance())){
380
- if (s === n) {
381
- T += s + advance();
382
- continue;
383
- }
384
- if (s === t) {
385
- if (true === e.keepQuotes) T += s;
386
- break;
387
- }
388
- T += s;
389
- }
390
- push({
391
- type: "text",
392
- value: T
393
- });
394
- continue;
395
- }
396
- if (T === f) {
397
- x++;
398
- let t = b.value && "$" === b.value.slice(-1) || true === A.dollar;
399
- let e = {
400
- type: "brace",
401
- open: true,
402
- close: false,
403
- dollar: t,
404
- depth: x,
405
- commas: 0,
406
- ranges: 0,
407
- nodes: []
408
- };
409
- A = push(e);
410
- w.push(A);
411
- push({
412
- type: "open",
413
- value: T
414
- });
415
- continue;
416
- }
417
- if (T === h) {
418
- if ("brace" !== A.type) {
419
- push({
420
- type: "text",
421
- value: T
422
- });
423
- continue;
424
- }
425
- let t = "close";
426
- A = w.pop();
427
- A.close = true;
428
- push({
429
- type: t,
430
- value: T
431
- });
432
- x--;
433
- A = w[w.length - 1];
434
- continue;
435
- }
436
- if (T === a && x > 0) {
437
- if (A.ranges > 0) {
438
- A.ranges = 0;
439
- let t = A.nodes.shift();
440
- A.nodes = [
441
- t,
442
- {
443
- type: "text",
444
- value: r(A)
445
- }
446
- ];
447
- }
448
- push({
449
- type: "comma",
450
- value: T
451
- });
452
- A.commas++;
453
- continue;
454
- }
455
- if (T === u && x > 0 && 0 === A.commas) {
456
- let t = A.nodes;
457
- if (0 === x || 0 === t.length) {
458
- push({
459
- type: "text",
460
- value: T
461
- });
462
- continue;
463
- }
464
- if ("dot" === b.type) {
465
- A.range = [];
466
- b.value += T;
467
- b.type = "range";
468
- if (3 !== A.nodes.length && 5 !== A.nodes.length) {
469
- A.invalid = true;
470
- A.ranges = 0;
471
- b.type = "text";
472
- continue;
473
- }
474
- A.ranges++;
475
- A.args = [];
476
- continue;
477
- }
478
- if ("range" === b.type) {
479
- t.pop();
480
- let e = t[t.length - 1];
481
- e.value += b.value + T;
482
- b = e;
483
- A.ranges--;
484
- continue;
485
- }
486
- push({
487
- type: "dot",
488
- value: T
489
- });
490
- continue;
491
- }
492
- push({
493
- type: "text",
494
- value: T
495
- });
496
- }
497
- do {
498
- A = w.pop();
499
- if ("root" !== A.type) {
500
- A.nodes.forEach((t)=>{
501
- if (!t.nodes) {
502
- if ("open" === t.type) t.isOpen = true;
503
- if ("close" === t.type) t.isClose = true;
504
- if (!t.nodes) t.type = "text";
505
- t.invalid = true;
506
- }
507
- });
508
- let t = w[w.length - 1];
509
- let e = t.nodes.indexOf(A);
510
- t.nodes.splice(e, 1, ...A.nodes);
511
- }
512
- }while (w.length > 0);
513
- push({
514
- type: "eos"
515
- });
516
- return R;
517
- };
518
- t.exports = parse;
519
- },
520
- 625: (t, e, s)=>{
521
- "use strict";
522
- const r = s(456);
523
- t.exports = (t, e = {})=>{
524
- let stringify = (t, s = {})=>{
525
- let i = e.escapeInvalid && r.isInvalidBrace(s);
526
- let n = true === t.invalid && true === e.escapeInvalid;
527
- let o = "";
528
- if (t.value) {
529
- if ((i || n) && r.isOpenOrClose(t)) return "\\" + t.value;
530
- return t.value;
531
- }
532
- if (t.value) return t.value;
533
- if (t.nodes) for (let e of t.nodes)o += stringify(e);
534
- return o;
535
- };
536
- return stringify(t);
537
- };
538
- },
539
- 456: (t, e)=>{
540
- "use strict";
541
- e.isInteger = (t)=>{
542
- if ("number" == typeof t) return Number.isInteger(t);
543
- if ("string" == typeof t && "" !== t.trim()) return Number.isInteger(Number(t));
544
- return false;
545
- };
546
- e.find = (t, e)=>t.nodes.find((t)=>t.type === e);
547
- e.exceedsLimit = (t, s, r = 1, i)=>{
548
- if (false === i) return false;
549
- if (!e.isInteger(t) || !e.isInteger(s)) return false;
550
- return (Number(s) - Number(t)) / Number(r) >= i;
551
- };
552
- e.escapeNode = (t, e = 0, s)=>{
553
- let r = t.nodes[e];
554
- if (!r) return;
555
- if (s && r.type === s || "open" === r.type || "close" === r.type) {
556
- if (true !== r.escaped) {
557
- r.value = "\\" + r.value;
558
- r.escaped = true;
559
- }
560
- }
561
- };
562
- e.encloseBrace = (t)=>{
563
- if ("brace" !== t.type) return false;
564
- if (t.commas >> 0 + t.ranges === 0) {
565
- t.invalid = true;
566
- return true;
567
- }
568
- return false;
569
- };
570
- e.isInvalidBrace = (t)=>{
571
- if ("brace" !== t.type) return false;
572
- if (true === t.invalid || t.dollar) return true;
573
- if (t.commas >> 0 + t.ranges === 0) {
574
- t.invalid = true;
575
- return true;
576
- }
577
- if (true !== t.open || true !== t.close) {
578
- t.invalid = true;
579
- return true;
580
- }
581
- return false;
582
- };
583
- e.isOpenOrClose = (t)=>{
584
- if ("open" === t.type || "close" === t.type) return true;
585
- return true === t.open || true === t.close;
586
- };
587
- e.reduce = (t)=>t.reduce((t, e)=>{
588
- if ("text" === e.type) t.push(e.value);
589
- if ("range" === e.type) e.type = "text";
590
- return t;
591
- }, []);
592
- e.flatten = (...t)=>{
593
- const e = [];
594
- const flat = (t)=>{
595
- for(let s = 0; s < t.length; s++){
596
- let r = t[s];
597
- Array.isArray(r) ? flat(r) : void 0 !== r && e.push(r);
598
- }
599
- return e;
600
- };
601
- flat(t);
602
- return e;
603
- };
604
- },
605
- 240: (t, e, s)=>{
606
- "use strict";
607
- const { sep: r } = s(17);
608
- const { platform: i } = process;
609
- const n = s(37);
610
- e.EV_ALL = "all";
611
- e.EV_READY = "ready";
612
- e.EV_ADD = "add";
613
- e.EV_CHANGE = "change";
614
- e.EV_ADD_DIR = "addDir";
615
- e.EV_UNLINK = "unlink";
616
- e.EV_UNLINK_DIR = "unlinkDir";
617
- e.EV_RAW = "raw";
618
- e.EV_ERROR = "error";
619
- e.STR_DATA = "data";
620
- e.STR_END = "end";
621
- e.STR_CLOSE = "close";
622
- e.FSEVENT_CREATED = "created";
623
- e.FSEVENT_MODIFIED = "modified";
624
- e.FSEVENT_DELETED = "deleted";
625
- e.FSEVENT_MOVED = "moved";
626
- e.FSEVENT_CLONED = "cloned";
627
- e.FSEVENT_UNKNOWN = "unknown";
628
- e.FSEVENT_TYPE_FILE = "file";
629
- e.FSEVENT_TYPE_DIRECTORY = "directory";
630
- e.FSEVENT_TYPE_SYMLINK = "symlink";
631
- e.KEY_LISTENERS = "listeners";
632
- e.KEY_ERR = "errHandlers";
633
- e.KEY_RAW = "rawEmitters";
634
- e.HANDLER_KEYS = [
635
- e.KEY_LISTENERS,
636
- e.KEY_ERR,
637
- e.KEY_RAW
638
- ];
639
- e.DOT_SLASH = `.${r}`;
640
- e.BACK_SLASH_RE = /\\/g;
641
- e.DOUBLE_SLASH_RE = /\/\//;
642
- e.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
643
- e.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
644
- e.REPLACER_RE = /^\.[/\\]/;
645
- e.SLASH = "/";
646
- e.SLASH_SLASH = "//";
647
- e.BRACE_START = "{";
648
- e.BANG = "!";
649
- e.ONE_DOT = ".";
650
- e.TWO_DOTS = "..";
651
- e.STAR = "*";
652
- e.GLOBSTAR = "**";
653
- e.ROOT_GLOBSTAR = "/**/*";
654
- e.SLASH_GLOBSTAR = "/**";
655
- e.DIR_SUFFIX = "Dir";
656
- e.ANYMATCH_OPTS = {
657
- dot: true
658
- };
659
- e.STRING_TYPE = "string";
660
- e.FUNCTION_TYPE = "function";
661
- e.EMPTY_STR = "";
662
- e.EMPTY_FN = ()=>{};
663
- e.IDENTITY_FN = (t)=>t;
664
- e.isWindows = "win32" === i;
665
- e.isMacos = "darwin" === i;
666
- e.isLinux = "linux" === i;
667
- e.isIBMi = "OS400" === n.type();
668
- },
669
- 578: (t, e, s)=>{
670
- "use strict";
671
- const r = s(147);
672
- const i = s(17);
673
- const { promisify: n } = s(837);
674
- let o;
675
- try {
676
- o = s(249);
677
- } catch (t) {
678
- if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(t);
679
- }
680
- if (o) {
681
- const t = process.version.match(/v(\d+)\.(\d+)/);
682
- if (t && t[1] && t[2]) {
683
- const e = Number.parseInt(t[1], 10);
684
- const s = Number.parseInt(t[2], 10);
685
- if (8 === e && s < 16) o = void 0;
686
- }
687
- }
688
- const { EV_ADD: a, EV_CHANGE: u, EV_ADD_DIR: l, EV_UNLINK: c, EV_ERROR: f, STR_DATA: h, STR_END: p, FSEVENT_CREATED: d, FSEVENT_MODIFIED: _, FSEVENT_DELETED: E, FSEVENT_MOVED: g, FSEVENT_UNKNOWN: m, FSEVENT_TYPE_FILE: y, FSEVENT_TYPE_DIRECTORY: R, FSEVENT_TYPE_SYMLINK: w, ROOT_GLOBSTAR: A, DIR_SUFFIX: b, DOT_SLASH: v, FUNCTION_TYPE: S, EMPTY_FN: C, IDENTITY_FN: x } = s(240);
689
- const Depth = (t)=>isNaN(t) ? {} : {
690
- depth: t
691
- };
692
- const T = n(r.stat);
693
- const H = n(r.lstat);
694
- const O = n(r.realpath);
695
- const P = {
696
- stat: T,
697
- lstat: H
698
- };
699
- const I = new Map;
700
- const L = 10;
701
- const N = new Set([
702
- 69888,
703
- 70400,
704
- 71424,
705
- 72704,
706
- 73472,
707
- 131328,
708
- 131840,
709
- 262912
710
- ]);
711
- const createFSEventsInstance = (t, e)=>{
712
- const s = o.watch(t, e);
713
- return {
714
- stop: s
715
- };
716
- };
717
- function setFSEventsListener(t, e, s, r) {
718
- let n = i.extname(e) ? i.dirname(e) : e;
719
- const a = i.dirname(n);
720
- let u = I.get(n);
721
- if (couldConsolidate(a)) n = a;
722
- const l = i.resolve(t);
723
- const c = l !== e;
724
- const filteredListener = (t, r, n)=>{
725
- if (c) t = t.replace(e, l);
726
- if (t === l || !t.indexOf(l + i.sep)) s(t, r, n);
727
- };
728
- let f = false;
729
- for (const t of I.keys())if (0 === e.indexOf(i.resolve(t) + i.sep)) {
730
- n = t;
731
- u = I.get(n);
732
- f = true;
733
- break;
734
- }
735
- if (u || f) u.listeners.add(filteredListener);
736
- else {
737
- u = {
738
- listeners: new Set([
739
- filteredListener
740
- ]),
741
- rawEmitter: r,
742
- watcher: createFSEventsInstance(n, (t, e)=>{
743
- if (!u.listeners.size) return;
744
- const s = o.getInfo(t, e);
745
- u.listeners.forEach((r)=>{
746
- r(t, e, s);
747
- });
748
- u.rawEmitter(s.event, t, s);
749
- })
750
- };
751
- I.set(n, u);
752
- }
753
- return ()=>{
754
- const t = u.listeners;
755
- t.delete(filteredListener);
756
- if (!t.size) {
757
- I.delete(n);
758
- if (u.watcher) return u.watcher.stop().then(()=>{
759
- u.rawEmitter = u.watcher = void 0;
760
- Object.freeze(u);
761
- });
762
- }
763
- };
764
- }
765
- const couldConsolidate = (t)=>{
766
- let e = 0;
767
- for (const s of I.keys())if (0 === s.indexOf(t)) {
768
- e++;
769
- if (e >= L) return true;
770
- }
771
- return false;
772
- };
773
- const canUse = ()=>o && I.size < 128;
774
- const calcDepth = (t, e)=>{
775
- let s = 0;
776
- while(!t.indexOf(e) && (t = i.dirname(t)) !== e)s++;
777
- return s;
778
- };
779
- const sameTypes = (t, e)=>t.type === R && e.isDirectory() || t.type === w && e.isSymbolicLink() || t.type === y && e.isFile();
780
- class FsEventsHandler {
781
- constructor(t){
782
- this.fsw = t;
783
- }
784
- checkIgnored(t, e) {
785
- const s = this.fsw._ignoredPaths;
786
- if (this.fsw._isIgnored(t, e)) {
787
- s.add(t);
788
- if (e && e.isDirectory()) s.add(t + A);
789
- return true;
790
- }
791
- s.delete(t);
792
- s.delete(t + A);
793
- }
794
- addOrChange(t, e, s, r, i, n, o, l) {
795
- const c = i.has(n) ? u : a;
796
- this.handleEvent(c, t, e, s, r, i, n, o, l);
797
- }
798
- async checkExists(t, e, s, r, i, n, o, a) {
799
- try {
800
- const u = await T(t);
801
- if (this.fsw.closed) return;
802
- if (sameTypes(o, u)) this.addOrChange(t, e, s, r, i, n, o, a);
803
- else this.handleEvent(c, t, e, s, r, i, n, o, a);
804
- } catch (u) {
805
- if ("EACCES" === u.code) this.addOrChange(t, e, s, r, i, n, o, a);
806
- else this.handleEvent(c, t, e, s, r, i, n, o, a);
807
- }
808
- }
809
- handleEvent(t, e, s, r, i, n, o, u, f) {
810
- if (this.fsw.closed || this.checkIgnored(e)) return;
811
- if (t === c) {
812
- const t = u.type === R;
813
- if (t || n.has(o)) this.fsw._remove(i, o, t);
814
- } else {
815
- if (t === a) {
816
- if (u.type === R) this.fsw._getWatchedDir(e);
817
- if (u.type === w && f.followSymlinks) {
818
- const t = void 0 === f.depth ? void 0 : calcDepth(s, r) + 1;
819
- return this._addToFsEvents(e, false, true, t);
820
- }
821
- this.fsw._getWatchedDir(i).add(o);
822
- }
823
- const n = u.type === R ? t + b : t;
824
- this.fsw._emit(n, e);
825
- if (n === l) this._addToFsEvents(e, false, true);
826
- }
827
- }
828
- _watchWithFsEvents(t, e, s, r) {
829
- if (this.fsw.closed || this.fsw._isIgnored(t)) return;
830
- const n = this.fsw.options;
831
- const watchCallback = async (o, a, u)=>{
832
- if (this.fsw.closed) return;
833
- if (void 0 !== n.depth && calcDepth(o, e) > n.depth) return;
834
- const l = s(i.join(t, i.relative(t, o)));
835
- if (r && !r(l)) return;
836
- const f = i.dirname(l);
837
- const h = i.basename(l);
838
- const p = this.fsw._getWatchedDir(u.type === R ? l : f);
839
- if (N.has(a) || u.event === m) if (typeof n.ignored === S) {
840
- let t;
841
- try {
842
- t = await T(l);
843
- } catch (t) {}
844
- if (this.fsw.closed) return;
845
- if (this.checkIgnored(l, t)) return;
846
- if (sameTypes(u, t)) this.addOrChange(l, o, e, f, p, h, u, n);
847
- else this.handleEvent(c, l, o, e, f, p, h, u, n);
848
- } else this.checkExists(l, o, e, f, p, h, u, n);
849
- else switch(u.event){
850
- case d:
851
- case _:
852
- return this.addOrChange(l, o, e, f, p, h, u, n);
853
- case E:
854
- case g:
855
- return this.checkExists(l, o, e, f, p, h, u, n);
856
- }
857
- };
858
- const o = setFSEventsListener(t, e, watchCallback, this.fsw._emitRaw);
859
- this.fsw._emitReady();
860
- return o;
861
- }
862
- async _handleFsEventsSymlink(t, e, s, r) {
863
- if (this.fsw.closed || this.fsw._symlinkPaths.has(e)) return;
864
- this.fsw._symlinkPaths.set(e, true);
865
- this.fsw._incrReadyCount();
866
- try {
867
- const e = await O(t);
868
- if (this.fsw.closed) return;
869
- if (this.fsw._isIgnored(e)) return this.fsw._emitReady();
870
- this.fsw._incrReadyCount();
871
- this._addToFsEvents(e || t, (r)=>{
872
- let n = t;
873
- if (e && e !== v) n = r.replace(e, t);
874
- else if (r !== v) n = i.join(t, r);
875
- return s(n);
876
- }, false, r);
877
- } catch (t) {
878
- if (this.fsw._handleError(t)) return this.fsw._emitReady();
879
- }
880
- }
881
- emitAdd(t, e, s, r, n) {
882
- const o = s(t);
883
- const u = e.isDirectory();
884
- const c = this.fsw._getWatchedDir(i.dirname(o));
885
- const f = i.basename(o);
886
- if (u) this.fsw._getWatchedDir(o);
887
- if (c.has(f)) return;
888
- c.add(f);
889
- if (!r.ignoreInitial || true === n) this.fsw._emit(u ? l : a, o, e);
890
- }
891
- initWatch(t, e, s, r) {
892
- if (this.fsw.closed) return;
893
- const n = this._watchWithFsEvents(s.watchPath, i.resolve(t || s.watchPath), r, s.globFilter);
894
- this.fsw._addPathCloser(e, n);
895
- }
896
- async _addToFsEvents(t, e, s, r) {
897
- if (this.fsw.closed) return;
898
- const n = this.fsw.options;
899
- const o = typeof e === S ? e : x;
900
- const a = this.fsw._getWatchHelpers(t);
901
- try {
902
- const e = await P[a.statMethod](a.watchPath);
903
- if (this.fsw.closed) return;
904
- if (this.fsw._isIgnored(a.watchPath, e)) throw null;
905
- if (e.isDirectory()) {
906
- if (!a.globFilter) this.emitAdd(o(t), e, o, n, s);
907
- if (r && r > n.depth) return;
908
- this.fsw._readdirp(a.watchPath, {
909
- fileFilter: (t)=>a.filterPath(t),
910
- directoryFilter: (t)=>a.filterDir(t),
911
- ...Depth(n.depth - (r || 0))
912
- }).on(h, (t)=>{
913
- if (this.fsw.closed) return;
914
- if (t.stats.isDirectory() && !a.filterPath(t)) return;
915
- const e = i.join(a.watchPath, t.path);
916
- const { fullPath: r } = t;
917
- if (a.followSymlinks && t.stats.isSymbolicLink()) {
918
- const t = void 0 === n.depth ? void 0 : calcDepth(e, i.resolve(a.watchPath)) + 1;
919
- this._handleFsEventsSymlink(e, r, o, t);
920
- } else this.emitAdd(e, t.stats, o, n, s);
921
- }).on(f, C).on(p, ()=>{
922
- this.fsw._emitReady();
923
- });
924
- } else {
925
- this.emitAdd(a.watchPath, e, o, n, s);
926
- this.fsw._emitReady();
927
- }
928
- } catch (t) {
929
- if (!t || this.fsw._handleError(t)) {
930
- this.fsw._emitReady();
931
- this.fsw._emitReady();
932
- }
933
- }
934
- if (n.persistent && true !== s) if (typeof e === S) this.initWatch(void 0, t, a, o);
935
- else {
936
- let e;
937
- try {
938
- e = await O(a.watchPath);
939
- } catch (t) {}
940
- this.initWatch(e, t, a, o);
941
- }
942
- }
943
- }
944
- t.exports = FsEventsHandler;
945
- t.exports.canUse = canUse;
946
- },
947
- 254: (t, e, s)=>{
948
- "use strict";
949
- const r = s(147);
950
- const i = s(17);
951
- const { promisify: n } = s(837);
952
- const o = s(41);
953
- const { isWindows: a, isLinux: u, EMPTY_FN: l, EMPTY_STR: c, KEY_LISTENERS: f, KEY_ERR: h, KEY_RAW: p, HANDLER_KEYS: d, EV_CHANGE: _, EV_ADD: E, EV_ADD_DIR: g, EV_ERROR: m, STR_DATA: y, STR_END: R, BRACE_START: w, STAR: A } = s(240);
954
- const b = "watch";
955
- const v = n(r.open);
956
- const S = n(r.stat);
957
- const C = n(r.lstat);
958
- const x = n(r.close);
959
- const T = n(r.realpath);
960
- const H = {
961
- lstat: C,
962
- stat: S
963
- };
964
- const foreach = (t, e)=>{
965
- if (t instanceof Set) t.forEach(e);
966
- else e(t);
967
- };
968
- const addAndConvert = (t, e, s)=>{
969
- let r = t[e];
970
- if (!(r instanceof Set)) t[e] = r = new Set([
971
- r
972
- ]);
973
- r.add(s);
974
- };
975
- const clearItem = (t)=>(e)=>{
976
- const s = t[e];
977
- if (s instanceof Set) s.clear();
978
- else delete t[e];
979
- };
980
- const delFromSet = (t, e, s)=>{
981
- const r = t[e];
982
- if (r instanceof Set) r.delete(s);
983
- else if (r === s) delete t[e];
984
- };
985
- const isEmptySet = (t)=>t instanceof Set ? 0 === t.size : !t;
986
- const O = new Map;
987
- function createFsWatchInstance(t, e, s, n, o) {
988
- const handleEvent = (e, r)=>{
989
- s(t);
990
- o(e, r, {
991
- watchedPath: t
992
- });
993
- if (r && t !== r) fsWatchBroadcast(i.resolve(t, r), f, i.join(t, r));
994
- };
995
- try {
996
- return r.watch(t, e, handleEvent);
997
- } catch (t) {
998
- n(t);
999
- }
1000
- }
1001
- const fsWatchBroadcast = (t, e, s, r, i)=>{
1002
- const n = O.get(t);
1003
- if (!n) return;
1004
- foreach(n[e], (t)=>{
1005
- t(s, r, i);
1006
- });
1007
- };
1008
- const setFsWatchListener = (t, e, s, r)=>{
1009
- const { listener: i, errHandler: n, rawEmitter: o } = r;
1010
- let u = O.get(e);
1011
- let l;
1012
- if (!s.persistent) {
1013
- l = createFsWatchInstance(t, s, i, n, o);
1014
- return l.close.bind(l);
1015
- }
1016
- if (u) {
1017
- addAndConvert(u, f, i);
1018
- addAndConvert(u, h, n);
1019
- addAndConvert(u, p, o);
1020
- } else {
1021
- l = createFsWatchInstance(t, s, fsWatchBroadcast.bind(null, e, f), n, fsWatchBroadcast.bind(null, e, p));
1022
- if (!l) return;
1023
- l.on(m, async (s)=>{
1024
- const r = fsWatchBroadcast.bind(null, e, h);
1025
- u.watcherUnusable = true;
1026
- if (a && "EPERM" === s.code) try {
1027
- const e = await v(t, "r");
1028
- await x(e);
1029
- r(s);
1030
- } catch (t) {}
1031
- else r(s);
1032
- });
1033
- u = {
1034
- listeners: i,
1035
- errHandlers: n,
1036
- rawEmitters: o,
1037
- watcher: l
1038
- };
1039
- O.set(e, u);
1040
- }
1041
- return ()=>{
1042
- delFromSet(u, f, i);
1043
- delFromSet(u, h, n);
1044
- delFromSet(u, p, o);
1045
- if (isEmptySet(u.listeners)) {
1046
- u.watcher.close();
1047
- O.delete(e);
1048
- d.forEach(clearItem(u));
1049
- u.watcher = void 0;
1050
- Object.freeze(u);
1051
- }
1052
- };
1053
- };
1054
- const P = new Map;
1055
- const setFsWatchFileListener = (t, e, s, i)=>{
1056
- const { listener: n, rawEmitter: o } = i;
1057
- let a = P.get(e);
1058
- new Set;
1059
- new Set;
1060
- const c = a && a.options;
1061
- if (c && (c.persistent < s.persistent || c.interval > s.interval)) {
1062
- a.listeners;
1063
- a.rawEmitters;
1064
- r.unwatchFile(e);
1065
- a = void 0;
1066
- }
1067
- if (a) {
1068
- addAndConvert(a, f, n);
1069
- addAndConvert(a, p, o);
1070
- } else {
1071
- a = {
1072
- listeners: n,
1073
- rawEmitters: o,
1074
- options: s,
1075
- watcher: r.watchFile(e, s, (s, r)=>{
1076
- foreach(a.rawEmitters, (t)=>{
1077
- t(_, e, {
1078
- curr: s,
1079
- prev: r
1080
- });
1081
- });
1082
- const i = s.mtimeMs;
1083
- if (s.size !== r.size || i > r.mtimeMs || 0 === i) foreach(a.listeners, (e)=>e(t, s));
1084
- })
1085
- };
1086
- P.set(e, a);
1087
- }
1088
- return ()=>{
1089
- delFromSet(a, f, n);
1090
- delFromSet(a, p, o);
1091
- if (isEmptySet(a.listeners)) {
1092
- P.delete(e);
1093
- r.unwatchFile(e);
1094
- a.options = a.watcher = void 0;
1095
- Object.freeze(a);
1096
- }
1097
- };
1098
- };
1099
- class NodeFsHandler {
1100
- constructor(t){
1101
- this.fsw = t;
1102
- this._boundHandleError = (e)=>t._handleError(e);
1103
- }
1104
- _watchWithNodeFs(t, e) {
1105
- const s = this.fsw.options;
1106
- const r = i.dirname(t);
1107
- const n = i.basename(t);
1108
- const a = this.fsw._getWatchedDir(r);
1109
- a.add(n);
1110
- const u = i.resolve(t);
1111
- const c = {
1112
- persistent: s.persistent
1113
- };
1114
- if (!e) e = l;
1115
- let f;
1116
- if (s.usePolling) {
1117
- c.interval = s.enableBinaryInterval && o(n) ? s.binaryInterval : s.interval;
1118
- f = setFsWatchFileListener(t, u, c, {
1119
- listener: e,
1120
- rawEmitter: this.fsw._emitRaw
1121
- });
1122
- } else f = setFsWatchListener(t, u, c, {
1123
- listener: e,
1124
- errHandler: this._boundHandleError,
1125
- rawEmitter: this.fsw._emitRaw
1126
- });
1127
- return f;
1128
- }
1129
- _handleFile(t, e, s) {
1130
- if (this.fsw.closed) return;
1131
- const r = i.dirname(t);
1132
- const n = i.basename(t);
1133
- const o = this.fsw._getWatchedDir(r);
1134
- let a = e;
1135
- if (o.has(n)) return;
1136
- const listener = async (e, s)=>{
1137
- if (!this.fsw._throttle(b, t, 5)) return;
1138
- if (s && 0 !== s.mtimeMs) {
1139
- if (o.has(n)) {
1140
- const e = s.atimeMs;
1141
- const r = s.mtimeMs;
1142
- if (!e || e <= r || r !== a.mtimeMs) this.fsw._emit(_, t, s);
1143
- a = s;
1144
- }
1145
- } else try {
1146
- const s = await S(t);
1147
- if (this.fsw.closed) return;
1148
- const r = s.atimeMs;
1149
- const i = s.mtimeMs;
1150
- if (!r || r <= i || i !== a.mtimeMs) this.fsw._emit(_, t, s);
1151
- if (u && a.ino !== s.ino) {
1152
- this.fsw._closeFile(e);
1153
- a = s;
1154
- this.fsw._addPathCloser(e, this._watchWithNodeFs(t, listener));
1155
- } else a = s;
1156
- } catch (t) {
1157
- this.fsw._remove(r, n);
1158
- }
1159
- };
1160
- const l = this._watchWithNodeFs(t, listener);
1161
- if (!(s && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(t)) {
1162
- if (!this.fsw._throttle(E, t, 0)) return;
1163
- this.fsw._emit(E, t, e);
1164
- }
1165
- return l;
1166
- }
1167
- async _handleSymlink(t, e, s, r) {
1168
- if (this.fsw.closed) return;
1169
- const i = t.fullPath;
1170
- const n = this.fsw._getWatchedDir(e);
1171
- if (!this.fsw.options.followSymlinks) {
1172
- this.fsw._incrReadyCount();
1173
- let e;
1174
- try {
1175
- e = await T(s);
1176
- } catch (t) {
1177
- this.fsw._emitReady();
1178
- return true;
1179
- }
1180
- if (this.fsw.closed) return;
1181
- if (n.has(r)) {
1182
- if (this.fsw._symlinkPaths.get(i) !== e) {
1183
- this.fsw._symlinkPaths.set(i, e);
1184
- this.fsw._emit(_, s, t.stats);
1185
- }
1186
- } else {
1187
- n.add(r);
1188
- this.fsw._symlinkPaths.set(i, e);
1189
- this.fsw._emit(E, s, t.stats);
1190
- }
1191
- this.fsw._emitReady();
1192
- return true;
1193
- }
1194
- if (this.fsw._symlinkPaths.has(i)) return true;
1195
- this.fsw._symlinkPaths.set(i, true);
1196
- }
1197
- _handleRead(t, e, s, r, n, o, a) {
1198
- t = i.join(t, c);
1199
- if (!s.hasGlob) {
1200
- a = this.fsw._throttle("readdir", t, 1e3);
1201
- if (!a) return;
1202
- }
1203
- const u = this.fsw._getWatchedDir(s.path);
1204
- const l = new Set;
1205
- let f = this.fsw._readdirp(t, {
1206
- fileFilter: (t)=>s.filterPath(t),
1207
- directoryFilter: (t)=>s.filterDir(t),
1208
- depth: 0
1209
- }).on(y, async (a)=>{
1210
- if (this.fsw.closed) {
1211
- f = void 0;
1212
- return;
1213
- }
1214
- const c = a.path;
1215
- let h = i.join(t, c);
1216
- l.add(c);
1217
- if (a.stats.isSymbolicLink() && await this._handleSymlink(a, t, h, c)) return;
1218
- if (this.fsw.closed) {
1219
- f = void 0;
1220
- return;
1221
- }
1222
- if (c === r || !r && !u.has(c)) {
1223
- this.fsw._incrReadyCount();
1224
- h = i.join(n, i.relative(n, h));
1225
- this._addToNodeFs(h, e, s, o + 1);
1226
- }
1227
- }).on(m, this._boundHandleError);
1228
- return new Promise((e)=>f.once(R, ()=>{
1229
- if (this.fsw.closed) {
1230
- f = void 0;
1231
- return;
1232
- }
1233
- const c = a ? a.clear() : false;
1234
- e();
1235
- u.getChildren().filter((e)=>e !== t && !l.has(e) && (!s.hasGlob || s.filterPath({
1236
- fullPath: i.resolve(t, e)
1237
- }))).forEach((e)=>{
1238
- this.fsw._remove(t, e);
1239
- });
1240
- f = void 0;
1241
- if (c) this._handleRead(t, false, s, r, n, o, a);
1242
- }));
1243
- }
1244
- async _handleDir(t, e, s, r, n, o, a) {
1245
- const u = this.fsw._getWatchedDir(i.dirname(t));
1246
- const l = u.has(i.basename(t));
1247
- if (!(s && this.fsw.options.ignoreInitial) && !n && !l) {
1248
- if (!o.hasGlob || o.globFilter(t)) this.fsw._emit(g, t, e);
1249
- }
1250
- u.add(i.basename(t));
1251
- this.fsw._getWatchedDir(t);
1252
- let c;
1253
- let f;
1254
- const h = this.fsw.options.depth;
1255
- if ((null == h || r <= h) && !this.fsw._symlinkPaths.has(a)) {
1256
- if (!n) {
1257
- await this._handleRead(t, s, o, n, t, r, c);
1258
- if (this.fsw.closed) return;
1259
- }
1260
- f = this._watchWithNodeFs(t, (e, s)=>{
1261
- if (s && 0 === s.mtimeMs) return;
1262
- this._handleRead(e, false, o, n, t, r, c);
1263
- });
1264
- }
1265
- return f;
1266
- }
1267
- async _addToNodeFs(t, e, s, r, n) {
1268
- const o = this.fsw._emitReady;
1269
- if (this.fsw._isIgnored(t) || this.fsw.closed) {
1270
- o();
1271
- return false;
1272
- }
1273
- const a = this.fsw._getWatchHelpers(t, r);
1274
- if (!a.hasGlob && s) {
1275
- a.hasGlob = s.hasGlob;
1276
- a.globFilter = s.globFilter;
1277
- a.filterPath = (t)=>s.filterPath(t);
1278
- a.filterDir = (t)=>s.filterDir(t);
1279
- }
1280
- try {
1281
- const s = await H[a.statMethod](a.watchPath);
1282
- if (this.fsw.closed) return;
1283
- if (this.fsw._isIgnored(a.watchPath, s)) {
1284
- o();
1285
- return false;
1286
- }
1287
- const u = this.fsw.options.followSymlinks && !t.includes(A) && !t.includes(w);
1288
- let l;
1289
- if (s.isDirectory()) {
1290
- const o = i.resolve(t);
1291
- const c = u ? await T(t) : t;
1292
- if (this.fsw.closed) return;
1293
- l = await this._handleDir(a.watchPath, s, e, r, n, a, c);
1294
- if (this.fsw.closed) return;
1295
- if (o !== c && void 0 !== c) this.fsw._symlinkPaths.set(o, c);
1296
- } else if (s.isSymbolicLink()) {
1297
- const n = u ? await T(t) : t;
1298
- if (this.fsw.closed) return;
1299
- const o = i.dirname(a.watchPath);
1300
- this.fsw._getWatchedDir(o).add(a.watchPath);
1301
- this.fsw._emit(E, a.watchPath, s);
1302
- l = await this._handleDir(o, s, e, r, t, a, n);
1303
- if (this.fsw.closed) return;
1304
- if (void 0 !== n) this.fsw._symlinkPaths.set(i.resolve(t), n);
1305
- } else l = this._handleFile(a.watchPath, s, e);
1306
- o();
1307
- this.fsw._addPathCloser(t, l);
1308
- return false;
1309
- } catch (e) {
1310
- if (this.fsw._handleError(e)) {
1311
- o();
1312
- return t;
1313
- }
1314
- }
1315
- }
1316
- }
1317
- t.exports = NodeFsHandler;
1318
- },
1319
- 442: (t, e, s)=>{
1320
- "use strict";
1321
- /*!
1322
- * fill-range <https://github.com/jonschlinkert/fill-range>
1323
- *
1324
- * Copyright (c) 2014-present, Jon Schlinkert.
1325
- * Licensed under the MIT License.
1326
- */ const r = s(837);
1327
- const i = s(211);
1328
- const isObject = (t)=>null !== t && "object" == typeof t && !Array.isArray(t);
1329
- const transform = (t)=>(e)=>true === t ? Number(e) : String(e);
1330
- const isValidValue = (t)=>"number" == typeof t || "string" == typeof t && "" !== t;
1331
- const isNumber = (t)=>Number.isInteger(+t);
1332
- const zeros = (t)=>{
1333
- let e = `${t}`;
1334
- let s = -1;
1335
- if ("-" === e[0]) e = e.slice(1);
1336
- if ("0" === e) return false;
1337
- while("0" === e[++s]);
1338
- return s > 0;
1339
- };
1340
- const stringify = (t, e, s)=>{
1341
- if ("string" == typeof t || "string" == typeof e) return true;
1342
- return true === s.stringify;
1343
- };
1344
- const pad = (t, e, s)=>{
1345
- if (e > 0) {
1346
- let s = "-" === t[0] ? "-" : "";
1347
- if (s) t = t.slice(1);
1348
- t = s + t.padStart(s ? e - 1 : e, "0");
1349
- }
1350
- if (false === s) return String(t);
1351
- return t;
1352
- };
1353
- const toMaxLen = (t, e)=>{
1354
- let s = "-" === t[0] ? "-" : "";
1355
- if (s) {
1356
- t = t.slice(1);
1357
- e--;
1358
- }
1359
- while(t.length < e)t = "0" + t;
1360
- return s ? "-" + t : t;
1361
- };
1362
- const toSequence = (t, e)=>{
1363
- t.negatives.sort((t, e)=>t < e ? -1 : t > e ? 1 : 0);
1364
- t.positives.sort((t, e)=>t < e ? -1 : t > e ? 1 : 0);
1365
- let s = e.capture ? "" : "?:";
1366
- let r = "";
1367
- let i = "";
1368
- let n;
1369
- if (t.positives.length) r = t.positives.join("|");
1370
- if (t.negatives.length) i = `-(${s}${t.negatives.join("|")})`;
1371
- n = r && i ? `${r}|${i}` : r || i;
1372
- if (e.wrap) return `(${s}${n})`;
1373
- return n;
1374
- };
1375
- const toRange = (t, e, s, r)=>{
1376
- if (s) return i(t, e, {
1377
- wrap: false,
1378
- ...r
1379
- });
1380
- let n = String.fromCharCode(t);
1381
- if (t === e) return n;
1382
- let o = String.fromCharCode(e);
1383
- return `[${n}-${o}]`;
1384
- };
1385
- const toRegex = (t, e, s)=>{
1386
- if (Array.isArray(t)) {
1387
- let e = true === s.wrap;
1388
- let r = s.capture ? "" : "?:";
1389
- return e ? `(${r}${t.join("|")})` : t.join("|");
1390
- }
1391
- return i(t, e, s);
1392
- };
1393
- const rangeError = (...t)=>new RangeError("Invalid range arguments: " + r.inspect(...t));
1394
- const invalidRange = (t, e, s)=>{
1395
- if (true === s.strictRanges) throw rangeError([
1396
- t,
1397
- e
1398
- ]);
1399
- return [];
1400
- };
1401
- const invalidStep = (t, e)=>{
1402
- if (true === e.strictRanges) throw new TypeError(`Expected step "${t}" to be a number`);
1403
- return [];
1404
- };
1405
- const fillNumbers = (t, e, s = 1, r = {})=>{
1406
- let i = Number(t);
1407
- let n = Number(e);
1408
- if (!Number.isInteger(i) || !Number.isInteger(n)) {
1409
- if (true === r.strictRanges) throw rangeError([
1410
- t,
1411
- e
1412
- ]);
1413
- return [];
1414
- }
1415
- if (0 === i) i = 0;
1416
- if (0 === n) n = 0;
1417
- let o = i > n;
1418
- let a = String(t);
1419
- let u = String(e);
1420
- let l = String(s);
1421
- s = Math.max(Math.abs(s), 1);
1422
- let c = zeros(a) || zeros(u) || zeros(l);
1423
- let f = c ? Math.max(a.length, u.length, l.length) : 0;
1424
- let h = false === c && false === stringify(t, e, r);
1425
- let p = r.transform || transform(h);
1426
- if (r.toRegex && 1 === s) return toRange(toMaxLen(t, f), toMaxLen(e, f), true, r);
1427
- let d = {
1428
- negatives: [],
1429
- positives: []
1430
- };
1431
- let push = (t)=>d[t < 0 ? "negatives" : "positives"].push(Math.abs(t));
1432
- let _ = [];
1433
- let E = 0;
1434
- while(o ? i >= n : i <= n){
1435
- if (true === r.toRegex && s > 1) push(i);
1436
- else _.push(pad(p(i, E), f, h));
1437
- i = o ? i - s : i + s;
1438
- E++;
1439
- }
1440
- if (true === r.toRegex) return s > 1 ? toSequence(d, r) : toRegex(_, null, {
1441
- wrap: false,
1442
- ...r
1443
- });
1444
- return _;
1445
- };
1446
- const fillLetters = (t, e, s = 1, r = {})=>{
1447
- if (!isNumber(t) && t.length > 1 || !isNumber(e) && e.length > 1) return invalidRange(t, e, r);
1448
- let i = r.transform || ((t)=>String.fromCharCode(t));
1449
- let n = `${t}`.charCodeAt(0);
1450
- let o = `${e}`.charCodeAt(0);
1451
- let a = n > o;
1452
- let u = Math.min(n, o);
1453
- let l = Math.max(n, o);
1454
- if (r.toRegex && 1 === s) return toRange(u, l, false, r);
1455
- let c = [];
1456
- let f = 0;
1457
- while(a ? n >= o : n <= o){
1458
- c.push(i(n, f));
1459
- n = a ? n - s : n + s;
1460
- f++;
1461
- }
1462
- if (true === r.toRegex) return toRegex(c, null, {
1463
- wrap: false,
1464
- options: r
1465
- });
1466
- return c;
1467
- };
1468
- const fill = (t, e, s, r = {})=>{
1469
- if (null == e && isValidValue(t)) return [
1470
- t
1471
- ];
1472
- if (!isValidValue(t) || !isValidValue(e)) return invalidRange(t, e, r);
1473
- if ("function" == typeof s) return fill(t, e, 1, {
1474
- transform: s
1475
- });
1476
- if (isObject(s)) return fill(t, e, 0, s);
1477
- let i = {
1478
- ...r
1479
- };
1480
- if (true === i.capture) i.wrap = true;
1481
- s = s || i.step || 1;
1482
- if (!isNumber(s)) {
1483
- if (null != s && !isObject(s)) return invalidStep(s, i);
1484
- return fill(t, e, 1, s);
1485
- }
1486
- if (isNumber(t) && isNumber(e)) return fillNumbers(t, e, s, i);
1487
- return fillLetters(t, e, Math.max(Math.abs(s), 1), i);
1488
- };
1489
- t.exports = fill;
1490
- },
1491
- 249: (t, e, s)=>{
1492
- "use strict";
1493
- if ("darwin" !== process.platform) throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`);
1494
- const r = s(653);
1495
- const i = r.constants;
1496
- function watch(t, e, s) {
1497
- if ("string" != typeof t) throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof t}`);
1498
- if ("function" == typeof e && void 0 === s) {
1499
- s = e;
1500
- e = r.flags.SinceNow;
1501
- }
1502
- if ("number" != typeof e) throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof e}`);
1503
- if ("function" != typeof s) throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof s}`);
1504
- let i = r.start(r.global, t, e, s);
1505
- if (!i) throw new Error(`could not watch: ${t}`);
1506
- return ()=>{
1507
- const t = i ? Promise.resolve(i).then(r.stop) : Promise.resolve(void 0);
1508
- i = void 0;
1509
- return t;
1510
- };
1511
- }
1512
- function getInfo(t, e) {
1513
- return {
1514
- path: t,
1515
- flags: e,
1516
- event: getEventType(e),
1517
- type: getFileType(e),
1518
- changes: getFileChanges(e)
1519
- };
1520
- }
1521
- function getFileType(t) {
1522
- if (i.ItemIsFile & t) return "file";
1523
- if (i.ItemIsDir & t) return "directory";
1524
- if (i.ItemIsSymlink & t) return "symlink";
1525
- }
1526
- function anyIsTrue(t) {
1527
- for(let e in t)if (t[e]) return true;
1528
- return false;
1529
- }
1530
- function getEventType(t) {
1531
- if (i.ItemRemoved & t) return "deleted";
1532
- if (i.ItemRenamed & t) return "moved";
1533
- if (i.ItemCreated & t) return "created";
1534
- if (i.ItemModified & t) return "modified";
1535
- if (i.RootChanged & t) return "root-changed";
1536
- if (i.ItemCloned & t) return "cloned";
1537
- if (anyIsTrue(t)) return "modified";
1538
- return "unknown";
1539
- }
1540
- function getFileChanges(t) {
1541
- return {
1542
- inode: !!(i.ItemInodeMetaMod & t),
1543
- finder: !!(i.ItemFinderInfoMod & t),
1544
- access: !!(i.ItemChangeOwner & t),
1545
- xattrs: !!(i.ItemXattrMod & t)
1546
- };
1547
- }
1548
- e.watch = watch;
1549
- e.getInfo = getInfo;
1550
- e.constants = i;
1551
- },
1552
- 976: (t, e, s)=>{
1553
- "use strict";
1554
- var r = s(654);
1555
- var i = s(17).posix.dirname;
1556
- var n = "win32" === s(37).platform();
1557
- var o = "/";
1558
- var a = /\\/g;
1559
- var u = /[\{\[].*[\}\]]$/;
1560
- var l = /(^|[^\\])([\{\[]|\([^\)]+$)/;
1561
- var c = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
1562
- t.exports = function(t, e) {
1563
- var s = Object.assign({
1564
- flipBackslashes: true
1565
- }, e);
1566
- if (s.flipBackslashes && n && t.indexOf(o) < 0) t = t.replace(a, o);
1567
- if (u.test(t)) t += o;
1568
- t += "a";
1569
- do t = i(t);
1570
- while (r(t) || l.test(t));
1571
- return t.replace(c, "$1");
1572
- };
1573
- },
1574
- 41: (t, e, s)=>{
1575
- "use strict";
1576
- const r = s(17);
1577
- const i = s(828);
1578
- const n = new Set(i);
1579
- t.exports = (t)=>n.has(r.extname(t).slice(1).toLowerCase());
1580
- },
1581
- 71: (t)=>{
1582
- /*!
1583
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
1584
- *
1585
- * Copyright (c) 2014-2016, Jon Schlinkert.
1586
- * Licensed under the MIT License.
1587
- */ t.exports = function(t) {
1588
- if ("string" != typeof t || "" === t) return false;
1589
- var e;
1590
- while(e = /(\\).|([@?!+*]\(.*\))/g.exec(t)){
1591
- if (e[2]) return true;
1592
- t = t.slice(e.index + e[0].length);
1593
- }
1594
- return false;
1595
- };
1596
- },
1597
- 654: (t, e, s)=>{
1598
- /*!
1599
- * is-glob <https://github.com/jonschlinkert/is-glob>
1600
- *
1601
- * Copyright (c) 2014-2017, Jon Schlinkert.
1602
- * Released under the MIT License.
1603
- */ var r = s(71);
1604
- var i = {
1605
- "{": "}",
1606
- "(": ")",
1607
- "[": "]"
1608
- };
1609
- var strictCheck = function(t) {
1610
- if ("!" === t[0]) return true;
1611
- var e = 0;
1612
- var s = -2;
1613
- var r = -2;
1614
- var n = -2;
1615
- var o = -2;
1616
- var a = -2;
1617
- while(e < t.length){
1618
- if ("*" === t[e]) return true;
1619
- if ("?" === t[e + 1] && /[\].+)]/.test(t[e])) return true;
1620
- if (-1 !== r && "[" === t[e] && "]" !== t[e + 1]) {
1621
- if (r < e) r = t.indexOf("]", e);
1622
- if (r > e) {
1623
- if (-1 === a || a > r) return true;
1624
- a = t.indexOf("\\", e);
1625
- if (-1 === a || a > r) return true;
1626
- }
1627
- }
1628
- if (-1 !== n && "{" === t[e] && "}" !== t[e + 1]) {
1629
- n = t.indexOf("}", e);
1630
- if (n > e) {
1631
- a = t.indexOf("\\", e);
1632
- if (-1 === a || a > n) return true;
1633
- }
1634
- }
1635
- if (-1 !== o && "(" === t[e] && "?" === t[e + 1] && /[:!=]/.test(t[e + 2]) && ")" !== t[e + 3]) {
1636
- o = t.indexOf(")", e);
1637
- if (o > e) {
1638
- a = t.indexOf("\\", e);
1639
- if (-1 === a || a > o) return true;
1640
- }
1641
- }
1642
- if (-1 !== s && "(" === t[e] && "|" !== t[e + 1]) {
1643
- if (s < e) s = t.indexOf("|", e);
1644
- if (-1 !== s && ")" !== t[s + 1]) {
1645
- o = t.indexOf(")", s);
1646
- if (o > s) {
1647
- a = t.indexOf("\\", s);
1648
- if (-1 === a || a > o) return true;
1649
- }
1650
- }
1651
- }
1652
- if ("\\" === t[e]) {
1653
- var u = t[e + 1];
1654
- e += 2;
1655
- var l = i[u];
1656
- if (l) {
1657
- var c = t.indexOf(l, e);
1658
- if (-1 !== c) e = c + 1;
1659
- }
1660
- if ("!" === t[e]) return true;
1661
- } else e++;
1662
- }
1663
- return false;
1664
- };
1665
- var relaxedCheck = function(t) {
1666
- if ("!" === t[0]) return true;
1667
- var e = 0;
1668
- while(e < t.length){
1669
- if (/[*?{}()[\]]/.test(t[e])) return true;
1670
- if ("\\" === t[e]) {
1671
- var s = t[e + 1];
1672
- e += 2;
1673
- var r = i[s];
1674
- if (r) {
1675
- var n = t.indexOf(r, e);
1676
- if (-1 !== n) e = n + 1;
1677
- }
1678
- if ("!" === t[e]) return true;
1679
- } else e++;
1680
- }
1681
- return false;
1682
- };
1683
- t.exports = function(t, e) {
1684
- if ("string" != typeof t || "" === t) return false;
1685
- if (r(t)) return true;
1686
- var s = strictCheck;
1687
- if (e && false === e.strict) s = relaxedCheck;
1688
- return s(t);
1689
- };
1690
- },
1691
- 387: (t)=>{
1692
- "use strict";
1693
- /*!
1694
- * is-number <https://github.com/jonschlinkert/is-number>
1695
- *
1696
- * Copyright (c) 2014-present, Jon Schlinkert.
1697
- * Released under the MIT License.
1698
- */ t.exports = function(t) {
1699
- if ("number" == typeof t) return t - t === 0;
1700
- if ("string" == typeof t && "" !== t.trim()) return Number.isFinite ? Number.isFinite(+t) : isFinite(+t);
1701
- return false;
1702
- };
1703
- },
1704
- 498: (t)=>{
1705
- /*!
1706
- * normalize-path <https://github.com/jonschlinkert/normalize-path>
1707
- *
1708
- * Copyright (c) 2014-2018, Jon Schlinkert.
1709
- * Released under the MIT License.
1710
- */ t.exports = function(t, e) {
1711
- if ("string" != typeof t) throw new TypeError("expected path to be a string");
1712
- if ("\\" === t || "/" === t) return "/";
1713
- var s = t.length;
1714
- if (s <= 1) return t;
1715
- var r = "";
1716
- if (s > 4 && "\\" === t[3]) {
1717
- var i = t[2];
1718
- if (("?" === i || "." === i) && "\\\\" === t.slice(0, 2)) {
1719
- t = t.slice(2);
1720
- r = "//";
1721
- }
1722
- }
1723
- var n = t.split(/[/\\]+/);
1724
- if (false !== e && "" === n[n.length - 1]) n.pop();
1725
- return r + n.join("/");
1726
- };
1727
- },
1728
- 700: (t, e, s)=>{
1729
- "use strict";
1730
- t.exports = s(144);
1731
- },
1732
- 112: (t, e, s)=>{
1733
- "use strict";
1734
- const r = s(17);
1735
- const i = "\\\\/";
1736
- const n = `[^${i}]`;
1737
- const o = "\\.";
1738
- const a = "\\+";
1739
- const u = "\\?";
1740
- const l = "\\/";
1741
- const c = "(?=.)";
1742
- const f = "[^/]";
1743
- const h = `(?:${l}|$)`;
1744
- const p = `(?:^|${l})`;
1745
- const d = `${o}{1,2}${h}`;
1746
- const _ = `(?!${o})`;
1747
- const E = `(?!${p}${d})`;
1748
- const g = `(?!${o}{0,1}${h})`;
1749
- const m = `(?!${d})`;
1750
- const y = `[^.${l}]`;
1751
- const R = `${f}*?`;
1752
- const w = {
1753
- DOT_LITERAL: o,
1754
- PLUS_LITERAL: a,
1755
- QMARK_LITERAL: u,
1756
- SLASH_LITERAL: l,
1757
- ONE_CHAR: c,
1758
- QMARK: f,
1759
- END_ANCHOR: h,
1760
- DOTS_SLASH: d,
1761
- NO_DOT: _,
1762
- NO_DOTS: E,
1763
- NO_DOT_SLASH: g,
1764
- NO_DOTS_SLASH: m,
1765
- QMARK_NO_DOT: y,
1766
- STAR: R,
1767
- START_ANCHOR: p
1768
- };
1769
- const A = {
1770
- ...w,
1771
- SLASH_LITERAL: `[${i}]`,
1772
- QMARK: n,
1773
- STAR: `${n}*?`,
1774
- DOTS_SLASH: `${o}{1,2}(?:[${i}]|$)`,
1775
- NO_DOT: `(?!${o})`,
1776
- NO_DOTS: `(?!(?:^|[${i}])${o}{1,2}(?:[${i}]|$))`,
1777
- NO_DOT_SLASH: `(?!${o}{0,1}(?:[${i}]|$))`,
1778
- NO_DOTS_SLASH: `(?!${o}{1,2}(?:[${i}]|$))`,
1779
- QMARK_NO_DOT: `[^.${i}]`,
1780
- START_ANCHOR: `(?:^|[${i}])`,
1781
- END_ANCHOR: `(?:[${i}]|$)`
1782
- };
1783
- const b = {
1784
- alnum: "a-zA-Z0-9",
1785
- alpha: "a-zA-Z",
1786
- ascii: "\\x00-\\x7F",
1787
- blank: " \\t",
1788
- cntrl: "\\x00-\\x1F\\x7F",
1789
- digit: "0-9",
1790
- graph: "\\x21-\\x7E",
1791
- lower: "a-z",
1792
- print: "\\x20-\\x7E ",
1793
- punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
1794
- space: " \\t\\r\\n\\v\\f",
1795
- upper: "A-Z",
1796
- word: "A-Za-z0-9_",
1797
- xdigit: "A-Fa-f0-9"
1798
- };
1799
- t.exports = {
1800
- MAX_LENGTH: 65536,
1801
- POSIX_REGEX_SOURCE: b,
1802
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
1803
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
1804
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
1805
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
1806
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
1807
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
1808
- REPLACEMENTS: {
1809
- "***": "*",
1810
- "**/**": "**",
1811
- "**/**/**": "**"
1812
- },
1813
- CHAR_0: 48,
1814
- CHAR_9: 57,
1815
- CHAR_UPPERCASE_A: 65,
1816
- CHAR_LOWERCASE_A: 97,
1817
- CHAR_UPPERCASE_Z: 90,
1818
- CHAR_LOWERCASE_Z: 122,
1819
- CHAR_LEFT_PARENTHESES: 40,
1820
- CHAR_RIGHT_PARENTHESES: 41,
1821
- CHAR_ASTERISK: 42,
1822
- CHAR_AMPERSAND: 38,
1823
- CHAR_AT: 64,
1824
- CHAR_BACKWARD_SLASH: 92,
1825
- CHAR_CARRIAGE_RETURN: 13,
1826
- CHAR_CIRCUMFLEX_ACCENT: 94,
1827
- CHAR_COLON: 58,
1828
- CHAR_COMMA: 44,
1829
- CHAR_DOT: 46,
1830
- CHAR_DOUBLE_QUOTE: 34,
1831
- CHAR_EQUAL: 61,
1832
- CHAR_EXCLAMATION_MARK: 33,
1833
- CHAR_FORM_FEED: 12,
1834
- CHAR_FORWARD_SLASH: 47,
1835
- CHAR_GRAVE_ACCENT: 96,
1836
- CHAR_HASH: 35,
1837
- CHAR_HYPHEN_MINUS: 45,
1838
- CHAR_LEFT_ANGLE_BRACKET: 60,
1839
- CHAR_LEFT_CURLY_BRACE: 123,
1840
- CHAR_LEFT_SQUARE_BRACKET: 91,
1841
- CHAR_LINE_FEED: 10,
1842
- CHAR_NO_BREAK_SPACE: 160,
1843
- CHAR_PERCENT: 37,
1844
- CHAR_PLUS: 43,
1845
- CHAR_QUESTION_MARK: 63,
1846
- CHAR_RIGHT_ANGLE_BRACKET: 62,
1847
- CHAR_RIGHT_CURLY_BRACE: 125,
1848
- CHAR_RIGHT_SQUARE_BRACKET: 93,
1849
- CHAR_SEMICOLON: 59,
1850
- CHAR_SINGLE_QUOTE: 39,
1851
- CHAR_SPACE: 32,
1852
- CHAR_TAB: 9,
1853
- CHAR_UNDERSCORE: 95,
1854
- CHAR_VERTICAL_LINE: 124,
1855
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
1856
- SEP: r.sep,
1857
- extglobChars (t) {
1858
- return {
1859
- "!": {
1860
- type: "negate",
1861
- open: "(?:(?!(?:",
1862
- close: `))${t.STAR})`
1863
- },
1864
- "?": {
1865
- type: "qmark",
1866
- open: "(?:",
1867
- close: ")?"
1868
- },
1869
- "+": {
1870
- type: "plus",
1871
- open: "(?:",
1872
- close: ")+"
1873
- },
1874
- "*": {
1875
- type: "star",
1876
- open: "(?:",
1877
- close: ")*"
1878
- },
1879
- "@": {
1880
- type: "at",
1881
- open: "(?:",
1882
- close: ")"
1883
- }
1884
- };
1885
- },
1886
- globChars (t) {
1887
- return true === t ? A : w;
1888
- }
1889
- };
1890
- },
1891
- 352: (t, e, s)=>{
1892
- "use strict";
1893
- const r = s(112);
1894
- const i = s(869);
1895
- const { MAX_LENGTH: n, POSIX_REGEX_SOURCE: o, REGEX_NON_SPECIAL_CHARS: a, REGEX_SPECIAL_CHARS_BACKREF: u, REPLACEMENTS: l } = r;
1896
- const expandRange = (t, e)=>{
1897
- if ("function" == typeof e.expandRange) return e.expandRange(...t, e);
1898
- t.sort();
1899
- const s = `[${t.join("-")}]`;
1900
- try {
1901
- new RegExp(s);
1902
- } catch (e) {
1903
- return t.map((t)=>i.escapeRegex(t)).join("..");
1904
- }
1905
- return s;
1906
- };
1907
- const syntaxError = (t, e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`;
1908
- const parse = (t, e)=>{
1909
- if ("string" != typeof t) throw new TypeError("Expected a string");
1910
- t = l[t] || t;
1911
- const s = {
1912
- ...e
1913
- };
1914
- const c = "number" == typeof s.maxLength ? Math.min(n, s.maxLength) : n;
1915
- let f = t.length;
1916
- if (f > c) throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${c}`);
1917
- const h = {
1918
- type: "bos",
1919
- value: "",
1920
- output: s.prepend || ""
1921
- };
1922
- const p = [
1923
- h
1924
- ];
1925
- const d = s.capture ? "" : "?:";
1926
- const _ = i.isWindows(e);
1927
- const E = r.globChars(_);
1928
- const g = r.extglobChars(E);
1929
- const { DOT_LITERAL: m, PLUS_LITERAL: y, SLASH_LITERAL: R, ONE_CHAR: w, DOTS_SLASH: A, NO_DOT: b, NO_DOT_SLASH: v, NO_DOTS_SLASH: S, QMARK: C, QMARK_NO_DOT: x, STAR: T, START_ANCHOR: H } = E;
1930
- const globstar = (t)=>`(${d}(?:(?!${H}${t.dot ? A : m}).)*?)`;
1931
- const O = s.dot ? "" : b;
1932
- const P = s.dot ? C : x;
1933
- let I = true === s.bash ? globstar(s) : T;
1934
- if (s.capture) I = `(${I})`;
1935
- if ("boolean" == typeof s.noext) s.noextglob = s.noext;
1936
- const L = {
1937
- input: t,
1938
- index: -1,
1939
- start: 0,
1940
- dot: true === s.dot,
1941
- consumed: "",
1942
- output: "",
1943
- prefix: "",
1944
- backtrack: false,
1945
- negated: false,
1946
- brackets: 0,
1947
- braces: 0,
1948
- parens: 0,
1949
- quotes: 0,
1950
- globstar: false,
1951
- tokens: p
1952
- };
1953
- t = i.removePrefix(t, L);
1954
- f = t.length;
1955
- const N = [];
1956
- const k = [];
1957
- const $ = [];
1958
- let D = h;
1959
- let F;
1960
- const eos = ()=>L.index === f - 1;
1961
- const M = L.peek = (e = 1)=>t[L.index + e];
1962
- const W = L.advance = ()=>t[++L.index] || "";
1963
- const remaining = ()=>t.slice(L.index + 1);
1964
- const consume = (t = "", e = 0)=>{
1965
- L.consumed += t;
1966
- L.index += e;
1967
- };
1968
- const append = (t)=>{
1969
- L.output += null != t.output ? t.output : t.value;
1970
- consume(t.value);
1971
- };
1972
- const negate = ()=>{
1973
- let t = 1;
1974
- while("!" === M() && ("(" !== M(2) || "?" === M(3))){
1975
- W();
1976
- L.start++;
1977
- t++;
1978
- }
1979
- if (t % 2 === 0) return false;
1980
- L.negated = true;
1981
- L.start++;
1982
- return true;
1983
- };
1984
- const increment = (t)=>{
1985
- L[t]++;
1986
- $.push(t);
1987
- };
1988
- const decrement = (t)=>{
1989
- L[t]--;
1990
- $.pop();
1991
- };
1992
- const push = (t)=>{
1993
- if ("globstar" === D.type) {
1994
- const e = L.braces > 0 && ("comma" === t.type || "brace" === t.type);
1995
- const s = true === t.extglob || N.length && ("pipe" === t.type || "paren" === t.type);
1996
- if ("slash" !== t.type && "paren" !== t.type && !e && !s) {
1997
- L.output = L.output.slice(0, -D.output.length);
1998
- D.type = "star";
1999
- D.value = "*";
2000
- D.output = I;
2001
- L.output += D.output;
2002
- }
2003
- }
2004
- if (N.length && "paren" !== t.type) N[N.length - 1].inner += t.value;
2005
- if (t.value || t.output) append(t);
2006
- if (D && "text" === D.type && "text" === t.type) {
2007
- D.value += t.value;
2008
- D.output = (D.output || "") + t.value;
2009
- return;
2010
- }
2011
- t.prev = D;
2012
- p.push(t);
2013
- D = t;
2014
- };
2015
- const extglobOpen = (t, e)=>{
2016
- const r = {
2017
- ...g[e],
2018
- conditions: 1,
2019
- inner: ""
2020
- };
2021
- r.prev = D;
2022
- r.parens = L.parens;
2023
- r.output = L.output;
2024
- const i = (s.capture ? "(" : "") + r.open;
2025
- increment("parens");
2026
- push({
2027
- type: t,
2028
- value: e,
2029
- output: L.output ? "" : w
2030
- });
2031
- push({
2032
- type: "paren",
2033
- extglob: true,
2034
- value: W(),
2035
- output: i
2036
- });
2037
- N.push(r);
2038
- };
2039
- const extglobClose = (t)=>{
2040
- let e = t.close + (s.capture ? ")" : "");
2041
- let r;
2042
- if ("negate" === t.type) {
2043
- let i = I;
2044
- if (t.inner && t.inner.length > 1 && t.inner.includes("/")) i = globstar(s);
2045
- if (i !== I || eos() || /^\)+$/.test(remaining())) e = t.close = `)$))${i}`;
2046
- if (t.inner.includes("*") && (r = remaining()) && /^\.[^\\/.]+$/.test(r)) e = t.close = `)${r})${i})`;
2047
- if ("bos" === t.prev.type) L.negatedExtglob = true;
2048
- }
2049
- push({
2050
- type: "paren",
2051
- extglob: true,
2052
- value: F,
2053
- output: e
2054
- });
2055
- decrement("parens");
2056
- };
2057
- if (false !== s.fastpaths && !/(^[*!]|[/()[\]{}"])/.test(t)) {
2058
- let r = false;
2059
- let n = t.replace(u, (t, e, s, i, n, o)=>{
2060
- if ("\\" === i) {
2061
- r = true;
2062
- return t;
2063
- }
2064
- if ("?" === i) {
2065
- if (e) return e + i + (n ? C.repeat(n.length) : "");
2066
- if (0 === o) return P + (n ? C.repeat(n.length) : "");
2067
- return C.repeat(s.length);
2068
- }
2069
- if ("." === i) return m.repeat(s.length);
2070
- if ("*" === i) {
2071
- if (e) return e + i + (n ? I : "");
2072
- return I;
2073
- }
2074
- return e ? t : `\\${t}`;
2075
- });
2076
- if (true === r) n = true === s.unescape ? n.replace(/\\/g, "") : n.replace(/\\+/g, (t)=>t.length % 2 === 0 ? "\\\\" : t ? "\\" : "");
2077
- if (n === t && true === s.contains) {
2078
- L.output = t;
2079
- return L;
2080
- }
2081
- L.output = i.wrapOutput(n, L, e);
2082
- return L;
2083
- }
2084
- while(!eos()){
2085
- F = W();
2086
- if ("\0" === F) continue;
2087
- if ("\\" === F) {
2088
- const t = M();
2089
- if ("/" === t && true !== s.bash) continue;
2090
- if ("." === t || ";" === t) continue;
2091
- if (!t) {
2092
- F += "\\";
2093
- push({
2094
- type: "text",
2095
- value: F
2096
- });
2097
- continue;
2098
- }
2099
- const e = /^\\+/.exec(remaining());
2100
- let r = 0;
2101
- if (e && e[0].length > 2) {
2102
- r = e[0].length;
2103
- L.index += r;
2104
- if (r % 2 !== 0) F += "\\";
2105
- }
2106
- if (true === s.unescape) F = W();
2107
- else F += W();
2108
- if (0 === L.brackets) {
2109
- push({
2110
- type: "text",
2111
- value: F
2112
- });
2113
- continue;
2114
- }
2115
- }
2116
- if (L.brackets > 0 && ("]" !== F || "[" === D.value || "[^" === D.value)) {
2117
- if (false !== s.posix && ":" === F) {
2118
- const t = D.value.slice(1);
2119
- if (t.includes("[")) {
2120
- D.posix = true;
2121
- if (t.includes(":")) {
2122
- const t = D.value.lastIndexOf("[");
2123
- const e = D.value.slice(0, t);
2124
- const s = D.value.slice(t + 2);
2125
- const r = o[s];
2126
- if (r) {
2127
- D.value = e + r;
2128
- L.backtrack = true;
2129
- W();
2130
- if (!h.output && 1 === p.indexOf(D)) h.output = w;
2131
- continue;
2132
- }
2133
- }
2134
- }
2135
- }
2136
- if ("[" === F && ":" !== M() || "-" === F && "]" === M()) F = `\\${F}`;
2137
- if ("]" === F && ("[" === D.value || "[^" === D.value)) F = `\\${F}`;
2138
- if (true === s.posix && "!" === F && "[" === D.value) F = "^";
2139
- D.value += F;
2140
- append({
2141
- value: F
2142
- });
2143
- continue;
2144
- }
2145
- if (1 === L.quotes && '"' !== F) {
2146
- F = i.escapeRegex(F);
2147
- D.value += F;
2148
- append({
2149
- value: F
2150
- });
2151
- continue;
2152
- }
2153
- if ('"' === F) {
2154
- L.quotes = 1 === L.quotes ? 0 : 1;
2155
- if (true === s.keepQuotes) push({
2156
- type: "text",
2157
- value: F
2158
- });
2159
- continue;
2160
- }
2161
- if ("(" === F) {
2162
- increment("parens");
2163
- push({
2164
- type: "paren",
2165
- value: F
2166
- });
2167
- continue;
2168
- }
2169
- if (")" === F) {
2170
- if (0 === L.parens && true === s.strictBrackets) throw new SyntaxError(syntaxError("opening", "("));
2171
- const t = N[N.length - 1];
2172
- if (t && L.parens === t.parens + 1) {
2173
- extglobClose(N.pop());
2174
- continue;
2175
- }
2176
- push({
2177
- type: "paren",
2178
- value: F,
2179
- output: L.parens ? ")" : "\\)"
2180
- });
2181
- decrement("parens");
2182
- continue;
2183
- }
2184
- if ("[" === F) {
2185
- if (true !== s.nobracket && remaining().includes("]")) increment("brackets");
2186
- else {
2187
- if (true !== s.nobracket && true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", "]"));
2188
- F = `\\${F}`;
2189
- }
2190
- push({
2191
- type: "bracket",
2192
- value: F
2193
- });
2194
- continue;
2195
- }
2196
- if ("]" === F) {
2197
- if (true === s.nobracket || D && "bracket" === D.type && 1 === D.value.length) {
2198
- push({
2199
- type: "text",
2200
- value: F,
2201
- output: `\\${F}`
2202
- });
2203
- continue;
2204
- }
2205
- if (0 === L.brackets) {
2206
- if (true === s.strictBrackets) throw new SyntaxError(syntaxError("opening", "["));
2207
- push({
2208
- type: "text",
2209
- value: F,
2210
- output: `\\${F}`
2211
- });
2212
- continue;
2213
- }
2214
- decrement("brackets");
2215
- const t = D.value.slice(1);
2216
- if (true !== D.posix && "^" === t[0] && !t.includes("/")) F = `/${F}`;
2217
- D.value += F;
2218
- append({
2219
- value: F
2220
- });
2221
- if (false === s.literalBrackets || i.hasRegexChars(t)) continue;
2222
- const e = i.escapeRegex(D.value);
2223
- L.output = L.output.slice(0, -D.value.length);
2224
- if (true === s.literalBrackets) {
2225
- L.output += e;
2226
- D.value = e;
2227
- continue;
2228
- }
2229
- D.value = `(${d}${e}|${D.value})`;
2230
- L.output += D.value;
2231
- continue;
2232
- }
2233
- if ("{" === F && true !== s.nobrace) {
2234
- increment("braces");
2235
- const t = {
2236
- type: "brace",
2237
- value: F,
2238
- output: "(",
2239
- outputIndex: L.output.length,
2240
- tokensIndex: L.tokens.length
2241
- };
2242
- k.push(t);
2243
- push(t);
2244
- continue;
2245
- }
2246
- if ("}" === F) {
2247
- const t = k[k.length - 1];
2248
- if (true === s.nobrace || !t) {
2249
- push({
2250
- type: "text",
2251
- value: F,
2252
- output: F
2253
- });
2254
- continue;
2255
- }
2256
- let e = ")";
2257
- if (true === t.dots) {
2258
- const t = p.slice();
2259
- const r = [];
2260
- for(let e = t.length - 1; e >= 0; e--){
2261
- p.pop();
2262
- if ("brace" === t[e].type) break;
2263
- if ("dots" !== t[e].type) r.unshift(t[e].value);
2264
- }
2265
- e = expandRange(r, s);
2266
- L.backtrack = true;
2267
- }
2268
- if (true !== t.comma && true !== t.dots) {
2269
- const s = L.output.slice(0, t.outputIndex);
2270
- const r = L.tokens.slice(t.tokensIndex);
2271
- t.value = t.output = "\\{";
2272
- F = e = "\\}";
2273
- L.output = s;
2274
- for (const t of r)L.output += t.output || t.value;
2275
- }
2276
- push({
2277
- type: "brace",
2278
- value: F,
2279
- output: e
2280
- });
2281
- decrement("braces");
2282
- k.pop();
2283
- continue;
2284
- }
2285
- if ("|" === F) {
2286
- if (N.length > 0) N[N.length - 1].conditions++;
2287
- push({
2288
- type: "text",
2289
- value: F
2290
- });
2291
- continue;
2292
- }
2293
- if ("," === F) {
2294
- let t = F;
2295
- const e = k[k.length - 1];
2296
- if (e && "braces" === $[$.length - 1]) {
2297
- e.comma = true;
2298
- t = "|";
2299
- }
2300
- push({
2301
- type: "comma",
2302
- value: F,
2303
- output: t
2304
- });
2305
- continue;
2306
- }
2307
- if ("/" === F) {
2308
- if ("dot" === D.type && L.index === L.start + 1) {
2309
- L.start = L.index + 1;
2310
- L.consumed = "";
2311
- L.output = "";
2312
- p.pop();
2313
- D = h;
2314
- continue;
2315
- }
2316
- push({
2317
- type: "slash",
2318
- value: F,
2319
- output: R
2320
- });
2321
- continue;
2322
- }
2323
- if ("." === F) {
2324
- if (L.braces > 0 && "dot" === D.type) {
2325
- if ("." === D.value) D.output = m;
2326
- const t = k[k.length - 1];
2327
- D.type = "dots";
2328
- D.output += F;
2329
- D.value += F;
2330
- t.dots = true;
2331
- continue;
2332
- }
2333
- if (L.braces + L.parens === 0 && "bos" !== D.type && "slash" !== D.type) {
2334
- push({
2335
- type: "text",
2336
- value: F,
2337
- output: m
2338
- });
2339
- continue;
2340
- }
2341
- push({
2342
- type: "dot",
2343
- value: F,
2344
- output: m
2345
- });
2346
- continue;
2347
- }
2348
- if ("?" === F) {
2349
- const t = D && "(" === D.value;
2350
- if (!t && true !== s.noextglob && "(" === M() && "?" !== M(2)) {
2351
- extglobOpen("qmark", F);
2352
- continue;
2353
- }
2354
- if (D && "paren" === D.type) {
2355
- const t = M();
2356
- let e = F;
2357
- if ("<" === t && !i.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
2358
- if ("(" === D.value && !/[!=<:]/.test(t) || "<" === t && !/<([!=]|\w+>)/.test(remaining())) e = `\\${F}`;
2359
- push({
2360
- type: "text",
2361
- value: F,
2362
- output: e
2363
- });
2364
- continue;
2365
- }
2366
- if (true !== s.dot && ("slash" === D.type || "bos" === D.type)) {
2367
- push({
2368
- type: "qmark",
2369
- value: F,
2370
- output: x
2371
- });
2372
- continue;
2373
- }
2374
- push({
2375
- type: "qmark",
2376
- value: F,
2377
- output: C
2378
- });
2379
- continue;
2380
- }
2381
- if ("!" === F) {
2382
- if (true !== s.noextglob && "(" === M()) {
2383
- if ("?" !== M(2) || !/[!=<:]/.test(M(3))) {
2384
- extglobOpen("negate", F);
2385
- continue;
2386
- }
2387
- }
2388
- if (true !== s.nonegate && 0 === L.index) {
2389
- negate();
2390
- continue;
2391
- }
2392
- }
2393
- if ("+" === F) {
2394
- if (true !== s.noextglob && "(" === M() && "?" !== M(2)) {
2395
- extglobOpen("plus", F);
2396
- continue;
2397
- }
2398
- if (D && "(" === D.value || false === s.regex) {
2399
- push({
2400
- type: "plus",
2401
- value: F,
2402
- output: y
2403
- });
2404
- continue;
2405
- }
2406
- if (D && ("bracket" === D.type || "paren" === D.type || "brace" === D.type) || L.parens > 0) {
2407
- push({
2408
- type: "plus",
2409
- value: F
2410
- });
2411
- continue;
2412
- }
2413
- push({
2414
- type: "plus",
2415
- value: y
2416
- });
2417
- continue;
2418
- }
2419
- if ("@" === F) {
2420
- if (true !== s.noextglob && "(" === M() && "?" !== M(2)) {
2421
- push({
2422
- type: "at",
2423
- extglob: true,
2424
- value: F,
2425
- output: ""
2426
- });
2427
- continue;
2428
- }
2429
- push({
2430
- type: "text",
2431
- value: F
2432
- });
2433
- continue;
2434
- }
2435
- if ("*" !== F) {
2436
- if ("$" === F || "^" === F) F = `\\${F}`;
2437
- const t = a.exec(remaining());
2438
- if (t) {
2439
- F += t[0];
2440
- L.index += t[0].length;
2441
- }
2442
- push({
2443
- type: "text",
2444
- value: F
2445
- });
2446
- continue;
2447
- }
2448
- if (D && ("globstar" === D.type || true === D.star)) {
2449
- D.type = "star";
2450
- D.star = true;
2451
- D.value += F;
2452
- D.output = I;
2453
- L.backtrack = true;
2454
- L.globstar = true;
2455
- consume(F);
2456
- continue;
2457
- }
2458
- let e = remaining();
2459
- if (true !== s.noextglob && /^\([^?]/.test(e)) {
2460
- extglobOpen("star", F);
2461
- continue;
2462
- }
2463
- if ("star" === D.type) {
2464
- if (true === s.noglobstar) {
2465
- consume(F);
2466
- continue;
2467
- }
2468
- const r = D.prev;
2469
- const i = r.prev;
2470
- const n = "slash" === r.type || "bos" === r.type;
2471
- const o = i && ("star" === i.type || "globstar" === i.type);
2472
- if (true === s.bash && (!n || e[0] && "/" !== e[0])) {
2473
- push({
2474
- type: "star",
2475
- value: F,
2476
- output: ""
2477
- });
2478
- continue;
2479
- }
2480
- const a = L.braces > 0 && ("comma" === r.type || "brace" === r.type);
2481
- const u = N.length && ("pipe" === r.type || "paren" === r.type);
2482
- if (!n && "paren" !== r.type && !a && !u) {
2483
- push({
2484
- type: "star",
2485
- value: F,
2486
- output: ""
2487
- });
2488
- continue;
2489
- }
2490
- while("/**" === e.slice(0, 3)){
2491
- const s = t[L.index + 4];
2492
- if (s && "/" !== s) break;
2493
- e = e.slice(3);
2494
- consume("/**", 3);
2495
- }
2496
- if ("bos" === r.type && eos()) {
2497
- D.type = "globstar";
2498
- D.value += F;
2499
- D.output = globstar(s);
2500
- L.output = D.output;
2501
- L.globstar = true;
2502
- consume(F);
2503
- continue;
2504
- }
2505
- if ("slash" === r.type && "bos" !== r.prev.type && !o && eos()) {
2506
- L.output = L.output.slice(0, -(r.output + D.output).length);
2507
- r.output = `(?:${r.output}`;
2508
- D.type = "globstar";
2509
- D.output = globstar(s) + (s.strictSlashes ? ")" : "|$)");
2510
- D.value += F;
2511
- L.globstar = true;
2512
- L.output += r.output + D.output;
2513
- consume(F);
2514
- continue;
2515
- }
2516
- if ("slash" === r.type && "bos" !== r.prev.type && "/" === e[0]) {
2517
- const t = void 0 !== e[1] ? "|$" : "";
2518
- L.output = L.output.slice(0, -(r.output + D.output).length);
2519
- r.output = `(?:${r.output}`;
2520
- D.type = "globstar";
2521
- D.output = `${globstar(s)}${R}|${R}${t})`;
2522
- D.value += F;
2523
- L.output += r.output + D.output;
2524
- L.globstar = true;
2525
- consume(F + W());
2526
- push({
2527
- type: "slash",
2528
- value: "/",
2529
- output: ""
2530
- });
2531
- continue;
2532
- }
2533
- if ("bos" === r.type && "/" === e[0]) {
2534
- D.type = "globstar";
2535
- D.value += F;
2536
- D.output = `(?:^|${R}|${globstar(s)}${R})`;
2537
- L.output = D.output;
2538
- L.globstar = true;
2539
- consume(F + W());
2540
- push({
2541
- type: "slash",
2542
- value: "/",
2543
- output: ""
2544
- });
2545
- continue;
2546
- }
2547
- L.output = L.output.slice(0, -D.output.length);
2548
- D.type = "globstar";
2549
- D.output = globstar(s);
2550
- D.value += F;
2551
- L.output += D.output;
2552
- L.globstar = true;
2553
- consume(F);
2554
- continue;
2555
- }
2556
- const r = {
2557
- type: "star",
2558
- value: F,
2559
- output: I
2560
- };
2561
- if (true === s.bash) {
2562
- r.output = ".*?";
2563
- if ("bos" === D.type || "slash" === D.type) r.output = O + r.output;
2564
- push(r);
2565
- continue;
2566
- }
2567
- if (D && ("bracket" === D.type || "paren" === D.type) && true === s.regex) {
2568
- r.output = F;
2569
- push(r);
2570
- continue;
2571
- }
2572
- if (L.index === L.start || "slash" === D.type || "dot" === D.type) {
2573
- if ("dot" === D.type) {
2574
- L.output += v;
2575
- D.output += v;
2576
- } else if (true === s.dot) {
2577
- L.output += S;
2578
- D.output += S;
2579
- } else {
2580
- L.output += O;
2581
- D.output += O;
2582
- }
2583
- if ("*" !== M()) {
2584
- L.output += w;
2585
- D.output += w;
2586
- }
2587
- }
2588
- push(r);
2589
- }
2590
- while(L.brackets > 0){
2591
- if (true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", "]"));
2592
- L.output = i.escapeLast(L.output, "[");
2593
- decrement("brackets");
2594
- }
2595
- while(L.parens > 0){
2596
- if (true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", ")"));
2597
- L.output = i.escapeLast(L.output, "(");
2598
- decrement("parens");
2599
- }
2600
- while(L.braces > 0){
2601
- if (true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", "}"));
2602
- L.output = i.escapeLast(L.output, "{");
2603
- decrement("braces");
2604
- }
2605
- if (true !== s.strictSlashes && ("star" === D.type || "bracket" === D.type)) push({
2606
- type: "maybe_slash",
2607
- value: "",
2608
- output: `${R}?`
2609
- });
2610
- if (true === L.backtrack) {
2611
- L.output = "";
2612
- for (const t of L.tokens){
2613
- L.output += null != t.output ? t.output : t.value;
2614
- if (t.suffix) L.output += t.suffix;
2615
- }
2616
- }
2617
- return L;
2618
- };
2619
- parse.fastpaths = (t, e)=>{
2620
- const s = {
2621
- ...e
2622
- };
2623
- const o = "number" == typeof s.maxLength ? Math.min(n, s.maxLength) : n;
2624
- const a = t.length;
2625
- if (a > o) throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);
2626
- t = l[t] || t;
2627
- const u = i.isWindows(e);
2628
- const { DOT_LITERAL: c, SLASH_LITERAL: f, ONE_CHAR: h, DOTS_SLASH: p, NO_DOT: d, NO_DOTS: _, NO_DOTS_SLASH: E, STAR: g, START_ANCHOR: m } = r.globChars(u);
2629
- const y = s.dot ? _ : d;
2630
- const R = s.dot ? E : d;
2631
- const w = s.capture ? "" : "?:";
2632
- const A = {
2633
- negated: false,
2634
- prefix: ""
2635
- };
2636
- let b = true === s.bash ? ".*?" : g;
2637
- if (s.capture) b = `(${b})`;
2638
- const globstar = (t)=>{
2639
- if (true === t.noglobstar) return b;
2640
- return `(${w}(?:(?!${m}${t.dot ? p : c}).)*?)`;
2641
- };
2642
- const create = (t)=>{
2643
- switch(t){
2644
- case "*":
2645
- return `${y}${h}${b}`;
2646
- case ".*":
2647
- return `${c}${h}${b}`;
2648
- case "*.*":
2649
- return `${y}${b}${c}${h}${b}`;
2650
- case "*/*":
2651
- return `${y}${b}${f}${h}${R}${b}`;
2652
- case "**":
2653
- return y + globstar(s);
2654
- case "**/*":
2655
- return `(?:${y}${globstar(s)}${f})?${R}${h}${b}`;
2656
- case "**/*.*":
2657
- return `(?:${y}${globstar(s)}${f})?${R}${b}${c}${h}${b}`;
2658
- case "**/.*":
2659
- return `(?:${y}${globstar(s)}${f})?${c}${h}${b}`;
2660
- default:
2661
- {
2662
- const e = /^(.*?)\.(\w+)$/.exec(t);
2663
- if (!e) return;
2664
- const s = create(e[1]);
2665
- if (!s) return;
2666
- return s + c + e[2];
2667
- }
2668
- }
2669
- };
2670
- const v = i.removePrefix(t, A);
2671
- let S = create(v);
2672
- if (S && true !== s.strictSlashes) S += `${f}?`;
2673
- return S;
2674
- };
2675
- t.exports = parse;
2676
- },
2677
- 144: (t, e, s)=>{
2678
- "use strict";
2679
- const r = s(17);
2680
- const i = s(909);
2681
- const n = s(352);
2682
- const o = s(869);
2683
- const a = s(112);
2684
- const isObject = (t)=>t && "object" == typeof t && !Array.isArray(t);
2685
- const picomatch = (t, e, s = false)=>{
2686
- if (Array.isArray(t)) {
2687
- const r = t.map((t)=>picomatch(t, e, s));
2688
- const arrayMatcher = (t)=>{
2689
- for (const e of r){
2690
- const s = e(t);
2691
- if (s) return s;
2692
- }
2693
- return false;
2694
- };
2695
- return arrayMatcher;
2696
- }
2697
- const r = isObject(t) && t.tokens && t.input;
2698
- if ("" === t || "string" != typeof t && !r) throw new TypeError("Expected pattern to be a non-empty string");
2699
- const i = e || {};
2700
- const n = o.isWindows(e);
2701
- const a = r ? picomatch.compileRe(t, e) : picomatch.makeRe(t, e, false, true);
2702
- const u = a.state;
2703
- delete a.state;
2704
- let isIgnored = ()=>false;
2705
- if (i.ignore) {
2706
- const t = {
2707
- ...e,
2708
- ignore: null,
2709
- onMatch: null,
2710
- onResult: null
2711
- };
2712
- isIgnored = picomatch(i.ignore, t, s);
2713
- }
2714
- const matcher = (s, r = false)=>{
2715
- const { isMatch: o, match: l, output: c } = picomatch.test(s, a, e, {
2716
- glob: t,
2717
- posix: n
2718
- });
2719
- const f = {
2720
- glob: t,
2721
- state: u,
2722
- regex: a,
2723
- posix: n,
2724
- input: s,
2725
- output: c,
2726
- match: l,
2727
- isMatch: o
2728
- };
2729
- if ("function" == typeof i.onResult) i.onResult(f);
2730
- if (false === o) {
2731
- f.isMatch = false;
2732
- return r ? f : false;
2733
- }
2734
- if (isIgnored(s)) {
2735
- if ("function" == typeof i.onIgnore) i.onIgnore(f);
2736
- f.isMatch = false;
2737
- return r ? f : false;
2738
- }
2739
- if ("function" == typeof i.onMatch) i.onMatch(f);
2740
- return r ? f : true;
2741
- };
2742
- if (s) matcher.state = u;
2743
- return matcher;
2744
- };
2745
- picomatch.test = (t, e, s, { glob: r, posix: i } = {})=>{
2746
- if ("string" != typeof t) throw new TypeError("Expected input to be a string");
2747
- if ("" === t) return {
2748
- isMatch: false,
2749
- output: ""
2750
- };
2751
- const n = s || {};
2752
- const a = n.format || (i ? o.toPosixSlashes : null);
2753
- let u = t === r;
2754
- let l = u && a ? a(t) : t;
2755
- if (false === u) {
2756
- l = a ? a(t) : t;
2757
- u = l === r;
2758
- }
2759
- if (false === u || true === n.capture) u = true === n.matchBase || true === n.basename ? picomatch.matchBase(t, e, s, i) : e.exec(l);
2760
- return {
2761
- isMatch: Boolean(u),
2762
- match: u,
2763
- output: l
2764
- };
2765
- };
2766
- picomatch.matchBase = (t, e, s, i = o.isWindows(s))=>{
2767
- const n = e instanceof RegExp ? e : picomatch.makeRe(e, s);
2768
- return n.test(r.basename(t));
2769
- };
2770
- picomatch.isMatch = (t, e, s)=>picomatch(e, s)(t);
2771
- picomatch.parse = (t, e)=>{
2772
- if (Array.isArray(t)) return t.map((t)=>picomatch.parse(t, e));
2773
- return n(t, {
2774
- ...e,
2775
- fastpaths: false
2776
- });
2777
- };
2778
- picomatch.scan = (t, e)=>i(t, e);
2779
- picomatch.compileRe = (t, e, s = false, r = false)=>{
2780
- if (true === s) return t.output;
2781
- const i = e || {};
2782
- const n = i.contains ? "" : "^";
2783
- const o = i.contains ? "" : "$";
2784
- let a = `${n}(?:${t.output})${o}`;
2785
- if (t && true === t.negated) a = `^(?!${a}).*$`;
2786
- const u = picomatch.toRegex(a, e);
2787
- if (true === r) u.state = t;
2788
- return u;
2789
- };
2790
- picomatch.makeRe = (t, e = {}, s = false, r = false)=>{
2791
- if (!t || "string" != typeof t) throw new TypeError("Expected a non-empty string");
2792
- let i = {
2793
- negated: false,
2794
- fastpaths: true
2795
- };
2796
- if (false !== e.fastpaths && ("." === t[0] || "*" === t[0])) i.output = n.fastpaths(t, e);
2797
- if (!i.output) i = n(t, e);
2798
- return picomatch.compileRe(i, e, s, r);
2799
- };
2800
- picomatch.toRegex = (t, e)=>{
2801
- try {
2802
- const s = e || {};
2803
- return new RegExp(t, s.flags || (s.nocase ? "i" : ""));
2804
- } catch (t) {
2805
- if (e && true === e.debug) throw t;
2806
- return /$^/;
2807
- }
2808
- };
2809
- picomatch.constants = a;
2810
- t.exports = picomatch;
2811
- },
2812
- 909: (t, e, s)=>{
2813
- "use strict";
2814
- const r = s(869);
2815
- const { CHAR_ASTERISK: i, CHAR_AT: n, CHAR_BACKWARD_SLASH: o, CHAR_COMMA: a, CHAR_DOT: u, CHAR_EXCLAMATION_MARK: l, CHAR_FORWARD_SLASH: c, CHAR_LEFT_CURLY_BRACE: f, CHAR_LEFT_PARENTHESES: h, CHAR_LEFT_SQUARE_BRACKET: p, CHAR_PLUS: d, CHAR_QUESTION_MARK: _, CHAR_RIGHT_CURLY_BRACE: E, CHAR_RIGHT_PARENTHESES: g, CHAR_RIGHT_SQUARE_BRACKET: m } = s(112);
2816
- const isPathSeparator = (t)=>t === c || t === o;
2817
- const depth = (t)=>{
2818
- if (true !== t.isPrefix) t.depth = t.isGlobstar ? 1 / 0 : 1;
2819
- };
2820
- const scan = (t, e)=>{
2821
- const s = e || {};
2822
- const y = t.length - 1;
2823
- const R = true === s.parts || true === s.scanToEnd;
2824
- const w = [];
2825
- const A = [];
2826
- const b = [];
2827
- let v = t;
2828
- let S = -1;
2829
- let C = 0;
2830
- let x = 0;
2831
- let T = false;
2832
- let H = false;
2833
- let O = false;
2834
- let P = false;
2835
- let I = false;
2836
- let L = false;
2837
- let N = false;
2838
- let k = false;
2839
- let $ = false;
2840
- let D = false;
2841
- let F = 0;
2842
- let M;
2843
- let W;
2844
- let G = {
2845
- value: "",
2846
- depth: 0,
2847
- isGlob: false
2848
- };
2849
- const eos = ()=>S >= y;
2850
- const peek = ()=>v.charCodeAt(S + 1);
2851
- const advance = ()=>{
2852
- M = W;
2853
- return v.charCodeAt(++S);
2854
- };
2855
- while(S < y){
2856
- W = advance();
2857
- let t;
2858
- if (W === o) {
2859
- N = G.backslashes = true;
2860
- W = advance();
2861
- if (W === f) L = true;
2862
- continue;
2863
- }
2864
- if (true === L || W === f) {
2865
- F++;
2866
- while(true !== eos() && (W = advance())){
2867
- if (W === o) {
2868
- N = G.backslashes = true;
2869
- advance();
2870
- continue;
2871
- }
2872
- if (W === f) {
2873
- F++;
2874
- continue;
2875
- }
2876
- if (true !== L && W === u && (W = advance()) === u) {
2877
- T = G.isBrace = true;
2878
- O = G.isGlob = true;
2879
- D = true;
2880
- if (true === R) continue;
2881
- break;
2882
- }
2883
- if (true !== L && W === a) {
2884
- T = G.isBrace = true;
2885
- O = G.isGlob = true;
2886
- D = true;
2887
- if (true === R) continue;
2888
- break;
2889
- }
2890
- if (W === E) {
2891
- F--;
2892
- if (0 === F) {
2893
- L = false;
2894
- T = G.isBrace = true;
2895
- D = true;
2896
- break;
2897
- }
2898
- }
2899
- }
2900
- if (true === R) continue;
2901
- break;
2902
- }
2903
- if (W === c) {
2904
- w.push(S);
2905
- A.push(G);
2906
- G = {
2907
- value: "",
2908
- depth: 0,
2909
- isGlob: false
2910
- };
2911
- if (true === D) continue;
2912
- if (M === u && S === C + 1) {
2913
- C += 2;
2914
- continue;
2915
- }
2916
- x = S + 1;
2917
- continue;
2918
- }
2919
- if (true !== s.noext) {
2920
- const t = W === d || W === n || W === i || W === _ || W === l;
2921
- if (true === t && peek() === h) {
2922
- O = G.isGlob = true;
2923
- P = G.isExtglob = true;
2924
- D = true;
2925
- if (W === l && S === C) $ = true;
2926
- if (true === R) {
2927
- while(true !== eos() && (W = advance())){
2928
- if (W === o) {
2929
- N = G.backslashes = true;
2930
- W = advance();
2931
- continue;
2932
- }
2933
- if (W === g) {
2934
- O = G.isGlob = true;
2935
- D = true;
2936
- break;
2937
- }
2938
- }
2939
- continue;
2940
- }
2941
- break;
2942
- }
2943
- }
2944
- if (W === i) {
2945
- if (M === i) I = G.isGlobstar = true;
2946
- O = G.isGlob = true;
2947
- D = true;
2948
- if (true === R) continue;
2949
- break;
2950
- }
2951
- if (W === _) {
2952
- O = G.isGlob = true;
2953
- D = true;
2954
- if (true === R) continue;
2955
- break;
2956
- }
2957
- if (W === p) {
2958
- while(true !== eos() && (t = advance())){
2959
- if (t === o) {
2960
- N = G.backslashes = true;
2961
- advance();
2962
- continue;
2963
- }
2964
- if (t === m) {
2965
- H = G.isBracket = true;
2966
- O = G.isGlob = true;
2967
- D = true;
2968
- break;
2969
- }
2970
- }
2971
- if (true === R) continue;
2972
- break;
2973
- }
2974
- if (true !== s.nonegate && W === l && S === C) {
2975
- k = G.negated = true;
2976
- C++;
2977
- continue;
2978
- }
2979
- if (true !== s.noparen && W === h) {
2980
- O = G.isGlob = true;
2981
- if (true === R) {
2982
- while(true !== eos() && (W = advance())){
2983
- if (W === h) {
2984
- N = G.backslashes = true;
2985
- W = advance();
2986
- continue;
2987
- }
2988
- if (W === g) {
2989
- D = true;
2990
- break;
2991
- }
2992
- }
2993
- continue;
2994
- }
2995
- break;
2996
- }
2997
- if (true === O) {
2998
- D = true;
2999
- if (true === R) continue;
3000
- break;
3001
- }
3002
- }
3003
- if (true === s.noext) {
3004
- P = false;
3005
- O = false;
3006
- }
3007
- let B = v;
3008
- let U = "";
3009
- let K = "";
3010
- if (C > 0) {
3011
- U = v.slice(0, C);
3012
- v = v.slice(C);
3013
- x -= C;
3014
- }
3015
- if (B && true === O && x > 0) {
3016
- B = v.slice(0, x);
3017
- K = v.slice(x);
3018
- } else if (true === O) {
3019
- B = "";
3020
- K = v;
3021
- } else B = v;
3022
- if (B && "" !== B && "/" !== B && B !== v) {
3023
- if (isPathSeparator(B.charCodeAt(B.length - 1))) B = B.slice(0, -1);
3024
- }
3025
- if (true === s.unescape) {
3026
- if (K) K = r.removeBackslashes(K);
3027
- if (B && true === N) B = r.removeBackslashes(B);
3028
- }
3029
- const V = {
3030
- prefix: U,
3031
- input: t,
3032
- start: C,
3033
- base: B,
3034
- glob: K,
3035
- isBrace: T,
3036
- isBracket: H,
3037
- isGlob: O,
3038
- isExtglob: P,
3039
- isGlobstar: I,
3040
- negated: k,
3041
- negatedExtglob: $
3042
- };
3043
- if (true === s.tokens) {
3044
- V.maxDepth = 0;
3045
- if (!isPathSeparator(W)) A.push(G);
3046
- V.tokens = A;
3047
- }
3048
- if (true === s.parts || true === s.tokens) {
3049
- let e;
3050
- for(let r = 0; r < w.length; r++){
3051
- const i = e ? e + 1 : C;
3052
- const n = w[r];
3053
- const o = t.slice(i, n);
3054
- if (s.tokens) {
3055
- if (0 === r && 0 !== C) {
3056
- A[r].isPrefix = true;
3057
- A[r].value = U;
3058
- } else A[r].value = o;
3059
- depth(A[r]);
3060
- V.maxDepth += A[r].depth;
3061
- }
3062
- if (0 !== r || "" !== o) b.push(o);
3063
- e = n;
3064
- }
3065
- if (e && e + 1 < t.length) {
3066
- const r = t.slice(e + 1);
3067
- b.push(r);
3068
- if (s.tokens) {
3069
- A[A.length - 1].value = r;
3070
- depth(A[A.length - 1]);
3071
- V.maxDepth += A[A.length - 1].depth;
3072
- }
3073
- }
3074
- V.slashes = w;
3075
- V.parts = b;
3076
- }
3077
- return V;
3078
- };
3079
- t.exports = scan;
3080
- },
3081
- 869: (t, e, s)=>{
3082
- "use strict";
3083
- const r = s(17);
3084
- const i = "win32" === process.platform;
3085
- const { REGEX_BACKSLASH: n, REGEX_REMOVE_BACKSLASH: o, REGEX_SPECIAL_CHARS: a, REGEX_SPECIAL_CHARS_GLOBAL: u } = s(112);
3086
- e.isObject = (t)=>null !== t && "object" == typeof t && !Array.isArray(t);
3087
- e.hasRegexChars = (t)=>a.test(t);
3088
- e.isRegexChar = (t)=>1 === t.length && e.hasRegexChars(t);
3089
- e.escapeRegex = (t)=>t.replace(u, "\\$1");
3090
- e.toPosixSlashes = (t)=>t.replace(n, "/");
3091
- e.removeBackslashes = (t)=>t.replace(o, (t)=>"\\" === t ? "" : t);
3092
- e.supportsLookbehinds = ()=>{
3093
- const t = process.version.slice(1).split(".").map(Number);
3094
- if (3 === t.length && t[0] >= 9 || 8 === t[0] && t[1] >= 10) return true;
3095
- return false;
3096
- };
3097
- e.isWindows = (t)=>{
3098
- if (t && "boolean" == typeof t.windows) return t.windows;
3099
- return true === i || "\\" === r.sep;
3100
- };
3101
- e.escapeLast = (t, s, r)=>{
3102
- const i = t.lastIndexOf(s, r);
3103
- if (-1 === i) return t;
3104
- if ("\\" === t[i - 1]) return e.escapeLast(t, s, i - 1);
3105
- return `${t.slice(0, i)}\\${t.slice(i)}`;
3106
- };
3107
- e.removePrefix = (t, e = {})=>{
3108
- let s = t;
3109
- if (s.startsWith("./")) {
3110
- s = s.slice(2);
3111
- e.prefix = "./";
3112
- }
3113
- return s;
3114
- };
3115
- e.wrapOutput = (t, e = {}, s = {})=>{
3116
- const r = s.contains ? "" : "^";
3117
- const i = s.contains ? "" : "$";
3118
- let n = `${r}(?:${t})${i}`;
3119
- if (true === e.negated) n = `(?:^(?!${n}).*$)`;
3120
- return n;
3121
- };
3122
- },
3123
- 559: (t, e, s)=>{
3124
- "use strict";
3125
- const r = s(147);
3126
- const { Readable: i } = s(781);
3127
- const n = s(17);
3128
- const { promisify: o } = s(837);
3129
- const a = s(700);
3130
- const u = o(r.readdir);
3131
- const l = o(r.stat);
3132
- const c = o(r.lstat);
3133
- const f = o(r.realpath);
3134
- const h = "!";
3135
- const p = "READDIRP_RECURSIVE_ERROR";
3136
- const d = new Set([
3137
- "ENOENT",
3138
- "EPERM",
3139
- "EACCES",
3140
- "ELOOP",
3141
- p
3142
- ]);
3143
- const _ = "files";
3144
- const E = "directories";
3145
- const g = "files_directories";
3146
- const m = "all";
3147
- const y = [
3148
- _,
3149
- E,
3150
- g,
3151
- m
3152
- ];
3153
- const isNormalFlowError = (t)=>d.has(t.code);
3154
- const [R, w] = process.versions.node.split(".").slice(0, 2).map((t)=>Number.parseInt(t, 10));
3155
- const A = "win32" === process.platform && (R > 10 || 10 === R && w >= 5);
3156
- const normalizeFilter = (t)=>{
3157
- if (void 0 === t) return;
3158
- if ("function" == typeof t) return t;
3159
- if ("string" == typeof t) {
3160
- const e = a(t.trim());
3161
- return (t)=>e(t.basename);
3162
- }
3163
- if (Array.isArray(t)) {
3164
- const e = [];
3165
- const s = [];
3166
- for (const r of t){
3167
- const t = r.trim();
3168
- if (t.charAt(0) === h) s.push(a(t.slice(1)));
3169
- else e.push(a(t));
3170
- }
3171
- if (s.length > 0) {
3172
- if (e.length > 0) return (t)=>e.some((e)=>e(t.basename)) && !s.some((e)=>e(t.basename));
3173
- return (t)=>!s.some((e)=>e(t.basename));
3174
- }
3175
- return (t)=>e.some((e)=>e(t.basename));
3176
- }
3177
- };
3178
- class ReaddirpStream extends i {
3179
- static get defaultOptions() {
3180
- return {
3181
- root: ".",
3182
- fileFilter: (t)=>true,
3183
- directoryFilter: (t)=>true,
3184
- type: _,
3185
- lstat: false,
3186
- depth: 2147483648,
3187
- alwaysStat: false
3188
- };
3189
- }
3190
- constructor(t = {}){
3191
- super({
3192
- objectMode: true,
3193
- autoDestroy: true,
3194
- highWaterMark: t.highWaterMark || 4096
3195
- });
3196
- const e = {
3197
- ...ReaddirpStream.defaultOptions,
3198
- ...t
3199
- };
3200
- const { root: s, type: i } = e;
3201
- this._fileFilter = normalizeFilter(e.fileFilter);
3202
- this._directoryFilter = normalizeFilter(e.directoryFilter);
3203
- const o = e.lstat ? c : l;
3204
- if (A) this._stat = (t)=>o(t, {
3205
- bigint: true
3206
- });
3207
- else this._stat = o;
3208
- this._maxDepth = e.depth;
3209
- this._wantsDir = [
3210
- E,
3211
- g,
3212
- m
3213
- ].includes(i);
3214
- this._wantsFile = [
3215
- _,
3216
- g,
3217
- m
3218
- ].includes(i);
3219
- this._wantsEverything = i === m;
3220
- this._root = n.resolve(s);
3221
- this._isDirent = "Dirent" in r && !e.alwaysStat;
3222
- this._statsProp = this._isDirent ? "dirent" : "stats";
3223
- this._rdOptions = {
3224
- encoding: "utf8",
3225
- withFileTypes: this._isDirent
3226
- };
3227
- this.parents = [
3228
- this._exploreDir(s, 1)
3229
- ];
3230
- this.reading = false;
3231
- this.parent = void 0;
3232
- }
3233
- async _read(t) {
3234
- if (this.reading) return;
3235
- this.reading = true;
3236
- try {
3237
- while(!this.destroyed && t > 0){
3238
- const { path: e, depth: s, files: r = [] } = this.parent || {};
3239
- if (r.length > 0) {
3240
- const i = r.splice(0, t).map((t)=>this._formatEntry(t, e));
3241
- for (const e of (await Promise.all(i))){
3242
- if (this.destroyed) return;
3243
- const r = await this._getEntryType(e);
3244
- if ("directory" === r && this._directoryFilter(e)) {
3245
- if (s <= this._maxDepth) this.parents.push(this._exploreDir(e.fullPath, s + 1));
3246
- if (this._wantsDir) {
3247
- this.push(e);
3248
- t--;
3249
- }
3250
- } else if (("file" === r || this._includeAsFile(e)) && this._fileFilter(e)) {
3251
- if (this._wantsFile) {
3252
- this.push(e);
3253
- t--;
3254
- }
3255
- }
3256
- }
3257
- } else {
3258
- const t = this.parents.pop();
3259
- if (!t) {
3260
- this.push(null);
3261
- break;
3262
- }
3263
- this.parent = await t;
3264
- if (this.destroyed) return;
3265
- }
3266
- }
3267
- } catch (t) {
3268
- this.destroy(t);
3269
- } finally{
3270
- this.reading = false;
3271
- }
3272
- }
3273
- async _exploreDir(t, e) {
3274
- let s;
3275
- try {
3276
- s = await u(t, this._rdOptions);
3277
- } catch (t) {
3278
- this._onError(t);
3279
- }
3280
- return {
3281
- files: s,
3282
- depth: e,
3283
- path: t
3284
- };
3285
- }
3286
- async _formatEntry(t, e) {
3287
- let s;
3288
- try {
3289
- const r = this._isDirent ? t.name : t;
3290
- const i = n.resolve(n.join(e, r));
3291
- s = {
3292
- path: n.relative(this._root, i),
3293
- fullPath: i,
3294
- basename: r
3295
- };
3296
- s[this._statsProp] = this._isDirent ? t : await this._stat(i);
3297
- } catch (t) {
3298
- this._onError(t);
3299
- }
3300
- return s;
3301
- }
3302
- _onError(t) {
3303
- if (isNormalFlowError(t) && !this.destroyed) this.emit("warn", t);
3304
- else this.destroy(t);
3305
- }
3306
- async _getEntryType(t) {
3307
- const e = t && t[this._statsProp];
3308
- if (!e) return;
3309
- if (e.isFile()) return "file";
3310
- if (e.isDirectory()) return "directory";
3311
- if (e && e.isSymbolicLink()) {
3312
- const e = t.fullPath;
3313
- try {
3314
- const t = await f(e);
3315
- const s = await c(t);
3316
- if (s.isFile()) return "file";
3317
- if (s.isDirectory()) {
3318
- const s = t.length;
3319
- if (e.startsWith(t) && e.substr(s, 1) === n.sep) {
3320
- const s = new Error(`Circular symlink detected: "${e}" points to "${t}"`);
3321
- s.code = p;
3322
- return this._onError(s);
3323
- }
3324
- return "directory";
3325
- }
3326
- } catch (t) {
3327
- this._onError(t);
3328
- }
3329
- }
3330
- }
3331
- _includeAsFile(t) {
3332
- const e = t && t[this._statsProp];
3333
- return e && this._wantsEverything && !e.isDirectory();
3334
- }
3335
- }
3336
- const readdirp = (t, e = {})=>{
3337
- let s = e.entryType || e.type;
3338
- if ("both" === s) s = g;
3339
- if (s) e.type = s;
3340
- if (t) {
3341
- if ("string" != typeof t) throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
3342
- else if (s && !y.includes(s)) throw new Error(`readdirp: Invalid type passed. Use one of ${y.join(", ")}`);
3343
- } else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
3344
- e.root = t;
3345
- return new ReaddirpStream(e);
3346
- };
3347
- const readdirpPromise = (t, e = {})=>new Promise((s, r)=>{
3348
- const i = [];
3349
- readdirp(t, e).on("data", (t)=>i.push(t)).on("end", ()=>s(i)).on("error", (t)=>r(t));
3350
- });
3351
- readdirp.promise = readdirpPromise;
3352
- readdirp.ReaddirpStream = ReaddirpStream;
3353
- readdirp.default = readdirp;
3354
- t.exports = readdirp;
3355
- },
3356
- 211: (t, e, s)=>{
3357
- "use strict";
3358
- /*!
3359
- * to-regex-range <https://github.com/micromatch/to-regex-range>
3360
- *
3361
- * Copyright (c) 2015-present, Jon Schlinkert.
3362
- * Released under the MIT License.
3363
- */ const r = s(387);
3364
- const toRegexRange = (t, e, s)=>{
3365
- if (false === r(t)) throw new TypeError("toRegexRange: expected the first argument to be a number");
3366
- if (void 0 === e || t === e) return String(t);
3367
- if (false === r(e)) throw new TypeError("toRegexRange: expected the second argument to be a number.");
3368
- let i = {
3369
- relaxZeros: true,
3370
- ...s
3371
- };
3372
- if ("boolean" == typeof i.strictZeros) i.relaxZeros = false === i.strictZeros;
3373
- let n = String(i.relaxZeros);
3374
- let o = String(i.shorthand);
3375
- let a = String(i.capture);
3376
- let u = String(i.wrap);
3377
- let l = t + ":" + e + "=" + n + o + a + u;
3378
- if (toRegexRange.cache.hasOwnProperty(l)) return toRegexRange.cache[l].result;
3379
- let c = Math.min(t, e);
3380
- let f = Math.max(t, e);
3381
- if (1 === Math.abs(c - f)) {
3382
- let s = t + "|" + e;
3383
- if (i.capture) return `(${s})`;
3384
- if (false === i.wrap) return s;
3385
- return `(?:${s})`;
3386
- }
3387
- let h = hasPadding(t) || hasPadding(e);
3388
- let p = {
3389
- min: t,
3390
- max: e,
3391
- a: c,
3392
- b: f
3393
- };
3394
- let d = [];
3395
- let _ = [];
3396
- if (h) {
3397
- p.isPadded = h;
3398
- p.maxLen = String(p.max).length;
3399
- }
3400
- if (c < 0) {
3401
- let t = f < 0 ? Math.abs(f) : 1;
3402
- _ = splitToPatterns(t, Math.abs(c), p, i);
3403
- c = p.a = 0;
3404
- }
3405
- if (f >= 0) d = splitToPatterns(c, f, p, i);
3406
- p.negatives = _;
3407
- p.positives = d;
3408
- p.result = collatePatterns(_, d, i);
3409
- if (true === i.capture) p.result = `(${p.result})`;
3410
- else if (false !== i.wrap && d.length + _.length > 1) p.result = `(?:${p.result})`;
3411
- toRegexRange.cache[l] = p;
3412
- return p.result;
3413
- };
3414
- function collatePatterns(t, e, s) {
3415
- let r = filterPatterns(t, e, "-", false, s) || [];
3416
- let i = filterPatterns(e, t, "", false, s) || [];
3417
- let n = filterPatterns(t, e, "-?", true, s) || [];
3418
- let o = r.concat(n).concat(i);
3419
- return o.join("|");
3420
- }
3421
- function splitToRanges(t, e) {
3422
- let s = 1;
3423
- let r = 1;
3424
- let i = countNines(t, s);
3425
- let n = new Set([
3426
- e
3427
- ]);
3428
- while(t <= i && i <= e){
3429
- n.add(i);
3430
- s += 1;
3431
- i = countNines(t, s);
3432
- }
3433
- i = countZeros(e + 1, r) - 1;
3434
- while(t < i && i <= e){
3435
- n.add(i);
3436
- r += 1;
3437
- i = countZeros(e + 1, r) - 1;
3438
- }
3439
- n = [
3440
- ...n
3441
- ];
3442
- n.sort(compare);
3443
- return n;
3444
- }
3445
- function rangeToPattern(t, e, s) {
3446
- if (t === e) return {
3447
- pattern: t,
3448
- count: [],
3449
- digits: 0
3450
- };
3451
- let r = zip(t, e);
3452
- let i = r.length;
3453
- let n = "";
3454
- let o = 0;
3455
- for(let t = 0; t < i; t++){
3456
- let [e, i] = r[t];
3457
- if (e === i) n += e;
3458
- else if ("0" !== e || "9" !== i) n += toCharacterClass(e, i, s);
3459
- else o++;
3460
- }
3461
- if (o) n += true === s.shorthand ? "\\d" : "[0-9]";
3462
- return {
3463
- pattern: n,
3464
- count: [
3465
- o
3466
- ],
3467
- digits: i
3468
- };
3469
- }
3470
- function splitToPatterns(t, e, s, r) {
3471
- let i = splitToRanges(t, e);
3472
- let n = [];
3473
- let o = t;
3474
- let a;
3475
- for(let t = 0; t < i.length; t++){
3476
- let e = i[t];
3477
- let u = rangeToPattern(String(o), String(e), r);
3478
- let l = "";
3479
- if (!s.isPadded && a && a.pattern === u.pattern) {
3480
- if (a.count.length > 1) a.count.pop();
3481
- a.count.push(u.count[0]);
3482
- a.string = a.pattern + toQuantifier(a.count);
3483
- o = e + 1;
3484
- continue;
3485
- }
3486
- if (s.isPadded) l = padZeros(e, s, r);
3487
- u.string = l + u.pattern + toQuantifier(u.count);
3488
- n.push(u);
3489
- o = e + 1;
3490
- a = u;
3491
- }
3492
- return n;
3493
- }
3494
- function filterPatterns(t, e, s, r, i) {
3495
- let n = [];
3496
- for (let i of t){
3497
- let { string: t } = i;
3498
- if (!r && !contains(e, "string", t)) n.push(s + t);
3499
- if (r && contains(e, "string", t)) n.push(s + t);
3500
- }
3501
- return n;
3502
- }
3503
- function zip(t, e) {
3504
- let s = [];
3505
- for(let r = 0; r < t.length; r++)s.push([
3506
- t[r],
3507
- e[r]
3508
- ]);
3509
- return s;
3510
- }
3511
- function compare(t, e) {
3512
- return t > e ? 1 : e > t ? -1 : 0;
3513
- }
3514
- function contains(t, e, s) {
3515
- return t.some((t)=>t[e] === s);
3516
- }
3517
- function countNines(t, e) {
3518
- return Number(String(t).slice(0, -e) + "9".repeat(e));
3519
- }
3520
- function countZeros(t, e) {
3521
- return t - t % Math.pow(10, e);
3522
- }
3523
- function toQuantifier(t) {
3524
- let [e = 0, s = ""] = t;
3525
- if (s || e > 1) return `{${e + (s ? "," + s : "")}}`;
3526
- return "";
3527
- }
3528
- function toCharacterClass(t, e, s) {
3529
- return `[${t}${e - t === 1 ? "" : "-"}${e}]`;
3530
- }
3531
- function hasPadding(t) {
3532
- return /^-?(0+)\d/.test(t);
3533
- }
3534
- function padZeros(t, e, s) {
3535
- if (!e.isPadded) return t;
3536
- let r = Math.abs(e.maxLen - String(t).length);
3537
- let i = false !== s.relaxZeros;
3538
- switch(r){
3539
- case 0:
3540
- return "";
3541
- case 1:
3542
- return i ? "0?" : "0";
3543
- case 2:
3544
- return i ? "0{0,2}" : "00";
3545
- default:
3546
- return i ? `0{0,${r}}` : `0{${r}}`;
3547
- }
3548
- }
3549
- toRegexRange.cache = {};
3550
- toRegexRange.clearCache = ()=>toRegexRange.cache = {};
3551
- t.exports = toRegexRange;
3552
- },
3553
- 653: (t, e, s)=>{
3554
- t.exports = require(s.ab + "fsevents.node");
3555
- },
3556
- 361: (t)=>{
3557
- "use strict";
3558
- t.exports = require("events");
3559
- },
3560
- 147: (t)=>{
3561
- "use strict";
3562
- t.exports = require("fs");
3563
- },
3564
- 37: (t)=>{
3565
- "use strict";
3566
- t.exports = require("os");
3567
- },
3568
- 17: (t)=>{
3569
- "use strict";
3570
- t.exports = require("path");
3571
- },
3572
- 781: (t)=>{
3573
- "use strict";
3574
- t.exports = require("stream");
3575
- },
3576
- 837: (t)=>{
3577
- "use strict";
3578
- t.exports = require("util");
3579
- },
3580
- 600: (t)=>{
3581
- "use strict";
3582
- t.exports = JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]');
3583
- }
3584
- };
3585
- var e = {};
3586
- function __nccwpck_require__(s) {
3587
- var r = e[s];
3588
- if (void 0 !== r) return r.exports;
3589
- var i = e[s] = {
3590
- exports: {}
3591
- };
3592
- var n = true;
3593
- try {
3594
- t[s](i, i.exports, __nccwpck_require__);
3595
- n = false;
3596
- } finally{
3597
- if (n) delete e[s];
3598
- }
3599
- return i.exports;
3600
- }
3601
- if (void 0 !== __nccwpck_require__) __nccwpck_require__.ab = __dirname + "/";
3602
- var s = {};
3603
- (()=>{
3604
- "use strict";
3605
- var t = s;
3606
- const { EventEmitter: e } = __nccwpck_require__(361);
3607
- const r = __nccwpck_require__(147);
3608
- const i = __nccwpck_require__(17);
3609
- const { promisify: n } = __nccwpck_require__(837);
3610
- const o = __nccwpck_require__(559);
3611
- const a = __nccwpck_require__(372)["default"];
3612
- const u = __nccwpck_require__(976);
3613
- const l = __nccwpck_require__(654);
3614
- const c = __nccwpck_require__(570);
3615
- const f = __nccwpck_require__(498);
3616
- const h = __nccwpck_require__(254);
3617
- const p = __nccwpck_require__(578);
3618
- const { EV_ALL: d, EV_READY: _, EV_ADD: E, EV_CHANGE: g, EV_UNLINK: m, EV_ADD_DIR: y, EV_UNLINK_DIR: R, EV_RAW: w, EV_ERROR: A, STR_CLOSE: b, STR_END: v, BACK_SLASH_RE: S, DOUBLE_SLASH_RE: C, SLASH_OR_BACK_SLASH_RE: x, DOT_RE: T, REPLACER_RE: H, SLASH: O, SLASH_SLASH: P, BRACE_START: I, BANG: L, ONE_DOT: N, TWO_DOTS: k, GLOBSTAR: $, SLASH_GLOBSTAR: D, ANYMATCH_OPTS: F, STRING_TYPE: M, FUNCTION_TYPE: W, EMPTY_STR: G, EMPTY_FN: B, isWindows: U, isMacos: K, isIBMi: V } = __nccwpck_require__(240);
3619
- const j = n(r.stat);
3620
- const Y = n(r.readdir);
3621
- const arrify = (t = [])=>Array.isArray(t) ? t : [
3622
- t
3623
- ];
3624
- const flatten = (t, e = [])=>{
3625
- t.forEach((t)=>{
3626
- if (Array.isArray(t)) flatten(t, e);
3627
- else e.push(t);
3628
- });
3629
- return e;
3630
- };
3631
- const unifyPaths = (t)=>{
3632
- const e = flatten(arrify(t));
3633
- if (!e.every((t)=>typeof t === M)) throw new TypeError(`Non-string provided as watch path: ${e}`);
3634
- return e.map(normalizePathToUnix);
3635
- };
3636
- const toUnix = (t)=>{
3637
- let e = t.replace(S, O);
3638
- let s = false;
3639
- if (e.startsWith(P)) s = true;
3640
- while(e.match(C))e = e.replace(C, O);
3641
- if (s) e = O + e;
3642
- return e;
3643
- };
3644
- const normalizePathToUnix = (t)=>toUnix(i.normalize(toUnix(t)));
3645
- const normalizeIgnored = (t = G)=>(e)=>{
3646
- if (typeof e !== M) return e;
3647
- return normalizePathToUnix(i.isAbsolute(e) ? e : i.join(t, e));
3648
- };
3649
- const getAbsolutePath = (t, e)=>{
3650
- if (i.isAbsolute(t)) return t;
3651
- if (t.startsWith(L)) return L + i.join(e, t.slice(1));
3652
- return i.join(e, t);
3653
- };
3654
- const undef = (t, e)=>void 0 === t[e];
3655
- class DirEntry {
3656
- constructor(t, e){
3657
- this.path = t;
3658
- this._removeWatcher = e;
3659
- this.items = new Set;
3660
- }
3661
- add(t) {
3662
- const { items: e } = this;
3663
- if (!e) return;
3664
- if (t !== N && t !== k) e.add(t);
3665
- }
3666
- async remove(t) {
3667
- const { items: e } = this;
3668
- if (!e) return;
3669
- e.delete(t);
3670
- if (e.size > 0) return;
3671
- const s = this.path;
3672
- try {
3673
- await Y(s);
3674
- } catch (t) {
3675
- if (this._removeWatcher) this._removeWatcher(i.dirname(s), i.basename(s));
3676
- }
3677
- }
3678
- has(t) {
3679
- const { items: e } = this;
3680
- if (!e) return;
3681
- return e.has(t);
3682
- }
3683
- getChildren() {
3684
- const { items: t } = this;
3685
- if (!t) return;
3686
- return [
3687
- ...t.values()
3688
- ];
3689
- }
3690
- dispose() {
3691
- this.items.clear();
3692
- delete this.path;
3693
- delete this._removeWatcher;
3694
- delete this.items;
3695
- Object.freeze(this);
3696
- }
3697
- }
3698
- const z = "stat";
3699
- const q = "lstat";
3700
- class WatchHelper {
3701
- constructor(t, e, s, r){
3702
- this.fsw = r;
3703
- this.path = t = t.replace(H, G);
3704
- this.watchPath = e;
3705
- this.fullWatchPath = i.resolve(e);
3706
- this.hasGlob = e !== t;
3707
- if (t === G) this.hasGlob = false;
3708
- this.globSymlink = this.hasGlob && s ? void 0 : false;
3709
- this.globFilter = this.hasGlob ? a(t, void 0, F) : false;
3710
- this.dirParts = this.getDirParts(t);
3711
- this.dirParts.forEach((t)=>{
3712
- if (t.length > 1) t.pop();
3713
- });
3714
- this.followSymlinks = s;
3715
- this.statMethod = s ? z : q;
3716
- }
3717
- checkGlobSymlink(t) {
3718
- if (void 0 === this.globSymlink) this.globSymlink = t.fullParentDir === this.fullWatchPath ? false : {
3719
- realPath: t.fullParentDir,
3720
- linkPath: this.fullWatchPath
3721
- };
3722
- if (this.globSymlink) return t.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
3723
- return t.fullPath;
3724
- }
3725
- entryPath(t) {
3726
- return i.join(this.watchPath, i.relative(this.watchPath, this.checkGlobSymlink(t)));
3727
- }
3728
- filterPath(t) {
3729
- const { stats: e } = t;
3730
- if (e && e.isSymbolicLink()) return this.filterDir(t);
3731
- const s = this.entryPath(t);
3732
- const r = this.hasGlob && typeof this.globFilter === W ? this.globFilter(s) : true;
3733
- return r && this.fsw._isntIgnored(s, e) && this.fsw._hasReadPermissions(e);
3734
- }
3735
- getDirParts(t) {
3736
- if (!this.hasGlob) return [];
3737
- const e = [];
3738
- const s = t.includes(I) ? c.expand(t) : [
3739
- t
3740
- ];
3741
- s.forEach((t)=>{
3742
- e.push(i.relative(this.watchPath, t).split(x));
3743
- });
3744
- return e;
3745
- }
3746
- filterDir(t) {
3747
- if (this.hasGlob) {
3748
- const e = this.getDirParts(this.checkGlobSymlink(t));
3749
- let s = false;
3750
- this.unmatchedGlob = !this.dirParts.some((t)=>t.every((t, r)=>{
3751
- if (t === $) s = true;
3752
- return s || !e[0][r] || a(t, e[0][r], F);
3753
- }));
3754
- }
3755
- return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(t), t.stats);
3756
- }
3757
- }
3758
- class FSWatcher extends e {
3759
- constructor(t){
3760
- super();
3761
- const e = {};
3762
- if (t) Object.assign(e, t);
3763
- this._watched = new Map;
3764
- this._closers = new Map;
3765
- this._ignoredPaths = new Set;
3766
- this._throttled = new Map;
3767
- this._symlinkPaths = new Map;
3768
- this._streams = new Set;
3769
- this.closed = false;
3770
- if (undef(e, "persistent")) e.persistent = true;
3771
- if (undef(e, "ignoreInitial")) e.ignoreInitial = false;
3772
- if (undef(e, "ignorePermissionErrors")) e.ignorePermissionErrors = false;
3773
- if (undef(e, "interval")) e.interval = 100;
3774
- if (undef(e, "binaryInterval")) e.binaryInterval = 300;
3775
- if (undef(e, "disableGlobbing")) e.disableGlobbing = false;
3776
- e.enableBinaryInterval = e.binaryInterval !== e.interval;
3777
- if (undef(e, "useFsEvents")) e.useFsEvents = !e.usePolling;
3778
- const s = p.canUse();
3779
- if (!s) e.useFsEvents = false;
3780
- if (undef(e, "usePolling") && !e.useFsEvents) e.usePolling = K;
3781
- if (V) e.usePolling = true;
3782
- const r = process.env.CHOKIDAR_USEPOLLING;
3783
- if (void 0 !== r) {
3784
- const t = r.toLowerCase();
3785
- if ("false" === t || "0" === t) e.usePolling = false;
3786
- else if ("true" === t || "1" === t) e.usePolling = true;
3787
- else e.usePolling = !!t;
3788
- }
3789
- const i = process.env.CHOKIDAR_INTERVAL;
3790
- if (i) e.interval = Number.parseInt(i, 10);
3791
- if (undef(e, "atomic")) e.atomic = !e.usePolling && !e.useFsEvents;
3792
- if (e.atomic) this._pendingUnlinks = new Map;
3793
- if (undef(e, "followSymlinks")) e.followSymlinks = true;
3794
- if (undef(e, "awaitWriteFinish")) e.awaitWriteFinish = false;
3795
- if (true === e.awaitWriteFinish) e.awaitWriteFinish = {};
3796
- const n = e.awaitWriteFinish;
3797
- if (n) {
3798
- if (!n.stabilityThreshold) n.stabilityThreshold = 2e3;
3799
- if (!n.pollInterval) n.pollInterval = 100;
3800
- this._pendingWrites = new Map;
3801
- }
3802
- if (e.ignored) e.ignored = arrify(e.ignored);
3803
- let o = 0;
3804
- this._emitReady = ()=>{
3805
- o++;
3806
- if (o >= this._readyCount) {
3807
- this._emitReady = B;
3808
- this._readyEmitted = true;
3809
- process.nextTick(()=>this.emit(_));
3810
- }
3811
- };
3812
- this._emitRaw = (...t)=>this.emit(w, ...t);
3813
- this._readyEmitted = false;
3814
- this.options = e;
3815
- if (e.useFsEvents) this._fsEventsHandler = new p(this);
3816
- else this._nodeFsHandler = new h(this);
3817
- Object.freeze(e);
3818
- }
3819
- add(t, e, s) {
3820
- const { cwd: r, disableGlobbing: n } = this.options;
3821
- this.closed = false;
3822
- let o = unifyPaths(t);
3823
- if (r) o = o.map((t)=>{
3824
- const e = getAbsolutePath(t, r);
3825
- if (n || !l(t)) return e;
3826
- return f(e);
3827
- });
3828
- o = o.filter((t)=>{
3829
- if (t.startsWith(L)) {
3830
- this._ignoredPaths.add(t.slice(1));
3831
- return false;
3832
- }
3833
- this._ignoredPaths.delete(t);
3834
- this._ignoredPaths.delete(t + D);
3835
- this._userIgnored = void 0;
3836
- return true;
3837
- });
3838
- if (this.options.useFsEvents && this._fsEventsHandler) {
3839
- if (!this._readyCount) this._readyCount = o.length;
3840
- if (this.options.persistent) this._readyCount *= 2;
3841
- o.forEach((t)=>this._fsEventsHandler._addToFsEvents(t));
3842
- } else {
3843
- if (!this._readyCount) this._readyCount = 0;
3844
- this._readyCount += o.length;
3845
- Promise.all(o.map(async (t)=>{
3846
- const r = await this._nodeFsHandler._addToNodeFs(t, !s, 0, 0, e);
3847
- if (r) this._emitReady();
3848
- return r;
3849
- })).then((t)=>{
3850
- if (this.closed) return;
3851
- t.filter((t)=>t).forEach((t)=>{
3852
- this.add(i.dirname(t), i.basename(e || t));
3853
- });
3854
- });
3855
- }
3856
- return this;
3857
- }
3858
- unwatch(t) {
3859
- if (this.closed) return this;
3860
- const e = unifyPaths(t);
3861
- const { cwd: s } = this.options;
3862
- e.forEach((t)=>{
3863
- if (!i.isAbsolute(t) && !this._closers.has(t)) {
3864
- if (s) t = i.join(s, t);
3865
- t = i.resolve(t);
3866
- }
3867
- this._closePath(t);
3868
- this._ignoredPaths.add(t);
3869
- if (this._watched.has(t)) this._ignoredPaths.add(t + D);
3870
- this._userIgnored = void 0;
3871
- });
3872
- return this;
3873
- }
3874
- close() {
3875
- if (this.closed) return this._closePromise;
3876
- this.closed = true;
3877
- this.removeAllListeners();
3878
- const t = [];
3879
- this._closers.forEach((e)=>e.forEach((e)=>{
3880
- const s = e();
3881
- if (s instanceof Promise) t.push(s);
3882
- }));
3883
- this._streams.forEach((t)=>t.destroy());
3884
- this._userIgnored = void 0;
3885
- this._readyCount = 0;
3886
- this._readyEmitted = false;
3887
- this._watched.forEach((t)=>t.dispose());
3888
- [
3889
- "closers",
3890
- "watched",
3891
- "streams",
3892
- "symlinkPaths",
3893
- "throttled"
3894
- ].forEach((t)=>{
3895
- this[`_${t}`].clear();
3896
- });
3897
- this._closePromise = t.length ? Promise.all(t).then(()=>void 0) : Promise.resolve();
3898
- return this._closePromise;
3899
- }
3900
- getWatched() {
3901
- const t = {};
3902
- this._watched.forEach((e, s)=>{
3903
- const r = this.options.cwd ? i.relative(this.options.cwd, s) : s;
3904
- t[r || N] = e.getChildren().sort();
3905
- });
3906
- return t;
3907
- }
3908
- emitWithAll(t, e) {
3909
- this.emit(...e);
3910
- if (t !== A) this.emit(d, ...e);
3911
- }
3912
- async _emit(t, e, s, r, n) {
3913
- if (this.closed) return;
3914
- const o = this.options;
3915
- if (U) e = i.normalize(e);
3916
- if (o.cwd) e = i.relative(o.cwd, e);
3917
- const a = [
3918
- t,
3919
- e
3920
- ];
3921
- if (void 0 !== n) a.push(s, r, n);
3922
- else if (void 0 !== r) a.push(s, r);
3923
- else if (void 0 !== s) a.push(s);
3924
- const u = o.awaitWriteFinish;
3925
- let l;
3926
- if (u && (l = this._pendingWrites.get(e))) {
3927
- l.lastChange = new Date;
3928
- return this;
3929
- }
3930
- if (o.atomic) {
3931
- if (t === m) {
3932
- this._pendingUnlinks.set(e, a);
3933
- setTimeout(()=>{
3934
- this._pendingUnlinks.forEach((t, e)=>{
3935
- this.emit(...t);
3936
- this.emit(d, ...t);
3937
- this._pendingUnlinks.delete(e);
3938
- });
3939
- }, "number" == typeof o.atomic ? o.atomic : 100);
3940
- return this;
3941
- }
3942
- if (t === E && this._pendingUnlinks.has(e)) {
3943
- t = a[0] = g;
3944
- this._pendingUnlinks.delete(e);
3945
- }
3946
- }
3947
- if (u && (t === E || t === g) && this._readyEmitted) {
3948
- const awfEmit = (e, s)=>{
3949
- if (e) {
3950
- t = a[0] = A;
3951
- a[1] = e;
3952
- this.emitWithAll(t, a);
3953
- } else if (s) {
3954
- if (a.length > 2) a[2] = s;
3955
- else a.push(s);
3956
- this.emitWithAll(t, a);
3957
- }
3958
- };
3959
- this._awaitWriteFinish(e, u.stabilityThreshold, t, awfEmit);
3960
- return this;
3961
- }
3962
- if (t === g) {
3963
- const t = !this._throttle(g, e, 50);
3964
- if (t) return this;
3965
- }
3966
- if (o.alwaysStat && void 0 === s && (t === E || t === y || t === g)) {
3967
- const t = o.cwd ? i.join(o.cwd, e) : e;
3968
- let s;
3969
- try {
3970
- s = await j(t);
3971
- } catch (t) {}
3972
- if (!s || this.closed) return;
3973
- a.push(s);
3974
- }
3975
- this.emitWithAll(t, a);
3976
- return this;
3977
- }
3978
- _handleError(t) {
3979
- const e = t && t.code;
3980
- if (t && "ENOENT" !== e && "ENOTDIR" !== e && (!this.options.ignorePermissionErrors || "EPERM" !== e && "EACCES" !== e)) this.emit(A, t);
3981
- return t || this.closed;
3982
- }
3983
- _throttle(t, e, s) {
3984
- if (!this._throttled.has(t)) this._throttled.set(t, new Map);
3985
- const r = this._throttled.get(t);
3986
- const i = r.get(e);
3987
- if (i) {
3988
- i.count++;
3989
- return false;
3990
- }
3991
- let n;
3992
- const clear = ()=>{
3993
- const t = r.get(e);
3994
- const s = t ? t.count : 0;
3995
- r.delete(e);
3996
- clearTimeout(n);
3997
- if (t) clearTimeout(t.timeoutObject);
3998
- return s;
3999
- };
4000
- n = setTimeout(clear, s);
4001
- const o = {
4002
- timeoutObject: n,
4003
- clear: clear,
4004
- count: 0
4005
- };
4006
- r.set(e, o);
4007
- return o;
4008
- }
4009
- _incrReadyCount() {
4010
- return this._readyCount++;
4011
- }
4012
- _awaitWriteFinish(t, e, s, n) {
4013
- let o;
4014
- let a = t;
4015
- if (this.options.cwd && !i.isAbsolute(t)) a = i.join(this.options.cwd, t);
4016
- const u = new Date;
4017
- const awaitWriteFinish = (s)=>{
4018
- r.stat(a, (r, i)=>{
4019
- if (r || !this._pendingWrites.has(t)) {
4020
- if (r && "ENOENT" !== r.code) n(r);
4021
- return;
4022
- }
4023
- const a = Number(new Date);
4024
- if (s && i.size !== s.size) this._pendingWrites.get(t).lastChange = a;
4025
- const u = this._pendingWrites.get(t);
4026
- const l = a - u.lastChange;
4027
- if (l >= e) {
4028
- this._pendingWrites.delete(t);
4029
- n(void 0, i);
4030
- } else o = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, i);
4031
- });
4032
- };
4033
- if (!this._pendingWrites.has(t)) {
4034
- this._pendingWrites.set(t, {
4035
- lastChange: u,
4036
- cancelWait: ()=>{
4037
- this._pendingWrites.delete(t);
4038
- clearTimeout(o);
4039
- return s;
4040
- }
4041
- });
4042
- o = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval);
4043
- }
4044
- }
4045
- _getGlobIgnored() {
4046
- return [
4047
- ...this._ignoredPaths.values()
4048
- ];
4049
- }
4050
- _isIgnored(t, e) {
4051
- if (this.options.atomic && T.test(t)) return true;
4052
- if (!this._userIgnored) {
4053
- const { cwd: t } = this.options;
4054
- const e = this.options.ignored;
4055
- const s = e && e.map(normalizeIgnored(t));
4056
- const r = arrify(s).filter((t)=>typeof t === M && !l(t)).map((t)=>t + D);
4057
- const i = this._getGlobIgnored().map(normalizeIgnored(t)).concat(s, r);
4058
- this._userIgnored = a(i, void 0, F);
4059
- }
4060
- return this._userIgnored([
4061
- t,
4062
- e
4063
- ]);
4064
- }
4065
- _isntIgnored(t, e) {
4066
- return !this._isIgnored(t, e);
4067
- }
4068
- _getWatchHelpers(t, e) {
4069
- const s = e || this.options.disableGlobbing || !l(t) ? t : u(t);
4070
- const r = this.options.followSymlinks;
4071
- return new WatchHelper(t, s, r, this);
4072
- }
4073
- _getWatchedDir(t) {
4074
- if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
4075
- const e = i.resolve(t);
4076
- if (!this._watched.has(e)) this._watched.set(e, new DirEntry(e, this._boundRemove));
4077
- return this._watched.get(e);
4078
- }
4079
- _hasReadPermissions(t) {
4080
- if (this.options.ignorePermissionErrors) return true;
4081
- const e = t && Number.parseInt(t.mode, 10);
4082
- const s = 511 & e;
4083
- const r = Number.parseInt(s.toString(8)[0], 10);
4084
- return Boolean(4 & r);
4085
- }
4086
- _remove(t, e, s) {
4087
- const r = i.join(t, e);
4088
- const n = i.resolve(r);
4089
- s = null != s ? s : this._watched.has(r) || this._watched.has(n);
4090
- if (!this._throttle("remove", r, 100)) return;
4091
- if (!s && !this.options.useFsEvents && 1 === this._watched.size) this.add(t, e, true);
4092
- const o = this._getWatchedDir(r);
4093
- const a = o.getChildren();
4094
- a.forEach((t)=>this._remove(r, t));
4095
- const u = this._getWatchedDir(t);
4096
- const l = u.has(e);
4097
- u.remove(e);
4098
- if (this._symlinkPaths.has(n)) this._symlinkPaths.delete(n);
4099
- let c = r;
4100
- if (this.options.cwd) c = i.relative(this.options.cwd, r);
4101
- if (this.options.awaitWriteFinish && this._pendingWrites.has(c)) {
4102
- const t = this._pendingWrites.get(c).cancelWait();
4103
- if (t === E) return;
4104
- }
4105
- this._watched.delete(r);
4106
- this._watched.delete(n);
4107
- const f = s ? R : m;
4108
- if (l && !this._isIgnored(r)) this._emit(f, r);
4109
- if (!this.options.useFsEvents) this._closePath(r);
4110
- }
4111
- _closePath(t) {
4112
- this._closeFile(t);
4113
- const e = i.dirname(t);
4114
- this._getWatchedDir(e).remove(i.basename(t));
4115
- }
4116
- _closeFile(t) {
4117
- const e = this._closers.get(t);
4118
- if (!e) return;
4119
- e.forEach((t)=>t());
4120
- this._closers.delete(t);
4121
- }
4122
- _addPathCloser(t, e) {
4123
- if (!e) return;
4124
- let s = this._closers.get(t);
4125
- if (!s) {
4126
- s = [];
4127
- this._closers.set(t, s);
4128
- }
4129
- s.push(e);
4130
- }
4131
- _readdirp(t, e) {
4132
- if (this.closed) return;
4133
- const s = {
4134
- type: d,
4135
- alwaysStat: true,
4136
- lstat: true,
4137
- ...e
4138
- };
4139
- let r = o(t, s);
4140
- this._streams.add(r);
4141
- r.once(b, ()=>{
4142
- r = void 0;
4143
- });
4144
- r.once(v, ()=>{
4145
- if (r) {
4146
- this._streams.delete(r);
4147
- r = void 0;
4148
- }
4149
- });
4150
- return r;
4151
- }
4152
- }
4153
- t.FSWatcher = FSWatcher;
4154
- const watch = (t, e)=>{
4155
- const s = new FSWatcher(e);
4156
- s.add(t);
4157
- return s;
4158
- };
4159
- t.watch = watch;
4160
- })();
4161
- module.exports = s;
4162
- })();