@teammy/server 0.1.4 → 0.1.6

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 (585) hide show
  1. package/dist/main.js +11646 -7952
  2. package/dist/native-pi-entry.js +14 -1
  3. package/dist/project-pi-entry.js +46 -8
  4. package/dist/runtime/workflows/task-bootstrap/prompt.md +2 -0
  5. package/dist/web/assets/{Assistant-B3h2yQF3.css → Assistant-4yZWjYm-.css} +1 -1
  6. package/dist/web/assets/Assistant-BNVXOHQZ.js +1 -0
  7. package/dist/web/assets/Dashboard-zKTK6EZD.js +1 -0
  8. package/dist/web/assets/Files-DI98WkdW.js +1 -0
  9. package/dist/web/assets/{Markdown-Bq8P_NBV.js → Markdown-D3cU0ani.js} +4 -4
  10. package/dist/web/assets/Materials-CK-mbNmo.css +1 -0
  11. package/dist/web/assets/Materials-CWptgAHz.js +6 -0
  12. package/dist/web/assets/Sessions-DiDwqXLI.js +1 -0
  13. package/dist/web/assets/WorkspaceTree-DeAA1QtV.js +1 -0
  14. package/dist/web/assets/{file-links-CFCIacLV.js → file-links-GfCXWkEh.js} +1 -1
  15. package/dist/web/assets/index-BwEl1PIa.js +66 -0
  16. package/dist/web/assets/{index-B-MqU_88.css → index-CTIAGUGG.css} +1 -1
  17. package/dist/web/downloads/teammy-skill.zip +0 -0
  18. package/dist/web/index.html +2 -2
  19. package/node_modules/@isaacs/nonrecursive-glob-match/LICENSE.md +55 -0
  20. package/node_modules/@isaacs/nonrecursive-glob-match/README.md +333 -0
  21. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts +114 -0
  22. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts.map +1 -0
  23. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js +762 -0
  24. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js.map +1 -0
  25. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js +3 -0
  26. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js.map +7 -0
  27. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/package.json +3 -0
  28. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts +4 -0
  29. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts.map +1 -0
  30. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js +142 -0
  31. package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js.map +1 -0
  32. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts +114 -0
  33. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts.map +1 -0
  34. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js +758 -0
  35. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js.map +1 -0
  36. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js +3 -0
  37. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js.map +7 -0
  38. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/package.json +3 -0
  39. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts +4 -0
  40. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts.map +1 -0
  41. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js +138 -0
  42. package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js.map +1 -0
  43. package/node_modules/@isaacs/nonrecursive-glob-match/package.json +56 -0
  44. package/node_modules/@isaacs/nonrecursive-glob-match/src/index.ts +900 -0
  45. package/node_modules/@isaacs/nonrecursive-glob-match/src/parse-class.ts +158 -0
  46. package/node_modules/@wecom/aibot-node-sdk/README.md +786 -0
  47. package/node_modules/@wecom/aibot-node-sdk/dist/api.d.ts +17 -0
  48. package/node_modules/@wecom/aibot-node-sdk/dist/client.d.ts +217 -0
  49. package/node_modules/@wecom/aibot-node-sdk/dist/crypto.d.ts +12 -0
  50. package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js +1563 -0
  51. package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js.map +1 -0
  52. package/node_modules/@wecom/aibot-node-sdk/dist/index.d.ts +1324 -0
  53. package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js +1544 -0
  54. package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js.map +1 -0
  55. package/node_modules/@wecom/aibot-node-sdk/dist/logger.d.ts +14 -0
  56. package/node_modules/@wecom/aibot-node-sdk/dist/message-handler.d.ts +29 -0
  57. package/node_modules/@wecom/aibot-node-sdk/dist/types/api.d.ts +466 -0
  58. package/node_modules/@wecom/aibot-node-sdk/dist/types/common.d.ts +30 -0
  59. package/node_modules/@wecom/aibot-node-sdk/dist/types/config.d.ts +34 -0
  60. package/node_modules/@wecom/aibot-node-sdk/dist/types/event.d.ts +109 -0
  61. package/node_modules/@wecom/aibot-node-sdk/dist/types/index.d.ts +10 -0
  62. package/node_modules/@wecom/aibot-node-sdk/dist/types/message.d.ts +158 -0
  63. package/node_modules/@wecom/aibot-node-sdk/dist/utils.d.ts +19 -0
  64. package/node_modules/@wecom/aibot-node-sdk/dist/wecom-crypto/index.d.ts +46 -0
  65. package/node_modules/@wecom/aibot-node-sdk/dist/ws.d.ts +161 -0
  66. package/node_modules/@wecom/aibot-node-sdk/package.json +43 -0
  67. package/node_modules/asynckit/LICENSE +21 -0
  68. package/node_modules/asynckit/README.md +233 -0
  69. package/node_modules/asynckit/bench.js +76 -0
  70. package/node_modules/asynckit/index.js +6 -0
  71. package/node_modules/asynckit/lib/abort.js +29 -0
  72. package/node_modules/asynckit/lib/async.js +34 -0
  73. package/node_modules/asynckit/lib/defer.js +26 -0
  74. package/node_modules/asynckit/lib/iterate.js +75 -0
  75. package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  76. package/node_modules/asynckit/lib/readable_parallel.js +25 -0
  77. package/node_modules/asynckit/lib/readable_serial.js +25 -0
  78. package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  79. package/node_modules/asynckit/lib/state.js +37 -0
  80. package/node_modules/asynckit/lib/streamify.js +141 -0
  81. package/node_modules/asynckit/lib/terminator.js +29 -0
  82. package/node_modules/asynckit/package.json +63 -0
  83. package/node_modules/asynckit/parallel.js +43 -0
  84. package/node_modules/asynckit/serial.js +17 -0
  85. package/node_modules/asynckit/serialOrdered.js +75 -0
  86. package/node_modules/asynckit/stream.js +21 -0
  87. package/node_modules/axios/CHANGELOG.md +1934 -0
  88. package/node_modules/axios/LICENSE +7 -0
  89. package/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  90. package/node_modules/axios/README.md +2786 -0
  91. package/node_modules/axios/dist/axios.js +6460 -0
  92. package/node_modules/axios/dist/axios.min.js +5 -0
  93. package/node_modules/axios/dist/axios.min.js.map +1 -0
  94. package/node_modules/axios/dist/browser/axios.cjs +6509 -0
  95. package/node_modules/axios/dist/esm/axios.js +6530 -0
  96. package/node_modules/axios/dist/esm/axios.min.js +3 -0
  97. package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  98. package/node_modules/axios/dist/node/axios.cjs +7491 -0
  99. package/node_modules/axios/index.d.cts +785 -0
  100. package/node_modules/axios/index.d.ts +804 -0
  101. package/node_modules/axios/index.js +45 -0
  102. package/node_modules/axios/lib/adapters/README.md +36 -0
  103. package/node_modules/axios/lib/adapters/adapters.js +132 -0
  104. package/node_modules/axios/lib/adapters/fetch.js +749 -0
  105. package/node_modules/axios/lib/adapters/http.js +1609 -0
  106. package/node_modules/axios/lib/adapters/xhr.js +384 -0
  107. package/node_modules/axios/lib/axios.js +89 -0
  108. package/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  109. package/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  110. package/node_modules/axios/lib/cancel/isCancel.js +5 -0
  111. package/node_modules/axios/lib/core/Axios.js +361 -0
  112. package/node_modules/axios/lib/core/AxiosError.js +278 -0
  113. package/node_modules/axios/lib/core/AxiosHeaders.js +487 -0
  114. package/node_modules/axios/lib/core/InterceptorManager.js +182 -0
  115. package/node_modules/axios/lib/core/README.md +8 -0
  116. package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
  117. package/node_modules/axios/lib/core/buildFullPath.js +76 -0
  118. package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
  119. package/node_modules/axios/lib/core/dispatchRequest.js +115 -0
  120. package/node_modules/axios/lib/core/mergeConfig.js +237 -0
  121. package/node_modules/axios/lib/core/methodList.js +17 -0
  122. package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  123. package/node_modules/axios/lib/core/settle.js +27 -0
  124. package/node_modules/axios/lib/core/transformData.js +28 -0
  125. package/node_modules/axios/lib/defaults/index.js +178 -0
  126. package/node_modules/axios/lib/defaults/transitional.js +11 -0
  127. package/node_modules/axios/lib/env/README.md +3 -0
  128. package/node_modules/axios/lib/env/classes/FormData.js +2 -0
  129. package/node_modules/axios/lib/env/data.js +1 -0
  130. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +165 -0
  131. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  132. package/node_modules/axios/lib/helpers/Http2Sessions.js +122 -0
  133. package/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  134. package/node_modules/axios/lib/helpers/README.md +7 -0
  135. package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  136. package/node_modules/axios/lib/helpers/bind.js +14 -0
  137. package/node_modules/axios/lib/helpers/buildURL.js +69 -0
  138. package/node_modules/axios/lib/helpers/callbackify.js +18 -0
  139. package/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  140. package/node_modules/axios/lib/helpers/composeSignals.js +71 -0
  141. package/node_modules/axios/lib/helpers/cookies.js +88 -0
  142. package/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  143. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +193 -0
  144. package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
  145. package/node_modules/axios/lib/helpers/formDataToJSON.js +149 -0
  146. package/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  147. package/node_modules/axios/lib/helpers/fromDataURI.js +75 -0
  148. package/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  149. package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  150. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
  151. package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  152. package/node_modules/axios/lib/helpers/null.js +2 -0
  153. package/node_modules/axios/lib/helpers/parseHeaders.js +72 -0
  154. package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  155. package/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  156. package/node_modules/axios/lib/helpers/readBlob.js +15 -0
  157. package/node_modules/axios/lib/helpers/resolveConfig.js +120 -0
  158. package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  159. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +520 -0
  160. package/node_modules/axios/lib/helpers/speedometer.js +55 -0
  161. package/node_modules/axios/lib/helpers/spread.js +28 -0
  162. package/node_modules/axios/lib/helpers/throttle.js +45 -0
  163. package/node_modules/axios/lib/helpers/toFormData.js +279 -0
  164. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  165. package/node_modules/axios/lib/helpers/trackStream.js +89 -0
  166. package/node_modules/axios/lib/helpers/validator.js +112 -0
  167. package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  168. package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  169. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  170. package/node_modules/axios/lib/platform/browser/index.js +13 -0
  171. package/node_modules/axios/lib/platform/common/utils.js +52 -0
  172. package/node_modules/axios/lib/platform/index.js +7 -0
  173. package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  174. package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  175. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  176. package/node_modules/axios/lib/platform/node/index.js +37 -0
  177. package/node_modules/axios/lib/utils.js +1201 -0
  178. package/node_modules/axios/node_modules/agent-base/README.md +145 -0
  179. package/node_modules/axios/node_modules/agent-base/dist/src/index.d.ts +78 -0
  180. package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
  181. package/node_modules/axios/node_modules/agent-base/dist/src/index.js.map +1 -0
  182. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
  183. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
  184. package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js.map +1 -0
  185. package/node_modules/axios/node_modules/agent-base/package.json +64 -0
  186. package/node_modules/axios/node_modules/agent-base/src/index.ts +345 -0
  187. package/node_modules/axios/node_modules/agent-base/src/promisify.ts +33 -0
  188. package/node_modules/axios/node_modules/https-proxy-agent/README.md +137 -0
  189. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
  190. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
  191. package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
  192. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
  193. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
  194. package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  195. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
  196. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
  197. package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  198. package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
  199. package/node_modules/axios/package.json +202 -0
  200. package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  201. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  202. package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  203. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  204. package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  205. package/node_modules/call-bind-apply-helpers/README.md +62 -0
  206. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  207. package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  208. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  209. package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  210. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  211. package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  212. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  213. package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  214. package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  215. package/node_modules/call-bind-apply-helpers/index.js +15 -0
  216. package/node_modules/call-bind-apply-helpers/package.json +85 -0
  217. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  218. package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  219. package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  220. package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  221. package/node_modules/combined-stream/License +19 -0
  222. package/node_modules/combined-stream/Readme.md +138 -0
  223. package/node_modules/combined-stream/lib/combined_stream.js +208 -0
  224. package/node_modules/combined-stream/package.json +25 -0
  225. package/node_modules/delayed-stream/.npmignore +1 -0
  226. package/node_modules/delayed-stream/License +19 -0
  227. package/node_modules/delayed-stream/Makefile +7 -0
  228. package/node_modules/delayed-stream/Readme.md +141 -0
  229. package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  230. package/node_modules/delayed-stream/package.json +27 -0
  231. package/node_modules/dunder-proto/.eslintrc +5 -0
  232. package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  233. package/node_modules/dunder-proto/.nycrc +13 -0
  234. package/node_modules/dunder-proto/CHANGELOG.md +24 -0
  235. package/node_modules/dunder-proto/LICENSE +21 -0
  236. package/node_modules/dunder-proto/README.md +54 -0
  237. package/node_modules/dunder-proto/get.d.ts +5 -0
  238. package/node_modules/dunder-proto/get.js +30 -0
  239. package/node_modules/dunder-proto/package.json +76 -0
  240. package/node_modules/dunder-proto/set.d.ts +5 -0
  241. package/node_modules/dunder-proto/set.js +35 -0
  242. package/node_modules/dunder-proto/test/get.js +34 -0
  243. package/node_modules/dunder-proto/test/index.js +4 -0
  244. package/node_modules/dunder-proto/test/set.js +50 -0
  245. package/node_modules/dunder-proto/tsconfig.json +9 -0
  246. package/node_modules/es-define-property/.eslintrc +13 -0
  247. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  248. package/node_modules/es-define-property/.nycrc +9 -0
  249. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  250. package/node_modules/es-define-property/LICENSE +21 -0
  251. package/node_modules/es-define-property/README.md +49 -0
  252. package/node_modules/es-define-property/index.d.ts +3 -0
  253. package/node_modules/es-define-property/index.js +14 -0
  254. package/node_modules/es-define-property/package.json +81 -0
  255. package/node_modules/es-define-property/test/index.js +56 -0
  256. package/node_modules/es-define-property/tsconfig.json +10 -0
  257. package/node_modules/es-errors/.eslintrc +5 -0
  258. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  259. package/node_modules/es-errors/CHANGELOG.md +40 -0
  260. package/node_modules/es-errors/LICENSE +21 -0
  261. package/node_modules/es-errors/README.md +55 -0
  262. package/node_modules/es-errors/eval.d.ts +3 -0
  263. package/node_modules/es-errors/eval.js +4 -0
  264. package/node_modules/es-errors/index.d.ts +3 -0
  265. package/node_modules/es-errors/index.js +4 -0
  266. package/node_modules/es-errors/package.json +80 -0
  267. package/node_modules/es-errors/range.d.ts +3 -0
  268. package/node_modules/es-errors/range.js +4 -0
  269. package/node_modules/es-errors/ref.d.ts +3 -0
  270. package/node_modules/es-errors/ref.js +4 -0
  271. package/node_modules/es-errors/syntax.d.ts +3 -0
  272. package/node_modules/es-errors/syntax.js +4 -0
  273. package/node_modules/es-errors/test/index.js +19 -0
  274. package/node_modules/es-errors/tsconfig.json +49 -0
  275. package/node_modules/es-errors/type.d.ts +3 -0
  276. package/node_modules/es-errors/type.js +4 -0
  277. package/node_modules/es-errors/uri.d.ts +3 -0
  278. package/node_modules/es-errors/uri.js +4 -0
  279. package/node_modules/es-object-atoms/.eslintrc +16 -0
  280. package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  281. package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
  282. package/node_modules/es-object-atoms/LICENSE +21 -0
  283. package/node_modules/es-object-atoms/README.md +63 -0
  284. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  285. package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  286. package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  287. package/node_modules/es-object-atoms/ToObject.js +10 -0
  288. package/node_modules/es-object-atoms/index.d.ts +3 -0
  289. package/node_modules/es-object-atoms/index.js +4 -0
  290. package/node_modules/es-object-atoms/isObject.d.ts +3 -0
  291. package/node_modules/es-object-atoms/isObject.js +6 -0
  292. package/node_modules/es-object-atoms/package.json +79 -0
  293. package/node_modules/es-object-atoms/test/index.js +38 -0
  294. package/node_modules/es-object-atoms/tsconfig.json +7 -0
  295. package/node_modules/es-set-tostringtag/.eslintrc +13 -0
  296. package/node_modules/es-set-tostringtag/.nycrc +9 -0
  297. package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
  298. package/node_modules/es-set-tostringtag/LICENSE +21 -0
  299. package/node_modules/es-set-tostringtag/README.md +53 -0
  300. package/node_modules/es-set-tostringtag/index.d.ts +10 -0
  301. package/node_modules/es-set-tostringtag/index.js +35 -0
  302. package/node_modules/es-set-tostringtag/package.json +78 -0
  303. package/node_modules/es-set-tostringtag/test/index.js +85 -0
  304. package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
  305. package/node_modules/eventemitter3/LICENSE +21 -0
  306. package/node_modules/eventemitter3/README.md +85 -0
  307. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
  308. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
  309. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
  310. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
  311. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
  312. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
  313. package/node_modules/eventemitter3/index.d.ts +135 -0
  314. package/node_modules/eventemitter3/index.js +336 -0
  315. package/node_modules/eventemitter3/index.mjs +4 -0
  316. package/node_modules/eventemitter3/package.json +62 -0
  317. package/node_modules/follow-redirects/LICENSE +18 -0
  318. package/node_modules/follow-redirects/README.md +183 -0
  319. package/node_modules/follow-redirects/debug.js +15 -0
  320. package/node_modules/follow-redirects/http.js +1 -0
  321. package/node_modules/follow-redirects/https.js +1 -0
  322. package/node_modules/follow-redirects/index.js +714 -0
  323. package/node_modules/follow-redirects/package.json +58 -0
  324. package/node_modules/form-data/CHANGELOG.md +686 -0
  325. package/node_modules/form-data/License +19 -0
  326. package/node_modules/form-data/README.md +355 -0
  327. package/node_modules/form-data/index.d.ts +62 -0
  328. package/node_modules/form-data/lib/browser.js +4 -0
  329. package/node_modules/form-data/lib/form_data.js +506 -0
  330. package/node_modules/form-data/lib/populate.js +10 -0
  331. package/node_modules/form-data/package.json +82 -0
  332. package/node_modules/function-bind/.eslintrc +21 -0
  333. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  334. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  335. package/node_modules/function-bind/.nycrc +13 -0
  336. package/node_modules/function-bind/CHANGELOG.md +136 -0
  337. package/node_modules/function-bind/LICENSE +20 -0
  338. package/node_modules/function-bind/README.md +46 -0
  339. package/node_modules/function-bind/implementation.js +84 -0
  340. package/node_modules/function-bind/index.js +5 -0
  341. package/node_modules/function-bind/package.json +87 -0
  342. package/node_modules/function-bind/test/.eslintrc +9 -0
  343. package/node_modules/function-bind/test/index.js +252 -0
  344. package/node_modules/get-intrinsic/.eslintrc +42 -0
  345. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  346. package/node_modules/get-intrinsic/.nycrc +9 -0
  347. package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  348. package/node_modules/get-intrinsic/LICENSE +21 -0
  349. package/node_modules/get-intrinsic/README.md +71 -0
  350. package/node_modules/get-intrinsic/index.js +378 -0
  351. package/node_modules/get-intrinsic/package.json +97 -0
  352. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  353. package/node_modules/get-proto/.eslintrc +10 -0
  354. package/node_modules/get-proto/.github/FUNDING.yml +12 -0
  355. package/node_modules/get-proto/.nycrc +9 -0
  356. package/node_modules/get-proto/CHANGELOG.md +21 -0
  357. package/node_modules/get-proto/LICENSE +21 -0
  358. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  359. package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  360. package/node_modules/get-proto/README.md +50 -0
  361. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  362. package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  363. package/node_modules/get-proto/index.d.ts +5 -0
  364. package/node_modules/get-proto/index.js +27 -0
  365. package/node_modules/get-proto/package.json +81 -0
  366. package/node_modules/get-proto/test/index.js +68 -0
  367. package/node_modules/get-proto/tsconfig.json +9 -0
  368. package/node_modules/glob/README.md +388 -214
  369. package/node_modules/glob/dist/commonjs/glob.d.ts +20 -11
  370. package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -1
  371. package/node_modules/glob/dist/commonjs/glob.js +22 -29
  372. package/node_modules/glob/dist/commonjs/glob.js.map +1 -1
  373. package/node_modules/glob/dist/commonjs/has-magic.d.ts +1 -1
  374. package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -1
  375. package/node_modules/glob/dist/commonjs/has-magic.js +1 -4
  376. package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -1
  377. package/node_modules/glob/dist/commonjs/ignore.d.ts +16 -4
  378. package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -1
  379. package/node_modules/glob/dist/commonjs/ignore.js +24 -4
  380. package/node_modules/glob/dist/commonjs/ignore.js.map +1 -1
  381. package/node_modules/glob/dist/commonjs/index.d.ts +3 -2
  382. package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -1
  383. package/node_modules/glob/dist/commonjs/index.js.map +1 -1
  384. package/node_modules/glob/dist/commonjs/index.min.js +2 -3
  385. package/node_modules/glob/dist/commonjs/index.min.js.map +4 -4
  386. package/node_modules/glob/dist/commonjs/pattern.d.ts +10 -3
  387. package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -1
  388. package/node_modules/glob/dist/commonjs/pattern.js +27 -15
  389. package/node_modules/glob/dist/commonjs/pattern.js.map +1 -1
  390. package/node_modules/glob/dist/commonjs/processor.d.ts +23 -10
  391. package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -1
  392. package/node_modules/glob/dist/commonjs/processor.js +36 -23
  393. package/node_modules/glob/dist/commonjs/processor.js.map +1 -1
  394. package/node_modules/glob/dist/commonjs/walker.d.ts +19 -17
  395. package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -1
  396. package/node_modules/glob/dist/commonjs/walker.js +50 -35
  397. package/node_modules/glob/dist/commonjs/walker.js.map +1 -1
  398. package/node_modules/glob/dist/esm/glob.d.ts +20 -11
  399. package/node_modules/glob/dist/esm/glob.d.ts.map +1 -1
  400. package/node_modules/glob/dist/esm/glob.js +22 -29
  401. package/node_modules/glob/dist/esm/glob.js.map +1 -1
  402. package/node_modules/glob/dist/esm/has-magic.d.ts +1 -1
  403. package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -1
  404. package/node_modules/glob/dist/esm/has-magic.js +1 -4
  405. package/node_modules/glob/dist/esm/has-magic.js.map +1 -1
  406. package/node_modules/glob/dist/esm/ignore.d.ts +16 -4
  407. package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -1
  408. package/node_modules/glob/dist/esm/ignore.js +25 -5
  409. package/node_modules/glob/dist/esm/ignore.js.map +1 -1
  410. package/node_modules/glob/dist/esm/index.d.ts +3 -2
  411. package/node_modules/glob/dist/esm/index.d.ts.map +1 -1
  412. package/node_modules/glob/dist/esm/index.js.map +1 -1
  413. package/node_modules/glob/dist/esm/index.min.js +2 -3
  414. package/node_modules/glob/dist/esm/index.min.js.map +4 -4
  415. package/node_modules/glob/dist/esm/pattern.d.ts +10 -3
  416. package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -1
  417. package/node_modules/glob/dist/esm/pattern.js +27 -15
  418. package/node_modules/glob/dist/esm/pattern.js.map +1 -1
  419. package/node_modules/glob/dist/esm/processor.d.ts +23 -10
  420. package/node_modules/glob/dist/esm/processor.d.ts.map +1 -1
  421. package/node_modules/glob/dist/esm/processor.js +36 -23
  422. package/node_modules/glob/dist/esm/processor.js.map +1 -1
  423. package/node_modules/glob/dist/esm/walker.d.ts +19 -17
  424. package/node_modules/glob/dist/esm/walker.d.ts.map +1 -1
  425. package/node_modules/glob/dist/esm/walker.js +51 -36
  426. package/node_modules/glob/dist/esm/walker.js.map +1 -1
  427. package/node_modules/glob/package.json +28 -12
  428. package/node_modules/glob/src/glob.ts +655 -0
  429. package/node_modules/glob/src/has-magic.ts +23 -0
  430. package/node_modules/glob/src/ignore.ts +162 -0
  431. package/node_modules/glob/src/index.ts +225 -0
  432. package/node_modules/glob/src/pattern.ts +286 -0
  433. package/node_modules/glob/src/processor.ts +333 -0
  434. package/node_modules/glob/src/walker.ts +523 -0
  435. package/node_modules/gopd/.eslintrc +16 -0
  436. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  437. package/node_modules/gopd/CHANGELOG.md +45 -0
  438. package/node_modules/gopd/LICENSE +21 -0
  439. package/node_modules/gopd/README.md +40 -0
  440. package/node_modules/gopd/gOPD.d.ts +1 -0
  441. package/node_modules/gopd/gOPD.js +4 -0
  442. package/node_modules/gopd/index.d.ts +5 -0
  443. package/node_modules/gopd/index.js +15 -0
  444. package/node_modules/gopd/package.json +77 -0
  445. package/node_modules/gopd/test/index.js +36 -0
  446. package/node_modules/gopd/tsconfig.json +9 -0
  447. package/node_modules/has-symbols/.eslintrc +11 -0
  448. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  449. package/node_modules/has-symbols/.nycrc +9 -0
  450. package/node_modules/has-symbols/CHANGELOG.md +91 -0
  451. package/node_modules/has-symbols/LICENSE +21 -0
  452. package/node_modules/has-symbols/README.md +46 -0
  453. package/node_modules/has-symbols/index.d.ts +3 -0
  454. package/node_modules/has-symbols/index.js +14 -0
  455. package/node_modules/has-symbols/package.json +111 -0
  456. package/node_modules/has-symbols/shams.d.ts +3 -0
  457. package/node_modules/has-symbols/shams.js +45 -0
  458. package/node_modules/has-symbols/test/index.js +22 -0
  459. package/node_modules/has-symbols/test/shams/core-js.js +29 -0
  460. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  461. package/node_modules/has-symbols/test/tests.js +58 -0
  462. package/node_modules/has-symbols/tsconfig.json +10 -0
  463. package/node_modules/has-tostringtag/.eslintrc +5 -0
  464. package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
  465. package/node_modules/has-tostringtag/.nycrc +13 -0
  466. package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
  467. package/node_modules/has-tostringtag/LICENSE +21 -0
  468. package/node_modules/has-tostringtag/README.md +46 -0
  469. package/node_modules/has-tostringtag/index.d.ts +3 -0
  470. package/node_modules/has-tostringtag/index.js +8 -0
  471. package/node_modules/has-tostringtag/package.json +108 -0
  472. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  473. package/node_modules/has-tostringtag/shams.js +8 -0
  474. package/node_modules/has-tostringtag/test/index.js +21 -0
  475. package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
  476. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
  477. package/node_modules/has-tostringtag/test/tests.js +15 -0
  478. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  479. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  480. package/node_modules/hasown/.nycrc +13 -0
  481. package/node_modules/hasown/CHANGELOG.md +58 -0
  482. package/node_modules/hasown/LICENSE +21 -0
  483. package/node_modules/hasown/README.md +40 -0
  484. package/node_modules/hasown/eslint.config.mjs +6 -0
  485. package/node_modules/hasown/index.d.ts +3 -0
  486. package/node_modules/hasown/index.js +8 -0
  487. package/node_modules/hasown/package.json +91 -0
  488. package/node_modules/hasown/tsconfig.json +6 -0
  489. package/node_modules/math-intrinsics/.eslintrc +16 -0
  490. package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  491. package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  492. package/node_modules/math-intrinsics/LICENSE +21 -0
  493. package/node_modules/math-intrinsics/README.md +50 -0
  494. package/node_modules/math-intrinsics/abs.d.ts +1 -0
  495. package/node_modules/math-intrinsics/abs.js +4 -0
  496. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  497. package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  498. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  499. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  500. package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  501. package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  502. package/node_modules/math-intrinsics/floor.d.ts +1 -0
  503. package/node_modules/math-intrinsics/floor.js +4 -0
  504. package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  505. package/node_modules/math-intrinsics/isFinite.js +12 -0
  506. package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  507. package/node_modules/math-intrinsics/isInteger.js +16 -0
  508. package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  509. package/node_modules/math-intrinsics/isNaN.js +6 -0
  510. package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  511. package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  512. package/node_modules/math-intrinsics/max.d.ts +1 -0
  513. package/node_modules/math-intrinsics/max.js +4 -0
  514. package/node_modules/math-intrinsics/min.d.ts +1 -0
  515. package/node_modules/math-intrinsics/min.js +4 -0
  516. package/node_modules/math-intrinsics/mod.d.ts +3 -0
  517. package/node_modules/math-intrinsics/mod.js +9 -0
  518. package/node_modules/math-intrinsics/package.json +86 -0
  519. package/node_modules/math-intrinsics/pow.d.ts +1 -0
  520. package/node_modules/math-intrinsics/pow.js +4 -0
  521. package/node_modules/math-intrinsics/round.d.ts +1 -0
  522. package/node_modules/math-intrinsics/round.js +4 -0
  523. package/node_modules/math-intrinsics/sign.d.ts +3 -0
  524. package/node_modules/math-intrinsics/sign.js +11 -0
  525. package/node_modules/math-intrinsics/test/index.js +192 -0
  526. package/node_modules/math-intrinsics/tsconfig.json +3 -0
  527. package/node_modules/mime-db/HISTORY.md +507 -0
  528. package/node_modules/mime-db/LICENSE +23 -0
  529. package/node_modules/mime-db/README.md +100 -0
  530. package/node_modules/mime-db/db.json +8519 -0
  531. package/node_modules/mime-db/index.js +12 -0
  532. package/node_modules/mime-db/package.json +60 -0
  533. package/node_modules/mime-types/HISTORY.md +397 -0
  534. package/node_modules/mime-types/LICENSE +23 -0
  535. package/node_modules/mime-types/README.md +113 -0
  536. package/node_modules/mime-types/index.js +188 -0
  537. package/node_modules/mime-types/package.json +44 -0
  538. package/node_modules/minimatch/README.md +125 -107
  539. package/node_modules/minimatch/dist/commonjs/index.d.ts +49 -38
  540. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -1
  541. package/node_modules/minimatch/dist/commonjs/index.js +782 -359
  542. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -1
  543. package/node_modules/minimatch/dist/esm/index.d.ts +49 -38
  544. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -1
  545. package/node_modules/minimatch/dist/esm/index.js +781 -356
  546. package/node_modules/minimatch/dist/esm/index.js.map +1 -1
  547. package/node_modules/minimatch/package.json +5 -4
  548. package/node_modules/path-scurry/README.md +0 -1
  549. package/node_modules/path-scurry/dist/commonjs/index.d.ts +7 -0
  550. package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -1
  551. package/node_modules/path-scurry/dist/commonjs/index.js +59 -21
  552. package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -1
  553. package/node_modules/path-scurry/dist/esm/index.d.ts +7 -0
  554. package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -1
  555. package/node_modules/path-scurry/dist/esm/index.js +42 -14
  556. package/node_modules/path-scurry/dist/esm/index.js.map +1 -1
  557. package/node_modules/path-scurry/package.json +4 -4
  558. package/node_modules/proxy-from-env/LICENSE +20 -0
  559. package/node_modules/proxy-from-env/README.md +163 -0
  560. package/node_modules/proxy-from-env/index.cjs +105 -0
  561. package/node_modules/proxy-from-env/index.js +103 -0
  562. package/node_modules/proxy-from-env/package.json +43 -0
  563. package/package.json +3 -1
  564. package/dist/web/assets/Assistant-DSQAdSiW.js +0 -1
  565. package/dist/web/assets/Dashboard-dCu2Cdxd.js +0 -1
  566. package/dist/web/assets/Files-cRhoWviM.js +0 -1
  567. package/dist/web/assets/Sessions-BxHsX1C5.js +0 -1
  568. package/dist/web/assets/WorkspaceTree-CD94JsaJ.js +0 -1
  569. package/dist/web/assets/index-BXpTaAUz.js +0 -66
  570. package/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
  571. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
  572. package/node_modules/minimatch/dist/commonjs/ast.js +0 -845
  573. package/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
  574. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
  575. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
  576. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
  577. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
  578. package/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
  579. package/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
  580. package/node_modules/minimatch/dist/esm/ast.js +0 -841
  581. package/node_modules/minimatch/dist/esm/ast.js.map +0 -1
  582. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
  583. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
  584. package/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
  585. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
