@askviraj/linter 1.1.2 → 1.1.3
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/node_modules/{synckit → @astrojs/compiler-binding}/LICENSE +1 -1
- package/node_modules/@astrojs/compiler-binding/browser.js +1 -0
- package/node_modules/@astrojs/compiler-binding/index.d.ts +337 -0
- package/node_modules/@astrojs/compiler-binding/index.js +599 -0
- package/node_modules/@astrojs/compiler-binding/package.json +83 -0
- package/node_modules/@astrojs/compiler-binding/webcontainer-fallback.cjs +23 -0
- package/node_modules/@astrojs/compiler-binding-linux-x64-gnu/README.md +3 -0
- package/node_modules/@astrojs/compiler-binding-linux-x64-gnu/astro.linux-x64-gnu.node +0 -0
- package/node_modules/@astrojs/compiler-binding-linux-x64-gnu/package.json +40 -0
- package/node_modules/{parse5 → @astrojs/compiler-rs}/LICENSE +7 -5
- package/node_modules/@astrojs/compiler-rs/README.md +62 -0
- package/node_modules/@astrojs/compiler-rs/async.d.ts +1 -0
- package/node_modules/@astrojs/compiler-rs/dist/async.d.mts +9 -0
- package/node_modules/@astrojs/compiler-rs/dist/async.mjs +1 -0
- package/node_modules/@astrojs/compiler-rs/dist/index.d.mts +9 -0
- package/node_modules/@astrojs/compiler-rs/dist/index.mjs +1 -0
- package/node_modules/@astrojs/compiler-rs/dist/shared.d.mts +45 -0
- package/node_modules/@astrojs/compiler-rs/dist/shared.mjs +1 -0
- package/node_modules/@astrojs/compiler-rs/dist/types.d.mts +94 -0
- package/node_modules/@astrojs/compiler-rs/dist/types.mjs +1 -0
- package/node_modules/@astrojs/compiler-rs/dist/utils.d.mts +4 -0
- package/node_modules/@astrojs/compiler-rs/dist/utils.mjs +1 -0
- package/node_modules/@astrojs/compiler-rs/package.json +55 -0
- package/node_modules/@astrojs/compiler-rs/types.d.ts +1 -0
- package/node_modules/@eslint/config-helpers/README.md +2 -2
- package/node_modules/@eslint/config-helpers/dist/cjs/index.cjs +27 -26
- package/node_modules/@eslint/config-helpers/dist/cjs/index.d.cts +13 -12
- package/node_modules/@eslint/config-helpers/dist/cjs/types.cts +4 -2
- package/node_modules/@eslint/config-helpers/dist/esm/index.d.ts +13 -12
- package/node_modules/@eslint/config-helpers/dist/esm/index.js +27 -26
- package/node_modules/@eslint/config-helpers/dist/esm/types.d.ts +2 -0
- package/node_modules/@eslint/config-helpers/dist/esm/types.ts +4 -2
- package/node_modules/@eslint/config-helpers/package.json +1 -1
- package/node_modules/@eslint/css/README.md +2 -2
- package/node_modules/@eslint/css/dist/build/rules.d.ts +75 -21
- package/node_modules/@eslint/css/dist/build/rules.js +15 -15
- package/node_modules/@eslint/css/dist/data/baseline-data.js +256 -32
- package/node_modules/@eslint/css/dist/index.js +1 -1
- package/node_modules/@eslint/css/dist/rules/font-family-fallbacks.d.ts +15 -15
- package/node_modules/@eslint/css/dist/rules/font-family-fallbacks.js +2 -5
- package/node_modules/@eslint/css/dist/rules/no-duplicate-imports.d.ts +18 -18
- package/node_modules/@eslint/css/dist/rules/no-duplicate-imports.js +9 -12
- package/node_modules/@eslint/css/dist/rules/no-duplicate-keyframe-selectors.d.ts +14 -14
- package/node_modules/@eslint/css/dist/rules/no-duplicate-keyframe-selectors.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-empty-blocks.d.ts +14 -14
- package/node_modules/@eslint/css/dist/rules/no-empty-blocks.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-important.d.ts +16 -16
- package/node_modules/@eslint/css/dist/rules/no-important.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-invalid-at-rule-placement.d.ts +16 -16
- package/node_modules/@eslint/css/dist/rules/no-invalid-at-rule-placement.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-invalid-at-rules.d.ts +21 -21
- package/node_modules/@eslint/css/dist/rules/no-invalid-at-rules.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-invalid-named-grid-areas.d.ts +16 -16
- package/node_modules/@eslint/css/dist/rules/no-invalid-named-grid-areas.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-invalid-properties.d.ts +18 -18
- package/node_modules/@eslint/css/dist/rules/no-invalid-properties.js +2 -3
- package/node_modules/@eslint/css/dist/rules/no-unmatchable-selectors.d.ts +14 -14
- package/node_modules/@eslint/css/dist/rules/no-unmatchable-selectors.js +2 -3
- package/node_modules/@eslint/css/dist/rules/prefer-logical-properties.d.ts +22 -19
- package/node_modules/@eslint/css/dist/rules/prefer-logical-properties.js +66 -23
- package/node_modules/@eslint/css/dist/rules/relative-font-units.d.ts +16 -16
- package/node_modules/@eslint/css/dist/rules/relative-font-units.js +13 -7
- package/node_modules/@eslint/css/dist/rules/selector-complexity.d.ts +17 -17
- package/node_modules/@eslint/css/dist/rules/selector-complexity.js +2 -3
- package/node_modules/@eslint/css/dist/rules/use-baseline.d.ts +22 -22
- package/node_modules/@eslint/css/dist/rules/use-baseline.js +2 -3
- package/node_modules/@eslint/css/dist/rules/use-layers.d.ts +18 -18
- package/node_modules/@eslint/css/dist/rules/use-layers.js +3 -4
- package/node_modules/@eslint/css/package.json +7 -12
- package/node_modules/@eslint/css-tree/README.md +2 -2
- package/node_modules/@eslint/css-tree/dist/csstree.esm.js +1 -1
- package/node_modules/@eslint/css-tree/dist/csstree.js +1 -1
- package/node_modules/@eslint/css-tree/dist/data.cjs +4 -1
- package/node_modules/@eslint/css-tree/dist/data.js +4 -1
- package/node_modules/@eslint/css-tree/dist/version.cjs +1 -1
- package/node_modules/@eslint/css-tree/dist/version.js +1 -1
- package/node_modules/@eslint/css-tree/package.json +3 -3
- package/node_modules/@eslint/json/README.md +2 -2
- package/node_modules/@eslint/json/dist/index.js +1 -1
- package/node_modules/@eslint/json/package.json +4 -9
- package/node_modules/@eslint/markdown/README.md +3 -3
- package/node_modules/@eslint/markdown/dist/build/rules.d.ts +105 -27
- package/node_modules/@eslint/markdown/dist/build/rules.js +21 -21
- package/node_modules/@eslint/markdown/dist/index.d.ts +2 -2
- package/node_modules/@eslint/markdown/dist/index.js +4 -4
- package/node_modules/@eslint/markdown/dist/processor.d.ts +4 -9
- package/node_modules/@eslint/markdown/dist/processor.js +12 -15
- package/node_modules/@eslint/markdown/dist/rules/fenced-code-language.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/fenced-code-language.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/fenced-code-meta.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/fenced-code-meta.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/heading-increment.d.ts +16 -16
- package/node_modules/@eslint/markdown/dist/rules/heading-increment.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-bare-urls.d.ts +14 -14
- package/node_modules/@eslint/markdown/dist/rules/no-bare-urls.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-duplicate-definitions.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/no-duplicate-definitions.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-duplicate-headings.d.ts +15 -15
- package/node_modules/@eslint/markdown/dist/rules/no-duplicate-headings.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-empty-definitions.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/no-empty-definitions.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-empty-images.d.ts +14 -14
- package/node_modules/@eslint/markdown/dist/rules/no-empty-images.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-empty-links.d.ts +14 -14
- package/node_modules/@eslint/markdown/dist/rules/no-empty-links.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-html.d.ts +15 -15
- package/node_modules/@eslint/markdown/dist/rules/no-html.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-invalid-label-refs.d.ts +14 -14
- package/node_modules/@eslint/markdown/dist/rules/no-invalid-label-refs.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-missing-atx-heading-space.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/no-missing-atx-heading-space.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-missing-label-refs.d.ts +16 -16
- package/node_modules/@eslint/markdown/dist/rules/no-missing-label-refs.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-missing-link-fragments.d.ts +16 -16
- package/node_modules/@eslint/markdown/dist/rules/no-missing-link-fragments.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-multiple-h1.d.ts +16 -16
- package/node_modules/@eslint/markdown/dist/rules/no-multiple-h1.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-reference-like-urls.d.ts +15 -15
- package/node_modules/@eslint/markdown/dist/rules/no-reference-like-urls.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-reversed-media-syntax.d.ts +15 -15
- package/node_modules/@eslint/markdown/dist/rules/no-reversed-media-syntax.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-space-in-emphasis.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/no-space-in-emphasis.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/no-unused-definitions.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/no-unused-definitions.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/require-alt-text.d.ts +14 -14
- package/node_modules/@eslint/markdown/dist/rules/require-alt-text.js +2 -3
- package/node_modules/@eslint/markdown/dist/rules/table-column-count.d.ts +17 -17
- package/node_modules/@eslint/markdown/dist/rules/table-column-count.js +2 -3
- package/node_modules/@eslint/markdown/package.json +5 -10
- package/node_modules/@eslint-community/eslint-utils/index.js +1 -1
- package/node_modules/@eslint-community/eslint-utils/index.js.map +1 -1
- package/node_modules/@eslint-community/eslint-utils/index.mjs +1 -1
- package/node_modules/@eslint-community/eslint-utils/index.mjs.map +1 -1
- package/node_modules/@eslint-community/eslint-utils/package.json +12 -7
- package/node_modules/@html-eslint/core/dist/index.js +1 -0
- package/node_modules/@html-eslint/core/dist/index.js.map +1 -1
- package/node_modules/@html-eslint/core/dist/index.mjs +1 -0
- package/node_modules/@html-eslint/core/dist/index.mjs.map +1 -1
- package/node_modules/@html-eslint/core/package.json +3 -3
- package/node_modules/@html-eslint/eslint-plugin/lib/rules/require-content.js +20 -1
- package/node_modules/@html-eslint/eslint-plugin/lib/rules/require-input-label.js +110 -8
- package/node_modules/@html-eslint/eslint-plugin/lib/rules/utils/node.js +13 -0
- package/node_modules/@html-eslint/eslint-plugin/package.json +7 -7
- package/node_modules/@html-eslint/eslint-plugin/types/rules/require-content.d.ts.map +1 -1
- package/node_modules/@html-eslint/eslint-plugin/types/rules/require-input-label.d.ts.map +1 -1
- package/node_modules/@html-eslint/eslint-plugin/types/rules/utils/node.d.ts +7 -0
- package/node_modules/@html-eslint/eslint-plugin/types/rules/utils/node.d.ts.map +1 -1
- package/node_modules/@html-eslint/parser/lib/parser.js +0 -1
- package/node_modules/@html-eslint/parser/package.json +4 -4
- package/node_modules/@html-eslint/parser/types/parser.d.ts.map +1 -1
- package/node_modules/@html-eslint/template-parser/package.json +3 -3
- package/node_modules/@html-eslint/template-syntax-parser/package.json +3 -3
- package/node_modules/@html-eslint/types/package.json +2 -2
- package/node_modules/@rviscomi/capo.js/README.md +4 -4
- package/node_modules/@rviscomi/capo.js/dist/adapters/adapter.cjs +7 -2
- package/node_modules/@rviscomi/capo.js/dist/adapters/browser.cjs +31 -3
- package/node_modules/@rviscomi/capo.js/dist/adapters/index.cjs +36 -4
- package/node_modules/@rviscomi/capo.js/dist/adapters/test-suite.cjs +6 -1
- package/node_modules/@rviscomi/capo.js/dist/analyzer.cjs +53 -24
- package/node_modules/@rviscomi/capo.js/dist/chrome/README.md +53 -0
- package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/capo.html +1 -1
- package/node_modules/@rviscomi/capo.js/dist/chrome/capo.js +3 -0
- package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/chrome.js +56 -18
- package/node_modules/@rviscomi/capo.js/dist/chrome/manifest.json +26 -0
- package/node_modules/@rviscomi/capo.js/dist/chrome/options/options.js +1 -0
- package/node_modules/@rviscomi/capo.js/dist/chrome.zip +0 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/README.md +53 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/background.js +7 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/capo.css +59 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/capo.html +12 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/capo.js +3 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/chrome.js +120 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/images/icon128.png +0 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/manifest.json +39 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/options/options.css +81 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/options/options.html +43 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/options/options.js +1 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox/styles/open-props.css +291 -0
- package/node_modules/@rviscomi/capo.js/dist/firefox.zip +0 -0
- package/node_modules/@rviscomi/capo.js/dist/index.cjs +93 -33
- package/node_modules/@rviscomi/capo.js/dist/lib/colors.cjs +1 -0
- package/node_modules/@rviscomi/capo.js/dist/lib/io.cjs +137 -28
- package/node_modules/@rviscomi/capo.js/dist/lib/options.cjs +61 -0
- package/node_modules/@rviscomi/capo.js/dist/lib/rules.cjs +28 -13
- package/node_modules/@rviscomi/capo.js/dist/lib/validation.cjs +31 -16
- package/node_modules/@rviscomi/capo.js/dist/source.zip +0 -0
- package/node_modules/@rviscomi/capo.js/dist/types/adapters/adapter.d.ts +105 -0
- package/node_modules/@rviscomi/capo.js/dist/types/adapters/browser.d.ts +107 -0
- package/node_modules/@rviscomi/capo.js/dist/types/adapters/index.d.ts +7 -0
- package/node_modules/@rviscomi/capo.js/dist/types/adapters/test-suite.d.ts +52 -0
- package/node_modules/@rviscomi/capo.js/dist/types/analyzer.d.ts +195 -0
- package/node_modules/@rviscomi/capo.js/dist/types/index.d.ts +29 -0
- package/node_modules/@rviscomi/capo.js/dist/types/lib/colors.d.ts +20 -0
- package/node_modules/@rviscomi/capo.js/dist/types/lib/io.d.ts +166 -0
- package/node_modules/@rviscomi/capo.js/dist/types/lib/options.d.ts +114 -0
- package/node_modules/@rviscomi/capo.js/dist/types/lib/rules.d.ts +111 -0
- package/node_modules/@rviscomi/capo.js/dist/types/lib/validation.d.ts +61 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/adapters/adapter.d.ts +105 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/adapters/browser.d.ts +107 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/adapters/index.d.ts +7 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/adapters/test-suite.d.ts +52 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/analyzer.d.ts +195 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/index.d.ts +13 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/lib/colors.d.ts +20 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/lib/io.d.ts +166 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/lib/options.d.ts +114 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/lib/rules.d.ts +111 -0
- package/node_modules/@rviscomi/capo.js/dist/types/src/lib/validation.d.ts +61 -0
- package/node_modules/@rviscomi/capo.js/package.json +34 -16
- package/node_modules/@rviscomi/capo.js/src/adapters/adapter.js +16 -5
- package/node_modules/@rviscomi/capo.js/src/adapters/browser.js +30 -4
- package/node_modules/@rviscomi/capo.js/src/adapters/test-suite.js +11 -10
- package/node_modules/@rviscomi/capo.js/src/analyzer.js +47 -25
- package/node_modules/@rviscomi/capo.js/src/extension/README.md +53 -0
- package/node_modules/@rviscomi/capo.js/src/extension/background.js +7 -0
- package/node_modules/@rviscomi/capo.js/src/extension/capo.css +59 -0
- package/node_modules/@rviscomi/capo.js/src/extension/capo.html +12 -0
- package/node_modules/@rviscomi/capo.js/src/extension/capo.js +93 -0
- package/node_modules/@rviscomi/capo.js/src/extension/chrome.js +120 -0
- package/node_modules/@rviscomi/capo.js/src/extension/images/icon128.png +0 -0
- package/node_modules/@rviscomi/capo.js/src/extension/images/icon256.png +0 -0
- package/node_modules/@rviscomi/capo.js/{crx → src/extension}/manifest.json +1 -1
- package/node_modules/@rviscomi/capo.js/src/extension/options/options.css +81 -0
- package/node_modules/@rviscomi/capo.js/src/extension/options/options.html +43 -0
- package/node_modules/@rviscomi/capo.js/src/extension/options.js +87 -0
- package/node_modules/@rviscomi/capo.js/src/extension/styles/open-props.css +291 -0
- package/node_modules/@rviscomi/capo.js/src/index.js +10 -0
- package/node_modules/@rviscomi/capo.js/src/lib/colors.js +14 -0
- package/node_modules/@rviscomi/capo.js/src/lib/io.js +171 -32
- package/node_modules/@rviscomi/capo.js/src/lib/options.js +82 -1
- package/node_modules/@rviscomi/capo.js/src/lib/rules.js +120 -43
- package/node_modules/@rviscomi/capo.js/src/lib/validation.js +211 -86
- package/node_modules/@rviscomi/capo.js/src/web/capo.js +5 -8
- package/node_modules/@types/hast/README.md +2 -2
- package/node_modules/@types/hast/index.d.ts +642 -0
- package/node_modules/@types/hast/package.json +9 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslintrc/all.d.ts +0 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslintrc/all.js +0 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/flat/all.js +0 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/index.d.ts +0 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/index.js +47 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/raw-plugin.d.ts +0 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +4 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.d.ts +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js +23 -10
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js +16 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js +41 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js +12 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js +5 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js +2 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +5 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js +2 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +36 -9
- package/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.js +11 -2
- package/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/legacy.js +11 -2
- package/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/package.json +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/package.json +22 -11
- package/node_modules/@typescript-eslint/parser/dist/index.js +47 -0
- package/node_modules/@typescript-eslint/parser/dist/parser.js +11 -6
- package/node_modules/@typescript-eslint/parser/package.json +9 -7
- package/node_modules/@typescript-eslint/project-service/package.json +7 -5
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js +2 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js +1 -0
- package/node_modules/@typescript-eslint/scope-manager/package.json +8 -6
- package/node_modules/@typescript-eslint/tsconfig-utils/package.json +5 -3
- package/node_modules/@typescript-eslint/type-utils/package.json +9 -7
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +10 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +13 -0
- package/node_modules/@typescript-eslint/types/package.json +5 -3
- package/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.js +22 -6
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +5 -4
- package/node_modules/@typescript-eslint/typescript-estree/dist/getImportClausePhaseModifier.d.ts +4 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/getImportClausePhaseModifier.js +56 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js +27 -18
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts +8 -0
- package/node_modules/@typescript-eslint/typescript-estree/package.json +9 -7
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts +1 -1
- package/node_modules/@typescript-eslint/utils/package.json +8 -6
- package/node_modules/@typescript-eslint/visitor-keys/package.json +6 -4
- package/node_modules/acorn/CHANGELOG.md +12 -0
- package/node_modules/acorn/README.md +5 -0
- package/node_modules/acorn/dist/acorn.d.mts +8 -0
- package/node_modules/acorn/dist/acorn.d.ts +8 -0
- package/node_modules/acorn/dist/acorn.js +16 -7
- package/node_modules/acorn/dist/acorn.mjs +16 -7
- package/node_modules/acorn/package.json +1 -1
- package/node_modules/astro-eslint-parser/lib/index.d.mts +113 -18
- package/node_modules/astro-eslint-parser/lib/index.mjs +871 -1172
- package/node_modules/astro-eslint-parser/package.json +7 -9
- package/node_modules/brace-expansion/README.md +11 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +2 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +162 -84
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.d.ts +2 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +161 -83
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -2
- package/node_modules/eslint/README.md +2 -2
- package/node_modules/eslint/lib/cli-engine/formatters/html.js +1 -1
- package/node_modules/eslint/lib/languages/js/index.js +1 -1
- package/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +1 -1
- package/node_modules/eslint/lib/linter/vfile.js +1 -1
- package/node_modules/eslint/lib/rules/class-methods-use-this.js +6 -5
- package/node_modules/eslint/lib/rules/complexity.js +1 -1
- package/node_modules/eslint/lib/rules/eqeqeq.js +26 -6
- package/node_modules/eslint/lib/rules/func-name-matching.js +3 -3
- package/node_modules/eslint/lib/rules/generator-star-spacing.js +4 -6
- package/node_modules/eslint/lib/rules/indent.js +4 -6
- package/node_modules/eslint/lib/rules/key-spacing.js +5 -7
- package/node_modules/eslint/lib/rules/max-len.js +1 -1
- package/node_modules/eslint/lib/rules/max-nested-callbacks.js +11 -1
- package/node_modules/eslint/lib/rules/no-compare-neg-zero.js +91 -8
- package/node_modules/eslint/lib/rules/no-control-regex.js +3 -0
- package/node_modules/eslint/lib/rules/no-implicit-coercion.js +22 -8
- package/node_modules/eslint/lib/rules/no-invalid-regexp.js +3 -1
- package/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +5 -7
- package/node_modules/eslint/lib/rules/no-promise-executor-return.js +5 -7
- package/node_modules/eslint/lib/rules/no-script-url.js +4 -6
- package/node_modules/eslint/lib/rules/no-shadow.js +14 -20
- package/node_modules/eslint/lib/rules/no-unreachable-loop.js +8 -4
- package/node_modules/eslint/lib/rules/prefer-numeric-literals.js +14 -6
- package/node_modules/eslint/lib/rules/prefer-object-has-own.js +4 -6
- package/node_modules/eslint/lib/rules/prefer-object-spread.js +9 -1
- package/node_modules/eslint/lib/rules/prefer-template.js +1 -1
- package/node_modules/eslint/lib/rules/preserve-caught-error.js +268 -116
- package/node_modules/eslint/lib/rules/quotes.js +1 -1
- package/node_modules/eslint/lib/rules/radix.js +58 -57
- package/node_modules/eslint/lib/rules/use-isnan.js +20 -12
- package/node_modules/eslint/lib/rules/utils/ast-utils.js +1 -1
- package/node_modules/eslint/lib/shared/serialization.js +1 -1
- package/node_modules/eslint/lib/shared/translate-cli-options.js +3 -3
- package/node_modules/eslint/lib/types/config-api.d.ts +8 -1
- package/node_modules/eslint/lib/types/index.d.ts +3 -6
- package/node_modules/eslint/lib/types/rules.d.ts +17 -9
- package/node_modules/eslint/package.json +7 -7
- package/node_modules/eslint-plugin-astro/README.md +10 -2
- package/node_modules/eslint-plugin-astro/lib/index.d.mts +0 -1
- package/node_modules/eslint-plugin-astro/lib/index.mjs +76 -637
- package/node_modules/eslint-plugin-astro/package.json +11 -11
- package/node_modules/eslint-plugin-toml/README.md +2 -0
- package/node_modules/eslint-plugin-toml/lib/index.d.mts +6 -5
- package/node_modules/eslint-plugin-toml/lib/index.mjs +32 -3
- package/node_modules/eslint-plugin-toml/package.json +7 -7
- package/node_modules/eslint-plugin-yml/lib/index.mjs +49 -19
- package/node_modules/eslint-plugin-yml/package.json +2 -2
- package/node_modules/flatted/golang/pkg/flatted/flatted.go +16 -14
- package/node_modules/flatted/package.json +10 -5
- package/node_modules/flatted/types/index.d.ts +1 -1
- package/node_modules/globals/globals.json +105 -33
- package/node_modules/globals/index.d.ts +105 -33
- package/node_modules/globals/package.json +2 -2
- package/node_modules/mdn-data/css/properties.json +64 -16
- package/node_modules/mdn-data/css/properties.schema.json +1 -7
- package/node_modules/mdn-data/css/syntaxes.json +1 -1
- package/node_modules/mdn-data/l10n/css.json +3 -62
- package/node_modules/mdn-data/package.json +1 -1
- package/node_modules/minimatch/package.json +9 -9
- package/node_modules/nanoid/non-secure/index.cjs +2 -2
- package/node_modules/nanoid/non-secure/index.js +2 -2
- package/node_modules/nanoid/package.json +1 -1
- package/node_modules/picomatch/README.md +15 -21
- package/node_modules/picomatch/lib/parse.js +39 -9
- package/node_modules/picomatch/lib/picomatch.js +14 -2
- package/node_modules/picomatch/package.json +3 -2
- package/node_modules/postcss/README.md +1 -2
- package/node_modules/postcss/lib/container.js +81 -34
- package/node_modules/postcss/lib/fromJSON.js +65 -26
- package/node_modules/postcss/lib/input.js +7 -1
- package/node_modules/postcss/lib/lazy-result.js +77 -14
- package/node_modules/postcss/lib/list.js +1 -0
- package/node_modules/postcss/lib/node.d.ts +2 -2
- package/node_modules/postcss/lib/node.js +90 -52
- package/node_modules/postcss/lib/postcss.d.ts +4 -1
- package/node_modules/postcss/lib/previous-map.js +6 -3
- package/node_modules/postcss/lib/processor.js +1 -1
- package/node_modules/postcss/lib/root.js +16 -1
- package/node_modules/postcss/lib/stringifier.js +112 -25
- package/node_modules/postcss/lib/warning.js +10 -0
- package/node_modules/postcss/package.json +2 -2
- package/node_modules/typescript-eslint/dist/index.js +47 -0
- package/node_modules/typescript-eslint/package.json +14 -6
- package/node_modules/yaml-eslint-parser/lib/chunk-CfYAbeIz.mjs +13 -0
- package/node_modules/yaml-eslint-parser/lib/index.d.mts +2 -2
- package/node_modules/yaml-eslint-parser/lib/index.mjs +164 -157
- package/node_modules/yaml-eslint-parser/package.json +17 -18
- package/package.json +23 -23
- package/node_modules/@astrojs/compiler/LICENSE +0 -53
- package/node_modules/@astrojs/compiler/README.md +0 -72
- package/node_modules/@astrojs/compiler/dist/astro.wasm +0 -0
- package/node_modules/@astrojs/compiler/dist/browser/index.cjs +0 -2
- package/node_modules/@astrojs/compiler/dist/browser/index.d.ts +0 -11
- package/node_modules/@astrojs/compiler/dist/browser/index.js +0 -1
- package/node_modules/@astrojs/compiler/dist/browser/utils.cjs +0 -3
- package/node_modules/@astrojs/compiler/dist/browser/utils.d.ts +0 -29
- package/node_modules/@astrojs/compiler/dist/browser/utils.js +0 -3
- package/node_modules/@astrojs/compiler/dist/browser/wasm_exec.cjs +0 -2
- package/node_modules/@astrojs/compiler/dist/browser/wasm_exec.d.ts +0 -37
- package/node_modules/@astrojs/compiler/dist/browser/wasm_exec.js +0 -1
- package/node_modules/@astrojs/compiler/dist/chunk-QR6QDSEV.js +0 -2
- package/node_modules/@astrojs/compiler/dist/chunk-W5DTLHV4.js +0 -1
- package/node_modules/@astrojs/compiler/dist/node/index.cjs +0 -1
- package/node_modules/@astrojs/compiler/dist/node/index.d.ts +0 -12
- package/node_modules/@astrojs/compiler/dist/node/index.js +0 -1
- package/node_modules/@astrojs/compiler/dist/node/sync.cjs +0 -1
- package/node_modules/@astrojs/compiler/dist/node/sync.d.ts +0 -16
- package/node_modules/@astrojs/compiler/dist/node/sync.js +0 -1
- package/node_modules/@astrojs/compiler/dist/node/utils.cjs +0 -3
- package/node_modules/@astrojs/compiler/dist/node/utils.d.ts +0 -29
- package/node_modules/@astrojs/compiler/dist/node/utils.js +0 -3
- package/node_modules/@astrojs/compiler/dist/node/wasm_exec.cjs +0 -1
- package/node_modules/@astrojs/compiler/dist/node/wasm_exec.d.ts +0 -37
- package/node_modules/@astrojs/compiler/dist/node/wasm_exec.js +0 -1
- package/node_modules/@astrojs/compiler/dist/shared/ast.cjs +0 -1
- package/node_modules/@astrojs/compiler/dist/shared/ast.d.ts +0 -74
- package/node_modules/@astrojs/compiler/dist/shared/ast.js +0 -0
- package/node_modules/@astrojs/compiler/dist/shared/diagnostics.cjs +0 -1
- package/node_modules/@astrojs/compiler/dist/shared/diagnostics.d.ts +0 -18
- package/node_modules/@astrojs/compiler/dist/shared/diagnostics.js +0 -1
- package/node_modules/@astrojs/compiler/dist/shared/types.cjs +0 -1
- package/node_modules/@astrojs/compiler/dist/shared/types.d.ts +0 -153
- package/node_modules/@astrojs/compiler/dist/shared/types.js +0 -1
- package/node_modules/@astrojs/compiler/package.json +0 -58
- package/node_modules/@astrojs/compiler/sync.d.ts +0 -1
- package/node_modules/@astrojs/compiler/types.d.ts +0 -1
- package/node_modules/@astrojs/compiler/utils.d.ts +0 -1
- package/node_modules/@pkgr/core/index.d.cts +0 -3
- package/node_modules/@pkgr/core/lib/constants.d.ts +0 -6
- package/node_modules/@pkgr/core/lib/constants.js +0 -9
- package/node_modules/@pkgr/core/lib/constants.js.map +0 -1
- package/node_modules/@pkgr/core/lib/helpers.d.ts +0 -19
- package/node_modules/@pkgr/core/lib/helpers.js +0 -67
- package/node_modules/@pkgr/core/lib/helpers.js.map +0 -1
- package/node_modules/@pkgr/core/lib/index.cjs +0 -91
- package/node_modules/@pkgr/core/lib/index.d.ts +0 -2
- package/node_modules/@pkgr/core/lib/index.js +0 -3
- package/node_modules/@pkgr/core/lib/index.js.map +0 -1
- package/node_modules/@pkgr/core/package.json +0 -38
- package/node_modules/@rviscomi/capo.js/crx/README.md +0 -10
- package/node_modules/@rviscomi/capo.js/crx/capo.js +0 -3
- package/node_modules/@rviscomi/capo.js/crx/options/options.js +0 -1
- package/node_modules/@rviscomi/capo.js/docs/.vscode/extensions.json +0 -4
- package/node_modules/@rviscomi/capo.js/docs/.vscode/launch.json +0 -11
- package/node_modules/@rviscomi/capo.js/docs/README.md +0 -51
- package/node_modules/@rviscomi/capo.js/docs/astro.config.mjs +0 -82
- package/node_modules/@rviscomi/capo.js/docs/package-lock.json +0 -7439
- package/node_modules/@rviscomi/capo.js/docs/package.json +0 -21
- package/node_modules/@rviscomi/capo.js/docs/public/capo-social-alt.webp +0 -0
- package/node_modules/@rviscomi/capo.js/docs/public/capo-social.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/public/capo-social.webp +0 -0
- package/node_modules/@rviscomi/capo.js/docs/public/favicon.svg +0 -13
- package/node_modules/@rviscomi/capo.js/docs/src/assets/bookmarklet-setup.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/bookmarklet.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/capo-chrome.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/capo-extension.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/capo800.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-console-expanded.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-console-interactive.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-console.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-hover-validation.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-menu.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-options-dark.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-options-light.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/crx-store.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/custom-palette.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/developer-mode.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/devtools-console.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/devtools-snippet.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/devtools-sources.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/houston.webp +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/load-unpacked.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-areas.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-base.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-crx-stripes.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-csp.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-invalid-element.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-origin-trial.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/assets/validation-title.png +0 -0
- package/node_modules/@rviscomi/capo.js/docs/src/components/CapoClient.astro +0 -165
- package/node_modules/@rviscomi/capo.js/docs/src/components/CapoOptions.astro +0 -10
- package/node_modules/@rviscomi/capo.js/docs/src/components/CapoPalette.astro +0 -26
- package/node_modules/@rviscomi/capo.js/docs/src/components/InlineCapoIcon.astro +0 -15
- package/node_modules/@rviscomi/capo.js/docs/src/components/InlineCapoWeightBars.astro +0 -39
- package/node_modules/@rviscomi/capo.js/docs/src/components/VirtualConsole.astro +0 -11
- package/node_modules/@rviscomi/capo.js/docs/src/content/config.ts +0 -7
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/developer/contributing.mdx +0 -8
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/developer/crx-local.mdx +0 -28
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/developer/custom-adapters.mdx +0 -273
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/index.mdx +0 -108
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/migration-v2.mdx +0 -62
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/actionability.mdx +0 -6
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/assessment-mode.mdx +0 -29
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/config.mdx +0 -195
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/demo.mdx +0 -9
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/extension.mdx +0 -116
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/performance.mdx +0 -6
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/quick-start.mdx +0 -26
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/rules.mdx +0 -202
- package/node_modules/@rviscomi/capo.js/docs/src/content/docs/user/validation.mdx +0 -197
- package/node_modules/@rviscomi/capo.js/docs/src/env.d.ts +0 -2
- package/node_modules/@rviscomi/capo.js/docs/src/lib/VirtualConsole.js +0 -190
- package/node_modules/@rviscomi/capo.js/docs/src/lib/capo.js +0 -1533
- package/node_modules/@rviscomi/capo.js/docs/src/styles/custom.css +0 -7
- package/node_modules/@rviscomi/capo.js/docs/src/styles/virtual-console.css +0 -131
- package/node_modules/@rviscomi/capo.js/docs/tests/VirtualConsole.test.js +0 -108
- package/node_modules/@rviscomi/capo.js/docs/tsconfig.json +0 -3
- package/node_modules/@rviscomi/capo.js/src/crx/capo.js +0 -62
- package/node_modules/@rviscomi/capo.js/src/crx/options.js +0 -69
- package/node_modules/astrojs-compiler-sync/LICENSE +0 -53
- package/node_modules/astrojs-compiler-sync/README.md +0 -3
- package/node_modules/astrojs-compiler-sync/browser/index.d.ts +0 -6
- package/node_modules/astrojs-compiler-sync/browser/index.js +0 -76
- package/node_modules/astrojs-compiler-sync/browser/wasm_exec.js +0 -665
- package/node_modules/astrojs-compiler-sync/lib/astrojs-compiler-worker.js +0 -5
- package/node_modules/astrojs-compiler-sync/lib/compiler-sync.cjs +0 -31
- package/node_modules/astrojs-compiler-sync/lib/index.cjs +0 -30
- package/node_modules/astrojs-compiler-sync/lib/index.d.cts +0 -3
- package/node_modules/astrojs-compiler-sync/lib/index.d.ts +0 -14
- package/node_modules/astrojs-compiler-sync/lib/index.js +0 -18
- package/node_modules/astrojs-compiler-sync/package.json +0 -100
- package/node_modules/entities/LICENSE +0 -11
- package/node_modules/entities/dist/decode-codepoint.d.ts +0 -8
- package/node_modules/entities/dist/decode-codepoint.d.ts.map +0 -1
- package/node_modules/entities/dist/decode-codepoint.js +0 -46
- package/node_modules/entities/dist/decode-codepoint.js.map +0 -1
- package/node_modules/entities/dist/decode.d.ts +0 -194
- package/node_modules/entities/dist/decode.d.ts.map +0 -1
- package/node_modules/entities/dist/decode.js +0 -544
- package/node_modules/entities/dist/decode.js.map +0 -1
- package/node_modules/entities/dist/encode.d.ts +0 -24
- package/node_modules/entities/dist/encode.d.ts.map +0 -1
- package/node_modules/entities/dist/encode.js +0 -90
- package/node_modules/entities/dist/encode.js.map +0 -1
- package/node_modules/entities/dist/escape.d.ts +0 -48
- package/node_modules/entities/dist/escape.d.ts.map +0 -1
- package/node_modules/entities/dist/escape.js +0 -132
- package/node_modules/entities/dist/escape.js.map +0 -1
- package/node_modules/entities/dist/generated/decode-data-html.d.ts +0 -3
- package/node_modules/entities/dist/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/entities/dist/generated/decode-data-html.js +0 -5
- package/node_modules/entities/dist/generated/decode-data-html.js.map +0 -1
- package/node_modules/entities/dist/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/entities/dist/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/entities/dist/generated/decode-data-xml.js +0 -5
- package/node_modules/entities/dist/generated/decode-data-xml.js.map +0 -1
- package/node_modules/entities/dist/generated/encode-html.d.ts +0 -5
- package/node_modules/entities/dist/generated/encode-html.d.ts.map +0 -1
- package/node_modules/entities/dist/generated/encode-html.js +0 -12
- package/node_modules/entities/dist/generated/encode-html.js.map +0 -1
- package/node_modules/entities/dist/index.d.ts +0 -89
- package/node_modules/entities/dist/index.d.ts.map +0 -1
- package/node_modules/entities/dist/index.js +0 -91
- package/node_modules/entities/dist/index.js.map +0 -1
- package/node_modules/entities/dist/internal/bin-trie-flags.d.ts +0 -17
- package/node_modules/entities/dist/internal/bin-trie-flags.d.ts.map +0 -1
- package/node_modules/entities/dist/internal/bin-trie-flags.js +0 -18
- package/node_modules/entities/dist/internal/bin-trie-flags.js.map +0 -1
- package/node_modules/entities/dist/internal/decode-shared.d.ts +0 -7
- package/node_modules/entities/dist/internal/decode-shared.d.ts.map +0 -1
- package/node_modules/entities/dist/internal/decode-shared.js +0 -17
- package/node_modules/entities/dist/internal/decode-shared.js.map +0 -1
- package/node_modules/entities/dist/internal/encode-shared.d.ts +0 -33
- package/node_modules/entities/dist/internal/encode-shared.d.ts.map +0 -1
- package/node_modules/entities/dist/internal/encode-shared.js +0 -93
- package/node_modules/entities/dist/internal/encode-shared.js.map +0 -1
- package/node_modules/entities/package.json +0 -83
- package/node_modules/entities/readme.md +0 -131
- package/node_modules/entities/src/decode-codepoint.ts +0 -50
- package/node_modules/entities/src/decode.ts +0 -671
- package/node_modules/entities/src/encode.ts +0 -95
- package/node_modules/entities/src/escape.ts +0 -160
- package/node_modules/entities/src/generated/decode-data-html.ts +0 -7
- package/node_modules/entities/src/generated/decode-data-xml.ts +0 -7
- package/node_modules/entities/src/generated/encode-html.ts +0 -18
- package/node_modules/entities/src/index.ts +0 -162
- package/node_modules/entities/src/internal/bin-trie-flags.ts +0 -16
- package/node_modules/entities/src/internal/decode-shared.ts +0 -18
- package/node_modules/entities/src/internal/encode-shared.ts +0 -123
- package/node_modules/parse5/README.md +0 -38
- package/node_modules/parse5/dist/common/doctype.d.ts +0 -4
- package/node_modules/parse5/dist/common/doctype.js +0 -114
- package/node_modules/parse5/dist/common/error-codes.d.ts +0 -67
- package/node_modules/parse5/dist/common/error-codes.js +0 -63
- package/node_modules/parse5/dist/common/foreign-content.d.ts +0 -9
- package/node_modules/parse5/dist/common/foreign-content.js +0 -228
- package/node_modules/parse5/dist/common/html.d.ts +0 -289
- package/node_modules/parse5/dist/common/html.js +0 -523
- package/node_modules/parse5/dist/common/token.d.ts +0 -84
- package/node_modules/parse5/dist/common/token.js +0 -20
- package/node_modules/parse5/dist/common/unicode.d.ts +0 -42
- package/node_modules/parse5/dist/common/unicode.js +0 -62
- package/node_modules/parse5/dist/index.d.ts +0 -71
- package/node_modules/parse5/dist/index.js +0 -42
- package/node_modules/parse5/dist/parser/formatting-element-list.d.ts +0 -36
- package/node_modules/parse5/dist/parser/formatting-element-list.js +0 -110
- package/node_modules/parse5/dist/parser/index.d.ts +0 -221
- package/node_modules/parse5/dist/parser/index.js +0 -3245
- package/node_modules/parse5/dist/parser/open-element-stack.d.ts +0 -53
- package/node_modules/parse5/dist/parser/open-element-stack.js +0 -324
- package/node_modules/parse5/dist/serializer/index.d.ts +0 -60
- package/node_modules/parse5/dist/serializer/index.js +0 -168
- package/node_modules/parse5/dist/tokenizer/index.d.ts +0 -247
- package/node_modules/parse5/dist/tokenizer/index.js +0 -2712
- package/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +0 -36
- package/node_modules/parse5/dist/tokenizer/preprocessor.js +0 -196
- package/node_modules/parse5/dist/tree-adapters/default.d.ts +0 -84
- package/node_modules/parse5/dist/tree-adapters/default.js +0 -173
- package/node_modules/parse5/dist/tree-adapters/interface.d.ts +0 -255
- package/node_modules/parse5/dist/tree-adapters/interface.js +0 -1
- package/node_modules/parse5/package.json +0 -53
- package/node_modules/synckit/README.md +0 -256
- package/node_modules/synckit/lib/common.d.ts +0 -5
- package/node_modules/synckit/lib/common.js +0 -22
- package/node_modules/synckit/lib/common.js.map +0 -1
- package/node_modules/synckit/lib/constants.d.ts +0 -38
- package/node_modules/synckit/lib/constants.js +0 -54
- package/node_modules/synckit/lib/constants.js.map +0 -1
- package/node_modules/synckit/lib/helpers.d.ts +0 -27
- package/node_modules/synckit/lib/helpers.js +0 -411
- package/node_modules/synckit/lib/helpers.js.map +0 -1
- package/node_modules/synckit/lib/index.cjs +0 -588
- package/node_modules/synckit/lib/index.d.cts +0 -138
- package/node_modules/synckit/lib/index.d.ts +0 -7
- package/node_modules/synckit/lib/index.js +0 -68
- package/node_modules/synckit/lib/index.js.map +0 -1
- package/node_modules/synckit/lib/types.d.ts +0 -48
- package/node_modules/synckit/lib/types.js +0 -2
- package/node_modules/synckit/lib/types.js.map +0 -1
- package/node_modules/synckit/package.json +0 -45
- package/node_modules/yaml-eslint-parser/lib/chunk-15K8U1wQ.mjs +0 -18
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/background.js +0 -0
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/capo.css +0 -0
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/images/icon128.png +0 -0
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/images/icon256.png +0 -0
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/options/options.css +0 -0
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/options/options.html +0 -0
- /package/node_modules/@rviscomi/capo.js/{crx → dist/chrome}/styles/open-props.css +0 -0
- /package/node_modules/@rviscomi/capo.js/{docs/src/assets/capo256.png → dist/firefox/images/icon256.png} +0 -0
- /package/node_modules/eslint-plugin-toml/lib/{chunk-CfYAbeIz.mjs → rolldown-runtime-D7D4PA-g.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-eslint-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Astro component parser for ESLint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.mjs",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"prebuild": "npm run -s clean",
|
|
23
23
|
"build": "tsdown",
|
|
24
24
|
"clean": "rimraf .nyc_output lib coverage",
|
|
25
|
-
"lint": "
|
|
25
|
+
"lint": "npm run lint:js && npm run lint:ts",
|
|
26
|
+
"lint:js": "eslint .",
|
|
27
|
+
"lint:ts": "tsc --noEmit",
|
|
26
28
|
"eslint-fix": "npm run lint -- --fix",
|
|
27
29
|
"test": "npm run mocha -- \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
|
|
28
30
|
"cover": "nyc --reporter=lcov npm run test",
|
|
@@ -55,16 +57,14 @@
|
|
|
55
57
|
},
|
|
56
58
|
"homepage": "https://github.com/ota-meshi/astro-eslint-parser#readme",
|
|
57
59
|
"dependencies": {
|
|
58
|
-
"@astrojs/compiler": "^
|
|
60
|
+
"@astrojs/compiler-rs": "^0.3.1",
|
|
59
61
|
"@typescript-eslint/scope-manager": "^8.61.0",
|
|
60
62
|
"@typescript-eslint/types": "^8.61.0",
|
|
61
|
-
"
|
|
62
|
-
"debug": "^4.3.4",
|
|
63
|
-
"entities": "^8.0.0",
|
|
63
|
+
"debug": "^4.4.3",
|
|
64
64
|
"eslint-scope": "^9.1.2",
|
|
65
65
|
"eslint-visitor-keys": "^5.0.1",
|
|
66
66
|
"espree": "^11.2.0",
|
|
67
|
-
"semver": "^7.
|
|
67
|
+
"semver": "^7.8.4",
|
|
68
68
|
"tinyglobby": "^0.2.17"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
@@ -103,8 +103,6 @@
|
|
|
103
103
|
"eslint-plugin-svelte": "^3.19.0",
|
|
104
104
|
"estree-walker": "^3.0.0",
|
|
105
105
|
"globals": "^17.0.0",
|
|
106
|
-
"locate-character": "^3.0.0",
|
|
107
|
-
"magic-string": "^0.30.0",
|
|
108
106
|
"mocha": "^11.0.0",
|
|
109
107
|
"mocha-chai-jest-snapshot": "^1.1.3",
|
|
110
108
|
"nyc": "^18.0.0",
|
|
@@ -64,6 +64,17 @@ const expansions = expand('{1..100}'.repeat(5), {
|
|
|
64
64
|
// expansions.length will be 100, not 100^5
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
The `options` object can also provide a `maxLength` value to cap the
|
|
68
|
+
total number of characters across all expansions. This is limited to
|
|
69
|
+
`4_000_000` by default, to prevent memory exhaustion from inputs whose
|
|
70
|
+
result count stays under `max` while each result grows very long.
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
const expansions = expand('{a,b}'.repeat(1500), {
|
|
74
|
+
maxLength: 10_000,
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
67
78
|
Valid expansions are:
|
|
68
79
|
|
|
69
80
|
```js
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const EXPANSION_MAX = 100000;
|
|
2
|
+
export declare const EXPANSION_MAX_LENGTH = 4000000;
|
|
2
3
|
export type BraceExpansionOptions = {
|
|
3
4
|
max?: number;
|
|
5
|
+
maxLength?: number;
|
|
4
6
|
};
|
|
5
7
|
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EXPANSION_MAX = void 0;
|
|
3
|
+
exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0;
|
|
4
4
|
exports.expand = expand;
|
|
5
5
|
const balanced_match_1 = require("balanced-match");
|
|
6
6
|
const escSlash = '\0SLASH' + Math.random() + '\0';
|
|
@@ -19,6 +19,17 @@ const closePattern = /\\}/g;
|
|
|
19
19
|
const commaPattern = /\\,/g;
|
|
20
20
|
const periodPattern = /\\\./g;
|
|
21
21
|
exports.EXPANSION_MAX = 100_000;
|
|
22
|
+
// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
|
|
23
|
+
// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
|
|
24
|
+
// truncated to 100k results - while making every result ~1500 characters
|
|
25
|
+
// long. The result set, and the intermediate arrays built while combining
|
|
26
|
+
// brace sets, then grow large enough to exhaust memory and crash the process
|
|
27
|
+
// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
|
|
28
|
+
// characters the accumulator may hold at any point, so memory stays flat no
|
|
29
|
+
// matter how many brace groups are chained. The limit sits well above any
|
|
30
|
+
// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
|
|
31
|
+
// characters) so legitimate input is unaffected.
|
|
32
|
+
exports.EXPANSION_MAX_LENGTH = 4_000_000;
|
|
22
33
|
function numeric(str) {
|
|
23
34
|
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
24
35
|
}
|
|
@@ -68,7 +79,7 @@ function expand(str, options = {}) {
|
|
|
68
79
|
if (!str) {
|
|
69
80
|
return [];
|
|
70
81
|
}
|
|
71
|
-
const { max = exports.EXPANSION_MAX } = options;
|
|
82
|
+
const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options;
|
|
72
83
|
// I don't know why Bash 4.3 does this, but it does.
|
|
73
84
|
// Anything starting with {} will have the first two bytes preserved
|
|
74
85
|
// but *only* at the top level, so {},a}b will not expand to anything,
|
|
@@ -78,7 +89,7 @@ function expand(str, options = {}) {
|
|
|
78
89
|
if (str.slice(0, 2) === '{}') {
|
|
79
90
|
str = '\\{\\}' + str.slice(2);
|
|
80
91
|
}
|
|
81
|
-
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
|
92
|
+
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
|
82
93
|
}
|
|
83
94
|
function embrace(str) {
|
|
84
95
|
return '{' + str + '}';
|
|
@@ -92,25 +103,116 @@ function lte(i, y) {
|
|
|
92
103
|
function gte(i, y) {
|
|
93
104
|
return i >= y;
|
|
94
105
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
|
|
107
|
+
// number of results at `max` and the total number of characters at `maxLength`.
|
|
108
|
+
// This is the one place output grows, so bounding it here keeps the single
|
|
109
|
+
// accumulator - and therefore memory - flat regardless of how many brace groups
|
|
110
|
+
// are combined (CVE-2026-14257).
|
|
111
|
+
function combine(acc, pre, values, max, maxLength, dropEmpties) {
|
|
112
|
+
const out = [];
|
|
113
|
+
let length = 0;
|
|
114
|
+
for (let a = 0; a < acc.length; a++) {
|
|
115
|
+
for (let v = 0; v < values.length; v++) {
|
|
116
|
+
if (out.length >= max)
|
|
117
|
+
return out;
|
|
118
|
+
const expansion = acc[a] + pre + values[v];
|
|
119
|
+
// Bash drops empty results at the top level. Skip them before they count
|
|
120
|
+
// against `max`, so `max` bounds the number of *kept* results.
|
|
121
|
+
if (dropEmpties && !expansion)
|
|
122
|
+
continue;
|
|
123
|
+
if (length + expansion.length > maxLength)
|
|
124
|
+
return out;
|
|
125
|
+
out.push(expansion);
|
|
126
|
+
length += expansion.length;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
|
|
132
|
+
// sequence body.
|
|
133
|
+
function expandSequence(body, isAlphaSequence, max, maxLength) {
|
|
134
|
+
const n = body.split(/\.\./);
|
|
135
|
+
const N = [];
|
|
136
|
+
// A sequence body always splits into two or three parts, but the compiler
|
|
137
|
+
// can't know that.
|
|
138
|
+
/* c8 ignore start */
|
|
139
|
+
if (n[0] === undefined || n[1] === undefined) {
|
|
140
|
+
return N;
|
|
141
|
+
}
|
|
142
|
+
/* c8 ignore stop */
|
|
143
|
+
const x = numeric(n[0]);
|
|
144
|
+
const y = numeric(n[1]);
|
|
145
|
+
const width = Math.max(n[0].length, n[1].length);
|
|
146
|
+
let incr = n.length === 3 && n[2] !== undefined ?
|
|
147
|
+
Math.max(Math.abs(numeric(n[2])), 1)
|
|
148
|
+
: 1;
|
|
149
|
+
let test = lte;
|
|
150
|
+
const reverse = y < x;
|
|
151
|
+
if (reverse) {
|
|
152
|
+
incr *= -1;
|
|
153
|
+
test = gte;
|
|
154
|
+
}
|
|
155
|
+
const pad = n.some(isPadded);
|
|
156
|
+
let length = 0;
|
|
157
|
+
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
158
|
+
let c;
|
|
159
|
+
if (isAlphaSequence) {
|
|
160
|
+
c = String.fromCharCode(i);
|
|
161
|
+
if (c === '\\') {
|
|
162
|
+
c = '';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
c = String(i);
|
|
167
|
+
if (pad) {
|
|
168
|
+
const need = width - c.length;
|
|
169
|
+
if (need > 0) {
|
|
170
|
+
const z = new Array(need + 1).join('0');
|
|
171
|
+
if (i < 0) {
|
|
172
|
+
c = '-' + z + c.slice(1);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
c = z + c;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (length + c.length > maxLength)
|
|
181
|
+
break;
|
|
182
|
+
N.push(c);
|
|
183
|
+
length += c.length;
|
|
184
|
+
}
|
|
185
|
+
return N;
|
|
186
|
+
}
|
|
187
|
+
function expand_(str, max, maxLength, isTop) {
|
|
188
|
+
// Consume the string's top-level brace groups left to right, threading a
|
|
189
|
+
// running set of combined prefixes (`acc`). Expanding the tail iteratively -
|
|
190
|
+
// rather than recursing on `m.post` once per group - keeps the native stack
|
|
191
|
+
// depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
|
|
192
|
+
// longer overflow the stack, and leaves a single accumulator whose size
|
|
193
|
+
// `maxLength` bounds directly (CVE-2026-14257).
|
|
194
|
+
let acc = [''];
|
|
195
|
+
// Bash drops empty results, but only when the *first* top-level group is a
|
|
196
|
+
// comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
|
|
197
|
+
// is on the final strings, so it is applied to whichever `combine` produces
|
|
198
|
+
// them (the one with no brace set left in the tail).
|
|
199
|
+
let dropEmpties = false;
|
|
200
|
+
let firstGroup = true;
|
|
101
201
|
for (;;) {
|
|
102
202
|
const m = (0, balanced_match_1.balanced)('{', '}', str);
|
|
103
|
-
|
|
104
|
-
|
|
203
|
+
// No brace set left: the rest of the string is literal.
|
|
204
|
+
if (!m) {
|
|
205
|
+
return combine(acc, str, [''], max, maxLength, dropEmpties);
|
|
206
|
+
}
|
|
105
207
|
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
|
106
208
|
const pre = m.pre;
|
|
107
|
-
if (/\$$/.test(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
209
|
+
if (/\$$/.test(pre)) {
|
|
210
|
+
acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);
|
|
211
|
+
firstGroup = false;
|
|
212
|
+
if (!m.post.length)
|
|
213
|
+
break;
|
|
214
|
+
str = m.post;
|
|
215
|
+
continue;
|
|
114
216
|
}
|
|
115
217
|
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
116
218
|
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
@@ -123,89 +225,65 @@ function expand_(str, max, isTop) {
|
|
|
123
225
|
isTop = true;
|
|
124
226
|
continue;
|
|
125
227
|
}
|
|
126
|
-
|
|
228
|
+
// Nothing here expands, so the whole remaining string is literal.
|
|
229
|
+
return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);
|
|
230
|
+
}
|
|
231
|
+
if (firstGroup) {
|
|
232
|
+
dropEmpties = isTop && !isSequence;
|
|
233
|
+
firstGroup = false;
|
|
127
234
|
}
|
|
128
|
-
|
|
129
|
-
// it before the early returns above expanded post a second time on every
|
|
130
|
-
// non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up
|
|
131
|
-
// exponentially.
|
|
132
|
-
const post = m.post.length ? expand_(m.post, max, false) : [''];
|
|
133
|
-
let n;
|
|
235
|
+
let values;
|
|
134
236
|
if (isSequence) {
|
|
135
|
-
|
|
237
|
+
values = expandSequence(m.body, isAlphaSequence, max, maxLength);
|
|
136
238
|
}
|
|
137
239
|
else {
|
|
138
|
-
n = parseCommaParts(m.body);
|
|
240
|
+
let n = parseCommaParts(m.body);
|
|
139
241
|
if (n.length === 1 && n[0] !== undefined) {
|
|
140
242
|
// x{{a,b}}y ==> x{a}y x{b}y
|
|
141
|
-
n = expand_(n[0], max, false).map(embrace);
|
|
243
|
+
n = expand_(n[0], max, maxLength, false).map(embrace);
|
|
142
244
|
//XXX is this necessary? Can't seem to hit it in tests.
|
|
143
245
|
/* c8 ignore start */
|
|
144
246
|
if (n.length === 1) {
|
|
145
|
-
|
|
247
|
+
acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);
|
|
248
|
+
if (!m.post.length)
|
|
249
|
+
break;
|
|
250
|
+
str = m.post;
|
|
251
|
+
continue;
|
|
146
252
|
}
|
|
147
253
|
/* c8 ignore stop */
|
|
148
254
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
Math.max(Math.abs(numeric(n[2])), 1)
|
|
159
|
-
: 1;
|
|
160
|
-
let test = lte;
|
|
161
|
-
const reverse = y < x;
|
|
162
|
-
if (reverse) {
|
|
163
|
-
incr *= -1;
|
|
164
|
-
test = gte;
|
|
165
|
-
}
|
|
166
|
-
const pad = n.some(isPadded);
|
|
167
|
-
N = [];
|
|
168
|
-
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
169
|
-
let c;
|
|
170
|
-
if (isAlphaSequence) {
|
|
171
|
-
c = String.fromCharCode(i);
|
|
172
|
-
if (c === '\\') {
|
|
173
|
-
c = '';
|
|
174
|
-
}
|
|
255
|
+
// Values that `combine` is going to drop as empty produce no result, so
|
|
256
|
+
// they must not count against `max` - otherwise `{a,,b}` with `max: 2`
|
|
257
|
+
// would stop at `['a', '']` and yield one result instead of two. Skipping
|
|
258
|
+
// them outright keeps `values` bounded while leaving `max` a bound on
|
|
259
|
+
// *kept* results.
|
|
260
|
+
let dropsEmpties = dropEmpties && !m.post.length && !pre;
|
|
261
|
+
for (let d = 0; dropsEmpties && d < acc.length; d++) {
|
|
262
|
+
if (acc[d]) {
|
|
263
|
+
dropsEmpties = false;
|
|
175
264
|
}
|
|
176
|
-
else {
|
|
177
|
-
c = String(i);
|
|
178
|
-
if (pad) {
|
|
179
|
-
const need = width - c.length;
|
|
180
|
-
if (need > 0) {
|
|
181
|
-
const z = new Array(need + 1).join('0');
|
|
182
|
-
if (i < 0) {
|
|
183
|
-
c = '-' + z + c.slice(1);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
c = z + c;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
N.push(c);
|
|
192
265
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
266
|
+
values = [];
|
|
267
|
+
let valuesLength = 0;
|
|
268
|
+
outer: for (let j = 0; j < n.length; j++) {
|
|
269
|
+
const expanded = expand_(n[j], max, maxLength, false);
|
|
270
|
+
for (let k = 0; k < expanded.length; k++) {
|
|
271
|
+
const v = expanded[k];
|
|
272
|
+
if (dropsEmpties && !v)
|
|
273
|
+
continue;
|
|
274
|
+
if (values.length >= max || valuesLength + v.length > maxLength) {
|
|
275
|
+
break outer;
|
|
276
|
+
}
|
|
277
|
+
values.push(v);
|
|
278
|
+
valuesLength += v.length;
|
|
205
279
|
}
|
|
206
280
|
}
|
|
207
281
|
}
|
|
208
|
-
|
|
282
|
+
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
|
283
|
+
if (!m.post.length)
|
|
284
|
+
break;
|
|
285
|
+
str = m.post;
|
|
209
286
|
}
|
|
287
|
+
return acc;
|
|
210
288
|
}
|
|
211
289
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA8EA,wBAkBC;AAhGD,mDAAyC;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,aAAa,GAAG,OAAO,CAAA;AAEhB,QAAA,aAAa,GAAG,OAAO,CAAA;AAEpC,SAAS,OAAO,CAA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AAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;YACtD,CAAC;QACH,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n // The `{a},b}` rewrite below restarts expansion on a rewritten string with\n // the same `max` and `isTop = true`. Loop instead of recursing so a long run\n // of non-expanding `{}` groups can't exhaust the call stack.\n for (;;) {\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(m.pre)) {\n const post: string[] =\n m.post.length ? expand_(m.post, max, false) : ['']\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n return expansions\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n return [str]\n }\n\n // Only expand post once we know this brace set actually expands. Computing\n // it before the early returns above expanded post a second time on every\n // non-expanding `{}`, which is what made inputs like `a{},{},{}...` blow up\n // exponentially.\n const post: string[] =\n m.post.length ? expand_(m.post, max, false) : ['']\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n\n return expansions\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA2FA,wBAkBC;AA7GD,mDAAyC;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAA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= '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n acc: string[],\n pre: string,\n values: string[],\n max: number,\n maxLength: number,\n dropEmpties: boolean,\n): string[] {\n const out: string[] = []\n let length = 0\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max) return out\n const expansion = (acc[a] as string) + pre + values[v]\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion) continue\n if (length + expansion.length > maxLength) return out\n out.push(expansion)\n length += expansion.length\n }\n }\n return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n body: string,\n isAlphaSequence: boolean,\n max: number,\n maxLength: number,\n): string[] {\n const n = body.split(/\\.\\./)\n const N: string[] = []\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N\n }\n /* c8 ignore stop */\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n let length = 0\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n if (length + c.length > maxLength) break\n N.push(c)\n length += c.length\n }\n return N\n}\n\nfunction expand_(\n str: string,\n max: number,\n maxLength: number,\n isTop: boolean,\n): string[] {\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc: string[] = ['']\n\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n let dropEmpties = false\n let firstGroup = true\n\n for (;;) {\n const m = balanced('{', '}', str)\n\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties)\n }\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(pre)) {\n acc = combine(\n acc,\n pre + '{' + m.body + '}',\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n firstGroup = false\n if (!m.post.length) break\n str = m.post\n continue\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(\n acc,\n pre + '{' + m.body + '}' + m.post,\n [''],\n max,\n maxLength,\n dropEmpties,\n )\n }\n\n if (firstGroup) {\n dropEmpties = isTop && !isSequence\n firstGroup = false\n }\n\n let values: string[]\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n } else {\n let n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(\n acc,\n pre + n[0],\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n if (!m.post.length) break\n str = m.post\n continue\n }\n /* c8 ignore stop */\n }\n\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false\n }\n }\n\n values = []\n let valuesLength = 0\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j] as string, max, maxLength, false)\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k] as string\n if (dropsEmpties && !v) continue\n if (values.length >= max || valuesLength + v.length > maxLength) {\n break outer\n }\n values.push(v)\n valuesLength += v.length\n }\n }\n }\n\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n if (!m.post.length) break\n str = m.post\n }\n\n return acc\n}\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const EXPANSION_MAX = 100000;
|
|
2
|
+
export declare const EXPANSION_MAX_LENGTH = 4000000;
|
|
2
3
|
export type BraceExpansionOptions = {
|
|
3
4
|
max?: number;
|
|
5
|
+
maxLength?: number;
|
|
4
6
|
};
|
|
5
7
|
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}
|