korext 0.1.0

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 (517) hide show
  1. package/bin/korext.js +278 -0
  2. package/korext-cli-0.1.0.tgz +0 -0
  3. package/node_modules/ansi-regex/index.d.ts +37 -0
  4. package/node_modules/ansi-regex/index.js +10 -0
  5. package/node_modules/ansi-regex/license +9 -0
  6. package/node_modules/ansi-regex/package.json +55 -0
  7. package/node_modules/ansi-regex/readme.md +78 -0
  8. package/node_modules/ansi-styles/index.d.ts +345 -0
  9. package/node_modules/ansi-styles/index.js +163 -0
  10. package/node_modules/ansi-styles/license +9 -0
  11. package/node_modules/ansi-styles/package.json +56 -0
  12. package/node_modules/ansi-styles/readme.md +152 -0
  13. package/node_modules/balanced-match/LICENSE.md +23 -0
  14. package/node_modules/balanced-match/README.md +57 -0
  15. package/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
  16. package/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
  17. package/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  18. package/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
  19. package/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  20. package/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
  21. package/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
  22. package/node_modules/balanced-match/dist/esm/index.js +54 -0
  23. package/node_modules/balanced-match/dist/esm/index.js.map +1 -0
  24. package/node_modules/balanced-match/dist/esm/package.json +3 -0
  25. package/node_modules/balanced-match/package.json +68 -0
  26. package/node_modules/base64-js/LICENSE +21 -0
  27. package/node_modules/base64-js/README.md +34 -0
  28. package/node_modules/base64-js/base64js.min.js +1 -0
  29. package/node_modules/base64-js/index.d.ts +3 -0
  30. package/node_modules/base64-js/index.js +150 -0
  31. package/node_modules/base64-js/package.json +47 -0
  32. package/node_modules/bl/.travis.yml +17 -0
  33. package/node_modules/bl/BufferList.js +396 -0
  34. package/node_modules/bl/LICENSE.md +13 -0
  35. package/node_modules/bl/README.md +247 -0
  36. package/node_modules/bl/bl.js +84 -0
  37. package/node_modules/bl/package.json +37 -0
  38. package/node_modules/bl/test/convert.js +21 -0
  39. package/node_modules/bl/test/indexOf.js +492 -0
  40. package/node_modules/bl/test/isBufferList.js +32 -0
  41. package/node_modules/bl/test/test.js +869 -0
  42. package/node_modules/brace-expansion/LICENSE +23 -0
  43. package/node_modules/brace-expansion/README.md +94 -0
  44. package/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
  45. package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
  46. package/node_modules/brace-expansion/dist/commonjs/index.js +199 -0
  47. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
  48. package/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  49. package/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
  50. package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
  51. package/node_modules/brace-expansion/dist/esm/index.js +195 -0
  52. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
  53. package/node_modules/brace-expansion/dist/esm/package.json +3 -0
  54. package/node_modules/brace-expansion/package.json +64 -0
  55. package/node_modules/buffer/AUTHORS.md +70 -0
  56. package/node_modules/buffer/LICENSE +21 -0
  57. package/node_modules/buffer/README.md +410 -0
  58. package/node_modules/buffer/index.d.ts +186 -0
  59. package/node_modules/buffer/index.js +1817 -0
  60. package/node_modules/buffer/package.json +96 -0
  61. package/node_modules/chalk/index.d.ts +415 -0
  62. package/node_modules/chalk/license +9 -0
  63. package/node_modules/chalk/package.json +68 -0
  64. package/node_modules/chalk/readme.md +341 -0
  65. package/node_modules/chalk/source/index.js +229 -0
  66. package/node_modules/chalk/source/templates.js +134 -0
  67. package/node_modules/chalk/source/util.js +39 -0
  68. package/node_modules/cli-cursor/index.d.ts +45 -0
  69. package/node_modules/cli-cursor/index.js +35 -0
  70. package/node_modules/cli-cursor/license +9 -0
  71. package/node_modules/cli-cursor/package.json +46 -0
  72. package/node_modules/cli-cursor/readme.md +55 -0
  73. package/node_modules/cli-spinners/index.d.ts +128 -0
  74. package/node_modules/cli-spinners/index.js +15 -0
  75. package/node_modules/cli-spinners/license +9 -0
  76. package/node_modules/cli-spinners/package.json +50 -0
  77. package/node_modules/cli-spinners/readme.md +54 -0
  78. package/node_modules/cli-spinners/spinners.json +1622 -0
  79. package/node_modules/clone/.npmignore +4 -0
  80. package/node_modules/clone/LICENSE +18 -0
  81. package/node_modules/clone/README.md +126 -0
  82. package/node_modules/clone/clone.iml +10 -0
  83. package/node_modules/clone/clone.js +166 -0
  84. package/node_modules/clone/package.json +51 -0
  85. package/node_modules/color-convert/CHANGELOG.md +54 -0
  86. package/node_modules/color-convert/LICENSE +21 -0
  87. package/node_modules/color-convert/README.md +68 -0
  88. package/node_modules/color-convert/conversions.js +839 -0
  89. package/node_modules/color-convert/index.js +81 -0
  90. package/node_modules/color-convert/package.json +48 -0
  91. package/node_modules/color-convert/route.js +97 -0
  92. package/node_modules/color-name/LICENSE +8 -0
  93. package/node_modules/color-name/README.md +11 -0
  94. package/node_modules/color-name/index.js +152 -0
  95. package/node_modules/color-name/package.json +28 -0
  96. package/node_modules/commander/LICENSE +22 -0
  97. package/node_modules/commander/Readme.md +1176 -0
  98. package/node_modules/commander/esm.mjs +16 -0
  99. package/node_modules/commander/index.js +24 -0
  100. package/node_modules/commander/lib/argument.js +150 -0
  101. package/node_modules/commander/lib/command.js +2777 -0
  102. package/node_modules/commander/lib/error.js +39 -0
  103. package/node_modules/commander/lib/help.js +747 -0
  104. package/node_modules/commander/lib/option.js +380 -0
  105. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  106. package/node_modules/commander/package-support.json +19 -0
  107. package/node_modules/commander/package.json +82 -0
  108. package/node_modules/commander/typings/esm.d.mts +3 -0
  109. package/node_modules/commander/typings/index.d.ts +1113 -0
  110. package/node_modules/data-uri-to-buffer/README.md +88 -0
  111. package/node_modules/data-uri-to-buffer/dist/index.d.ts +15 -0
  112. package/node_modules/data-uri-to-buffer/dist/index.js +53 -0
  113. package/node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
  114. package/node_modules/data-uri-to-buffer/package.json +62 -0
  115. package/node_modules/data-uri-to-buffer/src/index.ts +68 -0
  116. package/node_modules/defaults/LICENSE +22 -0
  117. package/node_modules/defaults/README.md +39 -0
  118. package/node_modules/defaults/index.js +13 -0
  119. package/node_modules/defaults/package.json +33 -0
  120. package/node_modules/defaults/test.js +34 -0
  121. package/node_modules/fetch-blob/LICENSE +21 -0
  122. package/node_modules/fetch-blob/README.md +106 -0
  123. package/node_modules/fetch-blob/file.d.ts +2 -0
  124. package/node_modules/fetch-blob/file.js +49 -0
  125. package/node_modules/fetch-blob/from.d.ts +26 -0
  126. package/node_modules/fetch-blob/from.js +100 -0
  127. package/node_modules/fetch-blob/index.d.ts +3 -0
  128. package/node_modules/fetch-blob/index.js +250 -0
  129. package/node_modules/fetch-blob/package.json +56 -0
  130. package/node_modules/fetch-blob/streams.cjs +51 -0
  131. package/node_modules/formdata-polyfill/FormData.js +441 -0
  132. package/node_modules/formdata-polyfill/LICENSE +21 -0
  133. package/node_modules/formdata-polyfill/README.md +145 -0
  134. package/node_modules/formdata-polyfill/esm.min.d.ts +5 -0
  135. package/node_modules/formdata-polyfill/esm.min.js +40 -0
  136. package/node_modules/formdata-polyfill/formdata-to-blob.js +39 -0
  137. package/node_modules/formdata-polyfill/formdata.min.js +21 -0
  138. package/node_modules/formdata-polyfill/package.json +50 -0
  139. package/node_modules/glob/LICENSE.md +63 -0
  140. package/node_modules/glob/README.md +1203 -0
  141. package/node_modules/glob/dist/commonjs/glob.d.ts +396 -0
  142. package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
  143. package/node_modules/glob/dist/commonjs/glob.js +248 -0
  144. package/node_modules/glob/dist/commonjs/glob.js.map +1 -0
  145. package/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
  146. package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
  147. package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  148. package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
  149. package/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
  150. package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
  151. package/node_modules/glob/dist/commonjs/ignore.js +119 -0
  152. package/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
  153. package/node_modules/glob/dist/commonjs/index.d.ts +97 -0
  154. package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
  155. package/node_modules/glob/dist/commonjs/index.js +68 -0
  156. package/node_modules/glob/dist/commonjs/index.js.map +1 -0
  157. package/node_modules/glob/dist/commonjs/index.min.js +4 -0
  158. package/node_modules/glob/dist/commonjs/index.min.js.map +7 -0
  159. package/node_modules/glob/dist/commonjs/package.json +3 -0
  160. package/node_modules/glob/dist/commonjs/pattern.d.ts +79 -0
  161. package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
  162. package/node_modules/glob/dist/commonjs/pattern.js +223 -0
  163. package/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
  164. package/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
  165. package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
  166. package/node_modules/glob/dist/commonjs/processor.js +301 -0
  167. package/node_modules/glob/dist/commonjs/processor.js.map +1 -0
  168. package/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
  169. package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
  170. package/node_modules/glob/dist/commonjs/walker.js +387 -0
  171. package/node_modules/glob/dist/commonjs/walker.js.map +1 -0
  172. package/node_modules/glob/dist/esm/glob.d.ts +396 -0
  173. package/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
  174. package/node_modules/glob/dist/esm/glob.js +244 -0
  175. package/node_modules/glob/dist/esm/glob.js.map +1 -0
  176. package/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
  177. package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
  178. package/node_modules/glob/dist/esm/has-magic.js +23 -0
  179. package/node_modules/glob/dist/esm/has-magic.js.map +1 -0
  180. package/node_modules/glob/dist/esm/ignore.d.ts +24 -0
  181. package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
  182. package/node_modules/glob/dist/esm/ignore.js +115 -0
  183. package/node_modules/glob/dist/esm/ignore.js.map +1 -0
  184. package/node_modules/glob/dist/esm/index.d.ts +97 -0
  185. package/node_modules/glob/dist/esm/index.d.ts.map +1 -0
  186. package/node_modules/glob/dist/esm/index.js +55 -0
  187. package/node_modules/glob/dist/esm/index.js.map +1 -0
  188. package/node_modules/glob/dist/esm/index.min.js +4 -0
  189. package/node_modules/glob/dist/esm/index.min.js.map +7 -0
  190. package/node_modules/glob/dist/esm/package.json +3 -0
  191. package/node_modules/glob/dist/esm/pattern.d.ts +79 -0
  192. package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
  193. package/node_modules/glob/dist/esm/pattern.js +219 -0
  194. package/node_modules/glob/dist/esm/pattern.js.map +1 -0
  195. package/node_modules/glob/dist/esm/processor.d.ts +59 -0
  196. package/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
  197. package/node_modules/glob/dist/esm/processor.js +294 -0
  198. package/node_modules/glob/dist/esm/processor.js.map +1 -0
  199. package/node_modules/glob/dist/esm/walker.d.ts +97 -0
  200. package/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
  201. package/node_modules/glob/dist/esm/walker.js +381 -0
  202. package/node_modules/glob/dist/esm/walker.js.map +1 -0
  203. package/node_modules/glob/package.json +98 -0
  204. package/node_modules/has-flag/index.d.ts +39 -0
  205. package/node_modules/has-flag/index.js +8 -0
  206. package/node_modules/has-flag/license +9 -0
  207. package/node_modules/has-flag/package.json +46 -0
  208. package/node_modules/has-flag/readme.md +89 -0
  209. package/node_modules/ieee754/LICENSE +11 -0
  210. package/node_modules/ieee754/README.md +51 -0
  211. package/node_modules/ieee754/index.d.ts +10 -0
  212. package/node_modules/ieee754/index.js +85 -0
  213. package/node_modules/ieee754/package.json +52 -0
  214. package/node_modules/inherits/LICENSE +16 -0
  215. package/node_modules/inherits/README.md +42 -0
  216. package/node_modules/inherits/inherits.js +9 -0
  217. package/node_modules/inherits/inherits_browser.js +27 -0
  218. package/node_modules/inherits/package.json +29 -0
  219. package/node_modules/is-interactive/index.d.ts +31 -0
  220. package/node_modules/is-interactive/index.js +9 -0
  221. package/node_modules/is-interactive/license +9 -0
  222. package/node_modules/is-interactive/package.json +38 -0
  223. package/node_modules/is-interactive/readme.md +51 -0
  224. package/node_modules/is-unicode-supported/index.d.ts +14 -0
  225. package/node_modules/is-unicode-supported/index.js +13 -0
  226. package/node_modules/is-unicode-supported/license +9 -0
  227. package/node_modules/is-unicode-supported/package.json +41 -0
  228. package/node_modules/is-unicode-supported/readme.md +35 -0
  229. package/node_modules/log-symbols/browser.js +8 -0
  230. package/node_modules/log-symbols/index.d.ts +25 -0
  231. package/node_modules/log-symbols/index.js +19 -0
  232. package/node_modules/log-symbols/license +9 -0
  233. package/node_modules/log-symbols/package.json +52 -0
  234. package/node_modules/log-symbols/readme.md +51 -0
  235. package/node_modules/lru-cache/LICENSE.md +55 -0
  236. package/node_modules/lru-cache/README.md +383 -0
  237. package/node_modules/lru-cache/dist/commonjs/index.d.ts +1323 -0
  238. package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
  239. package/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
  240. package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
  241. package/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  242. package/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
  243. package/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  244. package/node_modules/lru-cache/dist/esm/index.d.ts +1323 -0
  245. package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
  246. package/node_modules/lru-cache/dist/esm/index.js +1591 -0
  247. package/node_modules/lru-cache/dist/esm/index.js.map +1 -0
  248. package/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  249. package/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
  250. package/node_modules/lru-cache/dist/esm/package.json +3 -0
  251. package/node_modules/lru-cache/package.json +93 -0
  252. package/node_modules/mimic-fn/index.d.ts +54 -0
  253. package/node_modules/mimic-fn/index.js +13 -0
  254. package/node_modules/mimic-fn/license +9 -0
  255. package/node_modules/mimic-fn/package.json +42 -0
  256. package/node_modules/mimic-fn/readme.md +69 -0
  257. package/node_modules/minimatch/LICENSE.md +55 -0
  258. package/node_modules/minimatch/README.md +528 -0
  259. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  260. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  261. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  262. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  263. package/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
  264. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  265. package/node_modules/minimatch/dist/commonjs/ast.js +846 -0
  266. package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  267. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  268. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  269. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  270. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  271. package/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
  272. package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  273. package/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  274. package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  275. package/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
  276. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  277. package/node_modules/minimatch/dist/commonjs/index.js +1121 -0
  278. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  279. package/node_modules/minimatch/dist/commonjs/package.json +3 -0
  280. package/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
  281. package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  282. package/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  283. package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  284. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  285. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  286. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  287. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  288. package/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
  289. package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  290. package/node_modules/minimatch/dist/esm/ast.js +842 -0
  291. package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  292. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  293. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  294. package/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  295. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  296. package/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
  297. package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  298. package/node_modules/minimatch/dist/esm/escape.js +26 -0
  299. package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  300. package/node_modules/minimatch/dist/esm/index.d.ts +174 -0
  301. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  302. package/node_modules/minimatch/dist/esm/index.js +1108 -0
  303. package/node_modules/minimatch/dist/esm/index.js.map +1 -0
  304. package/node_modules/minimatch/dist/esm/package.json +3 -0
  305. package/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
  306. package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  307. package/node_modules/minimatch/dist/esm/unescape.js +34 -0
  308. package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  309. package/node_modules/minimatch/package.json +67 -0
  310. package/node_modules/minipass/LICENSE.md +55 -0
  311. package/node_modules/minipass/README.md +825 -0
  312. package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
  313. package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
  314. package/node_modules/minipass/dist/commonjs/index.js +1038 -0
  315. package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
  316. package/node_modules/minipass/dist/commonjs/package.json +3 -0
  317. package/node_modules/minipass/dist/esm/index.d.ts +545 -0
  318. package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
  319. package/node_modules/minipass/dist/esm/index.js +1020 -0
  320. package/node_modules/minipass/dist/esm/index.js.map +1 -0
  321. package/node_modules/minipass/dist/esm/package.json +3 -0
  322. package/node_modules/minipass/package.json +77 -0
  323. package/node_modules/node-domexception/.history/README_20210527203617.md +2 -0
  324. package/node_modules/node-domexception/.history/README_20210527212714.md +41 -0
  325. package/node_modules/node-domexception/.history/README_20210527213345.md +36 -0
  326. package/node_modules/node-domexception/.history/README_20210527213411.md +36 -0
  327. package/node_modules/node-domexception/.history/README_20210527213803.md +36 -0
  328. package/node_modules/node-domexception/.history/README_20210527214323.md +38 -0
  329. package/node_modules/node-domexception/.history/README_20210527214408.md +38 -0
  330. package/node_modules/node-domexception/.history/index_20210527203842.js +0 -0
  331. package/node_modules/node-domexception/.history/index_20210527203947.js +8 -0
  332. package/node_modules/node-domexception/.history/index_20210527204259.js +9 -0
  333. package/node_modules/node-domexception/.history/index_20210527204418.js +9 -0
  334. package/node_modules/node-domexception/.history/index_20210527204756.js +11 -0
  335. package/node_modules/node-domexception/.history/index_20210527204833.js +11 -0
  336. package/node_modules/node-domexception/.history/index_20210527211208.js +15 -0
  337. package/node_modules/node-domexception/.history/index_20210527211248.js +15 -0
  338. package/node_modules/node-domexception/.history/index_20210527212722.js +23 -0
  339. package/node_modules/node-domexception/.history/index_20210527212731.js +23 -0
  340. package/node_modules/node-domexception/.history/index_20210527212746.js +15 -0
  341. package/node_modules/node-domexception/.history/index_20210527212900.js +16 -0
  342. package/node_modules/node-domexception/.history/index_20210527213022.js +16 -0
  343. package/node_modules/node-domexception/.history/index_20210527213822.js +16 -0
  344. package/node_modules/node-domexception/.history/index_20210527213843.js +17 -0
  345. package/node_modules/node-domexception/.history/index_20210527213852.js +17 -0
  346. package/node_modules/node-domexception/.history/index_20210527213910.js +16 -0
  347. package/node_modules/node-domexception/.history/index_20210527214034.js +16 -0
  348. package/node_modules/node-domexception/.history/index_20210527214643.js +41 -0
  349. package/node_modules/node-domexception/.history/index_20210527214654.js +41 -0
  350. package/node_modules/node-domexception/.history/index_20210527214700.js +16 -0
  351. package/node_modules/node-domexception/.history/package_20210527203733.json +19 -0
  352. package/node_modules/node-domexception/.history/package_20210527203825.json +16 -0
  353. package/node_modules/node-domexception/.history/package_20210527204621.json +19 -0
  354. package/node_modules/node-domexception/.history/package_20210527204913.json +25 -0
  355. package/node_modules/node-domexception/.history/package_20210527204925.json +25 -0
  356. package/node_modules/node-domexception/.history/package_20210527205145.json +29 -0
  357. package/node_modules/node-domexception/.history/package_20210527205156.json +29 -0
  358. package/node_modules/node-domexception/.history/test_20210527205603.js +0 -0
  359. package/node_modules/node-domexception/.history/test_20210527205957.js +3 -0
  360. package/node_modules/node-domexception/.history/test_20210527210021.js +3 -0
  361. package/node_modules/node-domexception/LICENSE +21 -0
  362. package/node_modules/node-domexception/README.md +46 -0
  363. package/node_modules/node-domexception/index.js +16 -0
  364. package/node_modules/node-domexception/package.json +29 -0
  365. package/node_modules/node-fetch/@types/index.d.ts +219 -0
  366. package/node_modules/node-fetch/LICENSE.md +22 -0
  367. package/node_modules/node-fetch/README.md +872 -0
  368. package/node_modules/node-fetch/package.json +131 -0
  369. package/node_modules/node-fetch/src/body.js +397 -0
  370. package/node_modules/node-fetch/src/errors/abort-error.js +10 -0
  371. package/node_modules/node-fetch/src/errors/base.js +17 -0
  372. package/node_modules/node-fetch/src/errors/fetch-error.js +26 -0
  373. package/node_modules/node-fetch/src/headers.js +267 -0
  374. package/node_modules/node-fetch/src/index.js +417 -0
  375. package/node_modules/node-fetch/src/request.js +313 -0
  376. package/node_modules/node-fetch/src/response.js +160 -0
  377. package/node_modules/node-fetch/src/utils/get-search.js +9 -0
  378. package/node_modules/node-fetch/src/utils/is-redirect.js +11 -0
  379. package/node_modules/node-fetch/src/utils/is.js +87 -0
  380. package/node_modules/node-fetch/src/utils/multipart-parser.js +432 -0
  381. package/node_modules/node-fetch/src/utils/referrer.js +340 -0
  382. package/node_modules/onetime/index.d.ts +64 -0
  383. package/node_modules/onetime/index.js +44 -0
  384. package/node_modules/onetime/license +9 -0
  385. package/node_modules/onetime/package.json +43 -0
  386. package/node_modules/onetime/readme.md +94 -0
  387. package/node_modules/ora/index.d.ts +277 -0
  388. package/node_modules/ora/index.js +407 -0
  389. package/node_modules/ora/license +9 -0
  390. package/node_modules/ora/package.json +57 -0
  391. package/node_modules/ora/readme.md +264 -0
  392. package/node_modules/path-scurry/LICENSE.md +55 -0
  393. package/node_modules/path-scurry/README.md +636 -0
  394. package/node_modules/path-scurry/dist/commonjs/index.d.ts +1115 -0
  395. package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -0
  396. package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
  397. package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -0
  398. package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  399. package/node_modules/path-scurry/dist/esm/index.d.ts +1115 -0
  400. package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -0
  401. package/node_modules/path-scurry/dist/esm/index.js +1983 -0
  402. package/node_modules/path-scurry/dist/esm/index.js.map +1 -0
  403. package/node_modules/path-scurry/dist/esm/package.json +3 -0
  404. package/node_modules/path-scurry/package.json +72 -0
  405. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  406. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  407. package/node_modules/readable-stream/LICENSE +47 -0
  408. package/node_modules/readable-stream/README.md +106 -0
  409. package/node_modules/readable-stream/errors-browser.js +127 -0
  410. package/node_modules/readable-stream/errors.js +116 -0
  411. package/node_modules/readable-stream/experimentalWarning.js +17 -0
  412. package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
  413. package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
  414. package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
  415. package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
  416. package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
  417. package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
  418. package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
  419. package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
  420. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
  421. package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  422. package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
  423. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
  424. package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
  425. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  426. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  427. package/node_modules/readable-stream/package.json +68 -0
  428. package/node_modules/readable-stream/readable-browser.js +9 -0
  429. package/node_modules/readable-stream/readable.js +16 -0
  430. package/node_modules/restore-cursor/index.d.ts +13 -0
  431. package/node_modules/restore-cursor/index.js +9 -0
  432. package/node_modules/restore-cursor/license +9 -0
  433. package/node_modules/restore-cursor/package.json +52 -0
  434. package/node_modules/restore-cursor/readme.md +26 -0
  435. package/node_modules/safe-buffer/LICENSE +21 -0
  436. package/node_modules/safe-buffer/README.md +584 -0
  437. package/node_modules/safe-buffer/index.d.ts +187 -0
  438. package/node_modules/safe-buffer/index.js +65 -0
  439. package/node_modules/safe-buffer/package.json +51 -0
  440. package/node_modules/signal-exit/LICENSE.txt +16 -0
  441. package/node_modules/signal-exit/README.md +39 -0
  442. package/node_modules/signal-exit/index.js +202 -0
  443. package/node_modules/signal-exit/package.json +38 -0
  444. package/node_modules/signal-exit/signals.js +53 -0
  445. package/node_modules/string_decoder/LICENSE +48 -0
  446. package/node_modules/string_decoder/README.md +47 -0
  447. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  448. package/node_modules/string_decoder/package.json +34 -0
  449. package/node_modules/strip-ansi/index.d.ts +17 -0
  450. package/node_modules/strip-ansi/index.js +4 -0
  451. package/node_modules/strip-ansi/license +9 -0
  452. package/node_modules/strip-ansi/package.json +54 -0
  453. package/node_modules/strip-ansi/readme.md +46 -0
  454. package/node_modules/supports-color/browser.js +5 -0
  455. package/node_modules/supports-color/index.js +135 -0
  456. package/node_modules/supports-color/license +9 -0
  457. package/node_modules/supports-color/package.json +53 -0
  458. package/node_modules/supports-color/readme.md +76 -0
  459. package/node_modules/util-deprecate/History.md +16 -0
  460. package/node_modules/util-deprecate/LICENSE +24 -0
  461. package/node_modules/util-deprecate/README.md +53 -0
  462. package/node_modules/util-deprecate/browser.js +67 -0
  463. package/node_modules/util-deprecate/node.js +6 -0
  464. package/node_modules/util-deprecate/package.json +27 -0
  465. package/node_modules/wcwidth/.npmignore +1 -0
  466. package/node_modules/wcwidth/LICENSE +30 -0
  467. package/node_modules/wcwidth/Readme.md +33 -0
  468. package/node_modules/wcwidth/combining.js +50 -0
  469. package/node_modules/wcwidth/docs/index.md +65 -0
  470. package/node_modules/wcwidth/index.js +99 -0
  471. package/node_modules/wcwidth/package.json +42 -0
  472. package/node_modules/wcwidth/test/index.js +64 -0
  473. package/node_modules/web-streams-polyfill/LICENSE +22 -0
  474. package/node_modules/web-streams-polyfill/README.md +110 -0
  475. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js +4765 -0
  476. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js.map +1 -0
  477. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js +9 -0
  478. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js.map +1 -0
  479. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs +4745 -0
  480. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs.map +1 -0
  481. package/node_modules/web-streams-polyfill/dist/polyfill.es6.js +4838 -0
  482. package/node_modules/web-streams-polyfill/dist/polyfill.es6.js.map +1 -0
  483. package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js +9 -0
  484. package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js.map +1 -0
  485. package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs +4818 -0
  486. package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs.map +1 -0
  487. package/node_modules/web-streams-polyfill/dist/polyfill.js +5011 -0
  488. package/node_modules/web-streams-polyfill/dist/polyfill.js.map +1 -0
  489. package/node_modules/web-streams-polyfill/dist/polyfill.min.js +9 -0
  490. package/node_modules/web-streams-polyfill/dist/polyfill.min.js.map +1 -0
  491. package/node_modules/web-streams-polyfill/dist/polyfill.mjs +4991 -0
  492. package/node_modules/web-streams-polyfill/dist/polyfill.mjs.map +1 -0
  493. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +4737 -0
  494. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
  495. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs +4717 -0
  496. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs.map +1 -0
  497. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js +4810 -0
  498. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js.map +1 -0
  499. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs +4790 -0
  500. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs.map +1 -0
  501. package/node_modules/web-streams-polyfill/dist/ponyfill.js +4983 -0
  502. package/node_modules/web-streams-polyfill/dist/ponyfill.js.map +1 -0
  503. package/node_modules/web-streams-polyfill/dist/ponyfill.mjs +4963 -0
  504. package/node_modules/web-streams-polyfill/dist/ponyfill.mjs.map +1 -0
  505. package/node_modules/web-streams-polyfill/dist/types/polyfill.d.ts +24 -0
  506. package/node_modules/web-streams-polyfill/dist/types/ponyfill.d.ts +780 -0
  507. package/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts +28 -0
  508. package/node_modules/web-streams-polyfill/dist/types/ts3.6/ponyfill.d.ts +821 -0
  509. package/node_modules/web-streams-polyfill/dist/types/tsdoc-metadata.json +11 -0
  510. package/node_modules/web-streams-polyfill/es2018/package.json +14 -0
  511. package/node_modules/web-streams-polyfill/es6/package.json +14 -0
  512. package/node_modules/web-streams-polyfill/package.json +83 -0
  513. package/node_modules/web-streams-polyfill/ponyfill/es2018/package.json +13 -0
  514. package/node_modules/web-streams-polyfill/ponyfill/es6/package.json +13 -0
  515. package/node_modules/web-streams-polyfill/ponyfill/package.json +13 -0
  516. package/package.json +26 -0
  517. package/version.json +18 -0
