@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.
- package/dist/main.js +11646 -7952
- package/dist/native-pi-entry.js +14 -1
- package/dist/project-pi-entry.js +46 -8
- package/dist/runtime/workflows/task-bootstrap/prompt.md +2 -0
- package/dist/web/assets/{Assistant-B3h2yQF3.css → Assistant-4yZWjYm-.css} +1 -1
- package/dist/web/assets/Assistant-BNVXOHQZ.js +1 -0
- package/dist/web/assets/Dashboard-zKTK6EZD.js +1 -0
- package/dist/web/assets/Files-DI98WkdW.js +1 -0
- package/dist/web/assets/{Markdown-Bq8P_NBV.js → Markdown-D3cU0ani.js} +4 -4
- package/dist/web/assets/Materials-CK-mbNmo.css +1 -0
- package/dist/web/assets/Materials-CWptgAHz.js +6 -0
- package/dist/web/assets/Sessions-DiDwqXLI.js +1 -0
- package/dist/web/assets/WorkspaceTree-DeAA1QtV.js +1 -0
- package/dist/web/assets/{file-links-CFCIacLV.js → file-links-GfCXWkEh.js} +1 -1
- package/dist/web/assets/index-BwEl1PIa.js +66 -0
- package/dist/web/assets/{index-B-MqU_88.css → index-CTIAGUGG.css} +1 -1
- package/dist/web/downloads/teammy-skill.zip +0 -0
- package/dist/web/index.html +2 -2
- package/node_modules/@isaacs/nonrecursive-glob-match/LICENSE.md +55 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/README.md +333 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts +114 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js +762 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts +4 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js +142 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts +114 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js +758 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js.map +7 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts +4 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js +138 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/package.json +56 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/src/index.ts +900 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/src/parse-class.ts +158 -0
- package/node_modules/@wecom/aibot-node-sdk/README.md +786 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/api.d.ts +17 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/client.d.ts +217 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/crypto.d.ts +12 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js +1563 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js.map +1 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.d.ts +1324 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js +1544 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js.map +1 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/logger.d.ts +14 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/message-handler.d.ts +29 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/api.d.ts +466 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/common.d.ts +30 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/config.d.ts +34 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/event.d.ts +109 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/index.d.ts +10 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/message.d.ts +158 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/utils.d.ts +19 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/wecom-crypto/index.d.ts +46 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/ws.d.ts +161 -0
- package/node_modules/@wecom/aibot-node-sdk/package.json +43 -0
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/axios/CHANGELOG.md +1934 -0
- package/node_modules/axios/LICENSE +7 -0
- package/node_modules/axios/MIGRATION_GUIDE.md +877 -0
- package/node_modules/axios/README.md +2786 -0
- package/node_modules/axios/dist/axios.js +6460 -0
- package/node_modules/axios/dist/axios.min.js +5 -0
- package/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/axios/dist/browser/axios.cjs +6509 -0
- package/node_modules/axios/dist/esm/axios.js +6530 -0
- package/node_modules/axios/dist/esm/axios.min.js +3 -0
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/axios/dist/node/axios.cjs +7491 -0
- package/node_modules/axios/index.d.cts +785 -0
- package/node_modules/axios/index.d.ts +804 -0
- package/node_modules/axios/index.js +45 -0
- package/node_modules/axios/lib/adapters/README.md +36 -0
- package/node_modules/axios/lib/adapters/adapters.js +132 -0
- package/node_modules/axios/lib/adapters/fetch.js +749 -0
- package/node_modules/axios/lib/adapters/http.js +1609 -0
- package/node_modules/axios/lib/adapters/xhr.js +384 -0
- package/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/axios/lib/cancel/CancelToken.js +135 -0
- package/node_modules/axios/lib/cancel/CanceledError.js +22 -0
- package/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/axios/lib/core/Axios.js +361 -0
- package/node_modules/axios/lib/core/AxiosError.js +278 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +487 -0
- package/node_modules/axios/lib/core/InterceptorManager.js +182 -0
- package/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/buildFullPath.js +76 -0
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +115 -0
- package/node_modules/axios/lib/core/mergeConfig.js +237 -0
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/axios/lib/defaults/index.js +178 -0
- package/node_modules/axios/lib/defaults/transitional.js +11 -0
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +165 -0
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
- package/node_modules/axios/lib/helpers/Http2Sessions.js +122 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
- package/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/node_modules/axios/lib/helpers/bind.js +14 -0
- package/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/node_modules/axios/lib/helpers/callbackify.js +18 -0
- package/node_modules/axios/lib/helpers/combineURLs.js +23 -0
- package/node_modules/axios/lib/helpers/composeSignals.js +71 -0
- package/node_modules/axios/lib/helpers/cookies.js +88 -0
- package/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +193 -0
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +149 -0
- package/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
- package/node_modules/axios/lib/helpers/fromDataURI.js +75 -0
- package/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
- package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +72 -0
- package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
- package/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +120 -0
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +520 -0
- package/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/axios/lib/helpers/throttle.js +45 -0
- package/node_modules/axios/lib/helpers/toFormData.js +279 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/node_modules/axios/lib/helpers/trackStream.js +89 -0
- package/node_modules/axios/lib/helpers/validator.js +112 -0
- package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/axios/lib/platform/common/utils.js +52 -0
- package/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/node/index.js +37 -0
- package/node_modules/axios/lib/utils.js +1201 -0
- package/node_modules/axios/node_modules/agent-base/README.md +145 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/package.json +64 -0
- package/node_modules/axios/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/axios/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/axios/package.json +202 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +79 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/eventemitter3/README.md +85 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
- package/node_modules/eventemitter3/index.d.ts +135 -0
- package/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/eventemitter3/index.mjs +4 -0
- package/node_modules/eventemitter3/package.json +62 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +183 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +714 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/form-data/CHANGELOG.md +686 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md +355 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +4 -0
- package/node_modules/form-data/lib/form_data.js +506 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/package.json +82 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/glob/README.md +388 -214
- package/node_modules/glob/dist/commonjs/glob.d.ts +20 -11
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/glob.js +22 -29
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -1
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +1 -1
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/has-magic.js +1 -4
- package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -1
- package/node_modules/glob/dist/commonjs/ignore.d.ts +16 -4
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/ignore.js +24 -4
- package/node_modules/glob/dist/commonjs/ignore.js.map +1 -1
- package/node_modules/glob/dist/commonjs/index.d.ts +3 -2
- package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/index.js.map +1 -1
- package/node_modules/glob/dist/commonjs/index.min.js +2 -3
- package/node_modules/glob/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/glob/dist/commonjs/pattern.d.ts +10 -3
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/pattern.js +27 -15
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -1
- package/node_modules/glob/dist/commonjs/processor.d.ts +23 -10
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/processor.js +36 -23
- package/node_modules/glob/dist/commonjs/processor.js.map +1 -1
- package/node_modules/glob/dist/commonjs/walker.d.ts +19 -17
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/walker.js +50 -35
- package/node_modules/glob/dist/commonjs/walker.js.map +1 -1
- package/node_modules/glob/dist/esm/glob.d.ts +20 -11
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/glob.js +22 -29
- package/node_modules/glob/dist/esm/glob.js.map +1 -1
- package/node_modules/glob/dist/esm/has-magic.d.ts +1 -1
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/has-magic.js +1 -4
- package/node_modules/glob/dist/esm/has-magic.js.map +1 -1
- package/node_modules/glob/dist/esm/ignore.d.ts +16 -4
- package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/ignore.js +25 -5
- package/node_modules/glob/dist/esm/ignore.js.map +1 -1
- package/node_modules/glob/dist/esm/index.d.ts +3 -2
- package/node_modules/glob/dist/esm/index.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/index.js.map +1 -1
- package/node_modules/glob/dist/esm/index.min.js +2 -3
- package/node_modules/glob/dist/esm/index.min.js.map +4 -4
- package/node_modules/glob/dist/esm/pattern.d.ts +10 -3
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/pattern.js +27 -15
- package/node_modules/glob/dist/esm/pattern.js.map +1 -1
- package/node_modules/glob/dist/esm/processor.d.ts +23 -10
- package/node_modules/glob/dist/esm/processor.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/processor.js +36 -23
- package/node_modules/glob/dist/esm/processor.js.map +1 -1
- package/node_modules/glob/dist/esm/walker.d.ts +19 -17
- package/node_modules/glob/dist/esm/walker.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/walker.js +51 -36
- package/node_modules/glob/dist/esm/walker.js.map +1 -1
- package/node_modules/glob/package.json +28 -12
- package/node_modules/glob/src/glob.ts +655 -0
- package/node_modules/glob/src/has-magic.ts +23 -0
- package/node_modules/glob/src/ignore.ts +162 -0
- package/node_modules/glob/src/index.ts +225 -0
- package/node_modules/glob/src/pattern.ts +286 -0
- package/node_modules/glob/src/processor.ts +333 -0
- package/node_modules/glob/src/walker.ts +523 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +58 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/minimatch/README.md +125 -107
- package/node_modules/minimatch/dist/commonjs/index.d.ts +49 -38
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/minimatch/dist/commonjs/index.js +782 -359
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -1
- package/node_modules/minimatch/dist/esm/index.d.ts +49 -38
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -1
- package/node_modules/minimatch/dist/esm/index.js +781 -356
- package/node_modules/minimatch/dist/esm/index.js.map +1 -1
- package/node_modules/minimatch/package.json +5 -4
- package/node_modules/path-scurry/README.md +0 -1
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +7 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/path-scurry/dist/commonjs/index.js +59 -21
- package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -1
- package/node_modules/path-scurry/dist/esm/index.d.ts +7 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -1
- package/node_modules/path-scurry/dist/esm/index.js +42 -14
- package/node_modules/path-scurry/dist/esm/index.js.map +1 -1
- package/node_modules/path-scurry/package.json +4 -4
- package/node_modules/proxy-from-env/LICENSE +20 -0
- package/node_modules/proxy-from-env/README.md +163 -0
- package/node_modules/proxy-from-env/index.cjs +105 -0
- package/node_modules/proxy-from-env/index.js +103 -0
- package/node_modules/proxy-from-env/package.json +43 -0
- package/package.json +3 -1
- package/dist/web/assets/Assistant-DSQAdSiW.js +0 -1
- package/dist/web/assets/Dashboard-dCu2Cdxd.js +0 -1
- package/dist/web/assets/Files-cRhoWviM.js +0 -1
- package/dist/web/assets/Sessions-BxHsX1C5.js +0 -1
- package/dist/web/assets/WorkspaceTree-CD94JsaJ.js +0 -1
- package/dist/web/assets/index-BXpTaAUz.js +0 -66
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/ast.js +0 -845
- package/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
- package/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/ast.js +0 -841
- package/node_modules/minimatch/dist/esm/ast.js.map +0 -1
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// give it a pattern, and it'll be able to tell you if
|
|
2
|
+
// a given path should be ignored.
|
|
3
|
+
// Ignoring a path ignores its children if the pattern ends in /**
|
|
4
|
+
// Ignores are always parsed in dot:true mode
|
|
5
|
+
|
|
6
|
+
import type { MinimatchOptions } from 'minimatch'
|
|
7
|
+
import { escape, Minimatch } from 'minimatch'
|
|
8
|
+
import type { Path } from 'path-scurry'
|
|
9
|
+
import { Pattern } from './pattern.js'
|
|
10
|
+
import type { GlobWalkerOpts } from './walker.js'
|
|
11
|
+
|
|
12
|
+
export interface IgnoreLike {
|
|
13
|
+
ignored?: (p: Path) => boolean
|
|
14
|
+
childrenIgnored?: (p: Path) => boolean
|
|
15
|
+
add?: (ignore: string) => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const defaultPlatform: NodeJS.Platform =
|
|
19
|
+
(
|
|
20
|
+
typeof process === 'object' &&
|
|
21
|
+
process &&
|
|
22
|
+
typeof process.platform === 'string'
|
|
23
|
+
) ?
|
|
24
|
+
process.platform
|
|
25
|
+
: 'linux'
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Class used to process ignored patterns
|
|
29
|
+
*/
|
|
30
|
+
export class Ignore implements IgnoreLike {
|
|
31
|
+
relative: Minimatch[]
|
|
32
|
+
relativeChildren: Minimatch[]
|
|
33
|
+
absolute: Minimatch[]
|
|
34
|
+
absoluteChildren: Minimatch[]
|
|
35
|
+
platform: NodeJS.Platform
|
|
36
|
+
mmopts: MinimatchOptions
|
|
37
|
+
/**
|
|
38
|
+
* The escaped glob for the directory that a pattern starting with
|
|
39
|
+
* `/` is rooted at, with no trailing `/`.
|
|
40
|
+
*/
|
|
41
|
+
slashRoot: string
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Patterns that start with `/` (but not drive letters or UNC paths
|
|
45
|
+
* on Windows) start at the `root` option if it is set, or else at
|
|
46
|
+
* the root of `cwd`, the same as non-ignored patterns. If `cwd` is
|
|
47
|
+
* not provided, they start at `/`.
|
|
48
|
+
*/
|
|
49
|
+
constructor(
|
|
50
|
+
ignored: string[],
|
|
51
|
+
{
|
|
52
|
+
nobrace,
|
|
53
|
+
nocase,
|
|
54
|
+
noext,
|
|
55
|
+
noglobstar,
|
|
56
|
+
normalize,
|
|
57
|
+
platform = defaultPlatform,
|
|
58
|
+
root,
|
|
59
|
+
windowsPathsNoEscape,
|
|
60
|
+
allowWindowsEscape,
|
|
61
|
+
}: GlobWalkerOpts,
|
|
62
|
+
cwd?: Path,
|
|
63
|
+
) {
|
|
64
|
+
this.relative = []
|
|
65
|
+
this.absolute = []
|
|
66
|
+
this.relativeChildren = []
|
|
67
|
+
this.absoluteChildren = []
|
|
68
|
+
this.platform = platform
|
|
69
|
+
windowsPathsNoEscape =
|
|
70
|
+
!!windowsPathsNoEscape || allowWindowsEscape === false
|
|
71
|
+
this.mmopts = {
|
|
72
|
+
dot: true,
|
|
73
|
+
nobrace,
|
|
74
|
+
nocase,
|
|
75
|
+
noext,
|
|
76
|
+
noglobstar,
|
|
77
|
+
normalize,
|
|
78
|
+
optimizationLevel: 2,
|
|
79
|
+
platform,
|
|
80
|
+
nocomment: true,
|
|
81
|
+
nonegate: true,
|
|
82
|
+
windowsPathsNoEscape,
|
|
83
|
+
}
|
|
84
|
+
const slashRoot = cwd?.resolve(root ?? '/').fullpath() ?? '/'
|
|
85
|
+
this.slashRoot = escape(
|
|
86
|
+
slashRoot.replace(/\\/g, '/').replace(/\/$/, ''),
|
|
87
|
+
{ windowsPathsNoEscape },
|
|
88
|
+
)
|
|
89
|
+
for (const ign of ignored) this.add(ign)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
add(ign: string) {
|
|
93
|
+
// this is a little weird, but it gives us a clean set of optimized
|
|
94
|
+
// minimatch matchers, without getting tripped up if one of them
|
|
95
|
+
// ends in /** inside a brace section, and it's only inefficient at
|
|
96
|
+
// the start of the walk, not along it.
|
|
97
|
+
// It'd be nice if the Pattern class just had a .test() method, but
|
|
98
|
+
// handling globstars is a bit of a pita, and that code already lives
|
|
99
|
+
// in minimatch anyway.
|
|
100
|
+
// Another way would be if maybe Minimatch could take its set/globParts
|
|
101
|
+
// as an option, and then we could at least just use Pattern to test
|
|
102
|
+
// for absolute-ness.
|
|
103
|
+
// Yet another way, Minimatch could take an array of glob strings, and
|
|
104
|
+
// a cwd option, and do the right thing.
|
|
105
|
+
const mm = new Minimatch(ign, this.mmopts)
|
|
106
|
+
for (let i = 0; i < mm.set.length; i++) {
|
|
107
|
+
const parsed = mm.set[i]
|
|
108
|
+
const globParts = mm.globParts[i]
|
|
109
|
+
/* c8 ignore start */
|
|
110
|
+
if (!parsed || !globParts) {
|
|
111
|
+
throw new Error('invalid pattern object')
|
|
112
|
+
}
|
|
113
|
+
// strip off leading ./ portions
|
|
114
|
+
// https://github.com/isaacs/node-glob/issues/570
|
|
115
|
+
while (parsed[0] === '.' && globParts[0] === '.') {
|
|
116
|
+
parsed.shift()
|
|
117
|
+
globParts.shift()
|
|
118
|
+
}
|
|
119
|
+
/* c8 ignore stop */
|
|
120
|
+
const p = new Pattern(parsed, globParts, 0, this.platform)
|
|
121
|
+
const glob =
|
|
122
|
+
p.root() === '/' ?
|
|
123
|
+
`${this.slashRoot}/${p.rest()?.globString() ?? ''}`
|
|
124
|
+
: p.globString()
|
|
125
|
+
const m = new Minimatch(glob, this.mmopts)
|
|
126
|
+
const children = globParts[globParts.length - 1] === '**'
|
|
127
|
+
const absolute = p.isAbsolute()
|
|
128
|
+
if (absolute) this.absolute.push(m)
|
|
129
|
+
else this.relative.push(m)
|
|
130
|
+
if (children) {
|
|
131
|
+
if (absolute) this.absoluteChildren.push(m)
|
|
132
|
+
else this.relativeChildren.push(m)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
ignored(p: Path): boolean {
|
|
138
|
+
const fullpath = p.fullpath()
|
|
139
|
+
const fullpaths = `${fullpath}/`
|
|
140
|
+
const relative = p.relative() || '.'
|
|
141
|
+
const relatives = `${relative}/`
|
|
142
|
+
for (const m of this.relative) {
|
|
143
|
+
if (m.match(relative) || m.match(relatives)) return true
|
|
144
|
+
}
|
|
145
|
+
for (const m of this.absolute) {
|
|
146
|
+
if (m.match(fullpath) || m.match(fullpaths)) return true
|
|
147
|
+
}
|
|
148
|
+
return false
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
childrenIgnored(p: Path): boolean {
|
|
152
|
+
const fullpath = `${p.fullpath()}/`
|
|
153
|
+
const relative = `${p.relative() || '.'}/`
|
|
154
|
+
for (const m of this.relativeChildren) {
|
|
155
|
+
if (m.match(relative)) return true
|
|
156
|
+
}
|
|
157
|
+
for (const m of this.absoluteChildren) {
|
|
158
|
+
if (m.match(fullpath)) return true
|
|
159
|
+
}
|
|
160
|
+
return false
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { escape, unescape } from 'minimatch'
|
|
2
|
+
import type { Minipass } from 'minipass'
|
|
3
|
+
import type { Path } from 'path-scurry'
|
|
4
|
+
import type {
|
|
5
|
+
GlobOptions,
|
|
6
|
+
GlobOptionsWithFileTypesFalse,
|
|
7
|
+
GlobOptionsWithFileTypesTrue,
|
|
8
|
+
GlobOptionsWithFileTypesUnset,
|
|
9
|
+
} from './glob.js'
|
|
10
|
+
import { Glob } from './glob.js'
|
|
11
|
+
import { hasMagic } from './has-magic.js'
|
|
12
|
+
|
|
13
|
+
export { escape, unescape } from 'minimatch'
|
|
14
|
+
export type { Form } from 'minimatch'
|
|
15
|
+
export type {
|
|
16
|
+
FSOption,
|
|
17
|
+
Path,
|
|
18
|
+
WalkOptions,
|
|
19
|
+
WalkOptionsWithFileTypesTrue,
|
|
20
|
+
WalkOptionsWithFileTypesUnset,
|
|
21
|
+
} from 'path-scurry'
|
|
22
|
+
export { Glob } from './glob.js'
|
|
23
|
+
export type {
|
|
24
|
+
GlobOptions,
|
|
25
|
+
GlobOptionsWithFileTypesFalse,
|
|
26
|
+
GlobOptionsWithFileTypesTrue,
|
|
27
|
+
GlobOptionsWithFileTypesUnset,
|
|
28
|
+
} from './glob.js'
|
|
29
|
+
export { hasMagic } from './has-magic.js'
|
|
30
|
+
export { Ignore } from './ignore.js'
|
|
31
|
+
export type { IgnoreLike } from './ignore.js'
|
|
32
|
+
export type { MatchStream } from './walker.js'
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
|
36
|
+
* you consume them, even all in a single tick if you consume them immediately,
|
|
37
|
+
* but will still respond to backpressure if they're not consumed immediately.
|
|
38
|
+
*/
|
|
39
|
+
export function globStreamSync(
|
|
40
|
+
pattern: string | string[],
|
|
41
|
+
options: GlobOptionsWithFileTypesTrue,
|
|
42
|
+
): Minipass<Path, Path>
|
|
43
|
+
export function globStreamSync(
|
|
44
|
+
pattern: string | string[],
|
|
45
|
+
options: GlobOptionsWithFileTypesFalse,
|
|
46
|
+
): Minipass<string, string>
|
|
47
|
+
export function globStreamSync(
|
|
48
|
+
pattern: string | string[],
|
|
49
|
+
options: GlobOptionsWithFileTypesUnset,
|
|
50
|
+
): Minipass<string, string>
|
|
51
|
+
export function globStreamSync(
|
|
52
|
+
pattern: string | string[],
|
|
53
|
+
options: GlobOptions,
|
|
54
|
+
): Minipass<Path, Path> | Minipass<string, string>
|
|
55
|
+
export function globStreamSync(
|
|
56
|
+
pattern: string | string[],
|
|
57
|
+
options: GlobOptions = {},
|
|
58
|
+
) {
|
|
59
|
+
return new Glob(pattern, options).streamSync()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Return a stream that emits all the strings or `Path` objects and
|
|
64
|
+
* then emits `end` when completed.
|
|
65
|
+
*/
|
|
66
|
+
export function globStream(
|
|
67
|
+
pattern: string | string[],
|
|
68
|
+
options: GlobOptionsWithFileTypesFalse,
|
|
69
|
+
): Minipass<string, string>
|
|
70
|
+
export function globStream(
|
|
71
|
+
pattern: string | string[],
|
|
72
|
+
options: GlobOptionsWithFileTypesTrue,
|
|
73
|
+
): Minipass<Path, Path>
|
|
74
|
+
export function globStream(
|
|
75
|
+
pattern: string | string[],
|
|
76
|
+
options?: GlobOptionsWithFileTypesUnset | undefined,
|
|
77
|
+
): Minipass<string, string>
|
|
78
|
+
export function globStream(
|
|
79
|
+
pattern: string | string[],
|
|
80
|
+
options: GlobOptions,
|
|
81
|
+
): Minipass<Path, Path> | Minipass<string, string>
|
|
82
|
+
export function globStream(
|
|
83
|
+
pattern: string | string[],
|
|
84
|
+
options: GlobOptions = {},
|
|
85
|
+
) {
|
|
86
|
+
return new Glob(pattern, options).stream()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Synchronous form of {@link glob}
|
|
91
|
+
*/
|
|
92
|
+
export function globSync(
|
|
93
|
+
pattern: string | string[],
|
|
94
|
+
options: GlobOptionsWithFileTypesFalse,
|
|
95
|
+
): string[]
|
|
96
|
+
export function globSync(
|
|
97
|
+
pattern: string | string[],
|
|
98
|
+
options: GlobOptionsWithFileTypesTrue,
|
|
99
|
+
): Path[]
|
|
100
|
+
export function globSync(
|
|
101
|
+
pattern: string | string[],
|
|
102
|
+
options?: GlobOptionsWithFileTypesUnset | undefined,
|
|
103
|
+
): string[]
|
|
104
|
+
export function globSync(
|
|
105
|
+
pattern: string | string[],
|
|
106
|
+
options: GlobOptions,
|
|
107
|
+
): Path[] | string[]
|
|
108
|
+
export function globSync(
|
|
109
|
+
pattern: string | string[],
|
|
110
|
+
options: GlobOptions = {},
|
|
111
|
+
) {
|
|
112
|
+
return new Glob(pattern, options).walkSync()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
|
117
|
+
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
|
118
|
+
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
|
119
|
+
* full option descriptions.
|
|
120
|
+
*/
|
|
121
|
+
async function glob_(
|
|
122
|
+
pattern: string | string[],
|
|
123
|
+
options?: GlobOptionsWithFileTypesUnset | undefined,
|
|
124
|
+
): Promise<string[]>
|
|
125
|
+
async function glob_(
|
|
126
|
+
pattern: string | string[],
|
|
127
|
+
options: GlobOptionsWithFileTypesTrue,
|
|
128
|
+
): Promise<Path[]>
|
|
129
|
+
async function glob_(
|
|
130
|
+
pattern: string | string[],
|
|
131
|
+
options: GlobOptionsWithFileTypesFalse,
|
|
132
|
+
): Promise<string[]>
|
|
133
|
+
async function glob_(
|
|
134
|
+
pattern: string | string[],
|
|
135
|
+
options: GlobOptions,
|
|
136
|
+
): Promise<Path[] | string[]>
|
|
137
|
+
async function glob_(
|
|
138
|
+
pattern: string | string[],
|
|
139
|
+
options: GlobOptions = {},
|
|
140
|
+
) {
|
|
141
|
+
return new Glob(pattern, options).walk()
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Return a sync iterator for walking glob pattern matches.
|
|
146
|
+
*/
|
|
147
|
+
export function globIterateSync(
|
|
148
|
+
pattern: string | string[],
|
|
149
|
+
options?: GlobOptionsWithFileTypesUnset | undefined,
|
|
150
|
+
): Generator<string, void, void>
|
|
151
|
+
export function globIterateSync(
|
|
152
|
+
pattern: string | string[],
|
|
153
|
+
options: GlobOptionsWithFileTypesTrue,
|
|
154
|
+
): Generator<Path, void, void>
|
|
155
|
+
export function globIterateSync(
|
|
156
|
+
pattern: string | string[],
|
|
157
|
+
options: GlobOptionsWithFileTypesFalse,
|
|
158
|
+
): Generator<string, void, void>
|
|
159
|
+
export function globIterateSync(
|
|
160
|
+
pattern: string | string[],
|
|
161
|
+
options: GlobOptions,
|
|
162
|
+
): Generator<Path, void, void> | Generator<string, void, void>
|
|
163
|
+
export function globIterateSync(
|
|
164
|
+
pattern: string | string[],
|
|
165
|
+
options: GlobOptions = {},
|
|
166
|
+
) {
|
|
167
|
+
return new Glob(pattern, options).iterateSync()
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Return an async iterator for walking glob pattern matches.
|
|
172
|
+
*/
|
|
173
|
+
export function globIterate(
|
|
174
|
+
pattern: string | string[],
|
|
175
|
+
options?: GlobOptionsWithFileTypesUnset | undefined,
|
|
176
|
+
): AsyncGenerator<string, void, void>
|
|
177
|
+
export function globIterate(
|
|
178
|
+
pattern: string | string[],
|
|
179
|
+
options: GlobOptionsWithFileTypesTrue,
|
|
180
|
+
): AsyncGenerator<Path, void, void>
|
|
181
|
+
export function globIterate(
|
|
182
|
+
pattern: string | string[],
|
|
183
|
+
options: GlobOptionsWithFileTypesFalse,
|
|
184
|
+
): AsyncGenerator<string, void, void>
|
|
185
|
+
export function globIterate(
|
|
186
|
+
pattern: string | string[],
|
|
187
|
+
options: GlobOptions,
|
|
188
|
+
): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>
|
|
189
|
+
export function globIterate(
|
|
190
|
+
pattern: string | string[],
|
|
191
|
+
options: GlobOptions = {},
|
|
192
|
+
) {
|
|
193
|
+
return new Glob(pattern, options).iterate()
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
|
|
197
|
+
export const streamSync = globStreamSync
|
|
198
|
+
export const stream = Object.assign(globStream, { sync: globStreamSync })
|
|
199
|
+
export const iterateSync = globIterateSync
|
|
200
|
+
export const iterate = Object.assign(globIterate, {
|
|
201
|
+
sync: globIterateSync,
|
|
202
|
+
})
|
|
203
|
+
export const sync = Object.assign(globSync, {
|
|
204
|
+
stream: globStreamSync,
|
|
205
|
+
iterate: globIterateSync,
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
export const glob = Object.assign(glob_, {
|
|
209
|
+
glob: glob_,
|
|
210
|
+
globSync,
|
|
211
|
+
sync,
|
|
212
|
+
globStream,
|
|
213
|
+
stream,
|
|
214
|
+
globStreamSync,
|
|
215
|
+
streamSync,
|
|
216
|
+
globIterate,
|
|
217
|
+
iterate,
|
|
218
|
+
globIterateSync,
|
|
219
|
+
iterateSync,
|
|
220
|
+
Glob,
|
|
221
|
+
hasMagic,
|
|
222
|
+
escape,
|
|
223
|
+
unescape,
|
|
224
|
+
})
|
|
225
|
+
glob.glob = glob
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// this is just a very light wrapper around 2 arrays with an offset index
|
|
2
|
+
|
|
3
|
+
import type { ParseReturnFiltered } from 'minimatch'
|
|
4
|
+
import { GLOBSTAR } from 'minimatch'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One portion of a parsed minimatch pattern: a string, a Matcher for
|
|
8
|
+
* a portion with magic, or GLOBSTAR for `**`.
|
|
9
|
+
*/
|
|
10
|
+
export type MMPattern = ParseReturnFiltered
|
|
11
|
+
|
|
12
|
+
/** The Matcher that minimatch makes for a portion with magic. */
|
|
13
|
+
export type MMMatcher = Exclude<MMPattern, string | typeof GLOBSTAR>
|
|
14
|
+
|
|
15
|
+
// an array of length >= 1
|
|
16
|
+
export type PatternList = [p: MMPattern, ...rest: MMPattern[]]
|
|
17
|
+
export type UNCPatternList = [
|
|
18
|
+
p0: '',
|
|
19
|
+
p1: '',
|
|
20
|
+
p2: string,
|
|
21
|
+
p3: string,
|
|
22
|
+
...rest: MMPattern[],
|
|
23
|
+
]
|
|
24
|
+
export type DrivePatternList = [p0: string, ...rest: MMPattern[]]
|
|
25
|
+
export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]
|
|
26
|
+
export type GlobList = [p: string, ...rest: string[]]
|
|
27
|
+
|
|
28
|
+
const isPatternList = (pl: MMPattern[]): pl is PatternList =>
|
|
29
|
+
pl.length >= 1
|
|
30
|
+
const isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1
|
|
31
|
+
|
|
32
|
+
const customInspect = Symbol.for('nodejs.util.inspect.custom')
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* An immutable-ish view on an array of glob parts and their parsed
|
|
36
|
+
* results
|
|
37
|
+
*/
|
|
38
|
+
export class Pattern {
|
|
39
|
+
readonly #patternList: PatternList
|
|
40
|
+
readonly #globList: GlobList
|
|
41
|
+
readonly #index: number
|
|
42
|
+
readonly length: number
|
|
43
|
+
readonly #platform: NodeJS.Platform
|
|
44
|
+
#rest?: Pattern | null
|
|
45
|
+
#globString?: string
|
|
46
|
+
#isDrive?: boolean
|
|
47
|
+
#isUNC?: boolean
|
|
48
|
+
#isAbsolute?: boolean
|
|
49
|
+
#followGlobstar: boolean = true
|
|
50
|
+
|
|
51
|
+
constructor(
|
|
52
|
+
patternList: MMPattern[],
|
|
53
|
+
globList: string[],
|
|
54
|
+
index: number,
|
|
55
|
+
platform: NodeJS.Platform,
|
|
56
|
+
) {
|
|
57
|
+
if (!isPatternList(patternList)) {
|
|
58
|
+
throw new TypeError('empty pattern list')
|
|
59
|
+
}
|
|
60
|
+
if (!isGlobList(globList)) {
|
|
61
|
+
throw new TypeError('empty glob list')
|
|
62
|
+
}
|
|
63
|
+
if (globList.length !== patternList.length) {
|
|
64
|
+
throw new TypeError('mismatched pattern list and glob list lengths')
|
|
65
|
+
}
|
|
66
|
+
this.length = patternList.length
|
|
67
|
+
if (index < 0 || index >= this.length) {
|
|
68
|
+
throw new TypeError('index out of range')
|
|
69
|
+
}
|
|
70
|
+
this.#patternList = patternList
|
|
71
|
+
this.#globList = globList
|
|
72
|
+
this.#index = index
|
|
73
|
+
this.#platform = platform
|
|
74
|
+
|
|
75
|
+
// normalize root entries of absolute patterns on initial creation.
|
|
76
|
+
if (this.#index === 0) {
|
|
77
|
+
// c: => ['c:/']
|
|
78
|
+
// C:/ => ['C:/']
|
|
79
|
+
// C:/x => ['C:/', 'x']
|
|
80
|
+
// //host/share => ['//host/share/']
|
|
81
|
+
// //host/share/ => ['//host/share/']
|
|
82
|
+
// //host/share/x => ['//host/share/', 'x']
|
|
83
|
+
// //?/UNC/host/share/x => ['//?/UNC/host/share/', 'x']
|
|
84
|
+
// /etc => ['/', 'etc']
|
|
85
|
+
// / => ['/']
|
|
86
|
+
if (this.isUNC()) {
|
|
87
|
+
// '' / '' / 'host' / 'share', or
|
|
88
|
+
// '' / '' / '?' / 'UNC' / 'host' / 'share'
|
|
89
|
+
const n = this.#isLongUNC() ? 6 : 4
|
|
90
|
+
const proot = this.#patternList.slice(0, n)
|
|
91
|
+
const groot = this.#globList.slice(0, n)
|
|
92
|
+
const prest = this.#patternList.slice(n)
|
|
93
|
+
const grest = this.#globList.slice(n)
|
|
94
|
+
if (prest[0] === '') {
|
|
95
|
+
// ends in /
|
|
96
|
+
prest.shift()
|
|
97
|
+
grest.shift()
|
|
98
|
+
}
|
|
99
|
+
const p = [...proot, ''].join('/')
|
|
100
|
+
const g = [...groot, ''].join('/')
|
|
101
|
+
this.#patternList = [p, ...prest]
|
|
102
|
+
this.#globList = [g, ...grest]
|
|
103
|
+
this.length = this.#patternList.length
|
|
104
|
+
} else if (this.isDrive() || this.isAbsolute()) {
|
|
105
|
+
const [p1, ...prest] = this.#patternList
|
|
106
|
+
const [g1, ...grest] = this.#globList
|
|
107
|
+
if (prest[0] === '') {
|
|
108
|
+
// ends in /
|
|
109
|
+
prest.shift()
|
|
110
|
+
grest.shift()
|
|
111
|
+
}
|
|
112
|
+
const p = `${p1 as string}/`
|
|
113
|
+
const g = `${g1}/`
|
|
114
|
+
this.#patternList = [p, ...prest]
|
|
115
|
+
this.#globList = [g, ...grest]
|
|
116
|
+
this.length = this.#patternList.length
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[customInspect]() {
|
|
122
|
+
return `Pattern <${this.#globList.slice(this.#index).join('/')}>`
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The first entry in the parsed list of patterns
|
|
127
|
+
*/
|
|
128
|
+
pattern(): MMPattern {
|
|
129
|
+
return this.#patternList[this.#index] as MMPattern
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* true of if pattern() returns a string
|
|
134
|
+
*/
|
|
135
|
+
isString(): boolean {
|
|
136
|
+
return typeof this.#patternList[this.#index] === 'string'
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* true of if pattern() returns GLOBSTAR
|
|
140
|
+
*/
|
|
141
|
+
isGlobstar(): boolean {
|
|
142
|
+
return this.#patternList[this.#index] === GLOBSTAR
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* true if pattern() returns a Matcher, for a portion with magic
|
|
146
|
+
*/
|
|
147
|
+
isMatcher(): boolean {
|
|
148
|
+
return typeof this.#patternList[this.#index] === 'object'
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The /-joined set of glob parts that make up this pattern
|
|
153
|
+
*/
|
|
154
|
+
globString(): string {
|
|
155
|
+
return (this.#globString =
|
|
156
|
+
this.#globString ||
|
|
157
|
+
(this.#index === 0 ?
|
|
158
|
+
this.isAbsolute() ?
|
|
159
|
+
this.#globList[0] + this.#globList.slice(1).join('/')
|
|
160
|
+
: this.#globList.join('/')
|
|
161
|
+
: this.#globList.slice(this.#index).join('/')))
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* true if there are more pattern parts after this one
|
|
166
|
+
*/
|
|
167
|
+
hasMore(): boolean {
|
|
168
|
+
return this.length > this.#index + 1
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The rest of the pattern after this part, or null if this is the end
|
|
173
|
+
*/
|
|
174
|
+
rest(): Pattern | null {
|
|
175
|
+
if (this.#rest !== undefined) return this.#rest
|
|
176
|
+
if (!this.hasMore()) return (this.#rest = null)
|
|
177
|
+
this.#rest = new Pattern(
|
|
178
|
+
this.#patternList,
|
|
179
|
+
this.#globList,
|
|
180
|
+
this.#index + 1,
|
|
181
|
+
this.#platform,
|
|
182
|
+
)
|
|
183
|
+
this.#rest.#isAbsolute = this.#isAbsolute
|
|
184
|
+
this.#rest.#isUNC = this.#isUNC
|
|
185
|
+
this.#rest.#isDrive = this.#isDrive
|
|
186
|
+
return this.#rest
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// the root is //?/UNC/host/share, the same as //host/share
|
|
190
|
+
#isLongUNC(): boolean {
|
|
191
|
+
const pl = this.#patternList
|
|
192
|
+
return (
|
|
193
|
+
pl[2] === '?' && typeof pl[3] === 'string' && /^unc$/i.test(pl[3])
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* true if the pattern represents a //unc/path/ on windows
|
|
199
|
+
*/
|
|
200
|
+
isUNC(): boolean {
|
|
201
|
+
const pl = this.#patternList
|
|
202
|
+
// the host and share, after //?/UNC/ in a long UNC path
|
|
203
|
+
const h = this.#isLongUNC() ? 4 : 2
|
|
204
|
+
return this.#isUNC !== undefined ?
|
|
205
|
+
this.#isUNC
|
|
206
|
+
: (this.#isUNC =
|
|
207
|
+
this.#platform === 'win32' &&
|
|
208
|
+
this.#index === 0 &&
|
|
209
|
+
pl[0] === '' &&
|
|
210
|
+
pl[1] === '' &&
|
|
211
|
+
typeof pl[h] === 'string' &&
|
|
212
|
+
!!pl[h] &&
|
|
213
|
+
typeof pl[h + 1] === 'string' &&
|
|
214
|
+
!!pl[h + 1])
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// pattern like C:/...
|
|
218
|
+
// split = ['C:', ...]
|
|
219
|
+
// XXX: would be nice to handle patterns like `c:*` to test the cwd
|
|
220
|
+
// in c: for *, but I don't know of a way to even figure out what that
|
|
221
|
+
// cwd is without actually chdir'ing into it?
|
|
222
|
+
/**
|
|
223
|
+
* True if the pattern starts with a drive letter on Windows
|
|
224
|
+
*/
|
|
225
|
+
isDrive(): boolean {
|
|
226
|
+
const pl = this.#patternList
|
|
227
|
+
return this.#isDrive !== undefined ?
|
|
228
|
+
this.#isDrive
|
|
229
|
+
: (this.#isDrive =
|
|
230
|
+
this.#platform === 'win32' &&
|
|
231
|
+
this.#index === 0 &&
|
|
232
|
+
this.length > 1 &&
|
|
233
|
+
typeof pl[0] === 'string' &&
|
|
234
|
+
/^[a-z]:$/i.test(pl[0]))
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// pattern = '/' or '/...' or '/x/...'
|
|
238
|
+
// split = ['', ''] or ['', ...] or ['', 'x', ...]
|
|
239
|
+
// Drive and UNC both considered absolute on windows
|
|
240
|
+
/**
|
|
241
|
+
* True if the pattern is rooted on an absolute path
|
|
242
|
+
*/
|
|
243
|
+
isAbsolute(): boolean {
|
|
244
|
+
const pl = this.#patternList
|
|
245
|
+
return this.#isAbsolute !== undefined ?
|
|
246
|
+
this.#isAbsolute
|
|
247
|
+
: (this.#isAbsolute =
|
|
248
|
+
(pl[0] === '' && pl.length > 1) ||
|
|
249
|
+
this.isDrive() ||
|
|
250
|
+
this.isUNC())
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* consume the root of the pattern, and return it
|
|
255
|
+
*/
|
|
256
|
+
root(): string {
|
|
257
|
+
const p = this.#patternList[0]
|
|
258
|
+
return (
|
|
259
|
+
typeof p === 'string' && this.isAbsolute() && this.#index === 0
|
|
260
|
+
) ?
|
|
261
|
+
p
|
|
262
|
+
: ''
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Check to see if the current globstar pattern is allowed to follow
|
|
267
|
+
* a symbolic link.
|
|
268
|
+
*/
|
|
269
|
+
checkFollowGlobstar(): boolean {
|
|
270
|
+
return !(
|
|
271
|
+
this.#index === 0 ||
|
|
272
|
+
!this.isGlobstar() ||
|
|
273
|
+
!this.#followGlobstar
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Mark that the current globstar pattern is following a symbolic link
|
|
279
|
+
*/
|
|
280
|
+
markFollowGlobstar(): boolean {
|
|
281
|
+
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
|
|
282
|
+
return false
|
|
283
|
+
this.#followGlobstar = false
|
|
284
|
+
return true
|
|
285
|
+
}
|
|
286
|
+
}
|