@ashx-j/lunr 0.2.17 → 0.2.19
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/CHANGELOG.md +26 -1
- package/README.md +2 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +44 -19
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +2 -1
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +4 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +172 -171
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +50 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +131 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts +7 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js +211 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +0 -5
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +0 -202
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +276 -109
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +4 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.js +10 -3
- package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +2 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +68 -15
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +5 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +2 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +72 -31
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.js +105 -54
- package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.js +82 -65
- package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.js +2 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +259 -168
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/lazy.d.ts +18 -0
- package/dist/builtin-extensions/pi-web-access/lazy.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/lazy.js +19 -0
- package/dist/builtin-extensions/pi-web-access/lazy.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts +6 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js +17 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js.map +1 -0
- package/dist/cli-runtime.d.ts +3 -0
- package/dist/cli-runtime.d.ts.map +1 -0
- package/dist/cli-runtime.js +72 -0
- package/dist/cli-runtime.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +11 -60
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +6 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/host-static.d.ts.map +1 -1
- package/dist/core/extensions/host-static.js +34 -12
- package/dist/core/extensions/host-static.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -2
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +10 -64
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/timings.d.ts +2 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +17 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +6 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +23 -6
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +3 -1
- package/dist/gateway/cron.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +20 -14
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +10 -8
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/thinking-level-slash.d.ts +4 -0
- package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
- package/dist/modes/interactive/thinking-level-slash.js +23 -0
- package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
- package/dist/node-runtime/agent-session-services-35WNVGMR.js +36 -0
- package/dist/node-runtime/benchmark-request-UC7PD3V3.js +57 -0
- package/dist/node-runtime/brave-UWDA3I22.js +143 -0
- package/dist/node-runtime/builtin-extensions-322XDDEM.js +28 -0
- package/dist/node-runtime/chunk-2SJB2AWP.js +47 -0
- package/dist/node-runtime/chunk-3NMWLTPV.js +64 -0
- package/dist/node-runtime/chunk-3WFAEVKS.js +115 -0
- package/dist/node-runtime/chunk-3X3KZKMI.js +49 -0
- package/dist/node-runtime/chunk-4CSFRBCN.js +7558 -0
- package/dist/node-runtime/chunk-4DJ6HEGH.js +296 -0
- package/dist/node-runtime/chunk-4FX25LWP.js +1345 -0
- package/dist/node-runtime/chunk-4HXHDDCF.js +16 -0
- package/dist/node-runtime/chunk-4I23VTC4.js +429 -0
- package/dist/node-runtime/chunk-4TLO4PO2.js +3427 -0
- package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
- package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
- package/dist/node-runtime/chunk-5EFIU3OM.js +295 -0
- package/dist/node-runtime/chunk-6BEIBLQ3.js +53 -0
- package/dist/node-runtime/chunk-6KDIOJL3.js +72 -0
- package/dist/node-runtime/chunk-7N3YHTYF.js +26 -0
- package/dist/node-runtime/chunk-7NBZ5P7I.js +24 -0
- package/dist/node-runtime/chunk-AD6VXAO7.js +342 -0
- package/dist/node-runtime/chunk-ARC4KOTI.js +11178 -0
- package/dist/node-runtime/chunk-AROOY4BB.js +173 -0
- package/dist/node-runtime/chunk-ATGA2WLC.js +5646 -0
- package/dist/node-runtime/chunk-AUXVGBO4.js +19 -0
- package/dist/node-runtime/chunk-AY6CAJSL.js +30 -0
- package/dist/node-runtime/chunk-BHO7O6E5.js +296 -0
- package/dist/node-runtime/chunk-BI3DHYCN.js +8845 -0
- package/dist/node-runtime/chunk-BOHIDQT4.js +21 -0
- package/dist/node-runtime/chunk-BRJX2PRC.js +53 -0
- package/dist/node-runtime/chunk-CBGB57XT.js +20211 -0
- package/dist/node-runtime/chunk-CCZJ3PYY.js +17 -0
- package/dist/node-runtime/chunk-CGBXPL3E.js +1171 -0
- package/dist/node-runtime/chunk-CJECDQKP.js +19 -0
- package/dist/node-runtime/chunk-CSFI6YXL.js +130 -0
- package/dist/node-runtime/chunk-DAPBPCBP.js +53 -0
- package/dist/node-runtime/chunk-DDWHZ633.js +37 -0
- package/dist/node-runtime/chunk-DMMTJQMQ.js +43 -0
- package/dist/node-runtime/chunk-DVGWF6A2.js +1180 -0
- package/dist/node-runtime/chunk-FQMM2EZ2.js +248 -0
- package/dist/node-runtime/chunk-FVDOXRUD.js +96 -0
- package/dist/node-runtime/chunk-G6LRAP36.js +105 -0
- package/dist/node-runtime/chunk-GKLEQ3I4.js +860 -0
- package/dist/node-runtime/chunk-H2EOZYMP.js +57 -0
- package/dist/node-runtime/chunk-HQCKFM2O.js +56 -0
- package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
- package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
- package/dist/node-runtime/chunk-IRPJXI6U.js +1269 -0
- package/dist/node-runtime/chunk-J26TSGDL.js +633 -0
- package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
- package/dist/node-runtime/chunk-JZQ7F36T.js +610 -0
- package/dist/node-runtime/chunk-KBKMCJDU.js +126 -0
- package/dist/node-runtime/chunk-KWA4OC2J.js +100 -0
- package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
- package/dist/node-runtime/chunk-MCUNIRD5.js +8388 -0
- package/dist/node-runtime/chunk-NUIFPZWX.js +209 -0
- package/dist/node-runtime/chunk-OBMWP3I5.js +68 -0
- package/dist/node-runtime/chunk-OCVIXVTZ.js +88 -0
- package/dist/node-runtime/chunk-OPEK5RRY.js +466 -0
- package/dist/node-runtime/chunk-OR4L3IB2.js +42 -0
- package/dist/node-runtime/chunk-PL6JKXWI.js +3622 -0
- package/dist/node-runtime/chunk-PNJSG3IZ.js +807 -0
- package/dist/node-runtime/chunk-PVCDKGR6.js +55 -0
- package/dist/node-runtime/chunk-Q4Q6D4IY.js +364 -0
- package/dist/node-runtime/chunk-Q5ZU2VRT.js +83 -0
- package/dist/node-runtime/chunk-QFWG2RVL.js +5477 -0
- package/dist/node-runtime/chunk-QZMODZQ2.js +305 -0
- package/dist/node-runtime/chunk-RNBHABBA.js +986 -0
- package/dist/node-runtime/chunk-RQ2Q5IYR.js +72 -0
- package/dist/node-runtime/chunk-RRIZE6QQ.js +17 -0
- package/dist/node-runtime/chunk-SN6G4OU6.js +4753 -0
- package/dist/node-runtime/chunk-STERBGUB.js +949 -0
- package/dist/node-runtime/chunk-TFBIJTM3.js +966 -0
- package/dist/node-runtime/chunk-TXHKBRHZ.js +9450 -0
- package/dist/node-runtime/chunk-UWQYRSYQ.js +8973 -0
- package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
- package/dist/node-runtime/chunk-VSELYKWU.js +772 -0
- package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
- package/dist/node-runtime/chunk-WJVFOIB5.js +24921 -0
- package/dist/node-runtime/chunk-WKDK4C5P.js +2834 -0
- package/dist/node-runtime/chunk-XATUM2HK.js +46 -0
- package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
- package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
- package/dist/node-runtime/chunk-ZRCBN365.js +1734 -0
- package/dist/node-runtime/cli-runtime.js +80 -0
- package/dist/node-runtime/clipboard-OZ63BBC6.js +12 -0
- package/dist/node-runtime/clipboard-image-7QR6GXVA.js +13 -0
- package/dist/node-runtime/command-DWUM5X3U.js +13 -0
- package/dist/node-runtime/commands-MV5KOZ64.js +291 -0
- package/dist/node-runtime/config-QDD5PUE2.js +73 -0
- package/dist/node-runtime/curator-server-XCM43VEF.js +3816 -0
- package/dist/node-runtime/customize-XEXL2DGQ.js +12 -0
- package/dist/node-runtime/direct-tool-executor-BK7CLEBX.js +188 -0
- package/dist/node-runtime/exa-LL64QZR2.js +329 -0
- package/dist/node-runtime/export-html-TEXVV5RP.js +150 -0
- package/dist/node-runtime/extension-input-O4HSAEM4.js +14 -0
- package/dist/node-runtime/extension-selector-X5FCX43D.js +14 -0
- package/dist/node-runtime/extract-XLQSJN4V.js +17 -0
- package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
- package/dist/node-runtime/gateway-UZXMFGWY.js +2137 -0
- package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
- package/dist/node-runtime/gemini-search-U7SUMPQA.js +330 -0
- package/dist/node-runtime/gemini-url-context-PXWCBQHK.js +103 -0
- package/dist/node-runtime/gemini-web-MM446SEH.js +14 -0
- package/dist/node-runtime/github-extract-F64RZOEA.js +619 -0
- package/dist/node-runtime/goal-NJEE5CTU.js +1831 -0
- package/dist/node-runtime/index.js +859 -0
- package/dist/node-runtime/init-3C7Z24OI.js +28 -0
- package/dist/node-runtime/install-cli-EXMJQESX.js +308 -0
- package/dist/node-runtime/interactive-mode-QT5IKGQ5.js +56 -0
- package/dist/node-runtime/interactive-view-ILS6TAN5.js +247 -0
- package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
- package/dist/node-runtime/lunr-cron-QPBTKBGI.js +272 -0
- package/dist/node-runtime/main.js +54 -0
- package/dist/node-runtime/mcp-auth-flow-QIXHW6QN.js +32 -0
- package/dist/node-runtime/mcp-panel-IIGMXQGP.js +501 -0
- package/dist/node-runtime/mcp-setup-panel-FEK7663I.js +355 -0
- package/dist/node-runtime/memory-cap-3S4XRLNP.js +20 -0
- package/dist/node-runtime/model-tiers-NJLHUEGK.js +20 -0
- package/dist/node-runtime/openai-search-B3MSNCQA.js +288 -0
- package/dist/node-runtime/package-manager-cli-7RKSZGEN.js +749 -0
- package/dist/node-runtime/parallel-AI2MNSCU.js +265 -0
- package/dist/node-runtime/parser-manager-TQHWYDH7.js +152 -0
- package/dist/node-runtime/pdf-extract-IPE6H4HP.js +57 -0
- package/dist/node-runtime/perplexity-QVJW3I35.js +12 -0
- package/dist/node-runtime/pi-intercom-EEMBGQID.js +2215 -0
- package/dist/node-runtime/pi-mcp-adapter-GUFZWW54.js +428 -0
- package/dist/node-runtime/pi-ollama-cloud-2F3Y2QNM.js +1440 -0
- package/dist/node-runtime/pi-prompt-template-model-QWTCGLJU.js +3946 -0
- package/dist/node-runtime/pi-subagents-7YJ3I4VE.js +6048 -0
- package/dist/node-runtime/pi-web-access-2CQGFLT2.js +1867 -0
- package/dist/node-runtime/print-mode-XSFM26EL.js +12 -0
- package/dist/node-runtime/proxy-modes-V6YVFH3C.js +685 -0
- package/dist/node-runtime/rpc-entry.js +62 -0
- package/dist/node-runtime/rpc-mode-W5ZTLTMZ.js +13 -0
- package/dist/node-runtime/runtime-bridges-3RKBDLNA.js +14 -0
- package/dist/node-runtime/session-manager-E7AREDTV.js +33 -0
- package/dist/node-runtime/session-selector-FJ7M2AIX.js +14 -0
- package/dist/node-runtime/settings-manager-GHPTUN7R.js +21 -0
- package/dist/node-runtime/src-BPQFJR76.js +2427 -0
- package/dist/node-runtime/subagent-executor-5Q5A4HJ2.js +8499 -0
- package/dist/node-runtime/summary-review-YSMXKITO.js +228 -0
- package/dist/node-runtime/tavily-WEZFVFP7.js +154 -0
- package/dist/node-runtime/timings-UAD5BEAS.js +16 -0
- package/dist/node-runtime/tool-renderer-MV5O452K.js +204 -0
- package/dist/node-runtime/update-cli-L3JIBH2U.js +70 -0
- package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
- package/dist/node-runtime/video-extract-OYT5WKS5.js +304 -0
- package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
- package/dist/node-runtime/youtube-extract-TQYKGFGS.js +264 -0
- package/dist/rpc.d.ts +3 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +18 -0
- package/dist/rpc.js.map +1 -0
- package/dist/startup/benchmark-request.d.ts +3 -0
- package/dist/startup/benchmark-request.d.ts.map +1 -0
- package/dist/startup/benchmark-request.js +65 -0
- package/dist/startup/benchmark-request.js.map +1 -0
- package/dist/startup/interactive-view.d.ts.map +1 -1
- package/dist/startup/interactive-view.js +1 -2
- package/dist/startup/interactive-view.js.map +1 -1
- package/dist/startup/startup-milestones.d.ts +1 -1
- package/dist/startup/startup-milestones.d.ts.map +1 -1
- package/dist/startup/startup-milestones.js.map +1 -1
- package/dist/utils/await-with-abort.d.ts +2 -0
- package/dist/utils/await-with-abort.d.ts.map +1 -0
- package/dist/utils/await-with-abort.js +19 -0
- package/dist/utils/await-with-abort.js.map +1 -0
- package/docs/development.md +5 -1
- package/docs/features.md +2 -2
- package/docs/interactive-startup.md +95 -48
- package/docs/keybindings.md +2 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/usage.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/hidden-thinking-label.ts +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,1171 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// node_modules/balanced-match/dist/esm/index.js
|
|
4
|
+
var balanced = (a, b, str) => {
|
|
5
|
+
let ma = a instanceof RegExp ? maybeMatch(a, str) : a, mb = b instanceof RegExp ? maybeMatch(b, str) : b, r = ma !== null && mb != null && range(ma, mb, str);
|
|
6
|
+
return r && {
|
|
7
|
+
start: r[0],
|
|
8
|
+
end: r[1],
|
|
9
|
+
pre: str.slice(0, r[0]),
|
|
10
|
+
body: str.slice(r[0] + ma.length, r[1]),
|
|
11
|
+
post: str.slice(r[1] + mb.length)
|
|
12
|
+
};
|
|
13
|
+
}, maybeMatch = (reg, str) => {
|
|
14
|
+
let m = str.match(reg);
|
|
15
|
+
return m ? m[0] : null;
|
|
16
|
+
}, range = (a, b, str) => {
|
|
17
|
+
let begs, beg, left, right, result, ai = str.indexOf(a), bi = str.indexOf(b, ai + 1), i = ai;
|
|
18
|
+
if (ai >= 0 && bi > 0) {
|
|
19
|
+
if (a === b)
|
|
20
|
+
return [ai, bi];
|
|
21
|
+
for (begs = [], left = str.length; i >= 0 && !result; ) {
|
|
22
|
+
if (i === ai)
|
|
23
|
+
begs.push(i), ai = str.indexOf(a, i + 1);
|
|
24
|
+
else if (begs.length === 1) {
|
|
25
|
+
let r = begs.pop();
|
|
26
|
+
r !== void 0 && (result = [r, bi]);
|
|
27
|
+
} else
|
|
28
|
+
beg = begs.pop(), beg !== void 0 && beg < left && (left = beg, right = bi), bi = str.indexOf(b, i + 1);
|
|
29
|
+
i = ai < bi && ai >= 0 ? ai : bi;
|
|
30
|
+
}
|
|
31
|
+
begs.length && right !== void 0 && (result = [left, right]);
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// node_modules/brace-expansion/dist/esm/index.js
|
|
37
|
+
var escSlash = "\0SLASH" + Math.random() + "\0", escOpen = "\0OPEN" + Math.random() + "\0", escClose = "\0CLOSE" + Math.random() + "\0", escComma = "\0COMMA" + Math.random() + "\0", escPeriod = "\0PERIOD" + Math.random() + "\0", escSlashPattern = new RegExp(escSlash, "g"), escOpenPattern = new RegExp(escOpen, "g"), escClosePattern = new RegExp(escClose, "g"), escCommaPattern = new RegExp(escComma, "g"), escPeriodPattern = new RegExp(escPeriod, "g"), slashPattern = /\\\\/g, openPattern = /\\{/g, closePattern = /\\}/g, commaPattern = /\\,/g, periodPattern = /\\\./g, EXPANSION_MAX = 1e5;
|
|
38
|
+
function numeric(str) {
|
|
39
|
+
return isNaN(str) ? str.charCodeAt(0) : parseInt(str, 10);
|
|
40
|
+
}
|
|
41
|
+
function escapeBraces(str) {
|
|
42
|
+
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
|
|
43
|
+
}
|
|
44
|
+
function unescapeBraces(str) {
|
|
45
|
+
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
|
|
46
|
+
}
|
|
47
|
+
function parseCommaParts(str) {
|
|
48
|
+
if (!str)
|
|
49
|
+
return [""];
|
|
50
|
+
let parts = [], m = balanced("{", "}", str);
|
|
51
|
+
if (!m)
|
|
52
|
+
return str.split(",");
|
|
53
|
+
let { pre, body, post } = m, p = pre.split(",");
|
|
54
|
+
p[p.length - 1] += "{" + body + "}";
|
|
55
|
+
let postParts = parseCommaParts(post);
|
|
56
|
+
return post.length && (p[p.length - 1] += postParts.shift(), p.push.apply(p, postParts)), parts.push.apply(parts, p), parts;
|
|
57
|
+
}
|
|
58
|
+
function expand(str, options = {}) {
|
|
59
|
+
if (!str)
|
|
60
|
+
return [];
|
|
61
|
+
let { max = EXPANSION_MAX } = options;
|
|
62
|
+
return str.slice(0, 2) === "{}" && (str = "\\{\\}" + str.slice(2)), expand_(escapeBraces(str), max, !0).map(unescapeBraces);
|
|
63
|
+
}
|
|
64
|
+
function embrace(str) {
|
|
65
|
+
return "{" + str + "}";
|
|
66
|
+
}
|
|
67
|
+
function isPadded(el) {
|
|
68
|
+
return /^-?0\d/.test(el);
|
|
69
|
+
}
|
|
70
|
+
function lte(i, y) {
|
|
71
|
+
return i <= y;
|
|
72
|
+
}
|
|
73
|
+
function gte(i, y) {
|
|
74
|
+
return i >= y;
|
|
75
|
+
}
|
|
76
|
+
function expand_(str, max, isTop) {
|
|
77
|
+
let expansions = [];
|
|
78
|
+
for (; ; ) {
|
|
79
|
+
let m = balanced("{", "}", str);
|
|
80
|
+
if (!m)
|
|
81
|
+
return [str];
|
|
82
|
+
let pre = m.pre;
|
|
83
|
+
if (/\$$/.test(m.pre)) {
|
|
84
|
+
let post2 = m.post.length ? expand_(m.post, max, !1) : [""];
|
|
85
|
+
for (let k = 0; k < post2.length && k < max; k++) {
|
|
86
|
+
let expansion = pre + "{" + m.body + "}" + post2[k];
|
|
87
|
+
expansions.push(expansion);
|
|
88
|
+
}
|
|
89
|
+
return expansions;
|
|
90
|
+
}
|
|
91
|
+
let isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), isSequence = isNumericSequence || isAlphaSequence, isOptions = m.body.indexOf(",") >= 0;
|
|
92
|
+
if (!isSequence && !isOptions) {
|
|
93
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
94
|
+
str = m.pre + "{" + m.body + escClose + m.post, isTop = !0;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
return [str];
|
|
98
|
+
}
|
|
99
|
+
let post = m.post.length ? expand_(m.post, max, !1) : [""], n;
|
|
100
|
+
if (isSequence)
|
|
101
|
+
n = m.body.split(/\.\./);
|
|
102
|
+
else if (n = parseCommaParts(m.body), n.length === 1 && n[0] !== void 0 && (n = expand_(n[0], max, !1).map(embrace), n.length === 1))
|
|
103
|
+
return post.map((p) => m.pre + n[0] + p);
|
|
104
|
+
let N;
|
|
105
|
+
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
|
|
106
|
+
let x = numeric(n[0]), y = numeric(n[1]), width = Math.max(n[0].length, n[1].length), incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1, test = lte;
|
|
107
|
+
y < x && (incr *= -1, test = gte);
|
|
108
|
+
let pad = n.some(isPadded);
|
|
109
|
+
N = [];
|
|
110
|
+
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
111
|
+
let c;
|
|
112
|
+
if (isAlphaSequence)
|
|
113
|
+
c = String.fromCharCode(i), c === "\\" && (c = "");
|
|
114
|
+
else if (c = String(i), pad) {
|
|
115
|
+
let need = width - c.length;
|
|
116
|
+
if (need > 0) {
|
|
117
|
+
let z = new Array(need + 1).join("0");
|
|
118
|
+
i < 0 ? c = "-" + z + c.slice(1) : c = z + c;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
N.push(c);
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
N = [];
|
|
125
|
+
for (let j = 0; j < n.length; j++)
|
|
126
|
+
N.push.apply(N, expand_(n[j], max, !1));
|
|
127
|
+
}
|
|
128
|
+
for (let j = 0; j < N.length; j++)
|
|
129
|
+
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
|
130
|
+
let expansion = pre + N[j] + post[k];
|
|
131
|
+
(!isTop || isSequence || expansion) && expansions.push(expansion);
|
|
132
|
+
}
|
|
133
|
+
return expansions;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
138
|
+
var assertValidPattern = (pattern) => {
|
|
139
|
+
if (typeof pattern != "string")
|
|
140
|
+
throw new TypeError("invalid pattern");
|
|
141
|
+
if (pattern.length > 65536)
|
|
142
|
+
throw new TypeError("pattern is too long");
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// node_modules/minimatch/dist/esm/brace-expressions.js
|
|
146
|
+
var posixClasses = {
|
|
147
|
+
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
|
|
148
|
+
"[:alpha:]": ["\\p{L}\\p{Nl}", !0],
|
|
149
|
+
"[:ascii:]": ["\\x00-\\x7f", !1],
|
|
150
|
+
"[:blank:]": ["\\p{Zs}\\t", !0],
|
|
151
|
+
"[:cntrl:]": ["\\p{Cc}", !0],
|
|
152
|
+
"[:digit:]": ["\\p{Nd}", !0],
|
|
153
|
+
"[:graph:]": ["\\p{Z}\\p{C}", !0, !0],
|
|
154
|
+
"[:lower:]": ["\\p{Ll}", !0],
|
|
155
|
+
"[:print:]": ["\\p{C}", !0],
|
|
156
|
+
"[:punct:]": ["\\p{P}", !0],
|
|
157
|
+
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
|
|
158
|
+
"[:upper:]": ["\\p{Lu}", !0],
|
|
159
|
+
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
|
|
160
|
+
"[:xdigit:]": ["A-Fa-f0-9", !1]
|
|
161
|
+
}, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), rangesToString = (ranges) => ranges.join(""), parseClass = (glob, position) => {
|
|
162
|
+
let pos = position;
|
|
163
|
+
if (glob.charAt(pos) !== "[")
|
|
164
|
+
throw new Error("not in a brace expression");
|
|
165
|
+
let ranges = [], negs = [], i = pos + 1, sawStart = !1, uflag = !1, escaping = !1, negate = !1, endPos = pos, rangeStart = "";
|
|
166
|
+
WHILE: for (; i < glob.length; ) {
|
|
167
|
+
let c = glob.charAt(i);
|
|
168
|
+
if ((c === "!" || c === "^") && i === pos + 1) {
|
|
169
|
+
negate = !0, i++;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (c === "]" && sawStart && !escaping) {
|
|
173
|
+
endPos = i + 1;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
if (sawStart = !0, c === "\\" && !escaping) {
|
|
177
|
+
escaping = !0, i++;
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (c === "[" && !escaping) {
|
|
181
|
+
for (let [cls, [unip, u, neg]] of Object.entries(posixClasses))
|
|
182
|
+
if (glob.startsWith(cls, i)) {
|
|
183
|
+
if (rangeStart)
|
|
184
|
+
return ["$.", !1, glob.length - pos, !0];
|
|
185
|
+
i += cls.length, neg ? negs.push(unip) : ranges.push(unip), uflag = uflag || u;
|
|
186
|
+
continue WHILE;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (escaping = !1, rangeStart) {
|
|
190
|
+
c > rangeStart ? ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c)) : c === rangeStart && ranges.push(braceEscape(c)), rangeStart = "", i++;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (glob.startsWith("-]", i + 1)) {
|
|
194
|
+
ranges.push(braceEscape(c + "-")), i += 2;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (glob.startsWith("-", i + 1)) {
|
|
198
|
+
rangeStart = c, i += 2;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
ranges.push(braceEscape(c)), i++;
|
|
202
|
+
}
|
|
203
|
+
if (endPos < i)
|
|
204
|
+
return ["", !1, 0, !1];
|
|
205
|
+
if (!ranges.length && !negs.length)
|
|
206
|
+
return ["$.", !1, glob.length - pos, !0];
|
|
207
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
208
|
+
let r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
209
|
+
return [regexpEscape(r), !1, endPos - pos, !1];
|
|
210
|
+
}
|
|
211
|
+
let sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]", snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
212
|
+
return [ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs, uflag, endPos - pos, !0];
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
// node_modules/minimatch/dist/esm/unescape.js
|
|
216
|
+
var unescape = (s, { windowsPathsNoEscape = !1, magicalBraces = !0 } = {}) => magicalBraces ? windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1") : windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
217
|
+
|
|
218
|
+
// node_modules/minimatch/dist/esm/ast.js
|
|
219
|
+
var _a, types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), isExtglobType = (c) => types.has(c), isExtglobAST = (c) => isExtglobType(c.type), adoptionMap = /* @__PURE__ */ new Map([
|
|
220
|
+
["!", ["@"]],
|
|
221
|
+
["?", ["?", "@"]],
|
|
222
|
+
["@", ["@"]],
|
|
223
|
+
["*", ["*", "+", "?", "@"]],
|
|
224
|
+
["+", ["+", "@"]]
|
|
225
|
+
]), adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
226
|
+
["!", ["?"]],
|
|
227
|
+
["@", ["?"]],
|
|
228
|
+
["+", ["?", "*"]]
|
|
229
|
+
]), adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
230
|
+
["!", ["?", "@"]],
|
|
231
|
+
["?", ["?", "@"]],
|
|
232
|
+
["@", ["?", "@"]],
|
|
233
|
+
["*", ["*", "+", "?", "@"]],
|
|
234
|
+
["+", ["+", "@", "?", "*"]]
|
|
235
|
+
]), usurpMap = /* @__PURE__ */ new Map([
|
|
236
|
+
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
237
|
+
[
|
|
238
|
+
"?",
|
|
239
|
+
/* @__PURE__ */ new Map([
|
|
240
|
+
["*", "*"],
|
|
241
|
+
["+", "*"]
|
|
242
|
+
])
|
|
243
|
+
],
|
|
244
|
+
[
|
|
245
|
+
"@",
|
|
246
|
+
/* @__PURE__ */ new Map([
|
|
247
|
+
["!", "!"],
|
|
248
|
+
["?", "?"],
|
|
249
|
+
["@", "@"],
|
|
250
|
+
["*", "*"],
|
|
251
|
+
["+", "+"]
|
|
252
|
+
])
|
|
253
|
+
],
|
|
254
|
+
[
|
|
255
|
+
"+",
|
|
256
|
+
/* @__PURE__ */ new Map([
|
|
257
|
+
["?", "*"],
|
|
258
|
+
["*", "*"]
|
|
259
|
+
])
|
|
260
|
+
]
|
|
261
|
+
]), startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))", startNoDot = "(?!\\.)", addPatternStart = /* @__PURE__ */ new Set(["[", "."]), justDots = /* @__PURE__ */ new Set(["..", "."]), reSpecials = new Set("().*{}+?[]^$\\!"), regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), qmark = "[^/]", star = qmark + "*?", starNoEmpty = qmark + "+?", ID = 0, AST = class {
|
|
262
|
+
type;
|
|
263
|
+
#root;
|
|
264
|
+
#hasMagic;
|
|
265
|
+
#uflag = !1;
|
|
266
|
+
#parts = [];
|
|
267
|
+
#parent;
|
|
268
|
+
#parentIndex;
|
|
269
|
+
#negs;
|
|
270
|
+
#filledNegs = !1;
|
|
271
|
+
#options;
|
|
272
|
+
#toString;
|
|
273
|
+
// set to true if it's an extglob with no children
|
|
274
|
+
// (which really means one child of '')
|
|
275
|
+
#emptyExt = !1;
|
|
276
|
+
id = ++ID;
|
|
277
|
+
get depth() {
|
|
278
|
+
return (this.#parent?.depth ?? -1) + 1;
|
|
279
|
+
}
|
|
280
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
281
|
+
return {
|
|
282
|
+
"@@type": "AST",
|
|
283
|
+
id: this.id,
|
|
284
|
+
type: this.type,
|
|
285
|
+
root: this.#root.id,
|
|
286
|
+
parent: this.#parent?.id,
|
|
287
|
+
depth: this.depth,
|
|
288
|
+
partsLength: this.#parts.length,
|
|
289
|
+
parts: this.#parts
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
constructor(type, parent, options = {}) {
|
|
293
|
+
this.type = type, type && (this.#hasMagic = !0), this.#parent = parent, this.#root = this.#parent ? this.#parent.#root : this, this.#options = this.#root === this ? options : this.#root.#options, this.#negs = this.#root === this ? [] : this.#root.#negs, type === "!" && !this.#root.#filledNegs && this.#negs.push(this), this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
|
294
|
+
}
|
|
295
|
+
get hasMagic() {
|
|
296
|
+
if (this.#hasMagic !== void 0)
|
|
297
|
+
return this.#hasMagic;
|
|
298
|
+
for (let p of this.#parts)
|
|
299
|
+
if (typeof p != "string" && (p.type || p.hasMagic))
|
|
300
|
+
return this.#hasMagic = !0;
|
|
301
|
+
return this.#hasMagic;
|
|
302
|
+
}
|
|
303
|
+
// reconstructs the pattern
|
|
304
|
+
toString() {
|
|
305
|
+
return this.#toString !== void 0 ? this.#toString : this.type ? this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")" : this.#toString = this.#parts.map((p) => String(p)).join("");
|
|
306
|
+
}
|
|
307
|
+
#fillNegs() {
|
|
308
|
+
if (this !== this.#root)
|
|
309
|
+
throw new Error("should only call on root");
|
|
310
|
+
if (this.#filledNegs)
|
|
311
|
+
return this;
|
|
312
|
+
this.toString(), this.#filledNegs = !0;
|
|
313
|
+
let n;
|
|
314
|
+
for (; n = this.#negs.pop(); ) {
|
|
315
|
+
if (n.type !== "!")
|
|
316
|
+
continue;
|
|
317
|
+
let p = n, pp = p.#parent;
|
|
318
|
+
for (; pp; ) {
|
|
319
|
+
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++)
|
|
320
|
+
for (let part of n.#parts) {
|
|
321
|
+
if (typeof part == "string")
|
|
322
|
+
throw new Error("string part in extglob AST??");
|
|
323
|
+
part.copyIn(pp.#parts[i]);
|
|
324
|
+
}
|
|
325
|
+
p = pp, pp = p.#parent;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return this;
|
|
329
|
+
}
|
|
330
|
+
push(...parts) {
|
|
331
|
+
for (let p of parts)
|
|
332
|
+
if (p !== "") {
|
|
333
|
+
if (typeof p != "string" && !(p instanceof _a && p.#parent === this))
|
|
334
|
+
throw new Error("invalid part: " + p);
|
|
335
|
+
this.#parts.push(p);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
toJSON() {
|
|
339
|
+
let ret = this.type === null ? this.#parts.slice().map((p) => typeof p == "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
340
|
+
return this.isStart() && !this.type && ret.unshift([]), this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!") && ret.push({}), ret;
|
|
341
|
+
}
|
|
342
|
+
isStart() {
|
|
343
|
+
if (this.#root === this)
|
|
344
|
+
return !0;
|
|
345
|
+
if (!this.#parent?.isStart())
|
|
346
|
+
return !1;
|
|
347
|
+
if (this.#parentIndex === 0)
|
|
348
|
+
return !0;
|
|
349
|
+
let p = this.#parent;
|
|
350
|
+
for (let i = 0; i < this.#parentIndex; i++) {
|
|
351
|
+
let pp = p.#parts[i];
|
|
352
|
+
if (!(pp instanceof _a && pp.type === "!"))
|
|
353
|
+
return !1;
|
|
354
|
+
}
|
|
355
|
+
return !0;
|
|
356
|
+
}
|
|
357
|
+
isEnd() {
|
|
358
|
+
if (this.#root === this || this.#parent?.type === "!")
|
|
359
|
+
return !0;
|
|
360
|
+
if (!this.#parent?.isEnd())
|
|
361
|
+
return !1;
|
|
362
|
+
if (!this.type)
|
|
363
|
+
return this.#parent?.isEnd();
|
|
364
|
+
let pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
365
|
+
return this.#parentIndex === pl - 1;
|
|
366
|
+
}
|
|
367
|
+
copyIn(part) {
|
|
368
|
+
typeof part == "string" ? this.push(part) : this.push(part.clone(this));
|
|
369
|
+
}
|
|
370
|
+
clone(parent) {
|
|
371
|
+
let c = new _a(this.type, parent);
|
|
372
|
+
for (let p of this.#parts)
|
|
373
|
+
c.copyIn(p);
|
|
374
|
+
return c;
|
|
375
|
+
}
|
|
376
|
+
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
377
|
+
let maxDepth = opt.maxExtglobRecursion ?? 2, escaping = !1, inBrace = !1, braceStart = -1, braceNeg = !1;
|
|
378
|
+
if (ast.type === null) {
|
|
379
|
+
let i2 = pos, acc2 = "";
|
|
380
|
+
for (; i2 < str.length; ) {
|
|
381
|
+
let c = str.charAt(i2++);
|
|
382
|
+
if (escaping || c === "\\") {
|
|
383
|
+
escaping = !escaping, acc2 += c;
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
if (inBrace) {
|
|
387
|
+
i2 === braceStart + 1 ? (c === "^" || c === "!") && (braceNeg = !0) : c === "]" && !(i2 === braceStart + 2 && braceNeg) && (inBrace = !1), acc2 += c;
|
|
388
|
+
continue;
|
|
389
|
+
} else if (c === "[") {
|
|
390
|
+
inBrace = !0, braceStart = i2, braceNeg = !1, acc2 += c;
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth) {
|
|
394
|
+
ast.push(acc2), acc2 = "";
|
|
395
|
+
let ext2 = new _a(c, ast);
|
|
396
|
+
i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1), ast.push(ext2);
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
acc2 += c;
|
|
400
|
+
}
|
|
401
|
+
return ast.push(acc2), i2;
|
|
402
|
+
}
|
|
403
|
+
let i = pos + 1, part = new _a(null, ast), parts = [], acc = "";
|
|
404
|
+
for (; i < str.length; ) {
|
|
405
|
+
let c = str.charAt(i++);
|
|
406
|
+
if (escaping || c === "\\") {
|
|
407
|
+
escaping = !escaping, acc += c;
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
if (inBrace) {
|
|
411
|
+
i === braceStart + 1 ? (c === "^" || c === "!") && (braceNeg = !0) : c === "]" && !(i === braceStart + 2 && braceNeg) && (inBrace = !1), acc += c;
|
|
412
|
+
continue;
|
|
413
|
+
} else if (c === "[") {
|
|
414
|
+
inBrace = !0, braceStart = i, braceNeg = !1, acc += c;
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
if (!opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
418
|
+
(extDepth <= maxDepth || ast && ast.#canAdoptType(c))) {
|
|
419
|
+
let depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
420
|
+
part.push(acc), acc = "";
|
|
421
|
+
let ext2 = new _a(c, part);
|
|
422
|
+
part.push(ext2), i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd);
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
if (c === "|") {
|
|
426
|
+
part.push(acc), acc = "", parts.push(part), part = new _a(null, ast);
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
if (c === ")")
|
|
430
|
+
return acc === "" && ast.#parts.length === 0 && (ast.#emptyExt = !0), part.push(acc), acc = "", ast.push(...parts, part), i;
|
|
431
|
+
acc += c;
|
|
432
|
+
}
|
|
433
|
+
return ast.type = null, ast.#hasMagic = void 0, ast.#parts = [str.substring(pos - 1)], i;
|
|
434
|
+
}
|
|
435
|
+
#canAdoptWithSpace(child) {
|
|
436
|
+
return this.#canAdopt(child, adoptionWithSpaceMap);
|
|
437
|
+
}
|
|
438
|
+
#canAdopt(child, map = adoptionMap) {
|
|
439
|
+
if (!child || typeof child != "object" || child.type !== null || child.#parts.length !== 1 || this.type === null)
|
|
440
|
+
return !1;
|
|
441
|
+
let gc = child.#parts[0];
|
|
442
|
+
return !gc || typeof gc != "object" || gc.type === null ? !1 : this.#canAdoptType(gc.type, map);
|
|
443
|
+
}
|
|
444
|
+
#canAdoptType(c, map = adoptionAnyMap) {
|
|
445
|
+
return !!map.get(this.type)?.includes(c);
|
|
446
|
+
}
|
|
447
|
+
#adoptWithSpace(child, index) {
|
|
448
|
+
let gc = child.#parts[0], blank = new _a(null, gc, this.options);
|
|
449
|
+
blank.#parts.push(""), gc.push(blank), this.#adopt(child, index);
|
|
450
|
+
}
|
|
451
|
+
#adopt(child, index) {
|
|
452
|
+
let gc = child.#parts[0];
|
|
453
|
+
this.#parts.splice(index, 1, ...gc.#parts);
|
|
454
|
+
for (let p of gc.#parts)
|
|
455
|
+
typeof p == "object" && (p.#parent = this);
|
|
456
|
+
this.#toString = void 0;
|
|
457
|
+
}
|
|
458
|
+
#canUsurpType(c) {
|
|
459
|
+
return !!usurpMap.get(this.type)?.has(c);
|
|
460
|
+
}
|
|
461
|
+
#canUsurp(child) {
|
|
462
|
+
if (!child || typeof child != "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1)
|
|
463
|
+
return !1;
|
|
464
|
+
let gc = child.#parts[0];
|
|
465
|
+
return !gc || typeof gc != "object" || gc.type === null ? !1 : this.#canUsurpType(gc.type);
|
|
466
|
+
}
|
|
467
|
+
#usurp(child) {
|
|
468
|
+
let m = usurpMap.get(this.type), gc = child.#parts[0], nt = m?.get(gc.type);
|
|
469
|
+
if (!nt)
|
|
470
|
+
return !1;
|
|
471
|
+
this.#parts = gc.#parts;
|
|
472
|
+
for (let p of this.#parts)
|
|
473
|
+
typeof p == "object" && (p.#parent = this);
|
|
474
|
+
this.type = nt, this.#toString = void 0, this.#emptyExt = !1;
|
|
475
|
+
}
|
|
476
|
+
static fromGlob(pattern, options = {}) {
|
|
477
|
+
let ast = new _a(null, void 0, options);
|
|
478
|
+
return _a.#parseAST(pattern, ast, 0, options, 0), ast;
|
|
479
|
+
}
|
|
480
|
+
// returns the regular expression if there's magic, or the unescaped
|
|
481
|
+
// string if not.
|
|
482
|
+
toMMPattern() {
|
|
483
|
+
if (this !== this.#root)
|
|
484
|
+
return this.#root.toMMPattern();
|
|
485
|
+
let glob = this.toString(), [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
486
|
+
if (!(hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase()))
|
|
487
|
+
return body;
|
|
488
|
+
let flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
|
|
489
|
+
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
490
|
+
_src: re,
|
|
491
|
+
_glob: glob
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
get options() {
|
|
495
|
+
return this.#options;
|
|
496
|
+
}
|
|
497
|
+
// returns the string match, the regexp source, whether there's magic
|
|
498
|
+
// in the regexp (so a regular expression is required) and whether or
|
|
499
|
+
// not the uflag is needed for the regular expression (for posix classes)
|
|
500
|
+
// TODO: instead of injecting the start/end at this point, just return
|
|
501
|
+
// the BODY of the regexp, along with the start/end portions suitable
|
|
502
|
+
// for binding the start/end in either a joined full-path makeRe context
|
|
503
|
+
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
504
|
+
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
505
|
+
//
|
|
506
|
+
// In part-matching mode, the start is:
|
|
507
|
+
// - if not isStart: nothing
|
|
508
|
+
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
509
|
+
// - if dots allowed or not possible: ^
|
|
510
|
+
// - if dots possible and not allowed: ^(?!\.)
|
|
511
|
+
// end is:
|
|
512
|
+
// - if not isEnd(): nothing
|
|
513
|
+
// - else: $
|
|
514
|
+
//
|
|
515
|
+
// In full-path matching mode, we put the slash at the START of the
|
|
516
|
+
// pattern, so start is:
|
|
517
|
+
// - if first pattern: same as part-matching mode
|
|
518
|
+
// - if not isStart(): nothing
|
|
519
|
+
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
520
|
+
// - if dots allowed or not possible: /
|
|
521
|
+
// - if dots possible and not allowed: /(?!\.)
|
|
522
|
+
// end is:
|
|
523
|
+
// - if last pattern, same as part-matching mode
|
|
524
|
+
// - else nothing
|
|
525
|
+
//
|
|
526
|
+
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
527
|
+
// there to bind the end of the negated pattern portion, and it's easier to
|
|
528
|
+
// just stick it in now rather than try to inject it later in the middle of
|
|
529
|
+
// the pattern.
|
|
530
|
+
//
|
|
531
|
+
// We can just always return the same end, and leave it up to the caller
|
|
532
|
+
// to know whether it's going to be used joined or in parts.
|
|
533
|
+
// And, if the start is adjusted slightly, can do the same there:
|
|
534
|
+
// - if not isStart: nothing
|
|
535
|
+
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
536
|
+
// - if dots allowed or not possible: (?:/|^)
|
|
537
|
+
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
538
|
+
//
|
|
539
|
+
// But it's better to have a simpler binding without a conditional, for
|
|
540
|
+
// performance, so probably better to return both start options.
|
|
541
|
+
//
|
|
542
|
+
// Then the caller just ignores the end if it's not the first pattern,
|
|
543
|
+
// and the start always gets applied.
|
|
544
|
+
//
|
|
545
|
+
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
546
|
+
// so the caller can just attach $ at the end of the pattern when building.
|
|
547
|
+
//
|
|
548
|
+
// So the todo is:
|
|
549
|
+
// - better detect what kind of start is needed
|
|
550
|
+
// - return both flavors of starting pattern
|
|
551
|
+
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
552
|
+
//
|
|
553
|
+
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
554
|
+
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
555
|
+
// that dot prevention biz to live in the extglob portions, because eg
|
|
556
|
+
// +(*|.x*) can match .xy but not .yx.
|
|
557
|
+
//
|
|
558
|
+
// So, return the two flavors if it's #root and the first child is not an
|
|
559
|
+
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
560
|
+
// use the (?:^|/) style of start binding.
|
|
561
|
+
//
|
|
562
|
+
// Even simplified further:
|
|
563
|
+
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
564
|
+
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
565
|
+
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
566
|
+
toRegExpSource(allowDot) {
|
|
567
|
+
let dot = allowDot ?? !!this.#options.dot;
|
|
568
|
+
if (this.#root === this && (this.#flatten(), this.#fillNegs()), !isExtglobAST(this)) {
|
|
569
|
+
let noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s != "string"), src = this.#parts.map((p) => {
|
|
570
|
+
let [re, _, hasMagic, uflag] = typeof p == "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
571
|
+
return this.#hasMagic = this.#hasMagic || hasMagic, this.#uflag = this.#uflag || uflag, re;
|
|
572
|
+
}).join(""), start2 = "";
|
|
573
|
+
if (this.isStart() && typeof this.#parts[0] == "string" && !(this.#parts.length === 1 && justDots.has(this.#parts[0]))) {
|
|
574
|
+
let aps = addPatternStart, needNoTrav = (
|
|
575
|
+
// dots are allowed, and the pattern starts with [ or .
|
|
576
|
+
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
577
|
+
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
578
|
+
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
579
|
+
), needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
580
|
+
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
581
|
+
}
|
|
582
|
+
let end = "";
|
|
583
|
+
return this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!" && (end = "(?:$|\\/)"), [
|
|
584
|
+
start2 + src + end,
|
|
585
|
+
unescape(src),
|
|
586
|
+
this.#hasMagic = !!this.#hasMagic,
|
|
587
|
+
this.#uflag
|
|
588
|
+
];
|
|
589
|
+
}
|
|
590
|
+
let repeated = this.type === "*" || this.type === "+", start = this.type === "!" ? "(?:(?!(?:" : "(?:", body = this.#partsToRegExp(dot);
|
|
591
|
+
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
592
|
+
let s = this.toString(), me = this;
|
|
593
|
+
return me.#parts = [s], me.type = null, me.#hasMagic = void 0, [s, unescape(this.toString()), !1, !1];
|
|
594
|
+
}
|
|
595
|
+
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(!0);
|
|
596
|
+
bodyDotAllowed === body && (bodyDotAllowed = ""), bodyDotAllowed && (body = `(?:${body})(?:${bodyDotAllowed})*?`);
|
|
597
|
+
let final = "";
|
|
598
|
+
if (this.type === "!" && this.#emptyExt)
|
|
599
|
+
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
600
|
+
else {
|
|
601
|
+
let close = this.type === "!" ? (
|
|
602
|
+
// !() must match something,but !(x) can match ''
|
|
603
|
+
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
604
|
+
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? ")?" : `)${this.type}`;
|
|
605
|
+
final = start + body + close;
|
|
606
|
+
}
|
|
607
|
+
return [
|
|
608
|
+
final,
|
|
609
|
+
unescape(body),
|
|
610
|
+
this.#hasMagic = !!this.#hasMagic,
|
|
611
|
+
this.#uflag
|
|
612
|
+
];
|
|
613
|
+
}
|
|
614
|
+
#flatten() {
|
|
615
|
+
if (isExtglobAST(this)) {
|
|
616
|
+
let iterations = 0, done = !1;
|
|
617
|
+
do {
|
|
618
|
+
done = !0;
|
|
619
|
+
for (let i = 0; i < this.#parts.length; i++) {
|
|
620
|
+
let c = this.#parts[i];
|
|
621
|
+
typeof c == "object" && (c.#flatten(), this.#canAdopt(c) ? (done = !1, this.#adopt(c, i)) : this.#canAdoptWithSpace(c) ? (done = !1, this.#adoptWithSpace(c, i)) : this.#canUsurp(c) && (done = !1, this.#usurp(c)));
|
|
622
|
+
}
|
|
623
|
+
} while (!done && ++iterations < 10);
|
|
624
|
+
} else
|
|
625
|
+
for (let p of this.#parts)
|
|
626
|
+
typeof p == "object" && p.#flatten();
|
|
627
|
+
this.#toString = void 0;
|
|
628
|
+
}
|
|
629
|
+
#partsToRegExp(dot) {
|
|
630
|
+
return this.#parts.map((p) => {
|
|
631
|
+
if (typeof p == "string")
|
|
632
|
+
throw new Error("string type in extglob ast??");
|
|
633
|
+
let [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
|
634
|
+
return this.#uflag = this.#uflag || uflag, re;
|
|
635
|
+
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
636
|
+
}
|
|
637
|
+
static #parseGlob(glob, hasMagic, noEmpty = !1) {
|
|
638
|
+
let escaping = !1, re = "", uflag = !1, inStar = !1;
|
|
639
|
+
for (let i = 0; i < glob.length; i++) {
|
|
640
|
+
let c = glob.charAt(i);
|
|
641
|
+
if (escaping) {
|
|
642
|
+
escaping = !1, re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
if (c === "*") {
|
|
646
|
+
if (inStar)
|
|
647
|
+
continue;
|
|
648
|
+
inStar = !0, re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star, hasMagic = !0;
|
|
649
|
+
continue;
|
|
650
|
+
} else
|
|
651
|
+
inStar = !1;
|
|
652
|
+
if (c === "\\") {
|
|
653
|
+
i === glob.length - 1 ? re += "\\\\" : escaping = !0;
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
if (c === "[") {
|
|
657
|
+
let [src, needUflag, consumed, magic] = parseClass(glob, i);
|
|
658
|
+
if (consumed) {
|
|
659
|
+
re += src, uflag = uflag || needUflag, i += consumed - 1, hasMagic = hasMagic || magic;
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if (c === "?") {
|
|
664
|
+
re += qmark, hasMagic = !0;
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
re += regExpEscape(c);
|
|
668
|
+
}
|
|
669
|
+
return [re, unescape(glob), !!hasMagic, uflag];
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
_a = AST;
|
|
673
|
+
|
|
674
|
+
// node_modules/minimatch/dist/esm/escape.js
|
|
675
|
+
var escape = (s, { windowsPathsNoEscape = !1, magicalBraces = !1 } = {}) => magicalBraces ? windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&") : windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
676
|
+
|
|
677
|
+
// node_modules/minimatch/dist/esm/index.js
|
|
678
|
+
var minimatch = (p, pattern, options = {}) => (assertValidPattern(pattern), !options.nocomment && pattern.charAt(0) === "#" ? !1 : new Minimatch(pattern, options).match(p)), starDotExtRE = /^\*+([^+@!?*[(]*)$/, starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2), starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2), starDotExtTestNocase = (ext2) => (ext2 = ext2.toLowerCase(), (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2)), starDotExtTestNocaseDot = (ext2) => (ext2 = ext2.toLowerCase(), (f) => f.toLowerCase().endsWith(ext2)), starDotStarRE = /^\*+\.\*+$/, starDotStarTest = (f) => !f.startsWith(".") && f.includes("."), starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes("."), dotStarRE = /^\.\*+$/, dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith("."), starRE = /^\*+$/, starTest = (f) => f.length !== 0 && !f.startsWith("."), starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..", qmarksRE = /^\?+([^+@!?*[(]*)?$/, qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
679
|
+
let noext = qmarksTestNoExt([$0]);
|
|
680
|
+
return ext2 ? (ext2 = ext2.toLowerCase(), (f) => noext(f) && f.toLowerCase().endsWith(ext2)) : noext;
|
|
681
|
+
}, qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
682
|
+
let noext = qmarksTestNoExtDot([$0]);
|
|
683
|
+
return ext2 ? (ext2 = ext2.toLowerCase(), (f) => noext(f) && f.toLowerCase().endsWith(ext2)) : noext;
|
|
684
|
+
}, qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
685
|
+
let noext = qmarksTestNoExtDot([$0]);
|
|
686
|
+
return ext2 ? (f) => noext(f) && f.endsWith(ext2) : noext;
|
|
687
|
+
}, qmarksTest = ([$0, ext2 = ""]) => {
|
|
688
|
+
let noext = qmarksTestNoExt([$0]);
|
|
689
|
+
return ext2 ? (f) => noext(f) && f.endsWith(ext2) : noext;
|
|
690
|
+
}, qmarksTestNoExt = ([$0]) => {
|
|
691
|
+
let len = $0.length;
|
|
692
|
+
return (f) => f.length === len && !f.startsWith(".");
|
|
693
|
+
}, qmarksTestNoExtDot = ([$0]) => {
|
|
694
|
+
let len = $0.length;
|
|
695
|
+
return (f) => f.length === len && f !== "." && f !== "..";
|
|
696
|
+
}, defaultPlatform = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", path = {
|
|
697
|
+
win32: { sep: "\\" },
|
|
698
|
+
posix: { sep: "/" }
|
|
699
|
+
}, sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
700
|
+
minimatch.sep = sep;
|
|
701
|
+
var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
702
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
703
|
+
var qmark2 = "[^/]", star2 = qmark2 + "*?", twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
704
|
+
minimatch.filter = filter;
|
|
705
|
+
var ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
|
|
706
|
+
if (!def || typeof def != "object" || !Object.keys(def).length)
|
|
707
|
+
return minimatch;
|
|
708
|
+
let orig = minimatch;
|
|
709
|
+
return Object.assign((p, pattern, options = {}) => orig(p, pattern, ext(def, options)), {
|
|
710
|
+
Minimatch: class extends orig.Minimatch {
|
|
711
|
+
constructor(pattern, options = {}) {
|
|
712
|
+
super(pattern, ext(def, options));
|
|
713
|
+
}
|
|
714
|
+
static defaults(options) {
|
|
715
|
+
return orig.defaults(ext(def, options)).Minimatch;
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
AST: class extends orig.AST {
|
|
719
|
+
/* c8 ignore start */
|
|
720
|
+
constructor(type, parent, options = {}) {
|
|
721
|
+
super(type, parent, ext(def, options));
|
|
722
|
+
}
|
|
723
|
+
/* c8 ignore stop */
|
|
724
|
+
static fromGlob(pattern, options = {}) {
|
|
725
|
+
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
729
|
+
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
730
|
+
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
731
|
+
defaults: (options) => orig.defaults(ext(def, options)),
|
|
732
|
+
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
733
|
+
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
734
|
+
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
735
|
+
sep: orig.sep,
|
|
736
|
+
GLOBSTAR
|
|
737
|
+
});
|
|
738
|
+
};
|
|
739
|
+
minimatch.defaults = defaults;
|
|
740
|
+
var braceExpand = (pattern, options = {}) => (assertValidPattern(pattern), options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern) ? [pattern] : expand(pattern, { max: options.braceExpandMax }));
|
|
741
|
+
minimatch.braceExpand = braceExpand;
|
|
742
|
+
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
743
|
+
minimatch.makeRe = makeRe;
|
|
744
|
+
var match = (list, pattern, options = {}) => {
|
|
745
|
+
let mm = new Minimatch(pattern, options);
|
|
746
|
+
return list = list.filter((f) => mm.match(f)), mm.options.nonull && !list.length && list.push(pattern), list;
|
|
747
|
+
};
|
|
748
|
+
minimatch.match = match;
|
|
749
|
+
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/, regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Minimatch = class {
|
|
750
|
+
options;
|
|
751
|
+
set;
|
|
752
|
+
pattern;
|
|
753
|
+
windowsPathsNoEscape;
|
|
754
|
+
nonegate;
|
|
755
|
+
negate;
|
|
756
|
+
comment;
|
|
757
|
+
empty;
|
|
758
|
+
preserveMultipleSlashes;
|
|
759
|
+
partial;
|
|
760
|
+
globSet;
|
|
761
|
+
globParts;
|
|
762
|
+
nocase;
|
|
763
|
+
isWindows;
|
|
764
|
+
platform;
|
|
765
|
+
windowsNoMagicRoot;
|
|
766
|
+
maxGlobstarRecursion;
|
|
767
|
+
regexp;
|
|
768
|
+
constructor(pattern, options = {}) {
|
|
769
|
+
assertValidPattern(pattern), options = options || {}, this.options = options, this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200, this.pattern = pattern, this.platform = options.platform || defaultPlatform, this.isWindows = this.platform === "win32";
|
|
770
|
+
let awe = "allowWindowsEscape";
|
|
771
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!options.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!options.nonegate, this.comment = !1, this.empty = !1, this.partial = !!options.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
|
|
772
|
+
}
|
|
773
|
+
hasMagic() {
|
|
774
|
+
if (this.options.magicalBraces && this.set.length > 1)
|
|
775
|
+
return !0;
|
|
776
|
+
for (let pattern of this.set)
|
|
777
|
+
for (let part of pattern)
|
|
778
|
+
if (typeof part != "string")
|
|
779
|
+
return !0;
|
|
780
|
+
return !1;
|
|
781
|
+
}
|
|
782
|
+
debug(..._) {
|
|
783
|
+
}
|
|
784
|
+
make() {
|
|
785
|
+
let pattern = this.pattern, options = this.options;
|
|
786
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
787
|
+
this.comment = !0;
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
if (!pattern) {
|
|
791
|
+
this.empty = !0;
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], options.debug && (this.debug = (...args) => console.error(...args)), this.debug(this.pattern, this.globSet);
|
|
795
|
+
let rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
796
|
+
this.globParts = this.preprocess(rawGlobParts), this.debug(this.pattern, this.globParts);
|
|
797
|
+
let set = this.globParts.map((s, _, __) => {
|
|
798
|
+
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
799
|
+
let isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]), isDrive = /^[a-z]:/i.test(s[0]);
|
|
800
|
+
if (isUNC)
|
|
801
|
+
return [
|
|
802
|
+
...s.slice(0, 4),
|
|
803
|
+
...s.slice(4).map((ss) => this.parse(ss))
|
|
804
|
+
];
|
|
805
|
+
if (isDrive)
|
|
806
|
+
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
807
|
+
}
|
|
808
|
+
return s.map((ss) => this.parse(ss));
|
|
809
|
+
});
|
|
810
|
+
if (this.debug(this.pattern, set), this.set = set.filter((s) => s.indexOf(!1) === -1), this.isWindows)
|
|
811
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
812
|
+
let p = this.set[i];
|
|
813
|
+
p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] == "string" && /^[a-z]:$/i.test(p[3]) && (p[2] = "?");
|
|
814
|
+
}
|
|
815
|
+
this.debug(this.pattern, this.set);
|
|
816
|
+
}
|
|
817
|
+
// various transforms to equivalent pattern sets that are
|
|
818
|
+
// faster to process in a filesystem walk. The goal is to
|
|
819
|
+
// eliminate what we can, and push all ** patterns as far
|
|
820
|
+
// to the right as possible, even if it increases the number
|
|
821
|
+
// of patterns that we have to process.
|
|
822
|
+
preprocess(globParts) {
|
|
823
|
+
if (this.options.noglobstar)
|
|
824
|
+
for (let partset of globParts)
|
|
825
|
+
for (let j = 0; j < partset.length; j++)
|
|
826
|
+
partset[j] === "**" && (partset[j] = "*");
|
|
827
|
+
let { optimizationLevel = 1 } = this.options;
|
|
828
|
+
return optimizationLevel >= 2 ? (globParts = this.firstPhasePreProcess(globParts), globParts = this.secondPhasePreProcess(globParts)) : optimizationLevel >= 1 ? globParts = this.levelOneOptimize(globParts) : globParts = this.adjascentGlobstarOptimize(globParts), globParts;
|
|
829
|
+
}
|
|
830
|
+
// just get rid of adjascent ** portions
|
|
831
|
+
adjascentGlobstarOptimize(globParts) {
|
|
832
|
+
return globParts.map((parts) => {
|
|
833
|
+
let gs = -1;
|
|
834
|
+
for (; (gs = parts.indexOf("**", gs + 1)) !== -1; ) {
|
|
835
|
+
let i = gs;
|
|
836
|
+
for (; parts[i + 1] === "**"; )
|
|
837
|
+
i++;
|
|
838
|
+
i !== gs && parts.splice(gs, i - gs);
|
|
839
|
+
}
|
|
840
|
+
return parts;
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
// get rid of adjascent ** and resolve .. portions
|
|
844
|
+
levelOneOptimize(globParts) {
|
|
845
|
+
return globParts.map((parts) => (parts = parts.reduce((set, part) => {
|
|
846
|
+
let prev = set[set.length - 1];
|
|
847
|
+
return part === "**" && prev === "**" ? set : part === ".." && prev && prev !== ".." && prev !== "." && prev !== "**" ? (set.pop(), set) : (set.push(part), set);
|
|
848
|
+
}, []), parts.length === 0 ? [""] : parts));
|
|
849
|
+
}
|
|
850
|
+
levelTwoFileOptimize(parts) {
|
|
851
|
+
Array.isArray(parts) || (parts = this.slashSplit(parts));
|
|
852
|
+
let didSomething = !1;
|
|
853
|
+
do {
|
|
854
|
+
if (didSomething = !1, !this.preserveMultipleSlashes) {
|
|
855
|
+
for (let i = 1; i < parts.length - 1; i++) {
|
|
856
|
+
let p = parts[i];
|
|
857
|
+
i === 1 && p === "" && parts[0] === "" || (p === "." || p === "") && (didSomething = !0, parts.splice(i, 1), i--);
|
|
858
|
+
}
|
|
859
|
+
parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "") && (didSomething = !0, parts.pop());
|
|
860
|
+
}
|
|
861
|
+
let dd = 0;
|
|
862
|
+
for (; (dd = parts.indexOf("..", dd + 1)) !== -1; ) {
|
|
863
|
+
let p = parts[dd - 1];
|
|
864
|
+
p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p)) && (didSomething = !0, parts.splice(dd - 1, 2), dd -= 2);
|
|
865
|
+
}
|
|
866
|
+
} while (didSomething);
|
|
867
|
+
return parts.length === 0 ? [""] : parts;
|
|
868
|
+
}
|
|
869
|
+
// First phase: single-pattern processing
|
|
870
|
+
// <pre> is 1 or more portions
|
|
871
|
+
// <rest> is 1 or more portions
|
|
872
|
+
// <p> is any portion other than ., .., '', or **
|
|
873
|
+
// <e> is . or ''
|
|
874
|
+
//
|
|
875
|
+
// **/.. is *brutal* for filesystem walking performance, because
|
|
876
|
+
// it effectively resets the recursive walk each time it occurs,
|
|
877
|
+
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
878
|
+
// or most strings (other than .., ., and '') can be.
|
|
879
|
+
//
|
|
880
|
+
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
881
|
+
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
882
|
+
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
883
|
+
// **/**/<rest> -> **/<rest>
|
|
884
|
+
//
|
|
885
|
+
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
886
|
+
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
887
|
+
firstPhasePreProcess(globParts) {
|
|
888
|
+
let didSomething = !1;
|
|
889
|
+
do {
|
|
890
|
+
didSomething = !1;
|
|
891
|
+
for (let parts of globParts) {
|
|
892
|
+
let gs = -1;
|
|
893
|
+
for (; (gs = parts.indexOf("**", gs + 1)) !== -1; ) {
|
|
894
|
+
let gss = gs;
|
|
895
|
+
for (; parts[gss + 1] === "**"; )
|
|
896
|
+
gss++;
|
|
897
|
+
gss > gs && parts.splice(gs + 1, gss - gs);
|
|
898
|
+
let next = parts[gs + 1], p = parts[gs + 2], p2 = parts[gs + 3];
|
|
899
|
+
if (next !== ".." || !p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..")
|
|
900
|
+
continue;
|
|
901
|
+
didSomething = !0, parts.splice(gs, 1);
|
|
902
|
+
let other = parts.slice(0);
|
|
903
|
+
other[gs] = "**", globParts.push(other), gs--;
|
|
904
|
+
}
|
|
905
|
+
if (!this.preserveMultipleSlashes) {
|
|
906
|
+
for (let i = 1; i < parts.length - 1; i++) {
|
|
907
|
+
let p = parts[i];
|
|
908
|
+
i === 1 && p === "" && parts[0] === "" || (p === "." || p === "") && (didSomething = !0, parts.splice(i, 1), i--);
|
|
909
|
+
}
|
|
910
|
+
parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "") && (didSomething = !0, parts.pop());
|
|
911
|
+
}
|
|
912
|
+
let dd = 0;
|
|
913
|
+
for (; (dd = parts.indexOf("..", dd + 1)) !== -1; ) {
|
|
914
|
+
let p = parts[dd - 1];
|
|
915
|
+
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
916
|
+
didSomething = !0;
|
|
917
|
+
let splin = dd === 1 && parts[dd + 1] === "**" ? ["."] : [];
|
|
918
|
+
parts.splice(dd - 1, 2, ...splin), parts.length === 0 && parts.push(""), dd -= 2;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
} while (didSomething);
|
|
923
|
+
return globParts;
|
|
924
|
+
}
|
|
925
|
+
// second phase: multi-pattern dedupes
|
|
926
|
+
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
927
|
+
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
928
|
+
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
929
|
+
//
|
|
930
|
+
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
931
|
+
// ^-- not valid because ** doens't follow symlinks
|
|
932
|
+
secondPhasePreProcess(globParts) {
|
|
933
|
+
for (let i = 0; i < globParts.length - 1; i++)
|
|
934
|
+
for (let j = i + 1; j < globParts.length; j++) {
|
|
935
|
+
let matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
|
|
936
|
+
if (matched) {
|
|
937
|
+
globParts[i] = [], globParts[j] = matched;
|
|
938
|
+
break;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
return globParts.filter((gs) => gs.length);
|
|
942
|
+
}
|
|
943
|
+
partsMatch(a, b, emptyGSMatch = !1) {
|
|
944
|
+
let ai = 0, bi = 0, result = [], which = "";
|
|
945
|
+
for (; ai < a.length && bi < b.length; )
|
|
946
|
+
if (a[ai] === b[bi])
|
|
947
|
+
result.push(which === "b" ? b[bi] : a[ai]), ai++, bi++;
|
|
948
|
+
else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1])
|
|
949
|
+
result.push(a[ai]), ai++;
|
|
950
|
+
else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1])
|
|
951
|
+
result.push(b[bi]), bi++;
|
|
952
|
+
else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
953
|
+
if (which === "b")
|
|
954
|
+
return !1;
|
|
955
|
+
which = "a", result.push(a[ai]), ai++, bi++;
|
|
956
|
+
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
957
|
+
if (which === "a")
|
|
958
|
+
return !1;
|
|
959
|
+
which = "b", result.push(b[bi]), ai++, bi++;
|
|
960
|
+
} else
|
|
961
|
+
return !1;
|
|
962
|
+
return a.length === b.length && result;
|
|
963
|
+
}
|
|
964
|
+
parseNegate() {
|
|
965
|
+
if (this.nonegate)
|
|
966
|
+
return;
|
|
967
|
+
let pattern = this.pattern, negate = !1, negateOffset = 0;
|
|
968
|
+
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++)
|
|
969
|
+
negate = !negate, negateOffset++;
|
|
970
|
+
negateOffset && (this.pattern = pattern.slice(negateOffset)), this.negate = negate;
|
|
971
|
+
}
|
|
972
|
+
// set partial to true to test if, for example,
|
|
973
|
+
// "/a/b" matches the start of "/*/b/*/d"
|
|
974
|
+
// Partial means, if you run out of file before you run
|
|
975
|
+
// out of pattern, then that's fine, as long as all
|
|
976
|
+
// the parts match.
|
|
977
|
+
matchOne(file, pattern, partial = !1) {
|
|
978
|
+
let fileStartIndex = 0, patternStartIndex = 0;
|
|
979
|
+
if (this.isWindows) {
|
|
980
|
+
let fileDrive = typeof file[0] == "string" && /^[a-z]:$/i.test(file[0]), fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]), patternDrive = typeof pattern[0] == "string" && /^[a-z]:$/i.test(pattern[0]), patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] == "string" && /^[a-z]:$/i.test(pattern[3]), fdi = fileUNC ? 3 : fileDrive ? 0 : void 0, pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
981
|
+
if (typeof fdi == "number" && typeof pdi == "number") {
|
|
982
|
+
let [fd, pd] = [
|
|
983
|
+
file[fdi],
|
|
984
|
+
pattern[pdi]
|
|
985
|
+
];
|
|
986
|
+
fd.toLowerCase() === pd.toLowerCase() && (pattern[pdi] = fd, patternStartIndex = pdi, fileStartIndex = fdi);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
let { optimizationLevel = 1 } = this.options;
|
|
990
|
+
return optimizationLevel >= 2 && (file = this.levelTwoFileOptimize(file)), pattern.includes(GLOBSTAR) ? this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex) : this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
991
|
+
}
|
|
992
|
+
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
|
993
|
+
let firstgs = pattern.indexOf(GLOBSTAR, patternIndex), lastgs = pattern.lastIndexOf(GLOBSTAR), [head, body, tail] = partial ? [
|
|
994
|
+
pattern.slice(patternIndex, firstgs),
|
|
995
|
+
pattern.slice(firstgs + 1),
|
|
996
|
+
[]
|
|
997
|
+
] : [
|
|
998
|
+
pattern.slice(patternIndex, firstgs),
|
|
999
|
+
pattern.slice(firstgs + 1, lastgs),
|
|
1000
|
+
pattern.slice(lastgs + 1)
|
|
1001
|
+
];
|
|
1002
|
+
if (head.length) {
|
|
1003
|
+
let fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
1004
|
+
if (!this.#matchOne(fileHead, head, partial, 0, 0))
|
|
1005
|
+
return !1;
|
|
1006
|
+
fileIndex += head.length, patternIndex += head.length;
|
|
1007
|
+
}
|
|
1008
|
+
let fileTailMatch = 0;
|
|
1009
|
+
if (tail.length) {
|
|
1010
|
+
if (tail.length + fileIndex > file.length)
|
|
1011
|
+
return !1;
|
|
1012
|
+
let tailStart = file.length - tail.length;
|
|
1013
|
+
if (this.#matchOne(file, tail, partial, tailStart, 0))
|
|
1014
|
+
fileTailMatch = tail.length;
|
|
1015
|
+
else {
|
|
1016
|
+
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length || (tailStart--, !this.#matchOne(file, tail, partial, tailStart, 0)))
|
|
1017
|
+
return !1;
|
|
1018
|
+
fileTailMatch = tail.length + 1;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
if (!body.length) {
|
|
1022
|
+
let sawSome = !!fileTailMatch;
|
|
1023
|
+
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
|
1024
|
+
let f = String(file[i2]);
|
|
1025
|
+
if (sawSome = !0, f === "." || f === ".." || !this.options.dot && f.startsWith("."))
|
|
1026
|
+
return !1;
|
|
1027
|
+
}
|
|
1028
|
+
return partial || sawSome;
|
|
1029
|
+
}
|
|
1030
|
+
let bodySegments = [[[], 0]], currentBody = bodySegments[0], nonGsParts = 0, nonGsPartsSums = [0];
|
|
1031
|
+
for (let b of body)
|
|
1032
|
+
b === GLOBSTAR ? (nonGsPartsSums.push(nonGsParts), currentBody = [[], 0], bodySegments.push(currentBody)) : (currentBody[0].push(b), nonGsParts++);
|
|
1033
|
+
let i = bodySegments.length - 1, fileLength = file.length - fileTailMatch;
|
|
1034
|
+
for (let b of bodySegments)
|
|
1035
|
+
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
|
1036
|
+
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
1037
|
+
}
|
|
1038
|
+
// return false for "nope, not matching"
|
|
1039
|
+
// return null for "not matching, cannot keep trying"
|
|
1040
|
+
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
1041
|
+
let bs = bodySegments[bodyIndex];
|
|
1042
|
+
if (!bs) {
|
|
1043
|
+
for (let i = fileIndex; i < file.length; i++) {
|
|
1044
|
+
sawTail = !0;
|
|
1045
|
+
let f = file[i];
|
|
1046
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith("."))
|
|
1047
|
+
return !1;
|
|
1048
|
+
}
|
|
1049
|
+
return sawTail;
|
|
1050
|
+
}
|
|
1051
|
+
let [body, after] = bs;
|
|
1052
|
+
for (; fileIndex <= after; ) {
|
|
1053
|
+
if (this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0) && globStarDepth < this.maxGlobstarRecursion) {
|
|
1054
|
+
let sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
1055
|
+
if (sub !== !1)
|
|
1056
|
+
return sub;
|
|
1057
|
+
}
|
|
1058
|
+
let f = file[fileIndex];
|
|
1059
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith("."))
|
|
1060
|
+
return !1;
|
|
1061
|
+
fileIndex++;
|
|
1062
|
+
}
|
|
1063
|
+
return partial || null;
|
|
1064
|
+
}
|
|
1065
|
+
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
|
1066
|
+
let fi, pi, pl, fl;
|
|
1067
|
+
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1068
|
+
this.debug("matchOne loop");
|
|
1069
|
+
let p = pattern[pi], f = file[fi];
|
|
1070
|
+
if (this.debug(pattern, p, f), p === !1 || p === GLOBSTAR)
|
|
1071
|
+
return !1;
|
|
1072
|
+
let hit;
|
|
1073
|
+
if (typeof p == "string" ? (hit = f === p, this.debug("string match", p, f, hit)) : (hit = p.test(f), this.debug("pattern match", p, f, hit)), !hit)
|
|
1074
|
+
return !1;
|
|
1075
|
+
}
|
|
1076
|
+
if (fi === fl && pi === pl)
|
|
1077
|
+
return !0;
|
|
1078
|
+
if (fi === fl)
|
|
1079
|
+
return partial;
|
|
1080
|
+
if (pi === pl)
|
|
1081
|
+
return fi === fl - 1 && file[fi] === "";
|
|
1082
|
+
throw new Error("wtf?");
|
|
1083
|
+
}
|
|
1084
|
+
braceExpand() {
|
|
1085
|
+
return braceExpand(this.pattern, this.options);
|
|
1086
|
+
}
|
|
1087
|
+
parse(pattern) {
|
|
1088
|
+
assertValidPattern(pattern);
|
|
1089
|
+
let options = this.options;
|
|
1090
|
+
if (pattern === "**")
|
|
1091
|
+
return GLOBSTAR;
|
|
1092
|
+
if (pattern === "")
|
|
1093
|
+
return "";
|
|
1094
|
+
let m, fastTest = null;
|
|
1095
|
+
(m = pattern.match(starRE)) ? fastTest = options.dot ? starTestDot : starTest : (m = pattern.match(starDotExtRE)) ? fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]) : (m = pattern.match(qmarksRE)) ? fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m) : (m = pattern.match(starDotStarRE)) ? fastTest = options.dot ? starDotStarTestDot : starDotStarTest : (m = pattern.match(dotStarRE)) && (fastTest = dotStarTest);
|
|
1096
|
+
let re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
1097
|
+
return fastTest && typeof re == "object" && Reflect.defineProperty(re, "test", { value: fastTest }), re;
|
|
1098
|
+
}
|
|
1099
|
+
makeRe() {
|
|
1100
|
+
if (this.regexp || this.regexp === !1)
|
|
1101
|
+
return this.regexp;
|
|
1102
|
+
let set = this.set;
|
|
1103
|
+
if (!set.length)
|
|
1104
|
+
return this.regexp = !1, this.regexp;
|
|
1105
|
+
let options = this.options, twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot, flags = new Set(options.nocase ? ["i"] : []), re = set.map((pattern) => {
|
|
1106
|
+
let pp = pattern.map((p) => {
|
|
1107
|
+
if (p instanceof RegExp)
|
|
1108
|
+
for (let f of p.flags.split(""))
|
|
1109
|
+
flags.add(f);
|
|
1110
|
+
return typeof p == "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
1111
|
+
});
|
|
1112
|
+
pp.forEach((p, i) => {
|
|
1113
|
+
let next = pp[i + 1], prev = pp[i - 1];
|
|
1114
|
+
p !== GLOBSTAR || prev === GLOBSTAR || (prev === void 0 ? next !== void 0 && next !== GLOBSTAR ? pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next : pp[i] = twoStar : next === void 0 ? pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?" : next !== GLOBSTAR && (pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next, pp[i + 1] = GLOBSTAR));
|
|
1115
|
+
});
|
|
1116
|
+
let filtered = pp.filter((p) => p !== GLOBSTAR);
|
|
1117
|
+
if (this.partial && filtered.length >= 1) {
|
|
1118
|
+
let prefixes = [];
|
|
1119
|
+
for (let i = 1; i <= filtered.length; i++)
|
|
1120
|
+
prefixes.push(filtered.slice(0, i).join("/"));
|
|
1121
|
+
return "(?:" + prefixes.join("|") + ")";
|
|
1122
|
+
}
|
|
1123
|
+
return filtered.join("/");
|
|
1124
|
+
}).join("|"), [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
1125
|
+
re = "^" + open + re + close + "$", this.partial && (re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$"), this.negate && (re = "^(?!" + re + ").+$");
|
|
1126
|
+
try {
|
|
1127
|
+
this.regexp = new RegExp(re, [...flags].join(""));
|
|
1128
|
+
} catch {
|
|
1129
|
+
this.regexp = !1;
|
|
1130
|
+
}
|
|
1131
|
+
return this.regexp;
|
|
1132
|
+
}
|
|
1133
|
+
slashSplit(p) {
|
|
1134
|
+
return this.preserveMultipleSlashes ? p.split("/") : this.isWindows && /^\/\/[^/]+/.test(p) ? ["", ...p.split(/\/+/)] : p.split(/\/+/);
|
|
1135
|
+
}
|
|
1136
|
+
match(f, partial = this.partial) {
|
|
1137
|
+
if (this.debug("match", f, this.pattern), this.comment)
|
|
1138
|
+
return !1;
|
|
1139
|
+
if (this.empty)
|
|
1140
|
+
return f === "";
|
|
1141
|
+
if (f === "/" && partial)
|
|
1142
|
+
return !0;
|
|
1143
|
+
let options = this.options;
|
|
1144
|
+
this.isWindows && (f = f.split("\\").join("/"));
|
|
1145
|
+
let ff = this.slashSplit(f);
|
|
1146
|
+
this.debug(this.pattern, "split", ff);
|
|
1147
|
+
let set = this.set;
|
|
1148
|
+
this.debug(this.pattern, "set", set);
|
|
1149
|
+
let filename = ff[ff.length - 1];
|
|
1150
|
+
if (!filename)
|
|
1151
|
+
for (let i = ff.length - 2; !filename && i >= 0; i--)
|
|
1152
|
+
filename = ff[i];
|
|
1153
|
+
for (let pattern of set) {
|
|
1154
|
+
let file = ff;
|
|
1155
|
+
if (options.matchBase && pattern.length === 1 && (file = [filename]), this.matchOne(file, pattern, partial))
|
|
1156
|
+
return options.flipNegate ? !0 : !this.negate;
|
|
1157
|
+
}
|
|
1158
|
+
return options.flipNegate ? !1 : this.negate;
|
|
1159
|
+
}
|
|
1160
|
+
static defaults(def) {
|
|
1161
|
+
return minimatch.defaults(def).Minimatch;
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
minimatch.AST = AST;
|
|
1165
|
+
minimatch.Minimatch = Minimatch;
|
|
1166
|
+
minimatch.escape = escape;
|
|
1167
|
+
minimatch.unescape = unescape;
|
|
1168
|
+
|
|
1169
|
+
export {
|
|
1170
|
+
minimatch
|
|
1171
|
+
};
|