decidim 0.27.2 → 0.27.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim might be problematic. Click here for more details.

Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +17 -10
  3. data/babel.config.json +1 -4
  4. data/docs/modules/customize/pages/data_consent.adoc +1 -1
  5. data/lib/decidim/release_manager.rb.new +43 -0
  6. data/lib/decidim/version.rb +1 -1
  7. data/package-lock.json +343 -255
  8. data/packages/browserslist-config/package.json +1 -1
  9. data/packages/core/node_modules/diff/CONTRIBUTING.md +39 -0
  10. data/packages/core/node_modules/diff/LICENSE +31 -0
  11. data/packages/core/node_modules/diff/README.md +211 -0
  12. data/packages/core/node_modules/diff/dist/diff.js +1627 -0
  13. data/packages/core/node_modules/diff/dist/diff.min.js +38 -0
  14. data/packages/core/node_modules/diff/lib/convert/dmp.js +32 -0
  15. data/packages/core/node_modules/diff/lib/convert/xml.js +42 -0
  16. data/packages/core/node_modules/diff/lib/diff/array.js +45 -0
  17. data/packages/core/node_modules/diff/lib/diff/base.js +307 -0
  18. data/packages/core/node_modules/diff/lib/diff/character.js +37 -0
  19. data/packages/core/node_modules/diff/lib/diff/css.js +41 -0
  20. data/packages/core/node_modules/diff/lib/diff/json.js +163 -0
  21. data/packages/core/node_modules/diff/lib/diff/line.js +89 -0
  22. data/packages/core/node_modules/diff/lib/diff/sentence.js +41 -0
  23. data/packages/core/node_modules/diff/lib/diff/word.js +108 -0
  24. data/packages/core/node_modules/diff/lib/index.es6.js +1561 -0
  25. data/packages/core/node_modules/diff/lib/index.js +216 -0
  26. data/packages/core/node_modules/diff/lib/index.mjs +1561 -0
  27. data/packages/core/node_modules/diff/lib/patch/apply.js +238 -0
  28. data/packages/core/node_modules/diff/lib/patch/create.js +272 -0
  29. data/packages/core/node_modules/diff/lib/patch/merge.js +613 -0
  30. data/packages/core/node_modules/diff/lib/patch/parse.js +167 -0
  31. data/packages/core/node_modules/diff/lib/util/array.js +32 -0
  32. data/packages/core/node_modules/diff/lib/util/distance-iterator.js +57 -0
  33. data/packages/core/node_modules/diff/lib/util/params.js +24 -0
  34. data/packages/core/node_modules/diff/package.json +87 -0
  35. data/packages/core/node_modules/diff/release-notes.md +309 -0
  36. data/packages/core/node_modules/diff/runtime.js +3 -0
  37. data/packages/core/package-lock.json +4889 -0
  38. data/packages/core/package.json +1 -1
  39. data/packages/dev/package.json +1 -1
  40. data/packages/elections/package.json +1 -1
  41. data/packages/eslint-config/package.json +1 -1
  42. data/packages/stylelint-config/package.json +1 -1
  43. data/packages/webpacker/node_modules/argparse/CHANGELOG.md +216 -0
  44. data/packages/webpacker/node_modules/argparse/LICENSE +254 -0
  45. data/packages/webpacker/node_modules/argparse/README.md +84 -0
  46. data/packages/webpacker/node_modules/argparse/argparse.js +3707 -0
  47. data/packages/webpacker/node_modules/argparse/lib/sub.js +67 -0
  48. data/packages/webpacker/node_modules/argparse/lib/textwrap.js +440 -0
  49. data/packages/webpacker/node_modules/argparse/package.json +31 -0
  50. data/packages/{core/node_modules/uuid/LICENSE.md → webpacker/node_modules/brace-expansion/LICENSE} +2 -2
  51. data/packages/webpacker/node_modules/brace-expansion/README.md +135 -0
  52. data/packages/webpacker/node_modules/brace-expansion/index.js +203 -0
  53. data/packages/webpacker/node_modules/brace-expansion/package.json +46 -0
  54. data/packages/webpacker/node_modules/glob/LICENSE +15 -0
  55. data/packages/webpacker/node_modules/glob/README.md +1214 -0
  56. data/packages/webpacker/node_modules/glob/dist/cjs/package.json +4 -0
  57. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts +3 -0
  58. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts.map +1 -0
  59. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js +270 -0
  60. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js.map +1 -0
  61. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts +344 -0
  62. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts.map +1 -0
  63. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js +238 -0
  64. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js.map +1 -0
  65. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts +14 -0
  66. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts.map +1 -0
  67. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js +27 -0
  68. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js.map +1 -0
  69. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts +20 -0
  70. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts.map +1 -0
  71. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js +103 -0
  72. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js.map +1 -0
  73. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts +95 -0
  74. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts.map +1 -0
  75. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js +68 -0
  76. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js.map +1 -0
  77. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts +77 -0
  78. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts.map +1 -0
  79. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js +219 -0
  80. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js.map +1 -0
  81. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts +59 -0
  82. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts.map +1 -0
  83. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js +309 -0
  84. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js.map +1 -0
  85. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts +96 -0
  86. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts.map +1 -0
  87. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js +358 -0
  88. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js.map +1 -0
  89. data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts +344 -0
  90. data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts.map +1 -0
  91. data/packages/webpacker/node_modules/glob/dist/mjs/glob.js +234 -0
  92. data/packages/webpacker/node_modules/glob/dist/mjs/glob.js.map +1 -0
  93. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts +14 -0
  94. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts.map +1 -0
  95. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js +23 -0
  96. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js.map +1 -0
  97. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts +20 -0
  98. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts.map +1 -0
  99. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js +99 -0
  100. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js.map +1 -0
  101. data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts +95 -0
  102. data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts.map +1 -0
  103. data/packages/webpacker/node_modules/glob/dist/mjs/index.js +56 -0
  104. data/packages/webpacker/node_modules/glob/dist/mjs/index.js.map +1 -0
  105. data/packages/webpacker/node_modules/glob/dist/mjs/package.json +4 -0
  106. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts +77 -0
  107. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts.map +1 -0
  108. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js +215 -0
  109. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js.map +1 -0
  110. data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts +59 -0
  111. data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts.map +1 -0
  112. data/packages/webpacker/node_modules/glob/dist/mjs/processor.js +302 -0
  113. data/packages/webpacker/node_modules/glob/dist/mjs/processor.js.map +1 -0
  114. data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts +96 -0
  115. data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts.map +1 -0
  116. data/packages/webpacker/node_modules/glob/dist/mjs/walker.js +352 -0
  117. data/packages/webpacker/node_modules/glob/dist/mjs/walker.js.map +1 -0
  118. data/packages/webpacker/node_modules/glob/package.json +98 -0
  119. data/packages/webpacker/node_modules/js-yaml/CHANGELOG.md +616 -0
  120. data/packages/webpacker/node_modules/js-yaml/LICENSE +21 -0
  121. data/packages/webpacker/node_modules/js-yaml/README.md +246 -0
  122. data/packages/webpacker/node_modules/js-yaml/bin/js-yaml.js +126 -0
  123. data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.js +3874 -0
  124. data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
  125. data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.mjs +3851 -0
  126. data/packages/webpacker/node_modules/js-yaml/index.js +47 -0
  127. data/packages/webpacker/node_modules/js-yaml/lib/common.js +59 -0
  128. data/packages/webpacker/node_modules/js-yaml/lib/dumper.js +965 -0
  129. data/packages/webpacker/node_modules/js-yaml/lib/exception.js +55 -0
  130. data/packages/webpacker/node_modules/js-yaml/lib/loader.js +1727 -0
  131. data/packages/webpacker/node_modules/js-yaml/lib/schema/core.js +11 -0
  132. data/packages/webpacker/node_modules/js-yaml/lib/schema/default.js +22 -0
  133. data/packages/webpacker/node_modules/js-yaml/lib/schema/failsafe.js +17 -0
  134. data/packages/webpacker/node_modules/js-yaml/lib/schema/json.js +19 -0
  135. data/packages/webpacker/node_modules/js-yaml/lib/schema.js +121 -0
  136. data/packages/webpacker/node_modules/js-yaml/lib/snippet.js +101 -0
  137. data/packages/webpacker/node_modules/js-yaml/lib/type/binary.js +125 -0
  138. data/packages/webpacker/node_modules/js-yaml/lib/type/bool.js +35 -0
  139. data/packages/webpacker/node_modules/js-yaml/lib/type/float.js +97 -0
  140. data/packages/webpacker/node_modules/js-yaml/lib/type/int.js +156 -0
  141. data/packages/webpacker/node_modules/js-yaml/lib/type/map.js +8 -0
  142. data/packages/webpacker/node_modules/js-yaml/lib/type/merge.js +12 -0
  143. data/packages/webpacker/node_modules/js-yaml/lib/type/null.js +35 -0
  144. data/packages/webpacker/node_modules/js-yaml/lib/type/omap.js +44 -0
  145. data/packages/webpacker/node_modules/js-yaml/lib/type/pairs.js +53 -0
  146. data/packages/webpacker/node_modules/js-yaml/lib/type/seq.js +8 -0
  147. data/packages/webpacker/node_modules/js-yaml/lib/type/set.js +29 -0
  148. data/packages/webpacker/node_modules/js-yaml/lib/type/str.js +8 -0
  149. data/packages/webpacker/node_modules/js-yaml/lib/type/timestamp.js +88 -0
  150. data/packages/webpacker/node_modules/js-yaml/lib/type.js +66 -0
  151. data/packages/webpacker/node_modules/js-yaml/package.json +66 -0
  152. data/packages/webpacker/node_modules/minimatch/LICENSE +15 -0
  153. data/packages/webpacker/node_modules/minimatch/README.md +454 -0
  154. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +2 -0
  155. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +1 -0
  156. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +14 -0
  157. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +1 -0
  158. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts +19 -0
  159. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts.map +1 -0
  160. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js +589 -0
  161. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js.map +1 -0
  162. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +8 -0
  163. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +1 -0
  164. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js +152 -0
  165. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js.map +1 -0
  166. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts +12 -0
  167. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts.map +1 -0
  168. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js +22 -0
  169. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js.map +1 -0
  170. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts +94 -0
  171. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts.map +1 -0
  172. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js +1011 -0
  173. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js.map +1 -0
  174. data/packages/webpacker/node_modules/minimatch/dist/cjs/package.json +3 -0
  175. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts +17 -0
  176. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts.map +1 -0
  177. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js +24 -0
  178. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js.map +1 -0
  179. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +2 -0
  180. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +1 -0
  181. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +10 -0
  182. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +1 -0
  183. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts +19 -0
  184. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts.map +1 -0
  185. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js +585 -0
  186. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js.map +1 -0
  187. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +8 -0
  188. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +1 -0
  189. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js +148 -0
  190. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js.map +1 -0
  191. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts +12 -0
  192. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts.map +1 -0
  193. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js +18 -0
  194. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js.map +1 -0
  195. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts +94 -0
  196. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts.map +1 -0
  197. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js +995 -0
  198. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js.map +1 -0
  199. data/packages/webpacker/node_modules/minimatch/dist/mjs/package.json +3 -0
  200. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts +17 -0
  201. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts.map +1 -0
  202. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js +20 -0
  203. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js.map +1 -0
  204. data/packages/webpacker/node_modules/minimatch/package.json +86 -0
  205. data/packages/webpacker/package.json +2 -2
  206. metadata +238 -65
  207. data/packages/core/node_modules/uuid/AUTHORS +0 -5
  208. data/packages/core/node_modules/uuid/CHANGELOG.md +0 -119
  209. data/packages/core/node_modules/uuid/README.md +0 -276
  210. data/packages/core/node_modules/uuid/bin/uuid +0 -65
  211. data/packages/core/node_modules/uuid/index.js +0 -8
  212. data/packages/core/node_modules/uuid/lib/bytesToUuid.js +0 -26
  213. data/packages/core/node_modules/uuid/lib/md5-browser.js +0 -216
  214. data/packages/core/node_modules/uuid/lib/md5.js +0 -25
  215. data/packages/core/node_modules/uuid/lib/rng-browser.js +0 -34
  216. data/packages/core/node_modules/uuid/lib/rng.js +0 -8
  217. data/packages/core/node_modules/uuid/lib/sha1-browser.js +0 -89
  218. data/packages/core/node_modules/uuid/lib/sha1.js +0 -25
  219. data/packages/core/node_modules/uuid/lib/v35.js +0 -57
  220. data/packages/core/node_modules/uuid/package.json +0 -49
  221. data/packages/core/node_modules/uuid/v1.js +0 -109
  222. data/packages/core/node_modules/uuid/v3.js +0 -4
  223. data/packages/core/node_modules/uuid/v4.js +0 -29
  224. data/packages/core/node_modules/uuid/v5.js +0 -3
