@pnpm/exe 11.0.5 → 11.0.7

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