@@ -1,5 +1,12 @@
1
+ import type { ParseReturnFiltered } from 'minimatch';
1
2
  import { GLOBSTAR } from 'minimatch';
2
- export type MMPattern = string | RegExp | typeof GLOBSTAR;
3
+ /**
4
+ * One portion of a parsed minimatch pattern: a string, a Matcher for
5
+ * a portion with magic, or GLOBSTAR for `**`.
6
+ */
7
+ export type MMPattern = ParseReturnFiltered;
8
+ /** The Matcher that minimatch makes for a portion with magic. */
9
+ export type MMMatcher = Exclude<MMPattern, string | typeof GLOBSTAR>;
3
10
  export type PatternList = [p: MMPattern, ...rest: MMPattern[]];
4
11
  export type UNCPatternList = [
5
12
  p0: '',
@@ -34,9 +41,9 @@ export declare class Pattern {
34
41
  */
35
42
  isGlobstar(): boolean;
36
43
  /**
37
- * true if pattern() returns a regexp
44
+ * true if pattern() returns a Matcher, for a portion with magic
38
45
  */
39
- isRegExp(): boolean;
46
+ isMatcher(): boolean;
40
47
  /**
41
48
  * The /-joined set of glob parts that make up this pattern
42
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAA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M,CAAA;gBAUrB,WAAW,EAAE,SAAS,EAAE,EACxB,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;IAkE3B,CAAC,aAAa,CAAC;IAIf;;OAEG;IACH,OAAO,IAAI,SAAS;IAIpB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAGnB;;OAEG;IACH,UAAU,IAAI,OAAO;IAGrB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,UAAU,IAAI,MAAM;IAUpB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAuBtB;;OAEG;IACH,KAAK,IAAI,OAAO;IAsBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IASd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"}
@@ -45,19 +45,24 @@ export class Pattern {
45
45
  // //host/share => ['//host/share/']
46
46
  // //host/share/ => ['//host/share/']
47
47
  // //host/share/x => ['//host/share/', 'x']
48
+ // //?/UNC/host/share/x => ['//?/UNC/host/share/', 'x']
48
49
  // /etc => ['/', 'etc']
49
50
  // / => ['/']
50
51
  if (this.isUNC()) {
51
- // '' / '' / 'host' / 'share'
52
- const [p0, p1, p2, p3, ...prest] = this.#patternList;
53
- const [g0, g1, g2, g3, ...grest] = this.#globList;
52
+ // '' / '' / 'host' / 'share', or
53
+ // '' / '' / '?' / 'UNC' / 'host' / 'share'
54
+ const n = this.#isLongUNC() ? 6 : 4;
55
+ const proot = this.#patternList.slice(0, n);
56
+ const groot = this.#globList.slice(0, n);
57
+ const prest = this.#patternList.slice(n);
58
+ const grest = this.#globList.slice(n);
54
59
  if (prest[0] === '') {
55
60
  // ends in /
56
61
  prest.shift();
57
62
  grest.shift();
58
63
  }
59
- const p = [p0, p1, p2, p3, ''].join('/');
60
- const g = [g0, g1, g2, g3, ''].join('/');
64
+ const p = [...proot, ''].join('/');
65
+ const g = [...groot, ''].join('/');
61
66
  this.#patternList = [p, ...prest];
62
67
  this.#globList = [g, ...grest];
63
68
  this.length = this.#patternList.length;
@@ -70,8 +75,8 @@ export class Pattern {
70
75
  prest.shift();
71
76
  grest.shift();
72
77
  }
73
- const p = p1 + '/';
74
- const g = g1 + '/';
78
+ const p = `${p1}/`;
79
+ const g = `${g1}/`;
75
80
  this.#patternList = [p, ...prest];
76
81
  this.#globList = [g, ...grest];
77
82
  this.length = this.#patternList.length;
@@ -79,7 +84,7 @@ export class Pattern {
79
84
  }
80
85
  }
81
86
  [customInspect]() {
82
- return 'Pattern <' + this.#globList.slice(this.#index).join('/') + '>';
87
+ return `Pattern <${this.#globList.slice(this.#index).join('/')}>`;
83
88
  }
84
89
  /**
85
90
  * The first entry in the parsed list of patterns
@@ -100,10 +105,10 @@ export class Pattern {
100
105
  return this.#patternList[this.#index] === GLOBSTAR;
101
106
  }
102
107
  /**
103
- * true if pattern() returns a regexp
108
+ * true if pattern() returns a Matcher, for a portion with magic
104
109
  */
105
- isRegExp() {
106
- return this.#patternList[this.#index] instanceof RegExp;
110
+ isMatcher() {
111
+ return typeof this.#patternList[this.#index] === 'object';
107
112
  }
108
113
  /**
109
114
  * The /-joined set of glob parts that make up this pattern
@@ -137,11 +142,18 @@ export class Pattern {
137
142
  this.#rest.#isDrive = this.#isDrive;
138
143
  return this.#rest;
139
144
  }
145
+ // the root is //?/UNC/host/share, the same as //host/share
146
+ #isLongUNC() {
147
+ const pl = this.#patternList;
148
+ return (pl[2] === '?' && typeof pl[3] === 'string' && /^unc$/i.test(pl[3]));
149
+ }
140
150
  /**
141
151
  * true if the pattern represents a //unc/path/ on windows
142
152
  */
143
153
  isUNC() {
144
154
  const pl = this.#patternList;
155
+ // the host and share, after //?/UNC/ in a long UNC path
156
+ const h = this.#isLongUNC() ? 4 : 2;
145
157
  return this.#isUNC !== undefined ?
146
158
  this.#isUNC
147
159
  : (this.#isUNC =
@@ -149,10 +161,10 @@ export class Pattern {
149
161
  this.#index === 0 &&
150
162
  pl[0] === '' &&
151
163
  pl[1] === '' &&
152
- typeof pl[2] === 'string' &&
153
- !!pl[2] &&
154
- typeof pl[3] === 'string' &&
155
- !!pl[3]);
164
+ typeof pl[h] === 'string' &&
165
+ !!pl[h] &&
166
+ typeof pl[h + 1] === 'string' &&
167
+ !!pl[h + 1]);
156
168
  }
157
169
  // pattern like C:/...
158
170
  // split = ['C:', ...]
@@ -1 +1 @@
1
- {"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAChB,MAAM,UAAU,GAAG,CAAC,EAAY,EAAkB,EAAE,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAEnE,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;AAE9D;;;GAGG;AACH,MAAM,OAAO,OAAO;IACT,YAAY,CAAa;IACzB,SAAS,CAAU;IACnB,MAAM,CAAQ;IACd,MAAM,CAAQ;IACd,SAAS,CAAiB;IACnC,KAAK,CAAiB;IACtB,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,WAAW,CAAU;IACrB,eAAe,GAAY,IAAI,CAAA;IAE/B,YACE,WAAwB,EACxB,QAAkB,EAClB,KAAa,EACb,QAAyB;QAEzB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAA;QAC3C,CAAC;QACD,IAAI,CAAC,U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AI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\nconst customInspect = Symbol.for('nodejs.util.inspect.custom')\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n [customInspect]() {\n return 'Pattern <' + this.#globList.slice(this.#index).join('/') + '>'\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAwBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAChB,MAAM,UAAU,GAAG,CAAC,EAAY,EAAkB,EAAE,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAEnE,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;AAE9D;;;GAGG;AACH,MAAM,OAAO,OAAO;IACT,YAAY,CAAa;IACzB,SAAS,CAAU;IACnB,MAAM,CAAQ;IACd,MAAM,CAAQ;IACd,SAAS,CAAiB;IACnC,KAAK,CAAiB;IACtB,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,WAAW,CAAU;IACrB,eAAe,GAAY,IAAI,CAAA;IAE/B,YACE,WAAwB,EACxB,QAAkB,EAClB,KAAa,EACb,QAAyB;QAEzB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAA;QAC3C,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,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AAC,IAAI,CAAC,WAAW;gBACf,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC/B,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,CACH,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAChE,CAAC,CAAC;YACD,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport type { ParseReturnFiltered } from 'minimatch'\nimport { GLOBSTAR } from 'minimatch'\n\n/**\n * One portion of a parsed minimatch pattern: a string, a Matcher for\n * a portion with magic, or GLOBSTAR for `**`.\n */\nexport type MMPattern = ParseReturnFiltered\n\n/** The Matcher that minimatch makes for a portion with magic. */\nexport type MMMatcher = Exclude<MMPattern, string | typeof GLOBSTAR>\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\nconst customInspect = Symbol.for('nodejs.util.inspect.custom')\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // //?/UNC/host/share/x => ['//?/UNC/host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share', or\n // '' / '' / '?' / 'UNC' / 'host' / 'share'\n const n = this.#isLongUNC() ? 6 : 4\n const proot = this.#patternList.slice(0, n)\n const groot = this.#globList.slice(0, n)\n const prest = this.#patternList.slice(n)\n const grest = this.#globList.slice(n)\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [...proot, ''].join('/')\n const g = [...groot, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = `${p1 as string}/`\n const g = `${g1}/`\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n [customInspect]() {\n return `Pattern <${this.#globList.slice(this.#index).join('/')}>`\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a Matcher, for a portion with magic\n */\n isMatcher(): boolean {\n return typeof this.#patternList[this.#index] === 'object'\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n // the root is //?/UNC/host/share, the same as //host/share\n #isLongUNC(): boolean {\n const pl = this.#patternList\n return (\n pl[2] === '?' && typeof pl[3] === 'string' && /^unc$/i.test(pl[3])\n )\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n // the host and share, after //?/UNC/ in a long UNC path\n const h = this.#isLongUNC() ? 4 : 2\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[h] === 'string' &&\n !!pl[h] &&\n typeof pl[h + 1] === 'string' &&\n !!pl[h + 1])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]}
@@ -1,26 +1,39 @@
1
- import { MMRegExp } from 'minimatch';
2
- import { Path } from 'path-scurry';
3
- import { Pattern } from './pattern.js';
4
- import { GlobWalkerOpts } from './walker.js';
1
+ import type { Path } from 'path-scurry';
2
+ import type { MMMatcher, Pattern } from './pattern.js';
3
+ import type { GlobWalkerOpts } from './walker.js';
5
4
  /**
6
- * A cache of which patterns have been processed for a given Path
5
+ * A cache of which patterns have been processed for a given Path, in
6
+ * this walk step and the steps that led to it.
7
+ *
8
+ * A step only adds to it before it makes the caches for the next
9
+ * steps, so a copy can look up the chain of caches before it, in
10
+ * place of copying their entries. A pattern for a path that a cache
11
+ * up the chain has already seen is added to that cache's set, so that
12
+ * the other steps that share it see it too. Paths are keyed by their
13
+ * full path, because path-scurry can make a new Path object for the
14
+ * same path once its cache of children is full.
7
15
  */
8
16
  export declare class HasWalkedCache {
9
- store: Map<string, Set<string>>;
10
- constructor(store?: Map<string, Set<string>>);
17
+ #private;
18
+ parent?: HasWalkedCache;
19
+ store?: Map<string, Set<string>>;
20
+ constructor(parent?: HasWalkedCache);
11
21
  copy(): HasWalkedCache;
12
- hasWalked(target: Path, pattern: Pattern): boolean | undefined;
22
+ hasWalked(target: Path, pattern: Pattern): boolean;
13
23
  storeWalked(target: Path, pattern: Pattern): void;
14
24
  }
15
25
  /**
16
26
  * A record of which paths have been matched in a given walk step,
17
27
  * and whether they only are considered a match if they are a directory,
18
28
  * and whether their absolute or relative path should be returned.
29
+ * The store maps each path to {@link MatchRecord.ABSOLUTE} and
30
+ * {@link MatchRecord.IF_DIR} flags.
19
31
  */
20
32
  export declare class MatchRecord {
33
+ static readonly ABSOLUTE = 2;
34
+ static readonly IF_DIR = 1;
21
35
  store: Map<Path, number>;
22
36
  add(target: Path, absolute: boolean, ifDir: boolean): void;
23
- entries(): [Path, boolean, boolean][];
24
37
  }
25
38
  /**
26
39
  * A collection of patterns that must be processed in a subsequent step
@@ -53,7 +66,7 @@ export declare class Processor {
53
66
  child(): Processor;
54
67
  filterEntries(parent: Path, entries: Path[]): Processor;
55
68
  testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void;
56
- testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void;
69
+ testMatcher(e: Path, p: MMMatcher, rest: Pattern | null, absolute: boolean): void;
57
70
  testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void;
58
71
  }
59
72
  //# sourceMappingURL=processor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;gBACnB,KAAK,GAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAGvD,IAAI;IAGJ,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;IAGxC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;CAM3C;AAED;;;;GAIG;AACH,qBAAa,WAAW;IACtB,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY;IACpC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,O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AAc,EAAE,cAAc,CAAA;IAC9B,OAAO,cAAoB;IAC3B,QAAQ,WAAiB;IACzB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,GAAG,EAAE,OAAO,CAAA;IACZ,IAAI,EAAE,cAAc,CAAA;gBAER,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,cAAc;IAQjE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;IAmGjD,cAAc,IAAI,IAAI,EAAE;IAIxB,KAAK;IAQL,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS;IAqBvD,YAAY,CACV,CAAC,EAAE,IAAI,EACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IA8CnB,WAAW,CACT,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE,OAAO,GAAG,IAAI,EACpB,QAAQ,EAAE,OAAO;IAWnB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"}
@@ -1,48 +1,60 @@
1
1
  // synchronous utility for filtering entries and calculating subwalks
2
2
  import { GLOBSTAR } from 'minimatch';
3
3
  /**
4
- * A cache of which patterns have been processed for a given Path
4
+ * A cache of which patterns have been processed for a given Path, in
5
+ * this walk step and the steps that led to it.
6
+ *
7
+ * A step only adds to it before it makes the caches for the next
8
+ * steps, so a copy can look up the chain of caches before it, in
9
+ * place of copying their entries. A pattern for a path that a cache
10
+ * up the chain has already seen is added to that cache's set, so that
11
+ * the other steps that share it see it too. Paths are keyed by their
12
+ * full path, because path-scurry can make a new Path object for the
13
+ * same path once its cache of children is full.
5
14
  */
6
15
  export class HasWalkedCache {
16
+ parent;
7
17
  store;
8
- constructor(store = new Map()) {
9
- this.store = store;
18
+ constructor(parent) {
19
+ this.parent = parent;
10
20
  }
11
21
  copy() {
12
- return new HasWalkedCache(new Map(this.store));
22
+ return new HasWalkedCache(this);
23
+ }
24
+ // the set for the path in this cache, or the closest one before it
25
+ #find(fullpath) {
26
+ const set = this.store?.get(fullpath);
27
+ return set || !this.parent ? set : this.parent.#find(fullpath);
13
28
  }
14
29
  hasWalked(target, pattern) {
15
- return this.store.get(target.fullpath())?.has(pattern.globString());
30
+ return !!this.#find(target.fullpath())?.has(pattern.globString());
16
31
  }
17
32
  storeWalked(target, pattern) {
18
33
  const fullpath = target.fullpath();
19
- const cached = this.store.get(fullpath);
34
+ const cached = this.#find(fullpath);
20
35
  if (cached)
21
36
  cached.add(pattern.globString());
22
37
  else
23
- this.store.set(fullpath, new Set([pattern.globString()]));
38
+ (this.store ??= new Map()).set(fullpath, new Set([pattern.globString()]));
24
39
  }
25
40
  }
26
41
  /**
27
42
  * A record of which paths have been matched in a given walk step,
28
43
  * and whether they only are considered a match if they are a directory,
29
44
  * and whether their absolute or relative path should be returned.
45
+ * The store maps each path to {@link MatchRecord.ABSOLUTE} and
46
+ * {@link MatchRecord.IF_DIR} flags.
30
47
  */
31
48
  export class MatchRecord {
49
+ static ABSOLUTE = 2;
50
+ static IF_DIR = 1;
32
51
  store = new Map();
33
52
  add(target, absolute, ifDir) {
34
- const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
53
+ const n = (absolute ? MatchRecord.ABSOLUTE : 0) |
54
+ (ifDir ? MatchRecord.IF_DIR : 0);
35
55
  const current = this.store.get(target);
36
56
  this.store.set(target, current === undefined ? n : n & current);
37
57
  }
38
- // match, absolute, ifdir
39
- entries() {
40
- return [...this.store.entries()].map(([path, n]) => [
41
- path,
42
- !!(n & 2),
43
- !!(n & 1),
44
- ]);
45
- }
46
58
  }
47
59
  /**
48
60
  * A collection of patterns that must be processed in a subsequent step
@@ -185,7 +197,7 @@ export class Processor {
185
197
  }
186
198
  }
187
199
  }
188
- else if (p instanceof RegExp) {
200
+ else if (typeof p === 'object') {
189
201
  this.subwalks.add(t, pattern);
190
202
  }
191
203
  }
@@ -213,8 +225,8 @@ export class Processor {
213
225
  if (p === GLOBSTAR) {
214
226
  results.testGlobstar(e, pattern, rest, absolute);
215
227
  }
216
- else if (p instanceof RegExp) {
217
- results.testRegExp(e, p, rest, absolute);
228
+ else if (typeof p === 'object') {
229
+ results.testMatcher(e, p, rest, absolute);
218
230
  }
219
231
  else {
220
232
  results.testString(e, p, rest, absolute);
@@ -264,13 +276,14 @@ export class Processor {
264
276
  /* c8 ignore stop */
265
277
  this.subwalks.add(ep, rest);
266
278
  }
267
- else if (rp instanceof RegExp) {
268
- this.testRegExp(e, rp, rest.rest(), absolute);
279
+ else if (typeof rp === 'object') {
280
+ this.testMatcher(e, rp, rest.rest(), absolute);
269
281
  }
270
282
  }
271
283
  }
272
- testRegExp(e, p, rest, absolute) {
273
- if (!p.test(e.name))
284
+ testMatcher(e, p, rest, absolute) {
285
+ // an entry name is one path portion, with no `/`
286
+ if (!p.testUnchecked(e.name))
274
287
  return;
275
288
  if (!rest) {
276
289
  this.matches.add(e, absolute, false);
@@ -1 +1 @@
1
- {"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,QAAQ,EAAY,MAAM,WAAW,CAAA;AAK9C;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,KAAK,CAA0B;IAC/B,YAAY,QAAkC,IAAI,GAAG,EAAE;QACrD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IACD,IAAI;QACF,OAAO,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,CAAC;IACD,SAAS,CAAC,MAAY,EAAE,OAAgB;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM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AQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,UAAU,CAAC,CAAO,EAAE,CAAS,EAAE,IAAoB,EAAE,QAAiB;QACpE,uBAAuB;QACvB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAM;QACzB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR, MMRegExp } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { MMPattern, Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path\n */\nexport class HasWalkedCache {\n store: Map<string, Set<string>>\n constructor(store: Map<string, Set<string>> = new Map()) {\n this.store = store\n }\n copy() {\n return new HasWalkedCache(new Map(this.store))\n }\n hasWalked(target: Path, pattern: Pattern) {\n return this.store.get(target.fullpath())?.has(pattern.globString())\n }\n storeWalked(target: Path, pattern: Pattern) {\n const fullpath = target.fullpath()\n const cached = this.store.get(fullpath)\n if (cached) cached.add(pattern.globString())\n else this.store.set(fullpath, new Set([pattern.globString()]))\n }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nexport class MatchRecord {\n store: Map<Path, number> = new Map()\n add(target: Path, absolute: boolean, ifDir: boolean) {\n const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0)\n const current = this.store.get(target)\n this.store.set(target, current === undefined ? n : n & current)\n }\n // match, absolute, ifdir\n entries(): [Path, boolean, boolean][] {\n return [...this.store.entries()].map(([path, n]) => [\n path,\n !!(n & 2),\n !!(n & 1),\n ])\n }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n store: Map<Path, Pattern[]> = new Map()\n add(target: Path, pattern: Pattern) {\n if (!target.canReaddir()) {\n return\n }\n const subs = this.store.get(target)\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern)\n }\n } else this.store.set(target, [pattern])\n }\n get(target: Path): Pattern[] {\n const subs = this.store.get(target)\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path')\n }\n /* c8 ignore stop */\n return subs\n }\n entries(): [Path, Pattern[]][] {\n return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n }\n keys(): Path[] {\n return [...this.store.keys()].filter(t => t.canReaddir())\n }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n hasWalkedCache: HasWalkedCache\n matches = new MatchRecord()\n subwalks = new SubWalks()\n patterns?: Pattern[]\n follow: boolean\n dot: boolean\n opts: GlobWalkerOpts\n\n constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n this.opts = opts\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.hasWalkedCache =\n hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache()\n }\n\n processPatterns(target: Path, patterns: Pattern[]) {\n this.patterns = patterns\n const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern)\n\n const root = pattern.root()\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n // start absolute patterns at root\n if (root) {\n t = t.resolve(\n root === '/' && this.opts.root !== undefined ?\n this.opts.root\n : root,\n )\n const rest = pattern.rest()\n if (!rest) {\n this.matches.add(t, true, false)\n continue\n } else {\n pattern = rest\n }\n }\n\n if (t.isENOENT()) continue\n\n let p: MMPattern\n let rest: Pattern | null\n let changed = false\n while (\n typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())\n ) {\n const c = t.resolve(p)\n t = c\n pattern = rest\n changed = true\n }\n p = pattern.pattern()\n rest = pattern.rest()\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n this.hasWalkedCache.storeWalked(t, pattern)\n }\n\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\n continue\n } else if (p === GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (\n !t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()\n ) {\n this.subwalks.add(t, pattern)\n }\n const rp = rest?.pattern()\n const rrest = rest?.rest()\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.')\n } else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t\n /* c8 ignore stop */\n if (!rrest) this.matches.add(tp, absolute, true)\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest)\n }\n }\n }\n } else if (p instanceof RegExp) {\n this.subwalks.add(t, pattern)\n }\n }\n\n return this\n }\n\n subwalkTargets(): Path[] {\n return this.subwalks.keys()\n }\n\n child() {\n return new Processor(this.opts, this.hasWalkedCache)\n }\n\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent: Path, entries: Path[]): Processor {\n const patterns = this.subwalks.get(parent)\n // put matches and entry walks into the results processor\n const results = this.child()\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute()\n const p = pattern.pattern()\n const rest = pattern.rest()\n if (p === GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute)\n } else if (p instanceof RegExp) {\n results.testRegExp(e, p, rest, absolute)\n } else {\n results.testString(e, p, rest, absolute)\n }\n }\n }\n return results\n }\n\n testGlobstar(\n e: Path,\n pattern: Pattern,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false)\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern)\n } else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest)\n } else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern)\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern()\n if (\n typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.'\n ) {\n this.testString(e, rp, rest.rest(), absolute)\n } else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e\n /* c8 ignore stop */\n this.subwalks.add(ep, rest)\n } else if (rp instanceof RegExp) {\n this.testRegExp(e, rp, rest.rest(), absolute)\n }\n }\n }\n\n testRegExp(\n e: Path,\n p: MMRegExp,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (!p.test(e.name)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n\n testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n // should never happen?\n if (!e.isNamed(p)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n}\n"]}
1
+ {"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAKpC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,cAAc;IACzB,MAAM,CAAiB;IACvB,KAAK,CAA2B;IAChC,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IACD,IAAI;QACF,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IACD,mEAAmE;IACnE,KAAK,CAAC,QAAgB;QACpB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;QACrC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IAChE,CAAC;IAED,SAAS,CAAC,MAAY,EAAE,OAAgB;QACtC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACnE,CAAC;IACD,WAAW,CAAC,MAAY,EAAE,OAAgB;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK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AAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR } from 'minimatch'\nimport type { Path } from 'path-scurry'\nimport type { MMMatcher, MMPattern, Pattern } from './pattern.js'\nimport type { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path, in\n * this walk step and the steps that led to it.\n *\n * A step only adds to it before it makes the caches for the next\n * steps, so a copy can look up the chain of caches before it, in\n * place of copying their entries. A pattern for a path that a cache\n * up the chain has already seen is added to that cache's set, so that\n * the other steps that share it see it too. Paths are keyed by their\n * full path, because path-scurry can make a new Path object for the\n * same path once its cache of children is full.\n */\nexport class HasWalkedCache {\n parent?: HasWalkedCache\n store?: Map<string, Set<string>>\n constructor(parent?: HasWalkedCache) {\n this.parent = parent\n }\n copy() {\n return new HasWalkedCache(this)\n }\n // the set for the path in this cache, or the closest one before it\n #find(fullpath: string): Set<string> | undefined {\n const set = this.store?.get(fullpath)\n return set || !this.parent ? set : this.parent.#find(fullpath)\n }\n\n hasWalked(target: Path, pattern: Pattern) {\n return !!this.#find(target.fullpath())?.has(pattern.globString())\n }\n storeWalked(target: Path, pattern: Pattern) {\n const fullpath = target.fullpath()\n const cached = this.#find(fullpath)\n if (cached) cached.add(pattern.globString())\n else\n (this.store ??= new Map()).set(\n fullpath,\n new Set([pattern.globString()]),\n )\n }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n * The store maps each path to {@link MatchRecord.ABSOLUTE} and\n * {@link MatchRecord.IF_DIR} flags.\n */\nexport class MatchRecord {\n static readonly ABSOLUTE = 2\n static readonly IF_DIR = 1\n store: Map<Path, number> = new Map()\n add(target: Path, absolute: boolean, ifDir: boolean) {\n const n =\n (absolute ? MatchRecord.ABSOLUTE : 0) |\n (ifDir ? MatchRecord.IF_DIR : 0)\n const current = this.store.get(target)\n this.store.set(target, current === undefined ? n : n & current)\n }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n store: Map<Path, Pattern[]> = new Map()\n add(target: Path, pattern: Pattern) {\n if (!target.canReaddir()) {\n return\n }\n const subs = this.store.get(target)\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern)\n }\n } else this.store.set(target, [pattern])\n }\n get(target: Path): Pattern[] {\n const subs = this.store.get(target)\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path')\n }\n /* c8 ignore stop */\n return subs\n }\n entries(): [Path, Pattern[]][] {\n return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n }\n keys(): Path[] {\n return [...this.store.keys()].filter(t => t.canReaddir())\n }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n hasWalkedCache: HasWalkedCache\n matches = new MatchRecord()\n subwalks = new SubWalks()\n patterns?: Pattern[]\n follow: boolean\n dot: boolean\n opts: GlobWalkerOpts\n\n constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n this.opts = opts\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.hasWalkedCache =\n hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache()\n }\n\n processPatterns(target: Path, patterns: Pattern[]) {\n this.patterns = patterns\n const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern)\n\n const root = pattern.root()\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n // start absolute patterns at root\n if (root) {\n t = t.resolve(\n root === '/' && this.opts.root !== undefined ?\n this.opts.root\n : root,\n )\n const rest = pattern.rest()\n if (!rest) {\n this.matches.add(t, true, false)\n continue\n } else {\n pattern = rest\n }\n }\n\n if (t.isENOENT()) continue\n\n let p: MMPattern\n let rest: Pattern | null\n let changed = false\n while (\n typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())\n ) {\n const c = t.resolve(p)\n t = c\n pattern = rest\n changed = true\n }\n p = pattern.pattern()\n rest = pattern.rest()\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n this.hasWalkedCache.storeWalked(t, pattern)\n }\n\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\n continue\n } else if (p === GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (\n !t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()\n ) {\n this.subwalks.add(t, pattern)\n }\n const rp = rest?.pattern()\n const rrest = rest?.rest()\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.')\n } else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t\n /* c8 ignore stop */\n if (!rrest) this.matches.add(tp, absolute, true)\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest)\n }\n }\n }\n } else if (typeof p === 'object') {\n this.subwalks.add(t, pattern)\n }\n }\n\n return this\n }\n\n subwalkTargets(): Path[] {\n return this.subwalks.keys()\n }\n\n child() {\n return new Processor(this.opts, this.hasWalkedCache)\n }\n\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent: Path, entries: Path[]): Processor {\n const patterns = this.subwalks.get(parent)\n // put matches and entry walks into the results processor\n const results = this.child()\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute()\n const p = pattern.pattern()\n const rest = pattern.rest()\n if (p === GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute)\n } else if (typeof p === 'object') {\n results.testMatcher(e, p, rest, absolute)\n } else {\n results.testString(e, p, rest, absolute)\n }\n }\n }\n return results\n }\n\n testGlobstar(\n e: Path,\n pattern: Pattern,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false)\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern)\n } else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest)\n } else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern)\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern()\n if (\n typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.'\n ) {\n this.testString(e, rp, rest.rest(), absolute)\n } else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e\n /* c8 ignore stop */\n this.subwalks.add(ep, rest)\n } else if (typeof rp === 'object') {\n this.testMatcher(e, rp, rest.rest(), absolute)\n }\n }\n }\n\n testMatcher(\n e: Path,\n p: MMMatcher,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n // an entry name is one path portion, with no `/`\n if (!p.testUnchecked(e.name)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n\n testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n // should never happen?\n if (!e.isNamed(p)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n}\n"]}
@@ -5,9 +5,10 @@
5
5
  * @module
6
6
  */
7
7
  import { Minipass } from 'minipass';
8
- import { Path } from 'path-scurry';
9
- import { IgnoreLike } from './ignore.js';
10
- import { Pattern } from './pattern.js';
8
+ import type { Form } from 'minimatch';
9
+ import type { Path } from 'path-scurry';
10
+ import type { IgnoreLike } from './ignore.js';
11
+ import type { Pattern } from './pattern.js';
11
12
  import { Processor } from './processor.js';
12
13
  export interface GlobWalkerOpts {
13
14
  absolute?: boolean;
@@ -16,7 +17,7 @@ export interface GlobWalkerOpts {
16
17
  dot?: boolean;
17
18
  dotRelative?: boolean;
18
19
  follow?: boolean;
19
- ignore?: string | string[] | IgnoreLike;
20
+ ignore?: string | string[] | IgnoreLike | ReadonlyArray<string>;
20
21
  mark?: boolean;
21
22
  matchBase?: boolean;
22
23
  maxDepth?: number;
@@ -25,6 +26,7 @@ export interface GlobWalkerOpts {
25
26
  nodir?: boolean;
26
27
  noext?: boolean;
27
28
  noglobstar?: boolean;
29
+ normalize?: boolean | Form;
28
30
  platform?: NodeJS.Platform;
29
31
  posix?: boolean;
30
32
  realpath?: boolean;
@@ -45,7 +47,7 @@ export type GWOFileTypesUnset = GlobWalkerOpts & {
45
47
  withFileTypes?: undefined;
46
48
  };
47
49
  export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
48
- export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
50
+ export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path[] : O extends GWOFileTypesFalse ? string[] : O extends GWOFileTypesUnset ? string[] : (Path | string)[];
49
51
  export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
50
52
  /**
51
53
  * basic walking utilities that all the glob walker types use
@@ -64,28 +66,28 @@ export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts
64
66
  constructor(patterns: Pattern[], path: Path, opts: O);
65
67
  pause(): void;
66
68
  resume(): void;
67
- onResume(fn: () => any): void;
68
- matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
69
+ onResume(fn: () => unknown): void;
70
+ matchCheck(inPath: Path, ifDir: boolean): Promise<Path | undefined>;
69
71
  matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
70
- matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
72
+ matchCheckSync(inPath: Path, ifDir: boolean): Path | undefined;
71
73
  abstract matchEmit(p: Result<O>): void;
72
74
  abstract matchEmit(p: string | Path): void;
73
75
  matchFinish(e: Path, absolute: boolean): void;
74
76
  match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
75
77
  matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
76
- walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
77
- walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
78
- walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
79
- walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
80
- walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
81
- walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
78
+ walkCB(target: Path, patterns: Pattern[], cb: () => unknown): unknown;
79
+ walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => unknown): unknown;
80
+ walkCB3(target: Path, entries: Path[], processorx: Processor, cb: () => unknown): void;
81
+ walkCBSync(target: Path, patterns: Pattern[], cb: () => unknown): unknown;
82
+ walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => unknown): unknown;
83
+ walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => unknown): void;
82
84
  }
83
85
  export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
84
- matches: Set<Result<O>>;
86
+ matches: Result<O>[];
85
87
  constructor(patterns: Pattern[], path: Path, opts: O);
86
88
  matchEmit(e: Result<O>): void;
87
- walk(): Promise<Set<Result<O>>>;
88
- walkSync(): Set<Result<O>>;
89
+ walk(): Promise<Result<O>[]>;
90
+ walkSync(): Result<O>[];
89
91
  }
90
92
  export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
91
93
  results: Minipass<Result<O>, Result<O>>;
@@ -1 +1 @@
1
- {"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,G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