cngpac 0.0.1
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/LICENSE +201 -0
- package/dist/bin.mjs +24025 -0
- package/dist/src/_virtual/_rolldown/runtime.mjs +35 -0
- package/dist/src/changelog.d.mts +71 -0
- package/dist/src/changelog.mjs +92 -0
- package/dist/src/changenote.d.mts +41 -0
- package/dist/src/changenote.mjs +184 -0
- package/dist/src/cli/commands/change.d.mts +4 -0
- package/dist/src/cli/commands/change.mjs +75 -0
- package/dist/src/formatter.d.mts +31 -0
- package/dist/src/formatter.mjs +50 -0
- package/dist/src/git.d.mts +20 -0
- package/dist/src/git.mjs +121 -0
- package/dist/src/index.d.mts +19 -0
- package/dist/src/index.mjs +20 -0
- package/dist/src/node_modules/.pnpm/@clack_core@1.2.0/node_modules/@clack/core/dist/index.mjs +530 -0
- package/dist/src/node_modules/.pnpm/@clack_prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs +110 -0
- package/dist/src/node_modules/.pnpm/@kwsites_file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.mjs +13 -0
- package/dist/src/node_modules/.pnpm/@kwsites_file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.mjs +59 -0
- package/dist/src/node_modules/.pnpm/@kwsites_promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.mjs +55 -0
- package/dist/src/node_modules/.pnpm/@octokit_auth-token@6.0.0/node_modules/@octokit/auth-token/dist-bundle/index.mjs +32 -0
- package/dist/src/node_modules/.pnpm/@octokit_core@7.0.6/node_modules/@octokit/core/dist-src/index.mjs +94 -0
- package/dist/src/node_modules/.pnpm/@octokit_core@7.0.6/node_modules/@octokit/core/dist-src/version.mjs +4 -0
- package/dist/src/node_modules/.pnpm/@octokit_endpoint@11.0.3/node_modules/@octokit/endpoint/dist-bundle/index.mjs +223 -0
- package/dist/src/node_modules/.pnpm/@octokit_graphql@9.0.3/node_modules/@octokit/graphql/dist-bundle/index.mjs +90 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-paginate-rest@14.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.mjs +86 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-request-log@6.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/index.mjs +22 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-request-log@6.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/version.mjs +4 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.mjs +94 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.mjs +1295 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.mjs +17 -0
- package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.mjs +4 -0
- package/dist/src/node_modules/.pnpm/@octokit_request-error@7.1.0/node_modules/@octokit/request-error/dist-src/index.mjs +30 -0
- package/dist/src/node_modules/.pnpm/@octokit_request@10.0.8/node_modules/@octokit/request/dist-bundle/index.mjs +146 -0
- package/dist/src/node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/index.mjs +9 -0
- package/dist/src/node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/version.mjs +4 -0
- package/dist/src/node_modules/.pnpm/@simple-git_args-pathspec@1.0.2/node_modules/@simple-git/args-pathspec/dist/index.mjs +14 -0
- package/dist/src/node_modules/.pnpm/@simple-git_argv-parser@1.0.3/node_modules/@simple-git/argv-parser/dist/index.mjs +369 -0
- package/dist/src/node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.mjs +13 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/index.mjs +43 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/add.mjs +28 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/register.mjs +16 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/remove.mjs +11 -0
- package/dist/src/node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.mjs +2135 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.mjs +200 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.mjs +206 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.mjs +15 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.mjs +212 -0
- package/dist/src/node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.mjs +19 -0
- package/dist/src/node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.mjs +4 -0
- package/dist/src/node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.mjs +7 -0
- package/dist/src/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.mjs +76 -0
- package/dist/src/node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.mjs +115 -0
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.mjs +138 -0
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.mjs +12 -0
- package/dist/src/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.mjs +12 -0
- package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.mjs +165 -0
- package/dist/src/node_modules/.pnpm/fault@2.0.1/node_modules/fault/index.mjs +38 -0
- package/dist/src/node_modules/.pnpm/format@0.2.2/node_modules/format/format.mjs +87 -0
- package/dist/src/node_modules/.pnpm/glob@13.0.6/node_modules/glob/dist/esm/index.min.mjs +3125 -0
- package/dist/src/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.mjs +13 -0
- package/dist/src/node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.mjs +8 -0
- package/dist/src/node_modules/.pnpm/json-with-bigint@3.5.8/node_modules/json-with-bigint/json-with-bigint.mjs +137 -0
- package/dist/src/node_modules/.pnpm/localstorage-polyfill@1.0.1/node_modules/localstorage-polyfill/localStorage.mjs +39 -0
- package/dist/src/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.mjs +29 -0
- package/dist/src/node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/index.mjs +976 -0
- package/dist/src/node_modules/.pnpm/mdast-util-frontmatter@2.0.1/node_modules/mdast-util-frontmatter/lib/index.mjs +162 -0
- package/dist/src/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.mjs +36 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/configure.mjs +48 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.mjs +27 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.mjs +20 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.mjs +62 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.mjs +61 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.mjs +51 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.mjs +47 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.mjs +20 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.mjs +50 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.mjs +69 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.mjs +47 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.mjs +40 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.mjs +50 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.mjs +93 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.mjs +35 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.mjs +48 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.mjs +22 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.mjs +20 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.mjs +51 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.mjs +17 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.mjs +19 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/index.mjs +161 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/join.mjs +18 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/unsafe.mjs +223 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/association.mjs +31 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.mjs +19 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-fence.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-quote.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-strong.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.mjs +16 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/container-flow.mjs +56 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.mjs +75 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.mjs +14 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.mjs +74 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.mjs +15 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.mjs +24 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.mjs +17 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/indent-lines.mjs +32 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.mjs +27 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/safe.mjs +116 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/track.mjs +59 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.mjs +83 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/attention.mjs +224 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/autolink.mjs +213 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/blank-line.mjs +60 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/block-quote.mjs +130 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-escape.mjs +62 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-reference.mjs +141 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-fenced.mjs +418 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-indented.mjs +147 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-text.mjs +187 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/content.mjs +137 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/definition.mjs +223 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/hard-break-escape.mjs +59 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/heading-atx.mjs +189 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-flow.mjs +777 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-text.mjs +617 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-end.mjs +479 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-image.mjs +95 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-link.mjs +50 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/line-ending.mjs +32 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/list.mjs +177 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/setext-underline.mjs +155 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/thematic-break.mjs +98 -0
- package/dist/src/node_modules/.pnpm/micromark-extension-frontmatter@2.0.0/node_modules/micromark-extension-frontmatter/lib/syntax.mjs +352 -0
- package/dist/src/node_modules/.pnpm/micromark-extension-frontmatter@2.0.0/node_modules/micromark-extension-frontmatter/lib/to-matters.mjs +109 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-destination@2.0.1/node_modules/micromark-factory-destination/index.mjs +186 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-label@2.0.1/node_modules/micromark-factory-label/index.mjs +134 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-space@2.0.1/node_modules/micromark-factory-space/index.mjs +61 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-title@2.0.1/node_modules/micromark-factory-title/index.mjs +148 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-whitespace@2.0.1/node_modules/micromark-factory-whitespace/index.mjs +43 -0
- package/dist/src/node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.mjs +229 -0
- package/dist/src/node_modules/.pnpm/micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.mjs +71 -0
- package/dist/src/node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.mjs +25 -0
- package/dist/src/node_modules/.pnpm/micromark-util-combine-extensions@2.0.1/node_modules/micromark-util-combine-extensions/index.mjs +73 -0
- package/dist/src/node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.mjs +22 -0
- package/dist/src/node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.mjs +40 -0
- package/dist/src/node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.mjs +100 -0
- package/dist/src/node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.mjs +25 -0
- package/dist/src/node_modules/.pnpm/micromark-util-resolve-all@2.0.1/node_modules/micromark-util-resolve-all/index.mjs +31 -0
- package/dist/src/node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/index.mjs +158 -0
- package/dist/src/node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.mjs +231 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/constructs.mjs +101 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/create-tokenizer.mjs +473 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/content.mjs +70 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/document.mjs +220 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/flow.mjs +51 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/text.mjs +178 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.mjs +52 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/postprocess.mjs +17 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/preprocess.mjs +102 -0
- package/dist/src/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.mjs +121 -0
- package/dist/src/node_modules/.pnpm/remark-frontmatter@5.0.0/node_modules/remark-frontmatter/lib/index.mjs +35 -0
- package/dist/src/node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/lib/index.mjs +37 -0
- package/dist/src/node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.mjs +36 -0
- package/dist/src/node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.mjs +3563 -0
- package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.mjs +57 -0
- package/dist/src/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.mjs +72 -0
- package/dist/src/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.mjs +157 -0
- package/dist/src/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/callable-instance.mjs +13 -0
- package/dist/src/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.mjs +1088 -0
- package/dist/src/node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.mjs +110 -0
- package/dist/src/node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.mjs +65 -0
- package/dist/src/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.node.mjs +10 -0
- package/dist/src/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.mjs +328 -0
- package/dist/src/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs +287 -0
- package/dist/src/node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.mjs +8 -0
- package/dist/src/node_modules/.pnpm/vfile-message@4.0.3/node_modules/vfile-message/lib/index.mjs +247 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/index.mjs +525 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minpath.mjs +2 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minproc.mjs +2 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minurl.mjs +3 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minurl.shared.mjs +24 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.mjs +62 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.mjs +49 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.mjs +98 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.mjs +66 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/composer.mjs +207 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.mjs +93 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.mjs +179 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.mjs +48 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.mjs +41 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.mjs +166 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs +211 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.mjs +110 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.mjs +32 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs +30 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.mjs +16 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.mjs +16 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/Document.mjs +295 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.mjs +43 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.mjs +69 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.mjs +170 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/errors.mjs +56 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/index.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/log.mjs +17 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.mjs +101 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.mjs +127 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.mjs +40 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.mjs +40 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.mjs +33 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.mjs +118 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.mjs +115 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.mjs +59 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.mjs +53 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.mjs +41 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.mjs +274 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.mjs +54 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.mjs +94 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst.mjs +85 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.mjs +523 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.mjs +50 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/parser.mjs +861 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/public-api.mjs +97 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.mjs +36 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.mjs +22 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.mjs +19 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.mjs +22 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.mjs +19 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.mjs +23 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.mjs +46 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.mjs +45 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.mjs +34 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.mjs +68 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/tags.mjs +103 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs +53 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs +31 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.mjs +49 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.mjs +79 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs +45 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs +71 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs +56 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.mjs +74 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs +87 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.mjs +119 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.mjs +115 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.mjs +124 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.mjs +23 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.mjs +24 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.mjs +104 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.mjs +229 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/visit.mjs +194 -0
- package/dist/src/node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.mjs +106 -0
- package/dist/src/pkg.d.mts +24 -0
- package/dist/src/pkg.mjs +39 -0
- package/dist/src/prepare.d.mts +14 -0
- package/dist/src/prepare.mjs +41 -0
- package/dist/src/publishers/npm.d.mts +21 -0
- package/dist/src/publishers/npm.mjs +42 -0
- package/dist/src/releasers/github.d.mts +10 -0
- package/dist/src/releasers/github.mjs +20 -0
- package/dist/src/saver.d.mts +42 -0
- package/dist/src/saver.mjs +39 -0
- package/dist/src/types.d.mts +150 -0
- package/dist/src/utils.d.mts +7 -0
- package/dist/src/utils.mjs +47 -0
- package/dist/src/version.d.mts +9 -0
- package/dist/src/version.mjs +18 -0
- package/package.json +156 -0
- package/templates/cngpac.config.ts +33 -0
- package/templates/version.yml +30 -0
|
@@ -0,0 +1,3125 @@
|
|
|
1
|
+
import { lstat, readdir, readlink, realpath } from "node:fs/promises";
|
|
2
|
+
import { posix, win32 } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { lstatSync, readdir as readdir$1, readdirSync, readlinkSync, realpathSync } from "fs";
|
|
5
|
+
import * as xi from "node:fs";
|
|
6
|
+
import { EventEmitter } from "node:events";
|
|
7
|
+
import Pe from "node:stream";
|
|
8
|
+
import { StringDecoder } from "node:string_decoder";
|
|
9
|
+
//#region node_modules/.pnpm/glob@13.0.6/node_modules/glob/dist/esm/index.min.js
|
|
10
|
+
var Gt = (n, t, e) => {
|
|
11
|
+
let s = n instanceof RegExp ? ce(n, e) : n, i = t instanceof RegExp ? ce(t, e) : t, r = s !== null && i != null && ss(s, i, e);
|
|
12
|
+
return r && {
|
|
13
|
+
start: r[0],
|
|
14
|
+
end: r[1],
|
|
15
|
+
pre: e.slice(0, r[0]),
|
|
16
|
+
body: e.slice(r[0] + s.length, r[1]),
|
|
17
|
+
post: e.slice(r[1] + i.length)
|
|
18
|
+
};
|
|
19
|
+
}, ce = (n, t) => {
|
|
20
|
+
let e = t.match(n);
|
|
21
|
+
return e ? e[0] : null;
|
|
22
|
+
}, ss = (n, t, e) => {
|
|
23
|
+
let s, i, r, o, h, a = e.indexOf(n), l = e.indexOf(t, a + 1), u = a;
|
|
24
|
+
if (a >= 0 && l > 0) {
|
|
25
|
+
if (n === t) return [a, l];
|
|
26
|
+
for (s = [], r = e.length; u >= 0 && !h;) {
|
|
27
|
+
if (u === a) s.push(u), a = e.indexOf(n, u + 1);
|
|
28
|
+
else if (s.length === 1) {
|
|
29
|
+
let c = s.pop();
|
|
30
|
+
c !== void 0 && (h = [c, l]);
|
|
31
|
+
} else i = s.pop(), i !== void 0 && i < r && (r = i, o = l), l = e.indexOf(t, u + 1);
|
|
32
|
+
u = a < l && a >= 0 ? a : l;
|
|
33
|
+
}
|
|
34
|
+
s.length && o !== void 0 && (h = [r, o]);
|
|
35
|
+
}
|
|
36
|
+
return h;
|
|
37
|
+
};
|
|
38
|
+
var fe = "\0SLASH" + Math.random() + "\0", ue = "\0OPEN" + Math.random() + "\0", qt = "\0CLOSE" + Math.random() + "\0", de = "\0COMMA" + Math.random() + "\0", pe = "\0PERIOD" + Math.random() + "\0", is = new RegExp(fe, "g"), rs = new RegExp(ue, "g"), ns = new RegExp(qt, "g"), os = new RegExp(de, "g"), hs = new RegExp(pe, "g"), as = /\\\\/g, ls = /\\{/g, cs = /\\}/g, fs$2 = /\\,/g, us = /\\./g, ds = 1e5;
|
|
39
|
+
function Ht(n) {
|
|
40
|
+
return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10);
|
|
41
|
+
}
|
|
42
|
+
function ps(n) {
|
|
43
|
+
return n.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs$2, de).replace(us, pe);
|
|
44
|
+
}
|
|
45
|
+
function ms(n) {
|
|
46
|
+
return n.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os, ",").replace(hs, ".");
|
|
47
|
+
}
|
|
48
|
+
function me(n) {
|
|
49
|
+
if (!n) return [""];
|
|
50
|
+
let t = [], e = Gt("{", "}", n);
|
|
51
|
+
if (!e) return n.split(",");
|
|
52
|
+
let { pre: s, body: i, post: r } = e, o = s.split(",");
|
|
53
|
+
o[o.length - 1] += "{" + i + "}";
|
|
54
|
+
let h = me(r);
|
|
55
|
+
return r.length && (o[o.length - 1] += h.shift(), o.push.apply(o, h)), t.push.apply(t, o), t;
|
|
56
|
+
}
|
|
57
|
+
function ge(n, t = {}) {
|
|
58
|
+
if (!n) return [];
|
|
59
|
+
let { max: e = ds } = t;
|
|
60
|
+
return n.slice(0, 2) === "{}" && (n = "\\{\\}" + n.slice(2)), ht(ps(n), e, !0).map(ms);
|
|
61
|
+
}
|
|
62
|
+
function gs(n) {
|
|
63
|
+
return "{" + n + "}";
|
|
64
|
+
}
|
|
65
|
+
function ws(n) {
|
|
66
|
+
return /^-?0\d/.test(n);
|
|
67
|
+
}
|
|
68
|
+
function ys(n, t) {
|
|
69
|
+
return n <= t;
|
|
70
|
+
}
|
|
71
|
+
function bs(n, t) {
|
|
72
|
+
return n >= t;
|
|
73
|
+
}
|
|
74
|
+
function ht(n, t, e) {
|
|
75
|
+
let s = [], i = Gt("{", "}", n);
|
|
76
|
+
if (!i) return [n];
|
|
77
|
+
let r = i.pre, o = i.post.length ? ht(i.post, t, !1) : [""];
|
|
78
|
+
if (/\$$/.test(i.pre)) for (let h = 0; h < o.length && h < t; h++) {
|
|
79
|
+
let a = r + "{" + i.body + "}" + o[h];
|
|
80
|
+
s.push(a);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
let h = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body), a = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body), l = h || a, u = i.body.indexOf(",") >= 0;
|
|
84
|
+
if (!l && !u) return i.post.match(/,(?!,).*\}/) ? (n = i.pre + "{" + i.body + qt + i.post, ht(n, t, !0)) : [n];
|
|
85
|
+
let c;
|
|
86
|
+
if (l) c = i.body.split(/\.\./);
|
|
87
|
+
else if (c = me(i.body), c.length === 1 && c[0] !== void 0 && (c = ht(c[0], t, !1).map(gs), c.length === 1)) return o.map((f) => i.pre + c[0] + f);
|
|
88
|
+
let d;
|
|
89
|
+
if (l && c[0] !== void 0 && c[1] !== void 0) {
|
|
90
|
+
let f = Ht(c[0]), m = Ht(c[1]), p = Math.max(c[0].length, c[1].length), w = c.length === 3 && c[2] !== void 0 ? Math.abs(Ht(c[2])) : 1, g = ys;
|
|
91
|
+
m < f && (w *= -1, g = bs);
|
|
92
|
+
let E = c.some(ws);
|
|
93
|
+
d = [];
|
|
94
|
+
for (let y = f; g(y, m); y += w) {
|
|
95
|
+
let b;
|
|
96
|
+
if (a) b = String.fromCharCode(y), b === "\\" && (b = "");
|
|
97
|
+
else if (b = String(y), E) {
|
|
98
|
+
let z = p - b.length;
|
|
99
|
+
if (z > 0) {
|
|
100
|
+
let $ = new Array(z + 1).join("0");
|
|
101
|
+
y < 0 ? b = "-" + $ + b.slice(1) : b = $ + b;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
d.push(b);
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
d = [];
|
|
108
|
+
for (let f = 0; f < c.length; f++) d.push.apply(d, ht(c[f], t, !1));
|
|
109
|
+
}
|
|
110
|
+
for (let f = 0; f < d.length; f++) for (let m = 0; m < o.length && s.length < t; m++) {
|
|
111
|
+
let p = r + d[f] + o[m];
|
|
112
|
+
(!e || l || p) && s.push(p);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return s;
|
|
116
|
+
}
|
|
117
|
+
var at = (n) => {
|
|
118
|
+
if (typeof n != "string") throw new TypeError("invalid pattern");
|
|
119
|
+
if (n.length > 65536) throw new TypeError("pattern is too long");
|
|
120
|
+
};
|
|
121
|
+
var Ss = {
|
|
122
|
+
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0],
|
|
123
|
+
"[:alpha:]": ["\\p{L}\\p{Nl}", !0],
|
|
124
|
+
"[:ascii:]": ["\\x00-\\x7f", !1],
|
|
125
|
+
"[:blank:]": ["\\p{Zs}\\t", !0],
|
|
126
|
+
"[:cntrl:]": ["\\p{Cc}", !0],
|
|
127
|
+
"[:digit:]": ["\\p{Nd}", !0],
|
|
128
|
+
"[:graph:]": [
|
|
129
|
+
"\\p{Z}\\p{C}",
|
|
130
|
+
!0,
|
|
131
|
+
!0
|
|
132
|
+
],
|
|
133
|
+
"[:lower:]": ["\\p{Ll}", !0],
|
|
134
|
+
"[:print:]": ["\\p{C}", !0],
|
|
135
|
+
"[:punct:]": ["\\p{P}", !0],
|
|
136
|
+
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0],
|
|
137
|
+
"[:upper:]": ["\\p{Lu}", !0],
|
|
138
|
+
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
|
|
139
|
+
"[:xdigit:]": ["A-Fa-f0-9", !1]
|
|
140
|
+
}, lt = (n) => n.replace(/[[\]\\-]/g, "\\$&"), Es = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), we = (n) => n.join(""), ye = (n, t) => {
|
|
141
|
+
let e = t;
|
|
142
|
+
if (n.charAt(e) !== "[") throw new Error("not in a brace expression");
|
|
143
|
+
let s = [], i = [], r = e + 1, o = !1, h = !1, a = !1, l = !1, u = e, c = "";
|
|
144
|
+
t: for (; r < n.length;) {
|
|
145
|
+
let p = n.charAt(r);
|
|
146
|
+
if ((p === "!" || p === "^") && r === e + 1) {
|
|
147
|
+
l = !0, r++;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (p === "]" && o && !a) {
|
|
151
|
+
u = r + 1;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
if (o = !0, p === "\\" && !a) {
|
|
155
|
+
a = !0, r++;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (p === "[" && !a) {
|
|
159
|
+
for (let [w, [g, S, E]] of Object.entries(Ss)) if (n.startsWith(w, r)) {
|
|
160
|
+
if (c) return [
|
|
161
|
+
"$.",
|
|
162
|
+
!1,
|
|
163
|
+
n.length - e,
|
|
164
|
+
!0
|
|
165
|
+
];
|
|
166
|
+
r += w.length, E ? i.push(g) : s.push(g), h = h || S;
|
|
167
|
+
continue t;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (a = !1, c) {
|
|
171
|
+
p > c ? s.push(lt(c) + "-" + lt(p)) : p === c && s.push(lt(p)), c = "", r++;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (n.startsWith("-]", r + 1)) {
|
|
175
|
+
s.push(lt(p + "-")), r += 2;
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (n.startsWith("-", r + 1)) {
|
|
179
|
+
c = p, r += 2;
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
s.push(lt(p)), r++;
|
|
183
|
+
}
|
|
184
|
+
if (u < r) return [
|
|
185
|
+
"",
|
|
186
|
+
!1,
|
|
187
|
+
0,
|
|
188
|
+
!1
|
|
189
|
+
];
|
|
190
|
+
if (!s.length && !i.length) return [
|
|
191
|
+
"$.",
|
|
192
|
+
!1,
|
|
193
|
+
n.length - e,
|
|
194
|
+
!0
|
|
195
|
+
];
|
|
196
|
+
if (i.length === 0 && s.length === 1 && /^\\?.$/.test(s[0]) && !l) return [
|
|
197
|
+
Es(s[0].length === 2 ? s[0].slice(-1) : s[0]),
|
|
198
|
+
!1,
|
|
199
|
+
u - e,
|
|
200
|
+
!1
|
|
201
|
+
];
|
|
202
|
+
let d = "[" + (l ? "^" : "") + we(s) + "]", f = "[" + (l ? "" : "^") + we(i) + "]";
|
|
203
|
+
return [
|
|
204
|
+
s.length && i.length ? "(" + d + "|" + f + ")" : s.length ? d : f,
|
|
205
|
+
h,
|
|
206
|
+
u - e,
|
|
207
|
+
!0
|
|
208
|
+
];
|
|
209
|
+
};
|
|
210
|
+
var W = (n, { windowsPathsNoEscape: t = !1, magicalBraces: e = !0 } = {}) => e ? t ? n.replace(/\[([^\/\\])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n.replace(/\[([^\/\\{}])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
211
|
+
var xs = new Set([
|
|
212
|
+
"!",
|
|
213
|
+
"?",
|
|
214
|
+
"+",
|
|
215
|
+
"*",
|
|
216
|
+
"@"
|
|
217
|
+
]), be = (n) => xs.has(n), vs = "(?!(?:^|/)\\.\\.?(?:$|/))", Ct = "(?!\\.)", Cs = new Set(["[", "."]), Ts = new Set(["..", "."]), As = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), ks = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Kt = "[^/]", Se = Kt + "*?", Ee = Kt + "+?", Q = class n {
|
|
218
|
+
type;
|
|
219
|
+
#t;
|
|
220
|
+
#s;
|
|
221
|
+
#n = !1;
|
|
222
|
+
#r = [];
|
|
223
|
+
#o;
|
|
224
|
+
#S;
|
|
225
|
+
#w;
|
|
226
|
+
#c = !1;
|
|
227
|
+
#h;
|
|
228
|
+
#u;
|
|
229
|
+
#f = !1;
|
|
230
|
+
constructor(t, e, s = {}) {
|
|
231
|
+
this.type = t, t && (this.#s = !0), this.#o = e, this.#t = this.#o ? this.#o.#t : this, this.#h = this.#t === this ? s : this.#t.#h, this.#w = this.#t === this ? [] : this.#t.#w, t === "!" && !this.#t.#c && this.#w.push(this), this.#S = this.#o ? this.#o.#r.length : 0;
|
|
232
|
+
}
|
|
233
|
+
get hasMagic() {
|
|
234
|
+
if (this.#s !== void 0) return this.#s;
|
|
235
|
+
for (let t of this.#r) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#s = !0;
|
|
236
|
+
return this.#s;
|
|
237
|
+
}
|
|
238
|
+
toString() {
|
|
239
|
+
return this.#u !== void 0 ? this.#u : this.type ? this.#u = this.type + "(" + this.#r.map((t) => String(t)).join("|") + ")" : this.#u = this.#r.map((t) => String(t)).join("");
|
|
240
|
+
}
|
|
241
|
+
#a() {
|
|
242
|
+
if (this !== this.#t) throw new Error("should only call on root");
|
|
243
|
+
if (this.#c) return this;
|
|
244
|
+
this.toString(), this.#c = !0;
|
|
245
|
+
let t;
|
|
246
|
+
for (; t = this.#w.pop();) {
|
|
247
|
+
if (t.type !== "!") continue;
|
|
248
|
+
let e = t, s = e.#o;
|
|
249
|
+
for (; s;) {
|
|
250
|
+
for (let i = e.#S + 1; !s.type && i < s.#r.length; i++) for (let r of t.#r) {
|
|
251
|
+
if (typeof r == "string") throw new Error("string part in extglob AST??");
|
|
252
|
+
r.copyIn(s.#r[i]);
|
|
253
|
+
}
|
|
254
|
+
e = s, s = e.#o;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
push(...t) {
|
|
260
|
+
for (let e of t) if (e !== "") {
|
|
261
|
+
if (typeof e != "string" && !(e instanceof n && e.#o === this)) throw new Error("invalid part: " + e);
|
|
262
|
+
this.#r.push(e);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
toJSON() {
|
|
266
|
+
let t = this.type === null ? this.#r.slice().map((e) => typeof e == "string" ? e : e.toJSON()) : [this.type, ...this.#r.map((e) => e.toJSON())];
|
|
267
|
+
return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#t || this.#t.#c && this.#o?.type === "!") && t.push({}), t;
|
|
268
|
+
}
|
|
269
|
+
isStart() {
|
|
270
|
+
if (this.#t === this) return !0;
|
|
271
|
+
if (!this.#o?.isStart()) return !1;
|
|
272
|
+
if (this.#S === 0) return !0;
|
|
273
|
+
let t = this.#o;
|
|
274
|
+
for (let e = 0; e < this.#S; e++) {
|
|
275
|
+
let s = t.#r[e];
|
|
276
|
+
if (!(s instanceof n && s.type === "!")) return !1;
|
|
277
|
+
}
|
|
278
|
+
return !0;
|
|
279
|
+
}
|
|
280
|
+
isEnd() {
|
|
281
|
+
if (this.#t === this || this.#o?.type === "!") return !0;
|
|
282
|
+
if (!this.#o?.isEnd()) return !1;
|
|
283
|
+
if (!this.type) return this.#o?.isEnd();
|
|
284
|
+
let t = this.#o ? this.#o.#r.length : 0;
|
|
285
|
+
return this.#S === t - 1;
|
|
286
|
+
}
|
|
287
|
+
copyIn(t) {
|
|
288
|
+
typeof t == "string" ? this.push(t) : this.push(t.clone(this));
|
|
289
|
+
}
|
|
290
|
+
clone(t) {
|
|
291
|
+
let e = new n(this.type, t);
|
|
292
|
+
for (let s of this.#r) e.copyIn(s);
|
|
293
|
+
return e;
|
|
294
|
+
}
|
|
295
|
+
static #i(t, e, s, i) {
|
|
296
|
+
let r = !1, o = !1, h = -1, a = !1;
|
|
297
|
+
if (e.type === null) {
|
|
298
|
+
let f = s, m = "";
|
|
299
|
+
for (; f < t.length;) {
|
|
300
|
+
let p = t.charAt(f++);
|
|
301
|
+
if (r || p === "\\") {
|
|
302
|
+
r = !r, m += p;
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
if (o) {
|
|
306
|
+
f === h + 1 ? (p === "^" || p === "!") && (a = !0) : p === "]" && !(f === h + 2 && a) && (o = !1), m += p;
|
|
307
|
+
continue;
|
|
308
|
+
} else if (p === "[") {
|
|
309
|
+
o = !0, h = f, a = !1, m += p;
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
if (!i.noext && be(p) && t.charAt(f) === "(") {
|
|
313
|
+
e.push(m), m = "";
|
|
314
|
+
let w = new n(p, e);
|
|
315
|
+
f = n.#i(t, w, f, i), e.push(w);
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
m += p;
|
|
319
|
+
}
|
|
320
|
+
return e.push(m), f;
|
|
321
|
+
}
|
|
322
|
+
let l = s + 1, u = new n(null, e), c = [], d = "";
|
|
323
|
+
for (; l < t.length;) {
|
|
324
|
+
let f = t.charAt(l++);
|
|
325
|
+
if (r || f === "\\") {
|
|
326
|
+
r = !r, d += f;
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
if (o) {
|
|
330
|
+
l === h + 1 ? (f === "^" || f === "!") && (a = !0) : f === "]" && !(l === h + 2 && a) && (o = !1), d += f;
|
|
331
|
+
continue;
|
|
332
|
+
} else if (f === "[") {
|
|
333
|
+
o = !0, h = l, a = !1, d += f;
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (be(f) && t.charAt(l) === "(") {
|
|
337
|
+
u.push(d), d = "";
|
|
338
|
+
let m = new n(f, u);
|
|
339
|
+
u.push(m), l = n.#i(t, m, l, i);
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
if (f === "|") {
|
|
343
|
+
u.push(d), d = "", c.push(u), u = new n(null, e);
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
if (f === ")") return d === "" && e.#r.length === 0 && (e.#f = !0), u.push(d), d = "", e.push(...c, u), l;
|
|
347
|
+
d += f;
|
|
348
|
+
}
|
|
349
|
+
return e.type = null, e.#s = void 0, e.#r = [t.substring(s - 1)], l;
|
|
350
|
+
}
|
|
351
|
+
static fromGlob(t, e = {}) {
|
|
352
|
+
let s = new n(null, void 0, e);
|
|
353
|
+
return n.#i(t, s, 0, e), s;
|
|
354
|
+
}
|
|
355
|
+
toMMPattern() {
|
|
356
|
+
if (this !== this.#t) return this.#t.toMMPattern();
|
|
357
|
+
let t = this.toString(), [e, s, i, r] = this.toRegExpSource();
|
|
358
|
+
if (!(i || this.#s || this.#h.nocase && !this.#h.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return s;
|
|
359
|
+
let h = (this.#h.nocase ? "i" : "") + (r ? "u" : "");
|
|
360
|
+
return Object.assign(new RegExp(`^${e}$`, h), {
|
|
361
|
+
_src: e,
|
|
362
|
+
_glob: t
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
get options() {
|
|
366
|
+
return this.#h;
|
|
367
|
+
}
|
|
368
|
+
toRegExpSource(t) {
|
|
369
|
+
let e = t ?? !!this.#h.dot;
|
|
370
|
+
if (this.#t === this && this.#a(), !this.type) {
|
|
371
|
+
let a = this.isStart() && this.isEnd() && !this.#r.some((f) => typeof f != "string"), l = this.#r.map((f) => {
|
|
372
|
+
let [m, p, w, g] = typeof f == "string" ? n.#E(f, this.#s, a) : f.toRegExpSource(t);
|
|
373
|
+
return this.#s = this.#s || w, this.#n = this.#n || g, m;
|
|
374
|
+
}).join(""), u = "";
|
|
375
|
+
if (this.isStart() && typeof this.#r[0] == "string" && !(this.#r.length === 1 && Ts.has(this.#r[0]))) {
|
|
376
|
+
let m = Cs, p = e && m.has(l.charAt(0)) || l.startsWith("\\.") && m.has(l.charAt(2)) || l.startsWith("\\.\\.") && m.has(l.charAt(4)), w = !e && !t && m.has(l.charAt(0));
|
|
377
|
+
u = p ? vs : w ? Ct : "";
|
|
378
|
+
}
|
|
379
|
+
let c = "";
|
|
380
|
+
return this.isEnd() && this.#t.#c && this.#o?.type === "!" && (c = "(?:$|\\/)"), [
|
|
381
|
+
u + l + c,
|
|
382
|
+
W(l),
|
|
383
|
+
this.#s = !!this.#s,
|
|
384
|
+
this.#n
|
|
385
|
+
];
|
|
386
|
+
}
|
|
387
|
+
let s = this.type === "*" || this.type === "+", i = this.type === "!" ? "(?:(?!(?:" : "(?:", r = this.#d(e);
|
|
388
|
+
if (this.isStart() && this.isEnd() && !r && this.type !== "!") {
|
|
389
|
+
let a = this.toString();
|
|
390
|
+
return this.#r = [a], this.type = null, this.#s = void 0, [
|
|
391
|
+
a,
|
|
392
|
+
W(this.toString()),
|
|
393
|
+
!1,
|
|
394
|
+
!1
|
|
395
|
+
];
|
|
396
|
+
}
|
|
397
|
+
let o = !s || t || e || !Ct ? "" : this.#d(!0);
|
|
398
|
+
o === r && (o = ""), o && (r = `(?:${r})(?:${o})*?`);
|
|
399
|
+
let h = "";
|
|
400
|
+
if (this.type === "!" && this.#f) h = (this.isStart() && !e ? Ct : "") + Ee;
|
|
401
|
+
else {
|
|
402
|
+
let a = this.type === "!" ? "))" + (this.isStart() && !e && !t ? Ct : "") + Se + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && o ? ")" : this.type === "*" && o ? ")?" : `)${this.type}`;
|
|
403
|
+
h = i + r + a;
|
|
404
|
+
}
|
|
405
|
+
return [
|
|
406
|
+
h,
|
|
407
|
+
W(r),
|
|
408
|
+
this.#s = !!this.#s,
|
|
409
|
+
this.#n
|
|
410
|
+
];
|
|
411
|
+
}
|
|
412
|
+
#d(t) {
|
|
413
|
+
return this.#r.map((e) => {
|
|
414
|
+
if (typeof e == "string") throw new Error("string type in extglob ast??");
|
|
415
|
+
let [s, i, r, o] = e.toRegExpSource(t);
|
|
416
|
+
return this.#n = this.#n || o, s;
|
|
417
|
+
}).filter((e) => !(this.isStart() && this.isEnd()) || !!e).join("|");
|
|
418
|
+
}
|
|
419
|
+
static #E(t, e, s = !1) {
|
|
420
|
+
let i = !1, r = "", o = !1, h = !1;
|
|
421
|
+
for (let a = 0; a < t.length; a++) {
|
|
422
|
+
let l = t.charAt(a);
|
|
423
|
+
if (i) {
|
|
424
|
+
i = !1, r += (As.has(l) ? "\\" : "") + l;
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
if (l === "*") {
|
|
428
|
+
if (h) continue;
|
|
429
|
+
h = !0, r += s && /^[*]+$/.test(t) ? Ee : Se, e = !0;
|
|
430
|
+
continue;
|
|
431
|
+
} else h = !1;
|
|
432
|
+
if (l === "\\") {
|
|
433
|
+
a === t.length - 1 ? r += "\\\\" : i = !0;
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
if (l === "[") {
|
|
437
|
+
let [u, c, d, f] = ye(t, a);
|
|
438
|
+
if (d) {
|
|
439
|
+
r += u, o = o || c, a += d - 1, e = e || f;
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (l === "?") {
|
|
444
|
+
r += Kt, e = !0;
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
r += ks(l);
|
|
448
|
+
}
|
|
449
|
+
return [
|
|
450
|
+
r,
|
|
451
|
+
W(t),
|
|
452
|
+
!!e,
|
|
453
|
+
o
|
|
454
|
+
];
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
var tt = (n, { windowsPathsNoEscape: t = !1, magicalBraces: e = !1 } = {}) => e ? t ? n.replace(/[?*()[\]{}]/g, "[$&]") : n.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n.replace(/[?*()[\]]/g, "[$&]") : n.replace(/[?*()[\]\\]/g, "\\$&");
|
|
458
|
+
var O = (n, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new D(t, e).match(n)), Rs = /^\*+([^+@!?\*\[\(]*)$/, Os = (n) => (t) => !t.startsWith(".") && t.endsWith(n), Fs = (n) => (t) => t.endsWith(n), Ds = (n) => (n = n.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(n)), Ms = (n) => (n = n.toLowerCase(), (t) => t.toLowerCase().endsWith(n)), Ns = /^\*+\.\*+$/, _s = (n) => !n.startsWith(".") && n.includes("."), Ls = (n) => n !== "." && n !== ".." && n.includes("."), Ws = /^\.\*+$/, Ps = (n) => n !== "." && n !== ".." && n.startsWith("."), js = /^\*+$/, Is = (n) => n.length !== 0 && !n.startsWith("."), zs = (n) => n.length !== 0 && n !== "." && n !== "..", Bs = /^\?+([^+@!?\*\[\(]*)?$/, Us = ([n, t = ""]) => {
|
|
459
|
+
let e = Ce([n]);
|
|
460
|
+
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
461
|
+
}, $s = ([n, t = ""]) => {
|
|
462
|
+
let e = Te([n]);
|
|
463
|
+
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
464
|
+
}, Gs = ([n, t = ""]) => {
|
|
465
|
+
let e = Te([n]);
|
|
466
|
+
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
467
|
+
}, Hs = ([n, t = ""]) => {
|
|
468
|
+
let e = Ce([n]);
|
|
469
|
+
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
470
|
+
}, Ce = ([n]) => {
|
|
471
|
+
let t = n.length;
|
|
472
|
+
return (e) => e.length === t && !e.startsWith(".");
|
|
473
|
+
}, Te = ([n]) => {
|
|
474
|
+
let t = n.length;
|
|
475
|
+
return (e) => e.length === t && e !== "." && e !== "..";
|
|
476
|
+
}, Ae = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", xe = {
|
|
477
|
+
win32: { sep: "\\" },
|
|
478
|
+
posix: { sep: "/" }
|
|
479
|
+
};
|
|
480
|
+
O.sep = Ae === "win32" ? xe.win32.sep : xe.posix.sep;
|
|
481
|
+
var A = Symbol("globstar **");
|
|
482
|
+
O.GLOBSTAR = A;
|
|
483
|
+
var Vs = "[^/]*?", Ys = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", Xs = "(?:(?!(?:\\/|^)\\.).)*?", Js = (n, t = {}) => (e) => O(e, n, t);
|
|
484
|
+
O.filter = Js;
|
|
485
|
+
var N = (n, t = {}) => Object.assign({}, n, t), Zs = (n) => {
|
|
486
|
+
if (!n || typeof n != "object" || !Object.keys(n).length) return O;
|
|
487
|
+
let t = O;
|
|
488
|
+
return Object.assign((s, i, r = {}) => t(s, i, N(n, r)), {
|
|
489
|
+
Minimatch: class extends t.Minimatch {
|
|
490
|
+
constructor(i, r = {}) {
|
|
491
|
+
super(i, N(n, r));
|
|
492
|
+
}
|
|
493
|
+
static defaults(i) {
|
|
494
|
+
return t.defaults(N(n, i)).Minimatch;
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
AST: class extends t.AST {
|
|
498
|
+
constructor(i, r, o = {}) {
|
|
499
|
+
super(i, r, N(n, o));
|
|
500
|
+
}
|
|
501
|
+
static fromGlob(i, r = {}) {
|
|
502
|
+
return t.AST.fromGlob(i, N(n, r));
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
unescape: (s, i = {}) => t.unescape(s, N(n, i)),
|
|
506
|
+
escape: (s, i = {}) => t.escape(s, N(n, i)),
|
|
507
|
+
filter: (s, i = {}) => t.filter(s, N(n, i)),
|
|
508
|
+
defaults: (s) => t.defaults(N(n, s)),
|
|
509
|
+
makeRe: (s, i = {}) => t.makeRe(s, N(n, i)),
|
|
510
|
+
braceExpand: (s, i = {}) => t.braceExpand(s, N(n, i)),
|
|
511
|
+
match: (s, i, r = {}) => t.match(s, i, N(n, r)),
|
|
512
|
+
sep: t.sep,
|
|
513
|
+
GLOBSTAR: A
|
|
514
|
+
});
|
|
515
|
+
};
|
|
516
|
+
O.defaults = Zs;
|
|
517
|
+
var ke = (n, t = {}) => (at(n), t.nobrace || !/\{(?:(?!\{).)*\}/.test(n) ? [n] : ge(n, { max: t.braceExpandMax }));
|
|
518
|
+
O.braceExpand = ke;
|
|
519
|
+
var Qs = (n, t = {}) => new D(n, t).makeRe();
|
|
520
|
+
O.makeRe = Qs;
|
|
521
|
+
var ti = (n, t, e = {}) => {
|
|
522
|
+
let s = new D(t, e);
|
|
523
|
+
return n = n.filter((i) => s.match(i)), s.options.nonull && !n.length && n.push(t), n;
|
|
524
|
+
};
|
|
525
|
+
O.match = ti;
|
|
526
|
+
var ve = /[?*]|[+@!]\(.*?\)|\[|\]/, ei = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), D = class {
|
|
527
|
+
options;
|
|
528
|
+
set;
|
|
529
|
+
pattern;
|
|
530
|
+
windowsPathsNoEscape;
|
|
531
|
+
nonegate;
|
|
532
|
+
negate;
|
|
533
|
+
comment;
|
|
534
|
+
empty;
|
|
535
|
+
preserveMultipleSlashes;
|
|
536
|
+
partial;
|
|
537
|
+
globSet;
|
|
538
|
+
globParts;
|
|
539
|
+
nocase;
|
|
540
|
+
isWindows;
|
|
541
|
+
platform;
|
|
542
|
+
windowsNoMagicRoot;
|
|
543
|
+
regexp;
|
|
544
|
+
constructor(t, e = {}) {
|
|
545
|
+
at(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Ae, this.isWindows = this.platform === "win32";
|
|
546
|
+
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e["allowWindowsEscape"] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
|
|
547
|
+
}
|
|
548
|
+
hasMagic() {
|
|
549
|
+
if (this.options.magicalBraces && this.set.length > 1) return !0;
|
|
550
|
+
for (let t of this.set) for (let e of t) if (typeof e != "string") return !0;
|
|
551
|
+
return !1;
|
|
552
|
+
}
|
|
553
|
+
debug(...t) {}
|
|
554
|
+
make() {
|
|
555
|
+
let t = this.pattern, e = this.options;
|
|
556
|
+
if (!e.nocomment && t.charAt(0) === "#") {
|
|
557
|
+
this.comment = !0;
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (!t) {
|
|
561
|
+
this.empty = !0;
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = (...r) => console.error(...r)), this.debug(this.pattern, this.globSet);
|
|
565
|
+
let s = this.globSet.map((r) => this.slashSplit(r));
|
|
566
|
+
this.globParts = this.preprocess(s), this.debug(this.pattern, this.globParts);
|
|
567
|
+
let i = this.globParts.map((r, o, h) => {
|
|
568
|
+
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
569
|
+
let a = r[0] === "" && r[1] === "" && (r[2] === "?" || !ve.test(r[2])) && !ve.test(r[3]), l = /^[a-z]:/i.test(r[0]);
|
|
570
|
+
if (a) return [...r.slice(0, 4), ...r.slice(4).map((u) => this.parse(u))];
|
|
571
|
+
if (l) return [r[0], ...r.slice(1).map((u) => this.parse(u))];
|
|
572
|
+
}
|
|
573
|
+
return r.map((a) => this.parse(a));
|
|
574
|
+
});
|
|
575
|
+
if (this.debug(this.pattern, i), this.set = i.filter((r) => r.indexOf(!1) === -1), this.isWindows) for (let r = 0; r < this.set.length; r++) {
|
|
576
|
+
let o = this.set[r];
|
|
577
|
+
o[0] === "" && o[1] === "" && this.globParts[r][2] === "?" && typeof o[3] == "string" && /^[a-z]:$/i.test(o[3]) && (o[2] = "?");
|
|
578
|
+
}
|
|
579
|
+
this.debug(this.pattern, this.set);
|
|
580
|
+
}
|
|
581
|
+
preprocess(t) {
|
|
582
|
+
if (this.options.noglobstar) for (let s = 0; s < t.length; s++) for (let i = 0; i < t[s].length; i++) t[s][i] === "**" && (t[s][i] = "*");
|
|
583
|
+
let { optimizationLevel: e = 1 } = this.options;
|
|
584
|
+
return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : e >= 1 ? t = this.levelOneOptimize(t) : t = this.adjascentGlobstarOptimize(t), t;
|
|
585
|
+
}
|
|
586
|
+
adjascentGlobstarOptimize(t) {
|
|
587
|
+
return t.map((e) => {
|
|
588
|
+
let s = -1;
|
|
589
|
+
for (; (s = e.indexOf("**", s + 1)) !== -1;) {
|
|
590
|
+
let i = s;
|
|
591
|
+
for (; e[i + 1] === "**";) i++;
|
|
592
|
+
i !== s && e.splice(s, i - s);
|
|
593
|
+
}
|
|
594
|
+
return e;
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
levelOneOptimize(t) {
|
|
598
|
+
return t.map((e) => (e = e.reduce((s, i) => {
|
|
599
|
+
let r = s[s.length - 1];
|
|
600
|
+
return i === "**" && r === "**" ? s : i === ".." && r && r !== ".." && r !== "." && r !== "**" ? (s.pop(), s) : (s.push(i), s);
|
|
601
|
+
}, []), e.length === 0 ? [""] : e));
|
|
602
|
+
}
|
|
603
|
+
levelTwoFileOptimize(t) {
|
|
604
|
+
Array.isArray(t) || (t = this.slashSplit(t));
|
|
605
|
+
let e = !1;
|
|
606
|
+
do {
|
|
607
|
+
if (e = !1, !this.preserveMultipleSlashes) {
|
|
608
|
+
for (let i = 1; i < t.length - 1; i++) {
|
|
609
|
+
let r = t[i];
|
|
610
|
+
i === 1 && r === "" && t[0] === "" || (r === "." || r === "") && (e = !0, t.splice(i, 1), i--);
|
|
611
|
+
}
|
|
612
|
+
t[0] === "." && t.length === 2 && (t[1] === "." || t[1] === "") && (e = !0, t.pop());
|
|
613
|
+
}
|
|
614
|
+
let s = 0;
|
|
615
|
+
for (; (s = t.indexOf("..", s + 1)) !== -1;) {
|
|
616
|
+
let i = t[s - 1];
|
|
617
|
+
i && i !== "." && i !== ".." && i !== "**" && (e = !0, t.splice(s - 1, 2), s -= 2);
|
|
618
|
+
}
|
|
619
|
+
} while (e);
|
|
620
|
+
return t.length === 0 ? [""] : t;
|
|
621
|
+
}
|
|
622
|
+
firstPhasePreProcess(t) {
|
|
623
|
+
let e = !1;
|
|
624
|
+
do {
|
|
625
|
+
e = !1;
|
|
626
|
+
for (let s of t) {
|
|
627
|
+
let i = -1;
|
|
628
|
+
for (; (i = s.indexOf("**", i + 1)) !== -1;) {
|
|
629
|
+
let o = i;
|
|
630
|
+
for (; s[o + 1] === "**";) o++;
|
|
631
|
+
o > i && s.splice(i + 1, o - i);
|
|
632
|
+
let h = s[i + 1], a = s[i + 2], l = s[i + 3];
|
|
633
|
+
if (h !== ".." || !a || a === "." || a === ".." || !l || l === "." || l === "..") continue;
|
|
634
|
+
e = !0, s.splice(i, 1);
|
|
635
|
+
let u = s.slice(0);
|
|
636
|
+
u[i] = "**", t.push(u), i--;
|
|
637
|
+
}
|
|
638
|
+
if (!this.preserveMultipleSlashes) {
|
|
639
|
+
for (let o = 1; o < s.length - 1; o++) {
|
|
640
|
+
let h = s[o];
|
|
641
|
+
o === 1 && h === "" && s[0] === "" || (h === "." || h === "") && (e = !0, s.splice(o, 1), o--);
|
|
642
|
+
}
|
|
643
|
+
s[0] === "." && s.length === 2 && (s[1] === "." || s[1] === "") && (e = !0, s.pop());
|
|
644
|
+
}
|
|
645
|
+
let r = 0;
|
|
646
|
+
for (; (r = s.indexOf("..", r + 1)) !== -1;) {
|
|
647
|
+
let o = s[r - 1];
|
|
648
|
+
if (o && o !== "." && o !== ".." && o !== "**") {
|
|
649
|
+
e = !0;
|
|
650
|
+
let a = r === 1 && s[r + 1] === "**" ? ["."] : [];
|
|
651
|
+
s.splice(r - 1, 2, ...a), s.length === 0 && s.push(""), r -= 2;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
} while (e);
|
|
656
|
+
return t;
|
|
657
|
+
}
|
|
658
|
+
secondPhasePreProcess(t) {
|
|
659
|
+
for (let e = 0; e < t.length - 1; e++) for (let s = e + 1; s < t.length; s++) {
|
|
660
|
+
let i = this.partsMatch(t[e], t[s], !this.preserveMultipleSlashes);
|
|
661
|
+
if (i) {
|
|
662
|
+
t[e] = [], t[s] = i;
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
return t.filter((e) => e.length);
|
|
667
|
+
}
|
|
668
|
+
partsMatch(t, e, s = !1) {
|
|
669
|
+
let i = 0, r = 0, o = [], h = "";
|
|
670
|
+
for (; i < t.length && r < e.length;) if (t[i] === e[r]) o.push(h === "b" ? e[r] : t[i]), i++, r++;
|
|
671
|
+
else if (s && t[i] === "**" && e[r] === t[i + 1]) o.push(t[i]), i++;
|
|
672
|
+
else if (s && e[r] === "**" && t[i] === e[r + 1]) o.push(e[r]), r++;
|
|
673
|
+
else if (t[i] === "*" && e[r] && (this.options.dot || !e[r].startsWith(".")) && e[r] !== "**") {
|
|
674
|
+
if (h === "b") return !1;
|
|
675
|
+
h = "a", o.push(t[i]), i++, r++;
|
|
676
|
+
} else if (e[r] === "*" && t[i] && (this.options.dot || !t[i].startsWith(".")) && t[i] !== "**") {
|
|
677
|
+
if (h === "a") return !1;
|
|
678
|
+
h = "b", o.push(e[r]), i++, r++;
|
|
679
|
+
} else return !1;
|
|
680
|
+
return t.length === e.length && o;
|
|
681
|
+
}
|
|
682
|
+
parseNegate() {
|
|
683
|
+
if (this.nonegate) return;
|
|
684
|
+
let t = this.pattern, e = !1, s = 0;
|
|
685
|
+
for (let i = 0; i < t.length && t.charAt(i) === "!"; i++) e = !e, s++;
|
|
686
|
+
s && (this.pattern = t.slice(s)), this.negate = e;
|
|
687
|
+
}
|
|
688
|
+
matchOne(t, e, s = !1) {
|
|
689
|
+
let i = this.options;
|
|
690
|
+
if (this.isWindows) {
|
|
691
|
+
let p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), w = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), g = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), S = !g && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), E = w ? 3 : p ? 0 : void 0, y = S ? 3 : g ? 0 : void 0;
|
|
692
|
+
if (typeof E == "number" && typeof y == "number") {
|
|
693
|
+
let [b, z] = [t[E], e[y]];
|
|
694
|
+
b.toLowerCase() === z.toLowerCase() && (e[y] = b, y > E ? e = e.slice(y) : E > y && (t = t.slice(E)));
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
let { optimizationLevel: r = 1 } = this.options;
|
|
698
|
+
r >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, {
|
|
699
|
+
file: t,
|
|
700
|
+
pattern: e
|
|
701
|
+
}), this.debug("matchOne", t.length, e.length);
|
|
702
|
+
for (var o = 0, h = 0, a = t.length, l = e.length; o < a && h < l; o++, h++) {
|
|
703
|
+
this.debug("matchOne loop");
|
|
704
|
+
var u = e[h], c = t[o];
|
|
705
|
+
if (this.debug(e, u, c), u === !1) return !1;
|
|
706
|
+
if (u === A) {
|
|
707
|
+
this.debug("GLOBSTAR", [
|
|
708
|
+
e,
|
|
709
|
+
u,
|
|
710
|
+
c
|
|
711
|
+
]);
|
|
712
|
+
var d = o, f = h + 1;
|
|
713
|
+
if (f === l) {
|
|
714
|
+
for (this.debug("** at the end"); o < a; o++) if (t[o] === "." || t[o] === ".." || !i.dot && t[o].charAt(0) === ".") return !1;
|
|
715
|
+
return !0;
|
|
716
|
+
}
|
|
717
|
+
for (; d < a;) {
|
|
718
|
+
var m = t[d];
|
|
719
|
+
if (this.debug(`
|
|
720
|
+
globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) return this.debug("globstar found match!", d, a, m), !0;
|
|
721
|
+
if (m === "." || m === ".." || !i.dot && m.charAt(0) === ".") {
|
|
722
|
+
this.debug("dot detected!", t, d, e, f);
|
|
723
|
+
break;
|
|
724
|
+
}
|
|
725
|
+
this.debug("globstar swallow a segment, and continue"), d++;
|
|
726
|
+
}
|
|
727
|
+
return !!(s && (this.debug(`
|
|
728
|
+
>>> no match, partial?`, t, d, e, f), d === a));
|
|
729
|
+
}
|
|
730
|
+
let p;
|
|
731
|
+
if (typeof u == "string" ? (p = c === u, this.debug("string match", u, c, p)) : (p = u.test(c), this.debug("pattern match", u, c, p)), !p) return !1;
|
|
732
|
+
}
|
|
733
|
+
if (o === a && h === l) return !0;
|
|
734
|
+
if (o === a) return s;
|
|
735
|
+
if (h === l) return o === a - 1 && t[o] === "";
|
|
736
|
+
throw new Error("wtf?");
|
|
737
|
+
}
|
|
738
|
+
braceExpand() {
|
|
739
|
+
return ke(this.pattern, this.options);
|
|
740
|
+
}
|
|
741
|
+
parse(t) {
|
|
742
|
+
at(t);
|
|
743
|
+
let e = this.options;
|
|
744
|
+
if (t === "**") return A;
|
|
745
|
+
if (t === "") return "";
|
|
746
|
+
let s, i = null;
|
|
747
|
+
(s = t.match(js)) ? i = e.dot ? zs : Is : (s = t.match(Rs)) ? i = (e.nocase ? e.dot ? Ms : Ds : e.dot ? Fs : Os)(s[1]) : (s = t.match(Bs)) ? i = (e.nocase ? e.dot ? $s : Us : e.dot ? Gs : Hs)(s) : (s = t.match(Ns)) ? i = e.dot ? Ls : _s : (s = t.match(Ws)) && (i = Ps);
|
|
748
|
+
let r = Q.fromGlob(t, this.options).toMMPattern();
|
|
749
|
+
return i && typeof r == "object" && Reflect.defineProperty(r, "test", { value: i }), r;
|
|
750
|
+
}
|
|
751
|
+
makeRe() {
|
|
752
|
+
if (this.regexp || this.regexp === !1) return this.regexp;
|
|
753
|
+
let t = this.set;
|
|
754
|
+
if (!t.length) return this.regexp = !1, this.regexp;
|
|
755
|
+
let e = this.options, s = e.noglobstar ? Vs : e.dot ? Ys : Xs, i = new Set(e.nocase ? ["i"] : []), r = t.map((a) => {
|
|
756
|
+
let l = a.map((c) => {
|
|
757
|
+
if (c instanceof RegExp) for (let d of c.flags.split("")) i.add(d);
|
|
758
|
+
return typeof c == "string" ? ei(c) : c === A ? A : c._src;
|
|
759
|
+
});
|
|
760
|
+
l.forEach((c, d) => {
|
|
761
|
+
let f = l[d + 1], m = l[d - 1];
|
|
762
|
+
c !== A || m === A || (m === void 0 ? f !== void 0 && f !== A ? l[d + 1] = "(?:\\/|" + s + "\\/)?" + f : l[d] = s : f === void 0 ? l[d - 1] = m + "(?:\\/|\\/" + s + ")?" : f !== A && (l[d - 1] = m + "(?:\\/|\\/" + s + "\\/)" + f, l[d + 1] = A));
|
|
763
|
+
});
|
|
764
|
+
let u = l.filter((c) => c !== A);
|
|
765
|
+
if (this.partial && u.length >= 1) {
|
|
766
|
+
let c = [];
|
|
767
|
+
for (let d = 1; d <= u.length; d++) c.push(u.slice(0, d).join("/"));
|
|
768
|
+
return "(?:" + c.join("|") + ")";
|
|
769
|
+
}
|
|
770
|
+
return u.join("/");
|
|
771
|
+
}).join("|"), [o, h] = t.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
772
|
+
r = "^" + o + r + h + "$", this.partial && (r = "^(?:\\/|" + o + r.slice(1, -1) + h + ")$"), this.negate && (r = "^(?!" + r + ").+$");
|
|
773
|
+
try {
|
|
774
|
+
this.regexp = new RegExp(r, [...i].join(""));
|
|
775
|
+
} catch {
|
|
776
|
+
this.regexp = !1;
|
|
777
|
+
}
|
|
778
|
+
return this.regexp;
|
|
779
|
+
}
|
|
780
|
+
slashSplit(t) {
|
|
781
|
+
return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
|
|
782
|
+
}
|
|
783
|
+
match(t, e = this.partial) {
|
|
784
|
+
if (this.debug("match", t, this.pattern), this.comment) return !1;
|
|
785
|
+
if (this.empty) return t === "";
|
|
786
|
+
if (t === "/" && e) return !0;
|
|
787
|
+
let s = this.options;
|
|
788
|
+
this.isWindows && (t = t.split("\\").join("/"));
|
|
789
|
+
let i = this.slashSplit(t);
|
|
790
|
+
this.debug(this.pattern, "split", i);
|
|
791
|
+
let r = this.set;
|
|
792
|
+
this.debug(this.pattern, "set", r);
|
|
793
|
+
let o = i[i.length - 1];
|
|
794
|
+
if (!o) for (let h = i.length - 2; !o && h >= 0; h--) o = i[h];
|
|
795
|
+
for (let h = 0; h < r.length; h++) {
|
|
796
|
+
let a = r[h], l = i;
|
|
797
|
+
if (s.matchBase && a.length === 1 && (l = [o]), this.matchOne(l, a, e)) return s.flipNegate ? !0 : !this.negate;
|
|
798
|
+
}
|
|
799
|
+
return s.flipNegate ? !1 : this.negate;
|
|
800
|
+
}
|
|
801
|
+
static defaults(t) {
|
|
802
|
+
return O.defaults(t).Minimatch;
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
O.AST = Q;
|
|
806
|
+
O.Minimatch = D;
|
|
807
|
+
O.escape = tt;
|
|
808
|
+
O.unescape = W;
|
|
809
|
+
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, Oe = /* @__PURE__ */ new Set(), Vt = typeof process == "object" && process ? process : {}, Fe = (n, t, e, s) => {
|
|
810
|
+
typeof Vt.emitWarning == "function" ? Vt.emitWarning(n, t, e, s) : console.error(`[${e}] ${t}: ${n}`);
|
|
811
|
+
}, At = globalThis.AbortController, Re = globalThis.AbortSignal;
|
|
812
|
+
if (typeof At > "u") {
|
|
813
|
+
Re = class {
|
|
814
|
+
onabort;
|
|
815
|
+
_onabort = [];
|
|
816
|
+
reason;
|
|
817
|
+
aborted = !1;
|
|
818
|
+
addEventListener(e, s) {
|
|
819
|
+
this._onabort.push(s);
|
|
820
|
+
}
|
|
821
|
+
}, At = class {
|
|
822
|
+
constructor() {
|
|
823
|
+
t();
|
|
824
|
+
}
|
|
825
|
+
signal = new Re();
|
|
826
|
+
abort(e) {
|
|
827
|
+
if (!this.signal.aborted) {
|
|
828
|
+
this.signal.reason = e, this.signal.aborted = !0;
|
|
829
|
+
for (let s of this.signal._onabort) s(e);
|
|
830
|
+
this.signal.onabort?.(e);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
let n = Vt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
835
|
+
n && (n = !1, Fe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
var ii = (n) => !Oe.has(n);
|
|
839
|
+
var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), De = (n) => q(n) ? n <= Math.pow(2, 8) ? Uint8Array : n <= Math.pow(2, 16) ? Uint16Array : n <= Math.pow(2, 32) ? Uint32Array : n <= Number.MAX_SAFE_INTEGER ? Tt : null : null, Tt = class extends Array {
|
|
840
|
+
constructor(n) {
|
|
841
|
+
super(n), this.fill(0);
|
|
842
|
+
}
|
|
843
|
+
}, ri = class ct {
|
|
844
|
+
heap;
|
|
845
|
+
length;
|
|
846
|
+
static #t = !1;
|
|
847
|
+
static create(t) {
|
|
848
|
+
let e = De(t);
|
|
849
|
+
if (!e) return [];
|
|
850
|
+
ct.#t = !0;
|
|
851
|
+
let s = new ct(t, e);
|
|
852
|
+
return ct.#t = !1, s;
|
|
853
|
+
}
|
|
854
|
+
constructor(t, e) {
|
|
855
|
+
if (!ct.#t) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
856
|
+
this.heap = new e(t), this.length = 0;
|
|
857
|
+
}
|
|
858
|
+
push(t) {
|
|
859
|
+
this.heap[this.length++] = t;
|
|
860
|
+
}
|
|
861
|
+
pop() {
|
|
862
|
+
return this.heap[--this.length];
|
|
863
|
+
}
|
|
864
|
+
}, ft = class Me {
|
|
865
|
+
#t;
|
|
866
|
+
#s;
|
|
867
|
+
#n;
|
|
868
|
+
#r;
|
|
869
|
+
#o;
|
|
870
|
+
#S;
|
|
871
|
+
#w;
|
|
872
|
+
#c;
|
|
873
|
+
get perf() {
|
|
874
|
+
return this.#c;
|
|
875
|
+
}
|
|
876
|
+
ttl;
|
|
877
|
+
ttlResolution;
|
|
878
|
+
ttlAutopurge;
|
|
879
|
+
updateAgeOnGet;
|
|
880
|
+
updateAgeOnHas;
|
|
881
|
+
allowStale;
|
|
882
|
+
noDisposeOnSet;
|
|
883
|
+
noUpdateTTL;
|
|
884
|
+
maxEntrySize;
|
|
885
|
+
sizeCalculation;
|
|
886
|
+
noDeleteOnFetchRejection;
|
|
887
|
+
noDeleteOnStaleGet;
|
|
888
|
+
allowStaleOnFetchAbort;
|
|
889
|
+
allowStaleOnFetchRejection;
|
|
890
|
+
ignoreFetchAbort;
|
|
891
|
+
#h;
|
|
892
|
+
#u;
|
|
893
|
+
#f;
|
|
894
|
+
#a;
|
|
895
|
+
#i;
|
|
896
|
+
#d;
|
|
897
|
+
#E;
|
|
898
|
+
#b;
|
|
899
|
+
#p;
|
|
900
|
+
#R;
|
|
901
|
+
#m;
|
|
902
|
+
#C;
|
|
903
|
+
#T;
|
|
904
|
+
#g;
|
|
905
|
+
#y;
|
|
906
|
+
#x;
|
|
907
|
+
#A;
|
|
908
|
+
#e;
|
|
909
|
+
#_;
|
|
910
|
+
static unsafeExposeInternals(t) {
|
|
911
|
+
return {
|
|
912
|
+
starts: t.#T,
|
|
913
|
+
ttls: t.#g,
|
|
914
|
+
autopurgeTimers: t.#y,
|
|
915
|
+
sizes: t.#C,
|
|
916
|
+
keyMap: t.#f,
|
|
917
|
+
keyList: t.#a,
|
|
918
|
+
valList: t.#i,
|
|
919
|
+
next: t.#d,
|
|
920
|
+
prev: t.#E,
|
|
921
|
+
get head() {
|
|
922
|
+
return t.#b;
|
|
923
|
+
},
|
|
924
|
+
get tail() {
|
|
925
|
+
return t.#p;
|
|
926
|
+
},
|
|
927
|
+
free: t.#R,
|
|
928
|
+
isBackgroundFetch: (e) => t.#l(e),
|
|
929
|
+
backgroundFetch: (e, s, i, r) => t.#U(e, s, i, r),
|
|
930
|
+
moveToTail: (e) => t.#W(e),
|
|
931
|
+
indexes: (e) => t.#F(e),
|
|
932
|
+
rindexes: (e) => t.#D(e),
|
|
933
|
+
isStale: (e) => t.#v(e)
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
get max() {
|
|
937
|
+
return this.#t;
|
|
938
|
+
}
|
|
939
|
+
get maxSize() {
|
|
940
|
+
return this.#s;
|
|
941
|
+
}
|
|
942
|
+
get calculatedSize() {
|
|
943
|
+
return this.#u;
|
|
944
|
+
}
|
|
945
|
+
get size() {
|
|
946
|
+
return this.#h;
|
|
947
|
+
}
|
|
948
|
+
get fetchMethod() {
|
|
949
|
+
return this.#S;
|
|
950
|
+
}
|
|
951
|
+
get memoMethod() {
|
|
952
|
+
return this.#w;
|
|
953
|
+
}
|
|
954
|
+
get dispose() {
|
|
955
|
+
return this.#n;
|
|
956
|
+
}
|
|
957
|
+
get onInsert() {
|
|
958
|
+
return this.#r;
|
|
959
|
+
}
|
|
960
|
+
get disposeAfter() {
|
|
961
|
+
return this.#o;
|
|
962
|
+
}
|
|
963
|
+
constructor(t) {
|
|
964
|
+
let { max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: r, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: a, dispose: l, onInsert: u, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: f, maxSize: m = 0, maxEntrySize: p = 0, sizeCalculation: w, fetchMethod: g, memoMethod: S, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: y, allowStaleOnFetchRejection: b, allowStaleOnFetchAbort: z, ignoreFetchAbort: $, perf: J } = t;
|
|
965
|
+
if (J !== void 0 && typeof J?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
966
|
+
if (this.#c = J ?? si, e !== 0 && !q(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
967
|
+
let Z = e ? De(e) : Array;
|
|
968
|
+
if (!Z) throw new Error("invalid max value: " + e);
|
|
969
|
+
if (this.#t = e, this.#s = m, this.maxEntrySize = p || this.#s, this.sizeCalculation = w, this.sizeCalculation) {
|
|
970
|
+
if (!this.#s && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
971
|
+
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
972
|
+
}
|
|
973
|
+
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
974
|
+
if (this.#w = S, g !== void 0 && typeof g != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
975
|
+
if (this.#S = g, this.#A = !!g, this.#f = /* @__PURE__ */ new Map(), this.#a = new Array(e).fill(void 0), this.#i = new Array(e).fill(void 0), this.#d = new Z(e), this.#E = new Z(e), this.#b = 0, this.#p = 0, this.#R = ri.create(e), this.#h = 0, this.#u = 0, typeof l == "function" && (this.#n = l), typeof u == "function" && (this.#r = u), typeof c == "function" ? (this.#o = c, this.#m = []) : (this.#o = void 0, this.#m = void 0), this.#x = !!this.#n, this.#_ = !!this.#r, this.#e = !!this.#o, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!f, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!b, this.allowStaleOnFetchAbort = !!z, this.ignoreFetchAbort = !!$, this.maxEntrySize !== 0) {
|
|
976
|
+
if (this.#s !== 0 && !q(this.#s)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
977
|
+
if (!q(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
978
|
+
this.#G();
|
|
979
|
+
}
|
|
980
|
+
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!y, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = q(i) || i === 0 ? i : 1, this.ttlAutopurge = !!r, this.ttl = s || 0, this.ttl) {
|
|
981
|
+
if (!q(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
982
|
+
this.#M();
|
|
983
|
+
}
|
|
984
|
+
if (this.#t === 0 && this.ttl === 0 && this.#s === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
985
|
+
if (!this.ttlAutopurge && !this.#t && !this.#s) {
|
|
986
|
+
let $t = "LRU_CACHE_UNBOUNDED";
|
|
987
|
+
ii($t) && (Oe.add($t), Fe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", $t, Me));
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
getRemainingTTL(t) {
|
|
991
|
+
return this.#f.has(t) ? Infinity : 0;
|
|
992
|
+
}
|
|
993
|
+
#M() {
|
|
994
|
+
let t = new Tt(this.#t), e = new Tt(this.#t);
|
|
995
|
+
this.#g = t, this.#T = e;
|
|
996
|
+
let s = this.ttlAutopurge ? new Array(this.#t) : void 0;
|
|
997
|
+
this.#y = s, this.#j = (o, h, a = this.#c.now()) => {
|
|
998
|
+
if (e[o] = h !== 0 ? a : 0, t[o] = h, s?.[o] && (clearTimeout(s[o]), s[o] = void 0), h !== 0 && s) {
|
|
999
|
+
let l = setTimeout(() => {
|
|
1000
|
+
this.#v(o) && this.#O(this.#a[o], "expire");
|
|
1001
|
+
}, h + 1);
|
|
1002
|
+
l.unref && l.unref(), s[o] = l;
|
|
1003
|
+
}
|
|
1004
|
+
}, this.#k = (o) => {
|
|
1005
|
+
e[o] = t[o] !== 0 ? this.#c.now() : 0;
|
|
1006
|
+
}, this.#N = (o, h) => {
|
|
1007
|
+
if (t[h]) {
|
|
1008
|
+
let a = t[h], l = e[h];
|
|
1009
|
+
if (!a || !l) return;
|
|
1010
|
+
o.ttl = a, o.start = l, o.now = i || r();
|
|
1011
|
+
o.remainingTTL = a - (o.now - l);
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
let i = 0, r = () => {
|
|
1015
|
+
let o = this.#c.now();
|
|
1016
|
+
if (this.ttlResolution > 0) {
|
|
1017
|
+
i = o;
|
|
1018
|
+
let h = setTimeout(() => i = 0, this.ttlResolution);
|
|
1019
|
+
h.unref && h.unref();
|
|
1020
|
+
}
|
|
1021
|
+
return o;
|
|
1022
|
+
};
|
|
1023
|
+
this.getRemainingTTL = (o) => {
|
|
1024
|
+
let h = this.#f.get(o);
|
|
1025
|
+
if (h === void 0) return 0;
|
|
1026
|
+
let a = t[h], l = e[h];
|
|
1027
|
+
if (!a || !l) return Infinity;
|
|
1028
|
+
return a - ((i || r()) - l);
|
|
1029
|
+
}, this.#v = (o) => {
|
|
1030
|
+
let h = e[o], a = t[o];
|
|
1031
|
+
return !!a && !!h && (i || r()) - h > a;
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
#k = () => {};
|
|
1035
|
+
#N = () => {};
|
|
1036
|
+
#j = () => {};
|
|
1037
|
+
#v = () => !1;
|
|
1038
|
+
#G() {
|
|
1039
|
+
let t = new Tt(this.#t);
|
|
1040
|
+
this.#u = 0, this.#C = t, this.#P = (e) => {
|
|
1041
|
+
this.#u -= t[e], t[e] = 0;
|
|
1042
|
+
}, this.#I = (e, s, i, r) => {
|
|
1043
|
+
if (this.#l(s)) return 0;
|
|
1044
|
+
if (!q(i)) if (r) {
|
|
1045
|
+
if (typeof r != "function") throw new TypeError("sizeCalculation must be a function");
|
|
1046
|
+
if (i = r(s, e), !q(i)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1047
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
1048
|
+
return i;
|
|
1049
|
+
}, this.#L = (e, s, i) => {
|
|
1050
|
+
if (t[e] = s, this.#s) {
|
|
1051
|
+
let r = this.#s - t[e];
|
|
1052
|
+
for (; this.#u > r;) this.#B(!0);
|
|
1053
|
+
}
|
|
1054
|
+
this.#u += t[e], i && (i.entrySize = s, i.totalCalculatedSize = this.#u);
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
#P = (t) => {};
|
|
1058
|
+
#L = (t, e, s) => {};
|
|
1059
|
+
#I = (t, e, s, i) => {
|
|
1060
|
+
if (s || i) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
1061
|
+
return 0;
|
|
1062
|
+
};
|
|
1063
|
+
*#F({ allowStale: t = this.allowStale } = {}) {
|
|
1064
|
+
if (this.#h) for (let e = this.#p; !(!this.#z(e) || ((t || !this.#v(e)) && (yield e), e === this.#b));) e = this.#E[e];
|
|
1065
|
+
}
|
|
1066
|
+
*#D({ allowStale: t = this.allowStale } = {}) {
|
|
1067
|
+
if (this.#h) for (let e = this.#b; !(!this.#z(e) || ((t || !this.#v(e)) && (yield e), e === this.#p));) e = this.#d[e];
|
|
1068
|
+
}
|
|
1069
|
+
#z(t) {
|
|
1070
|
+
return t !== void 0 && this.#f.get(this.#a[t]) === t;
|
|
1071
|
+
}
|
|
1072
|
+
*entries() {
|
|
1073
|
+
for (let t of this.#F()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]);
|
|
1074
|
+
}
|
|
1075
|
+
*rentries() {
|
|
1076
|
+
for (let t of this.#D()) this.#i[t] !== void 0 && this.#a[t] !== void 0 && !this.#l(this.#i[t]) && (yield [this.#a[t], this.#i[t]]);
|
|
1077
|
+
}
|
|
1078
|
+
*keys() {
|
|
1079
|
+
for (let t of this.#F()) {
|
|
1080
|
+
let e = this.#a[t];
|
|
1081
|
+
e !== void 0 && !this.#l(this.#i[t]) && (yield e);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
*rkeys() {
|
|
1085
|
+
for (let t of this.#D()) {
|
|
1086
|
+
let e = this.#a[t];
|
|
1087
|
+
e !== void 0 && !this.#l(this.#i[t]) && (yield e);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
*values() {
|
|
1091
|
+
for (let t of this.#F()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]);
|
|
1092
|
+
}
|
|
1093
|
+
*rvalues() {
|
|
1094
|
+
for (let t of this.#D()) this.#i[t] !== void 0 && !this.#l(this.#i[t]) && (yield this.#i[t]);
|
|
1095
|
+
}
|
|
1096
|
+
[Symbol.iterator]() {
|
|
1097
|
+
return this.entries();
|
|
1098
|
+
}
|
|
1099
|
+
[Symbol.toStringTag] = "LRUCache";
|
|
1100
|
+
find(t, e = {}) {
|
|
1101
|
+
for (let s of this.#F()) {
|
|
1102
|
+
let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
1103
|
+
if (r !== void 0 && t(r, this.#a[s], this)) return this.get(this.#a[s], e);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
forEach(t, e = this) {
|
|
1107
|
+
for (let s of this.#F()) {
|
|
1108
|
+
let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
1109
|
+
r !== void 0 && t.call(e, r, this.#a[s], this);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
rforEach(t, e = this) {
|
|
1113
|
+
for (let s of this.#D()) {
|
|
1114
|
+
let i = this.#i[s], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
1115
|
+
r !== void 0 && t.call(e, r, this.#a[s], this);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
purgeStale() {
|
|
1119
|
+
let t = !1;
|
|
1120
|
+
for (let e of this.#D({ allowStale: !0 })) this.#v(e) && (this.#O(this.#a[e], "expire"), t = !0);
|
|
1121
|
+
return t;
|
|
1122
|
+
}
|
|
1123
|
+
info(t) {
|
|
1124
|
+
let e = this.#f.get(t);
|
|
1125
|
+
if (e === void 0) return;
|
|
1126
|
+
let s = this.#i[e], i = this.#l(s) ? s.__staleWhileFetching : s;
|
|
1127
|
+
if (i === void 0) return;
|
|
1128
|
+
let r = { value: i };
|
|
1129
|
+
if (this.#g && this.#T) {
|
|
1130
|
+
let o = this.#g[e], h = this.#T[e];
|
|
1131
|
+
if (o && h) r.ttl = o - (this.#c.now() - h), r.start = Date.now();
|
|
1132
|
+
}
|
|
1133
|
+
return this.#C && (r.size = this.#C[e]), r;
|
|
1134
|
+
}
|
|
1135
|
+
dump() {
|
|
1136
|
+
let t = [];
|
|
1137
|
+
for (let e of this.#F({ allowStale: !0 })) {
|
|
1138
|
+
let s = this.#a[e], i = this.#i[e], r = this.#l(i) ? i.__staleWhileFetching : i;
|
|
1139
|
+
if (r === void 0 || s === void 0) continue;
|
|
1140
|
+
let o = { value: r };
|
|
1141
|
+
if (this.#g && this.#T) {
|
|
1142
|
+
o.ttl = this.#g[e];
|
|
1143
|
+
let h = this.#c.now() - this.#T[e];
|
|
1144
|
+
o.start = Math.floor(Date.now() - h);
|
|
1145
|
+
}
|
|
1146
|
+
this.#C && (o.size = this.#C[e]), t.unshift([s, o]);
|
|
1147
|
+
}
|
|
1148
|
+
return t;
|
|
1149
|
+
}
|
|
1150
|
+
load(t) {
|
|
1151
|
+
this.clear();
|
|
1152
|
+
for (let [e, s] of t) {
|
|
1153
|
+
if (s.start) {
|
|
1154
|
+
let i = Date.now() - s.start;
|
|
1155
|
+
s.start = this.#c.now() - i;
|
|
1156
|
+
}
|
|
1157
|
+
this.set(e, s.value, s);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
set(t, e, s = {}) {
|
|
1161
|
+
if (e === void 0) return this.delete(t), this;
|
|
1162
|
+
let { ttl: i = this.ttl, start: r, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: a } = s, { noUpdateTTL: l = this.noUpdateTTL } = s, u = this.#I(t, e, s.size || 0, h);
|
|
1163
|
+
if (this.maxEntrySize && u > this.maxEntrySize) return a && (a.set = "miss", a.maxEntrySizeExceeded = !0), this.#O(t, "set"), this;
|
|
1164
|
+
let c = this.#h === 0 ? void 0 : this.#f.get(t);
|
|
1165
|
+
if (c === void 0) c = this.#h === 0 ? this.#p : this.#R.length !== 0 ? this.#R.pop() : this.#h === this.#t ? this.#B(!1) : this.#h, this.#a[c] = t, this.#i[c] = e, this.#f.set(t, c), this.#d[this.#p] = c, this.#E[c] = this.#p, this.#p = c, this.#h++, this.#L(c, u, a), a && (a.set = "add"), l = !1, this.#_ && this.#r?.(e, t, "add");
|
|
1166
|
+
else {
|
|
1167
|
+
this.#W(c);
|
|
1168
|
+
let d = this.#i[c];
|
|
1169
|
+
if (e !== d) {
|
|
1170
|
+
if (this.#A && this.#l(d)) {
|
|
1171
|
+
d.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
|
|
1172
|
+
let { __staleWhileFetching: f } = d;
|
|
1173
|
+
f !== void 0 && !o && (this.#x && this.#n?.(f, t, "set"), this.#e && this.#m?.push([
|
|
1174
|
+
f,
|
|
1175
|
+
t,
|
|
1176
|
+
"set"
|
|
1177
|
+
]));
|
|
1178
|
+
} else o || (this.#x && this.#n?.(d, t, "set"), this.#e && this.#m?.push([
|
|
1179
|
+
d,
|
|
1180
|
+
t,
|
|
1181
|
+
"set"
|
|
1182
|
+
]));
|
|
1183
|
+
if (this.#P(c), this.#L(c, u, a), this.#i[c] = e, a) {
|
|
1184
|
+
a.set = "replace";
|
|
1185
|
+
let f = d && this.#l(d) ? d.__staleWhileFetching : d;
|
|
1186
|
+
f !== void 0 && (a.oldValue = f);
|
|
1187
|
+
}
|
|
1188
|
+
} else a && (a.set = "update");
|
|
1189
|
+
this.#_ && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
1190
|
+
}
|
|
1191
|
+
if (i !== 0 && !this.#g && this.#M(), this.#g && (l || this.#j(c, i, r), a && this.#N(a, c)), !o && this.#e && this.#m) {
|
|
1192
|
+
let d = this.#m, f;
|
|
1193
|
+
for (; f = d?.shift();) this.#o?.(...f);
|
|
1194
|
+
}
|
|
1195
|
+
return this;
|
|
1196
|
+
}
|
|
1197
|
+
pop() {
|
|
1198
|
+
try {
|
|
1199
|
+
for (; this.#h;) {
|
|
1200
|
+
let t = this.#i[this.#b];
|
|
1201
|
+
if (this.#B(!0), this.#l(t)) {
|
|
1202
|
+
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
1203
|
+
} else if (t !== void 0) return t;
|
|
1204
|
+
}
|
|
1205
|
+
} finally {
|
|
1206
|
+
if (this.#e && this.#m) {
|
|
1207
|
+
let t = this.#m, e;
|
|
1208
|
+
for (; e = t?.shift();) this.#o?.(...e);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
#B(t) {
|
|
1213
|
+
let e = this.#b, s = this.#a[e], i = this.#i[e];
|
|
1214
|
+
return this.#A && this.#l(i) ? i.__abortController.abort(/* @__PURE__ */ new Error("evicted")) : (this.#x || this.#e) && (this.#x && this.#n?.(i, s, "evict"), this.#e && this.#m?.push([
|
|
1215
|
+
i,
|
|
1216
|
+
s,
|
|
1217
|
+
"evict"
|
|
1218
|
+
])), this.#P(e), this.#y?.[e] && (clearTimeout(this.#y[e]), this.#y[e] = void 0), t && (this.#a[e] = void 0, this.#i[e] = void 0, this.#R.push(e)), this.#h === 1 ? (this.#b = this.#p = 0, this.#R.length = 0) : this.#b = this.#d[e], this.#f.delete(s), this.#h--, e;
|
|
1219
|
+
}
|
|
1220
|
+
has(t, e = {}) {
|
|
1221
|
+
let { updateAgeOnHas: s = this.updateAgeOnHas, status: i } = e, r = this.#f.get(t);
|
|
1222
|
+
if (r !== void 0) {
|
|
1223
|
+
let o = this.#i[r];
|
|
1224
|
+
if (this.#l(o) && o.__staleWhileFetching === void 0) return !1;
|
|
1225
|
+
if (this.#v(r)) i && (i.has = "stale", this.#N(i, r));
|
|
1226
|
+
else return s && this.#k(r), i && (i.has = "hit", this.#N(i, r)), !0;
|
|
1227
|
+
} else i && (i.has = "miss");
|
|
1228
|
+
return !1;
|
|
1229
|
+
}
|
|
1230
|
+
peek(t, e = {}) {
|
|
1231
|
+
let { allowStale: s = this.allowStale } = e, i = this.#f.get(t);
|
|
1232
|
+
if (i === void 0 || !s && this.#v(i)) return;
|
|
1233
|
+
let r = this.#i[i];
|
|
1234
|
+
return this.#l(r) ? r.__staleWhileFetching : r;
|
|
1235
|
+
}
|
|
1236
|
+
#U(t, e, s, i) {
|
|
1237
|
+
let r = e === void 0 ? void 0 : this.#i[e];
|
|
1238
|
+
if (this.#l(r)) return r;
|
|
1239
|
+
let o = new At(), { signal: h } = s;
|
|
1240
|
+
h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
|
|
1241
|
+
let a = {
|
|
1242
|
+
signal: o.signal,
|
|
1243
|
+
options: s,
|
|
1244
|
+
context: i
|
|
1245
|
+
}, l = (p, w = !1) => {
|
|
1246
|
+
let { aborted: g } = o.signal, S = s.ignoreFetchAbort && p !== void 0, E = s.ignoreFetchAbort || !!(s.allowStaleOnFetchAbort && p !== void 0);
|
|
1247
|
+
if (s.status && (g && !w ? (s.status.fetchAborted = !0, s.status.fetchError = o.signal.reason, S && (s.status.fetchAbortIgnored = !0)) : s.status.fetchResolved = !0), g && !S && !w) return c(o.signal.reason, E);
|
|
1248
|
+
let y = f, b = this.#i[e];
|
|
1249
|
+
return (b === f || S && w && b === void 0) && (p === void 0 ? y.__staleWhileFetching !== void 0 ? this.#i[e] = y.__staleWhileFetching : this.#O(t, "fetch") : (s.status && (s.status.fetchUpdated = !0), this.set(t, p, a.options))), p;
|
|
1250
|
+
}, u = (p) => (s.status && (s.status.fetchRejected = !0, s.status.fetchError = p), c(p, !1)), c = (p, w) => {
|
|
1251
|
+
let { aborted: g } = o.signal, S = g && s.allowStaleOnFetchAbort, E = S || s.allowStaleOnFetchRejection, y = E || s.noDeleteOnFetchRejection, b = f;
|
|
1252
|
+
if (this.#i[e] === f && (!y || !w && b.__staleWhileFetching === void 0 ? this.#O(t, "fetch") : S || (this.#i[e] = b.__staleWhileFetching)), E) return s.status && b.__staleWhileFetching !== void 0 && (s.status.returnedStale = !0), b.__staleWhileFetching;
|
|
1253
|
+
if (b.__returned === b) throw p;
|
|
1254
|
+
}, d = (p, w) => {
|
|
1255
|
+
let g = this.#S?.(t, r, a);
|
|
1256
|
+
g && g instanceof Promise && g.then((S) => p(S === void 0 ? void 0 : S), w), o.signal.addEventListener("abort", () => {
|
|
1257
|
+
(!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) && (p(void 0), s.allowStaleOnFetchAbort && (p = (S) => l(S, !0)));
|
|
1258
|
+
});
|
|
1259
|
+
};
|
|
1260
|
+
s.status && (s.status.fetchDispatched = !0);
|
|
1261
|
+
let f = new Promise(d).then(l, u), m = Object.assign(f, {
|
|
1262
|
+
__abortController: o,
|
|
1263
|
+
__staleWhileFetching: r,
|
|
1264
|
+
__returned: void 0
|
|
1265
|
+
});
|
|
1266
|
+
return e === void 0 ? (this.set(t, m, {
|
|
1267
|
+
...a.options,
|
|
1268
|
+
status: void 0
|
|
1269
|
+
}), e = this.#f.get(t)) : this.#i[e] = m, m;
|
|
1270
|
+
}
|
|
1271
|
+
#l(t) {
|
|
1272
|
+
if (!this.#A) return !1;
|
|
1273
|
+
let e = t;
|
|
1274
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof At;
|
|
1275
|
+
}
|
|
1276
|
+
async fetch(t, e = {}) {
|
|
1277
|
+
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: a = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: u = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort, context: p, forceRefresh: w = !1, status: g, signal: S } = e;
|
|
1278
|
+
if (!this.#A) return g && (g.fetch = "get"), this.get(t, {
|
|
1279
|
+
allowStale: s,
|
|
1280
|
+
updateAgeOnGet: i,
|
|
1281
|
+
noDeleteOnStaleGet: r,
|
|
1282
|
+
status: g
|
|
1283
|
+
});
|
|
1284
|
+
let E = {
|
|
1285
|
+
allowStale: s,
|
|
1286
|
+
updateAgeOnGet: i,
|
|
1287
|
+
noDeleteOnStaleGet: r,
|
|
1288
|
+
ttl: o,
|
|
1289
|
+
noDisposeOnSet: h,
|
|
1290
|
+
size: a,
|
|
1291
|
+
sizeCalculation: l,
|
|
1292
|
+
noUpdateTTL: u,
|
|
1293
|
+
noDeleteOnFetchRejection: c,
|
|
1294
|
+
allowStaleOnFetchRejection: d,
|
|
1295
|
+
allowStaleOnFetchAbort: m,
|
|
1296
|
+
ignoreFetchAbort: f,
|
|
1297
|
+
status: g,
|
|
1298
|
+
signal: S
|
|
1299
|
+
}, y = this.#f.get(t);
|
|
1300
|
+
if (y === void 0) {
|
|
1301
|
+
g && (g.fetch = "miss");
|
|
1302
|
+
let b = this.#U(t, y, E, p);
|
|
1303
|
+
return b.__returned = b;
|
|
1304
|
+
} else {
|
|
1305
|
+
let b = this.#i[y];
|
|
1306
|
+
if (this.#l(b)) {
|
|
1307
|
+
let Z = s && b.__staleWhileFetching !== void 0;
|
|
1308
|
+
return g && (g.fetch = "inflight", Z && (g.returnedStale = !0)), Z ? b.__staleWhileFetching : b.__returned = b;
|
|
1309
|
+
}
|
|
1310
|
+
let z = this.#v(y);
|
|
1311
|
+
if (!w && !z) return g && (g.fetch = "hit"), this.#W(y), i && this.#k(y), g && this.#N(g, y), b;
|
|
1312
|
+
let $ = this.#U(t, y, E, p), J = $.__staleWhileFetching !== void 0 && s;
|
|
1313
|
+
return g && (g.fetch = z ? "stale" : "refresh", J && z && (g.returnedStale = !0)), J ? $.__staleWhileFetching : $.__returned = $;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
async forceFetch(t, e = {}) {
|
|
1317
|
+
let s = await this.fetch(t, e);
|
|
1318
|
+
if (s === void 0) throw new Error("fetch() returned undefined");
|
|
1319
|
+
return s;
|
|
1320
|
+
}
|
|
1321
|
+
memo(t, e = {}) {
|
|
1322
|
+
let s = this.#w;
|
|
1323
|
+
if (!s) throw new Error("no memoMethod provided to constructor");
|
|
1324
|
+
let { context: i, forceRefresh: r, ...o } = e, h = this.get(t, o);
|
|
1325
|
+
if (!r && h !== void 0) return h;
|
|
1326
|
+
let a = s(t, h, {
|
|
1327
|
+
options: o,
|
|
1328
|
+
context: i
|
|
1329
|
+
});
|
|
1330
|
+
return this.set(t, a, o), a;
|
|
1331
|
+
}
|
|
1332
|
+
get(t, e = {}) {
|
|
1333
|
+
let { allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: r = this.noDeleteOnStaleGet, status: o } = e, h = this.#f.get(t);
|
|
1334
|
+
if (h !== void 0) {
|
|
1335
|
+
let a = this.#i[h], l = this.#l(a);
|
|
1336
|
+
return o && this.#N(o, h), this.#v(h) ? (o && (o.get = "stale"), l ? (o && s && a.__staleWhileFetching !== void 0 && (o.returnedStale = !0), s ? a.__staleWhileFetching : void 0) : (r || this.#O(t, "expire"), o && s && (o.returnedStale = !0), s ? a : void 0)) : (o && (o.get = "hit"), l ? a.__staleWhileFetching : (this.#W(h), i && this.#k(h), a));
|
|
1337
|
+
} else o && (o.get = "miss");
|
|
1338
|
+
}
|
|
1339
|
+
#$(t, e) {
|
|
1340
|
+
this.#E[e] = t, this.#d[t] = e;
|
|
1341
|
+
}
|
|
1342
|
+
#W(t) {
|
|
1343
|
+
t !== this.#p && (t === this.#b ? this.#b = this.#d[t] : this.#$(this.#E[t], this.#d[t]), this.#$(this.#p, t), this.#p = t);
|
|
1344
|
+
}
|
|
1345
|
+
delete(t) {
|
|
1346
|
+
return this.#O(t, "delete");
|
|
1347
|
+
}
|
|
1348
|
+
#O(t, e) {
|
|
1349
|
+
let s = !1;
|
|
1350
|
+
if (this.#h !== 0) {
|
|
1351
|
+
let i = this.#f.get(t);
|
|
1352
|
+
if (i !== void 0) if (this.#y?.[i] && (clearTimeout(this.#y?.[i]), this.#y[i] = void 0), s = !0, this.#h === 1) this.#H(e);
|
|
1353
|
+
else {
|
|
1354
|
+
this.#P(i);
|
|
1355
|
+
let r = this.#i[i];
|
|
1356
|
+
if (this.#l(r) ? r.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#x || this.#e) && (this.#x && this.#n?.(r, t, e), this.#e && this.#m?.push([
|
|
1357
|
+
r,
|
|
1358
|
+
t,
|
|
1359
|
+
e
|
|
1360
|
+
])), this.#f.delete(t), this.#a[i] = void 0, this.#i[i] = void 0, i === this.#p) this.#p = this.#E[i];
|
|
1361
|
+
else if (i === this.#b) this.#b = this.#d[i];
|
|
1362
|
+
else {
|
|
1363
|
+
let o = this.#E[i];
|
|
1364
|
+
this.#d[o] = this.#d[i];
|
|
1365
|
+
let h = this.#d[i];
|
|
1366
|
+
this.#E[h] = this.#E[i];
|
|
1367
|
+
}
|
|
1368
|
+
this.#h--, this.#R.push(i);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
if (this.#e && this.#m?.length) {
|
|
1372
|
+
let i = this.#m, r;
|
|
1373
|
+
for (; r = i?.shift();) this.#o?.(...r);
|
|
1374
|
+
}
|
|
1375
|
+
return s;
|
|
1376
|
+
}
|
|
1377
|
+
clear() {
|
|
1378
|
+
return this.#H("delete");
|
|
1379
|
+
}
|
|
1380
|
+
#H(t) {
|
|
1381
|
+
for (let e of this.#D({ allowStale: !0 })) {
|
|
1382
|
+
let s = this.#i[e];
|
|
1383
|
+
if (this.#l(s)) s.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
|
|
1384
|
+
else {
|
|
1385
|
+
let i = this.#a[e];
|
|
1386
|
+
this.#x && this.#n?.(s, i, t), this.#e && this.#m?.push([
|
|
1387
|
+
s,
|
|
1388
|
+
i,
|
|
1389
|
+
t
|
|
1390
|
+
]);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
if (this.#f.clear(), this.#i.fill(void 0), this.#a.fill(void 0), this.#g && this.#T) {
|
|
1394
|
+
this.#g.fill(0), this.#T.fill(0);
|
|
1395
|
+
for (let e of this.#y ?? []) e !== void 0 && clearTimeout(e);
|
|
1396
|
+
this.#y?.fill(void 0);
|
|
1397
|
+
}
|
|
1398
|
+
if (this.#C && this.#C.fill(0), this.#b = 0, this.#p = 0, this.#R.length = 0, this.#u = 0, this.#h = 0, this.#e && this.#m) {
|
|
1399
|
+
let e = this.#m, s;
|
|
1400
|
+
for (; s = e?.shift();) this.#o?.(...s);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
var Ne = typeof process == "object" && process ? process : {
|
|
1405
|
+
stdout: null,
|
|
1406
|
+
stderr: null
|
|
1407
|
+
}, oi = (n) => !!n && typeof n == "object" && (n instanceof V || n instanceof Pe || hi(n) || ai(n)), hi = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.pipe == "function" && n.pipe !== Pe.Writable.prototype.pipe, ai = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.write == "function" && typeof n.end == "function", G = Symbol("EOF"), H = Symbol("maybeEmitEnd"), K = Symbol("emittedEnd"), kt = Symbol("emittingEnd"), ut = Symbol("emittedError"), Rt = Symbol("closed"), _e = Symbol("read"), Ot = Symbol("flush"), Le = Symbol("flushChunk"), P = Symbol("encoding"), et = Symbol("decoder"), v = Symbol("flowing"), dt = Symbol("paused"), st = Symbol("resume"), C = Symbol("buffer"), F = Symbol("pipes"), T = Symbol("bufferLength"), Yt = Symbol("bufferPush"), Ft = Symbol("bufferShift"), k = Symbol("objectMode"), x = Symbol("destroyed"), Xt = Symbol("error"), Jt = Symbol("emitData"), We = Symbol("emitEnd"), Zt = Symbol("emitEnd2"), B = Symbol("async"), Qt = Symbol("abort"), Dt = Symbol("aborted"), pt = Symbol("signal"), Y = Symbol("dataListeners"), M = Symbol("discarded"), mt = (n) => Promise.resolve().then(n), li = (n) => n(), ci = (n) => n === "end" || n === "finish" || n === "prefinish", fi = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0, ui = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n), Mt = class {
|
|
1408
|
+
src;
|
|
1409
|
+
dest;
|
|
1410
|
+
opts;
|
|
1411
|
+
ondrain;
|
|
1412
|
+
constructor(t, e, s) {
|
|
1413
|
+
this.src = t, this.dest = e, this.opts = s, this.ondrain = () => t[st](), this.dest.on("drain", this.ondrain);
|
|
1414
|
+
}
|
|
1415
|
+
unpipe() {
|
|
1416
|
+
this.dest.removeListener("drain", this.ondrain);
|
|
1417
|
+
}
|
|
1418
|
+
proxyErrors(t) {}
|
|
1419
|
+
end() {
|
|
1420
|
+
this.unpipe(), this.opts.end && this.dest.end();
|
|
1421
|
+
}
|
|
1422
|
+
}, te = class extends Mt {
|
|
1423
|
+
unpipe() {
|
|
1424
|
+
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
1425
|
+
}
|
|
1426
|
+
constructor(t, e, s) {
|
|
1427
|
+
super(t, e, s), this.proxyErrors = (i) => this.dest.emit("error", i), t.on("error", this.proxyErrors);
|
|
1428
|
+
}
|
|
1429
|
+
}, di = (n) => !!n.objectMode, pi = (n) => !n.objectMode && !!n.encoding && n.encoding !== "buffer", V = class extends EventEmitter {
|
|
1430
|
+
[v] = !1;
|
|
1431
|
+
[dt] = !1;
|
|
1432
|
+
[F] = [];
|
|
1433
|
+
[C] = [];
|
|
1434
|
+
[k];
|
|
1435
|
+
[P];
|
|
1436
|
+
[B];
|
|
1437
|
+
[et];
|
|
1438
|
+
[G] = !1;
|
|
1439
|
+
[K] = !1;
|
|
1440
|
+
[kt] = !1;
|
|
1441
|
+
[Rt] = !1;
|
|
1442
|
+
[ut] = null;
|
|
1443
|
+
[T] = 0;
|
|
1444
|
+
[x] = !1;
|
|
1445
|
+
[pt];
|
|
1446
|
+
[Dt] = !1;
|
|
1447
|
+
[Y] = 0;
|
|
1448
|
+
[M] = !1;
|
|
1449
|
+
writable = !0;
|
|
1450
|
+
readable = !0;
|
|
1451
|
+
constructor(...t) {
|
|
1452
|
+
let e = t[0] || {};
|
|
1453
|
+
if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
|
|
1454
|
+
di(e) ? (this[k] = !0, this[P] = null) : pi(e) ? (this[P] = e.encoding, this[k] = !1) : (this[k] = !1, this[P] = null), this[B] = !!e.async, this[et] = this[P] ? new StringDecoder(this[P]) : null, e && e.debugExposeBuffer === !0 && Object.defineProperty(this, "buffer", { get: () => this[C] }), e && e.debugExposePipes === !0 && Object.defineProperty(this, "pipes", { get: () => this[F] });
|
|
1455
|
+
let { signal: s } = e;
|
|
1456
|
+
s && (this[pt] = s, s.aborted ? this[Qt]() : s.addEventListener("abort", () => this[Qt]()));
|
|
1457
|
+
}
|
|
1458
|
+
get bufferLength() {
|
|
1459
|
+
return this[T];
|
|
1460
|
+
}
|
|
1461
|
+
get encoding() {
|
|
1462
|
+
return this[P];
|
|
1463
|
+
}
|
|
1464
|
+
set encoding(t) {
|
|
1465
|
+
throw new Error("Encoding must be set at instantiation time");
|
|
1466
|
+
}
|
|
1467
|
+
setEncoding(t) {
|
|
1468
|
+
throw new Error("Encoding must be set at instantiation time");
|
|
1469
|
+
}
|
|
1470
|
+
get objectMode() {
|
|
1471
|
+
return this[k];
|
|
1472
|
+
}
|
|
1473
|
+
set objectMode(t) {
|
|
1474
|
+
throw new Error("objectMode must be set at instantiation time");
|
|
1475
|
+
}
|
|
1476
|
+
get async() {
|
|
1477
|
+
return this[B];
|
|
1478
|
+
}
|
|
1479
|
+
set async(t) {
|
|
1480
|
+
this[B] = this[B] || !!t;
|
|
1481
|
+
}
|
|
1482
|
+
[Qt]() {
|
|
1483
|
+
this[Dt] = !0, this.emit("abort", this[pt]?.reason), this.destroy(this[pt]?.reason);
|
|
1484
|
+
}
|
|
1485
|
+
get aborted() {
|
|
1486
|
+
return this[Dt];
|
|
1487
|
+
}
|
|
1488
|
+
set aborted(t) {}
|
|
1489
|
+
write(t, e, s) {
|
|
1490
|
+
if (this[Dt]) return !1;
|
|
1491
|
+
if (this[G]) throw new Error("write after end");
|
|
1492
|
+
if (this[x]) return this.emit("error", Object.assign(/* @__PURE__ */ new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), !0;
|
|
1493
|
+
typeof e == "function" && (s = e, e = "utf8"), e || (e = "utf8");
|
|
1494
|
+
let i = this[B] ? mt : li;
|
|
1495
|
+
if (!this[k] && !Buffer.isBuffer(t)) {
|
|
1496
|
+
if (ui(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
1497
|
+
else if (fi(t)) t = Buffer.from(t);
|
|
1498
|
+
else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
1499
|
+
}
|
|
1500
|
+
return this[k] ? (this[v] && this[T] !== 0 && this[Ot](!0), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : t.length ? (typeof t == "string" && !(e === this[P] && !this[et]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[P] && (t = this[et].write(t)), this[v] && this[T] !== 0 && this[Ot](!0), this[v] ? this.emit("data", t) : this[Yt](t), this[T] !== 0 && this.emit("readable"), s && i(s), this[v]) : (this[T] !== 0 && this.emit("readable"), s && i(s), this[v]);
|
|
1501
|
+
}
|
|
1502
|
+
read(t) {
|
|
1503
|
+
if (this[x]) return null;
|
|
1504
|
+
if (this[M] = !1, this[T] === 0 || t === 0 || t && t > this[T]) return this[H](), null;
|
|
1505
|
+
this[k] && (t = null), this[C].length > 1 && !this[k] && (this[C] = [this[P] ? this[C].join("") : Buffer.concat(this[C], this[T])]);
|
|
1506
|
+
let e = this[_e](t || null, this[C][0]);
|
|
1507
|
+
return this[H](), e;
|
|
1508
|
+
}
|
|
1509
|
+
[_e](t, e) {
|
|
1510
|
+
if (this[k]) this[Ft]();
|
|
1511
|
+
else {
|
|
1512
|
+
let s = e;
|
|
1513
|
+
t === s.length || t === null ? this[Ft]() : typeof s == "string" ? (this[C][0] = s.slice(t), e = s.slice(0, t), this[T] -= t) : (this[C][0] = s.subarray(t), e = s.subarray(0, t), this[T] -= t);
|
|
1514
|
+
}
|
|
1515
|
+
return this.emit("data", e), !this[C].length && !this[G] && this.emit("drain"), e;
|
|
1516
|
+
}
|
|
1517
|
+
end(t, e, s) {
|
|
1518
|
+
return typeof t == "function" && (s = t, t = void 0), typeof e == "function" && (s = e, e = "utf8"), t !== void 0 && this.write(t, e), s && this.once("end", s), this[G] = !0, this.writable = !1, (this[v] || !this[dt]) && this[H](), this;
|
|
1519
|
+
}
|
|
1520
|
+
[st]() {
|
|
1521
|
+
this[x] || (!this[Y] && !this[F].length && (this[M] = !0), this[dt] = !1, this[v] = !0, this.emit("resume"), this[C].length ? this[Ot]() : this[G] ? this[H]() : this.emit("drain"));
|
|
1522
|
+
}
|
|
1523
|
+
resume() {
|
|
1524
|
+
return this[st]();
|
|
1525
|
+
}
|
|
1526
|
+
pause() {
|
|
1527
|
+
this[v] = !1, this[dt] = !0, this[M] = !1;
|
|
1528
|
+
}
|
|
1529
|
+
get destroyed() {
|
|
1530
|
+
return this[x];
|
|
1531
|
+
}
|
|
1532
|
+
get flowing() {
|
|
1533
|
+
return this[v];
|
|
1534
|
+
}
|
|
1535
|
+
get paused() {
|
|
1536
|
+
return this[dt];
|
|
1537
|
+
}
|
|
1538
|
+
[Yt](t) {
|
|
1539
|
+
this[k] ? this[T] += 1 : this[T] += t.length, this[C].push(t);
|
|
1540
|
+
}
|
|
1541
|
+
[Ft]() {
|
|
1542
|
+
return this[k] ? this[T] -= 1 : this[T] -= this[C][0].length, this[C].shift();
|
|
1543
|
+
}
|
|
1544
|
+
[Ot](t = !1) {
|
|
1545
|
+
do ;
|
|
1546
|
+
while (this[Le](this[Ft]()) && this[C].length);
|
|
1547
|
+
!t && !this[C].length && !this[G] && this.emit("drain");
|
|
1548
|
+
}
|
|
1549
|
+
[Le](t) {
|
|
1550
|
+
return this.emit("data", t), this[v];
|
|
1551
|
+
}
|
|
1552
|
+
pipe(t, e) {
|
|
1553
|
+
if (this[x]) return t;
|
|
1554
|
+
this[M] = !1;
|
|
1555
|
+
let s = this[K];
|
|
1556
|
+
return e = e || {}, t === Ne.stdout || t === Ne.stderr ? e.end = !1 : e.end = e.end !== !1, e.proxyErrors = !!e.proxyErrors, s ? e.end && t.end() : (this[F].push(e.proxyErrors ? new te(this, t, e) : new Mt(this, t, e)), this[B] ? mt(() => this[st]()) : this[st]()), t;
|
|
1557
|
+
}
|
|
1558
|
+
unpipe(t) {
|
|
1559
|
+
let e = this[F].find((s) => s.dest === t);
|
|
1560
|
+
e && (this[F].length === 1 ? (this[v] && this[Y] === 0 && (this[v] = !1), this[F] = []) : this[F].splice(this[F].indexOf(e), 1), e.unpipe());
|
|
1561
|
+
}
|
|
1562
|
+
addListener(t, e) {
|
|
1563
|
+
return this.on(t, e);
|
|
1564
|
+
}
|
|
1565
|
+
on(t, e) {
|
|
1566
|
+
let s = super.on(t, e);
|
|
1567
|
+
if (t === "data") this[M] = !1, this[Y]++, !this[F].length && !this[v] && this[st]();
|
|
1568
|
+
else if (t === "readable" && this[T] !== 0) super.emit("readable");
|
|
1569
|
+
else if (ci(t) && this[K]) super.emit(t), this.removeAllListeners(t);
|
|
1570
|
+
else if (t === "error" && this[ut]) {
|
|
1571
|
+
let i = e;
|
|
1572
|
+
this[B] ? mt(() => i.call(this, this[ut])) : i.call(this, this[ut]);
|
|
1573
|
+
}
|
|
1574
|
+
return s;
|
|
1575
|
+
}
|
|
1576
|
+
removeListener(t, e) {
|
|
1577
|
+
return this.off(t, e);
|
|
1578
|
+
}
|
|
1579
|
+
off(t, e) {
|
|
1580
|
+
let s = super.off(t, e);
|
|
1581
|
+
return t === "data" && (this[Y] = this.listeners("data").length, this[Y] === 0 && !this[M] && !this[F].length && (this[v] = !1)), s;
|
|
1582
|
+
}
|
|
1583
|
+
removeAllListeners(t) {
|
|
1584
|
+
let e = super.removeAllListeners(t);
|
|
1585
|
+
return (t === "data" || t === void 0) && (this[Y] = 0, !this[M] && !this[F].length && (this[v] = !1)), e;
|
|
1586
|
+
}
|
|
1587
|
+
get emittedEnd() {
|
|
1588
|
+
return this[K];
|
|
1589
|
+
}
|
|
1590
|
+
[H]() {
|
|
1591
|
+
!this[kt] && !this[K] && !this[x] && this[C].length === 0 && this[G] && (this[kt] = !0, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Rt] && this.emit("close"), this[kt] = !1);
|
|
1592
|
+
}
|
|
1593
|
+
emit(t, ...e) {
|
|
1594
|
+
let s = e[0];
|
|
1595
|
+
if (t !== "error" && t !== "close" && t !== x && this[x]) return !1;
|
|
1596
|
+
if (t === "data") return !this[k] && !s ? !1 : this[B] ? (mt(() => this[Jt](s)), !0) : this[Jt](s);
|
|
1597
|
+
if (t === "end") return this[We]();
|
|
1598
|
+
if (t === "close") {
|
|
1599
|
+
if (this[Rt] = !0, !this[K] && !this[x]) return !1;
|
|
1600
|
+
let r = super.emit("close");
|
|
1601
|
+
return this.removeAllListeners("close"), r;
|
|
1602
|
+
} else if (t === "error") {
|
|
1603
|
+
this[ut] = s, super.emit(Xt, s);
|
|
1604
|
+
let r = !this[pt] || this.listeners("error").length ? super.emit("error", s) : !1;
|
|
1605
|
+
return this[H](), r;
|
|
1606
|
+
} else if (t === "resume") {
|
|
1607
|
+
let r = super.emit("resume");
|
|
1608
|
+
return this[H](), r;
|
|
1609
|
+
} else if (t === "finish" || t === "prefinish") {
|
|
1610
|
+
let r = super.emit(t);
|
|
1611
|
+
return this.removeAllListeners(t), r;
|
|
1612
|
+
}
|
|
1613
|
+
let i = super.emit(t, ...e);
|
|
1614
|
+
return this[H](), i;
|
|
1615
|
+
}
|
|
1616
|
+
[Jt](t) {
|
|
1617
|
+
for (let s of this[F]) s.dest.write(t) === !1 && this.pause();
|
|
1618
|
+
let e = this[M] ? !1 : super.emit("data", t);
|
|
1619
|
+
return this[H](), e;
|
|
1620
|
+
}
|
|
1621
|
+
[We]() {
|
|
1622
|
+
return this[K] ? !1 : (this[K] = !0, this.readable = !1, this[B] ? (mt(() => this[Zt]()), !0) : this[Zt]());
|
|
1623
|
+
}
|
|
1624
|
+
[Zt]() {
|
|
1625
|
+
if (this[et]) {
|
|
1626
|
+
let e = this[et].end();
|
|
1627
|
+
if (e) {
|
|
1628
|
+
for (let s of this[F]) s.dest.write(e);
|
|
1629
|
+
this[M] || super.emit("data", e);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
for (let e of this[F]) e.end();
|
|
1633
|
+
let t = super.emit("end");
|
|
1634
|
+
return this.removeAllListeners("end"), t;
|
|
1635
|
+
}
|
|
1636
|
+
async collect() {
|
|
1637
|
+
let t = Object.assign([], { dataLength: 0 });
|
|
1638
|
+
this[k] || (t.dataLength = 0);
|
|
1639
|
+
let e = this.promise();
|
|
1640
|
+
return this.on("data", (s) => {
|
|
1641
|
+
t.push(s), this[k] || (t.dataLength += s.length);
|
|
1642
|
+
}), await e, t;
|
|
1643
|
+
}
|
|
1644
|
+
async concat() {
|
|
1645
|
+
if (this[k]) throw new Error("cannot concat in objectMode");
|
|
1646
|
+
let t = await this.collect();
|
|
1647
|
+
return this[P] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
1648
|
+
}
|
|
1649
|
+
async promise() {
|
|
1650
|
+
return new Promise((t, e) => {
|
|
1651
|
+
this.on(x, () => e(/* @__PURE__ */ new Error("stream destroyed"))), this.on("error", (s) => e(s)), this.on("end", () => t());
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
[Symbol.asyncIterator]() {
|
|
1655
|
+
this[M] = !1;
|
|
1656
|
+
let t = !1, e = async () => (this.pause(), t = !0, {
|
|
1657
|
+
value: void 0,
|
|
1658
|
+
done: !0
|
|
1659
|
+
});
|
|
1660
|
+
return {
|
|
1661
|
+
next: () => {
|
|
1662
|
+
if (t) return e();
|
|
1663
|
+
let i = this.read();
|
|
1664
|
+
if (i !== null) return Promise.resolve({
|
|
1665
|
+
done: !1,
|
|
1666
|
+
value: i
|
|
1667
|
+
});
|
|
1668
|
+
if (this[G]) return e();
|
|
1669
|
+
let r, o, h = (c) => {
|
|
1670
|
+
this.off("data", a), this.off("end", l), this.off(x, u), e(), o(c);
|
|
1671
|
+
}, a = (c) => {
|
|
1672
|
+
this.off("error", h), this.off("end", l), this.off(x, u), this.pause(), r({
|
|
1673
|
+
value: c,
|
|
1674
|
+
done: !!this[G]
|
|
1675
|
+
});
|
|
1676
|
+
}, l = () => {
|
|
1677
|
+
this.off("error", h), this.off("data", a), this.off(x, u), e(), r({
|
|
1678
|
+
done: !0,
|
|
1679
|
+
value: void 0
|
|
1680
|
+
});
|
|
1681
|
+
}, u = () => h(/* @__PURE__ */ new Error("stream destroyed"));
|
|
1682
|
+
return new Promise((c, d) => {
|
|
1683
|
+
o = d, r = c, this.once(x, u), this.once("error", h), this.once("end", l), this.once("data", a);
|
|
1684
|
+
});
|
|
1685
|
+
},
|
|
1686
|
+
throw: e,
|
|
1687
|
+
return: e,
|
|
1688
|
+
[Symbol.asyncIterator]() {
|
|
1689
|
+
return this;
|
|
1690
|
+
},
|
|
1691
|
+
[Symbol.asyncDispose]: async () => {}
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
[Symbol.iterator]() {
|
|
1695
|
+
this[M] = !1;
|
|
1696
|
+
let t = !1, e = () => (this.pause(), this.off(Xt, e), this.off(x, e), this.off("end", e), t = !0, {
|
|
1697
|
+
done: !0,
|
|
1698
|
+
value: void 0
|
|
1699
|
+
}), s = () => {
|
|
1700
|
+
if (t) return e();
|
|
1701
|
+
let i = this.read();
|
|
1702
|
+
return i === null ? e() : {
|
|
1703
|
+
done: !1,
|
|
1704
|
+
value: i
|
|
1705
|
+
};
|
|
1706
|
+
};
|
|
1707
|
+
return this.once("end", e), this.once(Xt, e), this.once(x, e), {
|
|
1708
|
+
next: s,
|
|
1709
|
+
throw: e,
|
|
1710
|
+
return: e,
|
|
1711
|
+
[Symbol.iterator]() {
|
|
1712
|
+
return this;
|
|
1713
|
+
},
|
|
1714
|
+
[Symbol.dispose]: () => {}
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
destroy(t) {
|
|
1718
|
+
if (this[x]) return t ? this.emit("error", t) : this.emit(x), this;
|
|
1719
|
+
this[x] = !0, this[M] = !0, this[C].length = 0, this[T] = 0;
|
|
1720
|
+
let e = this;
|
|
1721
|
+
return typeof e.close == "function" && !this[Rt] && e.close(), t ? this.emit("error", t) : this.emit(x), this;
|
|
1722
|
+
}
|
|
1723
|
+
static get isStream() {
|
|
1724
|
+
return oi;
|
|
1725
|
+
}
|
|
1726
|
+
}, wt = {
|
|
1727
|
+
lstatSync,
|
|
1728
|
+
readdir: readdir$1,
|
|
1729
|
+
readdirSync,
|
|
1730
|
+
readlinkSync,
|
|
1731
|
+
realpathSync: realpathSync.native,
|
|
1732
|
+
promises: {
|
|
1733
|
+
lstat,
|
|
1734
|
+
readdir,
|
|
1735
|
+
readlink,
|
|
1736
|
+
realpath
|
|
1737
|
+
}
|
|
1738
|
+
}, Ue = (n) => !n || n === wt || n === xi ? wt : {
|
|
1739
|
+
...wt,
|
|
1740
|
+
...n,
|
|
1741
|
+
promises: {
|
|
1742
|
+
...wt.promises,
|
|
1743
|
+
...n.promises || {}
|
|
1744
|
+
}
|
|
1745
|
+
}, $e = /^\\\\\?\\([a-z]:)\\?$/i, Ri = (n) => n.replace(/\//g, "\\").replace($e, "$1\\"), Oi = /[\\\/]/, L = 0, Ge = 1, He = 2, U = 4, qe = 6, Ke = 8, X = 10, Ve = 12, _ = 15, gt = ~_, se = 16, je = 32, yt = 64, j = 128, Nt = 256, Lt = 512, Ie = yt | j | Lt, Fi = 1023, ie = (n) => n.isFile() ? Ke : n.isDirectory() ? U : n.isSymbolicLink() ? X : n.isCharacterDevice() ? He : n.isBlockDevice() ? qe : n.isSocket() ? Ve : n.isFIFO() ? Ge : L, ze = new ft({ max: 2 ** 12 }), bt = (n) => {
|
|
1746
|
+
let t = ze.get(n);
|
|
1747
|
+
if (t) return t;
|
|
1748
|
+
let e = n.normalize("NFKD");
|
|
1749
|
+
return ze.set(n, e), e;
|
|
1750
|
+
}, Be = new ft({ max: 2 ** 12 }), _t = (n) => {
|
|
1751
|
+
let t = Be.get(n);
|
|
1752
|
+
if (t) return t;
|
|
1753
|
+
let e = bt(n.toLowerCase());
|
|
1754
|
+
return Be.set(n, e), e;
|
|
1755
|
+
}, Wt = class extends ft {
|
|
1756
|
+
constructor() {
|
|
1757
|
+
super({ max: 256 });
|
|
1758
|
+
}
|
|
1759
|
+
}, ne = class extends ft {
|
|
1760
|
+
constructor(t = 16 * 1024) {
|
|
1761
|
+
super({
|
|
1762
|
+
maxSize: t,
|
|
1763
|
+
sizeCalculation: (e) => e.length + 1
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
}, Ye = Symbol("PathScurry setAsCwd"), R = class {
|
|
1767
|
+
name;
|
|
1768
|
+
root;
|
|
1769
|
+
roots;
|
|
1770
|
+
parent;
|
|
1771
|
+
nocase;
|
|
1772
|
+
isCWD = !1;
|
|
1773
|
+
#t;
|
|
1774
|
+
#s;
|
|
1775
|
+
get dev() {
|
|
1776
|
+
return this.#s;
|
|
1777
|
+
}
|
|
1778
|
+
#n;
|
|
1779
|
+
get mode() {
|
|
1780
|
+
return this.#n;
|
|
1781
|
+
}
|
|
1782
|
+
#r;
|
|
1783
|
+
get nlink() {
|
|
1784
|
+
return this.#r;
|
|
1785
|
+
}
|
|
1786
|
+
#o;
|
|
1787
|
+
get uid() {
|
|
1788
|
+
return this.#o;
|
|
1789
|
+
}
|
|
1790
|
+
#S;
|
|
1791
|
+
get gid() {
|
|
1792
|
+
return this.#S;
|
|
1793
|
+
}
|
|
1794
|
+
#w;
|
|
1795
|
+
get rdev() {
|
|
1796
|
+
return this.#w;
|
|
1797
|
+
}
|
|
1798
|
+
#c;
|
|
1799
|
+
get blksize() {
|
|
1800
|
+
return this.#c;
|
|
1801
|
+
}
|
|
1802
|
+
#h;
|
|
1803
|
+
get ino() {
|
|
1804
|
+
return this.#h;
|
|
1805
|
+
}
|
|
1806
|
+
#u;
|
|
1807
|
+
get size() {
|
|
1808
|
+
return this.#u;
|
|
1809
|
+
}
|
|
1810
|
+
#f;
|
|
1811
|
+
get blocks() {
|
|
1812
|
+
return this.#f;
|
|
1813
|
+
}
|
|
1814
|
+
#a;
|
|
1815
|
+
get atimeMs() {
|
|
1816
|
+
return this.#a;
|
|
1817
|
+
}
|
|
1818
|
+
#i;
|
|
1819
|
+
get mtimeMs() {
|
|
1820
|
+
return this.#i;
|
|
1821
|
+
}
|
|
1822
|
+
#d;
|
|
1823
|
+
get ctimeMs() {
|
|
1824
|
+
return this.#d;
|
|
1825
|
+
}
|
|
1826
|
+
#E;
|
|
1827
|
+
get birthtimeMs() {
|
|
1828
|
+
return this.#E;
|
|
1829
|
+
}
|
|
1830
|
+
#b;
|
|
1831
|
+
get atime() {
|
|
1832
|
+
return this.#b;
|
|
1833
|
+
}
|
|
1834
|
+
#p;
|
|
1835
|
+
get mtime() {
|
|
1836
|
+
return this.#p;
|
|
1837
|
+
}
|
|
1838
|
+
#R;
|
|
1839
|
+
get ctime() {
|
|
1840
|
+
return this.#R;
|
|
1841
|
+
}
|
|
1842
|
+
#m;
|
|
1843
|
+
get birthtime() {
|
|
1844
|
+
return this.#m;
|
|
1845
|
+
}
|
|
1846
|
+
#C;
|
|
1847
|
+
#T;
|
|
1848
|
+
#g;
|
|
1849
|
+
#y;
|
|
1850
|
+
#x;
|
|
1851
|
+
#A;
|
|
1852
|
+
#e;
|
|
1853
|
+
#_;
|
|
1854
|
+
#M;
|
|
1855
|
+
#k;
|
|
1856
|
+
get parentPath() {
|
|
1857
|
+
return (this.parent || this).fullpath();
|
|
1858
|
+
}
|
|
1859
|
+
get path() {
|
|
1860
|
+
return this.parentPath;
|
|
1861
|
+
}
|
|
1862
|
+
constructor(t, e = L, s, i, r, o, h) {
|
|
1863
|
+
this.name = t, this.#C = r ? _t(t) : bt(t), this.#e = e & Fi, this.nocase = r, this.roots = i, this.root = s || this, this.#_ = o, this.#g = h.fullpath, this.#x = h.relative, this.#A = h.relativePosix, this.parent = h.parent, this.parent ? this.#t = this.parent.#t : this.#t = Ue(h.fs);
|
|
1864
|
+
}
|
|
1865
|
+
depth() {
|
|
1866
|
+
return this.#T !== void 0 ? this.#T : this.parent ? this.#T = this.parent.depth() + 1 : this.#T = 0;
|
|
1867
|
+
}
|
|
1868
|
+
childrenCache() {
|
|
1869
|
+
return this.#_;
|
|
1870
|
+
}
|
|
1871
|
+
resolve(t) {
|
|
1872
|
+
if (!t) return this;
|
|
1873
|
+
let e = this.getRootString(t), i = t.substring(e.length).split(this.splitSep);
|
|
1874
|
+
return e ? this.getRoot(e).#N(i) : this.#N(i);
|
|
1875
|
+
}
|
|
1876
|
+
#N(t) {
|
|
1877
|
+
let e = this;
|
|
1878
|
+
for (let s of t) e = e.child(s);
|
|
1879
|
+
return e;
|
|
1880
|
+
}
|
|
1881
|
+
children() {
|
|
1882
|
+
let t = this.#_.get(this);
|
|
1883
|
+
if (t) return t;
|
|
1884
|
+
let e = Object.assign([], { provisional: 0 });
|
|
1885
|
+
return this.#_.set(this, e), this.#e &= ~se, e;
|
|
1886
|
+
}
|
|
1887
|
+
child(t, e) {
|
|
1888
|
+
if (t === "" || t === ".") return this;
|
|
1889
|
+
if (t === "..") return this.parent || this;
|
|
1890
|
+
let s = this.children(), i = this.nocase ? _t(t) : bt(t);
|
|
1891
|
+
for (let a of s) if (a.#C === i) return a;
|
|
1892
|
+
let r = this.parent ? this.sep : "", o = this.#g ? this.#g + r + t : void 0, h = this.newChild(t, L, {
|
|
1893
|
+
...e,
|
|
1894
|
+
parent: this,
|
|
1895
|
+
fullpath: o
|
|
1896
|
+
});
|
|
1897
|
+
return this.canReaddir() || (h.#e |= j), s.push(h), h;
|
|
1898
|
+
}
|
|
1899
|
+
relative() {
|
|
1900
|
+
if (this.isCWD) return "";
|
|
1901
|
+
if (this.#x !== void 0) return this.#x;
|
|
1902
|
+
let t = this.name, e = this.parent;
|
|
1903
|
+
if (!e) return this.#x = this.name;
|
|
1904
|
+
let s = e.relative();
|
|
1905
|
+
return s + (!s || !e.parent ? "" : this.sep) + t;
|
|
1906
|
+
}
|
|
1907
|
+
relativePosix() {
|
|
1908
|
+
if (this.sep === "/") return this.relative();
|
|
1909
|
+
if (this.isCWD) return "";
|
|
1910
|
+
if (this.#A !== void 0) return this.#A;
|
|
1911
|
+
let t = this.name, e = this.parent;
|
|
1912
|
+
if (!e) return this.#A = this.fullpathPosix();
|
|
1913
|
+
let s = e.relativePosix();
|
|
1914
|
+
return s + (!s || !e.parent ? "" : "/") + t;
|
|
1915
|
+
}
|
|
1916
|
+
fullpath() {
|
|
1917
|
+
if (this.#g !== void 0) return this.#g;
|
|
1918
|
+
let t = this.name, e = this.parent;
|
|
1919
|
+
if (!e) return this.#g = this.name;
|
|
1920
|
+
return this.#g = e.fullpath() + (e.parent ? this.sep : "") + t;
|
|
1921
|
+
}
|
|
1922
|
+
fullpathPosix() {
|
|
1923
|
+
if (this.#y !== void 0) return this.#y;
|
|
1924
|
+
if (this.sep === "/") return this.#y = this.fullpath();
|
|
1925
|
+
if (!this.parent) {
|
|
1926
|
+
let i = this.fullpath().replace(/\\/g, "/");
|
|
1927
|
+
return /^[a-z]:\//i.test(i) ? this.#y = `//?/${i}` : this.#y = i;
|
|
1928
|
+
}
|
|
1929
|
+
let t = this.parent, e = t.fullpathPosix();
|
|
1930
|
+
return this.#y = e + (!e || !t.parent ? "" : "/") + this.name;
|
|
1931
|
+
}
|
|
1932
|
+
isUnknown() {
|
|
1933
|
+
return (this.#e & _) === L;
|
|
1934
|
+
}
|
|
1935
|
+
isType(t) {
|
|
1936
|
+
return this[`is${t}`]();
|
|
1937
|
+
}
|
|
1938
|
+
getType() {
|
|
1939
|
+
return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown";
|
|
1940
|
+
}
|
|
1941
|
+
isFile() {
|
|
1942
|
+
return (this.#e & _) === Ke;
|
|
1943
|
+
}
|
|
1944
|
+
isDirectory() {
|
|
1945
|
+
return (this.#e & _) === U;
|
|
1946
|
+
}
|
|
1947
|
+
isCharacterDevice() {
|
|
1948
|
+
return (this.#e & _) === He;
|
|
1949
|
+
}
|
|
1950
|
+
isBlockDevice() {
|
|
1951
|
+
return (this.#e & _) === qe;
|
|
1952
|
+
}
|
|
1953
|
+
isFIFO() {
|
|
1954
|
+
return (this.#e & _) === Ge;
|
|
1955
|
+
}
|
|
1956
|
+
isSocket() {
|
|
1957
|
+
return (this.#e & _) === Ve;
|
|
1958
|
+
}
|
|
1959
|
+
isSymbolicLink() {
|
|
1960
|
+
return (this.#e & X) === X;
|
|
1961
|
+
}
|
|
1962
|
+
lstatCached() {
|
|
1963
|
+
return this.#e & je ? this : void 0;
|
|
1964
|
+
}
|
|
1965
|
+
readlinkCached() {
|
|
1966
|
+
return this.#M;
|
|
1967
|
+
}
|
|
1968
|
+
realpathCached() {
|
|
1969
|
+
return this.#k;
|
|
1970
|
+
}
|
|
1971
|
+
readdirCached() {
|
|
1972
|
+
let t = this.children();
|
|
1973
|
+
return t.slice(0, t.provisional);
|
|
1974
|
+
}
|
|
1975
|
+
canReadlink() {
|
|
1976
|
+
if (this.#M) return !0;
|
|
1977
|
+
if (!this.parent) return !1;
|
|
1978
|
+
let t = this.#e & _;
|
|
1979
|
+
return !(t !== L && t !== X || this.#e & Nt || this.#e & j);
|
|
1980
|
+
}
|
|
1981
|
+
calledReaddir() {
|
|
1982
|
+
return !!(this.#e & se);
|
|
1983
|
+
}
|
|
1984
|
+
isENOENT() {
|
|
1985
|
+
return !!(this.#e & j);
|
|
1986
|
+
}
|
|
1987
|
+
isNamed(t) {
|
|
1988
|
+
return this.nocase ? this.#C === _t(t) : this.#C === bt(t);
|
|
1989
|
+
}
|
|
1990
|
+
async readlink() {
|
|
1991
|
+
let t = this.#M;
|
|
1992
|
+
if (t) return t;
|
|
1993
|
+
if (this.canReadlink() && this.parent) try {
|
|
1994
|
+
let e = await this.#t.promises.readlink(this.fullpath()), s = (await this.parent.realpath())?.resolve(e);
|
|
1995
|
+
if (s) return this.#M = s;
|
|
1996
|
+
} catch (e) {
|
|
1997
|
+
this.#D(e.code);
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
readlinkSync() {
|
|
2002
|
+
let t = this.#M;
|
|
2003
|
+
if (t) return t;
|
|
2004
|
+
if (this.canReadlink() && this.parent) try {
|
|
2005
|
+
let e = this.#t.readlinkSync(this.fullpath()), s = this.parent.realpathSync()?.resolve(e);
|
|
2006
|
+
if (s) return this.#M = s;
|
|
2007
|
+
} catch (e) {
|
|
2008
|
+
this.#D(e.code);
|
|
2009
|
+
return;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
#j(t) {
|
|
2013
|
+
this.#e |= se;
|
|
2014
|
+
for (let e = t.provisional; e < t.length; e++) {
|
|
2015
|
+
let s = t[e];
|
|
2016
|
+
s && s.#v();
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
#v() {
|
|
2020
|
+
this.#e & j || (this.#e = (this.#e | j) & gt, this.#G());
|
|
2021
|
+
}
|
|
2022
|
+
#G() {
|
|
2023
|
+
let t = this.children();
|
|
2024
|
+
t.provisional = 0;
|
|
2025
|
+
for (let e of t) e.#v();
|
|
2026
|
+
}
|
|
2027
|
+
#P() {
|
|
2028
|
+
this.#e |= Lt, this.#L();
|
|
2029
|
+
}
|
|
2030
|
+
#L() {
|
|
2031
|
+
if (this.#e & yt) return;
|
|
2032
|
+
let t = this.#e;
|
|
2033
|
+
(t & _) === U && (t &= gt), this.#e = t | yt, this.#G();
|
|
2034
|
+
}
|
|
2035
|
+
#I(t = "") {
|
|
2036
|
+
t === "ENOTDIR" || t === "EPERM" ? this.#L() : t === "ENOENT" ? this.#v() : this.children().provisional = 0;
|
|
2037
|
+
}
|
|
2038
|
+
#F(t = "") {
|
|
2039
|
+
t === "ENOTDIR" ? this.parent.#L() : t === "ENOENT" && this.#v();
|
|
2040
|
+
}
|
|
2041
|
+
#D(t = "") {
|
|
2042
|
+
let e = this.#e;
|
|
2043
|
+
e |= Nt, t === "ENOENT" && (e |= j), (t === "EINVAL" || t === "UNKNOWN") && (e &= gt), this.#e = e, t === "ENOTDIR" && this.parent && this.parent.#L();
|
|
2044
|
+
}
|
|
2045
|
+
#z(t, e) {
|
|
2046
|
+
return this.#U(t, e) || this.#B(t, e);
|
|
2047
|
+
}
|
|
2048
|
+
#B(t, e) {
|
|
2049
|
+
let s = ie(t), i = this.newChild(t.name, s, { parent: this }), r = i.#e & _;
|
|
2050
|
+
return r !== U && r !== X && r !== L && (i.#e |= yt), e.unshift(i), e.provisional++, i;
|
|
2051
|
+
}
|
|
2052
|
+
#U(t, e) {
|
|
2053
|
+
for (let s = e.provisional; s < e.length; s++) {
|
|
2054
|
+
let i = e[s];
|
|
2055
|
+
if ((this.nocase ? _t(t.name) : bt(t.name)) === i.#C) return this.#l(t, i, s, e);
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
#l(t, e, s, i) {
|
|
2059
|
+
let r = e.name;
|
|
2060
|
+
return e.#e = e.#e & gt | ie(t), r !== t.name && (e.name = t.name), s !== i.provisional && (s === i.length - 1 ? i.pop() : i.splice(s, 1), i.unshift(e)), i.provisional++, e;
|
|
2061
|
+
}
|
|
2062
|
+
async lstat() {
|
|
2063
|
+
if ((this.#e & j) === 0) try {
|
|
2064
|
+
return this.#$(await this.#t.promises.lstat(this.fullpath())), this;
|
|
2065
|
+
} catch (t) {
|
|
2066
|
+
this.#F(t.code);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
lstatSync() {
|
|
2070
|
+
if ((this.#e & j) === 0) try {
|
|
2071
|
+
return this.#$(this.#t.lstatSync(this.fullpath())), this;
|
|
2072
|
+
} catch (t) {
|
|
2073
|
+
this.#F(t.code);
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
#$(t) {
|
|
2077
|
+
let { atime: e, atimeMs: s, birthtime: i, birthtimeMs: r, blksize: o, blocks: h, ctime: a, ctimeMs: l, dev: u, gid: c, ino: d, mode: f, mtime: m, mtimeMs: p, nlink: w, rdev: g, size: S, uid: E } = t;
|
|
2078
|
+
this.#b = e, this.#a = s, this.#m = i, this.#E = r, this.#c = o, this.#f = h, this.#R = a, this.#d = l, this.#s = u, this.#S = c, this.#h = d, this.#n = f, this.#p = m, this.#i = p, this.#r = w, this.#w = g, this.#u = S, this.#o = E;
|
|
2079
|
+
let y = ie(t);
|
|
2080
|
+
this.#e = this.#e & gt | y | je, y !== L && y !== U && y !== X && (this.#e |= yt);
|
|
2081
|
+
}
|
|
2082
|
+
#W = [];
|
|
2083
|
+
#O = !1;
|
|
2084
|
+
#H(t) {
|
|
2085
|
+
this.#O = !1;
|
|
2086
|
+
let e = this.#W.slice();
|
|
2087
|
+
this.#W.length = 0, e.forEach((s) => s(null, t));
|
|
2088
|
+
}
|
|
2089
|
+
readdirCB(t, e = !1) {
|
|
2090
|
+
if (!this.canReaddir()) {
|
|
2091
|
+
e ? t(null, []) : queueMicrotask(() => t(null, []));
|
|
2092
|
+
return;
|
|
2093
|
+
}
|
|
2094
|
+
let s = this.children();
|
|
2095
|
+
if (this.calledReaddir()) {
|
|
2096
|
+
let r = s.slice(0, s.provisional);
|
|
2097
|
+
e ? t(null, r) : queueMicrotask(() => t(null, r));
|
|
2098
|
+
return;
|
|
2099
|
+
}
|
|
2100
|
+
if (this.#W.push(t), this.#O) return;
|
|
2101
|
+
this.#O = !0;
|
|
2102
|
+
let i = this.fullpath();
|
|
2103
|
+
this.#t.readdir(i, { withFileTypes: !0 }, (r, o) => {
|
|
2104
|
+
if (r) this.#I(r.code), s.provisional = 0;
|
|
2105
|
+
else {
|
|
2106
|
+
for (let h of o) this.#z(h, s);
|
|
2107
|
+
this.#j(s);
|
|
2108
|
+
}
|
|
2109
|
+
this.#H(s.slice(0, s.provisional));
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
#q;
|
|
2113
|
+
async readdir() {
|
|
2114
|
+
if (!this.canReaddir()) return [];
|
|
2115
|
+
let t = this.children();
|
|
2116
|
+
if (this.calledReaddir()) return t.slice(0, t.provisional);
|
|
2117
|
+
let e = this.fullpath();
|
|
2118
|
+
if (this.#q) await this.#q;
|
|
2119
|
+
else {
|
|
2120
|
+
let s = () => {};
|
|
2121
|
+
this.#q = new Promise((i) => s = i);
|
|
2122
|
+
try {
|
|
2123
|
+
for (let i of await this.#t.promises.readdir(e, { withFileTypes: !0 })) this.#z(i, t);
|
|
2124
|
+
this.#j(t);
|
|
2125
|
+
} catch (i) {
|
|
2126
|
+
this.#I(i.code), t.provisional = 0;
|
|
2127
|
+
}
|
|
2128
|
+
this.#q = void 0, s();
|
|
2129
|
+
}
|
|
2130
|
+
return t.slice(0, t.provisional);
|
|
2131
|
+
}
|
|
2132
|
+
readdirSync() {
|
|
2133
|
+
if (!this.canReaddir()) return [];
|
|
2134
|
+
let t = this.children();
|
|
2135
|
+
if (this.calledReaddir()) return t.slice(0, t.provisional);
|
|
2136
|
+
let e = this.fullpath();
|
|
2137
|
+
try {
|
|
2138
|
+
for (let s of this.#t.readdirSync(e, { withFileTypes: !0 })) this.#z(s, t);
|
|
2139
|
+
this.#j(t);
|
|
2140
|
+
} catch (s) {
|
|
2141
|
+
this.#I(s.code), t.provisional = 0;
|
|
2142
|
+
}
|
|
2143
|
+
return t.slice(0, t.provisional);
|
|
2144
|
+
}
|
|
2145
|
+
canReaddir() {
|
|
2146
|
+
if (this.#e & Ie) return !1;
|
|
2147
|
+
let t = _ & this.#e;
|
|
2148
|
+
return t === L || t === U || t === X;
|
|
2149
|
+
}
|
|
2150
|
+
shouldWalk(t, e) {
|
|
2151
|
+
return (this.#e & U) === U && !(this.#e & Ie) && !t.has(this) && (!e || e(this));
|
|
2152
|
+
}
|
|
2153
|
+
async realpath() {
|
|
2154
|
+
if (this.#k) return this.#k;
|
|
2155
|
+
if (!((Lt | Nt | j) & this.#e)) try {
|
|
2156
|
+
let t = await this.#t.promises.realpath(this.fullpath());
|
|
2157
|
+
return this.#k = this.resolve(t);
|
|
2158
|
+
} catch {
|
|
2159
|
+
this.#P();
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
realpathSync() {
|
|
2163
|
+
if (this.#k) return this.#k;
|
|
2164
|
+
if (!((Lt | Nt | j) & this.#e)) try {
|
|
2165
|
+
let t = this.#t.realpathSync(this.fullpath());
|
|
2166
|
+
return this.#k = this.resolve(t);
|
|
2167
|
+
} catch {
|
|
2168
|
+
this.#P();
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
[Ye](t) {
|
|
2172
|
+
if (t === this) return;
|
|
2173
|
+
t.isCWD = !1, this.isCWD = !0;
|
|
2174
|
+
let e = /* @__PURE__ */ new Set([]), s = [], i = this;
|
|
2175
|
+
for (; i && i.parent;) e.add(i), i.#x = s.join(this.sep), i.#A = s.join("/"), i = i.parent, s.push("..");
|
|
2176
|
+
for (i = t; i && i.parent && !e.has(i);) i.#x = void 0, i.#A = void 0, i = i.parent;
|
|
2177
|
+
}
|
|
2178
|
+
}, Pt = class n extends R {
|
|
2179
|
+
sep = "\\";
|
|
2180
|
+
splitSep = Oi;
|
|
2181
|
+
constructor(t, e = L, s, i, r, o, h) {
|
|
2182
|
+
super(t, e, s, i, r, o, h);
|
|
2183
|
+
}
|
|
2184
|
+
newChild(t, e = L, s = {}) {
|
|
2185
|
+
return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
2186
|
+
}
|
|
2187
|
+
getRootString(t) {
|
|
2188
|
+
return win32.parse(t).root;
|
|
2189
|
+
}
|
|
2190
|
+
getRoot(t) {
|
|
2191
|
+
if (t = Ri(t.toUpperCase()), t === this.root.name) return this.root;
|
|
2192
|
+
for (let [e, s] of Object.entries(this.roots)) if (this.sameRoot(t, e)) return this.roots[t] = s;
|
|
2193
|
+
return this.roots[t] = new it(t, this).root;
|
|
2194
|
+
}
|
|
2195
|
+
sameRoot(t, e = this.root.name) {
|
|
2196
|
+
return t = t.toUpperCase().replace(/\//g, "\\").replace($e, "$1\\"), t === e;
|
|
2197
|
+
}
|
|
2198
|
+
}, jt = class n extends R {
|
|
2199
|
+
splitSep = "/";
|
|
2200
|
+
sep = "/";
|
|
2201
|
+
constructor(t, e = L, s, i, r, o, h) {
|
|
2202
|
+
super(t, e, s, i, r, o, h);
|
|
2203
|
+
}
|
|
2204
|
+
getRootString(t) {
|
|
2205
|
+
return t.startsWith("/") ? "/" : "";
|
|
2206
|
+
}
|
|
2207
|
+
getRoot(t) {
|
|
2208
|
+
return this.root;
|
|
2209
|
+
}
|
|
2210
|
+
newChild(t, e = L, s = {}) {
|
|
2211
|
+
return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
2212
|
+
}
|
|
2213
|
+
}, It = class {
|
|
2214
|
+
root;
|
|
2215
|
+
rootPath;
|
|
2216
|
+
roots;
|
|
2217
|
+
cwd;
|
|
2218
|
+
#t;
|
|
2219
|
+
#s;
|
|
2220
|
+
#n;
|
|
2221
|
+
nocase;
|
|
2222
|
+
#r;
|
|
2223
|
+
constructor(t = process.cwd(), e, s, { nocase: i, childrenCacheSize: r = 16 * 1024, fs: o = wt } = {}) {
|
|
2224
|
+
this.#r = Ue(o), (t instanceof URL || t.startsWith("file://")) && (t = fileURLToPath(t));
|
|
2225
|
+
let h = e.resolve(t);
|
|
2226
|
+
this.roots = Object.create(null), this.rootPath = this.parseRootPath(h), this.#t = new Wt(), this.#s = new Wt(), this.#n = new ne(r);
|
|
2227
|
+
let a = h.substring(this.rootPath.length).split(s);
|
|
2228
|
+
if (a.length === 1 && !a[0] && a.pop(), i === void 0) throw new TypeError("must provide nocase setting to PathScurryBase ctor");
|
|
2229
|
+
this.nocase = i, this.root = this.newRoot(this.#r), this.roots[this.rootPath] = this.root;
|
|
2230
|
+
let l = this.root, u = a.length - 1, c = e.sep, d = this.rootPath, f = !1;
|
|
2231
|
+
for (let m of a) {
|
|
2232
|
+
let p = u--;
|
|
2233
|
+
l = l.child(m, {
|
|
2234
|
+
relative: new Array(p).fill("..").join(c),
|
|
2235
|
+
relativePosix: new Array(p).fill("..").join("/"),
|
|
2236
|
+
fullpath: d += (f ? "" : c) + m
|
|
2237
|
+
}), f = !0;
|
|
2238
|
+
}
|
|
2239
|
+
this.cwd = l;
|
|
2240
|
+
}
|
|
2241
|
+
depth(t = this.cwd) {
|
|
2242
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), t.depth();
|
|
2243
|
+
}
|
|
2244
|
+
childrenCache() {
|
|
2245
|
+
return this.#n;
|
|
2246
|
+
}
|
|
2247
|
+
resolve(...t) {
|
|
2248
|
+
let e = "";
|
|
2249
|
+
for (let r = t.length - 1; r >= 0; r--) {
|
|
2250
|
+
let o = t[r];
|
|
2251
|
+
if (!(!o || o === ".") && (e = e ? `${o}/${e}` : o, this.isAbsolute(o))) break;
|
|
2252
|
+
}
|
|
2253
|
+
let s = this.#t.get(e);
|
|
2254
|
+
if (s !== void 0) return s;
|
|
2255
|
+
let i = this.cwd.resolve(e).fullpath();
|
|
2256
|
+
return this.#t.set(e, i), i;
|
|
2257
|
+
}
|
|
2258
|
+
resolvePosix(...t) {
|
|
2259
|
+
let e = "";
|
|
2260
|
+
for (let r = t.length - 1; r >= 0; r--) {
|
|
2261
|
+
let o = t[r];
|
|
2262
|
+
if (!(!o || o === ".") && (e = e ? `${o}/${e}` : o, this.isAbsolute(o))) break;
|
|
2263
|
+
}
|
|
2264
|
+
let s = this.#s.get(e);
|
|
2265
|
+
if (s !== void 0) return s;
|
|
2266
|
+
let i = this.cwd.resolve(e).fullpathPosix();
|
|
2267
|
+
return this.#s.set(e, i), i;
|
|
2268
|
+
}
|
|
2269
|
+
relative(t = this.cwd) {
|
|
2270
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), t.relative();
|
|
2271
|
+
}
|
|
2272
|
+
relativePosix(t = this.cwd) {
|
|
2273
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), t.relativePosix();
|
|
2274
|
+
}
|
|
2275
|
+
basename(t = this.cwd) {
|
|
2276
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), t.name;
|
|
2277
|
+
}
|
|
2278
|
+
dirname(t = this.cwd) {
|
|
2279
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), (t.parent || t).fullpath();
|
|
2280
|
+
}
|
|
2281
|
+
async readdir(t = this.cwd, e = { withFileTypes: !0 }) {
|
|
2282
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2283
|
+
let { withFileTypes: s } = e;
|
|
2284
|
+
if (t.canReaddir()) {
|
|
2285
|
+
let i = await t.readdir();
|
|
2286
|
+
return s ? i : i.map((r) => r.name);
|
|
2287
|
+
} else return [];
|
|
2288
|
+
}
|
|
2289
|
+
readdirSync(t = this.cwd, e = { withFileTypes: !0 }) {
|
|
2290
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2291
|
+
let { withFileTypes: s = !0 } = e;
|
|
2292
|
+
return t.canReaddir() ? s ? t.readdirSync() : t.readdirSync().map((i) => i.name) : [];
|
|
2293
|
+
}
|
|
2294
|
+
async lstat(t = this.cwd) {
|
|
2295
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstat();
|
|
2296
|
+
}
|
|
2297
|
+
lstatSync(t = this.cwd) {
|
|
2298
|
+
return typeof t == "string" && (t = this.cwd.resolve(t)), t.lstatSync();
|
|
2299
|
+
}
|
|
2300
|
+
async readlink(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
|
|
2301
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
2302
|
+
let s = await t.readlink();
|
|
2303
|
+
return e ? s : s?.fullpath();
|
|
2304
|
+
}
|
|
2305
|
+
readlinkSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
|
|
2306
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
2307
|
+
let s = t.readlinkSync();
|
|
2308
|
+
return e ? s : s?.fullpath();
|
|
2309
|
+
}
|
|
2310
|
+
async realpath(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
|
|
2311
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
2312
|
+
let s = await t.realpath();
|
|
2313
|
+
return e ? s : s?.fullpath();
|
|
2314
|
+
}
|
|
2315
|
+
realpathSync(t = this.cwd, { withFileTypes: e } = { withFileTypes: !1 }) {
|
|
2316
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t.withFileTypes, t = this.cwd);
|
|
2317
|
+
let s = t.realpathSync();
|
|
2318
|
+
return e ? s : s?.fullpath();
|
|
2319
|
+
}
|
|
2320
|
+
async walk(t = this.cwd, e = {}) {
|
|
2321
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2322
|
+
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e, h = [];
|
|
2323
|
+
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2324
|
+
let a = /* @__PURE__ */ new Set(), l = (c, d) => {
|
|
2325
|
+
a.add(c), c.readdirCB((f, m) => {
|
|
2326
|
+
if (f) return d(f);
|
|
2327
|
+
let p = m.length;
|
|
2328
|
+
if (!p) return d();
|
|
2329
|
+
let w = () => {
|
|
2330
|
+
--p === 0 && d();
|
|
2331
|
+
};
|
|
2332
|
+
for (let g of m) (!r || r(g)) && h.push(s ? g : g.fullpath()), i && g.isSymbolicLink() ? g.realpath().then((S) => S?.isUnknown() ? S.lstat() : S).then((S) => S?.shouldWalk(a, o) ? l(S, w) : w()) : g.shouldWalk(a, o) ? l(g, w) : w();
|
|
2333
|
+
}, !0);
|
|
2334
|
+
}, u = t;
|
|
2335
|
+
return new Promise((c, d) => {
|
|
2336
|
+
l(u, (f) => {
|
|
2337
|
+
if (f) return d(f);
|
|
2338
|
+
c(h);
|
|
2339
|
+
});
|
|
2340
|
+
});
|
|
2341
|
+
}
|
|
2342
|
+
walkSync(t = this.cwd, e = {}) {
|
|
2343
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2344
|
+
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e, h = [];
|
|
2345
|
+
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2346
|
+
let a = new Set([t]);
|
|
2347
|
+
for (let l of a) {
|
|
2348
|
+
let u = l.readdirSync();
|
|
2349
|
+
for (let c of u) {
|
|
2350
|
+
(!r || r(c)) && h.push(s ? c : c.fullpath());
|
|
2351
|
+
let d = c;
|
|
2352
|
+
if (c.isSymbolicLink()) {
|
|
2353
|
+
if (!(i && (d = c.realpathSync()))) continue;
|
|
2354
|
+
d.isUnknown() && d.lstatSync();
|
|
2355
|
+
}
|
|
2356
|
+
d.shouldWalk(a, o) && a.add(d);
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
return h;
|
|
2360
|
+
}
|
|
2361
|
+
[Symbol.asyncIterator]() {
|
|
2362
|
+
return this.iterate();
|
|
2363
|
+
}
|
|
2364
|
+
iterate(t = this.cwd, e = {}) {
|
|
2365
|
+
return typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd), this.stream(t, e)[Symbol.asyncIterator]();
|
|
2366
|
+
}
|
|
2367
|
+
[Symbol.iterator]() {
|
|
2368
|
+
return this.iterateSync();
|
|
2369
|
+
}
|
|
2370
|
+
*iterateSync(t = this.cwd, e = {}) {
|
|
2371
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2372
|
+
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e;
|
|
2373
|
+
(!r || r(t)) && (yield s ? t : t.fullpath());
|
|
2374
|
+
let h = new Set([t]);
|
|
2375
|
+
for (let a of h) {
|
|
2376
|
+
let l = a.readdirSync();
|
|
2377
|
+
for (let u of l) {
|
|
2378
|
+
(!r || r(u)) && (yield s ? u : u.fullpath());
|
|
2379
|
+
let c = u;
|
|
2380
|
+
if (u.isSymbolicLink()) {
|
|
2381
|
+
if (!(i && (c = u.realpathSync()))) continue;
|
|
2382
|
+
c.isUnknown() && c.lstatSync();
|
|
2383
|
+
}
|
|
2384
|
+
c.shouldWalk(h, o) && h.add(c);
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
stream(t = this.cwd, e = {}) {
|
|
2389
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2390
|
+
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e, h = new V({ objectMode: !0 });
|
|
2391
|
+
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
2392
|
+
let a = /* @__PURE__ */ new Set(), l = [t], u = 0, c = () => {
|
|
2393
|
+
let d = !1;
|
|
2394
|
+
for (; !d;) {
|
|
2395
|
+
let f = l.shift();
|
|
2396
|
+
if (!f) {
|
|
2397
|
+
u === 0 && h.end();
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
u++, a.add(f);
|
|
2401
|
+
let m = (w, g, S = !1) => {
|
|
2402
|
+
if (w) return h.emit("error", w);
|
|
2403
|
+
if (i && !S) {
|
|
2404
|
+
let E = [];
|
|
2405
|
+
for (let y of g) y.isSymbolicLink() && E.push(y.realpath().then((b) => b?.isUnknown() ? b.lstat() : b));
|
|
2406
|
+
if (E.length) {
|
|
2407
|
+
Promise.all(E).then(() => m(null, g, !0));
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
for (let E of g) E && (!r || r(E)) && (h.write(s ? E : E.fullpath()) || (d = !0));
|
|
2412
|
+
u--;
|
|
2413
|
+
for (let E of g) {
|
|
2414
|
+
let y = E.realpathCached() || E;
|
|
2415
|
+
y.shouldWalk(a, o) && l.push(y);
|
|
2416
|
+
}
|
|
2417
|
+
d && !h.flowing ? h.once("drain", c) : p || c();
|
|
2418
|
+
}, p = !0;
|
|
2419
|
+
f.readdirCB(m, !0), p = !1;
|
|
2420
|
+
}
|
|
2421
|
+
};
|
|
2422
|
+
return c(), h;
|
|
2423
|
+
}
|
|
2424
|
+
streamSync(t = this.cwd, e = {}) {
|
|
2425
|
+
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2426
|
+
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e, h = new V({ objectMode: !0 }), a = /* @__PURE__ */ new Set();
|
|
2427
|
+
(!r || r(t)) && h.write(s ? t : t.fullpath());
|
|
2428
|
+
let l = [t], u = 0, c = () => {
|
|
2429
|
+
let d = !1;
|
|
2430
|
+
for (; !d;) {
|
|
2431
|
+
let f = l.shift();
|
|
2432
|
+
if (!f) {
|
|
2433
|
+
u === 0 && h.end();
|
|
2434
|
+
return;
|
|
2435
|
+
}
|
|
2436
|
+
u++, a.add(f);
|
|
2437
|
+
let m = f.readdirSync();
|
|
2438
|
+
for (let p of m) (!r || r(p)) && (h.write(s ? p : p.fullpath()) || (d = !0));
|
|
2439
|
+
u--;
|
|
2440
|
+
for (let p of m) {
|
|
2441
|
+
let w = p;
|
|
2442
|
+
if (p.isSymbolicLink()) {
|
|
2443
|
+
if (!(i && (w = p.realpathSync()))) continue;
|
|
2444
|
+
w.isUnknown() && w.lstatSync();
|
|
2445
|
+
}
|
|
2446
|
+
w.shouldWalk(a, o) && l.push(w);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
d && !h.flowing && h.once("drain", c);
|
|
2450
|
+
};
|
|
2451
|
+
return c(), h;
|
|
2452
|
+
}
|
|
2453
|
+
chdir(t = this.cwd) {
|
|
2454
|
+
let e = this.cwd;
|
|
2455
|
+
this.cwd = typeof t == "string" ? this.cwd.resolve(t) : t, this.cwd[Ye](e);
|
|
2456
|
+
}
|
|
2457
|
+
}, it = class extends It {
|
|
2458
|
+
sep = "\\";
|
|
2459
|
+
constructor(t = process.cwd(), e = {}) {
|
|
2460
|
+
let { nocase: s = !0 } = e;
|
|
2461
|
+
super(t, win32, "\\", {
|
|
2462
|
+
...e,
|
|
2463
|
+
nocase: s
|
|
2464
|
+
}), this.nocase = s;
|
|
2465
|
+
for (let i = this.cwd; i; i = i.parent) i.nocase = this.nocase;
|
|
2466
|
+
}
|
|
2467
|
+
parseRootPath(t) {
|
|
2468
|
+
return win32.parse(t).root.toUpperCase();
|
|
2469
|
+
}
|
|
2470
|
+
newRoot(t) {
|
|
2471
|
+
return new Pt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
|
|
2472
|
+
}
|
|
2473
|
+
isAbsolute(t) {
|
|
2474
|
+
return t.startsWith("/") || t.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t);
|
|
2475
|
+
}
|
|
2476
|
+
}, rt = class extends It {
|
|
2477
|
+
sep = "/";
|
|
2478
|
+
constructor(t = process.cwd(), e = {}) {
|
|
2479
|
+
let { nocase: s = !1 } = e;
|
|
2480
|
+
super(t, posix, "/", {
|
|
2481
|
+
...e,
|
|
2482
|
+
nocase: s
|
|
2483
|
+
}), this.nocase = s;
|
|
2484
|
+
}
|
|
2485
|
+
parseRootPath(t) {
|
|
2486
|
+
return "/";
|
|
2487
|
+
}
|
|
2488
|
+
newRoot(t) {
|
|
2489
|
+
return new jt(this.rootPath, U, void 0, this.roots, this.nocase, this.childrenCache(), { fs: t });
|
|
2490
|
+
}
|
|
2491
|
+
isAbsolute(t) {
|
|
2492
|
+
return t.startsWith("/");
|
|
2493
|
+
}
|
|
2494
|
+
}, St = class extends rt {
|
|
2495
|
+
constructor(t = process.cwd(), e = {}) {
|
|
2496
|
+
let { nocase: s = !0 } = e;
|
|
2497
|
+
super(t, {
|
|
2498
|
+
...e,
|
|
2499
|
+
nocase: s
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
};
|
|
2503
|
+
process.platform;
|
|
2504
|
+
var Xe = process.platform === "win32" ? it : process.platform === "darwin" ? St : rt;
|
|
2505
|
+
var Di = (n) => n.length >= 1, Mi = (n) => n.length >= 1, Ni = Symbol.for("nodejs.util.inspect.custom"), nt = class n {
|
|
2506
|
+
#t;
|
|
2507
|
+
#s;
|
|
2508
|
+
#n;
|
|
2509
|
+
length;
|
|
2510
|
+
#r;
|
|
2511
|
+
#o;
|
|
2512
|
+
#S;
|
|
2513
|
+
#w;
|
|
2514
|
+
#c;
|
|
2515
|
+
#h;
|
|
2516
|
+
#u = !0;
|
|
2517
|
+
constructor(t, e, s, i) {
|
|
2518
|
+
if (!Di(t)) throw new TypeError("empty pattern list");
|
|
2519
|
+
if (!Mi(e)) throw new TypeError("empty glob list");
|
|
2520
|
+
if (e.length !== t.length) throw new TypeError("mismatched pattern list and glob list lengths");
|
|
2521
|
+
if (this.length = t.length, s < 0 || s >= this.length) throw new TypeError("index out of range");
|
|
2522
|
+
if (this.#t = t, this.#s = e, this.#n = s, this.#r = i, this.#n === 0) {
|
|
2523
|
+
if (this.isUNC()) {
|
|
2524
|
+
let [r, o, h, a, ...l] = this.#t, [u, c, d, f, ...m] = this.#s;
|
|
2525
|
+
l[0] === "" && (l.shift(), m.shift());
|
|
2526
|
+
let p = [
|
|
2527
|
+
r,
|
|
2528
|
+
o,
|
|
2529
|
+
h,
|
|
2530
|
+
a,
|
|
2531
|
+
""
|
|
2532
|
+
].join("/"), w = [
|
|
2533
|
+
u,
|
|
2534
|
+
c,
|
|
2535
|
+
d,
|
|
2536
|
+
f,
|
|
2537
|
+
""
|
|
2538
|
+
].join("/");
|
|
2539
|
+
this.#t = [p, ...l], this.#s = [w, ...m], this.length = this.#t.length;
|
|
2540
|
+
} else if (this.isDrive() || this.isAbsolute()) {
|
|
2541
|
+
let [r, ...o] = this.#t, [h, ...a] = this.#s;
|
|
2542
|
+
o[0] === "" && (o.shift(), a.shift());
|
|
2543
|
+
let l = r + "/", u = h + "/";
|
|
2544
|
+
this.#t = [l, ...o], this.#s = [u, ...a], this.length = this.#t.length;
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
[Ni]() {
|
|
2549
|
+
return "Pattern <" + this.#s.slice(this.#n).join("/") + ">";
|
|
2550
|
+
}
|
|
2551
|
+
pattern() {
|
|
2552
|
+
return this.#t[this.#n];
|
|
2553
|
+
}
|
|
2554
|
+
isString() {
|
|
2555
|
+
return typeof this.#t[this.#n] == "string";
|
|
2556
|
+
}
|
|
2557
|
+
isGlobstar() {
|
|
2558
|
+
return this.#t[this.#n] === A;
|
|
2559
|
+
}
|
|
2560
|
+
isRegExp() {
|
|
2561
|
+
return this.#t[this.#n] instanceof RegExp;
|
|
2562
|
+
}
|
|
2563
|
+
globString() {
|
|
2564
|
+
return this.#S = this.#S || (this.#n === 0 ? this.isAbsolute() ? this.#s[0] + this.#s.slice(1).join("/") : this.#s.join("/") : this.#s.slice(this.#n).join("/"));
|
|
2565
|
+
}
|
|
2566
|
+
hasMore() {
|
|
2567
|
+
return this.length > this.#n + 1;
|
|
2568
|
+
}
|
|
2569
|
+
rest() {
|
|
2570
|
+
return this.#o !== void 0 ? this.#o : this.hasMore() ? (this.#o = new n(this.#t, this.#s, this.#n + 1, this.#r), this.#o.#h = this.#h, this.#o.#c = this.#c, this.#o.#w = this.#w, this.#o) : this.#o = null;
|
|
2571
|
+
}
|
|
2572
|
+
isUNC() {
|
|
2573
|
+
let t = this.#t;
|
|
2574
|
+
return this.#c !== void 0 ? this.#c : this.#c = this.#r === "win32" && this.#n === 0 && t[0] === "" && t[1] === "" && typeof t[2] == "string" && !!t[2] && typeof t[3] == "string" && !!t[3];
|
|
2575
|
+
}
|
|
2576
|
+
isDrive() {
|
|
2577
|
+
let t = this.#t;
|
|
2578
|
+
return this.#w !== void 0 ? this.#w : this.#w = this.#r === "win32" && this.#n === 0 && this.length > 1 && typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]);
|
|
2579
|
+
}
|
|
2580
|
+
isAbsolute() {
|
|
2581
|
+
let t = this.#t;
|
|
2582
|
+
return this.#h !== void 0 ? this.#h : this.#h = t[0] === "" && t.length > 1 || this.isDrive() || this.isUNC();
|
|
2583
|
+
}
|
|
2584
|
+
root() {
|
|
2585
|
+
let t = this.#t[0];
|
|
2586
|
+
return typeof t == "string" && this.isAbsolute() && this.#n === 0 ? t : "";
|
|
2587
|
+
}
|
|
2588
|
+
checkFollowGlobstar() {
|
|
2589
|
+
return !(this.#n === 0 || !this.isGlobstar() || !this.#u);
|
|
2590
|
+
}
|
|
2591
|
+
markFollowGlobstar() {
|
|
2592
|
+
return this.#n === 0 || !this.isGlobstar() || !this.#u ? !1 : (this.#u = !1, !0);
|
|
2593
|
+
}
|
|
2594
|
+
};
|
|
2595
|
+
var _i = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", ot = class {
|
|
2596
|
+
relative;
|
|
2597
|
+
relativeChildren;
|
|
2598
|
+
absolute;
|
|
2599
|
+
absoluteChildren;
|
|
2600
|
+
platform;
|
|
2601
|
+
mmopts;
|
|
2602
|
+
constructor(t, { nobrace: e, nocase: s, noext: i, noglobstar: r, platform: o = _i }) {
|
|
2603
|
+
this.relative = [], this.absolute = [], this.relativeChildren = [], this.absoluteChildren = [], this.platform = o, this.mmopts = {
|
|
2604
|
+
dot: !0,
|
|
2605
|
+
nobrace: e,
|
|
2606
|
+
nocase: s,
|
|
2607
|
+
noext: i,
|
|
2608
|
+
noglobstar: r,
|
|
2609
|
+
optimizationLevel: 2,
|
|
2610
|
+
platform: o,
|
|
2611
|
+
nocomment: !0,
|
|
2612
|
+
nonegate: !0
|
|
2613
|
+
};
|
|
2614
|
+
for (let h of t) this.add(h);
|
|
2615
|
+
}
|
|
2616
|
+
add(t) {
|
|
2617
|
+
let e = new D(t, this.mmopts);
|
|
2618
|
+
for (let s = 0; s < e.set.length; s++) {
|
|
2619
|
+
let i = e.set[s], r = e.globParts[s];
|
|
2620
|
+
if (!i || !r) throw new Error("invalid pattern object");
|
|
2621
|
+
for (; i[0] === "." && r[0] === ".";) i.shift(), r.shift();
|
|
2622
|
+
let o = new nt(i, r, 0, this.platform), h = new D(o.globString(), this.mmopts), a = r[r.length - 1] === "**", l = o.isAbsolute();
|
|
2623
|
+
l ? this.absolute.push(h) : this.relative.push(h), a && (l ? this.absoluteChildren.push(h) : this.relativeChildren.push(h));
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
ignored(t) {
|
|
2627
|
+
let e = t.fullpath(), s = `${e}/`, i = t.relative() || ".", r = `${i}/`;
|
|
2628
|
+
for (let o of this.relative) if (o.match(i) || o.match(r)) return !0;
|
|
2629
|
+
for (let o of this.absolute) if (o.match(e) || o.match(s)) return !0;
|
|
2630
|
+
return !1;
|
|
2631
|
+
}
|
|
2632
|
+
childrenIgnored(t) {
|
|
2633
|
+
let e = t.fullpath() + "/", s = (t.relative() || ".") + "/";
|
|
2634
|
+
for (let i of this.relativeChildren) if (i.match(s)) return !0;
|
|
2635
|
+
for (let i of this.absoluteChildren) if (i.match(e)) return !0;
|
|
2636
|
+
return !1;
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
var oe = class n {
|
|
2640
|
+
store;
|
|
2641
|
+
constructor(t = /* @__PURE__ */ new Map()) {
|
|
2642
|
+
this.store = t;
|
|
2643
|
+
}
|
|
2644
|
+
copy() {
|
|
2645
|
+
return new n(new Map(this.store));
|
|
2646
|
+
}
|
|
2647
|
+
hasWalked(t, e) {
|
|
2648
|
+
return this.store.get(t.fullpath())?.has(e.globString());
|
|
2649
|
+
}
|
|
2650
|
+
storeWalked(t, e) {
|
|
2651
|
+
let s = t.fullpath(), i = this.store.get(s);
|
|
2652
|
+
i ? i.add(e.globString()) : this.store.set(s, new Set([e.globString()]));
|
|
2653
|
+
}
|
|
2654
|
+
}, he = class {
|
|
2655
|
+
store = /* @__PURE__ */ new Map();
|
|
2656
|
+
add(t, e, s) {
|
|
2657
|
+
let i = (e ? 2 : 0) | (s ? 1 : 0), r = this.store.get(t);
|
|
2658
|
+
this.store.set(t, r === void 0 ? i : i & r);
|
|
2659
|
+
}
|
|
2660
|
+
entries() {
|
|
2661
|
+
return [...this.store.entries()].map(([t, e]) => [
|
|
2662
|
+
t,
|
|
2663
|
+
!!(e & 2),
|
|
2664
|
+
!!(e & 1)
|
|
2665
|
+
]);
|
|
2666
|
+
}
|
|
2667
|
+
}, ae = class {
|
|
2668
|
+
store = /* @__PURE__ */ new Map();
|
|
2669
|
+
add(t, e) {
|
|
2670
|
+
if (!t.canReaddir()) return;
|
|
2671
|
+
let s = this.store.get(t);
|
|
2672
|
+
s ? s.find((i) => i.globString() === e.globString()) || s.push(e) : this.store.set(t, [e]);
|
|
2673
|
+
}
|
|
2674
|
+
get(t) {
|
|
2675
|
+
let e = this.store.get(t);
|
|
2676
|
+
if (!e) throw new Error("attempting to walk unknown path");
|
|
2677
|
+
return e;
|
|
2678
|
+
}
|
|
2679
|
+
entries() {
|
|
2680
|
+
return this.keys().map((t) => [t, this.store.get(t)]);
|
|
2681
|
+
}
|
|
2682
|
+
keys() {
|
|
2683
|
+
return [...this.store.keys()].filter((t) => t.canReaddir());
|
|
2684
|
+
}
|
|
2685
|
+
}, Et = class n {
|
|
2686
|
+
hasWalkedCache;
|
|
2687
|
+
matches = new he();
|
|
2688
|
+
subwalks = new ae();
|
|
2689
|
+
patterns;
|
|
2690
|
+
follow;
|
|
2691
|
+
dot;
|
|
2692
|
+
opts;
|
|
2693
|
+
constructor(t, e) {
|
|
2694
|
+
this.opts = t, this.follow = !!t.follow, this.dot = !!t.dot, this.hasWalkedCache = e ? e.copy() : new oe();
|
|
2695
|
+
}
|
|
2696
|
+
processPatterns(t, e) {
|
|
2697
|
+
this.patterns = e;
|
|
2698
|
+
let s = e.map((i) => [t, i]);
|
|
2699
|
+
for (let [i, r] of s) {
|
|
2700
|
+
this.hasWalkedCache.storeWalked(i, r);
|
|
2701
|
+
let o = r.root(), h = r.isAbsolute() && this.opts.absolute !== !1;
|
|
2702
|
+
if (o) {
|
|
2703
|
+
i = i.resolve(o === "/" && this.opts.root !== void 0 ? this.opts.root : o);
|
|
2704
|
+
let c = r.rest();
|
|
2705
|
+
if (c) r = c;
|
|
2706
|
+
else {
|
|
2707
|
+
this.matches.add(i, !0, !1);
|
|
2708
|
+
continue;
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
if (i.isENOENT()) continue;
|
|
2712
|
+
let a, l, u = !1;
|
|
2713
|
+
for (; typeof (a = r.pattern()) == "string" && (l = r.rest());) i = i.resolve(a), r = l, u = !0;
|
|
2714
|
+
if (a = r.pattern(), l = r.rest(), u) {
|
|
2715
|
+
if (this.hasWalkedCache.hasWalked(i, r)) continue;
|
|
2716
|
+
this.hasWalkedCache.storeWalked(i, r);
|
|
2717
|
+
}
|
|
2718
|
+
if (typeof a == "string") {
|
|
2719
|
+
let c = a === ".." || a === "" || a === ".";
|
|
2720
|
+
this.matches.add(i.resolve(a), h, c);
|
|
2721
|
+
continue;
|
|
2722
|
+
} else if (a === A) {
|
|
2723
|
+
(!i.isSymbolicLink() || this.follow || r.checkFollowGlobstar()) && this.subwalks.add(i, r);
|
|
2724
|
+
let c = l?.pattern(), d = l?.rest();
|
|
2725
|
+
if (!l || (c === "" || c === ".") && !d) this.matches.add(i, h, c === "" || c === ".");
|
|
2726
|
+
else if (c === "..") {
|
|
2727
|
+
let f = i.parent || i;
|
|
2728
|
+
d ? this.hasWalkedCache.hasWalked(f, d) || this.subwalks.add(f, d) : this.matches.add(f, h, !0);
|
|
2729
|
+
}
|
|
2730
|
+
} else a instanceof RegExp && this.subwalks.add(i, r);
|
|
2731
|
+
}
|
|
2732
|
+
return this;
|
|
2733
|
+
}
|
|
2734
|
+
subwalkTargets() {
|
|
2735
|
+
return this.subwalks.keys();
|
|
2736
|
+
}
|
|
2737
|
+
child() {
|
|
2738
|
+
return new n(this.opts, this.hasWalkedCache);
|
|
2739
|
+
}
|
|
2740
|
+
filterEntries(t, e) {
|
|
2741
|
+
let s = this.subwalks.get(t), i = this.child();
|
|
2742
|
+
for (let r of e) for (let o of s) {
|
|
2743
|
+
let h = o.isAbsolute(), a = o.pattern(), l = o.rest();
|
|
2744
|
+
a === A ? i.testGlobstar(r, o, l, h) : a instanceof RegExp ? i.testRegExp(r, a, l, h) : i.testString(r, a, l, h);
|
|
2745
|
+
}
|
|
2746
|
+
return i;
|
|
2747
|
+
}
|
|
2748
|
+
testGlobstar(t, e, s, i) {
|
|
2749
|
+
if ((this.dot || !t.name.startsWith(".")) && (e.hasMore() || this.matches.add(t, i, !1), t.canReaddir() && (this.follow || !t.isSymbolicLink() ? this.subwalks.add(t, e) : t.isSymbolicLink() && (s && e.checkFollowGlobstar() ? this.subwalks.add(t, s) : e.markFollowGlobstar() && this.subwalks.add(t, e)))), s) {
|
|
2750
|
+
let r = s.pattern();
|
|
2751
|
+
if (typeof r == "string" && r !== ".." && r !== "" && r !== ".") this.testString(t, r, s.rest(), i);
|
|
2752
|
+
else if (r === "..") {
|
|
2753
|
+
let o = t.parent || t;
|
|
2754
|
+
this.subwalks.add(o, s);
|
|
2755
|
+
} else r instanceof RegExp && this.testRegExp(t, r, s.rest(), i);
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
testRegExp(t, e, s, i) {
|
|
2759
|
+
e.test(t.name) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, !1));
|
|
2760
|
+
}
|
|
2761
|
+
testString(t, e, s, i) {
|
|
2762
|
+
t.isNamed(e) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, !1));
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
2765
|
+
var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? new ot(n, t) : n, zt = class {
|
|
2766
|
+
path;
|
|
2767
|
+
patterns;
|
|
2768
|
+
opts;
|
|
2769
|
+
seen = /* @__PURE__ */ new Set();
|
|
2770
|
+
paused = !1;
|
|
2771
|
+
aborted = !1;
|
|
2772
|
+
#t = [];
|
|
2773
|
+
#s;
|
|
2774
|
+
#n;
|
|
2775
|
+
signal;
|
|
2776
|
+
maxDepth;
|
|
2777
|
+
includeChildMatches;
|
|
2778
|
+
constructor(t, e, s) {
|
|
2779
|
+
if (this.patterns = t, this.path = e, this.opts = s, this.#n = !s.posix && s.platform === "win32" ? "\\" : "/", this.includeChildMatches = s.includeChildMatches !== !1, (s.ignore || !this.includeChildMatches) && (this.#s = Li(s.ignore ?? [], s), !this.includeChildMatches && typeof this.#s.add != "function")) throw new Error("cannot ignore child matches, ignore lacks add() method.");
|
|
2780
|
+
this.maxDepth = s.maxDepth || Infinity, s.signal && (this.signal = s.signal, this.signal.addEventListener("abort", () => {
|
|
2781
|
+
this.#t.length = 0;
|
|
2782
|
+
}));
|
|
2783
|
+
}
|
|
2784
|
+
#r(t) {
|
|
2785
|
+
return this.seen.has(t) || !!this.#s?.ignored?.(t);
|
|
2786
|
+
}
|
|
2787
|
+
#o(t) {
|
|
2788
|
+
return !!this.#s?.childrenIgnored?.(t);
|
|
2789
|
+
}
|
|
2790
|
+
pause() {
|
|
2791
|
+
this.paused = !0;
|
|
2792
|
+
}
|
|
2793
|
+
resume() {
|
|
2794
|
+
if (this.signal?.aborted) return;
|
|
2795
|
+
this.paused = !1;
|
|
2796
|
+
let t;
|
|
2797
|
+
for (; !this.paused && (t = this.#t.shift());) t();
|
|
2798
|
+
}
|
|
2799
|
+
onResume(t) {
|
|
2800
|
+
this.signal?.aborted || (this.paused ? this.#t.push(t) : t());
|
|
2801
|
+
}
|
|
2802
|
+
async matchCheck(t, e) {
|
|
2803
|
+
if (e && this.opts.nodir) return;
|
|
2804
|
+
let s;
|
|
2805
|
+
if (this.opts.realpath) {
|
|
2806
|
+
if (s = t.realpathCached() || await t.realpath(), !s) return;
|
|
2807
|
+
t = s;
|
|
2808
|
+
}
|
|
2809
|
+
let r = t.isUnknown() || this.opts.stat ? await t.lstat() : t;
|
|
2810
|
+
if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) {
|
|
2811
|
+
let o = await r.realpath();
|
|
2812
|
+
o && (o.isUnknown() || this.opts.stat) && await o.lstat();
|
|
2813
|
+
}
|
|
2814
|
+
return this.matchCheckTest(r, e);
|
|
2815
|
+
}
|
|
2816
|
+
matchCheckTest(t, e) {
|
|
2817
|
+
return t && (this.maxDepth === Infinity || t.depth() <= this.maxDepth) && (!e || t.canReaddir()) && (!this.opts.nodir || !t.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !t.isSymbolicLink() || !t.realpathCached()?.isDirectory()) && !this.#r(t) ? t : void 0;
|
|
2818
|
+
}
|
|
2819
|
+
matchCheckSync(t, e) {
|
|
2820
|
+
if (e && this.opts.nodir) return;
|
|
2821
|
+
let s;
|
|
2822
|
+
if (this.opts.realpath) {
|
|
2823
|
+
if (s = t.realpathCached() || t.realpathSync(), !s) return;
|
|
2824
|
+
t = s;
|
|
2825
|
+
}
|
|
2826
|
+
let r = t.isUnknown() || this.opts.stat ? t.lstatSync() : t;
|
|
2827
|
+
if (this.opts.follow && this.opts.nodir && r?.isSymbolicLink()) {
|
|
2828
|
+
let o = r.realpathSync();
|
|
2829
|
+
o && (o?.isUnknown() || this.opts.stat) && o.lstatSync();
|
|
2830
|
+
}
|
|
2831
|
+
return this.matchCheckTest(r, e);
|
|
2832
|
+
}
|
|
2833
|
+
matchFinish(t, e) {
|
|
2834
|
+
if (this.#r(t)) return;
|
|
2835
|
+
if (!this.includeChildMatches && this.#s?.add) {
|
|
2836
|
+
let r = `${t.relativePosix()}/**`;
|
|
2837
|
+
this.#s.add(r);
|
|
2838
|
+
}
|
|
2839
|
+
let s = this.opts.absolute === void 0 ? e : this.opts.absolute;
|
|
2840
|
+
this.seen.add(t);
|
|
2841
|
+
let i = this.opts.mark && t.isDirectory() ? this.#n : "";
|
|
2842
|
+
if (this.opts.withFileTypes) this.matchEmit(t);
|
|
2843
|
+
else if (s) {
|
|
2844
|
+
let r = this.opts.posix ? t.fullpathPosix() : t.fullpath();
|
|
2845
|
+
this.matchEmit(r + i);
|
|
2846
|
+
} else {
|
|
2847
|
+
let r = this.opts.posix ? t.relativePosix() : t.relative(), o = this.opts.dotRelative && !r.startsWith(".." + this.#n) ? "." + this.#n : "";
|
|
2848
|
+
this.matchEmit(r ? o + r + i : "." + i);
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
async match(t, e, s) {
|
|
2852
|
+
let i = await this.matchCheck(t, s);
|
|
2853
|
+
i && this.matchFinish(i, e);
|
|
2854
|
+
}
|
|
2855
|
+
matchSync(t, e, s) {
|
|
2856
|
+
let i = this.matchCheckSync(t, s);
|
|
2857
|
+
i && this.matchFinish(i, e);
|
|
2858
|
+
}
|
|
2859
|
+
walkCB(t, e, s) {
|
|
2860
|
+
this.signal?.aborted && s(), this.walkCB2(t, e, new Et(this.opts), s);
|
|
2861
|
+
}
|
|
2862
|
+
walkCB2(t, e, s, i) {
|
|
2863
|
+
if (this.#o(t)) return i();
|
|
2864
|
+
if (this.signal?.aborted && i(), this.paused) {
|
|
2865
|
+
this.onResume(() => this.walkCB2(t, e, s, i));
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
s.processPatterns(t, e);
|
|
2869
|
+
let r = 1, o = () => {
|
|
2870
|
+
--r === 0 && i();
|
|
2871
|
+
};
|
|
2872
|
+
for (let [h, a, l] of s.matches.entries()) this.#r(h) || (r++, this.match(h, a, l).then(() => o()));
|
|
2873
|
+
for (let h of s.subwalkTargets()) {
|
|
2874
|
+
if (this.maxDepth !== Infinity && h.depth() >= this.maxDepth) continue;
|
|
2875
|
+
r++;
|
|
2876
|
+
let a = h.readdirCached();
|
|
2877
|
+
h.calledReaddir() ? this.walkCB3(h, a, s, o) : h.readdirCB((l, u) => this.walkCB3(h, u, s, o), !0);
|
|
2878
|
+
}
|
|
2879
|
+
o();
|
|
2880
|
+
}
|
|
2881
|
+
walkCB3(t, e, s, i) {
|
|
2882
|
+
s = s.filterEntries(t, e);
|
|
2883
|
+
let r = 1, o = () => {
|
|
2884
|
+
--r === 0 && i();
|
|
2885
|
+
};
|
|
2886
|
+
for (let [h, a, l] of s.matches.entries()) this.#r(h) || (r++, this.match(h, a, l).then(() => o()));
|
|
2887
|
+
for (let [h, a] of s.subwalks.entries()) r++, this.walkCB2(h, a, s.child(), o);
|
|
2888
|
+
o();
|
|
2889
|
+
}
|
|
2890
|
+
walkCBSync(t, e, s) {
|
|
2891
|
+
this.signal?.aborted && s(), this.walkCB2Sync(t, e, new Et(this.opts), s);
|
|
2892
|
+
}
|
|
2893
|
+
walkCB2Sync(t, e, s, i) {
|
|
2894
|
+
if (this.#o(t)) return i();
|
|
2895
|
+
if (this.signal?.aborted && i(), this.paused) {
|
|
2896
|
+
this.onResume(() => this.walkCB2Sync(t, e, s, i));
|
|
2897
|
+
return;
|
|
2898
|
+
}
|
|
2899
|
+
s.processPatterns(t, e);
|
|
2900
|
+
let r = 1, o = () => {
|
|
2901
|
+
--r === 0 && i();
|
|
2902
|
+
};
|
|
2903
|
+
for (let [h, a, l] of s.matches.entries()) this.#r(h) || this.matchSync(h, a, l);
|
|
2904
|
+
for (let h of s.subwalkTargets()) {
|
|
2905
|
+
if (this.maxDepth !== Infinity && h.depth() >= this.maxDepth) continue;
|
|
2906
|
+
r++;
|
|
2907
|
+
let a = h.readdirSync();
|
|
2908
|
+
this.walkCB3Sync(h, a, s, o);
|
|
2909
|
+
}
|
|
2910
|
+
o();
|
|
2911
|
+
}
|
|
2912
|
+
walkCB3Sync(t, e, s, i) {
|
|
2913
|
+
s = s.filterEntries(t, e);
|
|
2914
|
+
let r = 1, o = () => {
|
|
2915
|
+
--r === 0 && i();
|
|
2916
|
+
};
|
|
2917
|
+
for (let [h, a, l] of s.matches.entries()) this.#r(h) || this.matchSync(h, a, l);
|
|
2918
|
+
for (let [h, a] of s.subwalks.entries()) r++, this.walkCB2Sync(h, a, s.child(), o);
|
|
2919
|
+
o();
|
|
2920
|
+
}
|
|
2921
|
+
}, xt = class extends zt {
|
|
2922
|
+
matches = /* @__PURE__ */ new Set();
|
|
2923
|
+
constructor(t, e, s) {
|
|
2924
|
+
super(t, e, s);
|
|
2925
|
+
}
|
|
2926
|
+
matchEmit(t) {
|
|
2927
|
+
this.matches.add(t);
|
|
2928
|
+
}
|
|
2929
|
+
async walk() {
|
|
2930
|
+
if (this.signal?.aborted) throw this.signal.reason;
|
|
2931
|
+
return this.path.isUnknown() && await this.path.lstat(), await new Promise((t, e) => {
|
|
2932
|
+
this.walkCB(this.path, this.patterns, () => {
|
|
2933
|
+
this.signal?.aborted ? e(this.signal.reason) : t(this.matches);
|
|
2934
|
+
});
|
|
2935
|
+
}), this.matches;
|
|
2936
|
+
}
|
|
2937
|
+
walkSync() {
|
|
2938
|
+
if (this.signal?.aborted) throw this.signal.reason;
|
|
2939
|
+
return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => {
|
|
2940
|
+
if (this.signal?.aborted) throw this.signal.reason;
|
|
2941
|
+
}), this.matches;
|
|
2942
|
+
}
|
|
2943
|
+
}, vt = class extends zt {
|
|
2944
|
+
results;
|
|
2945
|
+
constructor(t, e, s) {
|
|
2946
|
+
super(t, e, s), this.results = new V({
|
|
2947
|
+
signal: this.signal,
|
|
2948
|
+
objectMode: !0
|
|
2949
|
+
}), this.results.on("drain", () => this.resume()), this.results.on("resume", () => this.resume());
|
|
2950
|
+
}
|
|
2951
|
+
matchEmit(t) {
|
|
2952
|
+
this.results.write(t), this.results.flowing || this.pause();
|
|
2953
|
+
}
|
|
2954
|
+
stream() {
|
|
2955
|
+
let t = this.path;
|
|
2956
|
+
return t.isUnknown() ? t.lstat().then(() => {
|
|
2957
|
+
this.walkCB(t, this.patterns, () => this.results.end());
|
|
2958
|
+
}) : this.walkCB(t, this.patterns, () => this.results.end()), this.results;
|
|
2959
|
+
}
|
|
2960
|
+
streamSync() {
|
|
2961
|
+
return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results;
|
|
2962
|
+
}
|
|
2963
|
+
};
|
|
2964
|
+
var Pi = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", I = class {
|
|
2965
|
+
absolute;
|
|
2966
|
+
cwd;
|
|
2967
|
+
root;
|
|
2968
|
+
dot;
|
|
2969
|
+
dotRelative;
|
|
2970
|
+
follow;
|
|
2971
|
+
ignore;
|
|
2972
|
+
magicalBraces;
|
|
2973
|
+
mark;
|
|
2974
|
+
matchBase;
|
|
2975
|
+
maxDepth;
|
|
2976
|
+
nobrace;
|
|
2977
|
+
nocase;
|
|
2978
|
+
nodir;
|
|
2979
|
+
noext;
|
|
2980
|
+
noglobstar;
|
|
2981
|
+
pattern;
|
|
2982
|
+
platform;
|
|
2983
|
+
realpath;
|
|
2984
|
+
scurry;
|
|
2985
|
+
stat;
|
|
2986
|
+
signal;
|
|
2987
|
+
windowsPathsNoEscape;
|
|
2988
|
+
withFileTypes;
|
|
2989
|
+
includeChildMatches;
|
|
2990
|
+
opts;
|
|
2991
|
+
patterns;
|
|
2992
|
+
constructor(t, e) {
|
|
2993
|
+
if (!e) throw new TypeError("glob options required");
|
|
2994
|
+
if (this.withFileTypes = !!e.withFileTypes, this.signal = e.signal, this.follow = !!e.follow, this.dot = !!e.dot, this.dotRelative = !!e.dotRelative, this.nodir = !!e.nodir, this.mark = !!e.mark, e.cwd ? (e.cwd instanceof URL || e.cwd.startsWith("file://")) && (e.cwd = fileURLToPath(e.cwd)) : this.cwd = "", this.cwd = e.cwd || "", this.root = e.root, this.magicalBraces = !!e.magicalBraces, this.nobrace = !!e.nobrace, this.noext = !!e.noext, this.realpath = !!e.realpath, this.absolute = e.absolute, this.includeChildMatches = e.includeChildMatches !== !1, this.noglobstar = !!e.noglobstar, this.matchBase = !!e.matchBase, this.maxDepth = typeof e.maxDepth == "number" ? e.maxDepth : Infinity, this.stat = !!e.stat, this.ignore = e.ignore, this.withFileTypes && this.absolute !== void 0) throw new Error("cannot set absolute and withFileTypes:true");
|
|
2995
|
+
if (typeof t == "string" && (t = [t]), this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (t = t.map((a) => a.replace(/\\/g, "/"))), this.matchBase) {
|
|
2996
|
+
if (e.noglobstar) throw new TypeError("base matching requires globstar");
|
|
2997
|
+
t = t.map((a) => a.includes("/") ? a : `./**/${a}`);
|
|
2998
|
+
}
|
|
2999
|
+
if (this.pattern = t, this.platform = e.platform || Pi, this.opts = {
|
|
3000
|
+
...e,
|
|
3001
|
+
platform: this.platform
|
|
3002
|
+
}, e.scurry) {
|
|
3003
|
+
if (this.scurry = e.scurry, e.nocase !== void 0 && e.nocase !== e.scurry.nocase) throw new Error("nocase option contradicts provided scurry option");
|
|
3004
|
+
} else this.scurry = new (e.platform === "win32" ? it : e.platform === "darwin" ? St : e.platform ? rt : Xe)(this.cwd, {
|
|
3005
|
+
nocase: e.nocase,
|
|
3006
|
+
fs: e.fs
|
|
3007
|
+
});
|
|
3008
|
+
this.nocase = this.scurry.nocase;
|
|
3009
|
+
let s = this.platform === "darwin" || this.platform === "win32", i = {
|
|
3010
|
+
braceExpandMax: 1e4,
|
|
3011
|
+
...e,
|
|
3012
|
+
dot: this.dot,
|
|
3013
|
+
matchBase: this.matchBase,
|
|
3014
|
+
nobrace: this.nobrace,
|
|
3015
|
+
nocase: this.nocase,
|
|
3016
|
+
nocaseMagicOnly: s,
|
|
3017
|
+
nocomment: !0,
|
|
3018
|
+
noext: this.noext,
|
|
3019
|
+
nonegate: !0,
|
|
3020
|
+
optimizationLevel: 2,
|
|
3021
|
+
platform: this.platform,
|
|
3022
|
+
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
|
3023
|
+
debug: !!this.opts.debug
|
|
3024
|
+
}, [o, h] = this.pattern.map((a) => new D(a, i)).reduce((a, l) => (a[0].push(...l.set), a[1].push(...l.globParts), a), [[], []]);
|
|
3025
|
+
this.patterns = o.map((a, l) => {
|
|
3026
|
+
let u = h[l];
|
|
3027
|
+
if (!u) throw new Error("invalid pattern object");
|
|
3028
|
+
return new nt(a, u, 0, this.platform);
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
async walk() {
|
|
3032
|
+
return [...await new xt(this.patterns, this.scurry.cwd, {
|
|
3033
|
+
...this.opts,
|
|
3034
|
+
maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
|
|
3035
|
+
platform: this.platform,
|
|
3036
|
+
nocase: this.nocase,
|
|
3037
|
+
includeChildMatches: this.includeChildMatches
|
|
3038
|
+
}).walk()];
|
|
3039
|
+
}
|
|
3040
|
+
walkSync() {
|
|
3041
|
+
return [...new xt(this.patterns, this.scurry.cwd, {
|
|
3042
|
+
...this.opts,
|
|
3043
|
+
maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
|
|
3044
|
+
platform: this.platform,
|
|
3045
|
+
nocase: this.nocase,
|
|
3046
|
+
includeChildMatches: this.includeChildMatches
|
|
3047
|
+
}).walkSync()];
|
|
3048
|
+
}
|
|
3049
|
+
stream() {
|
|
3050
|
+
return new vt(this.patterns, this.scurry.cwd, {
|
|
3051
|
+
...this.opts,
|
|
3052
|
+
maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
|
|
3053
|
+
platform: this.platform,
|
|
3054
|
+
nocase: this.nocase,
|
|
3055
|
+
includeChildMatches: this.includeChildMatches
|
|
3056
|
+
}).stream();
|
|
3057
|
+
}
|
|
3058
|
+
streamSync() {
|
|
3059
|
+
return new vt(this.patterns, this.scurry.cwd, {
|
|
3060
|
+
...this.opts,
|
|
3061
|
+
maxDepth: this.maxDepth !== Infinity ? this.maxDepth + this.scurry.cwd.depth() : Infinity,
|
|
3062
|
+
platform: this.platform,
|
|
3063
|
+
nocase: this.nocase,
|
|
3064
|
+
includeChildMatches: this.includeChildMatches
|
|
3065
|
+
}).streamSync();
|
|
3066
|
+
}
|
|
3067
|
+
iterateSync() {
|
|
3068
|
+
return this.streamSync()[Symbol.iterator]();
|
|
3069
|
+
}
|
|
3070
|
+
[Symbol.iterator]() {
|
|
3071
|
+
return this.iterateSync();
|
|
3072
|
+
}
|
|
3073
|
+
iterate() {
|
|
3074
|
+
return this.stream()[Symbol.asyncIterator]();
|
|
3075
|
+
}
|
|
3076
|
+
[Symbol.asyncIterator]() {
|
|
3077
|
+
return this.iterate();
|
|
3078
|
+
}
|
|
3079
|
+
};
|
|
3080
|
+
var le = (n, t = {}) => {
|
|
3081
|
+
Array.isArray(n) || (n = [n]);
|
|
3082
|
+
for (let e of n) if (new D(e, t).hasMagic()) return !0;
|
|
3083
|
+
return !1;
|
|
3084
|
+
};
|
|
3085
|
+
function Bt(n, t = {}) {
|
|
3086
|
+
return new I(n, t).streamSync();
|
|
3087
|
+
}
|
|
3088
|
+
function Qe(n, t = {}) {
|
|
3089
|
+
return new I(n, t).stream();
|
|
3090
|
+
}
|
|
3091
|
+
function ts(n, t = {}) {
|
|
3092
|
+
return new I(n, t).walkSync();
|
|
3093
|
+
}
|
|
3094
|
+
async function Je(n, t = {}) {
|
|
3095
|
+
return new I(n, t).walk();
|
|
3096
|
+
}
|
|
3097
|
+
function Ut(n, t = {}) {
|
|
3098
|
+
return new I(n, t).iterateSync();
|
|
3099
|
+
}
|
|
3100
|
+
function es(n, t = {}) {
|
|
3101
|
+
return new I(n, t).iterate();
|
|
3102
|
+
}
|
|
3103
|
+
var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(es, { sync: Ut }), Ui = Object.assign(ts, {
|
|
3104
|
+
stream: Bt,
|
|
3105
|
+
iterate: Ut
|
|
3106
|
+
}), Ze = Object.assign(Je, {
|
|
3107
|
+
glob: Je,
|
|
3108
|
+
globSync: ts,
|
|
3109
|
+
sync: Ui,
|
|
3110
|
+
globStream: Qe,
|
|
3111
|
+
stream: Ii,
|
|
3112
|
+
globStreamSync: Bt,
|
|
3113
|
+
streamSync: ji,
|
|
3114
|
+
globIterate: es,
|
|
3115
|
+
iterate: Bi,
|
|
3116
|
+
globIterateSync: Ut,
|
|
3117
|
+
iterateSync: zi,
|
|
3118
|
+
Glob: I,
|
|
3119
|
+
hasMagic: le,
|
|
3120
|
+
escape: tt,
|
|
3121
|
+
unescape: W
|
|
3122
|
+
});
|
|
3123
|
+
Ze.glob = Ze;
|
|
3124
|
+
//#endregion
|
|
3125
|
+
export { Ze };
|