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,4 @@
1
+ {
2
+ "version": "10.3.3",
3
+ "type": "commonjs"
4
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":""}
@@ -0,0 +1,270 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const foreground_child_1 = require("foreground-child");
5
+ const fs_1 = require("fs");
6
+ const jackspeak_1 = require("jackspeak");
7
+ const package_json_1 = require("../package.json");
8
+ const index_js_1 = require("./index.js");
9
+ const j = (0, jackspeak_1.jack)({
10
+ usage: 'glob [options] [<pattern> [<pattern> ...]]',
11
+ })
12
+ .description(`
13
+ Glob v${package_json_1.version}
14
+
15
+ Expand the positional glob expression arguments into any matching file
16
+ system paths found.
17
+ `)
18
+ .opt({
19
+ cmd: {
20
+ short: 'c',
21
+ hint: 'command',
22
+ description: `Run the command provided, passing the glob expression
23
+ matches as arguments.`,
24
+ },
25
+ })
26
+ .opt({
27
+ default: {
28
+ short: 'p',
29
+ hint: 'pattern',
30
+ description: `If no positional arguments are provided, glob will use
31
+ this pattern`,
32
+ },
33
+ })
34
+ .flag({
35
+ all: {
36
+ short: 'A',
37
+ description: `By default, the glob cli command will not expand any
38
+ arguments that are an exact match to a file on disk.
39
+
40
+ This prevents double-expanding, in case the shell expands
41
+ an argument whose filename is a glob expression.
42
+
43
+ For example, if 'app/*.ts' would match 'app/[id].ts', then
44
+ on Windows powershell or cmd.exe, 'glob app/*.ts' will
45
+ expand to 'app/[id].ts', as expected. However, in posix
46
+ shells such as bash or zsh, the shell will first expand
47
+ 'app/*.ts' to a list of filenames. Then glob will look
48
+ for a file matching 'app/[id].ts' (ie, 'app/i.ts' or
49
+ 'app/d.ts'), which is unexpected.
50
+
51
+ Setting '--all' prevents this behavior, causing glob
52
+ to treat ALL patterns as glob expressions to be expanded,
53
+ even if they are an exact match to a file on disk.
54
+
55
+ When setting this option, be sure to enquote arguments
56
+ so that the shell will not expand them prior to passing
57
+ them to the glob command process.
58
+ `,
59
+ },
60
+ absolute: {
61
+ short: 'a',
62
+ description: 'Expand to absolute paths',
63
+ },
64
+ 'dot-relative': {
65
+ short: 'd',
66
+ description: `Prepend './' on relative matches`,
67
+ },
68
+ mark: {
69
+ short: 'm',
70
+ description: `Append a / on any directories matched`,
71
+ },
72
+ posix: {
73
+ short: 'x',
74
+ description: `Always resolve to posix style paths, using '/' as the
75
+ directory separator, even on Windows. Drive letter
76
+ absolute matches on Windows will be expanded to their
77
+ full resolved UNC maths, eg instead of 'C:\\foo\\bar',
78
+ it will expand to '//?/C:/foo/bar'.
79
+ `,
80
+ },
81
+ follow: {
82
+ short: 'f',
83
+ description: `Follow symlinked directories when expanding '**'`,
84
+ },
85
+ realpath: {
86
+ short: 'R',
87
+ description: `Call 'fs.realpath' on all of the results. In the case
88
+ of an entry that cannot be resolved, the entry is
89
+ omitted. This incurs a slight performance penalty, of
90
+ course, because of the added system calls.`,
91
+ },
92
+ stat: {
93
+ short: 's',
94
+ description: `Call 'fs.lstat' on all entries, whether required or not
95
+ to determine if it's a valid match.`,
96
+ },
97
+ 'match-base': {
98
+ short: 'b',
99
+ description: `Perform a basename-only match if the pattern does not
100
+ contain any slash characters. That is, '*.js' would be
101
+ treated as equivalent to '**/*.js', matching js files
102
+ in all directories.
103
+ `,
104
+ },
105
+ dot: {
106
+ description: `Allow patterns to match files/directories that start
107
+ with '.', even if the pattern does not start with '.'
108
+ `,
109
+ },
110
+ nobrace: {
111
+ description: 'Do not expand {...} patterns',
112
+ },
113
+ nocase: {
114
+ description: `Perform a case-insensitive match. This defaults to
115
+ 'true' on macOS and Windows platforms, and false on
116
+ all others.
117
+
118
+ Note: 'nocase' should only be explicitly set when it is
119
+ known that the filesystem's case sensitivity differs
120
+ from the platform default. If set 'true' on
121
+ case-insensitive file systems, then the walk may return
122
+ more or less results than expected.
123
+ `,
124
+ },
125
+ nodir: {
126
+ description: `Do not match directories, only files.
127
+
128
+ Note: to *only* match directories, append a '/' at the
129
+ end of the pattern.
130
+ `,
131
+ },
132
+ noext: {
133
+ description: `Do not expand extglob patterns, such as '+(a|b)'`,
134
+ },
135
+ noglobstar: {
136
+ description: `Do not expand '**' against multiple path portions.
137
+ Ie, treat it as a normal '*' instead.`,
138
+ },
139
+ 'windows-path-no-escape': {
140
+ description: `Use '\\' as a path separator *only*, and *never* as an
141
+ escape character. If set, all '\\' characters are
142
+ replaced with '/' in the pattern.`,
143
+ },
144
+ })
145
+ .num({
146
+ 'max-depth': {
147
+ short: 'D',
148
+ description: `Maximum depth to traverse from the current
149
+ working directory`,
150
+ },
151
+ })
152
+ .opt({
153
+ cwd: {
154
+ short: 'C',
155
+ description: 'Current working directory to execute/match in',
156
+ default: process.cwd(),
157
+ },
158
+ root: {
159
+ short: 'r',
160
+ description: `A string path resolved against the 'cwd', which is
161
+ used as the starting point for absolute patterns that
162
+ start with '/' (but not drive letters or UNC paths
163
+ on Windows).
164
+
165
+ Note that this *doesn't* necessarily limit the walk to
166
+ the 'root' directory, and doesn't affect the cwd
167
+ starting point for non-absolute patterns. A pattern
168
+ containing '..' will still be able to traverse out of
169
+ the root directory, if it is not an actual root directory
170
+ on the filesystem, and any non-absolute patterns will
171
+ still be matched in the 'cwd'.
172
+
173
+ To start absolute and non-absolute patterns in the same
174
+ path, you can use '--root=' to set it to the empty
175
+ string. However, be aware that on Windows systems, a
176
+ pattern like 'x:/*' or '//host/share/*' will *always*
177
+ start in the 'x:/' or '//host/share/' directory,
178
+ regardless of the --root setting.
179
+ `,
180
+ },
181
+ platform: {
182
+ description: `Defaults to the value of 'process.platform' if
183
+ available, or 'linux' if not. Setting --platform=win32
184
+ on non-Windows systems may cause strange behavior!`,
185
+ validate: v => new Set([
186
+ 'aix',
187
+ 'android',
188
+ 'darwin',
189
+ 'freebsd',
190
+ 'haiku',
191
+ 'linux',
192
+ 'openbsd',
193
+ 'sunos',
194
+ 'win32',
195
+ 'cygwin',
196
+ 'netbsd',
197
+ ]).has(v),
198
+ },
199
+ })
200
+ .optList({
201
+ ignore: {
202
+ short: 'i',
203
+ description: `Glob patterns to ignore`,
204
+ },
205
+ })
206
+ .flag({
207
+ debug: {
208
+ short: 'v',
209
+ description: `Output a huge amount of noisy debug information about
210
+ patterns as they are parsed and used to match files.`,
211
+ },
212
+ })
213
+ .flag({
214
+ help: {
215
+ short: 'h',
216
+ description: 'Show this usage information',
217
+ },
218
+ });
219
+ try {
220
+ const { positionals, values } = j.parse();
221
+ if (values.help) {
222
+ console.log(j.usage());
223
+ process.exit(0);
224
+ }
225
+ if (positionals.length === 0 && !values.default)
226
+ throw 'No patterns provided';
227
+ if (positionals.length === 0 && values.default)
228
+ positionals.push(values.default);
229
+ const patterns = values.all
230
+ ? positionals
231
+ : positionals.filter(p => !(0, fs_1.existsSync)(p));
232
+ const matches = values.all ? [] : positionals.filter(p => (0, fs_1.existsSync)(p));
233
+ const stream = (0, index_js_1.globStream)(patterns, {
234
+ absolute: values.absolute,
235
+ cwd: values.cwd,
236
+ dot: values.dot,
237
+ dotRelative: values['dot-relative'],
238
+ follow: values.follow,
239
+ ignore: values.ignore,
240
+ mark: values.mark,
241
+ matchBase: values['match-base'],
242
+ maxDepth: values['max-depth'],
243
+ nobrace: values.nobrace,
244
+ nocase: values.nocase,
245
+ nodir: values.nodir,
246
+ noext: values.noext,
247
+ noglobstar: values.noglobstar,
248
+ platform: values.platform,
249
+ realpath: values.realpath,
250
+ root: values.root,
251
+ stat: values.stat,
252
+ debug: values.debug,
253
+ posix: values.posix,
254
+ });
255
+ const cmd = values.cmd;
256
+ if (!cmd) {
257
+ matches.forEach(m => console.log(m));
258
+ stream.on('data', f => console.log(f));
259
+ }
260
+ else {
261
+ stream.on('data', f => matches.push(f));
262
+ stream.on('end', () => (0, foreground_child_1.foregroundChild)(cmd, matches, { shell: true }));
263
+ }
264
+ }
265
+ catch (e) {
266
+ console.error(j.usage());
267
+ console.error(e instanceof Error ? e.message : String(e));
268
+ process.exit(1);
269
+ }
270
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":";;;AACA,uDAAkD;AAClD,2BAA+B;AAC/B,yCAAgC;AAChC,kDAAyC;AACzC,yCAAuC;AAEvC,MAAM,CAAC,GAAG,IAAA,gBAAI,EAAC;IACb,KAAK,EAAE,4CAA4C;CACpD,CAAC;KACC,WAAW,CACV;YACQ,sBAAO;;;;GAIhB,CACA;KACA,GAAG,CAAC;IACH,GAAG,EAAE;QACH,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;0CACuB;KACrC;CACF,CAAC;KACD,GAAG,CAAC;IACH,OAAO,EAAE;QACP,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;iCACc;KAC5B;CACF,CAAC;KACD,IAAI,CAAC;IACJ,GAAG,EAAE;QACH,KAAK,EAAE,GAAG;QACV,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;OAqBZ;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,GAAG;QACV,WAAW,EA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OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;KACvC;SAAM;QACL,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAA,kCAAe,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;KACvE;CACF;AAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;IACxB,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;CAChB","sourcesContent":["#!/usr/bin/env node\nimport { foregroundChild } from 'foreground-child'\nimport { existsSync } from 'fs'\nimport { jack } from 'jackspeak'\nimport { version } from '../package.json'\nimport { globStream } from './index.js'\n\nconst j = jack({\n usage: 'glob [options] [<pattern> [<pattern> ...]]',\n})\n .description(\n `\n Glob v${version}\n\n Expand the positional glob expression arguments into any matching file\n system paths found.\n `\n )\n .opt({\n cmd: {\n short: 'c',\n hint: 'command',\n description: `Run the command provided, passing the glob expression\n matches as arguments.`,\n },\n })\n .opt({\n default: {\n short: 'p',\n hint: 'pattern',\n description: `If no positional arguments are provided, glob will use\n this pattern`,\n },\n })\n .flag({\n all: {\n short: 'A',\n description: `By default, the glob cli command will not expand any\n arguments that are an exact match to a file on disk.\n\n This prevents double-expanding, in case the shell expands\n an argument whose filename is a glob expression.\n\n For example, if 'app/*.ts' would match 'app/[id].ts', then\n on Windows powershell or cmd.exe, 'glob app/*.ts' will\n expand to 'app/[id].ts', as expected. However, in posix\n shells such as bash or zsh, the shell will first expand\n 'app/*.ts' to a list of filenames. Then glob will look\n for a file matching 'app/[id].ts' (ie, 'app/i.ts' or\n 'app/d.ts'), which is unexpected.\n\n Setting '--all' prevents this behavior, causing glob\n to treat ALL patterns as glob expressions to be expanded,\n even if they are an exact match to a file on disk.\n\n When setting this option, be sure to enquote arguments\n so that the shell will not expand them prior to passing\n them to the glob command process.\n `,\n },\n absolute: {\n short: 'a',\n description: 'Expand to absolute paths',\n },\n 'dot-relative': {\n short: 'd',\n description: `Prepend './' on relative matches`,\n },\n mark: {\n short: 'm',\n description: `Append a / on any directories matched`,\n },\n posix: {\n short: 'x',\n description: `Always resolve to posix style paths, using '/' as the\n directory separator, even on Windows. Drive letter\n absolute matches on Windows will be expanded to their\n full resolved UNC maths, eg instead of 'C:\\\\foo\\\\bar',\n it will expand to '//?/C:/foo/bar'.\n `,\n },\n\n follow: {\n short: 'f',\n description: `Follow symlinked directories when expanding '**'`,\n },\n realpath: {\n short: 'R',\n description: `Call 'fs.realpath' on all of the results. In the case\n of an entry that cannot be resolved, the entry is\n omitted. This incurs a slight performance penalty, of\n course, because of the added system calls.`,\n },\n stat: {\n short: 's',\n description: `Call 'fs.lstat' on all entries, whether required or not\n to determine if it's a valid match.`,\n },\n 'match-base': {\n short: 'b',\n description: `Perform a basename-only match if the pattern does not\n contain any slash characters. That is, '*.js' would be\n treated as equivalent to '**/*.js', matching js files\n in all directories.\n `,\n },\n\n dot: {\n description: `Allow patterns to match files/directories that start\n with '.', even if the pattern does not start with '.'\n `,\n },\n nobrace: {\n description: 'Do not expand {...} patterns',\n },\n nocase: {\n description: `Perform a case-insensitive match. This defaults to\n 'true' on macOS and Windows platforms, and false on\n all others.\n\n Note: 'nocase' should only be explicitly set when it is\n known that the filesystem's case sensitivity differs\n from the platform default. If set 'true' on\n case-insensitive file systems, then the walk may return\n more or less results than expected.\n `,\n },\n nodir: {\n description: `Do not match directories, only files.\n\n Note: to *only* match directories, append a '/' at the\n end of the pattern.\n `,\n },\n noext: {\n description: `Do not expand extglob patterns, such as '+(a|b)'`,\n },\n noglobstar: {\n description: `Do not expand '**' against multiple path portions.\n Ie, treat it as a normal '*' instead.`,\n },\n 'windows-path-no-escape': {\n description: `Use '\\\\' as a path separator *only*, and *never* as an\n escape character. If set, all '\\\\' characters are\n replaced with '/' in the pattern.`,\n },\n })\n .num({\n 'max-depth': {\n short: 'D',\n description: `Maximum depth to traverse from the current\n working directory`,\n },\n })\n .opt({\n cwd: {\n short: 'C',\n description: 'Current working directory to execute/match in',\n default: process.cwd(),\n },\n root: {\n short: 'r',\n description: `A string path resolved against the 'cwd', which is\n used as the starting point for absolute patterns that\n start with '/' (but not drive letters or UNC paths\n on Windows).\n\n Note that this *doesn't* necessarily limit the walk to\n the 'root' directory, and doesn't affect the cwd\n starting point for non-absolute patterns. A pattern\n containing '..' will still be able to traverse out of\n the root directory, if it is not an actual root directory\n on the filesystem, and any non-absolute patterns will\n still be matched in the 'cwd'.\n\n To start absolute and non-absolute patterns in the same\n path, you can use '--root=' to set it to the empty\n string. However, be aware that on Windows systems, a\n pattern like 'x:/*' or '//host/share/*' will *always*\n start in the 'x:/' or '//host/share/' directory,\n regardless of the --root setting.\n `,\n },\n platform: {\n description: `Defaults to the value of 'process.platform' if\n available, or 'linux' if not. Setting --platform=win32\n on non-Windows systems may cause strange behavior!`,\n validate: v =>\n new Set([\n 'aix',\n 'android',\n 'darwin',\n 'freebsd',\n 'haiku',\n 'linux',\n 'openbsd',\n 'sunos',\n 'win32',\n 'cygwin',\n 'netbsd',\n ]).has(v),\n },\n })\n .optList({\n ignore: {\n short: 'i',\n description: `Glob patterns to ignore`,\n },\n })\n .flag({\n debug: {\n short: 'v',\n description: `Output a huge amount of noisy debug information about\n patterns as they are parsed and used to match files.`,\n },\n })\n .flag({\n help: {\n short: 'h',\n description: 'Show this usage information',\n },\n })\n\ntry {\n const { positionals, values } = j.parse()\n if (values.help) {\n console.log(j.usage())\n process.exit(0)\n }\n if (positionals.length === 0 && !values.default)\n throw 'No patterns provided'\n if (positionals.length === 0 && values.default)\n positionals.push(values.default)\n const patterns = values.all\n ? positionals\n : positionals.filter(p => !existsSync(p))\n const matches = values.all ? [] : positionals.filter(p => existsSync(p))\n const stream = globStream(patterns, {\n absolute: values.absolute,\n cwd: values.cwd,\n dot: values.dot,\n dotRelative: values['dot-relative'],\n follow: values.follow,\n ignore: values.ignore,\n mark: values.mark,\n matchBase: values['match-base'],\n maxDepth: values['max-depth'],\n nobrace: values.nobrace,\n nocase: values.nocase,\n nodir: values.nodir,\n noext: values.noext,\n noglobstar: values.noglobstar,\n platform: values.platform as undefined | NodeJS.Platform,\n realpath: values.realpath,\n root: values.root,\n stat: values.stat,\n debug: values.debug,\n posix: values.posix,\n })\n\n const cmd = values.cmd\n if (!cmd) {\n matches.forEach(m => console.log(m))\n stream.on('data', f => console.log(f))\n } else {\n stream.on('data', f => matches.push(f))\n stream.on('end', () => foregroundChild(cmd, matches, { shell: true }))\n }\n} catch (e) {\n console.error(j.usage())\n console.error(e instanceof Error ? e.message : String(e))\n process.exit(1)\n}\n"]}
@@ -0,0 +1,344 @@
1
+ /// <reference types="node" />
2
+ import { Minimatch } from 'minimatch';
3
+ import { Minipass } from 'minipass';
4
+ import { FSOption, Path, PathScurry } from 'path-scurry';
5
+ import { IgnoreLike } from './ignore.js';
6
+ import { Pattern } from './pattern.js';
7
+ export type MatchSet = Minimatch['set'];
8
+ export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
9
+ /**
10
+ * A `GlobOptions` object may be provided to any of the exported methods, and
11
+ * must be provided to the `Glob` constructor.
12
+ *
13
+ * All options are optional, boolean, and false by default, unless otherwise
14
+ * noted.
15
+ *
16
+ * All resolved options are added to the Glob object as properties.
17
+ *
18
+ * If you are running many `glob` operations, you can pass a Glob object as the
19
+ * `options` argument to a subsequent operation to share the previously loaded
20
+ * cache.
21
+ */
22
+ export interface GlobOptions {
23
+ /**
24
+ * Set to `true` to always receive absolute paths for
25
+ * matched files. Set to `false` to always return relative paths.
26
+ *
27
+ * When this option is not set, absolute paths are returned for patterns
28
+ * that are absolute, and otherwise paths are returned that are relative
29
+ * to the `cwd` setting.
30
+ *
31
+ * This does _not_ make an extra system call to get
32
+ * the realpath, it only does string path resolution.
33
+ *
34
+ * Conflicts with {@link withFileTypes}
35
+ */
36
+ absolute?: boolean;
37
+ /**
38
+ * Set to false to enable {@link windowsPathsNoEscape}
39
+ *
40
+ * @deprecated
41
+ */
42
+ allowWindowsEscape?: boolean;
43
+ /**
44
+ * The current working directory in which to search. Defaults to
45
+ * `process.cwd()`.
46
+ *
47
+ * May be eiher a string path or a `file://` URL object or string.
48
+ */
49
+ cwd?: string | URL;
50
+ /**
51
+ * Include `.dot` files in normal matches and `globstar`
52
+ * matches. Note that an explicit dot in a portion of the pattern
53
+ * will always match dot files.
54
+ */
55
+ dot?: boolean;
56
+ /**
57
+ * Prepend all relative path strings with `./` (or `.\` on Windows).
58
+ *
59
+ * Without this option, returned relative paths are "bare", so instead of
60
+ * returning `'./foo/bar'`, they are returned as `'foo/bar'`.
61
+ *
62
+ * Relative patterns starting with `'../'` are not prepended with `./`, even
63
+ * if this option is set.
64
+ */
65
+ dotRelative?: boolean;
66
+ /**
67
+ * Follow symlinked directories when expanding `**`
68
+ * patterns. This can result in a lot of duplicate references in
69
+ * the presence of cyclic links, and make performance quite bad.
70
+ *
71
+ * By default, a `**` in a pattern will follow 1 symbolic link if
72
+ * it is not the first item in the pattern, or none if it is the
73
+ * first item in the pattern, following the same behavior as Bash.
74
+ */
75
+ follow?: boolean;
76
+ /**
77
+ * string or string[], or an object with `ignore` and `ignoreChildren`
78
+ * methods.
79
+ *
80
+ * If a string or string[] is provided, then this is treated as a glob
81
+ * pattern or array of glob patterns to exclude from matches. To ignore all
82
+ * children within a directory, as well as the entry itself, append `'/**'`
83
+ * to the ignore pattern.
84
+ *
85
+ * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
86
+ * any other settings.
87
+ *
88
+ * If an object is provided that has `ignored(path)` and/or
89
+ * `childrenIgnored(path)` methods, then these methods will be called to
90
+ * determine whether any Path is a match or if its children should be
91
+ * traversed, respectively.
92
+ */
93
+ ignore?: string | string[] | IgnoreLike;
94
+ /**
95
+ * Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
96
+ * effect if {@link nobrace} is set.
97
+ *
98
+ * Only has effect on the {@link hasMagic} function.
99
+ */
100
+ magicalBraces?: boolean;
101
+ /**
102
+ * Add a `/` character to directory matches. Note that this requires
103
+ * additional stat calls in some cases.
104
+ */
105
+ mark?: boolean;
106
+ /**
107
+ * Perform a basename-only match if the pattern does not contain any slash
108
+ * characters. That is, `*.js` would be treated as equivalent to
109
+ * `**\/*.js`, matching all js files in all directories.
110
+ */
111
+ matchBase?: boolean;
112
+ /**
113
+ * Limit the directory traversal to a given depth below the cwd.
114
+ * Note that this does NOT prevent traversal to sibling folders,
115
+ * root patterns, and so on. It only limits the maximum folder depth
116
+ * that the walk will descend, relative to the cwd.
117
+ */
118
+ maxDepth?: number;
119
+ /**
120
+ * Do not expand `{a,b}` and `{1..3}` brace sets.
121
+ */
122
+ nobrace?: boolean;
123
+ /**
124
+ * Perform a case-insensitive match. This defaults to `true` on macOS and
125
+ * Windows systems, and `false` on all others.
126
+ *
127
+ * **Note** `nocase` should only be explicitly set when it is
128
+ * known that the filesystem's case sensitivity differs from the
129
+ * platform default. If set `true` on case-sensitive file
130
+ * systems, or `false` on case-insensitive file systems, then the
131
+ * walk may return more or less results than expected.
132
+ */
133
+ nocase?: boolean;
134
+ /**
135
+ * Do not match directories, only files. (Note: to match
136
+ * _only_ directories, put a `/` at the end of the pattern.)
137
+ */
138
+ nodir?: boolean;
139
+ /**
140
+ * Do not match "extglob" patterns such as `+(a|b)`.
141
+ */
142
+ noext?: boolean;
143
+ /**
144
+ * Do not match `**` against multiple filenames. (Ie, treat it as a normal
145
+ * `*` instead.)
146
+ *
147
+ * Conflicts with {@link matchBase}
148
+ */
149
+ noglobstar?: boolean;
150
+ /**
151
+ * Defaults to value of `process.platform` if available, or `'linux'` if
152
+ * not. Setting `platform:'win32'` on non-Windows systems may cause strange
153
+ * behavior.
154
+ */
155
+ platform?: NodeJS.Platform;
156
+ /**
157
+ * Set to true to call `fs.realpath` on all of the
158
+ * results. In the case of an entry that cannot be resolved, the
159
+ * entry is omitted. This incurs a slight performance penalty, of
160
+ * course, because of the added system calls.
161
+ */
162
+ realpath?: boolean;
163
+ /**
164
+ *
165
+ * A string path resolved against the `cwd` option, which
166
+ * is used as the starting point for absolute patterns that start
167
+ * with `/`, (but not drive letters or UNC paths on Windows).
168
+ *
169
+ * Note that this _doesn't_ necessarily limit the walk to the
170
+ * `root` directory, and doesn't affect the cwd starting point for
171
+ * non-absolute patterns. A pattern containing `..` will still be
172
+ * able to traverse out of the root directory, if it is not an
173
+ * actual root directory on the filesystem, and any non-absolute
174
+ * patterns will be matched in the `cwd`. For example, the
175
+ * pattern `/../*` with `{root:'/some/path'}` will return all
176
+ * files in `/some`, not all files in `/some/path`. The pattern
177
+ * `*` with `{root:'/some/path'}` will return all the entries in
178
+ * the cwd, not the entries in `/some/path`.
179
+ *
180
+ * To start absolute and non-absolute patterns in the same
181
+ * path, you can use `{root:''}`. However, be aware that on
182
+ * Windows systems, a pattern like `x:/*` or `//host/share/*` will
183
+ * _always_ start in the `x:/` or `//host/share` directory,
184
+ * regardless of the `root` setting.
185
+ */
186
+ root?: string;
187
+ /**
188
+ * A [PathScurry](http://npm.im/path-scurry) object used
189
+ * to traverse the file system. If the `nocase` option is set
190
+ * explicitly, then any provided `scurry` object must match this
191
+ * setting.
192
+ */
193
+ scurry?: PathScurry;
194
+ /**
195
+ * Call `lstat()` on all entries, whether required or not to determine
196
+ * if it's a valid match. When used with {@link withFileTypes}, this means
197
+ * that matches will include data such as modified time, permissions, and
198
+ * so on. Note that this will incur a performance cost due to the added
199
+ * system calls.
200
+ */
201
+ stat?: boolean;
202
+ /**
203
+ * An AbortSignal which will cancel the Glob walk when
204
+ * triggered.
205
+ */
206
+ signal?: AbortSignal;
207
+ /**
208
+ * Use `\\` as a path separator _only_, and
209
+ * _never_ as an escape character. If set, all `\\` characters are
210
+ * replaced with `/` in the pattern.
211
+ *
212
+ * Note that this makes it **impossible** to match against paths
213
+ * containing literal glob pattern characters, but allows matching
214
+ * with patterns constructed using `path.join()` and
215
+ * `path.resolve()` on Windows platforms, mimicking the (buggy!)
216
+ * behavior of Glob v7 and before on Windows. Please use with
217
+ * caution, and be mindful of [the caveat below about Windows
218
+ * paths](#windows). (For legacy reasons, this is also set if
219
+ * `allowWindowsEscape` is set to the exact value `false`.)
220
+ */
221
+ windowsPathsNoEscape?: boolean;
222
+ /**
223
+ * Return [PathScurry](http://npm.im/path-scurry)
224
+ * `Path` objects instead of strings. These are similar to a
225
+ * NodeJS `Dirent` object, but with additional methods and
226
+ * properties.
227
+ *
228
+ * Conflicts with {@link absolute}
229
+ */
230
+ withFileTypes?: boolean;
231
+ /**
232
+ * An fs implementation to override some or all of the defaults. See
233
+ * http://npm.im/path-scurry for details about what can be overridden.
234
+ */
235
+ fs?: FSOption;
236
+ /**
237
+ * Just passed along to Minimatch. Note that this makes all pattern
238
+ * matching operations slower and *extremely* noisy.
239
+ */
240
+ debug?: boolean;
241
+ /**
242
+ * Return `/` delimited paths, even on Windows.
243
+ *
244
+ * On posix systems, this has no effect. But, on Windows, it means that
245
+ * paths will be `/` delimited, and absolute paths will be their full
246
+ * resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
247
+ * `'//?/C:/foo/bar'`
248
+ */
249
+ posix?: boolean;
250
+ }
251
+ export type GlobOptionsWithFileTypesTrue = GlobOptions & {
252
+ withFileTypes: true;
253
+ absolute?: undefined;
254
+ mark?: undefined;
255
+ posix?: undefined;
256
+ };
257
+ export type GlobOptionsWithFileTypesFalse = GlobOptions & {
258
+ withFileTypes?: false;
259
+ };
260
+ export type GlobOptionsWithFileTypesUnset = GlobOptions & {
261
+ withFileTypes?: undefined;
262
+ };
263
+ export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
264
+ export type Results<Opts> = Result<Opts>[];
265
+ export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
266
+ /**
267
+ * An object that can perform glob pattern traversals.
268
+ */
269
+ export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
270
+ absolute?: boolean;
271
+ cwd: string;
272
+ root?: string;
273
+ dot: boolean;
274
+ dotRelative: boolean;
275
+ follow: boolean;
276
+ ignore?: string | string[] | IgnoreLike;
277
+ magicalBraces: boolean;
278
+ mark?: boolean;
279
+ matchBase: boolean;
280
+ maxDepth: number;
281
+ nobrace: boolean;
282
+ nocase: boolean;
283
+ nodir: boolean;
284
+ noext: boolean;
285
+ noglobstar: boolean;
286
+ pattern: string[];
287
+ platform: NodeJS.Platform;
288
+ realpath: boolean;
289
+ scurry: PathScurry;
290
+ stat: boolean;
291
+ signal?: AbortSignal;
292
+ windowsPathsNoEscape: boolean;
293
+ withFileTypes: FileTypes<Opts>;
294
+ /**
295
+ * The options provided to the constructor.
296
+ */
297
+ opts: Opts;
298
+ /**
299
+ * An array of parsed immutable {@link Pattern} objects.
300
+ */
301
+ patterns: Pattern[];
302
+ /**
303
+ * All options are stored as properties on the `Glob` object.
304
+ *
305
+ * See {@link GlobOptions} for full options descriptions.
306
+ *
307
+ * Note that a previous `Glob` object can be passed as the
308
+ * `GlobOptions` to another `Glob` instantiation to re-use settings
309
+ * and caches with a new pattern.
310
+ *
311
+ * Traversal functions can be called multiple times to run the walk
312
+ * again.
313
+ */
314
+ constructor(pattern: string | string[], opts: Opts);
315
+ /**
316
+ * Returns a Promise that resolves to the results array.
317
+ */
318
+ walk(): Promise<Results<Opts>>;
319
+ /**
320
+ * synchronous {@link Glob.walk}
321
+ */
322
+ walkSync(): Results<Opts>;
323
+ /**
324
+ * Stream results asynchronously.
325
+ */
326
+ stream(): Minipass<Result<Opts>, Result<Opts>>;
327
+ /**
328
+ * Stream results synchronously.
329
+ */
330
+ streamSync(): Minipass<Result<Opts>, Result<Opts>>;
331
+ /**
332
+ * Default sync iteration function. Returns a Generator that
333
+ * iterates over the results.
334
+ */
335
+ iterateSync(): Generator<Result<Opts>, void, void>;
336
+ [Symbol.iterator](): Generator<Result<Opts>, void, void>;
337
+ /**
338
+ * Default async iteration function. Returns an AsyncGenerator that
339
+ * iterates over the results.
340
+ */
341
+ iterate(): AsyncGenerator<Result<Opts>, void, void>;
342
+ [Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
343
+ }
344
+ //# sourceMappingURL=glob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../src/glob.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAWlE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAElB;;;;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