@pnpm/exe 11.0.0-dev.1005 → 11.0.0-rc.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 (591) hide show
  1. package/dist/node-gyp-bin/node-gyp +6 -0
  2. package/dist/node-gyp-bin/node-gyp.cmd +5 -0
  3. package/dist/node_modules/@gar/promise-retry/LICENSE +20 -0
  4. package/dist/node_modules/@gar/promise-retry/lib/index.js +62 -0
  5. package/dist/node_modules/@gar/promise-retry/lib/retry.js +109 -0
  6. package/dist/node_modules/@gar/promise-retry/package.json +45 -0
  7. package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
  8. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
  9. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
  10. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
  11. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
  12. package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
  13. package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
  14. package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
  15. package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
  16. package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
  17. package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
  18. package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
  19. package/dist/node_modules/@npmcli/agent/package.json +60 -0
  20. package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
  21. package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
  22. package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
  23. package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
  24. package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
  25. package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
  26. package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
  27. package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
  28. package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
  29. package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
  30. package/dist/node_modules/@npmcli/fs/package.json +54 -0
  31. package/dist/node_modules/@npmcli/redact/LICENSE +21 -0
  32. package/dist/node_modules/@npmcli/redact/lib/deep-map.js +71 -0
  33. package/dist/node_modules/@npmcli/redact/lib/error.js +28 -0
  34. package/dist/node_modules/@npmcli/redact/lib/index.js +44 -0
  35. package/dist/node_modules/@npmcli/redact/lib/matchers.js +88 -0
  36. package/dist/node_modules/@npmcli/redact/lib/server.js +59 -0
  37. package/dist/node_modules/@npmcli/redact/lib/utils.js +202 -0
  38. package/dist/node_modules/@npmcli/redact/package.json +52 -0
  39. package/dist/node_modules/abbrev/LICENSE +46 -0
  40. package/dist/node_modules/abbrev/lib/index.js +53 -0
  41. package/dist/node_modules/abbrev/package.json +41 -0
  42. package/dist/node_modules/agent-base/LICENSE +22 -0
  43. package/dist/node_modules/agent-base/dist/helpers.js +66 -0
  44. package/dist/node_modules/agent-base/dist/index.js +178 -0
  45. package/dist/node_modules/agent-base/package.json +46 -0
  46. package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  47. package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  48. package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
  49. package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
  50. package/dist/node_modules/balanced-match/package.json +68 -0
  51. package/dist/node_modules/brace-expansion/LICENSE +23 -0
  52. package/dist/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
  53. package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  54. package/dist/node_modules/brace-expansion/dist/esm/index.js +197 -0
  55. package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
  56. package/dist/node_modules/brace-expansion/package.json +64 -0
  57. package/dist/node_modules/cacache/lib/content/path.js +29 -0
  58. package/dist/node_modules/cacache/lib/content/read.js +165 -0
  59. package/dist/node_modules/cacache/lib/content/rm.js +18 -0
  60. package/dist/node_modules/cacache/lib/content/write.js +206 -0
  61. package/dist/node_modules/cacache/lib/entry-index.js +336 -0
  62. package/dist/node_modules/cacache/lib/get.js +170 -0
  63. package/dist/node_modules/cacache/lib/index.js +42 -0
  64. package/dist/node_modules/cacache/lib/memoization.js +72 -0
  65. package/dist/node_modules/cacache/lib/put.js +80 -0
  66. package/dist/node_modules/cacache/lib/rm.js +31 -0
  67. package/dist/node_modules/cacache/lib/util/glob.js +7 -0
  68. package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
  69. package/dist/node_modules/cacache/lib/util/tmp.js +32 -0
  70. package/dist/node_modules/cacache/lib/verify.js +258 -0
  71. package/dist/node_modules/cacache/package.json +81 -0
  72. package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
  73. package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
  74. package/dist/node_modules/chownr/dist/esm/index.js +85 -0
  75. package/dist/node_modules/chownr/dist/esm/package.json +3 -0
  76. package/dist/node_modules/chownr/package.json +69 -0
  77. package/dist/node_modules/debug/LICENSE +20 -0
  78. package/dist/node_modules/debug/package.json +64 -0
  79. package/dist/node_modules/debug/src/browser.js +272 -0
  80. package/dist/node_modules/debug/src/common.js +292 -0
  81. package/dist/node_modules/debug/src/index.js +10 -0
  82. package/dist/node_modules/debug/src/node.js +263 -0
  83. package/dist/node_modules/env-paths/index.js +74 -0
  84. package/dist/node_modules/env-paths/license +9 -0
  85. package/dist/node_modules/env-paths/package.json +45 -0
  86. package/dist/node_modules/exponential-backoff/LICENSE +202 -0
  87. package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
  88. package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
  89. package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
  90. package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
  91. package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
  92. package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
  93. package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
  94. package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
  95. package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
  96. package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
  97. package/dist/node_modules/exponential-backoff/package.json +62 -0
  98. package/dist/node_modules/fdir/LICENSE +7 -0
  99. package/dist/node_modules/fdir/dist/index.cjs +588 -0
  100. package/dist/node_modules/fdir/dist/index.d.cts +155 -0
  101. package/dist/node_modules/fdir/dist/index.d.mts +155 -0
  102. package/dist/node_modules/fdir/dist/index.mjs +570 -0
  103. package/dist/node_modules/fdir/package.json +103 -0
  104. package/dist/node_modules/fs-minipass/LICENSE +15 -0
  105. package/dist/node_modules/fs-minipass/lib/index.js +443 -0
  106. package/dist/node_modules/fs-minipass/package.json +54 -0
  107. package/dist/node_modules/glob/dist/commonjs/glob.js +248 -0
  108. package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  109. package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
  110. package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
  111. package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
  112. package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
  113. package/dist/node_modules/glob/dist/commonjs/pattern.js +223 -0
  114. package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
  115. package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
  116. package/dist/node_modules/glob/dist/esm/glob.js +244 -0
  117. package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
  118. package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
  119. package/dist/node_modules/glob/dist/esm/index.js +55 -0
  120. package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
  121. package/dist/node_modules/glob/dist/esm/package.json +3 -0
  122. package/dist/node_modules/glob/dist/esm/pattern.js +219 -0
  123. package/dist/node_modules/glob/dist/esm/processor.js +294 -0
  124. package/dist/node_modules/glob/dist/esm/walker.js +381 -0
  125. package/dist/node_modules/glob/package.json +98 -0
  126. package/dist/node_modules/graceful-fs/LICENSE +15 -0
  127. package/dist/node_modules/graceful-fs/clone.js +23 -0
  128. package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
  129. package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
  130. package/dist/node_modules/graceful-fs/package.json +53 -0
  131. package/dist/node_modules/graceful-fs/polyfills.js +355 -0
  132. package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
  133. package/dist/node_modules/http-cache-semantics/index.js +928 -0
  134. package/dist/node_modules/http-cache-semantics/package.json +22 -0
  135. package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
  136. package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
  137. package/dist/node_modules/http-proxy-agent/package.json +47 -0
  138. package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
  139. package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
  140. package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
  141. package/dist/node_modules/https-proxy-agent/package.json +50 -0
  142. package/dist/node_modules/iconv-lite/LICENSE +21 -0
  143. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  144. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  145. package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
  146. package/dist/node_modules/iconv-lite/encodings/internal.js +218 -0
  147. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  148. package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  149. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
  150. package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  151. package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  152. package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  153. package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  154. package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  155. package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  156. package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  157. package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  158. package/dist/node_modules/iconv-lite/encodings/utf16.js +187 -0
  159. package/dist/node_modules/iconv-lite/encodings/utf32.js +307 -0
  160. package/dist/node_modules/iconv-lite/encodings/utf7.js +283 -0
  161. package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  162. package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  163. package/dist/node_modules/iconv-lite/lib/index.js +182 -0
  164. package/dist/node_modules/iconv-lite/lib/streams.js +105 -0
  165. package/dist/node_modules/iconv-lite/package.json +70 -0
  166. package/dist/node_modules/ip-address/LICENSE +19 -0
  167. package/dist/node_modules/ip-address/dist/address-error.js +12 -0
  168. package/dist/node_modules/ip-address/dist/common.js +46 -0
  169. package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
  170. package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
  171. package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
  172. package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
  173. package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
  174. package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
  175. package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
  176. package/dist/node_modules/ip-address/package.json +78 -0
  177. package/dist/node_modules/isexe/dist/commonjs/index.js +56 -0
  178. package/dist/node_modules/isexe/dist/commonjs/index.min.js +2 -0
  179. package/dist/node_modules/isexe/dist/commonjs/options.js +3 -0
  180. package/dist/node_modules/isexe/dist/commonjs/package.json +3 -0
  181. package/dist/node_modules/isexe/dist/commonjs/posix.js +67 -0
  182. package/dist/node_modules/isexe/dist/commonjs/win32.js +63 -0
  183. package/dist/node_modules/isexe/dist/esm/index.js +16 -0
  184. package/dist/node_modules/isexe/dist/esm/index.min.js +2 -0
  185. package/dist/node_modules/isexe/dist/esm/options.js +2 -0
  186. package/dist/node_modules/isexe/dist/esm/package.json +3 -0
  187. package/dist/node_modules/isexe/dist/esm/posix.js +62 -0
  188. package/dist/node_modules/isexe/dist/esm/win32.js +58 -0
  189. package/dist/node_modules/isexe/package.json +78 -0
  190. package/dist/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +10 -0
  191. package/dist/node_modules/lru-cache/dist/commonjs/index.js +1692 -0
  192. package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  193. package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  194. package/dist/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +4 -0
  195. package/dist/node_modules/lru-cache/dist/esm/browser/index.js +1688 -0
  196. package/dist/node_modules/lru-cache/dist/esm/browser/index.min.js +2 -0
  197. package/dist/node_modules/lru-cache/dist/esm/diagnostics-channel.js +19 -0
  198. package/dist/node_modules/lru-cache/dist/esm/index.js +1688 -0
  199. package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  200. package/dist/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +7 -0
  201. package/dist/node_modules/lru-cache/dist/esm/node/index.js +1688 -0
  202. package/dist/node_modules/lru-cache/dist/esm/node/index.min.js +2 -0
  203. package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
  204. package/dist/node_modules/lru-cache/package.json +126 -0
  205. package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
  206. package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
  207. package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
  208. package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
  209. package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
  210. package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
  211. package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
  212. package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
  213. package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
  214. package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
  215. package/dist/node_modules/make-fetch-happen/lib/remote.js +134 -0
  216. package/dist/node_modules/make-fetch-happen/package.json +75 -0
  217. package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  218. package/dist/node_modules/minimatch/dist/commonjs/ast.js +845 -0
  219. package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  220. package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  221. package/dist/node_modules/minimatch/dist/commonjs/index.js +1127 -0
  222. package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
  223. package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  224. package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  225. package/dist/node_modules/minimatch/dist/esm/ast.js +841 -0
  226. package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  227. package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
  228. package/dist/node_modules/minimatch/dist/esm/index.js +1114 -0
  229. package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
  230. package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
  231. package/dist/node_modules/minimatch/package.json +73 -0
  232. package/dist/node_modules/minipass/dist/commonjs/index.js +1038 -0
  233. package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
  234. package/dist/node_modules/minipass/dist/esm/index.js +1020 -0
  235. package/dist/node_modules/minipass/dist/esm/package.json +3 -0
  236. package/dist/node_modules/minipass/package.json +77 -0
  237. package/dist/node_modules/minipass-collect/LICENSE +15 -0
  238. package/dist/node_modules/minipass-collect/index.js +71 -0
  239. package/dist/node_modules/minipass-collect/package.json +30 -0
  240. package/dist/node_modules/minipass-fetch/LICENSE +28 -0
  241. package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
  242. package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
  243. package/dist/node_modules/minipass-fetch/lib/body.js +360 -0
  244. package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
  245. package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
  246. package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
  247. package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
  248. package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
  249. package/dist/node_modules/minipass-fetch/package.json +70 -0
  250. package/dist/node_modules/minipass-flush/index.js +39 -0
  251. package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
  252. package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
  253. package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
  254. package/dist/node_modules/minipass-flush/package.json +42 -0
  255. package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
  256. package/dist/node_modules/minipass-pipeline/index.js +128 -0
  257. package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
  258. package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
  259. package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
  260. package/dist/node_modules/minipass-pipeline/package.json +29 -0
  261. package/dist/node_modules/minipass-sized/LICENSE +15 -0
  262. package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
  263. package/dist/node_modules/minipass-sized/dist/commonjs/package.json +3 -0
  264. package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
  265. package/dist/node_modules/minipass-sized/dist/esm/package.json +3 -0
  266. package/dist/node_modules/minipass-sized/package.json +69 -0
  267. package/dist/node_modules/minizlib/LICENSE +26 -0
  268. package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
  269. package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
  270. package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
  271. package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
  272. package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
  273. package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
  274. package/dist/node_modules/minizlib/package.json +80 -0
  275. package/dist/node_modules/ms/index.js +162 -0
  276. package/dist/node_modules/ms/package.json +38 -0
  277. package/dist/node_modules/negotiator/LICENSE +24 -0
  278. package/dist/node_modules/negotiator/index.js +83 -0
  279. package/dist/node_modules/negotiator/lib/charset.js +169 -0
  280. package/dist/node_modules/negotiator/lib/encoding.js +205 -0
  281. package/dist/node_modules/negotiator/lib/language.js +179 -0
  282. package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
  283. package/dist/node_modules/negotiator/package.json +43 -0
  284. package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
  285. package/dist/node_modules/node-gyp/LICENSE +24 -0
  286. package/dist/node_modules/node-gyp/addon.gypi +204 -0
  287. package/dist/node_modules/node-gyp/bin/node-gyp.js +145 -0
  288. package/dist/node_modules/node-gyp/eslint.config.js +3 -0
  289. package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
  290. package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
  291. package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
  292. package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
  293. package/dist/node_modules/node-gyp/gyp/gyp +8 -0
  294. package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
  295. package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
  296. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
  297. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
  298. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
  299. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
  300. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
  301. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
  302. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
  303. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +599 -0
  304. package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
  305. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
  306. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
  307. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
  308. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
  309. package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
  310. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  311. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
  312. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
  313. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
  314. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
  315. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
  316. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
  317. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
  318. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
  319. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
  320. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
  321. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
  322. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2956 -0
  323. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
  324. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
  325. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
  326. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
  327. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
  328. package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
  329. package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
  330. package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
  331. package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
  332. package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
  333. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
  334. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
  335. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
  336. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
  337. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
  338. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
  339. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
  340. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
  341. package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
  342. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
  343. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
  344. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
  345. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
  346. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
  347. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
  348. package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
  349. package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
  350. package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  351. package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
  352. package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
  353. package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
  354. package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
  355. package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
  356. package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
  357. package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
  358. package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
  359. package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
  360. package/dist/node_modules/node-gyp/lib/build.js +230 -0
  361. package/dist/node_modules/node-gyp/lib/clean.js +15 -0
  362. package/dist/node_modules/node-gyp/lib/configure.js +328 -0
  363. package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
  364. package/dist/node_modules/node-gyp/lib/download.js +39 -0
  365. package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
  366. package/dist/node_modules/node-gyp/lib/find-python.js +304 -0
  367. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +606 -0
  368. package/dist/node_modules/node-gyp/lib/install.js +411 -0
  369. package/dist/node_modules/node-gyp/lib/list.js +26 -0
  370. package/dist/node_modules/node-gyp/lib/log.js +168 -0
  371. package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
  372. package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
  373. package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
  374. package/dist/node_modules/node-gyp/lib/remove.js +43 -0
  375. package/dist/node_modules/node-gyp/lib/util.js +81 -0
  376. package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
  377. package/dist/node_modules/node-gyp/package.json +52 -0
  378. package/dist/node_modules/node-gyp/release-please-config.json +40 -0
  379. package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
  380. package/dist/node_modules/nopt/LICENSE +15 -0
  381. package/dist/node_modules/nopt/bin/nopt.js +29 -0
  382. package/dist/node_modules/nopt/lib/debug.js +5 -0
  383. package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
  384. package/dist/node_modules/nopt/lib/nopt.js +34 -0
  385. package/dist/node_modules/nopt/lib/type-defs.js +91 -0
  386. package/dist/node_modules/nopt/package.json +52 -0
  387. package/dist/node_modules/p-map/index.js +283 -0
  388. package/dist/node_modules/p-map/license +9 -0
  389. package/dist/node_modules/p-map/package.json +57 -0
  390. package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
  391. package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  392. package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
  393. package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
  394. package/dist/node_modules/path-scurry/package.json +72 -0
  395. package/dist/node_modules/picomatch/LICENSE +21 -0
  396. package/dist/node_modules/picomatch/index.js +17 -0
  397. package/dist/node_modules/picomatch/lib/constants.js +184 -0
  398. package/dist/node_modules/picomatch/lib/parse.js +1386 -0
  399. package/dist/node_modules/picomatch/lib/picomatch.js +349 -0
  400. package/dist/node_modules/picomatch/lib/scan.js +391 -0
  401. package/dist/node_modules/picomatch/lib/utils.js +72 -0
  402. package/dist/node_modules/picomatch/package.json +82 -0
  403. package/dist/node_modules/picomatch/posix.js +3 -0
  404. package/dist/node_modules/proc-log/LICENSE +15 -0
  405. package/dist/node_modules/proc-log/lib/index.js +158 -0
  406. package/dist/node_modules/proc-log/package.json +46 -0
  407. package/dist/node_modules/safer-buffer/LICENSE +21 -0
  408. package/dist/node_modules/safer-buffer/dangerous.js +58 -0
  409. package/dist/node_modules/safer-buffer/package.json +34 -0
  410. package/dist/node_modules/safer-buffer/safer.js +77 -0
  411. package/dist/node_modules/safer-buffer/tests.js +406 -0
  412. package/dist/node_modules/semver/LICENSE +15 -0
  413. package/dist/node_modules/semver/bin/semver.js +191 -0
  414. package/dist/node_modules/semver/classes/comparator.js +143 -0
  415. package/dist/node_modules/semver/classes/index.js +7 -0
  416. package/dist/node_modules/semver/classes/range.js +557 -0
  417. package/dist/node_modules/semver/classes/semver.js +333 -0
  418. package/dist/node_modules/semver/functions/clean.js +8 -0
  419. package/dist/node_modules/semver/functions/cmp.js +54 -0
  420. package/dist/node_modules/semver/functions/coerce.js +62 -0
  421. package/dist/node_modules/semver/functions/compare-build.js +9 -0
  422. package/dist/node_modules/semver/functions/compare-loose.js +5 -0
  423. package/dist/node_modules/semver/functions/compare.js +7 -0
  424. package/dist/node_modules/semver/functions/diff.js +60 -0
  425. package/dist/node_modules/semver/functions/eq.js +5 -0
  426. package/dist/node_modules/semver/functions/gt.js +5 -0
  427. package/dist/node_modules/semver/functions/gte.js +5 -0
  428. package/dist/node_modules/semver/functions/inc.js +21 -0
  429. package/dist/node_modules/semver/functions/lt.js +5 -0
  430. package/dist/node_modules/semver/functions/lte.js +5 -0
  431. package/dist/node_modules/semver/functions/major.js +5 -0
  432. package/dist/node_modules/semver/functions/minor.js +5 -0
  433. package/dist/node_modules/semver/functions/neq.js +5 -0
  434. package/dist/node_modules/semver/functions/parse.js +18 -0
  435. package/dist/node_modules/semver/functions/patch.js +5 -0
  436. package/dist/node_modules/semver/functions/prerelease.js +8 -0
  437. package/dist/node_modules/semver/functions/rcompare.js +5 -0
  438. package/dist/node_modules/semver/functions/rsort.js +5 -0
  439. package/dist/node_modules/semver/functions/satisfies.js +12 -0
  440. package/dist/node_modules/semver/functions/sort.js +5 -0
  441. package/dist/node_modules/semver/functions/valid.js +8 -0
  442. package/dist/node_modules/semver/index.js +91 -0
  443. package/dist/node_modules/semver/internal/constants.js +37 -0
  444. package/dist/node_modules/semver/internal/debug.js +11 -0
  445. package/dist/node_modules/semver/internal/identifiers.js +29 -0
  446. package/dist/node_modules/semver/internal/lrucache.js +42 -0
  447. package/dist/node_modules/semver/internal/parse-options.js +17 -0
  448. package/dist/node_modules/semver/internal/re.js +223 -0
  449. package/dist/node_modules/semver/package.json +78 -0
  450. package/dist/node_modules/semver/preload.js +4 -0
  451. package/dist/node_modules/semver/range.bnf +16 -0
  452. package/dist/node_modules/semver/ranges/gtr.js +6 -0
  453. package/dist/node_modules/semver/ranges/intersects.js +9 -0
  454. package/dist/node_modules/semver/ranges/ltr.js +6 -0
  455. package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
  456. package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
  457. package/dist/node_modules/semver/ranges/min-version.js +63 -0
  458. package/dist/node_modules/semver/ranges/outside.js +82 -0
  459. package/dist/node_modules/semver/ranges/simplify.js +49 -0
  460. package/dist/node_modules/semver/ranges/subset.js +249 -0
  461. package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
  462. package/dist/node_modules/semver/ranges/valid.js +13 -0
  463. package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
  464. package/dist/node_modules/smart-buffer/LICENSE +20 -0
  465. package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
  466. package/dist/node_modules/smart-buffer/build/utils.js +108 -0
  467. package/dist/node_modules/smart-buffer/package.json +79 -0
  468. package/dist/node_modules/socks/.eslintrc.cjs +11 -0
  469. package/dist/node_modules/socks/.prettierrc.yaml +7 -0
  470. package/dist/node_modules/socks/LICENSE +20 -0
  471. package/dist/node_modules/socks/build/client/socksclient.js +793 -0
  472. package/dist/node_modules/socks/build/common/constants.js +108 -0
  473. package/dist/node_modules/socks/build/common/helpers.js +167 -0
  474. package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
  475. package/dist/node_modules/socks/build/common/util.js +25 -0
  476. package/dist/node_modules/socks/build/index.js +18 -0
  477. package/dist/node_modules/socks/package.json +58 -0
  478. package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
  479. package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
  480. package/dist/node_modules/socks-proxy-agent/package.json +142 -0
  481. package/dist/node_modules/ssri/lib/index.js +550 -0
  482. package/dist/node_modules/ssri/package.json +66 -0
  483. package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
  484. package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
  485. package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
  486. package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
  487. package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
  488. package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
  489. package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
  490. package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
  491. package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
  492. package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
  493. package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
  494. package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
  495. package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
  496. package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
  497. package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
  498. package/dist/node_modules/tar/dist/commonjs/pack.js +511 -0
  499. package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
  500. package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
  501. package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
  502. package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
  503. package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
  504. package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
  505. package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
  506. package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
  507. package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
  508. package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
  509. package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
  510. package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
  511. package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
  512. package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
  513. package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
  514. package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
  515. package/dist/node_modules/tar/dist/esm/create.js +76 -0
  516. package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
  517. package/dist/node_modules/tar/dist/esm/extract.js +49 -0
  518. package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
  519. package/dist/node_modules/tar/dist/esm/header.js +275 -0
  520. package/dist/node_modules/tar/dist/esm/index.js +20 -0
  521. package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
  522. package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
  523. package/dist/node_modules/tar/dist/esm/list.js +105 -0
  524. package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
  525. package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
  526. package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
  527. package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
  528. package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
  529. package/dist/node_modules/tar/dist/esm/options.js +54 -0
  530. package/dist/node_modules/tar/dist/esm/pack.js +469 -0
  531. package/dist/node_modules/tar/dist/esm/package.json +3 -0
  532. package/dist/node_modules/tar/dist/esm/parse.js +606 -0
  533. package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
  534. package/dist/node_modules/tar/dist/esm/pax.js +154 -0
  535. package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
  536. package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
  537. package/dist/node_modules/tar/dist/esm/replace.js +221 -0
  538. package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
  539. package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
  540. package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
  541. package/dist/node_modules/tar/dist/esm/types.js +45 -0
  542. package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
  543. package/dist/node_modules/tar/dist/esm/update.js +30 -0
  544. package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
  545. package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
  546. package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
  547. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
  548. package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
  549. package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
  550. package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
  551. package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
  552. package/dist/node_modules/tar/package.json +297 -0
  553. package/dist/node_modules/tinyglobby/LICENSE +21 -0
  554. package/dist/node_modules/tinyglobby/dist/index.cjs +334 -0
  555. package/dist/node_modules/tinyglobby/dist/index.d.cts +148 -0
  556. package/dist/node_modules/tinyglobby/dist/index.d.mts +148 -0
  557. package/dist/node_modules/tinyglobby/dist/index.mjs +306 -0
  558. package/dist/node_modules/tinyglobby/package.json +73 -0
  559. package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
  560. package/dist/node_modules/v8-compile-cache/package.json +34 -0
  561. package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
  562. package/dist/node_modules/which/LICENSE +15 -0
  563. package/dist/node_modules/which/bin/which.js +52 -0
  564. package/dist/node_modules/which/lib/index.js +111 -0
  565. package/dist/node_modules/which/package.json +52 -0
  566. package/dist/node_modules/yallist/LICENSE +15 -0
  567. package/dist/node_modules/yallist/iterator.js +8 -0
  568. package/dist/node_modules/yallist/package.json +29 -0
  569. package/dist/node_modules/yallist/yallist.js +426 -0
  570. package/dist/pnpm.mjs +267218 -0
  571. package/dist/pnpmrc +2 -0
  572. package/dist/templates/completion.bash +31 -0
  573. package/dist/templates/completion.fish +22 -0
  574. package/dist/templates/completion.ps1 +193 -0
  575. package/dist/templates/completion.zsh +27 -0
  576. package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
  577. package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
  578. package/dist/worker.js +10958 -0
  579. package/package.json +34 -11
  580. package/pn +2 -0
  581. package/pn.cmd +2 -0
  582. package/pn.ps1 +1 -0
  583. package/pnpx +2 -0
  584. package/pnpx.cmd +2 -0
  585. package/pnpx.ps1 +1 -0
  586. package/pnx +2 -0
  587. package/pnx.cmd +2 -0
  588. package/pnx.ps1 +1 -0
  589. package/prepare.js +26 -3
  590. package/setup.js +22 -11
  591. package/CHANGELOG.md +0 -15
