korext 0.8.0 → 0.8.2

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 (521) hide show
  1. package/package.json +3 -14
  2. package/CHANGELOG.md +0 -72
  3. package/dummy.pdf +0 -0
  4. package/korext.json +0 -11
  5. package/node_modules/ansi-regex/index.d.ts +0 -37
  6. package/node_modules/ansi-regex/index.js +0 -10
  7. package/node_modules/ansi-regex/license +0 -9
  8. package/node_modules/ansi-regex/package.json +0 -55
  9. package/node_modules/ansi-regex/readme.md +0 -78
  10. package/node_modules/ansi-styles/index.d.ts +0 -345
  11. package/node_modules/ansi-styles/index.js +0 -163
  12. package/node_modules/ansi-styles/license +0 -9
  13. package/node_modules/ansi-styles/package.json +0 -56
  14. package/node_modules/ansi-styles/readme.md +0 -152
  15. package/node_modules/balanced-match/LICENSE.md +0 -23
  16. package/node_modules/balanced-match/README.md +0 -57
  17. package/node_modules/balanced-match/dist/commonjs/index.d.ts +0 -9
  18. package/node_modules/balanced-match/dist/commonjs/index.d.ts.map +0 -1
  19. package/node_modules/balanced-match/dist/commonjs/index.js +0 -59
  20. package/node_modules/balanced-match/dist/commonjs/index.js.map +0 -1
  21. package/node_modules/balanced-match/dist/commonjs/package.json +0 -3
  22. package/node_modules/balanced-match/dist/esm/index.d.ts +0 -9
  23. package/node_modules/balanced-match/dist/esm/index.d.ts.map +0 -1
  24. package/node_modules/balanced-match/dist/esm/index.js +0 -54
  25. package/node_modules/balanced-match/dist/esm/index.js.map +0 -1
  26. package/node_modules/balanced-match/dist/esm/package.json +0 -3
  27. package/node_modules/balanced-match/package.json +0 -68
  28. package/node_modules/base64-js/LICENSE +0 -21
  29. package/node_modules/base64-js/README.md +0 -34
  30. package/node_modules/base64-js/base64js.min.js +0 -1
  31. package/node_modules/base64-js/index.d.ts +0 -3
  32. package/node_modules/base64-js/index.js +0 -150
  33. package/node_modules/base64-js/package.json +0 -47
  34. package/node_modules/bl/.travis.yml +0 -17
  35. package/node_modules/bl/BufferList.js +0 -396
  36. package/node_modules/bl/LICENSE.md +0 -13
  37. package/node_modules/bl/README.md +0 -247
  38. package/node_modules/bl/bl.js +0 -84
  39. package/node_modules/bl/package.json +0 -37
  40. package/node_modules/bl/test/convert.js +0 -21
  41. package/node_modules/bl/test/indexOf.js +0 -492
  42. package/node_modules/bl/test/isBufferList.js +0 -32
  43. package/node_modules/bl/test/test.js +0 -869
  44. package/node_modules/brace-expansion/LICENSE +0 -23
  45. package/node_modules/brace-expansion/README.md +0 -94
  46. package/node_modules/brace-expansion/dist/commonjs/index.d.ts +0 -6
  47. package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +0 -1
  48. package/node_modules/brace-expansion/dist/commonjs/index.js +0 -199
  49. package/node_modules/brace-expansion/dist/commonjs/index.js.map +0 -1
  50. package/node_modules/brace-expansion/dist/commonjs/package.json +0 -3
  51. package/node_modules/brace-expansion/dist/esm/index.d.ts +0 -6
  52. package/node_modules/brace-expansion/dist/esm/index.d.ts.map +0 -1
  53. package/node_modules/brace-expansion/dist/esm/index.js +0 -195
  54. package/node_modules/brace-expansion/dist/esm/index.js.map +0 -1
  55. package/node_modules/brace-expansion/dist/esm/package.json +0 -3
  56. package/node_modules/brace-expansion/package.json +0 -64
  57. package/node_modules/buffer/AUTHORS.md +0 -70
  58. package/node_modules/buffer/LICENSE +0 -21
  59. package/node_modules/buffer/README.md +0 -410
  60. package/node_modules/buffer/index.d.ts +0 -186
  61. package/node_modules/buffer/index.js +0 -1817
  62. package/node_modules/buffer/package.json +0 -96
  63. package/node_modules/chalk/index.d.ts +0 -415
  64. package/node_modules/chalk/license +0 -9
  65. package/node_modules/chalk/package.json +0 -68
  66. package/node_modules/chalk/readme.md +0 -341
  67. package/node_modules/chalk/source/index.js +0 -229
  68. package/node_modules/chalk/source/templates.js +0 -134
  69. package/node_modules/chalk/source/util.js +0 -39
  70. package/node_modules/cli-cursor/index.d.ts +0 -45
  71. package/node_modules/cli-cursor/index.js +0 -35
  72. package/node_modules/cli-cursor/license +0 -9
  73. package/node_modules/cli-cursor/package.json +0 -46
  74. package/node_modules/cli-cursor/readme.md +0 -55
  75. package/node_modules/cli-spinners/index.d.ts +0 -128
  76. package/node_modules/cli-spinners/index.js +0 -15
  77. package/node_modules/cli-spinners/license +0 -9
  78. package/node_modules/cli-spinners/package.json +0 -50
  79. package/node_modules/cli-spinners/readme.md +0 -54
  80. package/node_modules/cli-spinners/spinners.json +0 -1622
  81. package/node_modules/clone/.npmignore +0 -4
  82. package/node_modules/clone/LICENSE +0 -18
  83. package/node_modules/clone/README.md +0 -126
  84. package/node_modules/clone/clone.iml +0 -10
  85. package/node_modules/clone/clone.js +0 -166
  86. package/node_modules/clone/package.json +0 -51
  87. package/node_modules/color-convert/CHANGELOG.md +0 -54
  88. package/node_modules/color-convert/LICENSE +0 -21
  89. package/node_modules/color-convert/README.md +0 -68
  90. package/node_modules/color-convert/conversions.js +0 -839
  91. package/node_modules/color-convert/index.js +0 -81
  92. package/node_modules/color-convert/package.json +0 -48
  93. package/node_modules/color-convert/route.js +0 -97
  94. package/node_modules/color-name/LICENSE +0 -8
  95. package/node_modules/color-name/README.md +0 -11
  96. package/node_modules/color-name/index.js +0 -152
  97. package/node_modules/color-name/package.json +0 -28
  98. package/node_modules/commander/LICENSE +0 -22
  99. package/node_modules/commander/Readme.md +0 -1176
  100. package/node_modules/commander/esm.mjs +0 -16
  101. package/node_modules/commander/index.js +0 -24
  102. package/node_modules/commander/lib/argument.js +0 -150
  103. package/node_modules/commander/lib/command.js +0 -2777
  104. package/node_modules/commander/lib/error.js +0 -39
  105. package/node_modules/commander/lib/help.js +0 -747
  106. package/node_modules/commander/lib/option.js +0 -380
  107. package/node_modules/commander/lib/suggestSimilar.js +0 -101
  108. package/node_modules/commander/package-support.json +0 -19
  109. package/node_modules/commander/package.json +0 -82
  110. package/node_modules/commander/typings/esm.d.mts +0 -3
  111. package/node_modules/commander/typings/index.d.ts +0 -1113
  112. package/node_modules/data-uri-to-buffer/README.md +0 -88
  113. package/node_modules/data-uri-to-buffer/dist/index.d.ts +0 -15
  114. package/node_modules/data-uri-to-buffer/dist/index.js +0 -53
  115. package/node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
  116. package/node_modules/data-uri-to-buffer/package.json +0 -62
  117. package/node_modules/data-uri-to-buffer/src/index.ts +0 -68
  118. package/node_modules/defaults/LICENSE +0 -22
  119. package/node_modules/defaults/README.md +0 -39
  120. package/node_modules/defaults/index.js +0 -13
  121. package/node_modules/defaults/package.json +0 -33
  122. package/node_modules/defaults/test.js +0 -34
  123. package/node_modules/fetch-blob/LICENSE +0 -21
  124. package/node_modules/fetch-blob/README.md +0 -106
  125. package/node_modules/fetch-blob/file.d.ts +0 -2
  126. package/node_modules/fetch-blob/file.js +0 -49
  127. package/node_modules/fetch-blob/from.d.ts +0 -26
  128. package/node_modules/fetch-blob/from.js +0 -100
  129. package/node_modules/fetch-blob/index.d.ts +0 -3
  130. package/node_modules/fetch-blob/index.js +0 -250
  131. package/node_modules/fetch-blob/package.json +0 -56
  132. package/node_modules/fetch-blob/streams.cjs +0 -51
  133. package/node_modules/formdata-polyfill/FormData.js +0 -441
  134. package/node_modules/formdata-polyfill/LICENSE +0 -21
  135. package/node_modules/formdata-polyfill/README.md +0 -145
  136. package/node_modules/formdata-polyfill/esm.min.d.ts +0 -5
  137. package/node_modules/formdata-polyfill/esm.min.js +0 -40
  138. package/node_modules/formdata-polyfill/formdata-to-blob.js +0 -39
  139. package/node_modules/formdata-polyfill/formdata.min.js +0 -21
  140. package/node_modules/formdata-polyfill/package.json +0 -50
  141. package/node_modules/glob/LICENSE.md +0 -63
  142. package/node_modules/glob/README.md +0 -1203
  143. package/node_modules/glob/dist/commonjs/glob.d.ts +0 -396
  144. package/node_modules/glob/dist/commonjs/glob.d.ts.map +0 -1
  145. package/node_modules/glob/dist/commonjs/glob.js +0 -248
  146. package/node_modules/glob/dist/commonjs/glob.js.map +0 -1
  147. package/node_modules/glob/dist/commonjs/has-magic.d.ts +0 -14
  148. package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +0 -1
  149. package/node_modules/glob/dist/commonjs/has-magic.js +0 -27
  150. package/node_modules/glob/dist/commonjs/has-magic.js.map +0 -1
  151. package/node_modules/glob/dist/commonjs/ignore.d.ts +0 -24
  152. package/node_modules/glob/dist/commonjs/ignore.d.ts.map +0 -1
  153. package/node_modules/glob/dist/commonjs/ignore.js +0 -119
  154. package/node_modules/glob/dist/commonjs/ignore.js.map +0 -1
  155. package/node_modules/glob/dist/commonjs/index.d.ts +0 -97
  156. package/node_modules/glob/dist/commonjs/index.d.ts.map +0 -1
  157. package/node_modules/glob/dist/commonjs/index.js +0 -68
  158. package/node_modules/glob/dist/commonjs/index.js.map +0 -1
  159. package/node_modules/glob/dist/commonjs/index.min.js +0 -4
  160. package/node_modules/glob/dist/commonjs/index.min.js.map +0 -7
  161. package/node_modules/glob/dist/commonjs/package.json +0 -3
  162. package/node_modules/glob/dist/commonjs/pattern.d.ts +0 -79
  163. package/node_modules/glob/dist/commonjs/pattern.d.ts.map +0 -1
  164. package/node_modules/glob/dist/commonjs/pattern.js +0 -223
  165. package/node_modules/glob/dist/commonjs/pattern.js.map +0 -1
  166. package/node_modules/glob/dist/commonjs/processor.d.ts +0 -59
  167. package/node_modules/glob/dist/commonjs/processor.d.ts.map +0 -1
  168. package/node_modules/glob/dist/commonjs/processor.js +0 -301
  169. package/node_modules/glob/dist/commonjs/processor.js.map +0 -1
  170. package/node_modules/glob/dist/commonjs/walker.d.ts +0 -97
  171. package/node_modules/glob/dist/commonjs/walker.d.ts.map +0 -1
  172. package/node_modules/glob/dist/commonjs/walker.js +0 -387
  173. package/node_modules/glob/dist/commonjs/walker.js.map +0 -1
  174. package/node_modules/glob/dist/esm/glob.d.ts +0 -396
  175. package/node_modules/glob/dist/esm/glob.d.ts.map +0 -1
  176. package/node_modules/glob/dist/esm/glob.js +0 -244
  177. package/node_modules/glob/dist/esm/glob.js.map +0 -1
  178. package/node_modules/glob/dist/esm/has-magic.d.ts +0 -14
  179. package/node_modules/glob/dist/esm/has-magic.d.ts.map +0 -1
  180. package/node_modules/glob/dist/esm/has-magic.js +0 -23
  181. package/node_modules/glob/dist/esm/has-magic.js.map +0 -1
  182. package/node_modules/glob/dist/esm/ignore.d.ts +0 -24
  183. package/node_modules/glob/dist/esm/ignore.d.ts.map +0 -1
  184. package/node_modules/glob/dist/esm/ignore.js +0 -115
  185. package/node_modules/glob/dist/esm/ignore.js.map +0 -1
  186. package/node_modules/glob/dist/esm/index.d.ts +0 -97
  187. package/node_modules/glob/dist/esm/index.d.ts.map +0 -1
  188. package/node_modules/glob/dist/esm/index.js +0 -55
  189. package/node_modules/glob/dist/esm/index.js.map +0 -1
  190. package/node_modules/glob/dist/esm/index.min.js +0 -4
  191. package/node_modules/glob/dist/esm/index.min.js.map +0 -7
  192. package/node_modules/glob/dist/esm/package.json +0 -3
  193. package/node_modules/glob/dist/esm/pattern.d.ts +0 -79
  194. package/node_modules/glob/dist/esm/pattern.d.ts.map +0 -1
  195. package/node_modules/glob/dist/esm/pattern.js +0 -219
  196. package/node_modules/glob/dist/esm/pattern.js.map +0 -1
  197. package/node_modules/glob/dist/esm/processor.d.ts +0 -59
  198. package/node_modules/glob/dist/esm/processor.d.ts.map +0 -1
  199. package/node_modules/glob/dist/esm/processor.js +0 -294
  200. package/node_modules/glob/dist/esm/processor.js.map +0 -1
  201. package/node_modules/glob/dist/esm/walker.d.ts +0 -97
  202. package/node_modules/glob/dist/esm/walker.d.ts.map +0 -1
  203. package/node_modules/glob/dist/esm/walker.js +0 -381
  204. package/node_modules/glob/dist/esm/walker.js.map +0 -1
  205. package/node_modules/glob/package.json +0 -98
  206. package/node_modules/has-flag/index.d.ts +0 -39
  207. package/node_modules/has-flag/index.js +0 -8
  208. package/node_modules/has-flag/license +0 -9
  209. package/node_modules/has-flag/package.json +0 -46
  210. package/node_modules/has-flag/readme.md +0 -89
  211. package/node_modules/ieee754/LICENSE +0 -11
  212. package/node_modules/ieee754/README.md +0 -51
  213. package/node_modules/ieee754/index.d.ts +0 -10
  214. package/node_modules/ieee754/index.js +0 -85
  215. package/node_modules/ieee754/package.json +0 -52
  216. package/node_modules/inherits/LICENSE +0 -16
  217. package/node_modules/inherits/README.md +0 -42
  218. package/node_modules/inherits/inherits.js +0 -9
  219. package/node_modules/inherits/inherits_browser.js +0 -27
  220. package/node_modules/inherits/package.json +0 -29
  221. package/node_modules/is-interactive/index.d.ts +0 -31
  222. package/node_modules/is-interactive/index.js +0 -9
  223. package/node_modules/is-interactive/license +0 -9
  224. package/node_modules/is-interactive/package.json +0 -38
  225. package/node_modules/is-interactive/readme.md +0 -51
  226. package/node_modules/is-unicode-supported/index.d.ts +0 -14
  227. package/node_modules/is-unicode-supported/index.js +0 -13
  228. package/node_modules/is-unicode-supported/license +0 -9
  229. package/node_modules/is-unicode-supported/package.json +0 -41
  230. package/node_modules/is-unicode-supported/readme.md +0 -35
  231. package/node_modules/log-symbols/browser.js +0 -8
  232. package/node_modules/log-symbols/index.d.ts +0 -25
  233. package/node_modules/log-symbols/index.js +0 -19
  234. package/node_modules/log-symbols/license +0 -9
  235. package/node_modules/log-symbols/package.json +0 -52
  236. package/node_modules/log-symbols/readme.md +0 -51
  237. package/node_modules/lru-cache/LICENSE.md +0 -55
  238. package/node_modules/lru-cache/README.md +0 -383
  239. package/node_modules/lru-cache/dist/commonjs/index.d.ts +0 -1323
  240. package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +0 -1
  241. package/node_modules/lru-cache/dist/commonjs/index.js +0 -1595
  242. package/node_modules/lru-cache/dist/commonjs/index.js.map +0 -1
  243. package/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
  244. package/node_modules/lru-cache/dist/commonjs/index.min.js.map +0 -7
  245. package/node_modules/lru-cache/dist/commonjs/package.json +0 -3
  246. package/node_modules/lru-cache/dist/esm/index.d.ts +0 -1323
  247. package/node_modules/lru-cache/dist/esm/index.d.ts.map +0 -1
  248. package/node_modules/lru-cache/dist/esm/index.js +0 -1591
  249. package/node_modules/lru-cache/dist/esm/index.js.map +0 -1
  250. package/node_modules/lru-cache/dist/esm/index.min.js +0 -2
  251. package/node_modules/lru-cache/dist/esm/index.min.js.map +0 -7
  252. package/node_modules/lru-cache/dist/esm/package.json +0 -3
  253. package/node_modules/lru-cache/package.json +0 -93
  254. package/node_modules/mimic-fn/index.d.ts +0 -54
  255. package/node_modules/mimic-fn/index.js +0 -13
  256. package/node_modules/mimic-fn/license +0 -9
  257. package/node_modules/mimic-fn/package.json +0 -42
  258. package/node_modules/mimic-fn/readme.md +0 -69
  259. package/node_modules/minimatch/LICENSE.md +0 -55
  260. package/node_modules/minimatch/README.md +0 -528
  261. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +0 -2
  262. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +0 -1
  263. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
  264. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +0 -1
  265. package/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
  266. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
  267. package/node_modules/minimatch/dist/commonjs/ast.js +0 -846
  268. package/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
  269. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
  270. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
  271. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
  272. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
  273. package/node_modules/minimatch/dist/commonjs/escape.d.ts +0 -15
  274. package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +0 -1
  275. package/node_modules/minimatch/dist/commonjs/escape.js +0 -30
  276. package/node_modules/minimatch/dist/commonjs/escape.js.map +0 -1
  277. package/node_modules/minimatch/dist/commonjs/index.d.ts +0 -174
  278. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +0 -1
  279. package/node_modules/minimatch/dist/commonjs/index.js +0 -1121
  280. package/node_modules/minimatch/dist/commonjs/index.js.map +0 -1
  281. package/node_modules/minimatch/dist/commonjs/package.json +0 -3
  282. package/node_modules/minimatch/dist/commonjs/unescape.d.ts +0 -22
  283. package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +0 -1
  284. package/node_modules/minimatch/dist/commonjs/unescape.js +0 -38
  285. package/node_modules/minimatch/dist/commonjs/unescape.js.map +0 -1
  286. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +0 -2
  287. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +0 -1
  288. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -10
  289. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +0 -1
  290. package/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
  291. package/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
  292. package/node_modules/minimatch/dist/esm/ast.js +0 -842
  293. package/node_modules/minimatch/dist/esm/ast.js.map +0 -1
  294. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
  295. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
  296. package/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
  297. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
  298. package/node_modules/minimatch/dist/esm/escape.d.ts +0 -15
  299. package/node_modules/minimatch/dist/esm/escape.d.ts.map +0 -1
  300. package/node_modules/minimatch/dist/esm/escape.js +0 -26
  301. package/node_modules/minimatch/dist/esm/escape.js.map +0 -1
  302. package/node_modules/minimatch/dist/esm/index.d.ts +0 -174
  303. package/node_modules/minimatch/dist/esm/index.d.ts.map +0 -1
  304. package/node_modules/minimatch/dist/esm/index.js +0 -1108
  305. package/node_modules/minimatch/dist/esm/index.js.map +0 -1
  306. package/node_modules/minimatch/dist/esm/package.json +0 -3
  307. package/node_modules/minimatch/dist/esm/unescape.d.ts +0 -22
  308. package/node_modules/minimatch/dist/esm/unescape.d.ts.map +0 -1
  309. package/node_modules/minimatch/dist/esm/unescape.js +0 -34
  310. package/node_modules/minimatch/dist/esm/unescape.js.map +0 -1
  311. package/node_modules/minimatch/package.json +0 -67
  312. package/node_modules/minipass/LICENSE.md +0 -55
  313. package/node_modules/minipass/README.md +0 -825
  314. package/node_modules/minipass/dist/commonjs/index.d.ts +0 -545
  315. package/node_modules/minipass/dist/commonjs/index.d.ts.map +0 -1
  316. package/node_modules/minipass/dist/commonjs/index.js +0 -1038
  317. package/node_modules/minipass/dist/commonjs/index.js.map +0 -1
  318. package/node_modules/minipass/dist/commonjs/package.json +0 -3
  319. package/node_modules/minipass/dist/esm/index.d.ts +0 -545
  320. package/node_modules/minipass/dist/esm/index.d.ts.map +0 -1
  321. package/node_modules/minipass/dist/esm/index.js +0 -1020
  322. package/node_modules/minipass/dist/esm/index.js.map +0 -1
  323. package/node_modules/minipass/dist/esm/package.json +0 -3
  324. package/node_modules/minipass/package.json +0 -77
  325. package/node_modules/node-domexception/.history/README_20210527203617.md +0 -2
  326. package/node_modules/node-domexception/.history/README_20210527212714.md +0 -41
  327. package/node_modules/node-domexception/.history/README_20210527213345.md +0 -36
  328. package/node_modules/node-domexception/.history/README_20210527213411.md +0 -36
  329. package/node_modules/node-domexception/.history/README_20210527213803.md +0 -36
  330. package/node_modules/node-domexception/.history/README_20210527214323.md +0 -38
  331. package/node_modules/node-domexception/.history/README_20210527214408.md +0 -38
  332. package/node_modules/node-domexception/.history/index_20210527203842.js +0 -0
  333. package/node_modules/node-domexception/.history/index_20210527203947.js +0 -8
  334. package/node_modules/node-domexception/.history/index_20210527204259.js +0 -9
  335. package/node_modules/node-domexception/.history/index_20210527204418.js +0 -9
  336. package/node_modules/node-domexception/.history/index_20210527204756.js +0 -11
  337. package/node_modules/node-domexception/.history/index_20210527204833.js +0 -11
  338. package/node_modules/node-domexception/.history/index_20210527211208.js +0 -15
  339. package/node_modules/node-domexception/.history/index_20210527211248.js +0 -15
  340. package/node_modules/node-domexception/.history/index_20210527212722.js +0 -23
  341. package/node_modules/node-domexception/.history/index_20210527212731.js +0 -23
  342. package/node_modules/node-domexception/.history/index_20210527212746.js +0 -15
  343. package/node_modules/node-domexception/.history/index_20210527212900.js +0 -16
  344. package/node_modules/node-domexception/.history/index_20210527213022.js +0 -16
  345. package/node_modules/node-domexception/.history/index_20210527213822.js +0 -16
  346. package/node_modules/node-domexception/.history/index_20210527213843.js +0 -17
  347. package/node_modules/node-domexception/.history/index_20210527213852.js +0 -17
  348. package/node_modules/node-domexception/.history/index_20210527213910.js +0 -16
  349. package/node_modules/node-domexception/.history/index_20210527214034.js +0 -16
  350. package/node_modules/node-domexception/.history/index_20210527214643.js +0 -41
  351. package/node_modules/node-domexception/.history/index_20210527214654.js +0 -41
  352. package/node_modules/node-domexception/.history/index_20210527214700.js +0 -16
  353. package/node_modules/node-domexception/.history/package_20210527203733.json +0 -19
  354. package/node_modules/node-domexception/.history/package_20210527203825.json +0 -16
  355. package/node_modules/node-domexception/.history/package_20210527204621.json +0 -19
  356. package/node_modules/node-domexception/.history/package_20210527204913.json +0 -25
  357. package/node_modules/node-domexception/.history/package_20210527204925.json +0 -25
  358. package/node_modules/node-domexception/.history/package_20210527205145.json +0 -29
  359. package/node_modules/node-domexception/.history/package_20210527205156.json +0 -29
  360. package/node_modules/node-domexception/.history/test_20210527205603.js +0 -0
  361. package/node_modules/node-domexception/.history/test_20210527205957.js +0 -3
  362. package/node_modules/node-domexception/.history/test_20210527210021.js +0 -3
  363. package/node_modules/node-domexception/LICENSE +0 -21
  364. package/node_modules/node-domexception/README.md +0 -46
  365. package/node_modules/node-domexception/index.js +0 -16
  366. package/node_modules/node-domexception/package.json +0 -29
  367. package/node_modules/node-fetch/@types/index.d.ts +0 -219
  368. package/node_modules/node-fetch/LICENSE.md +0 -22
  369. package/node_modules/node-fetch/README.md +0 -872
  370. package/node_modules/node-fetch/package.json +0 -131
  371. package/node_modules/node-fetch/src/body.js +0 -397
  372. package/node_modules/node-fetch/src/errors/abort-error.js +0 -10
  373. package/node_modules/node-fetch/src/errors/base.js +0 -17
  374. package/node_modules/node-fetch/src/errors/fetch-error.js +0 -26
  375. package/node_modules/node-fetch/src/headers.js +0 -267
  376. package/node_modules/node-fetch/src/index.js +0 -417
  377. package/node_modules/node-fetch/src/request.js +0 -313
  378. package/node_modules/node-fetch/src/response.js +0 -160
  379. package/node_modules/node-fetch/src/utils/get-search.js +0 -9
  380. package/node_modules/node-fetch/src/utils/is-redirect.js +0 -11
  381. package/node_modules/node-fetch/src/utils/is.js +0 -87
  382. package/node_modules/node-fetch/src/utils/multipart-parser.js +0 -432
  383. package/node_modules/node-fetch/src/utils/referrer.js +0 -340
  384. package/node_modules/onetime/index.d.ts +0 -64
  385. package/node_modules/onetime/index.js +0 -44
  386. package/node_modules/onetime/license +0 -9
  387. package/node_modules/onetime/package.json +0 -43
  388. package/node_modules/onetime/readme.md +0 -94
  389. package/node_modules/ora/index.d.ts +0 -277
  390. package/node_modules/ora/index.js +0 -407
  391. package/node_modules/ora/license +0 -9
  392. package/node_modules/ora/package.json +0 -57
  393. package/node_modules/ora/readme.md +0 -264
  394. package/node_modules/path-scurry/LICENSE.md +0 -55
  395. package/node_modules/path-scurry/README.md +0 -636
  396. package/node_modules/path-scurry/dist/commonjs/index.d.ts +0 -1115
  397. package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +0 -1
  398. package/node_modules/path-scurry/dist/commonjs/index.js +0 -2018
  399. package/node_modules/path-scurry/dist/commonjs/index.js.map +0 -1
  400. package/node_modules/path-scurry/dist/commonjs/package.json +0 -3
  401. package/node_modules/path-scurry/dist/esm/index.d.ts +0 -1115
  402. package/node_modules/path-scurry/dist/esm/index.d.ts.map +0 -1
  403. package/node_modules/path-scurry/dist/esm/index.js +0 -1983
  404. package/node_modules/path-scurry/dist/esm/index.js.map +0 -1
  405. package/node_modules/path-scurry/dist/esm/package.json +0 -3
  406. package/node_modules/path-scurry/package.json +0 -72
  407. package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
  408. package/node_modules/readable-stream/GOVERNANCE.md +0 -136
  409. package/node_modules/readable-stream/LICENSE +0 -47
  410. package/node_modules/readable-stream/README.md +0 -106
  411. package/node_modules/readable-stream/errors-browser.js +0 -127
  412. package/node_modules/readable-stream/errors.js +0 -116
  413. package/node_modules/readable-stream/experimentalWarning.js +0 -17
  414. package/node_modules/readable-stream/lib/_stream_duplex.js +0 -126
  415. package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -37
  416. package/node_modules/readable-stream/lib/_stream_readable.js +0 -1027
  417. package/node_modules/readable-stream/lib/_stream_transform.js +0 -190
  418. package/node_modules/readable-stream/lib/_stream_writable.js +0 -641
  419. package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -180
  420. package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -183
  421. package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -96
  422. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -86
  423. package/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
  424. package/node_modules/readable-stream/lib/internal/streams/from.js +0 -52
  425. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -86
  426. package/node_modules/readable-stream/lib/internal/streams/state.js +0 -22
  427. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
  428. package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
  429. package/node_modules/readable-stream/package.json +0 -68
  430. package/node_modules/readable-stream/readable-browser.js +0 -9
  431. package/node_modules/readable-stream/readable.js +0 -16
  432. package/node_modules/restore-cursor/index.d.ts +0 -13
  433. package/node_modules/restore-cursor/index.js +0 -9
  434. package/node_modules/restore-cursor/license +0 -9
  435. package/node_modules/restore-cursor/package.json +0 -52
  436. package/node_modules/restore-cursor/readme.md +0 -26
  437. package/node_modules/safe-buffer/LICENSE +0 -21
  438. package/node_modules/safe-buffer/README.md +0 -584
  439. package/node_modules/safe-buffer/index.d.ts +0 -187
  440. package/node_modules/safe-buffer/index.js +0 -65
  441. package/node_modules/safe-buffer/package.json +0 -51
  442. package/node_modules/signal-exit/LICENSE.txt +0 -16
  443. package/node_modules/signal-exit/README.md +0 -39
  444. package/node_modules/signal-exit/index.js +0 -202
  445. package/node_modules/signal-exit/package.json +0 -38
  446. package/node_modules/signal-exit/signals.js +0 -53
  447. package/node_modules/string_decoder/LICENSE +0 -48
  448. package/node_modules/string_decoder/README.md +0 -47
  449. package/node_modules/string_decoder/lib/string_decoder.js +0 -296
  450. package/node_modules/string_decoder/package.json +0 -34
  451. package/node_modules/strip-ansi/index.d.ts +0 -17
  452. package/node_modules/strip-ansi/index.js +0 -4
  453. package/node_modules/strip-ansi/license +0 -9
  454. package/node_modules/strip-ansi/package.json +0 -54
  455. package/node_modules/strip-ansi/readme.md +0 -46
  456. package/node_modules/supports-color/browser.js +0 -5
  457. package/node_modules/supports-color/index.js +0 -135
  458. package/node_modules/supports-color/license +0 -9
  459. package/node_modules/supports-color/package.json +0 -53
  460. package/node_modules/supports-color/readme.md +0 -76
  461. package/node_modules/util-deprecate/History.md +0 -16
  462. package/node_modules/util-deprecate/LICENSE +0 -24
  463. package/node_modules/util-deprecate/README.md +0 -53
  464. package/node_modules/util-deprecate/browser.js +0 -67
  465. package/node_modules/util-deprecate/node.js +0 -6
  466. package/node_modules/util-deprecate/package.json +0 -27
  467. package/node_modules/wcwidth/.npmignore +0 -1
  468. package/node_modules/wcwidth/LICENSE +0 -30
  469. package/node_modules/wcwidth/Readme.md +0 -33
  470. package/node_modules/wcwidth/combining.js +0 -50
  471. package/node_modules/wcwidth/docs/index.md +0 -65
  472. package/node_modules/wcwidth/index.js +0 -99
  473. package/node_modules/wcwidth/package.json +0 -42
  474. package/node_modules/wcwidth/test/index.js +0 -64
  475. package/node_modules/web-streams-polyfill/LICENSE +0 -22
  476. package/node_modules/web-streams-polyfill/README.md +0 -110
  477. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js +0 -4765
  478. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.js.map +0 -1
  479. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js +0 -9
  480. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.min.js.map +0 -1
  481. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs +0 -4745
  482. package/node_modules/web-streams-polyfill/dist/polyfill.es2018.mjs.map +0 -1
  483. package/node_modules/web-streams-polyfill/dist/polyfill.es6.js +0 -4838
  484. package/node_modules/web-streams-polyfill/dist/polyfill.es6.js.map +0 -1
  485. package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js +0 -9
  486. package/node_modules/web-streams-polyfill/dist/polyfill.es6.min.js.map +0 -1
  487. package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs +0 -4818
  488. package/node_modules/web-streams-polyfill/dist/polyfill.es6.mjs.map +0 -1
  489. package/node_modules/web-streams-polyfill/dist/polyfill.js +0 -5011
  490. package/node_modules/web-streams-polyfill/dist/polyfill.js.map +0 -1
  491. package/node_modules/web-streams-polyfill/dist/polyfill.min.js +0 -9
  492. package/node_modules/web-streams-polyfill/dist/polyfill.min.js.map +0 -1
  493. package/node_modules/web-streams-polyfill/dist/polyfill.mjs +0 -4991
  494. package/node_modules/web-streams-polyfill/dist/polyfill.mjs.map +0 -1
  495. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +0 -4737
  496. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +0 -1
  497. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs +0 -4717
  498. package/node_modules/web-streams-polyfill/dist/ponyfill.es2018.mjs.map +0 -1
  499. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js +0 -4810
  500. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.js.map +0 -1
  501. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs +0 -4790
  502. package/node_modules/web-streams-polyfill/dist/ponyfill.es6.mjs.map +0 -1
  503. package/node_modules/web-streams-polyfill/dist/ponyfill.js +0 -4983
  504. package/node_modules/web-streams-polyfill/dist/ponyfill.js.map +0 -1
  505. package/node_modules/web-streams-polyfill/dist/ponyfill.mjs +0 -4963
  506. package/node_modules/web-streams-polyfill/dist/ponyfill.mjs.map +0 -1
  507. package/node_modules/web-streams-polyfill/dist/types/polyfill.d.ts +0 -24
  508. package/node_modules/web-streams-polyfill/dist/types/ponyfill.d.ts +0 -780
  509. package/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts +0 -28
  510. package/node_modules/web-streams-polyfill/dist/types/ts3.6/ponyfill.d.ts +0 -821
  511. package/node_modules/web-streams-polyfill/dist/types/tsdoc-metadata.json +0 -11
  512. package/node_modules/web-streams-polyfill/es2018/package.json +0 -14
  513. package/node_modules/web-streams-polyfill/es6/package.json +0 -14
  514. package/node_modules/web-streams-polyfill/package.json +0 -83
  515. package/node_modules/web-streams-polyfill/ponyfill/es2018/package.json +0 -13
  516. package/node_modules/web-streams-polyfill/ponyfill/es6/package.json +0 -13
  517. package/node_modules/web-streams-polyfill/ponyfill/package.json +0 -13
  518. package/src/commands/policy.ts +0 -146
  519. package/test-policy.md +0 -55
  520. package/test_cli.ts +0 -16
  521. package/version.json +0 -18
@@ -1,1121 +0,0 @@
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