@pnpm/exe 11.9.0 → 12.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/{dist/node_modules/v8-compile-cache/LICENSE → LICENSE} +2 -1
  2. package/README.md +259 -12
  3. package/install.js +175 -0
  4. package/package.json +30 -59
  5. package/pnpm +4 -1
  6. package/dist/node-gyp-bin/node-gyp +0 -6
  7. package/dist/node-gyp-bin/node-gyp.cmd +0 -5
  8. package/dist/node_modules/.package-map.json +0 -1
  9. package/dist/node_modules/@isaacs/fs-minipass/LICENSE +0 -15
  10. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +0 -430
  11. package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +0 -3
  12. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +0 -420
  13. package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +0 -3
  14. package/dist/node_modules/@isaacs/fs-minipass/package.json +0 -72
  15. package/dist/node_modules/abbrev/LICENSE +0 -46
  16. package/dist/node_modules/abbrev/lib/index.js +0 -53
  17. package/dist/node_modules/abbrev/package.json +0 -41
  18. package/dist/node_modules/chownr/dist/commonjs/index.js +0 -93
  19. package/dist/node_modules/chownr/dist/commonjs/package.json +0 -3
  20. package/dist/node_modules/chownr/dist/esm/index.js +0 -85
  21. package/dist/node_modules/chownr/dist/esm/package.json +0 -3
  22. package/dist/node_modules/chownr/package.json +0 -69
  23. package/dist/node_modules/env-paths/index.js +0 -74
  24. package/dist/node_modules/env-paths/license +0 -9
  25. package/dist/node_modules/env-paths/package.json +0 -45
  26. package/dist/node_modules/exponential-backoff/LICENSE +0 -202
  27. package/dist/node_modules/exponential-backoff/dist/backoff.js +0 -124
  28. package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +0 -25
  29. package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +0 -45
  30. package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +0 -17
  31. package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +0 -3
  32. package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +0 -82
  33. package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +0 -8
  34. package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +0 -15
  35. package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +0 -7
  36. package/dist/node_modules/exponential-backoff/dist/options.js +0 -31
  37. package/dist/node_modules/exponential-backoff/package.json +0 -62
  38. package/dist/node_modules/fdir/LICENSE +0 -7
  39. package/dist/node_modules/fdir/dist/index.cjs +0 -588
  40. package/dist/node_modules/fdir/dist/index.d.cts +0 -155
  41. package/dist/node_modules/fdir/dist/index.d.mts +0 -155
  42. package/dist/node_modules/fdir/dist/index.mjs +0 -570
  43. package/dist/node_modules/fdir/package.json +0 -103
  44. package/dist/node_modules/graceful-fs/LICENSE +0 -15
  45. package/dist/node_modules/graceful-fs/clone.js +0 -23
  46. package/dist/node_modules/graceful-fs/graceful-fs.js +0 -448
  47. package/dist/node_modules/graceful-fs/legacy-streams.js +0 -118
  48. package/dist/node_modules/graceful-fs/package.json +0 -53
  49. package/dist/node_modules/graceful-fs/polyfills.js +0 -355
  50. package/dist/node_modules/isexe/dist/commonjs/index.js +0 -56
  51. package/dist/node_modules/isexe/dist/commonjs/index.min.js +0 -2
  52. package/dist/node_modules/isexe/dist/commonjs/options.js +0 -3
  53. package/dist/node_modules/isexe/dist/commonjs/package.json +0 -3
  54. package/dist/node_modules/isexe/dist/commonjs/posix.js +0 -67
  55. package/dist/node_modules/isexe/dist/commonjs/win32.js +0 -63
  56. package/dist/node_modules/isexe/dist/esm/index.js +0 -16
  57. package/dist/node_modules/isexe/dist/esm/index.min.js +0 -2
  58. package/dist/node_modules/isexe/dist/esm/options.js +0 -2
  59. package/dist/node_modules/isexe/dist/esm/package.json +0 -3
  60. package/dist/node_modules/isexe/dist/esm/posix.js +0 -62
  61. package/dist/node_modules/isexe/dist/esm/win32.js +0 -58
  62. package/dist/node_modules/isexe/package.json +0 -78
  63. package/dist/node_modules/minipass/dist/commonjs/index.js +0 -1038
  64. package/dist/node_modules/minipass/dist/commonjs/package.json +0 -3
  65. package/dist/node_modules/minipass/dist/esm/index.js +0 -1020
  66. package/dist/node_modules/minipass/dist/esm/package.json +0 -3
  67. package/dist/node_modules/minipass/package.json +0 -77
  68. package/dist/node_modules/minizlib/LICENSE +0 -26
  69. package/dist/node_modules/minizlib/dist/commonjs/constants.js +0 -123
  70. package/dist/node_modules/minizlib/dist/commonjs/index.js +0 -416
  71. package/dist/node_modules/minizlib/dist/commonjs/package.json +0 -3
  72. package/dist/node_modules/minizlib/dist/esm/constants.js +0 -117
  73. package/dist/node_modules/minizlib/dist/esm/index.js +0 -363
  74. package/dist/node_modules/minizlib/dist/esm/package.json +0 -3
  75. package/dist/node_modules/minizlib/package.json +0 -80
  76. package/dist/node_modules/node-gyp/.release-please-manifest.json +0 -3
  77. package/dist/node_modules/node-gyp/LICENSE +0 -24
  78. package/dist/node_modules/node-gyp/addon.gypi +0 -204
  79. package/dist/node_modules/node-gyp/bin/node-gyp.js +0 -145
  80. package/dist/node_modules/node-gyp/eslint.config.js +0 -3
  81. package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +0 -3
  82. package/dist/node_modules/node-gyp/gyp/LICENSE +0 -28
  83. package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +0 -4
  84. package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
  85. package/dist/node_modules/node-gyp/gyp/gyp +0 -8
  86. package/dist/node_modules/node-gyp/gyp/gyp.bat +0 -5
  87. package/dist/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  88. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
  89. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  90. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1283
  91. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1545
  92. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  93. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
  94. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
  95. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -607
  96. package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -706
  97. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -725
  98. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -186
  99. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -170
  100. package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
  101. package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  102. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  103. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
  104. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1169
  105. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1316
  106. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
  107. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
  108. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -461
  109. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -88
  110. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -55
  111. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2755
  112. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3970
  113. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  114. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2957
  115. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -77
  116. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1389
  117. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
  118. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3097
  119. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
  120. package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -765
  121. package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1255
  122. package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  123. package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  124. package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -371
  125. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1936
  126. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
  127. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -301
  128. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3180
  129. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -64
  130. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
  131. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
  132. package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
  133. package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
  134. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +0 -107
  135. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
  136. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
  137. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
  138. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
  139. package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
  140. package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +0 -251
  141. package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +0 -807
  142. package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  143. package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
  144. package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
  145. package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +0 -541
  146. package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +0 -172
  147. package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +0 -563
  148. package/dist/node_modules/node-gyp/gyp/pyproject.toml +0 -116
  149. package/dist/node_modules/node-gyp/gyp/release-please-config.json +0 -11
  150. package/dist/node_modules/node-gyp/gyp/test_gyp.py +0 -260
  151. package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +0 -250
  152. package/dist/node_modules/node-gyp/lib/build.js +0 -230
  153. package/dist/node_modules/node-gyp/lib/clean.js +0 -15
  154. package/dist/node_modules/node-gyp/lib/configure.js +0 -328
  155. package/dist/node_modules/node-gyp/lib/create-config-gypi.js +0 -153
  156. package/dist/node_modules/node-gyp/lib/download.js +0 -86
  157. package/dist/node_modules/node-gyp/lib/find-node-directory.js +0 -63
  158. package/dist/node_modules/node-gyp/lib/find-python.js +0 -304
  159. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +0 -606
  160. package/dist/node_modules/node-gyp/lib/install.js +0 -411
  161. package/dist/node_modules/node-gyp/lib/list.js +0 -26
  162. package/dist/node_modules/node-gyp/lib/log.js +0 -168
  163. package/dist/node_modules/node-gyp/lib/node-gyp.js +0 -199
  164. package/dist/node_modules/node-gyp/lib/process-release.js +0 -144
  165. package/dist/node_modules/node-gyp/lib/rebuild.js +0 -12
  166. package/dist/node_modules/node-gyp/lib/remove.js +0 -43
  167. package/dist/node_modules/node-gyp/lib/util.js +0 -81
  168. package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +0 -21
  169. package/dist/node_modules/node-gyp/package.json +0 -52
  170. package/dist/node_modules/node-gyp/release-please-config.json +0 -40
  171. package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +0 -41
  172. package/dist/node_modules/nopt/LICENSE +0 -15
  173. package/dist/node_modules/nopt/bin/nopt.js +0 -29
  174. package/dist/node_modules/nopt/lib/debug.js +0 -5
  175. package/dist/node_modules/nopt/lib/nopt-lib.js +0 -514
  176. package/dist/node_modules/nopt/lib/nopt.js +0 -34
  177. package/dist/node_modules/nopt/lib/type-defs.js +0 -91
  178. package/dist/node_modules/nopt/package.json +0 -52
  179. package/dist/node_modules/picomatch/LICENSE +0 -21
  180. package/dist/node_modules/picomatch/index.js +0 -17
  181. package/dist/node_modules/picomatch/lib/constants.js +0 -184
  182. package/dist/node_modules/picomatch/lib/parse.js +0 -1386
  183. package/dist/node_modules/picomatch/lib/picomatch.js +0 -349
  184. package/dist/node_modules/picomatch/lib/scan.js +0 -391
  185. package/dist/node_modules/picomatch/lib/utils.js +0 -72
  186. package/dist/node_modules/picomatch/package.json +0 -82
  187. package/dist/node_modules/picomatch/posix.js +0 -3
  188. package/dist/node_modules/proc-log/LICENSE +0 -15
  189. package/dist/node_modules/proc-log/lib/index.js +0 -158
  190. package/dist/node_modules/proc-log/package.json +0 -46
  191. package/dist/node_modules/semver/LICENSE +0 -15
  192. package/dist/node_modules/semver/bin/semver.js +0 -195
  193. package/dist/node_modules/semver/classes/comparator.js +0 -143
  194. package/dist/node_modules/semver/classes/index.js +0 -7
  195. package/dist/node_modules/semver/classes/range.js +0 -577
  196. package/dist/node_modules/semver/classes/semver.js +0 -350
  197. package/dist/node_modules/semver/functions/clean.js +0 -8
  198. package/dist/node_modules/semver/functions/cmp.js +0 -54
  199. package/dist/node_modules/semver/functions/coerce.js +0 -62
  200. package/dist/node_modules/semver/functions/compare-build.js +0 -9
  201. package/dist/node_modules/semver/functions/compare-loose.js +0 -5
  202. package/dist/node_modules/semver/functions/compare.js +0 -7
  203. package/dist/node_modules/semver/functions/diff.js +0 -60
  204. package/dist/node_modules/semver/functions/eq.js +0 -5
  205. package/dist/node_modules/semver/functions/gt.js +0 -5
  206. package/dist/node_modules/semver/functions/gte.js +0 -5
  207. package/dist/node_modules/semver/functions/inc.js +0 -21
  208. package/dist/node_modules/semver/functions/lt.js +0 -5
  209. package/dist/node_modules/semver/functions/lte.js +0 -5
  210. package/dist/node_modules/semver/functions/major.js +0 -5
  211. package/dist/node_modules/semver/functions/minor.js +0 -5
  212. package/dist/node_modules/semver/functions/neq.js +0 -5
  213. package/dist/node_modules/semver/functions/parse.js +0 -18
  214. package/dist/node_modules/semver/functions/patch.js +0 -5
  215. package/dist/node_modules/semver/functions/prerelease.js +0 -8
  216. package/dist/node_modules/semver/functions/rcompare.js +0 -5
  217. package/dist/node_modules/semver/functions/rsort.js +0 -5
  218. package/dist/node_modules/semver/functions/satisfies.js +0 -12
  219. package/dist/node_modules/semver/functions/sort.js +0 -5
  220. package/dist/node_modules/semver/functions/truncate.js +0 -48
  221. package/dist/node_modules/semver/functions/valid.js +0 -8
  222. package/dist/node_modules/semver/index.js +0 -93
  223. package/dist/node_modules/semver/internal/constants.js +0 -37
  224. package/dist/node_modules/semver/internal/debug.js +0 -11
  225. package/dist/node_modules/semver/internal/identifiers.js +0 -29
  226. package/dist/node_modules/semver/internal/lrucache.js +0 -42
  227. package/dist/node_modules/semver/internal/parse-options.js +0 -17
  228. package/dist/node_modules/semver/internal/re.js +0 -223
  229. package/dist/node_modules/semver/package.json +0 -78
  230. package/dist/node_modules/semver/preload.js +0 -4
  231. package/dist/node_modules/semver/range.bnf +0 -17
  232. package/dist/node_modules/semver/ranges/gtr.js +0 -6
  233. package/dist/node_modules/semver/ranges/intersects.js +0 -9
  234. package/dist/node_modules/semver/ranges/ltr.js +0 -6
  235. package/dist/node_modules/semver/ranges/max-satisfying.js +0 -27
  236. package/dist/node_modules/semver/ranges/min-satisfying.js +0 -26
  237. package/dist/node_modules/semver/ranges/min-version.js +0 -63
  238. package/dist/node_modules/semver/ranges/outside.js +0 -82
  239. package/dist/node_modules/semver/ranges/simplify.js +0 -49
  240. package/dist/node_modules/semver/ranges/subset.js +0 -249
  241. package/dist/node_modules/semver/ranges/to-comparators.js +0 -10
  242. package/dist/node_modules/semver/ranges/valid.js +0 -13
  243. package/dist/node_modules/tar/dist/commonjs/create.js +0 -82
  244. package/dist/node_modules/tar/dist/commonjs/cwd-error.js +0 -18
  245. package/dist/node_modules/tar/dist/commonjs/extract.js +0 -88
  246. package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +0 -32
  247. package/dist/node_modules/tar/dist/commonjs/header.js +0 -347
  248. package/dist/node_modules/tar/dist/commonjs/index.js +0 -64
  249. package/dist/node_modules/tar/dist/commonjs/index.min.js +0 -4
  250. package/dist/node_modules/tar/dist/commonjs/large-numbers.js +0 -99
  251. package/dist/node_modules/tar/dist/commonjs/list.js +0 -145
  252. package/dist/node_modules/tar/dist/commonjs/make-command.js +0 -52
  253. package/dist/node_modules/tar/dist/commonjs/mkdir.js +0 -187
  254. package/dist/node_modules/tar/dist/commonjs/mode-fix.js +0 -29
  255. package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +0 -38
  256. package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +0 -12
  257. package/dist/node_modules/tar/dist/commonjs/options.js +0 -66
  258. package/dist/node_modules/tar/dist/commonjs/pack.js +0 -544
  259. package/dist/node_modules/tar/dist/commonjs/package.json +0 -3
  260. package/dist/node_modules/tar/dist/commonjs/parse.js +0 -610
  261. package/dist/node_modules/tar/dist/commonjs/path-reservations.js +0 -170
  262. package/dist/node_modules/tar/dist/commonjs/pax.js +0 -158
  263. package/dist/node_modules/tar/dist/commonjs/process-umask.js +0 -7
  264. package/dist/node_modules/tar/dist/commonjs/read-entry.js +0 -136
  265. package/dist/node_modules/tar/dist/commonjs/replace.js +0 -227
  266. package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +0 -29
  267. package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +0 -18
  268. package/dist/node_modules/tar/dist/commonjs/symlink-error.js +0 -19
  269. package/dist/node_modules/tar/dist/commonjs/types.js +0 -70
  270. package/dist/node_modules/tar/dist/commonjs/unpack.js +0 -932
  271. package/dist/node_modules/tar/dist/commonjs/update.js +0 -33
  272. package/dist/node_modules/tar/dist/commonjs/warn-method.js +0 -31
  273. package/dist/node_modules/tar/dist/commonjs/winchars.js +0 -14
  274. package/dist/node_modules/tar/dist/commonjs/write-entry.js +0 -698
  275. package/dist/node_modules/tar/dist/esm/create.js +0 -76
  276. package/dist/node_modules/tar/dist/esm/cwd-error.js +0 -14
  277. package/dist/node_modules/tar/dist/esm/extract.js +0 -49
  278. package/dist/node_modules/tar/dist/esm/get-write-flag.js +0 -26
  279. package/dist/node_modules/tar/dist/esm/header.js +0 -310
  280. package/dist/node_modules/tar/dist/esm/index.js +0 -20
  281. package/dist/node_modules/tar/dist/esm/index.min.js +0 -4
  282. package/dist/node_modules/tar/dist/esm/large-numbers.js +0 -94
  283. package/dist/node_modules/tar/dist/esm/list.js +0 -105
  284. package/dist/node_modules/tar/dist/esm/make-command.js +0 -48
  285. package/dist/node_modules/tar/dist/esm/mkdir.js +0 -179
  286. package/dist/node_modules/tar/dist/esm/mode-fix.js +0 -25
  287. package/dist/node_modules/tar/dist/esm/normalize-unicode.js +0 -34
  288. package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +0 -9
  289. package/dist/node_modules/tar/dist/esm/options.js +0 -54
  290. package/dist/node_modules/tar/dist/esm/pack.js +0 -502
  291. package/dist/node_modules/tar/dist/esm/package.json +0 -3
  292. package/dist/node_modules/tar/dist/esm/parse.js +0 -606
  293. package/dist/node_modules/tar/dist/esm/path-reservations.js +0 -166
  294. package/dist/node_modules/tar/dist/esm/pax.js +0 -154
  295. package/dist/node_modules/tar/dist/esm/process-umask.js +0 -3
  296. package/dist/node_modules/tar/dist/esm/read-entry.js +0 -132
  297. package/dist/node_modules/tar/dist/esm/replace.js +0 -221
  298. package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +0 -25
  299. package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +0 -14
  300. package/dist/node_modules/tar/dist/esm/symlink-error.js +0 -15
  301. package/dist/node_modules/tar/dist/esm/types.js +0 -65
  302. package/dist/node_modules/tar/dist/esm/unpack.js +0 -891
  303. package/dist/node_modules/tar/dist/esm/update.js +0 -30
  304. package/dist/node_modules/tar/dist/esm/warn-method.js +0 -27
  305. package/dist/node_modules/tar/dist/esm/winchars.js +0 -9
  306. package/dist/node_modules/tar/dist/esm/write-entry.js +0 -656
  307. package/dist/node_modules/tar/package.json +0 -298
  308. package/dist/node_modules/tinyglobby/LICENSE +0 -21
  309. package/dist/node_modules/tinyglobby/dist/index.cjs +0 -335
  310. package/dist/node_modules/tinyglobby/dist/index.d.cts +0 -148
  311. package/dist/node_modules/tinyglobby/dist/index.d.mts +0 -148
  312. package/dist/node_modules/tinyglobby/dist/index.mjs +0 -307
  313. package/dist/node_modules/tinyglobby/package.json +0 -70
  314. package/dist/node_modules/undici/LICENSE +0 -21
  315. package/dist/node_modules/undici/index-fetch.js +0 -35
  316. package/dist/node_modules/undici/index.js +0 -169
  317. package/dist/node_modules/undici/lib/api/abort-signal.js +0 -57
  318. package/dist/node_modules/undici/lib/api/api-connect.js +0 -108
  319. package/dist/node_modules/undici/lib/api/api-pipeline.js +0 -251
  320. package/dist/node_modules/undici/lib/api/api-request.js +0 -214
  321. package/dist/node_modules/undici/lib/api/api-stream.js +0 -220
  322. package/dist/node_modules/undici/lib/api/api-upgrade.js +0 -108
  323. package/dist/node_modules/undici/lib/api/index.js +0 -7
  324. package/dist/node_modules/undici/lib/api/readable.js +0 -385
  325. package/dist/node_modules/undici/lib/api/util.js +0 -93
  326. package/dist/node_modules/undici/lib/core/connect.js +0 -240
  327. package/dist/node_modules/undici/lib/core/constants.js +0 -118
  328. package/dist/node_modules/undici/lib/core/diagnostics.js +0 -202
  329. package/dist/node_modules/undici/lib/core/errors.js +0 -425
  330. package/dist/node_modules/undici/lib/core/request.js +0 -405
  331. package/dist/node_modules/undici/lib/core/symbols.js +0 -67
  332. package/dist/node_modules/undici/lib/core/tree.js +0 -152
  333. package/dist/node_modules/undici/lib/core/util.js +0 -719
  334. package/dist/node_modules/undici/lib/dispatcher/agent.js +0 -129
  335. package/dist/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -209
  336. package/dist/node_modules/undici/lib/dispatcher/client-h1.js +0 -1487
  337. package/dist/node_modules/undici/lib/dispatcher/client-h2.js +0 -744
  338. package/dist/node_modules/undici/lib/dispatcher/client.js +0 -623
  339. package/dist/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -199
  340. package/dist/node_modules/undici/lib/dispatcher/dispatcher.js +0 -65
  341. package/dist/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -160
  342. package/dist/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -117
  343. package/dist/node_modules/undici/lib/dispatcher/pool-base.js +0 -194
  344. package/dist/node_modules/undici/lib/dispatcher/pool-stats.js +0 -34
  345. package/dist/node_modules/undici/lib/dispatcher/pool.js +0 -107
  346. package/dist/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -274
  347. package/dist/node_modules/undici/lib/dispatcher/retry-agent.js +0 -35
  348. package/dist/node_modules/undici/lib/global.js +0 -32
  349. package/dist/node_modules/undici/lib/handler/decorator-handler.js +0 -44
  350. package/dist/node_modules/undici/lib/handler/redirect-handler.js +0 -232
  351. package/dist/node_modules/undici/lib/handler/retry-handler.js +0 -374
  352. package/dist/node_modules/undici/lib/interceptor/dns.js +0 -375
  353. package/dist/node_modules/undici/lib/interceptor/dump.js +0 -123
  354. package/dist/node_modules/undici/lib/interceptor/redirect-interceptor.js +0 -21
  355. package/dist/node_modules/undici/lib/interceptor/redirect.js +0 -24
  356. package/dist/node_modules/undici/lib/interceptor/response-error.js +0 -86
  357. package/dist/node_modules/undici/lib/interceptor/retry.js +0 -19
  358. package/dist/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  359. package/dist/node_modules/undici/lib/llhttp/constants.js +0 -278
  360. package/dist/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -5
  361. package/dist/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -5
  362. package/dist/node_modules/undici/lib/llhttp/utils.js +0 -15
  363. package/dist/node_modules/undici/lib/mock/mock-agent.js +0 -160
  364. package/dist/node_modules/undici/lib/mock/mock-client.js +0 -59
  365. package/dist/node_modules/undici/lib/mock/mock-errors.js +0 -28
  366. package/dist/node_modules/undici/lib/mock/mock-interceptor.js +0 -207
  367. package/dist/node_modules/undici/lib/mock/mock-pool.js +0 -59
  368. package/dist/node_modules/undici/lib/mock/mock-symbols.js +0 -23
  369. package/dist/node_modules/undici/lib/mock/mock-utils.js +0 -367
  370. package/dist/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  371. package/dist/node_modules/undici/lib/mock/pluralizer.js +0 -29
  372. package/dist/node_modules/undici/lib/util/timers.js +0 -423
  373. package/dist/node_modules/undici/lib/web/cache/cache.js +0 -859
  374. package/dist/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  375. package/dist/node_modules/undici/lib/web/cache/symbols.js +0 -5
  376. package/dist/node_modules/undici/lib/web/cache/util.js +0 -45
  377. package/dist/node_modules/undici/lib/web/cookies/constants.js +0 -12
  378. package/dist/node_modules/undici/lib/web/cookies/index.js +0 -184
  379. package/dist/node_modules/undici/lib/web/cookies/parse.js +0 -310
  380. package/dist/node_modules/undici/lib/web/cookies/util.js +0 -282
  381. package/dist/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -398
  382. package/dist/node_modules/undici/lib/web/eventsource/eventsource.js +0 -480
  383. package/dist/node_modules/undici/lib/web/eventsource/util.js +0 -37
  384. package/dist/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  385. package/dist/node_modules/undici/lib/web/fetch/body.js +0 -529
  386. package/dist/node_modules/undici/lib/web/fetch/constants.js +0 -124
  387. package/dist/node_modules/undici/lib/web/fetch/data-url.js +0 -744
  388. package/dist/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +0 -46
  389. package/dist/node_modules/undici/lib/web/fetch/file.js +0 -126
  390. package/dist/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -474
  391. package/dist/node_modules/undici/lib/web/fetch/formdata.js +0 -252
  392. package/dist/node_modules/undici/lib/web/fetch/global.js +0 -40
  393. package/dist/node_modules/undici/lib/web/fetch/headers.js +0 -687
  394. package/dist/node_modules/undici/lib/web/fetch/index.js +0 -2272
  395. package/dist/node_modules/undici/lib/web/fetch/request.js +0 -1037
  396. package/dist/node_modules/undici/lib/web/fetch/response.js +0 -610
  397. package/dist/node_modules/undici/lib/web/fetch/symbols.js +0 -9
  398. package/dist/node_modules/undici/lib/web/fetch/util.js +0 -1632
  399. package/dist/node_modules/undici/lib/web/fetch/webidl.js +0 -695
  400. package/dist/node_modules/undici/lib/web/fileapi/encoding.js +0 -290
  401. package/dist/node_modules/undici/lib/web/fileapi/filereader.js +0 -344
  402. package/dist/node_modules/undici/lib/web/fileapi/progressevent.js +0 -78
  403. package/dist/node_modules/undici/lib/web/fileapi/symbols.js +0 -10
  404. package/dist/node_modules/undici/lib/web/fileapi/util.js +0 -391
  405. package/dist/node_modules/undici/lib/web/websocket/connection.js +0 -371
  406. package/dist/node_modules/undici/lib/web/websocket/constants.js +0 -66
  407. package/dist/node_modules/undici/lib/web/websocket/events.js +0 -329
  408. package/dist/node_modules/undici/lib/web/websocket/frame.js +0 -96
  409. package/dist/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -100
  410. package/dist/node_modules/undici/lib/web/websocket/receiver.js +0 -513
  411. package/dist/node_modules/undici/lib/web/websocket/sender.js +0 -104
  412. package/dist/node_modules/undici/lib/web/websocket/symbols.js +0 -12
  413. package/dist/node_modules/undici/lib/web/websocket/util.js +0 -322
  414. package/dist/node_modules/undici/lib/web/websocket/websocket.js +0 -595
  415. package/dist/node_modules/undici/package.json +0 -160
  416. package/dist/node_modules/undici/scripts/strip-comments.js +0 -8
  417. package/dist/node_modules/v8-compile-cache/package.json +0 -34
  418. package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +0 -373
  419. package/dist/node_modules/which/LICENSE +0 -15
  420. package/dist/node_modules/which/bin/which.js +0 -52
  421. package/dist/node_modules/which/lib/index.js +0 -111
  422. package/dist/node_modules/which/package.json +0 -52
  423. package/dist/node_modules/yallist/dist/commonjs/index.js +0 -384
  424. package/dist/node_modules/yallist/dist/commonjs/package.json +0 -3
  425. package/dist/node_modules/yallist/dist/esm/index.js +0 -379
  426. package/dist/node_modules/yallist/dist/esm/package.json +0 -3
  427. package/dist/node_modules/yallist/package.json +0 -68
  428. package/dist/pnpm.mjs +0 -306294
  429. package/dist/pnpmrc +0 -2
  430. package/dist/templates/completion.bash +0 -31
  431. package/dist/templates/completion.fish +0 -22
  432. package/dist/templates/completion.ps1 +0 -193
  433. package/dist/templates/completion.zsh +0 -27
  434. package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
  435. package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
  436. package/dist/worker.js +0 -11938
  437. package/platform-pkg-name.js +0 -18
  438. package/pn.cmd +0 -2
  439. package/pn.ps1 +0 -1
  440. package/pnpx.cmd +0 -2
  441. package/pnpx.ps1 +0 -1
  442. package/pnx.cmd +0 -2
  443. package/pnx.ps1 +0 -1
  444. package/prepare.js +0 -29
  445. package/setup.js +0 -106
@@ -1,1386 +0,0 @@
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;