korext 0.8.0 → 0.8.1

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