@@ -0,0 +1,1386 @@
1
+ 'use strict';
2
+
3
+ const constants = require('./constants');
4
+ const utils = require('./utils');
5
+
6
+ /**
7
+ * Constants
8
+ */
9
+
10
+ const {
11
+ MAX_LENGTH,
12
+ POSIX_REGEX_SOURCE,
13
+ REGEX_NON_SPECIAL_CHARS,
14
+ REGEX_SPECIAL_CHARS_BACKREF,
15
+ REPLACEMENTS
16
+ } = constants;
17
+
18
+ /**
19
+ * Helpers
20
+ */
21
+
22
+ const expandRange = (args, options) => {
23
+ if (typeof options.expandRange === 'function') {
24
+ return options.expandRange(...args, options);
25
+ }
26
+
27
+ args.sort();
28
+ const value = `[${args.join('-')}]`;
29
+
30
+ try {
31
+ /* eslint-disable-next-line no-new */
32
+ new RegExp(value);
33
+ } catch (ex) {
34
+ return args.map(v => utils.escapeRegex(v)).join('..');
35
+ }
36
+
37
+ return value;
38
+ };
39
+
40
+ /**
41
+ * Create the message for a syntax error
42
+ */
43
+
44
+ const syntaxError = (type, char) => {
45
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
46
+ };
47
+
48
+ const splitTopLevel = input => {
49
+ const parts = [];
50
+ let bracket = 0;
51
+ let paren = 0;
52
+ let quote = 0;
53
+ let value = '';
54
+ let escaped = false;
55
+
56
+ for (const ch of input) {
57
+ if (escaped === true) {
58
+ value += ch;
59
+ escaped = false;
60
+ continue;
61
+ }
62
+
63
+ if (ch === '\\') {
64
+ value += ch;
65
+ escaped = true;
66
+ continue;
67
+ }
68
+
69
+ if (ch === '"') {
70
+ quote = quote === 1 ? 0 : 1;
71
+ value += ch;
72
+ continue;
73
+ }
74
+
75
+ if (quote === 0) {
76
+ if (ch === '[') {
77
+ bracket++;
78
+ } else if (ch === ']' && bracket > 0) {
79
+ bracket--;
80
+ } else if (bracket === 0) {
81
+ if (ch === '(') {
82
+ paren++;
83
+ } else if (ch === ')' && paren > 0) {
84
+ paren--;
85
+ } else if (ch === '|' && paren === 0) {
86
+ parts.push(value);
87
+ value = '';
88
+ continue;
89
+ }
90
+ }
91
+ }
92
+
93
+ value += ch;
94
+ }
95
+
96
+ parts.push(value);
97
+ return parts;
98
+ };
99
+
100
+ const isPlainBranch = branch => {
101
+ let escaped = false;
102
+
103
+ for (const ch of branch) {
104
+ if (escaped === true) {
105
+ escaped = false;
106
+ continue;
107
+ }
108
+
109
+ if (ch === '\\') {
110
+ escaped = true;
111
+ continue;
112
+ }
113
+
114
+ if (/[?*+@!()[\]{}]/.test(ch)) {
115
+ return false;
116
+ }
117
+ }
118
+
119
+ return true;
120
+ };
121
+
122
+ const normalizeSimpleBranch = branch => {
123
+ let value = branch.trim();
124
+ let changed = true;
125
+
126
+ while (changed === true) {
127
+ changed = false;
128
+
129
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
130
+ value = value.slice(2, -1);
131
+ changed = true;
132
+ }
133
+ }
134
+
135
+ if (!isPlainBranch(value)) {
136
+ return;
137
+ }
138
+
139
+ return value.replace(/\\(.)/g, '$1');
140
+ };
141
+
142
+ const hasRepeatedCharPrefixOverlap = branches => {
143
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
144
+
145
+ for (let i = 0; i < values.length; i++) {
146
+ for (let j = i + 1; j < values.length; j++) {
147
+ const a = values[i];
148
+ const b = values[j];
149
+ const char = a[0];
150
+
151
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
152
+ continue;
153
+ }
154
+
155
+ if (a === b || a.startsWith(b) || b.startsWith(a)) {
156
+ return true;
157
+ }
158
+ }
159
+ }
160
+
161
+ return false;
162
+ };
163
+
164
+ const parseRepeatedExtglob = (pattern, requireEnd = true) => {
165
+ if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
166
+ return;
167
+ }
168
+
169
+ let bracket = 0;
170
+ let paren = 0;
171
+ let quote = 0;
172
+ let escaped = false;
173
+
174
+ for (let i = 1; i < pattern.length; i++) {
175
+ const ch = pattern[i];
176
+
177
+ if (escaped === true) {
178
+ escaped = false;
179
+ continue;
180
+ }
181
+
182
+ if (ch === '\\') {
183
+ escaped = true;
184
+ continue;
185
+ }
186
+
187
+ if (ch === '"') {
188
+ quote = quote === 1 ? 0 : 1;
189
+ continue;
190
+ }
191
+
192
+ if (quote === 1) {
193
+ continue;
194
+ }
195
+
196
+ if (ch === '[') {
197
+ bracket++;
198
+ continue;
199
+ }
200
+
201
+ if (ch === ']' && bracket > 0) {
202
+ bracket--;
203
+ continue;
204
+ }
205
+
206
+ if (bracket > 0) {
207
+ continue;
208
+ }
209
+
210
+ if (ch === '(') {
211
+ paren++;
212
+ continue;
213
+ }
214
+
215
+ if (ch === ')') {
216
+ paren--;
217
+
218
+ if (paren === 0) {
219
+ if (requireEnd === true && i !== pattern.length - 1) {
220
+ return;
221
+ }
222
+
223
+ return {
224
+ type: pattern[0],
225
+ body: pattern.slice(2, i),
226
+ end: i
227
+ };
228
+ }
229
+ }
230
+ }
231
+ };
232
+
233
+ const getStarExtglobSequenceOutput = pattern => {
234
+ let index = 0;
235
+ const chars = [];
236
+
237
+ while (index < pattern.length) {
238
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
239
+
240
+ if (!match || match.type !== '*') {
241
+ return;
242
+ }
243
+
244
+ const branches = splitTopLevel(match.body).map(branch => branch.trim());
245
+ if (branches.length !== 1) {
246
+ return;
247
+ }
248
+
249
+ const branch = normalizeSimpleBranch(branches[0]);
250
+ if (!branch || branch.length !== 1) {
251
+ return;
252
+ }
253
+
254
+ chars.push(branch);
255
+ index += match.end + 1;
256
+ }
257
+
258
+ if (chars.length < 1) {
259
+ return;
260
+ }
261
+
262
+ const source = chars.length === 1
263
+ ? utils.escapeRegex(chars[0])
264
+ : `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
265
+
266
+ return `${source}*`;
267
+ };
268
+
269
+ const repeatedExtglobRecursion = pattern => {
270
+ let depth = 0;
271
+ let value = pattern.trim();
272
+ let match = parseRepeatedExtglob(value);
273
+
274
+ while (match) {
275
+ depth++;
276
+ value = match.body.trim();
277
+ match = parseRepeatedExtglob(value);
278
+ }
279
+
280
+ return depth;
281
+ };
282
+
283
+ const analyzeRepeatedExtglob = (body, options) => {
284
+ if (options.maxExtglobRecursion === false) {
285
+ return { risky: false };
286
+ }
287
+
288
+ const max =
289
+ typeof options.maxExtglobRecursion === 'number'
290
+ ? options.maxExtglobRecursion
291
+ : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
292
+
293
+ const branches = splitTopLevel(body).map(branch => branch.trim());
294
+
295
+ if (branches.length > 1) {
296
+ if (
297
+ branches.some(branch => branch === '') ||
298
+ branches.some(branch => /^[*?]+$/.test(branch)) ||
299
+ hasRepeatedCharPrefixOverlap(branches)
300
+ ) {
301
+ return { risky: true };
302
+ }
303
+ }
304
+
305
+ for (const branch of branches) {
306
+ const safeOutput = getStarExtglobSequenceOutput(branch);
307
+ if (safeOutput) {
308
+ return { risky: true, safeOutput };
309
+ }
310
+
311
+ if (repeatedExtglobRecursion(branch) > max) {
312
+ return { risky: true };
313
+ }
314
+ }
315
+
316
+ return { risky: false };
317
+ };
318
+
319
+ /**
320
+ * Parse the given input string.
321
+ * @param {String} input
322
+ * @param {Object} options
323
+ * @return {Object}
324
+ */
325
+
326
+ const parse = (input, options) => {
327
+ if (typeof input !== 'string') {
328
+ throw new TypeError('Expected a string');
329
+ }
330
+
331
+ input = REPLACEMENTS[input] || input;
332
+
333
+ const opts = { ...options };
334
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
335
+
336
+ let len = input.length;
337
+ if (len > max) {
338
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
339
+ }
340
+
341
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
342
+ const tokens = [bos];
343
+
344
+ const capture = opts.capture ? '' : '?:';
345
+
346
+ // create constants based on platform, for windows or posix
347
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
348
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
349
+
350
+ const {
351
+ DOT_LITERAL,
352
+ PLUS_LITERAL,
353
+ SLASH_LITERAL,
354
+ ONE_CHAR,
355
+ DOTS_SLASH,
356
+ NO_DOT,
357
+ NO_DOT_SLASH,
358
+ NO_DOTS_SLASH,
359
+ QMARK,
360
+ QMARK_NO_DOT,
361
+ STAR,
362
+ START_ANCHOR
363
+ } = PLATFORM_CHARS;
364
+
365
+ const globstar = opts => {
366
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
367
+ };
368
+
369
+ const nodot = opts.dot ? '' : NO_DOT;
370
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
371
+ let star = opts.bash === true ? globstar(opts) : STAR;
372
+
373
+ if (opts.capture) {
374
+ star = `(${star})`;
375
+ }
376
+
377
+ // minimatch options support
378
+ if (typeof opts.noext === 'boolean') {
379
+ opts.noextglob = opts.noext;
380
+ }
381
+
382
+ const state = {
383
+ input,
384
+ index: -1,
385
+ start: 0,
386
+ dot: opts.dot === true,
387
+ consumed: '',
388
+ output: '',
389
+ prefix: '',
390
+ backtrack: false,
391
+ negated: false,
392
+ brackets: 0,
393
+ braces: 0,
394
+ parens: 0,
395
+ quotes: 0,
396
+ globstar: false,
397
+ tokens
398
+ };
399
+
400
+ input = utils.removePrefix(input, state);
401
+ len = input.length;
402
+
403
+ const extglobs = [];
404
+ const braces = [];
405
+ const stack = [];
406
+ let prev = bos;
407
+ let value;
408
+
409
+ /**
410
+ * Tokenizing helpers
411
+ */
412
+
413
+ const eos = () => state.index === len - 1;
414
+ const peek = state.peek = (n = 1) => input[state.index + n];
415
+ const advance = state.advance = () => input[++state.index] || '';
416
+ const remaining = () => input.slice(state.index + 1);
417
+ const consume = (value = '', num = 0) => {
418
+ state.consumed += value;
419
+ state.index += num;
420
+ };
421
+
422
+ const append = token => {
423
+ state.output += token.output != null ? token.output : token.value;
424
+ consume(token.value);
425
+ };
426
+
427
+ const negate = () => {
428
+ let count = 1;
429
+
430
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
431
+ advance();
432
+ state.start++;
433
+ count++;
434
+ }
435
+
436
+ if (count % 2 === 0) {
437
+ return false;
438
+ }
439
+
440
+ state.negated = true;
441
+ state.start++;
442
+ return true;
443
+ };
444
+
445
+ const increment = type => {
446
+ state[type]++;
447
+ stack.push(type);
448
+ };
449
+
450
+ const decrement = type => {
451
+ state[type]--;
452
+ stack.pop();
453
+ };
454
+
455
+ /**
456
+ * Push tokens onto the tokens array. This helper speeds up
457
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
458
+ * and 2) helping us avoid creating extra tokens when consecutive
459
+ * characters are plain text. This improves performance and simplifies
460
+ * lookbehinds.
461
+ */
462
+
463
+ const push = tok => {
464
+ if (prev.type === 'globstar') {
465
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
466
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
467
+
468
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
469
+ state.output = state.output.slice(0, -prev.output.length);
470
+ prev.type = 'star';
471
+ prev.value = '*';
472
+ prev.output = star;
473
+ state.output += prev.output;
474
+ }
475
+ }
476
+
477
+ if (extglobs.length && tok.type !== 'paren') {
478
+ extglobs[extglobs.length - 1].inner += tok.value;
479
+ }
480
+
481
+ if (tok.value || tok.output) append(tok);
482
+ if (prev && prev.type === 'text' && tok.type === 'text') {
483
+ prev.output = (prev.output || prev.value) + tok.value;
484
+ prev.value += tok.value;
485
+ return;
486
+ }
487
+
488
+ tok.prev = prev;
489
+ tokens.push(tok);
490
+ prev = tok;
491
+ };
492
+
493
+ const extglobOpen = (type, value) => {
494
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
495
+
496
+ token.prev = prev;
497
+ token.parens = state.parens;
498
+ token.output = state.output;
499
+ token.startIndex = state.index;
500
+ token.tokensIndex = tokens.length;
501
+ const output = (opts.capture ? '(' : '') + token.open;
502
+
503
+ increment('parens');
504
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
505
+ push({ type: 'paren', extglob: true, value: advance(), output });
506
+ extglobs.push(token);
507
+ };
508
+
509
+ const extglobClose = token => {
510
+ const literal = input.slice(token.startIndex, state.index + 1);
511
+ const body = input.slice(token.startIndex + 2, state.index);
512
+ const analysis = analyzeRepeatedExtglob(body, opts);
513
+
514
+ if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
515
+ const safeOutput = analysis.safeOutput
516
+ ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
517
+ : undefined;
518
+ const open = tokens[token.tokensIndex];
519
+
520
+ open.type = 'text';
521
+ open.value = literal;
522
+ open.output = safeOutput || utils.escapeRegex(literal);
523
+
524
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
525
+ tokens[i].value = '';
526
+ tokens[i].output = '';
527
+ delete tokens[i].suffix;
528
+ }
529
+
530
+ state.output = token.output + open.output;
531
+ state.backtrack = true;
532
+
533
+ push({ type: 'paren', extglob: true, value, output: '' });
534
+ decrement('parens');
535
+ return;
536
+ }
537
+
538
+ let output = token.close + (opts.capture ? ')' : '');
539
+ let rest;
540
+
541
+ if (token.type === 'negate') {
542
+ let extglobStar = star;
543
+
544
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
545
+ extglobStar = globstar(opts);
546
+ }
547
+
548
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
549
+ output = token.close = `)$))${extglobStar}`;
550
+ }
551
+
552
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
553
+ // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
554
+ // In this case, we need to parse the string and use it in the output of the original pattern.
555
+ // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
556
+ //
557
+ // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
558
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
559
+
560
+ output = token.close = `)${expression})${extglobStar})`;
561
+ }
562
+
563
+ if (token.prev.type === 'bos') {
564
+ state.negatedExtglob = true;
565
+ }
566
+ }
567
+
568
+ push({ type: 'paren', extglob: true, value, output });
569
+ decrement('parens');
570
+ };
571
+
572
+ /**
573
+ * Fast paths
574
+ */
575
+
576
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
577
+ let backslashes = false;
578
+
579
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
580
+ if (first === '\\') {
581
+ backslashes = true;
582
+ return m;
583
+ }
584
+
585
+ if (first === '?') {
586
+ if (esc) {
587
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
588
+ }
589
+ if (index === 0) {
590
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
591
+ }
592
+ return QMARK.repeat(chars.length);
593
+ }
594
+
595
+ if (first === '.') {
596
+ return DOT_LITERAL.repeat(chars.length);
597
+ }
598
+
599
+ if (first === '*') {
600
+ if (esc) {
601
+ return esc + first + (rest ? star : '');
602
+ }
603
+ return star;
604
+ }
605
+ return esc ? m : `\\${m}`;
606
+ });
607
+
608
+ if (backslashes === true) {
609
+ if (opts.unescape === true) {
610
+ output = output.replace(/\\/g, '');
611
+ } else {
612
+ output = output.replace(/\\+/g, m => {
613
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
614
+ });
615
+ }
616
+ }
617
+
618
+ if (output === input && opts.contains === true) {
619
+ state.output = input;
620
+ return state;
621
+ }
622
+
623
+ state.output = utils.wrapOutput(output, state, options);
624
+ return state;
625
+ }
626
+
627
+ /**
628
+ * Tokenize input until we reach end-of-string
629
+ */
630
+
631
+ while (!eos()) {
632
+ value = advance();
633
+
634
+ if (value === '\u0000') {
635
+ continue;
636
+ }
637
+
638
+ /**
639
+ * Escaped characters
640
+ */
641
+
642
+ if (value === '\\') {
643
+ const next = peek();
644
+
645
+ if (next === '/' && opts.bash !== true) {
646
+ continue;
647
+ }
648
+
649
+ if (next === '.' || next === ';') {
650
+ continue;
651
+ }
652
+
653
+ if (!next) {
654
+ value += '\\';
655
+ push({ type: 'text', value });
656
+ continue;
657
+ }
658
+
659
+ // collapse slashes to reduce potential for exploits
660
+ const match = /^\\+/.exec(remaining());
661
+ let slashes = 0;
662
+
663
+ if (match && match[0].length > 2) {
664
+ slashes = match[0].length;
665
+ state.index += slashes;
666
+ if (slashes % 2 !== 0) {
667
+ value += '\\';
668
+ }
669
+ }
670
+
671
+ if (opts.unescape === true) {
672
+ value = advance();
673
+ } else {
674
+ value += advance();
675
+ }
676
+
677
+ if (state.brackets === 0) {
678
+ push({ type: 'text', value });
679
+ continue;
680
+ }
681
+ }
682
+
683
+ /**
684
+ * If we're inside a regex character class, continue
685
+ * until we reach the closing bracket.
686
+ */
687
+
688
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
689
+ if (opts.posix !== false && value === ':') {
690
+ const inner = prev.value.slice(1);
691
+ if (inner.includes('[')) {
692
+ prev.posix = true;
693
+
694
+ if (inner.includes(':')) {
695
+ const idx = prev.value.lastIndexOf('[');
696
+ const pre = prev.value.slice(0, idx);
697
+ const rest = prev.value.slice(idx + 2);
698
+ const posix = POSIX_REGEX_SOURCE[rest];
699
+ if (posix) {
700
+ prev.value = pre + posix;
701
+ state.backtrack = true;
702
+ advance();
703
+
704
+ if (!bos.output && tokens.indexOf(prev) === 1) {
705
+ bos.output = ONE_CHAR;
706
+ }
707
+ continue;
708
+ }
709
+ }
710
+ }
711
+ }
712
+
713
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
714
+ value = `\\${value}`;
715
+ }
716
+
717
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
718
+ value = `\\${value}`;
719
+ }
720
+
721
+ if (opts.posix === true && value === '!' && prev.value === '[') {
722
+ value = '^';
723
+ }
724
+
725
+ prev.value += value;
726
+ append({ value });
727
+ continue;
728
+ }
729
+
730
+ /**
731
+ * If we're inside a quoted string, continue
732
+ * until we reach the closing double quote.
733
+ */
734
+
735
+ if (state.quotes === 1 && value !== '"') {
736
+ value = utils.escapeRegex(value);
737
+ prev.value += value;
738
+ append({ value });
739
+ continue;
740
+ }
741
+
742
+ /**
743
+ * Double quotes
744
+ */
745
+
746
+ if (value === '"') {
747
+ state.quotes = state.quotes === 1 ? 0 : 1;
748
+ if (opts.keepQuotes === true) {
749
+ push({ type: 'text', value });
750
+ }
751
+ continue;
752
+ }
753
+
754
+ /**
755
+ * Parentheses
756
+ */
757
+
758
+ if (value === '(') {
759
+ increment('parens');
760
+ push({ type: 'paren', value });
761
+ continue;
762
+ }
763
+
764
+ if (value === ')') {
765
+ if (state.parens === 0 && opts.strictBrackets === true) {
766
+ throw new SyntaxError(syntaxError('opening', '('));
767
+ }
768
+
769
+ const extglob = extglobs[extglobs.length - 1];
770
+ if (extglob && state.parens === extglob.parens + 1) {
771
+ extglobClose(extglobs.pop());
772
+ continue;
773
+ }
774
+
775
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
776
+ decrement('parens');
777
+ continue;
778
+ }
779
+
780
+ /**
781
+ * Square brackets
782
+ */
783
+
784
+ if (value === '[') {
785
+ if (opts.nobracket === true || !remaining().includes(']')) {
786
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
787
+ throw new SyntaxError(syntaxError('closing', ']'));
788
+ }
789
+
790
+ value = `\\${value}`;
791
+ } else {
792
+ increment('brackets');
793
+ }
794
+
795
+ push({ type: 'bracket', value });
796
+ continue;
797
+ }
798
+
799
+ if (value === ']') {
800
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
801
+ push({ type: 'text', value, output: `\\${value}` });
802
+ continue;
803
+ }
804
+
805
+ if (state.brackets === 0) {
806
+ if (opts.strictBrackets === true) {
807
+ throw new SyntaxError(syntaxError('opening', '['));
808
+ }
809
+
810
+ push({ type: 'text', value, output: `\\${value}` });
811
+ continue;
812
+ }
813
+
814
+ decrement('brackets');
815
+
816
+ const prevValue = prev.value.slice(1);
817
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
818
+ value = `/${value}`;
819
+ }
820
+
821
+ prev.value += value;
822
+ append({ value });
823
+
824
+ // when literal brackets are explicitly disabled
825
+ // assume we should match with a regex character class
826
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
827
+ continue;
828
+ }
829
+
830
+ const escaped = utils.escapeRegex(prev.value);
831
+ state.output = state.output.slice(0, -prev.value.length);
832
+
833
+ // when literal brackets are explicitly enabled
834
+ // assume we should escape the brackets to match literal characters
835
+ if (opts.literalBrackets === true) {
836
+ state.output += escaped;
837
+ prev.value = escaped;
838
+ continue;
839
+ }
840
+
841
+ // when the user specifies nothing, try to match both
842
+ prev.value = `(${capture}${escaped}|${prev.value})`;
843
+ state.output += prev.value;
844
+ continue;
845
+ }
846
+
847
+ /**
848
+ * Braces
849
+ */
850
+
851
+ if (value === '{' && opts.nobrace !== true) {
852
+ increment('braces');
853
+
854
+ const open = {
855
+ type: 'brace',
856
+ value,
857
+ output: '(',
858
+ outputIndex: state.output.length,
859
+ tokensIndex: state.tokens.length
860
+ };
861
+
862
+ braces.push(open);
863
+ push(open);
864
+ continue;
865
+ }
866
+
867
+ if (value === '}') {
868
+ const brace = braces[braces.length - 1];
869
+
870
+ if (opts.nobrace === true || !brace) {
871
+ push({ type: 'text', value, output: value });
872
+ continue;
873
+ }
874
+
875
+ let output = ')';
876
+
877
+ if (brace.dots === true) {
878
+ const arr = tokens.slice();
879
+ const range = [];
880
+
881
+ for (let i = arr.length - 1; i >= 0; i--) {
882
+ tokens.pop();
883
+ if (arr[i].type === 'brace') {
884
+ break;
885
+ }
886
+ if (arr[i].type !== 'dots') {
887
+ range.unshift(arr[i].value);
888
+ }
889
+ }
890
+
891
+ output = expandRange(range, opts);
892
+ state.backtrack = true;
893
+ }
894
+
895
+ if (brace.comma !== true && brace.dots !== true) {
896
+ const out = state.output.slice(0, brace.outputIndex);
897
+ const toks = state.tokens.slice(brace.tokensIndex);
898
+ brace.value = brace.output = '\\{';
899
+ value = output = '\\}';
900
+ state.output = out;
901
+ for (const t of toks) {
902
+ state.output += (t.output || t.value);
903
+ }
904
+ }
905
+
906
+ push({ type: 'brace', value, output });
907
+ decrement('braces');
908
+ braces.pop();
909
+ continue;
910
+ }
911
+
912
+ /**
913
+ * Pipes
914
+ */
915
+
916
+ if (value === '|') {
917
+ if (extglobs.length > 0) {
918
+ extglobs[extglobs.length - 1].conditions++;
919
+ }
920
+ push({ type: 'text', value });
921
+ continue;
922
+ }
923
+
924
+ /**
925
+ * Commas
926
+ */
927
+
928
+ if (value === ',') {
929
+ let output = value;
930
+
931
+ const brace = braces[braces.length - 1];
932
+ if (brace && stack[stack.length - 1] === 'braces') {
933
+ brace.comma = true;
934
+ output = '|';
935
+ }
936
+
937
+ push({ type: 'comma', value, output });
938
+ continue;
939
+ }
940
+
941
+ /**
942
+ * Slashes
943
+ */
944
+
945
+ if (value === '/') {
946
+ // if the beginning of the glob is "./", advance the start
947
+ // to the current index, and don't add the "./" characters
948
+ // to the state. This greatly simplifies lookbehinds when
949
+ // checking for BOS characters like "!" and "." (not "./")
950
+ if (prev.type === 'dot' && state.index === state.start + 1) {
951
+ state.start = state.index + 1;
952
+ state.consumed = '';
953
+ state.output = '';
954
+ tokens.pop();
955
+ prev = bos; // reset "prev" to the first token
956
+ continue;
957
+ }
958
+
959
+ push({ type: 'slash', value, output: SLASH_LITERAL });
960
+ continue;
961
+ }
962
+
963
+ /**
964
+ * Dots
965
+ */
966
+
967
+ if (value === '.') {
968
+ if (state.braces > 0 && prev.type === 'dot') {
969
+ if (prev.value === '.') prev.output = DOT_LITERAL;
970
+ const brace = braces[braces.length - 1];
971
+ prev.type = 'dots';
972
+ prev.output += value;
973
+ prev.value += value;
974
+ brace.dots = true;
975
+ continue;
976
+ }
977
+
978
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
979
+ push({ type: 'text', value, output: DOT_LITERAL });
980
+ continue;
981
+ }
982
+
983
+ push({ type: 'dot', value, output: DOT_LITERAL });
984
+ continue;
985
+ }
986
+
987
+ /**
988
+ * Question marks
989
+ */
990
+
991
+ if (value === '?') {
992
+ const isGroup = prev && prev.value === '(';
993
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
994
+ extglobOpen('qmark', value);
995
+ continue;
996
+ }
997
+
998
+ if (prev && prev.type === 'paren') {
999
+ const next = peek();
1000
+ let output = value;
1001
+
1002
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
1003
+ output = `\\${value}`;
1004
+ }
1005
+
1006
+ push({ type: 'text', value, output });
1007
+ continue;
1008
+ }
1009
+
1010
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
1011
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
1012
+ continue;
1013
+ }
1014
+
1015
+ push({ type: 'qmark', value, output: QMARK });
1016
+ continue;
1017
+ }
1018
+
1019
+ /**
1020
+ * Exclamation
1021
+ */
1022
+
1023
+ if (value === '!') {
1024
+ if (opts.noextglob !== true && peek() === '(') {
1025
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
1026
+ extglobOpen('negate', value);
1027
+ continue;
1028
+ }
1029
+ }
1030
+
1031
+ if (opts.nonegate !== true && state.index === 0) {
1032
+ negate();
1033
+ continue;
1034
+ }
1035
+ }
1036
+
1037
+ /**
1038
+ * Plus
1039
+ */
1040
+
1041
+ if (value === '+') {
1042
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1043
+ extglobOpen('plus', value);
1044
+ continue;
1045
+ }
1046
+
1047
+ if ((prev && prev.value === '(') || opts.regex === false) {
1048
+ push({ type: 'plus', value, output: PLUS_LITERAL });
1049
+ continue;
1050
+ }
1051
+
1052
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
1053
+ push({ type: 'plus', value });
1054
+ continue;
1055
+ }
1056
+
1057
+ push({ type: 'plus', value: PLUS_LITERAL });
1058
+ continue;
1059
+ }
1060
+
1061
+ /**
1062
+ * Plain text
1063
+ */
1064
+
1065
+ if (value === '@') {
1066
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
1067
+ push({ type: 'at', extglob: true, value, output: '' });
1068
+ continue;
1069
+ }
1070
+
1071
+ push({ type: 'text', value });
1072
+ continue;
1073
+ }
1074
+
1075
+ /**
1076
+ * Plain text
1077
+ */
1078
+
1079
+ if (value !== '*') {
1080
+ if (value === '$' || value === '^') {
1081
+ value = `\\${value}`;
1082
+ }
1083
+
1084
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
1085
+ if (match) {
1086
+ value += match[0];
1087
+ state.index += match[0].length;
1088
+ }
1089
+
1090
+ push({ type: 'text', value });
1091
+ continue;
1092
+ }
1093
+
1094
+ /**
1095
+ * Stars
1096
+ */
1097
+
1098
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
1099
+ prev.type = 'star';
1100
+ prev.star = true;
1101
+ prev.value += value;
1102
+ prev.output = star;
1103
+ state.backtrack = true;
1104
+ state.globstar = true;
1105
+ consume(value);
1106
+ continue;
1107
+ }
1108
+
1109
+ let rest = remaining();
1110
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
1111
+ extglobOpen('star', value);
1112
+ continue;
1113
+ }
1114
+
1115
+ if (prev.type === 'star') {
1116
+ if (opts.noglobstar === true) {
1117
+ consume(value);
1118
+ continue;
1119
+ }
1120
+
1121
+ const prior = prev.prev;
1122
+ const before = prior.prev;
1123
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
1124
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
1125
+
1126
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
1127
+ push({ type: 'star', value, output: '' });
1128
+ continue;
1129
+ }
1130
+
1131
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
1132
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
1133
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
1134
+ push({ type: 'star', value, output: '' });
1135
+ continue;
1136
+ }
1137
+
1138
+ // strip consecutive `/**/`
1139
+ while (rest.slice(0, 3) === '/**') {
1140
+ const after = input[state.index + 4];
1141
+ if (after && after !== '/') {
1142
+ break;
1143
+ }
1144
+ rest = rest.slice(3);
1145
+ consume('/**', 3);
1146
+ }
1147
+
1148
+ if (prior.type === 'bos' && eos()) {
1149
+ prev.type = 'globstar';
1150
+ prev.value += value;
1151
+ prev.output = globstar(opts);
1152
+ state.output = prev.output;
1153
+ state.globstar = true;
1154
+ consume(value);
1155
+ continue;
1156
+ }
1157
+
1158
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
1159
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1160
+ prior.output = `(?:${prior.output}`;
1161
+
1162
+ prev.type = 'globstar';
1163
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
1164
+ prev.value += value;
1165
+ state.globstar = true;
1166
+ state.output += prior.output + prev.output;
1167
+ consume(value);
1168
+ continue;
1169
+ }
1170
+
1171
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
1172
+ const end = rest[1] !== void 0 ? '|$' : '';
1173
+
1174
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
1175
+ prior.output = `(?:${prior.output}`;
1176
+
1177
+ prev.type = 'globstar';
1178
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
1179
+ prev.value += value;
1180
+
1181
+ state.output += prior.output + prev.output;
1182
+ state.globstar = true;
1183
+
1184
+ consume(value + advance());
1185
+
1186
+ push({ type: 'slash', value: '/', output: '' });
1187
+ continue;
1188
+ }
1189
+
1190
+ if (prior.type === 'bos' && rest[0] === '/') {
1191
+ prev.type = 'globstar';
1192
+ prev.value += value;
1193
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
1194
+ state.output = prev.output;
1195
+ state.globstar = true;
1196
+ consume(value + advance());
1197
+ push({ type: 'slash', value: '/', output: '' });
1198
+ continue;
1199
+ }
1200
+
1201
+ // remove single star from output
1202
+ state.output = state.output.slice(0, -prev.output.length);
1203
+
1204
+ // reset previous token to globstar
1205
+ prev.type = 'globstar';
1206
+ prev.output = globstar(opts);
1207
+ prev.value += value;
1208
+
1209
+ // reset output with globstar
1210
+ state.output += prev.output;
1211
+ state.globstar = true;
1212
+ consume(value);
1213
+ continue;
1214
+ }
1215
+
1216
+ const token = { type: 'star', value, output: star };
1217
+
1218
+ if (opts.bash === true) {
1219
+ token.output = '.*?';
1220
+ if (prev.type === 'bos' || prev.type === 'slash') {
1221
+ token.output = nodot + token.output;
1222
+ }
1223
+ push(token);
1224
+ continue;
1225
+ }
1226
+
1227
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
1228
+ token.output = value;
1229
+ push(token);
1230
+ continue;
1231
+ }
1232
+
1233
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
1234
+ if (prev.type === 'dot') {
1235
+ state.output += NO_DOT_SLASH;
1236
+ prev.output += NO_DOT_SLASH;
1237
+
1238
+ } else if (opts.dot === true) {
1239
+ state.output += NO_DOTS_SLASH;
1240
+ prev.output += NO_DOTS_SLASH;
1241
+
1242
+ } else {
1243
+ state.output += nodot;
1244
+ prev.output += nodot;
1245
+ }
1246
+
1247
+ if (peek() !== '*') {
1248
+ state.output += ONE_CHAR;
1249
+ prev.output += ONE_CHAR;
1250
+ }
1251
+ }
1252
+
1253
+ push(token);
1254
+ }
1255
+
1256
+ while (state.brackets > 0) {
1257
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
1258
+ state.output = utils.escapeLast(state.output, '[');
1259
+ decrement('brackets');
1260
+ }
1261
+
1262
+ while (state.parens > 0) {
1263
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
1264
+ state.output = utils.escapeLast(state.output, '(');
1265
+ decrement('parens');
1266
+ }
1267
+
1268
+ while (state.braces > 0) {
1269
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
1270
+ state.output = utils.escapeLast(state.output, '{');
1271
+ decrement('braces');
1272
+ }
1273
+
1274
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
1275
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
1276
+ }
1277
+
1278
+ // rebuild the output if we had to backtrack at any point
1279
+ if (state.backtrack === true) {
1280
+ state.output = '';
1281
+
1282
+ for (const token of state.tokens) {
1283
+ state.output += token.output != null ? token.output : token.value;
1284
+
1285
+ if (token.suffix) {
1286
+ state.output += token.suffix;
1287
+ }
1288
+ }
1289
+ }
1290
+
1291
+ return state;
1292
+ };
1293
+
1294
+ /**
1295
+ * Fast paths for creating regular expressions for common glob patterns.
1296
+ * This can significantly speed up processing and has very little downside
1297
+ * impact when none of the fast paths match.
1298
+ */
1299
+
1300
+ parse.fastpaths = (input, options) => {
1301
+ const opts = { ...options };
1302
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
1303
+ const len = input.length;
1304
+ if (len > max) {
1305
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
1306
+ }
1307
+
1308
+ input = REPLACEMENTS[input] || input;
1309
+
1310
+ // create constants based on platform, for windows or posix
1311
+ const {
1312
+ DOT_LITERAL,
1313
+ SLASH_LITERAL,
1314
+ ONE_CHAR,
1315
+ DOTS_SLASH,
1316
+ NO_DOT,
1317
+ NO_DOTS,
1318
+ NO_DOTS_SLASH,
1319
+ STAR,
1320
+ START_ANCHOR
1321
+ } = constants.globChars(opts.windows);
1322
+
1323
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
1324
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
1325
+ const capture = opts.capture ? '' : '?:';
1326
+ const state = { negated: false, prefix: '' };
1327
+ let star = opts.bash === true ? '.*?' : STAR;
1328
+
1329
+ if (opts.capture) {
1330
+ star = `(${star})`;
1331
+ }
1332
+
1333
+ const globstar = opts => {
1334
+ if (opts.noglobstar === true) return star;
1335
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1336
+ };
1337
+
1338
+ const create = str => {
1339
+ switch (str) {
1340
+ case '*':
1341
+ return `${nodot}${ONE_CHAR}${star}`;
1342
+
1343
+ case '.*':
1344
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
1345
+
1346
+ case '*.*':
1347
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1348
+
1349
+ case '*/*':
1350
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
1351
+
1352
+ case '**':
1353
+ return nodot + globstar(opts);
1354
+
1355
+ case '**/*':
1356
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
1357
+
1358
+ case '**/*.*':
1359
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
1360
+
1361
+ case '**/.*':
1362
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
1363
+
1364
+ default: {
1365
+ const match = /^(.*?)\.(\w+)$/.exec(str);
1366
+ if (!match) return;
1367
+
1368
+ const source = create(match[1]);
1369
+ if (!source) return;
1370
+
1371
+ return source + DOT_LITERAL + match[2];
1372
+ }
1373
+ }
1374
+ };
1375
+
1376
+ const output = utils.removePrefix(input, state);
1377
+ let source = create(output);
1378
+
1379
+ if (source && opts.strictSlashes !== true) {
1380
+ source += `${SLASH_LITERAL}?`;
1381
+ }
1382
+
1383
+ return source;
1384
+ };
1385
+
1386
+ module.exports = parse;