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,85 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_cst_scalar } from "./cst-scalar.mjs";
|
|
3
|
+
import { require_cst_stringify } from "./cst-stringify.mjs";
|
|
4
|
+
import { require_cst_visit } from "./cst-visit.mjs";
|
|
5
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js
|
|
6
|
+
var require_cst = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7
|
+
var cstScalar = require_cst_scalar();
|
|
8
|
+
var cstStringify = require_cst_stringify();
|
|
9
|
+
var cstVisit = require_cst_visit();
|
|
10
|
+
/** The byte order mark */
|
|
11
|
+
const BOM = "";
|
|
12
|
+
/** Start of doc-mode */
|
|
13
|
+
const DOCUMENT = "";
|
|
14
|
+
/** Unexpected end of flow-mode */
|
|
15
|
+
const FLOW_END = "";
|
|
16
|
+
/** Next token is a scalar value */
|
|
17
|
+
const SCALAR = "";
|
|
18
|
+
/** @returns `true` if `token` is a flow or block collection */
|
|
19
|
+
const isCollection = (token) => !!token && "items" in token;
|
|
20
|
+
/** @returns `true` if `token` is a flow or block scalar; not an alias */
|
|
21
|
+
const isScalar = (token) => !!token && (token.type === "scalar" || token.type === "single-quoted-scalar" || token.type === "double-quoted-scalar" || token.type === "block-scalar");
|
|
22
|
+
/* istanbul ignore next */
|
|
23
|
+
/** Get a printable representation of a lexer token */
|
|
24
|
+
function prettyToken(token) {
|
|
25
|
+
switch (token) {
|
|
26
|
+
case BOM: return "<BOM>";
|
|
27
|
+
case DOCUMENT: return "<DOC>";
|
|
28
|
+
case FLOW_END: return "<FLOW_END>";
|
|
29
|
+
case SCALAR: return "<SCALAR>";
|
|
30
|
+
default: return JSON.stringify(token);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Identify the type of a lexer token. May return `null` for unknown tokens. */
|
|
34
|
+
function tokenType(source) {
|
|
35
|
+
switch (source) {
|
|
36
|
+
case BOM: return "byte-order-mark";
|
|
37
|
+
case DOCUMENT: return "doc-mode";
|
|
38
|
+
case FLOW_END: return "flow-error-end";
|
|
39
|
+
case SCALAR: return "scalar";
|
|
40
|
+
case "---": return "doc-start";
|
|
41
|
+
case "...": return "doc-end";
|
|
42
|
+
case "":
|
|
43
|
+
case "\n":
|
|
44
|
+
case "\r\n": return "newline";
|
|
45
|
+
case "-": return "seq-item-ind";
|
|
46
|
+
case "?": return "explicit-key-ind";
|
|
47
|
+
case ":": return "map-value-ind";
|
|
48
|
+
case "{": return "flow-map-start";
|
|
49
|
+
case "}": return "flow-map-end";
|
|
50
|
+
case "[": return "flow-seq-start";
|
|
51
|
+
case "]": return "flow-seq-end";
|
|
52
|
+
case ",": return "comma";
|
|
53
|
+
}
|
|
54
|
+
switch (source[0]) {
|
|
55
|
+
case " ":
|
|
56
|
+
case " ": return "space";
|
|
57
|
+
case "#": return "comment";
|
|
58
|
+
case "%": return "directive-line";
|
|
59
|
+
case "*": return "alias";
|
|
60
|
+
case "&": return "anchor";
|
|
61
|
+
case "!": return "tag";
|
|
62
|
+
case "'": return "single-quoted-scalar";
|
|
63
|
+
case "\"": return "double-quoted-scalar";
|
|
64
|
+
case "|":
|
|
65
|
+
case ">": return "block-scalar-header";
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
exports.createScalarToken = cstScalar.createScalarToken;
|
|
70
|
+
exports.resolveAsScalar = cstScalar.resolveAsScalar;
|
|
71
|
+
exports.setScalarValue = cstScalar.setScalarValue;
|
|
72
|
+
exports.stringify = cstStringify.stringify;
|
|
73
|
+
exports.visit = cstVisit.visit;
|
|
74
|
+
exports.BOM = BOM;
|
|
75
|
+
exports.DOCUMENT = DOCUMENT;
|
|
76
|
+
exports.FLOW_END = FLOW_END;
|
|
77
|
+
exports.SCALAR = SCALAR;
|
|
78
|
+
exports.isCollection = isCollection;
|
|
79
|
+
exports.isScalar = isScalar;
|
|
80
|
+
exports.prettyToken = prettyToken;
|
|
81
|
+
exports.tokenType = tokenType;
|
|
82
|
+
}));
|
|
83
|
+
//#endregion
|
|
84
|
+
export default require_cst();
|
|
85
|
+
export { require_cst };
|
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_cst } from "./cst.mjs";
|
|
3
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js
|
|
4
|
+
var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var cst = require_cst();
|
|
6
|
+
function isEmpty(ch) {
|
|
7
|
+
switch (ch) {
|
|
8
|
+
case void 0:
|
|
9
|
+
case " ":
|
|
10
|
+
case "\n":
|
|
11
|
+
case "\r":
|
|
12
|
+
case " ": return true;
|
|
13
|
+
default: return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const hexDigits = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef");
|
|
17
|
+
const tagChars = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
|
|
18
|
+
const flowIndicatorChars = /* @__PURE__ */ new Set(",[]{}");
|
|
19
|
+
const invalidAnchorChars = /* @__PURE__ */ new Set(" ,[]{}\n\r ");
|
|
20
|
+
const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
|
|
21
|
+
/**
|
|
22
|
+
* Splits an input string into lexical tokens, i.e. smaller strings that are
|
|
23
|
+
* easily identifiable by `tokens.tokenType()`.
|
|
24
|
+
*
|
|
25
|
+
* Lexing starts always in a "stream" context. Incomplete input may be buffered
|
|
26
|
+
* until a complete token can be emitted.
|
|
27
|
+
*
|
|
28
|
+
* In addition to slices of the original input, the following control characters
|
|
29
|
+
* may also be emitted:
|
|
30
|
+
*
|
|
31
|
+
* - `\x02` (Start of Text): A document starts with the next token
|
|
32
|
+
* - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error)
|
|
33
|
+
* - `\x1f` (Unit Separator): Next token is a scalar value
|
|
34
|
+
* - `\u{FEFF}` (Byte order mark): Emitted separately outside documents
|
|
35
|
+
*/
|
|
36
|
+
var Lexer = class {
|
|
37
|
+
constructor() {
|
|
38
|
+
/**
|
|
39
|
+
* Flag indicating whether the end of the current buffer marks the end of
|
|
40
|
+
* all input
|
|
41
|
+
*/
|
|
42
|
+
this.atEnd = false;
|
|
43
|
+
/**
|
|
44
|
+
* Explicit indent set in block scalar header, as an offset from the current
|
|
45
|
+
* minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not
|
|
46
|
+
* explicitly set.
|
|
47
|
+
*/
|
|
48
|
+
this.blockScalarIndent = -1;
|
|
49
|
+
/**
|
|
50
|
+
* Block scalars that include a + (keep) chomping indicator in their header
|
|
51
|
+
* include trailing empty lines, which are otherwise excluded from the
|
|
52
|
+
* scalar's contents.
|
|
53
|
+
*/
|
|
54
|
+
this.blockScalarKeep = false;
|
|
55
|
+
/** Current input */
|
|
56
|
+
this.buffer = "";
|
|
57
|
+
/**
|
|
58
|
+
* Flag noting whether the map value indicator : can immediately follow this
|
|
59
|
+
* node within a flow context.
|
|
60
|
+
*/
|
|
61
|
+
this.flowKey = false;
|
|
62
|
+
/** Count of surrounding flow collection levels. */
|
|
63
|
+
this.flowLevel = 0;
|
|
64
|
+
/**
|
|
65
|
+
* Minimum level of indentation required for next lines to be parsed as a
|
|
66
|
+
* part of the current scalar value.
|
|
67
|
+
*/
|
|
68
|
+
this.indentNext = 0;
|
|
69
|
+
/** Indentation level of the current line. */
|
|
70
|
+
this.indentValue = 0;
|
|
71
|
+
/** Position of the next \n character. */
|
|
72
|
+
this.lineEndPos = null;
|
|
73
|
+
/** Stores the state of the lexer if reaching the end of incpomplete input */
|
|
74
|
+
this.next = null;
|
|
75
|
+
/** A pointer to `buffer`; the current position of the lexer. */
|
|
76
|
+
this.pos = 0;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Generate YAML tokens from the `source` string. If `incomplete`,
|
|
80
|
+
* a part of the last line may be left as a buffer for the next call.
|
|
81
|
+
*
|
|
82
|
+
* @returns A generator of lexical tokens
|
|
83
|
+
*/
|
|
84
|
+
*lex(source, incomplete = false) {
|
|
85
|
+
if (source) {
|
|
86
|
+
if (typeof source !== "string") throw TypeError("source is not a string");
|
|
87
|
+
this.buffer = this.buffer ? this.buffer + source : source;
|
|
88
|
+
this.lineEndPos = null;
|
|
89
|
+
}
|
|
90
|
+
this.atEnd = !incomplete;
|
|
91
|
+
let next = this.next ?? "stream";
|
|
92
|
+
while (next && (incomplete || this.hasChars(1))) next = yield* this.parseNext(next);
|
|
93
|
+
}
|
|
94
|
+
atLineEnd() {
|
|
95
|
+
let i = this.pos;
|
|
96
|
+
let ch = this.buffer[i];
|
|
97
|
+
while (ch === " " || ch === " ") ch = this.buffer[++i];
|
|
98
|
+
if (!ch || ch === "#" || ch === "\n") return true;
|
|
99
|
+
if (ch === "\r") return this.buffer[i + 1] === "\n";
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
charAt(n) {
|
|
103
|
+
return this.buffer[this.pos + n];
|
|
104
|
+
}
|
|
105
|
+
continueScalar(offset) {
|
|
106
|
+
let ch = this.buffer[offset];
|
|
107
|
+
if (this.indentNext > 0) {
|
|
108
|
+
let indent = 0;
|
|
109
|
+
while (ch === " ") ch = this.buffer[++indent + offset];
|
|
110
|
+
if (ch === "\r") {
|
|
111
|
+
const next = this.buffer[indent + offset + 1];
|
|
112
|
+
if (next === "\n" || !next && !this.atEnd) return offset + indent + 1;
|
|
113
|
+
}
|
|
114
|
+
return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1;
|
|
115
|
+
}
|
|
116
|
+
if (ch === "-" || ch === ".") {
|
|
117
|
+
const dt = this.buffer.substr(offset, 3);
|
|
118
|
+
if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) return -1;
|
|
119
|
+
}
|
|
120
|
+
return offset;
|
|
121
|
+
}
|
|
122
|
+
getLine() {
|
|
123
|
+
let end = this.lineEndPos;
|
|
124
|
+
if (typeof end !== "number" || end !== -1 && end < this.pos) {
|
|
125
|
+
end = this.buffer.indexOf("\n", this.pos);
|
|
126
|
+
this.lineEndPos = end;
|
|
127
|
+
}
|
|
128
|
+
if (end === -1) return this.atEnd ? this.buffer.substring(this.pos) : null;
|
|
129
|
+
if (this.buffer[end - 1] === "\r") end -= 1;
|
|
130
|
+
return this.buffer.substring(this.pos, end);
|
|
131
|
+
}
|
|
132
|
+
hasChars(n) {
|
|
133
|
+
return this.pos + n <= this.buffer.length;
|
|
134
|
+
}
|
|
135
|
+
setNext(state) {
|
|
136
|
+
this.buffer = this.buffer.substring(this.pos);
|
|
137
|
+
this.pos = 0;
|
|
138
|
+
this.lineEndPos = null;
|
|
139
|
+
this.next = state;
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
peek(n) {
|
|
143
|
+
return this.buffer.substr(this.pos, n);
|
|
144
|
+
}
|
|
145
|
+
*parseNext(next) {
|
|
146
|
+
switch (next) {
|
|
147
|
+
case "stream": return yield* this.parseStream();
|
|
148
|
+
case "line-start": return yield* this.parseLineStart();
|
|
149
|
+
case "block-start": return yield* this.parseBlockStart();
|
|
150
|
+
case "doc": return yield* this.parseDocument();
|
|
151
|
+
case "flow": return yield* this.parseFlowCollection();
|
|
152
|
+
case "quoted-scalar": return yield* this.parseQuotedScalar();
|
|
153
|
+
case "block-scalar": return yield* this.parseBlockScalar();
|
|
154
|
+
case "plain-scalar": return yield* this.parsePlainScalar();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
*parseStream() {
|
|
158
|
+
let line = this.getLine();
|
|
159
|
+
if (line === null) return this.setNext("stream");
|
|
160
|
+
if (line[0] === cst.BOM) {
|
|
161
|
+
yield* this.pushCount(1);
|
|
162
|
+
line = line.substring(1);
|
|
163
|
+
}
|
|
164
|
+
if (line[0] === "%") {
|
|
165
|
+
let dirEnd = line.length;
|
|
166
|
+
let cs = line.indexOf("#");
|
|
167
|
+
while (cs !== -1) {
|
|
168
|
+
const ch = line[cs - 1];
|
|
169
|
+
if (ch === " " || ch === " ") {
|
|
170
|
+
dirEnd = cs - 1;
|
|
171
|
+
break;
|
|
172
|
+
} else cs = line.indexOf("#", cs + 1);
|
|
173
|
+
}
|
|
174
|
+
while (true) {
|
|
175
|
+
const ch = line[dirEnd - 1];
|
|
176
|
+
if (ch === " " || ch === " ") dirEnd -= 1;
|
|
177
|
+
else break;
|
|
178
|
+
}
|
|
179
|
+
const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
|
|
180
|
+
yield* this.pushCount(line.length - n);
|
|
181
|
+
this.pushNewline();
|
|
182
|
+
return "stream";
|
|
183
|
+
}
|
|
184
|
+
if (this.atLineEnd()) {
|
|
185
|
+
const sp = yield* this.pushSpaces(true);
|
|
186
|
+
yield* this.pushCount(line.length - sp);
|
|
187
|
+
yield* this.pushNewline();
|
|
188
|
+
return "stream";
|
|
189
|
+
}
|
|
190
|
+
yield cst.DOCUMENT;
|
|
191
|
+
return yield* this.parseLineStart();
|
|
192
|
+
}
|
|
193
|
+
*parseLineStart() {
|
|
194
|
+
const ch = this.charAt(0);
|
|
195
|
+
if (!ch && !this.atEnd) return this.setNext("line-start");
|
|
196
|
+
if (ch === "-" || ch === ".") {
|
|
197
|
+
if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
|
|
198
|
+
const s = this.peek(3);
|
|
199
|
+
if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) {
|
|
200
|
+
yield* this.pushCount(3);
|
|
201
|
+
this.indentValue = 0;
|
|
202
|
+
this.indentNext = 0;
|
|
203
|
+
return s === "---" ? "doc" : "stream";
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
this.indentValue = yield* this.pushSpaces(false);
|
|
207
|
+
if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) this.indentNext = this.indentValue;
|
|
208
|
+
return yield* this.parseBlockStart();
|
|
209
|
+
}
|
|
210
|
+
*parseBlockStart() {
|
|
211
|
+
const [ch0, ch1] = this.peek(2);
|
|
212
|
+
if (!ch1 && !this.atEnd) return this.setNext("block-start");
|
|
213
|
+
if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) {
|
|
214
|
+
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
215
|
+
this.indentNext = this.indentValue + 1;
|
|
216
|
+
this.indentValue += n;
|
|
217
|
+
return yield* this.parseBlockStart();
|
|
218
|
+
}
|
|
219
|
+
return "doc";
|
|
220
|
+
}
|
|
221
|
+
*parseDocument() {
|
|
222
|
+
yield* this.pushSpaces(true);
|
|
223
|
+
const line = this.getLine();
|
|
224
|
+
if (line === null) return this.setNext("doc");
|
|
225
|
+
let n = yield* this.pushIndicators();
|
|
226
|
+
switch (line[n]) {
|
|
227
|
+
case "#": yield* this.pushCount(line.length - n);
|
|
228
|
+
case void 0:
|
|
229
|
+
yield* this.pushNewline();
|
|
230
|
+
return yield* this.parseLineStart();
|
|
231
|
+
case "{":
|
|
232
|
+
case "[":
|
|
233
|
+
yield* this.pushCount(1);
|
|
234
|
+
this.flowKey = false;
|
|
235
|
+
this.flowLevel = 1;
|
|
236
|
+
return "flow";
|
|
237
|
+
case "}":
|
|
238
|
+
case "]":
|
|
239
|
+
yield* this.pushCount(1);
|
|
240
|
+
return "doc";
|
|
241
|
+
case "*":
|
|
242
|
+
yield* this.pushUntil(isNotAnchorChar);
|
|
243
|
+
return "doc";
|
|
244
|
+
case "\"":
|
|
245
|
+
case "'": return yield* this.parseQuotedScalar();
|
|
246
|
+
case "|":
|
|
247
|
+
case ">":
|
|
248
|
+
n += yield* this.parseBlockScalarHeader();
|
|
249
|
+
n += yield* this.pushSpaces(true);
|
|
250
|
+
yield* this.pushCount(line.length - n);
|
|
251
|
+
yield* this.pushNewline();
|
|
252
|
+
return yield* this.parseBlockScalar();
|
|
253
|
+
default: return yield* this.parsePlainScalar();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
*parseFlowCollection() {
|
|
257
|
+
let nl, sp;
|
|
258
|
+
let indent = -1;
|
|
259
|
+
do {
|
|
260
|
+
nl = yield* this.pushNewline();
|
|
261
|
+
if (nl > 0) {
|
|
262
|
+
sp = yield* this.pushSpaces(false);
|
|
263
|
+
this.indentValue = indent = sp;
|
|
264
|
+
} else sp = 0;
|
|
265
|
+
sp += yield* this.pushSpaces(true);
|
|
266
|
+
} while (nl + sp > 0);
|
|
267
|
+
const line = this.getLine();
|
|
268
|
+
if (line === null) return this.setNext("flow");
|
|
269
|
+
if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) {
|
|
270
|
+
if (!(indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"))) {
|
|
271
|
+
this.flowLevel = 0;
|
|
272
|
+
yield cst.FLOW_END;
|
|
273
|
+
return yield* this.parseLineStart();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
let n = 0;
|
|
277
|
+
while (line[n] === ",") {
|
|
278
|
+
n += yield* this.pushCount(1);
|
|
279
|
+
n += yield* this.pushSpaces(true);
|
|
280
|
+
this.flowKey = false;
|
|
281
|
+
}
|
|
282
|
+
n += yield* this.pushIndicators();
|
|
283
|
+
switch (line[n]) {
|
|
284
|
+
case void 0: return "flow";
|
|
285
|
+
case "#":
|
|
286
|
+
yield* this.pushCount(line.length - n);
|
|
287
|
+
return "flow";
|
|
288
|
+
case "{":
|
|
289
|
+
case "[":
|
|
290
|
+
yield* this.pushCount(1);
|
|
291
|
+
this.flowKey = false;
|
|
292
|
+
this.flowLevel += 1;
|
|
293
|
+
return "flow";
|
|
294
|
+
case "}":
|
|
295
|
+
case "]":
|
|
296
|
+
yield* this.pushCount(1);
|
|
297
|
+
this.flowKey = true;
|
|
298
|
+
this.flowLevel -= 1;
|
|
299
|
+
return this.flowLevel ? "flow" : "doc";
|
|
300
|
+
case "*":
|
|
301
|
+
yield* this.pushUntil(isNotAnchorChar);
|
|
302
|
+
return "flow";
|
|
303
|
+
case "\"":
|
|
304
|
+
case "'":
|
|
305
|
+
this.flowKey = true;
|
|
306
|
+
return yield* this.parseQuotedScalar();
|
|
307
|
+
case ":": {
|
|
308
|
+
const next = this.charAt(1);
|
|
309
|
+
if (this.flowKey || isEmpty(next) || next === ",") {
|
|
310
|
+
this.flowKey = false;
|
|
311
|
+
yield* this.pushCount(1);
|
|
312
|
+
yield* this.pushSpaces(true);
|
|
313
|
+
return "flow";
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
default:
|
|
317
|
+
this.flowKey = false;
|
|
318
|
+
return yield* this.parsePlainScalar();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
*parseQuotedScalar() {
|
|
322
|
+
const quote = this.charAt(0);
|
|
323
|
+
let end = this.buffer.indexOf(quote, this.pos + 1);
|
|
324
|
+
if (quote === "'") while (end !== -1 && this.buffer[end + 1] === "'") end = this.buffer.indexOf("'", end + 2);
|
|
325
|
+
else while (end !== -1) {
|
|
326
|
+
let n = 0;
|
|
327
|
+
while (this.buffer[end - 1 - n] === "\\") n += 1;
|
|
328
|
+
if (n % 2 === 0) break;
|
|
329
|
+
end = this.buffer.indexOf("\"", end + 1);
|
|
330
|
+
}
|
|
331
|
+
const qb = this.buffer.substring(0, end);
|
|
332
|
+
let nl = qb.indexOf("\n", this.pos);
|
|
333
|
+
if (nl !== -1) {
|
|
334
|
+
while (nl !== -1) {
|
|
335
|
+
const cs = this.continueScalar(nl + 1);
|
|
336
|
+
if (cs === -1) break;
|
|
337
|
+
nl = qb.indexOf("\n", cs);
|
|
338
|
+
}
|
|
339
|
+
if (nl !== -1) end = nl - (qb[nl - 1] === "\r" ? 2 : 1);
|
|
340
|
+
}
|
|
341
|
+
if (end === -1) {
|
|
342
|
+
if (!this.atEnd) return this.setNext("quoted-scalar");
|
|
343
|
+
end = this.buffer.length;
|
|
344
|
+
}
|
|
345
|
+
yield* this.pushToIndex(end + 1, false);
|
|
346
|
+
return this.flowLevel ? "flow" : "doc";
|
|
347
|
+
}
|
|
348
|
+
*parseBlockScalarHeader() {
|
|
349
|
+
this.blockScalarIndent = -1;
|
|
350
|
+
this.blockScalarKeep = false;
|
|
351
|
+
let i = this.pos;
|
|
352
|
+
while (true) {
|
|
353
|
+
const ch = this.buffer[++i];
|
|
354
|
+
if (ch === "+") this.blockScalarKeep = true;
|
|
355
|
+
else if (ch > "0" && ch <= "9") this.blockScalarIndent = Number(ch) - 1;
|
|
356
|
+
else if (ch !== "-") break;
|
|
357
|
+
}
|
|
358
|
+
return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#");
|
|
359
|
+
}
|
|
360
|
+
*parseBlockScalar() {
|
|
361
|
+
let nl = this.pos - 1;
|
|
362
|
+
let indent = 0;
|
|
363
|
+
let ch;
|
|
364
|
+
loop: for (let i = this.pos; ch = this.buffer[i]; ++i) switch (ch) {
|
|
365
|
+
case " ":
|
|
366
|
+
indent += 1;
|
|
367
|
+
break;
|
|
368
|
+
case "\n":
|
|
369
|
+
nl = i;
|
|
370
|
+
indent = 0;
|
|
371
|
+
break;
|
|
372
|
+
case "\r": {
|
|
373
|
+
const next = this.buffer[i + 1];
|
|
374
|
+
if (!next && !this.atEnd) return this.setNext("block-scalar");
|
|
375
|
+
if (next === "\n") break;
|
|
376
|
+
}
|
|
377
|
+
default: break loop;
|
|
378
|
+
}
|
|
379
|
+
if (!ch && !this.atEnd) return this.setNext("block-scalar");
|
|
380
|
+
if (indent >= this.indentNext) {
|
|
381
|
+
if (this.blockScalarIndent === -1) this.indentNext = indent;
|
|
382
|
+
else this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
|
|
383
|
+
do {
|
|
384
|
+
const cs = this.continueScalar(nl + 1);
|
|
385
|
+
if (cs === -1) break;
|
|
386
|
+
nl = this.buffer.indexOf("\n", cs);
|
|
387
|
+
} while (nl !== -1);
|
|
388
|
+
if (nl === -1) {
|
|
389
|
+
if (!this.atEnd) return this.setNext("block-scalar");
|
|
390
|
+
nl = this.buffer.length;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
let i = nl + 1;
|
|
394
|
+
ch = this.buffer[i];
|
|
395
|
+
while (ch === " ") ch = this.buffer[++i];
|
|
396
|
+
if (ch === " ") {
|
|
397
|
+
while (ch === " " || ch === " " || ch === "\r" || ch === "\n") ch = this.buffer[++i];
|
|
398
|
+
nl = i - 1;
|
|
399
|
+
} else if (!this.blockScalarKeep) do {
|
|
400
|
+
let i = nl - 1;
|
|
401
|
+
let ch = this.buffer[i];
|
|
402
|
+
if (ch === "\r") ch = this.buffer[--i];
|
|
403
|
+
const lastChar = i;
|
|
404
|
+
while (ch === " ") ch = this.buffer[--i];
|
|
405
|
+
if (ch === "\n" && i >= this.pos && i + 1 + indent > lastChar) nl = i;
|
|
406
|
+
else break;
|
|
407
|
+
} while (true);
|
|
408
|
+
yield cst.SCALAR;
|
|
409
|
+
yield* this.pushToIndex(nl + 1, true);
|
|
410
|
+
return yield* this.parseLineStart();
|
|
411
|
+
}
|
|
412
|
+
*parsePlainScalar() {
|
|
413
|
+
const inFlow = this.flowLevel > 0;
|
|
414
|
+
let end = this.pos - 1;
|
|
415
|
+
let i = this.pos - 1;
|
|
416
|
+
let ch;
|
|
417
|
+
while (ch = this.buffer[++i]) if (ch === ":") {
|
|
418
|
+
const next = this.buffer[i + 1];
|
|
419
|
+
if (isEmpty(next) || inFlow && flowIndicatorChars.has(next)) break;
|
|
420
|
+
end = i;
|
|
421
|
+
} else if (isEmpty(ch)) {
|
|
422
|
+
let next = this.buffer[i + 1];
|
|
423
|
+
if (ch === "\r") if (next === "\n") {
|
|
424
|
+
i += 1;
|
|
425
|
+
ch = "\n";
|
|
426
|
+
next = this.buffer[i + 1];
|
|
427
|
+
} else end = i;
|
|
428
|
+
if (next === "#" || inFlow && flowIndicatorChars.has(next)) break;
|
|
429
|
+
if (ch === "\n") {
|
|
430
|
+
const cs = this.continueScalar(i + 1);
|
|
431
|
+
if (cs === -1) break;
|
|
432
|
+
i = Math.max(i, cs - 2);
|
|
433
|
+
}
|
|
434
|
+
} else {
|
|
435
|
+
if (inFlow && flowIndicatorChars.has(ch)) break;
|
|
436
|
+
end = i;
|
|
437
|
+
}
|
|
438
|
+
if (!ch && !this.atEnd) return this.setNext("plain-scalar");
|
|
439
|
+
yield cst.SCALAR;
|
|
440
|
+
yield* this.pushToIndex(end + 1, true);
|
|
441
|
+
return inFlow ? "flow" : "doc";
|
|
442
|
+
}
|
|
443
|
+
*pushCount(n) {
|
|
444
|
+
if (n > 0) {
|
|
445
|
+
yield this.buffer.substr(this.pos, n);
|
|
446
|
+
this.pos += n;
|
|
447
|
+
return n;
|
|
448
|
+
}
|
|
449
|
+
return 0;
|
|
450
|
+
}
|
|
451
|
+
*pushToIndex(i, allowEmpty) {
|
|
452
|
+
const s = this.buffer.slice(this.pos, i);
|
|
453
|
+
if (s) {
|
|
454
|
+
yield s;
|
|
455
|
+
this.pos += s.length;
|
|
456
|
+
return s.length;
|
|
457
|
+
} else if (allowEmpty) yield "";
|
|
458
|
+
return 0;
|
|
459
|
+
}
|
|
460
|
+
*pushIndicators() {
|
|
461
|
+
switch (this.charAt(0)) {
|
|
462
|
+
case "!": return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
463
|
+
case "&": return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
464
|
+
case "-":
|
|
465
|
+
case "?":
|
|
466
|
+
case ":": {
|
|
467
|
+
const inFlow = this.flowLevel > 0;
|
|
468
|
+
const ch1 = this.charAt(1);
|
|
469
|
+
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
470
|
+
if (!inFlow) this.indentNext = this.indentValue + 1;
|
|
471
|
+
else if (this.flowKey) this.flowKey = false;
|
|
472
|
+
return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return 0;
|
|
477
|
+
}
|
|
478
|
+
*pushTag() {
|
|
479
|
+
if (this.charAt(1) === "<") {
|
|
480
|
+
let i = this.pos + 2;
|
|
481
|
+
let ch = this.buffer[i];
|
|
482
|
+
while (!isEmpty(ch) && ch !== ">") ch = this.buffer[++i];
|
|
483
|
+
return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false);
|
|
484
|
+
} else {
|
|
485
|
+
let i = this.pos + 1;
|
|
486
|
+
let ch = this.buffer[i];
|
|
487
|
+
while (ch) if (tagChars.has(ch)) ch = this.buffer[++i];
|
|
488
|
+
else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) ch = this.buffer[i += 3];
|
|
489
|
+
else break;
|
|
490
|
+
return yield* this.pushToIndex(i, false);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
*pushNewline() {
|
|
494
|
+
const ch = this.buffer[this.pos];
|
|
495
|
+
if (ch === "\n") return yield* this.pushCount(1);
|
|
496
|
+
else if (ch === "\r" && this.charAt(1) === "\n") return yield* this.pushCount(2);
|
|
497
|
+
else return 0;
|
|
498
|
+
}
|
|
499
|
+
*pushSpaces(allowTabs) {
|
|
500
|
+
let i = this.pos - 1;
|
|
501
|
+
let ch;
|
|
502
|
+
do
|
|
503
|
+
ch = this.buffer[++i];
|
|
504
|
+
while (ch === " " || allowTabs && ch === " ");
|
|
505
|
+
const n = i - this.pos;
|
|
506
|
+
if (n > 0) {
|
|
507
|
+
yield this.buffer.substr(this.pos, n);
|
|
508
|
+
this.pos = i;
|
|
509
|
+
}
|
|
510
|
+
return n;
|
|
511
|
+
}
|
|
512
|
+
*pushUntil(test) {
|
|
513
|
+
let i = this.pos;
|
|
514
|
+
let ch = this.buffer[i];
|
|
515
|
+
while (!test(ch)) ch = this.buffer[++i];
|
|
516
|
+
return yield* this.pushToIndex(i, false);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
exports.Lexer = Lexer;
|
|
520
|
+
}));
|
|
521
|
+
//#endregion
|
|
522
|
+
export default require_lexer();
|
|
523
|
+
export { require_lexer };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js
|
|
3
|
+
var require_line_counter = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
/**
|
|
5
|
+
* Tracks newlines during parsing in order to provide an efficient API for
|
|
6
|
+
* determining the one-indexed `{ line, col }` position for any offset
|
|
7
|
+
* within the input.
|
|
8
|
+
*/
|
|
9
|
+
var LineCounter = class {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.lineStarts = [];
|
|
12
|
+
/**
|
|
13
|
+
* Should be called in ascending order. Otherwise, call
|
|
14
|
+
* `lineCounter.lineStarts.sort()` before calling `linePos()`.
|
|
15
|
+
*/
|
|
16
|
+
this.addNewLine = (offset) => this.lineStarts.push(offset);
|
|
17
|
+
/**
|
|
18
|
+
* Performs a binary search and returns the 1-indexed { line, col }
|
|
19
|
+
* position of `offset`. If `line === 0`, `addNewLine` has never been
|
|
20
|
+
* called or `offset` is before the first known newline.
|
|
21
|
+
*/
|
|
22
|
+
this.linePos = (offset) => {
|
|
23
|
+
let low = 0;
|
|
24
|
+
let high = this.lineStarts.length;
|
|
25
|
+
while (low < high) {
|
|
26
|
+
const mid = low + high >> 1;
|
|
27
|
+
if (this.lineStarts[mid] < offset) low = mid + 1;
|
|
28
|
+
else high = mid;
|
|
29
|
+
}
|
|
30
|
+
if (this.lineStarts[low] === offset) return {
|
|
31
|
+
line: low + 1,
|
|
32
|
+
col: 1
|
|
33
|
+
};
|
|
34
|
+
if (low === 0) return {
|
|
35
|
+
line: 0,
|
|
36
|
+
col: offset
|
|
37
|
+
};
|
|
38
|
+
const start = this.lineStarts[low - 1];
|
|
39
|
+
return {
|
|
40
|
+
line: low,
|
|
41
|
+
col: offset - start + 1
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.LineCounter = LineCounter;
|
|
47
|
+
}));
|
|
48
|
+
//#endregion
|
|
49
|
+
export default require_line_counter();
|
|
50
|
+
export { require_line_counter };
|