@@ -0,0 +1,1121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
4
+ const brace_expansion_1 = require("brace-expansion");
5
+ const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js");
6
+ const ast_js_1 = require("./ast.js");
7
+ const escape_js_1 = require("./escape.js");
8
+ const unescape_js_1 = require("./unescape.js");
9
+ const minimatch = (p, pattern, options = {}) => {
10
+ (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
11
+ // shortcut: comments match nothing.
12
+ if (!options.nocomment && pattern.charAt(0) === '#') {
13
+ return false;
14
+ }
15
+ return new Minimatch(pattern, options).match(p);
16
+ };
17
+ exports.minimatch = minimatch;
18
+ // Optimized checking for the most common glob patterns.
19
+ const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
20
+ const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
21
+ const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
22
+ const starDotExtTestNocase = (ext) => {
23
+ ext = ext.toLowerCase();
24
+ return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
25
+ };
26
+ const starDotExtTestNocaseDot = (ext) => {
27
+ ext = ext.toLowerCase();
28
+ return (f) => f.toLowerCase().endsWith(ext);
29
+ };
30
+ const starDotStarRE = /^\*+\.\*+$/;
31
+ const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
32
+ const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
33
+ const dotStarRE = /^\.\*+$/;
34
+ const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
35
+ const starRE = /^\*+$/;
36
+ const starTest = (f) => f.length !== 0 && !f.startsWith('.');
37
+ const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
38
+ const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
39
+ const qmarksTestNocase = ([$0, ext = '']) => {
40
+ const noext = qmarksTestNoExt([$0]);
41
+ if (!ext)
42
+ return noext;
43
+ ext = ext.toLowerCase();
44
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext);
45
+ };
46
+ const qmarksTestNocaseDot = ([$0, ext = '']) => {
47
+ const noext = qmarksTestNoExtDot([$0]);
48
+ if (!ext)
49
+ return noext;
50
+ ext = ext.toLowerCase();
51
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext);
52
+ };
53
+ const qmarksTestDot = ([$0, ext = '']) => {
54
+ const noext = qmarksTestNoExtDot([$0]);
55
+ return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
56
+ };
57
+ const qmarksTest = ([$0, ext = '']) => {
58
+ const noext = qmarksTestNoExt([$0]);
59
+ return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
60
+ };
61
+ const qmarksTestNoExt = ([$0]) => {
62
+ const len = $0.length;
63
+ return (f) => f.length === len && !f.startsWith('.');
64
+ };
65
+ const qmarksTestNoExtDot = ([$0]) => {
66
+ const len = $0.length;
67
+ return (f) => f.length === len && f !== '.' && f !== '..';
68
+ };
69
+ /* c8 ignore start */
70
+ const defaultPlatform = (typeof process === 'object' && process ?
71
+ (typeof process.env === 'object' &&
72
+ process.env &&
73
+ process.env.__MINIMATCH_TESTING_PLATFORM__) ||
74
+ process.platform
75
+ : 'posix');
76
+ const path = {
77
+ win32: { sep: '\\' },
78
+ posix: { sep: '/' },
79
+ };
80
+ /* c8 ignore stop */
81
+ exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
82
+ exports.minimatch.sep = exports.sep;
83
+ exports.GLOBSTAR = Symbol('globstar **');
84
+ exports.minimatch.GLOBSTAR = exports.GLOBSTAR;
85
+ // any single thing other than /
86
+ // don't need to escape / when using new RegExp()
87
+ const qmark = '[^/]';
88
+ // * => any number of characters
89
+ const star = qmark + '*?';
90
+ // ** when dots are allowed. Anything goes, except .. and .
91
+ // not (^ or / followed by one or two dots followed by $ or /),
92
+ // followed by anything, any number of times.
93
+ const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
94
+ // not a ^ or / followed by a dot,
95
+ // followed by anything, any number of times.
96
+ const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
97
+ const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options);
98
+ exports.filter = filter;
99
+ exports.minimatch.filter = exports.filter;
100
+ const ext = (a, b = {}) => Object.assign({}, a, b);
101
+ const defaults = (def) => {
102
+ if (!def || typeof def !== 'object' || !Object.keys(def).length) {
103
+ return exports.minimatch;
104
+ }
105
+ const orig = exports.minimatch;
106
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
107
+ return Object.assign(m, {
108
+ Minimatch: class Minimatch extends orig.Minimatch {
109
+ constructor(pattern, options = {}) {
110
+ super(pattern, ext(def, options));
111
+ }
112
+ static defaults(options) {
113
+ return orig.defaults(ext(def, options)).Minimatch;
114
+ }
115
+ },
116
+ AST: class AST extends orig.AST {
117
+ /* c8 ignore start */
118
+ constructor(type, parent, options = {}) {
119
+ super(type, parent, ext(def, options));
120
+ }
121
+ /* c8 ignore stop */
122
+ static fromGlob(pattern, options = {}) {
123
+ return orig.AST.fromGlob(pattern, ext(def, options));
124
+ }
125
+ },
126
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
127
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
128
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
129
+ defaults: (options) => orig.defaults(ext(def, options)),
130
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
131
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
132
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
133
+ sep: orig.sep,
134
+ GLOBSTAR: exports.GLOBSTAR,
135
+ });
136
+ };
137
+ exports.defaults = defaults;
138
+ exports.minimatch.defaults = exports.defaults;
139
+ // Brace expansion:
140
+ // a{b,c}d -> abd acd
141
+ // a{b,}c -> abc ac
142
+ // a{0..3}d -> a0d a1d a2d a3d
143
+ // a{b,c{d,e}f}g -> abg acdfg acefg
144
+ // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
145
+ //
146
+ // Invalid sets are not expanded.
147
+ // a{2..}b -> a{2..}b
148
+ // a{b}c -> a{b}c
149
+ const braceExpand = (pattern, options = {}) => {
150
+ (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
151
+ // Thanks to Yeting Li <https://github.com/yetingli> for
152
+ // improving this regexp to avoid a ReDOS vulnerability.
153
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
154
+ // shortcut. no need to expand.
155
+ return [pattern];
156
+ }
157
+ return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax });
158
+ };
159
+ exports.braceExpand = braceExpand;
160
+ exports.minimatch.braceExpand = exports.braceExpand;
161
+ // parse a component of the expanded set.
162
+ // At this point, no pattern may contain "/" in it
163
+ // so we're going to return a 2d array, where each entry is the full
164
+ // pattern, split on '/', and then turned into a regular expression.
165
+ // A regexp is made at the end which joins each array with an
166
+ // escaped /, and another full one which joins each regexp with |.
167
+ //
168
+ // Following the lead of Bash 4.1, note that "**" only has special meaning
169
+ // when it is the *only* thing in a path portion. Otherwise, any series
170
+ // of * is equivalent to a single *. Globstar behavior is enabled by
171
+ // default, and can be disabled by setting options.noglobstar.
172
+ const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
173
+ exports.makeRe = makeRe;
174
+ exports.minimatch.makeRe = exports.makeRe;
175
+ const match = (list, pattern, options = {}) => {
176
+ const mm = new Minimatch(pattern, options);
177
+ list = list.filter(f => mm.match(f));
178
+ if (mm.options.nonull && !list.length) {
179
+ list.push(pattern);
180
+ }
181
+ return list;
182
+ };
183
+ exports.match = match;
184
+ exports.minimatch.match = exports.match;
185
+ // replace stuff like \* with *
186
+ const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
187
+ const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
188
+ class Minimatch {
189
+ options;
190
+ set;
191
+ pattern;
192
+ windowsPathsNoEscape;
193
+ nonegate;
194
+ negate;
195
+ comment;
196
+ empty;
197
+ preserveMultipleSlashes;
198
+ partial;
199
+ globSet;
200
+ globParts;
201
+ nocase;
202
+ isWindows;
203
+ platform;
204
+ windowsNoMagicRoot;
205
+ maxGlobstarRecursion;
206
+ regexp;
207
+ constructor(pattern, options = {}) {
208
+ (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
209
+ options = options || {};
210
+ this.options = options;
211
+ this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
212
+ this.pattern = pattern;
213
+ this.platform = options.platform || defaultPlatform;
214
+ this.isWindows = this.platform === 'win32';
215
+ // avoid the annoying deprecation flag lol
216
+ const awe = ('allowWindow' + 'sEscape');
217
+ this.windowsPathsNoEscape =
218
+ !!options.windowsPathsNoEscape || options[awe] === false;
219
+ if (this.windowsPathsNoEscape) {
220
+ this.pattern = this.pattern.replace(/\\/g, '/');
221
+ }
222
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
223
+ this.regexp = null;
224
+ this.negate = false;
225
+ this.nonegate = !!options.nonegate;
226
+ this.comment = false;
227
+ this.empty = false;
228
+ this.partial = !!options.partial;
229
+ this.nocase = !!this.options.nocase;
230
+ this.windowsNoMagicRoot =
231
+ options.windowsNoMagicRoot !== undefined ?
232
+ options.windowsNoMagicRoot
233
+ : !!(this.isWindows && this.nocase);
234
+ this.globSet = [];
235
+ this.globParts = [];
236
+ this.set = [];
237
+ // make the set of regexps etc.
238
+ this.make();
239
+ }
240
+ hasMagic() {
241
+ if (this.options.magicalBraces && this.set.length > 1) {
242
+ return true;
243
+ }
244
+ for (const pattern of this.set) {
245
+ for (const part of pattern) {
246
+ if (typeof part !== 'string')
247
+ return true;
248
+ }
249
+ }
250
+ return false;
251
+ }
252
+ debug(..._) { }
253
+ make() {
254
+ const pattern = this.pattern;
255
+ const options = this.options;
256
+ // empty patterns and comments match nothing.
257
+ if (!options.nocomment && pattern.charAt(0) === '#') {
258
+ this.comment = true;
259
+ return;
260
+ }
261
+ if (!pattern) {
262
+ this.empty = true;
263
+ return;
264
+ }
265
+ // step 1: figure out negation, etc.
266
+ this.parseNegate();
267
+ // step 2: expand braces
268
+ this.globSet = [...new Set(this.braceExpand())];
269
+ if (options.debug) {
270
+ this.debug = (...args) => console.error(...args);
271
+ }
272
+ this.debug(this.pattern, this.globSet);
273
+ // step 3: now we have a set, so turn each one into a series of
274
+ // path-portion matching patterns.
275
+ // These will be regexps, except in the case of "**", which is
276
+ // set to the GLOBSTAR object for globstar behavior,
277
+ // and will not contain any / characters
278
+ //
279
+ // First, we preprocess to make the glob pattern sets a bit simpler
280
+ // and deduped. There are some perf-killing patterns that can cause
281
+ // problems with a glob walk, but we can simplify them down a bit.
282
+ const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
283
+ this.globParts = this.preprocess(rawGlobParts);
284
+ this.debug(this.pattern, this.globParts);
285
+ // glob --> regexps
286
+ let set = this.globParts.map((s, _, __) => {
287
+ if (this.isWindows && this.windowsNoMagicRoot) {
288
+ // check if it's a drive or unc path.
289
+ const isUNC = s[0] === '' &&
290
+ s[1] === '' &&
291
+ (s[2] === '?' || !globMagic.test(s[2])) &&
292
+ !globMagic.test(s[3]);
293
+ const isDrive = /^[a-z]:/i.test(s[0]);
294
+ if (isUNC) {
295
+ return [
296
+ ...s.slice(0, 4),
297
+ ...s.slice(4).map(ss => this.parse(ss)),
298
+ ];
299
+ }
300
+ else if (isDrive) {
301
+ return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
302
+ }
303
+ }
304
+ return s.map(ss => this.parse(ss));
305
+ });
306
+ this.debug(this.pattern, set);
307
+ // filter out everything that didn't compile properly.
308
+ this.set = set.filter(s => s.indexOf(false) === -1);
309
+ // do not treat the ? in UNC paths as magic
310
+ if (this.isWindows) {
311
+ for (let i = 0; i < this.set.length; i++) {
312
+ const p = this.set[i];
313
+ if (p[0] === '' &&
314
+ p[1] === '' &&
315
+ this.globParts[i][2] === '?' &&
316
+ typeof p[3] === 'string' &&
317
+ /^[a-z]:$/i.test(p[3])) {
318
+ p[2] = '?';
319
+ }
320
+ }
321
+ }
322
+ this.debug(this.pattern, this.set);
323
+ }
324
+ // various transforms to equivalent pattern sets that are
325
+ // faster to process in a filesystem walk. The goal is to
326
+ // eliminate what we can, and push all ** patterns as far
327
+ // to the right as possible, even if it increases the number
328
+ // of patterns that we have to process.
329
+ preprocess(globParts) {
330
+ // if we're not in globstar mode, then turn ** into *
331
+ if (this.options.noglobstar) {
332
+ for (let i = 0; i < globParts.length; i++) {
333
+ for (let j = 0; j < globParts[i].length; j++) {
334
+ if (globParts[i][j] === '**') {
335
+ globParts[i][j] = '*';
336
+ }
337
+ }
338
+ }
339
+ }
340
+ const { optimizationLevel = 1 } = this.options;
341
+ if (optimizationLevel >= 2) {
342
+ // aggressive optimization for the purpose of fs walking
343
+ globParts = this.firstPhasePreProcess(globParts);
344
+ globParts = this.secondPhasePreProcess(globParts);
345
+ }
346
+ else if (optimizationLevel >= 1) {
347
+ // just basic optimizations to remove some .. parts
348
+ globParts = this.levelOneOptimize(globParts);
349
+ }
350
+ else {
351
+ // just collapse multiple ** portions into one
352
+ globParts = this.adjascentGlobstarOptimize(globParts);
353
+ }
354
+ return globParts;
355
+ }
356
+ // just get rid of adjascent ** portions
357
+ adjascentGlobstarOptimize(globParts) {
358
+ return globParts.map(parts => {
359
+ let gs = -1;
360
+ while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
361
+ let i = gs;
362
+ while (parts[i + 1] === '**') {
363
+ i++;
364
+ }
365
+ if (i !== gs) {
366
+ parts.splice(gs, i - gs);
367
+ }
368
+ }
369
+ return parts;
370
+ });
371
+ }
372
+ // get rid of adjascent ** and resolve .. portions
373
+ levelOneOptimize(globParts) {
374
+ return globParts.map(parts => {
375
+ parts = parts.reduce((set, part) => {
376
+ const prev = set[set.length - 1];
377
+ if (part === '**' && prev === '**') {
378
+ return set;
379
+ }
380
+ if (part === '..') {
381
+ if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
382
+ set.pop();
383
+ return set;
384
+ }
385
+ }
386
+ set.push(part);
387
+ return set;
388
+ }, []);
389
+ return parts.length === 0 ? [''] : parts;
390
+ });
391
+ }
392
+ levelTwoFileOptimize(parts) {
393
+ if (!Array.isArray(parts)) {
394
+ parts = this.slashSplit(parts);
395
+ }
396
+ let didSomething = false;
397
+ do {
398
+ didSomething = false;
399
+ // <pre>/<e>/<rest> -> <pre>/<rest>
400
+ if (!this.preserveMultipleSlashes) {
401
+ for (let i = 1; i < parts.length - 1; i++) {
402
+ const p = parts[i];
403
+ // don't squeeze out UNC patterns
404
+ if (i === 1 && p === '' && parts[0] === '')
405
+ continue;
406
+ if (p === '.' || p === '') {
407
+ didSomething = true;
408
+ parts.splice(i, 1);
409
+ i--;
410
+ }
411
+ }
412
+ if (parts[0] === '.' &&
413
+ parts.length === 2 &&
414
+ (parts[1] === '.' || parts[1] === '')) {
415
+ didSomething = true;
416
+ parts.pop();
417
+ }
418
+ }
419
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
420
+ let dd = 0;
421
+ while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
422
+ const p = parts[dd - 1];
423
+ if (p && p !== '.' && p !== '..' && p !== '**') {
424
+ didSomething = true;
425
+ parts.splice(dd - 1, 2);
426
+ dd -= 2;
427
+ }
428
+ }
429
+ } while (didSomething);
430
+ return parts.length === 0 ? [''] : parts;
431
+ }
432
+ // First phase: single-pattern processing
433
+ // <pre> is 1 or more portions
434
+ // <rest> is 1 or more portions
435
+ // <p> is any portion other than ., .., '', or **
436
+ // <e> is . or ''
437
+ //
438
+ // **/.. is *brutal* for filesystem walking performance, because
439
+ // it effectively resets the recursive walk each time it occurs,
440
+ // and ** cannot be reduced out by a .. pattern part like a regexp
441
+ // or most strings (other than .., ., and '') can be.
442
+ //
443
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
444
+ // <pre>/<e>/<rest> -> <pre>/<rest>
445
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
446
+ // **/**/<rest> -> **/<rest>
447
+ //
448
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
449
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
450
+ firstPhasePreProcess(globParts) {
451
+ let didSomething = false;
452
+ do {
453
+ didSomething = false;
454
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
455
+ for (let parts of globParts) {
456
+ let gs = -1;
457
+ while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
458
+ let gss = gs;
459
+ while (parts[gss + 1] === '**') {
460
+ // <pre>/**/**/<rest> -> <pre>/**/<rest>
461
+ gss++;
462
+ }
463
+ // eg, if gs is 2 and gss is 4, that means we have 3 **
464
+ // parts, and can remove 2 of them.
465
+ if (gss > gs) {
466
+ parts.splice(gs + 1, gss - gs);
467
+ }
468
+ let next = parts[gs + 1];
469
+ const p = parts[gs + 2];
470
+ const p2 = parts[gs + 3];
471
+ if (next !== '..')
472
+ continue;
473
+ if (!p ||
474
+ p === '.' ||
475
+ p === '..' ||
476
+ !p2 ||
477
+ p2 === '.' ||
478
+ p2 === '..') {
479
+ continue;
480
+ }
481
+ didSomething = true;
482
+ // edit parts in place, and push the new one
483
+ parts.splice(gs, 1);
484
+ const other = parts.slice(0);
485
+ other[gs] = '**';
486
+ globParts.push(other);
487
+ gs--;
488
+ }
489
+ // <pre>/<e>/<rest> -> <pre>/<rest>
490
+ if (!this.preserveMultipleSlashes) {
491
+ for (let i = 1; i < parts.length - 1; i++) {
492
+ const p = parts[i];
493
+ // don't squeeze out UNC patterns
494
+ if (i === 1 && p === '' && parts[0] === '')
495
+ continue;
496
+ if (p === '.' || p === '') {
497
+ didSomething = true;
498
+ parts.splice(i, 1);
499
+ i--;
500
+ }
501
+ }
502
+ if (parts[0] === '.' &&
503
+ parts.length === 2 &&
504
+ (parts[1] === '.' || parts[1] === '')) {
505
+ didSomething = true;
506
+ parts.pop();
507
+ }
508
+ }
509
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
510
+ let dd = 0;
511
+ while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
512
+ const p = parts[dd - 1];
513
+ if (p && p !== '.' && p !== '..' && p !== '**') {
514
+ didSomething = true;
515
+ const needDot = dd === 1 && parts[dd + 1] === '**';
516
+ const splin = needDot ? ['.'] : [];
517
+ parts.splice(dd - 1, 2, ...splin);
518
+ if (parts.length === 0)
519
+ parts.push('');
520
+ dd -= 2;
521
+ }
522
+ }
523
+ }
524
+ } while (didSomething);
525
+ return globParts;
526
+ }
527
+ // second phase: multi-pattern dedupes
528
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
529
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
530
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
531
+ //
532
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
533
+ // ^-- not valid because ** doens't follow symlinks
534
+ secondPhasePreProcess(globParts) {
535
+ for (let i = 0; i < globParts.length - 1; i++) {
536
+ for (let j = i + 1; j < globParts.length; j++) {
537
+ const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
538
+ if (matched) {
539
+ globParts[i] = [];
540
+ globParts[j] = matched;
541
+ break;
542
+ }
543
+ }
544
+ }
545
+ return globParts.filter(gs => gs.length);
546
+ }
547
+ partsMatch(a, b, emptyGSMatch = false) {
548
+ let ai = 0;
549
+ let bi = 0;
550
+ let result = [];
551
+ let which = '';
552
+ while (ai < a.length && bi < b.length) {
553
+ if (a[ai] === b[bi]) {
554
+ result.push(which === 'b' ? b[bi] : a[ai]);
555
+ ai++;
556
+ bi++;
557
+ }
558
+ else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
559
+ result.push(a[ai]);
560
+ ai++;
561
+ }
562
+ else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
563
+ result.push(b[bi]);
564
+ bi++;
565
+ }
566
+ else if (a[ai] === '*' &&
567
+ b[bi] &&
568
+ (this.options.dot || !b[bi].startsWith('.')) &&
569
+ b[bi] !== '**') {
570
+ if (which === 'b')
571
+ return false;
572
+ which = 'a';
573
+ result.push(a[ai]);
574
+ ai++;
575
+ bi++;
576
+ }
577
+ else if (b[bi] === '*' &&
578
+ a[ai] &&
579
+ (this.options.dot || !a[ai].startsWith('.')) &&
580
+ a[ai] !== '**') {
581
+ if (which === 'a')
582
+ return false;
583
+ which = 'b';
584
+ result.push(b[bi]);
585
+ ai++;
586
+ bi++;
587
+ }
588
+ else {
589
+ return false;
590
+ }
591
+ }
592
+ // if we fall out of the loop, it means they two are identical
593
+ // as long as their lengths match
594
+ return a.length === b.length && result;
595
+ }
596
+ parseNegate() {
597
+ if (this.nonegate)
598
+ return;
599
+ const pattern = this.pattern;
600
+ let negate = false;
601
+ let negateOffset = 0;
602
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
603
+ negate = !negate;
604
+ negateOffset++;
605
+ }
606
+ if (negateOffset)
607
+ this.pattern = pattern.slice(negateOffset);
608
+ this.negate = negate;
609
+ }
610
+ // set partial to true to test if, for example,
611
+ // "/a/b" matches the start of "/*/b/*/d"
612
+ // Partial means, if you run out of file before you run
613
+ // out of pattern, then that's fine, as long as all
614
+ // the parts match.
615
+ matchOne(file, pattern, partial = false) {
616
+ let fileStartIndex = 0;
617
+ let patternStartIndex = 0;
618
+ // UNC paths like //?/X:/... can match X:/... and vice versa
619
+ // Drive letters in absolute drive or unc paths are always compared
620
+ // case-insensitively.
621
+ if (this.isWindows) {
622
+ const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
623
+ const fileUNC = !fileDrive &&
624
+ file[0] === '' &&
625
+ file[1] === '' &&
626
+ file[2] === '?' &&
627
+ /^[a-z]:$/i.test(file[3]);
628
+ const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
629
+ const patternUNC = !patternDrive &&
630
+ pattern[0] === '' &&
631
+ pattern[1] === '' &&
632
+ pattern[2] === '?' &&
633
+ typeof pattern[3] === 'string' &&
634
+ /^[a-z]:$/i.test(pattern[3]);
635
+ const fdi = fileUNC ? 3
636
+ : fileDrive ? 0
637
+ : undefined;
638
+ const pdi = patternUNC ? 3
639
+ : patternDrive ? 0
640
+ : undefined;
641
+ if (typeof fdi === 'number' && typeof pdi === 'number') {
642
+ const [fd, pd] = [
643
+ file[fdi],
644
+ pattern[pdi],
645
+ ];
646
+ // start matching at the drive letter index of each
647
+ if (fd.toLowerCase() === pd.toLowerCase()) {
648
+ pattern[pdi] = fd;
649
+ patternStartIndex = pdi;
650
+ fileStartIndex = fdi;
651
+ }
652
+ }
653
+ }
654
+ // resolve and reduce . and .. portions in the file as well.
655
+ // don't need to do the second phase, because it's only one string[]
656
+ const { optimizationLevel = 1 } = this.options;
657
+ if (optimizationLevel >= 2) {
658
+ file = this.levelTwoFileOptimize(file);
659
+ }
660
+ if (pattern.includes(exports.GLOBSTAR)) {
661
+ return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
662
+ }
663
+ return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
664
+ }
665
+ #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
666
+ // split the pattern into head, tail, and middle of ** delimited parts
667
+ const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
668
+ const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
669
+ // split the pattern up into globstar-delimited sections
670
+ // the tail has to be at the end, and the others just have
671
+ // to be found in order from the head.
672
+ const [head, body, tail] = partial ? [
673
+ pattern.slice(patternIndex, firstgs),
674
+ pattern.slice(firstgs + 1),
675
+ [],
676
+ ] : [
677
+ pattern.slice(patternIndex, firstgs),
678
+ pattern.slice(firstgs + 1, lastgs),
679
+ pattern.slice(lastgs + 1),
680
+ ];
681
+ // check the head, from the current file/pattern index.
682
+ if (head.length) {
683
+ const fileHead = file.slice(fileIndex, fileIndex + head.length);
684
+ if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
685
+ return false;
686
+ }
687
+ fileIndex += head.length;
688
+ patternIndex += head.length;
689
+ }
690
+ // now we know the head matches!
691
+ // if the last portion is not empty, it MUST match the end
692
+ // check the tail
693
+ let fileTailMatch = 0;
694
+ if (tail.length) {
695
+ // if head + tail > file, then we cannot possibly match
696
+ if (tail.length + fileIndex > file.length)
697
+ return false;
698
+ // try to match the tail
699
+ let tailStart = file.length - tail.length;
700
+ if (this.#matchOne(file, tail, partial, tailStart, 0)) {
701
+ fileTailMatch = tail.length;
702
+ }
703
+ else {
704
+ // affordance for stuff like a/**/* matching a/b/
705
+ // if the last file portion is '', and there's more to the pattern
706
+ // then try without the '' bit.
707
+ if (file[file.length - 1] !== '' ||
708
+ fileIndex + tail.length === file.length) {
709
+ return false;
710
+ }
711
+ tailStart--;
712
+ if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
713
+ return false;
714
+ }
715
+ fileTailMatch = tail.length + 1;
716
+ }
717
+ }
718
+ // now we know the tail matches!
719
+ // the middle is zero or more portions wrapped in **, possibly
720
+ // containing more ** sections.
721
+ // so a/**/b/**/c/**/d has become **/b/**/c/**
722
+ // if it's empty, it means a/**/b, just verify we have no bad dots
723
+ // if there's no tail, so it ends on /**, then we must have *something*
724
+ // after the head, or it's not a matc
725
+ if (!body.length) {
726
+ let sawSome = !!fileTailMatch;
727
+ for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
728
+ const f = String(file[i]);
729
+ sawSome = true;
730
+ if (f === '.' ||
731
+ f === '..' ||
732
+ (!this.options.dot && f.startsWith('.'))) {
733
+ return false;
734
+ }
735
+ }
736
+ // in partial mode, we just need to get past all file parts
737
+ return partial || sawSome;
738
+ }
739
+ // now we know that there's one or more body sections, which can
740
+ // be matched anywhere from the 0 index (because the head was pruned)
741
+ // through to the length-fileTailMatch index.
742
+ // split the body up into sections, and note the minimum index it can
743
+ // be found at (start with the length of all previous segments)
744
+ // [section, before, after]
745
+ const bodySegments = [[[], 0]];
746
+ let currentBody = bodySegments[0];
747
+ let nonGsParts = 0;
748
+ const nonGsPartsSums = [0];
749
+ for (const b of body) {
750
+ if (b === exports.GLOBSTAR) {
751
+ nonGsPartsSums.push(nonGsParts);
752
+ currentBody = [[], 0];
753
+ bodySegments.push(currentBody);
754
+ }
755
+ else {
756
+ currentBody[0].push(b);
757
+ nonGsParts++;
758
+ }
759
+ }
760
+ let i = bodySegments.length - 1;
761
+ const fileLength = file.length - fileTailMatch;
762
+ for (const b of bodySegments) {
763
+ b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
764
+ }
765
+ return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
766
+ }
767
+ // return false for "nope, not matching"
768
+ // return null for "not matching, cannot keep trying"
769
+ #matchGlobStarBodySections(file,
770
+ // pattern section, last possible position for it
771
+ bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
772
+ // take the first body segment, and walk from fileIndex to its "after"
773
+ // value at the end
774
+ // If it doesn't match at that position, we increment, until we hit
775
+ // that final possible position, and give up.
776
+ // If it does match, then advance and try to rest.
777
+ // If any of them fail we keep walking forward.
778
+ // this is still a bit recursively painful, but it's more constrained
779
+ // than previous implementations, because we never test something that
780
+ // can't possibly be a valid matching condition.
781
+ const bs = bodySegments[bodyIndex];
782
+ if (!bs) {
783
+ // just make sure that there's no bad dots
784
+ for (let i = fileIndex; i < file.length; i++) {
785
+ sawTail = true;
786
+ const f = file[i];
787
+ if (f === '.' ||
788
+ f === '..' ||
789
+ (!this.options.dot && f.startsWith('.'))) {
790
+ return false;
791
+ }
792
+ }
793
+ return sawTail;
794
+ }
795
+ // have a non-globstar body section to test
796
+ const [body, after] = bs;
797
+ while (fileIndex <= after) {
798
+ const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
799
+ // if limit exceeded, no match. intentional false negative,
800
+ // acceptable break in correctness for security.
801
+ if (m && globStarDepth < this.maxGlobstarRecursion) {
802
+ // match! see if the rest match. if so, we're done!
803
+ const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
804
+ if (sub !== false) {
805
+ return sub;
806
+ }
807
+ }
808
+ const f = file[fileIndex];
809
+ if (f === '.' ||
810
+ f === '..' ||
811
+ (!this.options.dot && f.startsWith('.'))) {
812
+ return false;
813
+ }
814
+ fileIndex++;
815
+ }
816
+ // walked off. no point continuing
817
+ return partial || null;
818
+ }
819
+ #matchOne(file, pattern, partial, fileIndex, patternIndex) {
820
+ let fi;
821
+ let pi;
822
+ let pl;
823
+ let fl;
824
+ for (fi = fileIndex,
825
+ pi = patternIndex,
826
+ fl = file.length,
827
+ pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
828
+ this.debug('matchOne loop');
829
+ let p = pattern[pi];
830
+ let f = file[fi];
831
+ this.debug(pattern, p, f);
832
+ // should be impossible.
833
+ // some invalid regexp stuff in the set.
834
+ /* c8 ignore start */
835
+ if (p === false || p === exports.GLOBSTAR) {
836
+ return false;
837
+ }
838
+ /* c8 ignore stop */
839
+ // something other than **
840
+ // non-magic patterns just have to match exactly
841
+ // patterns with magic have been turned into regexps.
842
+ let hit;
843
+ if (typeof p === 'string') {
844
+ hit = f === p;
845
+ this.debug('string match', p, f, hit);
846
+ }
847
+ else {
848
+ hit = p.test(f);
849
+ this.debug('pattern match', p, f, hit);
850
+ }
851
+ if (!hit)
852
+ return false;
853
+ }
854
+ // Note: ending in / means that we'll get a final ""
855
+ // at the end of the pattern. This can only match a
856
+ // corresponding "" at the end of the file.
857
+ // If the file ends in /, then it can only match a
858
+ // a pattern that ends in /, unless the pattern just
859
+ // doesn't have any more for it. But, a/b/ should *not*
860
+ // match "a/b/*", even though "" matches against the
861
+ // [^/]*? pattern, except in partial mode, where it might
862
+ // simply not be reached yet.
863
+ // However, a/b/ should still satisfy a/*
864
+ // now either we fell off the end of the pattern, or we're done.
865
+ if (fi === fl && pi === pl) {
866
+ // ran out of pattern and filename at the same time.
867
+ // an exact hit!
868
+ return true;
869
+ }
870
+ else if (fi === fl) {
871
+ // ran out of file, but still had pattern left.
872
+ // this is ok if we're doing the match as part of
873
+ // a glob fs traversal.
874
+ return partial;
875
+ }
876
+ else if (pi === pl) {
877
+ // ran out of pattern, still have file left.
878
+ // this is only acceptable if we're on the very last
879
+ // empty segment of a file with a trailing slash.
880
+ // a/* should match a/b/
881
+ return fi === fl - 1 && file[fi] === '';
882
+ /* c8 ignore start */
883
+ }
884
+ else {
885
+ // should be unreachable.
886
+ throw new Error('wtf?');
887
+ }
888
+ /* c8 ignore stop */
889
+ }
890
+ braceExpand() {
891
+ return (0, exports.braceExpand)(this.pattern, this.options);
892
+ }
893
+ parse(pattern) {
894
+ (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
895
+ const options = this.options;
896
+ // shortcuts
897
+ if (pattern === '**')
898
+ return exports.GLOBSTAR;
899
+ if (pattern === '')
900
+ return '';
901
+ // far and away, the most common glob pattern parts are
902
+ // *, *.*, and *.<ext> Add a fast check method for those.
903
+ let m;
904
+ let fastTest = null;
905
+ if ((m = pattern.match(starRE))) {
906
+ fastTest = options.dot ? starTestDot : starTest;
907
+ }
908
+ else if ((m = pattern.match(starDotExtRE))) {
909
+ fastTest = (options.nocase ?
910
+ options.dot ?
911
+ starDotExtTestNocaseDot
912
+ : starDotExtTestNocase
913
+ : options.dot ? starDotExtTestDot
914
+ : starDotExtTest)(m[1]);
915
+ }
916
+ else if ((m = pattern.match(qmarksRE))) {
917
+ fastTest = (options.nocase ?
918
+ options.dot ?
919
+ qmarksTestNocaseDot
920
+ : qmarksTestNocase
921
+ : options.dot ? qmarksTestDot
922
+ : qmarksTest)(m);
923
+ }
924
+ else if ((m = pattern.match(starDotStarRE))) {
925
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
926
+ }
927
+ else if ((m = pattern.match(dotStarRE))) {
928
+ fastTest = dotStarTest;
929
+ }
930
+ const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
931
+ if (fastTest && typeof re === 'object') {
932
+ // Avoids overriding in frozen environments
933
+ Reflect.defineProperty(re, 'test', { value: fastTest });
934
+ }
935
+ return re;
936
+ }
937
+ makeRe() {
938
+ if (this.regexp || this.regexp === false)
939
+ return this.regexp;
940
+ // at this point, this.set is a 2d array of partial
941
+ // pattern strings, or "**".
942
+ //
943
+ // It's better to use .match(). This function shouldn't
944
+ // be used, really, but it's pretty convenient sometimes,
945
+ // when you just want to work with a regex.
946
+ const set = this.set;
947
+ if (!set.length) {
948
+ this.regexp = false;
949
+ return this.regexp;
950
+ }
951
+ const options = this.options;
952
+ const twoStar = options.noglobstar ? star
953
+ : options.dot ? twoStarDot
954
+ : twoStarNoDot;
955
+ const flags = new Set(options.nocase ? ['i'] : []);
956
+ // regexpify non-globstar patterns
957
+ // if ** is only item, then we just do one twoStar
958
+ // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
959
+ // if ** is last, append (\/twoStar|) to previous
960
+ // if ** is in the middle, append (\/|\/twoStar\/) to previous
961
+ // then filter out GLOBSTAR symbols
962
+ let re = set
963
+ .map(pattern => {
964
+ const pp = pattern.map(p => {
965
+ if (p instanceof RegExp) {
966
+ for (const f of p.flags.split(''))
967
+ flags.add(f);
968
+ }
969
+ return (typeof p === 'string' ? regExpEscape(p)
970
+ : p === exports.GLOBSTAR ? exports.GLOBSTAR
971
+ : p._src);
972
+ });
973
+ pp.forEach((p, i) => {
974
+ const next = pp[i + 1];
975
+ const prev = pp[i - 1];
976
+ if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
977
+ return;
978
+ }
979
+ if (prev === undefined) {
980
+ if (next !== undefined && next !== exports.GLOBSTAR) {
981
+ pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
982
+ }
983
+ else {
984
+ pp[i] = twoStar;
985
+ }
986
+ }
987
+ else if (next === undefined) {
988
+ pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
989
+ }
990
+ else if (next !== exports.GLOBSTAR) {
991
+ pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
992
+ pp[i + 1] = exports.GLOBSTAR;
993
+ }
994
+ });
995
+ const filtered = pp.filter(p => p !== exports.GLOBSTAR);
996
+ // For partial matches, we need to make the pattern match
997
+ // any prefix of the full path. We do this by generating
998
+ // alternative patterns that match progressively longer prefixes.
999
+ if (this.partial && filtered.length >= 1) {
1000
+ const prefixes = [];
1001
+ for (let i = 1; i <= filtered.length; i++) {
1002
+ prefixes.push(filtered.slice(0, i).join('/'));
1003
+ }
1004
+ return '(?:' + prefixes.join('|') + ')';
1005
+ }
1006
+ return filtered.join('/');
1007
+ })
1008
+ .join('|');
1009
+ // need to wrap in parens if we had more than one thing with |,
1010
+ // otherwise only the first will be anchored to ^ and the last to $
1011
+ const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
1012
+ // must match entire pattern
1013
+ // ending in a * or ** will make it less strict.
1014
+ re = '^' + open + re + close + '$';
1015
+ // In partial mode, '/' should always match as it's a valid prefix for any pattern
1016
+ if (this.partial) {
1017
+ re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
1018
+ }
1019
+ // can match anything, as long as it's not this.
1020
+ if (this.negate)
1021
+ re = '^(?!' + re + ').+$';
1022
+ try {
1023
+ this.regexp = new RegExp(re, [...flags].join(''));
1024
+ /* c8 ignore start */
1025
+ }
1026
+ catch (ex) {
1027
+ // should be impossible
1028
+ this.regexp = false;
1029
+ }
1030
+ /* c8 ignore stop */
1031
+ return this.regexp;
1032
+ }
1033
+ slashSplit(p) {
1034
+ // if p starts with // on windows, we preserve that
1035
+ // so that UNC paths aren't broken. Otherwise, any number of
1036
+ // / characters are coalesced into one, unless
1037
+ // preserveMultipleSlashes is set to true.
1038
+ if (this.preserveMultipleSlashes) {
1039
+ return p.split('/');
1040
+ }
1041
+ else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
1042
+ // add an extra '' for the one we lose
1043
+ return ['', ...p.split(/\/+/)];
1044
+ }
1045
+ else {
1046
+ return p.split(/\/+/);
1047
+ }
1048
+ }
1049
+ match(f, partial = this.partial) {
1050
+ this.debug('match', f, this.pattern);
1051
+ // short-circuit in the case of busted things.
1052
+ // comments, etc.
1053
+ if (this.comment) {
1054
+ return false;
1055
+ }
1056
+ if (this.empty) {
1057
+ return f === '';
1058
+ }
1059
+ if (f === '/' && partial) {
1060
+ return true;
1061
+ }
1062
+ const options = this.options;
1063
+ // windows: need to use /, not \
1064
+ if (this.isWindows) {
1065
+ f = f.split('\\').join('/');
1066
+ }
1067
+ // treat the test path as a set of pathparts.
1068
+ const ff = this.slashSplit(f);
1069
+ this.debug(this.pattern, 'split', ff);
1070
+ // just ONE of the pattern sets in this.set needs to match
1071
+ // in order for it to be valid. If negating, then just one
1072
+ // match means that we have failed.
1073
+ // Either way, return on the first hit.
1074
+ const set = this.set;
1075
+ this.debug(this.pattern, 'set', set);
1076
+ // Find the basename of the path by looking for the last non-empty segment
1077
+ let filename = ff[ff.length - 1];
1078
+ if (!filename) {
1079
+ for (let i = ff.length - 2; !filename && i >= 0; i--) {
1080
+ filename = ff[i];
1081
+ }
1082
+ }
1083
+ for (let i = 0; i < set.length; i++) {
1084
+ const pattern = set[i];
1085
+ let file = ff;
1086
+ if (options.matchBase && pattern.length === 1) {
1087
+ file = [filename];
1088
+ }
1089
+ const hit = this.matchOne(file, pattern, partial);
1090
+ if (hit) {
1091
+ if (options.flipNegate) {
1092
+ return true;
1093
+ }
1094
+ return !this.negate;
1095
+ }
1096
+ }
1097
+ // didn't get any hits. this is success if it's a negative
1098
+ // pattern, failure otherwise.
1099
+ if (options.flipNegate) {
1100
+ return false;
1101
+ }
1102
+ return this.negate;
1103
+ }
1104
+ static defaults(def) {
1105
+ return exports.minimatch.defaults(def).Minimatch;
1106
+ }
1107
+ }
1108
+ exports.Minimatch = Minimatch;
1109
+ /* c8 ignore start */
1110
+ var ast_js_2 = require("./ast.js");
1111
+ Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
1112
+ var escape_js_2 = require("./escape.js");
1113
+ Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
1114
+ var unescape_js_2 = require("./unescape.js");
1115
+ Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
1116
+ /* c8 ignore stop */
1117
+ exports.minimatch.AST = ast_js_1.AST;
1118
+ exports.minimatch.Minimatch = Minimatch;
1119
+ exports.minimatch.escape = escape_js_1.escape;
1120
+ exports.minimatch.unescape = unescape_js_1.unescape;
1121
+ //# sourceMappingURL=index.js.map