@@ -0,0 +1,352 @@
1
+ /**
2
+ * Single-use utility classes to provide functionality to the {@link Glob}
3
+ * methods.
4
+ *
5
+ * @module
6
+ */
7
+ import { Minipass } from 'minipass';
8
+ import { Ignore } from './ignore.js';
9
+ import { Processor } from './processor.js';
10
+ const makeIgnore = (ignore, opts) => typeof ignore === 'string'
11
+ ? new Ignore([ignore], opts)
12
+ : Array.isArray(ignore)
13
+ ? new Ignore(ignore, opts)
14
+ : ignore;
15
+ /**
16
+ * basic walking utilities that all the glob walker types use
17
+ */
18
+ export class GlobUtil {
19
+ path;
20
+ patterns;
21
+ opts;
22
+ seen = new Set();
23
+ paused = false;
24
+ aborted = false;
25
+ #onResume = [];
26
+ #ignore;
27
+ #sep;
28
+ signal;
29
+ maxDepth;
30
+ constructor(patterns, path, opts) {
31
+ this.patterns = patterns;
32
+ this.path = path;
33
+ this.opts = opts;
34
+ this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
35
+ if (opts.ignore) {
36
+ this.#ignore = makeIgnore(opts.ignore, opts);
37
+ }
38
+ // ignore, always set with maxDepth, but it's optional on the
39
+ // GlobOptions type
40
+ /* c8 ignore start */
41
+ this.maxDepth = opts.maxDepth || Infinity;
42
+ /* c8 ignore stop */
43
+ if (opts.signal) {
44
+ this.signal = opts.signal;
45
+ this.signal.addEventListener('abort', () => {
46
+ this.#onResume.length = 0;
47
+ });
48
+ }
49
+ }
50
+ #ignored(path) {
51
+ return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
52
+ }
53
+ #childrenIgnored(path) {
54
+ return !!this.#ignore?.childrenIgnored?.(path);
55
+ }
56
+ // backpressure mechanism
57
+ pause() {
58
+ this.paused = true;
59
+ }
60
+ resume() {
61
+ /* c8 ignore start */
62
+ if (this.signal?.aborted)
63
+ return;
64
+ /* c8 ignore stop */
65
+ this.paused = false;
66
+ let fn = undefined;
67
+ while (!this.paused && (fn = this.#onResume.shift())) {
68
+ fn();
69
+ }
70
+ }
71
+ onResume(fn) {
72
+ if (this.signal?.aborted)
73
+ return;
74
+ /* c8 ignore start */
75
+ if (!this.paused) {
76
+ fn();
77
+ }
78
+ else {
79
+ /* c8 ignore stop */
80
+ this.#onResume.push(fn);
81
+ }
82
+ }
83
+ // do the requisite realpath/stat checking, and return the path
84
+ // to add or undefined to filter it out.
85
+ async matchCheck(e, ifDir) {
86
+ if (ifDir && this.opts.nodir)
87
+ return undefined;
88
+ let rpc;
89
+ if (this.opts.realpath) {
90
+ rpc = e.realpathCached() || (await e.realpath());
91
+ if (!rpc)
92
+ return undefined;
93
+ e = rpc;
94
+ }
95
+ const needStat = e.isUnknown() || this.opts.stat;
96
+ return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir);
97
+ }
98
+ matchCheckTest(e, ifDir) {
99
+ return e &&
100
+ (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
101
+ (!ifDir || e.canReaddir()) &&
102
+ (!this.opts.nodir || !e.isDirectory()) &&
103
+ !this.#ignored(e)
104
+ ? e
105
+ : undefined;
106
+ }
107
+ matchCheckSync(e, ifDir) {
108
+ if (ifDir && this.opts.nodir)
109
+ return undefined;
110
+ let rpc;
111
+ if (this.opts.realpath) {
112
+ rpc = e.realpathCached() || e.realpathSync();
113
+ if (!rpc)
114
+ return undefined;
115
+ e = rpc;
116
+ }
117
+ const needStat = e.isUnknown() || this.opts.stat;
118
+ return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir);
119
+ }
120
+ matchFinish(e, absolute) {
121
+ if (this.#ignored(e))
122
+ return;
123
+ const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
124
+ this.seen.add(e);
125
+ const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
126
+ // ok, we have what we need!
127
+ if (this.opts.withFileTypes) {
128
+ this.matchEmit(e);
129
+ }
130
+ else if (abs) {
131
+ const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
132
+ this.matchEmit(abs + mark);
133
+ }
134
+ else {
135
+ const rel = this.opts.posix ? e.relativePosix() : e.relative();
136
+ const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep)
137
+ ? '.' + this.#sep
138
+ : '';
139
+ this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
140
+ }
141
+ }
142
+ async match(e, absolute, ifDir) {
143
+ const p = await this.matchCheck(e, ifDir);
144
+ if (p)
145
+ this.matchFinish(p, absolute);
146
+ }
147
+ matchSync(e, absolute, ifDir) {
148
+ const p = this.matchCheckSync(e, ifDir);
149
+ if (p)
150
+ this.matchFinish(p, absolute);
151
+ }
152
+ walkCB(target, patterns, cb) {
153
+ /* c8 ignore start */
154
+ if (this.signal?.aborted)
155
+ cb();
156
+ /* c8 ignore stop */
157
+ this.walkCB2(target, patterns, new Processor(this.opts), cb);
158
+ }
159
+ walkCB2(target, patterns, processor, cb) {
160
+ if (this.#childrenIgnored(target))
161
+ return cb();
162
+ if (this.signal?.aborted)
163
+ cb();
164
+ if (this.paused) {
165
+ this.onResume(() => this.walkCB2(target, patterns, processor, cb));
166
+ return;
167
+ }
168
+ processor.processPatterns(target, patterns);
169
+ // done processing. all of the above is sync, can be abstracted out.
170
+ // subwalks is a map of paths to the entry filters they need
171
+ // matches is a map of paths to [absolute, ifDir] tuples.
172
+ let tasks = 1;
173
+ const next = () => {
174
+ if (--tasks === 0)
175
+ cb();
176
+ };
177
+ for (const [m, absolute, ifDir] of processor.matches.entries()) {
178
+ if (this.#ignored(m))
179
+ continue;
180
+ tasks++;
181
+ this.match(m, absolute, ifDir).then(() => next());
182
+ }
183
+ for (const t of processor.subwalkTargets()) {
184
+ if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
185
+ continue;
186
+ }
187
+ tasks++;
188
+ const childrenCached = t.readdirCached();
189
+ if (t.calledReaddir())
190
+ this.walkCB3(t, childrenCached, processor, next);
191
+ else {
192
+ t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
193
+ }
194
+ }
195
+ next();
196
+ }
197
+ walkCB3(target, entries, processor, cb) {
198
+ processor = processor.filterEntries(target, entries);
199
+ let tasks = 1;
200
+ const next = () => {
201
+ if (--tasks === 0)
202
+ cb();
203
+ };
204
+ for (const [m, absolute, ifDir] of processor.matches.entries()) {
205
+ if (this.#ignored(m))
206
+ continue;
207
+ tasks++;
208
+ this.match(m, absolute, ifDir).then(() => next());
209
+ }
210
+ for (const [target, patterns] of processor.subwalks.entries()) {
211
+ tasks++;
212
+ this.walkCB2(target, patterns, processor.child(), next);
213
+ }
214
+ next();
215
+ }
216
+ walkCBSync(target, patterns, cb) {
217
+ /* c8 ignore start */
218
+ if (this.signal?.aborted)
219
+ cb();
220
+ /* c8 ignore stop */
221
+ this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
222
+ }
223
+ walkCB2Sync(target, patterns, processor, cb) {
224
+ if (this.#childrenIgnored(target))
225
+ return cb();
226
+ if (this.signal?.aborted)
227
+ cb();
228
+ if (this.paused) {
229
+ this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
230
+ return;
231
+ }
232
+ processor.processPatterns(target, patterns);
233
+ // done processing. all of the above is sync, can be abstracted out.
234
+ // subwalks is a map of paths to the entry filters they need
235
+ // matches is a map of paths to [absolute, ifDir] tuples.
236
+ let tasks = 1;
237
+ const next = () => {
238
+ if (--tasks === 0)
239
+ cb();
240
+ };
241
+ for (const [m, absolute, ifDir] of processor.matches.entries()) {
242
+ if (this.#ignored(m))
243
+ continue;
244
+ this.matchSync(m, absolute, ifDir);
245
+ }
246
+ for (const t of processor.subwalkTargets()) {
247
+ if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
248
+ continue;
249
+ }
250
+ tasks++;
251
+ const children = t.readdirSync();
252
+ this.walkCB3Sync(t, children, processor, next);
253
+ }
254
+ next();
255
+ }
256
+ walkCB3Sync(target, entries, processor, cb) {
257
+ processor = processor.filterEntries(target, entries);
258
+ let tasks = 1;
259
+ const next = () => {
260
+ if (--tasks === 0)
261
+ cb();
262
+ };
263
+ for (const [m, absolute, ifDir] of processor.matches.entries()) {
264
+ if (this.#ignored(m))
265
+ continue;
266
+ this.matchSync(m, absolute, ifDir);
267
+ }
268
+ for (const [target, patterns] of processor.subwalks.entries()) {
269
+ tasks++;
270
+ this.walkCB2Sync(target, patterns, processor.child(), next);
271
+ }
272
+ next();
273
+ }
274
+ }
275
+ export class GlobWalker extends GlobUtil {
276
+ matches;
277
+ constructor(patterns, path, opts) {
278
+ super(patterns, path, opts);
279
+ this.matches = new Set();
280
+ }
281
+ matchEmit(e) {
282
+ this.matches.add(e);
283
+ }
284
+ async walk() {
285
+ if (this.signal?.aborted)
286
+ throw this.signal.reason;
287
+ if (this.path.isUnknown()) {
288
+ await this.path.lstat();
289
+ }
290
+ await new Promise((res, rej) => {
291
+ this.walkCB(this.path, this.patterns, () => {
292
+ if (this.signal?.aborted) {
293
+ rej(this.signal.reason);
294
+ }
295
+ else {
296
+ res(this.matches);
297
+ }
298
+ });
299
+ });
300
+ return this.matches;
301
+ }
302
+ walkSync() {
303
+ if (this.signal?.aborted)
304
+ throw this.signal.reason;
305
+ if (this.path.isUnknown()) {
306
+ this.path.lstatSync();
307
+ }
308
+ // nothing for the callback to do, because this never pauses
309
+ this.walkCBSync(this.path, this.patterns, () => {
310
+ if (this.signal?.aborted)
311
+ throw this.signal.reason;
312
+ });
313
+ return this.matches;
314
+ }
315
+ }
316
+ export class GlobStream extends GlobUtil {
317
+ results;
318
+ constructor(patterns, path, opts) {
319
+ super(patterns, path, opts);
320
+ this.results = new Minipass({
321
+ signal: this.signal,
322
+ objectMode: true,
323
+ });
324
+ this.results.on('drain', () => this.resume());
325
+ this.results.on('resume', () => this.resume());
326
+ }
327
+ matchEmit(e) {
328
+ this.results.write(e);
329
+ if (!this.results.flowing)
330
+ this.pause();
331
+ }
332
+ stream() {
333
+ const target = this.path;
334
+ if (target.isUnknown()) {
335
+ target.lstat().then(() => {
336
+ this.walkCB(target, this.patterns, () => this.results.end());
337
+ });
338
+ }
339
+ else {
340
+ this.walkCB(target, this.patterns, () => this.results.end());
341
+ }
342
+ return this.results;
343
+ }
344
+ streamSync() {
345
+ if (this.path.isUnknown()) {
346
+ this.path.lstatSync();
347
+ }
348
+ this.walkCBSync(this.path, this.patterns, () => this.results.end());
349
+ return this.results;
350
+ }
351
+ }
352
+ //# sourceMappingURL=walker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAc,MAAM,aAAa,CAAA;AAQhD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAiE1C,MAAM,UAAU,GAAG,CACjB,MAAsC,EACtC,IAAoB,EACR,EAAE,CACd,OAAO,MAAM,KAAK,QAAQ;IACxB,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IAC5B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;QAC1B,CAAC,CAAC,MAAM,CAAA;AAEZ;;GAEG;AACH,MAAM,OAAgB,QAAQ;IAC5B,IAAI,CAAM;IACV,QAAQ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O,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue\n ? Path\n : O extends GWOFileTypesFalse\n ? string\n : O extends GWOFileTypesUnset\n ? string\n : Path | string\n\nexport type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue\n ? Set<Path>\n : O extends GWOFileTypesFalse\n ? Set<string>\n : O extends GWOFileTypesUnset\n ? Set<string>\n : Set<Path | string>\n\nexport type MatchStream<O extends GlobWalkerOpts> =\n O extends GWOFileTypesTrue\n ? Minipass<Path, Path>\n : O extends GWOFileTypesFalse\n ? Minipass<string, string>\n : O extends GWOFileTypesUnset\n ? Minipass<string, string>\n : Minipass<Path | string, Path | string>\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts\n): IgnoreLike =>\n typeof ignore === 'string'\n ? new Ignore([ignore], opts)\n : Array.isArray(ignore)\n ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set<Path> = new Set<Path>()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n if (opts.ignore) {\n this.#ignore = makeIgnore(opts.ignore, opts)\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined> {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n !this.#ignored(e)\n ? e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir)\n }\n\n abstract matchEmit(p: Result<O>): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep)\n ? '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise<void> {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb)\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts\n> extends GlobUtil<O> {\n matches: O extends GWOFileTypesTrue\n ? Set<Path>\n : O extends GWOFileTypesFalse\n ? Set<string>\n : O extends GWOFileTypesUnset\n ? Set<string>\n : Set<Path | string>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.matches = new Set() as Matches<O>\n }\n\n matchEmit(e: Result<O>): void\n matchEmit(e: Path | string): void {\n this.matches.add(e)\n }\n\n async walk(): Promise<Matches<O>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Matches<O> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts\n> extends GlobUtil<O> {\n results: O extends GWOFileTypesTrue\n ? Minipass<Path, Path>\n : O extends GWOFileTypesFalse\n ? Minipass<string, string>\n : O extends GWOFileTypesUnset\n ? Minipass<string, string>\n : Minipass<Path | string, Path | string>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass({\n signal: this.signal,\n objectMode: true,\n }) as MatchStream<O>\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result<O>): void\n matchEmit(e: Path | string): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream<O> {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream<O> {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]}
@@ -0,0 +1,98 @@
1
+ {
2
+ "author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me/)",
3
+ "name": "glob",
4
+ "description": "the most correct and second fastest glob implementation in JavaScript",
5
+ "version": "10.3.3",
6
+ "bin": "./dist/cjs/src/bin.js",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git://github.com/isaacs/node-glob.git"
10
+ },
11
+ "main": "./dist/cjs/src/index.js",
12
+ "module": "./dist/mjs/index.js",
13
+ "types": "./dist/mjs/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/mjs/index.d.ts",
18
+ "default": "./dist/mjs/index.js"
19
+ },
20
+ "require": {
21
+ "types": "./dist/cjs/src/index.d.ts",
22
+ "default": "./dist/cjs/src/index.js"
23
+ }
24
+ }
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "scripts": {
30
+ "preversion": "npm test",
31
+ "postversion": "npm publish",
32
+ "prepublishOnly": "git push origin --follow-tags",
33
+ "preprepare": "rm -rf dist",
34
+ "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash fixup.sh",
35
+ "pretest": "npm run prepare",
36
+ "presnap": "npm run prepare",
37
+ "test": "c8 tap",
38
+ "snap": "c8 tap",
39
+ "format": "prettier --write . --loglevel warn",
40
+ "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
41
+ "prepublish": "npm run benchclean",
42
+ "profclean": "rm -f v8.log profile.txt",
43
+ "test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts",
44
+ "prebench": "npm run prepare",
45
+ "bench": "bash benchmark.sh",
46
+ "preprof": "npm run prepare",
47
+ "prof": "bash prof.sh",
48
+ "benchclean": "node benchclean.js"
49
+ },
50
+ "prettier": {
51
+ "semi": false,
52
+ "printWidth": 75,
53
+ "tabWidth": 2,
54
+ "useTabs": false,
55
+ "singleQuote": true,
56
+ "jsxSingleQuote": false,
57
+ "bracketSameLine": true,
58
+ "arrowParens": "avoid",
59
+ "endOfLine": "lf"
60
+ },
61
+ "dependencies": {
62
+ "foreground-child": "^3.1.0",
63
+ "jackspeak": "^2.0.3",
64
+ "minimatch": "^9.0.1",
65
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
66
+ "path-scurry": "^1.10.1"
67
+ },
68
+ "devDependencies": {
69
+ "@types/node": "^20.3.2",
70
+ "@types/tap": "^15.0.7",
71
+ "c8": "^7.12.0",
72
+ "memfs": "^3.4.13",
73
+ "mkdirp": "^2.1.4",
74
+ "prettier": "^2.8.3",
75
+ "rimraf": "^4.1.3",
76
+ "tap": "^16.3.4",
77
+ "ts-node": "^10.9.1",
78
+ "typedoc": "^0.23.24",
79
+ "typescript": "^4.9.4"
80
+ },
81
+ "tap": {
82
+ "before": "test/00-setup.ts",
83
+ "coverage": false,
84
+ "node-arg": [
85
+ "--no-warnings",
86
+ "--loader",
87
+ "ts-node/esm"
88
+ ],
89
+ "ts": false
90
+ },
91
+ "license": "ISC",
92
+ "funding": {
93
+ "url": "https://github.com/sponsors/isaacs"
94
+ },
95
+ "engines": {
96
+ "node": ">=16 || 14 >=14.17"
97
+ }
98
+ }