docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TableProperties = createLucideIcon("TableProperties", [
["path", { d: "M15 3v18", key: "14nvp0" }],
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M21 9H3", key: "1338ky" }],
["path", { d: "M21 15H3", key: "9uk58r" }]
]);
export { TableProperties as default };
//# sourceMappingURL=table-properties.js.map
@@ -0,0 +1,5 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_adapter_netlify_conninfo = require("./conninfo.js");
const require_adapter_netlify_handler = require("./handler.js");
exports.getConnInfo = require_adapter_netlify_conninfo.getConnInfo;
exports.handle = require_adapter_netlify_handler.handle;
@@ -0,0 +1,979 @@
import { $ as KeywordSpacingRuleOptions, A as NoWhitespaceBeforePropertyRuleOptions, At as EolLastRuleOptions, B as NoConfusingArrowRuleOptions, Bt as ArrowParensRuleOptions, C as PaddedBlocksRuleOptions, Ct as IndentRuleOptions, D as ObjectCurlySpacingRuleOptions, Dt as FunctionParenNewlineRuleOptions, E as ObjectPropertyNewlineRuleOptions, Et as GeneratorStarSpacingRuleOptions, F as NoMixedSpacesAndTabsRuleOptions, Ft as CommaSpacingRuleOptions, G as MemberDelimiterStyleRuleOptions, H as NewParensRuleOptions, Ht as ArrayBracketSpacingRuleOptions, I as NoMixedOperatorsRuleOptions, It as CommaDangleRuleOptions, J as ListStyleRuleOptions, K as MaxStatementsPerLineRuleOptions, L as NoFloatingDecimalRuleOptions, Lt as BraceStyleRuleOptions, M as NoTabsRuleOptions, Mt as CurlyNewlineRuleOptions, N as NoMultipleEmptyLinesRuleOptions, Nt as ComputedPropertySpacingRuleOptions, O as ObjectCurlyNewlineRuleOptions, Ot as FunctionCallSpacingRuleOptions, P as NoMultiSpacesRuleOptions, Pt as CommaStyleRuleOptions, Q as LineCommentPositionRuleOptions, R as NoExtraSemiRuleOptions, Rt as BlockSpacingRuleOptions, S as PaddingLineBetweenStatementsRuleOptions, St as JsxChildElementSpacingRuleOptions, T as OneVarDeclarationPerLineRuleOptions, Tt as ImplicitArrowLinebreakRuleOptions, U as MultilineTernaryRuleOptions, Ut as ArrayBracketNewlineRuleOptions, V as NewlinePerChainedCallRuleOptions, Vt as ArrayElementNewlineRuleOptions, W as MultilineCommentStyleRuleOptions, X as LinesAroundCommentRuleOptions, Y as LinesBetweenClassMembersRuleOptions, Z as LinebreakStyleRuleOptions, _ as SemiStyleRuleOptions, _t as JsxCurlySpacingRuleOptions, a as TypeGenericSpacingRuleOptions, at as JsxQuotesRuleOptions, b as QuotesRuleOptions, bt as JsxClosingTagLocationRuleOptions, c as TemplateCurlySpacingRuleOptions, ct as JsxPascalCaseRuleOptions, d as SpaceUnaryOpsRuleOptions, dt as JsxMaxPropsPerLineRuleOptions, et as KeySpacingRuleOptions, f as SpaceInfixOpsRuleOptions, ft as JsxIndentRuleOptions, g as SemiRuleOptions, gt as JsxEqualsSpacingRuleOptions, h as SpaceBeforeBlocksRuleOptions, ht as JsxFirstPropNewLineRuleOptions, i as TypeNamedTupleSpacingRuleOptions, it as JsxSelfClosingCompRuleOptions, j as NoTrailingSpacesRuleOptions, jt as DotLocationRuleOptions, k as NonblockStatementBodyPositionRuleOptions, kt as FunctionCallArgumentNewlineRuleOptions, l as SwitchColonSpacingRuleOptions, lt as JsxOneExpressionPerLineRuleOptions, m as SpaceBeforeFunctionParenRuleOptions, mt as JsxFunctionCallNewlineRuleOptions, n as WrapRegexRuleOptions, nt as JsxTagSpacingRuleOptions, o as TypeAnnotationSpacingRuleOptions, ot as JsxPropsStyleRuleOptions, p as SpaceInParensRuleOptions, pt as JsxIndentPropsRuleOptions, q as MaxLenRuleOptions, r as WrapIifeRuleOptions, rt as JsxSortPropsRuleOptions, s as TemplateTagSpacingRuleOptions, st as JsxPropsNoMultiSpacesRuleOptions, t as YieldStarSpacingRuleOptions, tt as JsxWrapMultilinesRuleOptions, u as SpacedCommentRuleOptions, ut as JsxNewlineRuleOptions, v as SemiSpacingRuleOptions, vt as JsxCurlyNewlineRuleOptions, w as OperatorLinebreakRuleOptions, wt as IndentBinaryOpsRuleOptions, x as QuotePropsRuleOptions, xt as JsxClosingBracketLocationRuleOptions, y as RestSpreadSpacingRuleOptions, yt as JsxCurlyBracePresenceRuleOptions, z as NoExtraParensRuleOptions, zt as ArrowSpacingRuleOptions } from "./types.mjs";
//#region dts/rule-options.d.ts
interface RuleOptions {
/**
* Enforce linebreaks after opening and before closing array brackets
* @see https://eslint.style/rules/array-bracket-newline
*/
'@stylistic/array-bracket-newline': ArrayBracketNewlineRuleOptions;
/**
* Enforce consistent spacing inside array brackets
* @see https://eslint.style/rules/array-bracket-spacing
*/
'@stylistic/array-bracket-spacing': ArrayBracketSpacingRuleOptions;
/**
* Enforce line breaks after each array element
* @see https://eslint.style/rules/array-element-newline
*/
'@stylistic/array-element-newline': ArrayElementNewlineRuleOptions;
/**
* Require parentheses around arrow function arguments
* @see https://eslint.style/rules/arrow-parens
*/
'@stylistic/arrow-parens': ArrowParensRuleOptions;
/**
* Enforce consistent spacing before and after the arrow in arrow functions
* @see https://eslint.style/rules/arrow-spacing
*/
'@stylistic/arrow-spacing': ArrowSpacingRuleOptions;
/**
* Disallow or enforce spaces inside of blocks after opening block and before closing block
* @see https://eslint.style/rules/block-spacing
*/
'@stylistic/block-spacing': BlockSpacingRuleOptions;
/**
* Enforce consistent brace style for blocks
* @see https://eslint.style/rules/brace-style
*/
'@stylistic/brace-style': BraceStyleRuleOptions;
/**
* Require or disallow trailing commas
* @see https://eslint.style/rules/comma-dangle
*/
'@stylistic/comma-dangle': CommaDangleRuleOptions;
/**
* Enforce consistent spacing before and after commas
* @see https://eslint.style/rules/comma-spacing
*/
'@stylistic/comma-spacing': CommaSpacingRuleOptions;
/**
* Enforce consistent comma style
* @see https://eslint.style/rules/comma-style
*/
'@stylistic/comma-style': CommaStyleRuleOptions;
/**
* Enforce consistent spacing inside computed property brackets
* @see https://eslint.style/rules/computed-property-spacing
*/
'@stylistic/computed-property-spacing': ComputedPropertySpacingRuleOptions;
/**
* Enforce consistent line breaks after opening and before closing braces
* @see https://eslint.style/rules/curly-newline
*/
'@stylistic/curly-newline': CurlyNewlineRuleOptions;
/**
* Enforce consistent newlines before and after dots
* @see https://eslint.style/rules/dot-location
*/
'@stylistic/dot-location': DotLocationRuleOptions;
/**
* Require or disallow newline at the end of files
* @see https://eslint.style/rules/eol-last
*/
'@stylistic/eol-last': EolLastRuleOptions;
/**
* Enforce line breaks between arguments of a function call
* @see https://eslint.style/rules/function-call-argument-newline
*/
'@stylistic/function-call-argument-newline': FunctionCallArgumentNewlineRuleOptions;
/**
* Require or disallow spacing between function identifiers and their invocations
* @see https://eslint.style/rules/function-call-spacing
*/
'@stylistic/function-call-spacing': FunctionCallSpacingRuleOptions;
/**
* Enforce consistent line breaks inside function parentheses
* @see https://eslint.style/rules/function-paren-newline
*/
'@stylistic/function-paren-newline': FunctionParenNewlineRuleOptions;
/**
* Enforce consistent spacing around `*` operators in generator functions
* @see https://eslint.style/rules/generator-star-spacing
*/
'@stylistic/generator-star-spacing': GeneratorStarSpacingRuleOptions;
/**
* Enforce the location of arrow function bodies
* @see https://eslint.style/rules/implicit-arrow-linebreak
*/
'@stylistic/implicit-arrow-linebreak': ImplicitArrowLinebreakRuleOptions;
/**
* Enforce consistent indentation
* @see https://eslint.style/rules/indent
*/
'@stylistic/indent': IndentRuleOptions;
/**
* Indentation for binary operators
* @see https://eslint.style/rules/indent-binary-ops
*/
'@stylistic/indent-binary-ops': IndentBinaryOpsRuleOptions;
/**
* Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
* @see https://eslint.style/rules/jsx-child-element-spacing
*/
'@stylistic/jsx-child-element-spacing': JsxChildElementSpacingRuleOptions;
/**
* Enforce closing bracket location in JSX
* @see https://eslint.style/rules/jsx-closing-bracket-location
*/
'@stylistic/jsx-closing-bracket-location': JsxClosingBracketLocationRuleOptions;
/**
* Enforce closing tag location for multiline JSX
* @see https://eslint.style/rules/jsx-closing-tag-location
*/
'@stylistic/jsx-closing-tag-location': JsxClosingTagLocationRuleOptions;
/**
* Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
* @see https://eslint.style/rules/jsx-curly-brace-presence
*/
'@stylistic/jsx-curly-brace-presence': JsxCurlyBracePresenceRuleOptions;
/**
* Enforce consistent linebreaks in curly braces in JSX attributes and expressions
* @see https://eslint.style/rules/jsx-curly-newline
*/
'@stylistic/jsx-curly-newline': JsxCurlyNewlineRuleOptions;
/**
* Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
* @see https://eslint.style/rules/jsx-curly-spacing
*/
'@stylistic/jsx-curly-spacing': JsxCurlySpacingRuleOptions;
/**
* Enforce or disallow spaces around equal signs in JSX attributes
* @see https://eslint.style/rules/jsx-equals-spacing
*/
'@stylistic/jsx-equals-spacing': JsxEqualsSpacingRuleOptions;
/**
* Enforce proper position of the first property in JSX
* @see https://eslint.style/rules/jsx-first-prop-new-line
*/
'@stylistic/jsx-first-prop-new-line': JsxFirstPropNewLineRuleOptions;
/**
* Enforce line breaks before and after JSX elements when they are used as arguments to a function.
* @see https://eslint.style/rules/jsx-function-call-newline
*/
'@stylistic/jsx-function-call-newline': JsxFunctionCallNewlineRuleOptions;
/**
* Enforce JSX indentation. Deprecated, use `indent` rule instead.
* @see https://eslint.style/rules/jsx-indent
*/
'@stylistic/jsx-indent': JsxIndentRuleOptions;
/**
* Enforce props indentation in JSX
* @see https://eslint.style/rules/jsx-indent-props
*/
'@stylistic/jsx-indent-props': JsxIndentPropsRuleOptions;
/**
* Enforce maximum of props on a single line in JSX
* @see https://eslint.style/rules/jsx-max-props-per-line
*/
'@stylistic/jsx-max-props-per-line': JsxMaxPropsPerLineRuleOptions;
/**
* Require or prevent a new line after jsx elements and expressions.
* @see https://eslint.style/rules/jsx-newline
*/
'@stylistic/jsx-newline': JsxNewlineRuleOptions;
/**
* Require one JSX element per line
* @see https://eslint.style/rules/jsx-one-expression-per-line
*/
'@stylistic/jsx-one-expression-per-line': JsxOneExpressionPerLineRuleOptions;
/**
* Enforce PascalCase for user-defined JSX components
* @see https://eslint.style/rules/jsx-pascal-case
*/
'@stylistic/jsx-pascal-case': JsxPascalCaseRuleOptions;
/**
* Disallow multiple spaces between inline JSX props. Deprecated, use `no-multi-spaces` rule instead.
* @see https://eslint.style/rules/jsx-props-no-multi-spaces
*/
'@stylistic/jsx-props-no-multi-spaces': JsxPropsNoMultiSpacesRuleOptions;
/**
* Enforce consistent line break styles for JSX props
* @see https://eslint.style/rules/jsx-props-style
*/
'@stylistic/exp-jsx-props-style': JsxPropsStyleRuleOptions;
/**
* Enforce the consistent use of either double or single quotes in JSX attributes
* @see https://eslint.style/rules/jsx-quotes
*/
'@stylistic/jsx-quotes': JsxQuotesRuleOptions;
/**
* Disallow extra closing tags for components without children
* @see https://eslint.style/rules/jsx-self-closing-comp
*/
'@stylistic/jsx-self-closing-comp': JsxSelfClosingCompRuleOptions;
/**
* Enforce props alphabetical sorting
* @see https://eslint.style/rules/jsx-sort-props
*/
'@stylistic/jsx-sort-props': JsxSortPropsRuleOptions;
/**
* Enforce whitespace in and around the JSX opening and closing brackets
* @see https://eslint.style/rules/jsx-tag-spacing
*/
'@stylistic/jsx-tag-spacing': JsxTagSpacingRuleOptions;
/**
* Disallow missing parentheses around multiline JSX
* @see https://eslint.style/rules/jsx-wrap-multilines
*/
'@stylistic/jsx-wrap-multilines': JsxWrapMultilinesRuleOptions;
/**
* Enforce consistent spacing between property names and type annotations in types and interfaces
* @see https://eslint.style/rules/key-spacing
*/
'@stylistic/key-spacing': KeySpacingRuleOptions;
/**
* Enforce consistent spacing before and after keywords
* @see https://eslint.style/rules/keyword-spacing
*/
'@stylistic/keyword-spacing': KeywordSpacingRuleOptions;
/**
* Enforce position of line comments
* @see https://eslint.style/rules/line-comment-position
*/
'@stylistic/line-comment-position': LineCommentPositionRuleOptions;
/**
* Enforce consistent linebreak style
* @see https://eslint.style/rules/linebreak-style
*/
'@stylistic/linebreak-style': LinebreakStyleRuleOptions;
/**
* Require empty lines around comments
* @see https://eslint.style/rules/lines-around-comment
*/
'@stylistic/lines-around-comment': LinesAroundCommentRuleOptions;
/**
* Require or disallow an empty line between class members
* @see https://eslint.style/rules/lines-between-class-members
*/
'@stylistic/lines-between-class-members': LinesBetweenClassMembersRuleOptions;
/**
* Enforce consistent spacing and line break styles inside brackets.
* @see https://eslint.style/rules/list-style
*/
'@stylistic/exp-list-style': ListStyleRuleOptions;
/**
* Enforce a maximum line length
* @see https://eslint.style/rules/max-len
*/
'@stylistic/max-len': MaxLenRuleOptions;
/**
* Enforce a maximum number of statements allowed per line
* @see https://eslint.style/rules/max-statements-per-line
*/
'@stylistic/max-statements-per-line': MaxStatementsPerLineRuleOptions;
/**
* Require a specific member delimiter style for interfaces and type literals
* @see https://eslint.style/rules/member-delimiter-style
*/
'@stylistic/member-delimiter-style': MemberDelimiterStyleRuleOptions;
/**
* Enforce a particular style for multiline comments
* @see https://eslint.style/rules/multiline-comment-style
*/
'@stylistic/multiline-comment-style': MultilineCommentStyleRuleOptions;
/**
* Enforce newlines between operands of ternary expressions
* @see https://eslint.style/rules/multiline-ternary
*/
'@stylistic/multiline-ternary': MultilineTernaryRuleOptions;
/**
* Enforce or disallow parentheses when invoking a constructor with no arguments
* @see https://eslint.style/rules/new-parens
*/
'@stylistic/new-parens': NewParensRuleOptions;
/**
* Require a newline after each call in a method chain
* @see https://eslint.style/rules/newline-per-chained-call
*/
'@stylistic/newline-per-chained-call': NewlinePerChainedCallRuleOptions;
/**
* Disallow arrow functions where they could be confused with comparisons
* @see https://eslint.style/rules/no-confusing-arrow
*/
'@stylistic/no-confusing-arrow': NoConfusingArrowRuleOptions;
/**
* Disallow unnecessary parentheses
* @see https://eslint.style/rules/no-extra-parens
*/
'@stylistic/no-extra-parens': NoExtraParensRuleOptions;
/**
* Disallow unnecessary semicolons
* @see https://eslint.style/rules/no-extra-semi
*/
'@stylistic/no-extra-semi': NoExtraSemiRuleOptions;
/**
* Disallow leading or trailing decimal points in numeric literals
* @see https://eslint.style/rules/no-floating-decimal
*/
'@stylistic/no-floating-decimal': NoFloatingDecimalRuleOptions;
/**
* Disallow mixed binary operators
* @see https://eslint.style/rules/no-mixed-operators
*/
'@stylistic/no-mixed-operators': NoMixedOperatorsRuleOptions;
/**
* Disallow mixed spaces and tabs for indentation
* @see https://eslint.style/rules/no-mixed-spaces-and-tabs
*/
'@stylistic/no-mixed-spaces-and-tabs': NoMixedSpacesAndTabsRuleOptions;
/**
* Disallow multiple spaces
* @see https://eslint.style/rules/no-multi-spaces
*/
'@stylistic/no-multi-spaces': NoMultiSpacesRuleOptions;
/**
* Disallow multiple empty lines
* @see https://eslint.style/rules/no-multiple-empty-lines
*/
'@stylistic/no-multiple-empty-lines': NoMultipleEmptyLinesRuleOptions;
/**
* Disallow all tabs
* @see https://eslint.style/rules/no-tabs
*/
'@stylistic/no-tabs': NoTabsRuleOptions;
/**
* Disallow trailing whitespace at the end of lines
* @see https://eslint.style/rules/no-trailing-spaces
*/
'@stylistic/no-trailing-spaces': NoTrailingSpacesRuleOptions;
/**
* Disallow whitespace before properties
* @see https://eslint.style/rules/no-whitespace-before-property
*/
'@stylistic/no-whitespace-before-property': NoWhitespaceBeforePropertyRuleOptions;
/**
* Enforce the location of single-line statements
* @see https://eslint.style/rules/nonblock-statement-body-position
*/
'@stylistic/nonblock-statement-body-position': NonblockStatementBodyPositionRuleOptions;
/**
* Enforce consistent line breaks after opening and before closing braces
* @see https://eslint.style/rules/object-curly-newline
*/
'@stylistic/object-curly-newline': ObjectCurlyNewlineRuleOptions;
/**
* Enforce consistent spacing inside braces
* @see https://eslint.style/rules/object-curly-spacing
*/
'@stylistic/object-curly-spacing': ObjectCurlySpacingRuleOptions;
/**
* Enforce placing object properties on separate lines
* @see https://eslint.style/rules/object-property-newline
*/
'@stylistic/object-property-newline': ObjectPropertyNewlineRuleOptions;
/**
* Require or disallow newlines around variable declarations
* @see https://eslint.style/rules/one-var-declaration-per-line
*/
'@stylistic/one-var-declaration-per-line': OneVarDeclarationPerLineRuleOptions;
/**
* Enforce consistent linebreak style for operators
* @see https://eslint.style/rules/operator-linebreak
*/
'@stylistic/operator-linebreak': OperatorLinebreakRuleOptions;
/**
* Require or disallow padding within blocks
* @see https://eslint.style/rules/padded-blocks
*/
'@stylistic/padded-blocks': PaddedBlocksRuleOptions;
/**
* Require or disallow padding lines between statements
* @see https://eslint.style/rules/padding-line-between-statements
*/
'@stylistic/padding-line-between-statements': PaddingLineBetweenStatementsRuleOptions;
/**
* Require quotes around object literal, type literal, interfaces and enums property names
* @see https://eslint.style/rules/quote-props
*/
'@stylistic/quote-props': QuotePropsRuleOptions;
/**
* Enforce the consistent use of either backticks, double, or single quotes
* @see https://eslint.style/rules/quotes
*/
'@stylistic/quotes': QuotesRuleOptions;
/**
* Enforce spacing between rest and spread operators and their expressions
* @see https://eslint.style/rules/rest-spread-spacing
*/
'@stylistic/rest-spread-spacing': RestSpreadSpacingRuleOptions;
/**
* Require or disallow semicolons instead of ASI
* @see https://eslint.style/rules/semi
*/
'@stylistic/semi': SemiRuleOptions;
/**
* Enforce consistent spacing before and after semicolons
* @see https://eslint.style/rules/semi-spacing
*/
'@stylistic/semi-spacing': SemiSpacingRuleOptions;
/**
* Enforce location of semicolons
* @see https://eslint.style/rules/semi-style
*/
'@stylistic/semi-style': SemiStyleRuleOptions;
/**
* Enforce consistent spacing before blocks
* @see https://eslint.style/rules/space-before-blocks
*/
'@stylistic/space-before-blocks': SpaceBeforeBlocksRuleOptions;
/**
* Enforce consistent spacing before function parenthesis
* @see https://eslint.style/rules/space-before-function-paren
*/
'@stylistic/space-before-function-paren': SpaceBeforeFunctionParenRuleOptions;
/**
* Enforce consistent spacing inside parentheses
* @see https://eslint.style/rules/space-in-parens
*/
'@stylistic/space-in-parens': SpaceInParensRuleOptions;
/**
* Require spacing around infix operators
* @see https://eslint.style/rules/space-infix-ops
*/
'@stylistic/space-infix-ops': SpaceInfixOpsRuleOptions;
/**
* Enforce consistent spacing before or after unary operators
* @see https://eslint.style/rules/space-unary-ops
*/
'@stylistic/space-unary-ops': SpaceUnaryOpsRuleOptions;
/**
* Enforce consistent spacing after the `//` or `/*` in a comment
* @see https://eslint.style/rules/spaced-comment
*/
'@stylistic/spaced-comment': SpacedCommentRuleOptions;
/**
* Enforce spacing around colons of switch statements
* @see https://eslint.style/rules/switch-colon-spacing
*/
'@stylistic/switch-colon-spacing': SwitchColonSpacingRuleOptions;
/**
* Require or disallow spacing around embedded expressions of template strings
* @see https://eslint.style/rules/template-curly-spacing
*/
'@stylistic/template-curly-spacing': TemplateCurlySpacingRuleOptions;
/**
* Require or disallow spacing between template tags and their literals
* @see https://eslint.style/rules/template-tag-spacing
*/
'@stylistic/template-tag-spacing': TemplateTagSpacingRuleOptions;
/**
* Require consistent spacing around type annotations
* @see https://eslint.style/rules/type-annotation-spacing
*/
'@stylistic/type-annotation-spacing': TypeAnnotationSpacingRuleOptions;
/**
* Enforces consistent spacing inside TypeScript type generics
* @see https://eslint.style/rules/type-generic-spacing
*/
'@stylistic/type-generic-spacing': TypeGenericSpacingRuleOptions;
/**
* Expect space before the type declaration in the named tuple
* @see https://eslint.style/rules/type-named-tuple-spacing
*/
'@stylistic/type-named-tuple-spacing': TypeNamedTupleSpacingRuleOptions;
/**
* Require parentheses around immediate `function` invocations
* @see https://eslint.style/rules/wrap-iife
*/
'@stylistic/wrap-iife': WrapIifeRuleOptions;
/**
* Require parenthesis around regex literals
* @see https://eslint.style/rules/wrap-regex
*/
'@stylistic/wrap-regex': WrapRegexRuleOptions;
/**
* Require or disallow spacing around the `*` in `yield*` expressions
* @see https://eslint.style/rules/yield-star-spacing
*/
'@stylistic/yield-star-spacing': YieldStarSpacingRuleOptions;
}
interface UnprefixedRuleOptions {
/**
* Enforce linebreaks after opening and before closing array brackets
* @see https://eslint.style/rules/array-bracket-newline
*/
'array-bracket-newline': ArrayBracketNewlineRuleOptions;
/**
* Enforce consistent spacing inside array brackets
* @see https://eslint.style/rules/array-bracket-spacing
*/
'array-bracket-spacing': ArrayBracketSpacingRuleOptions;
/**
* Enforce line breaks after each array element
* @see https://eslint.style/rules/array-element-newline
*/
'array-element-newline': ArrayElementNewlineRuleOptions;
/**
* Require parentheses around arrow function arguments
* @see https://eslint.style/rules/arrow-parens
*/
'arrow-parens': ArrowParensRuleOptions;
/**
* Enforce consistent spacing before and after the arrow in arrow functions
* @see https://eslint.style/rules/arrow-spacing
*/
'arrow-spacing': ArrowSpacingRuleOptions;
/**
* Disallow or enforce spaces inside of blocks after opening block and before closing block
* @see https://eslint.style/rules/block-spacing
*/
'block-spacing': BlockSpacingRuleOptions;
/**
* Enforce consistent brace style for blocks
* @see https://eslint.style/rules/brace-style
*/
'brace-style': BraceStyleRuleOptions;
/**
* Require or disallow trailing commas
* @see https://eslint.style/rules/comma-dangle
*/
'comma-dangle': CommaDangleRuleOptions;
/**
* Enforce consistent spacing before and after commas
* @see https://eslint.style/rules/comma-spacing
*/
'comma-spacing': CommaSpacingRuleOptions;
/**
* Enforce consistent comma style
* @see https://eslint.style/rules/comma-style
*/
'comma-style': CommaStyleRuleOptions;
/**
* Enforce consistent spacing inside computed property brackets
* @see https://eslint.style/rules/computed-property-spacing
*/
'computed-property-spacing': ComputedPropertySpacingRuleOptions;
/**
* Enforce consistent line breaks after opening and before closing braces
* @see https://eslint.style/rules/curly-newline
*/
'curly-newline': CurlyNewlineRuleOptions;
/**
* Enforce consistent newlines before and after dots
* @see https://eslint.style/rules/dot-location
*/
'dot-location': DotLocationRuleOptions;
/**
* Require or disallow newline at the end of files
* @see https://eslint.style/rules/eol-last
*/
'eol-last': EolLastRuleOptions;
/**
* Enforce line breaks between arguments of a function call
* @see https://eslint.style/rules/function-call-argument-newline
*/
'function-call-argument-newline': FunctionCallArgumentNewlineRuleOptions;
/**
* Require or disallow spacing between function identifiers and their invocations
* @see https://eslint.style/rules/function-call-spacing
*/
'function-call-spacing': FunctionCallSpacingRuleOptions;
/**
* Enforce consistent line breaks inside function parentheses
* @see https://eslint.style/rules/function-paren-newline
*/
'function-paren-newline': FunctionParenNewlineRuleOptions;
/**
* Enforce consistent spacing around `*` operators in generator functions
* @see https://eslint.style/rules/generator-star-spacing
*/
'generator-star-spacing': GeneratorStarSpacingRuleOptions;
/**
* Enforce the location of arrow function bodies
* @see https://eslint.style/rules/implicit-arrow-linebreak
*/
'implicit-arrow-linebreak': ImplicitArrowLinebreakRuleOptions;
/**
* Enforce consistent indentation
* @see https://eslint.style/rules/indent
*/
'indent': IndentRuleOptions;
/**
* Indentation for binary operators
* @see https://eslint.style/rules/indent-binary-ops
*/
'indent-binary-ops': IndentBinaryOpsRuleOptions;
/**
* Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
* @see https://eslint.style/rules/jsx-child-element-spacing
*/
'jsx-child-element-spacing': JsxChildElementSpacingRuleOptions;
/**
* Enforce closing bracket location in JSX
* @see https://eslint.style/rules/jsx-closing-bracket-location
*/
'jsx-closing-bracket-location': JsxClosingBracketLocationRuleOptions;
/**
* Enforce closing tag location for multiline JSX
* @see https://eslint.style/rules/jsx-closing-tag-location
*/
'jsx-closing-tag-location': JsxClosingTagLocationRuleOptions;
/**
* Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
* @see https://eslint.style/rules/jsx-curly-brace-presence
*/
'jsx-curly-brace-presence': JsxCurlyBracePresenceRuleOptions;
/**
* Enforce consistent linebreaks in curly braces in JSX attributes and expressions
* @see https://eslint.style/rules/jsx-curly-newline
*/
'jsx-curly-newline': JsxCurlyNewlineRuleOptions;
/**
* Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
* @see https://eslint.style/rules/jsx-curly-spacing
*/
'jsx-curly-spacing': JsxCurlySpacingRuleOptions;
/**
* Enforce or disallow spaces around equal signs in JSX attributes
* @see https://eslint.style/rules/jsx-equals-spacing
*/
'jsx-equals-spacing': JsxEqualsSpacingRuleOptions;
/**
* Enforce proper position of the first property in JSX
* @see https://eslint.style/rules/jsx-first-prop-new-line
*/
'jsx-first-prop-new-line': JsxFirstPropNewLineRuleOptions;
/**
* Enforce line breaks before and after JSX elements when they are used as arguments to a function.
* @see https://eslint.style/rules/jsx-function-call-newline
*/
'jsx-function-call-newline': JsxFunctionCallNewlineRuleOptions;
/**
* Enforce JSX indentation. Deprecated, use `indent` rule instead.
* @see https://eslint.style/rules/jsx-indent
*/
'jsx-indent': JsxIndentRuleOptions;
/**
* Enforce props indentation in JSX
* @see https://eslint.style/rules/jsx-indent-props
*/
'jsx-indent-props': JsxIndentPropsRuleOptions;
/**
* Enforce maximum of props on a single line in JSX
* @see https://eslint.style/rules/jsx-max-props-per-line
*/
'jsx-max-props-per-line': JsxMaxPropsPerLineRuleOptions;
/**
* Require or prevent a new line after jsx elements and expressions.
* @see https://eslint.style/rules/jsx-newline
*/
'jsx-newline': JsxNewlineRuleOptions;
/**
* Require one JSX element per line
* @see https://eslint.style/rules/jsx-one-expression-per-line
*/
'jsx-one-expression-per-line': JsxOneExpressionPerLineRuleOptions;
/**
* Enforce PascalCase for user-defined JSX components
* @see https://eslint.style/rules/jsx-pascal-case
*/
'jsx-pascal-case': JsxPascalCaseRuleOptions;
/**
* Disallow multiple spaces between inline JSX props. Deprecated, use `no-multi-spaces` rule instead.
* @see https://eslint.style/rules/jsx-props-no-multi-spaces
*/
'jsx-props-no-multi-spaces': JsxPropsNoMultiSpacesRuleOptions;
/**
* Enforce consistent line break styles for JSX props
* @see https://eslint.style/rules/jsx-props-style
*/
'exp-jsx-props-style': JsxPropsStyleRuleOptions;
/**
* Enforce the consistent use of either double or single quotes in JSX attributes
* @see https://eslint.style/rules/jsx-quotes
*/
'jsx-quotes': JsxQuotesRuleOptions;
/**
* Disallow extra closing tags for components without children
* @see https://eslint.style/rules/jsx-self-closing-comp
*/
'jsx-self-closing-comp': JsxSelfClosingCompRuleOptions;
/**
* Enforce props alphabetical sorting
* @see https://eslint.style/rules/jsx-sort-props
*/
'jsx-sort-props': JsxSortPropsRuleOptions;
/**
* Enforce whitespace in and around the JSX opening and closing brackets
* @see https://eslint.style/rules/jsx-tag-spacing
*/
'jsx-tag-spacing': JsxTagSpacingRuleOptions;
/**
* Disallow missing parentheses around multiline JSX
* @see https://eslint.style/rules/jsx-wrap-multilines
*/
'jsx-wrap-multilines': JsxWrapMultilinesRuleOptions;
/**
* Enforce consistent spacing between property names and type annotations in types and interfaces
* @see https://eslint.style/rules/key-spacing
*/
'key-spacing': KeySpacingRuleOptions;
/**
* Enforce consistent spacing before and after keywords
* @see https://eslint.style/rules/keyword-spacing
*/
'keyword-spacing': KeywordSpacingRuleOptions;
/**
* Enforce position of line comments
* @see https://eslint.style/rules/line-comment-position
*/
'line-comment-position': LineCommentPositionRuleOptions;
/**
* Enforce consistent linebreak style
* @see https://eslint.style/rules/linebreak-style
*/
'linebreak-style': LinebreakStyleRuleOptions;
/**
* Require empty lines around comments
* @see https://eslint.style/rules/lines-around-comment
*/
'lines-around-comment': LinesAroundCommentRuleOptions;
/**
* Require or disallow an empty line between class members
* @see https://eslint.style/rules/lines-between-class-members
*/
'lines-between-class-members': LinesBetweenClassMembersRuleOptions;
/**
* Enforce consistent spacing and line break styles inside brackets.
* @see https://eslint.style/rules/list-style
*/
'exp-list-style': ListStyleRuleOptions;
/**
* Enforce a maximum line length
* @see https://eslint.style/rules/max-len
*/
'max-len': MaxLenRuleOptions;
/**
* Enforce a maximum number of statements allowed per line
* @see https://eslint.style/rules/max-statements-per-line
*/
'max-statements-per-line': MaxStatementsPerLineRuleOptions;
/**
* Require a specific member delimiter style for interfaces and type literals
* @see https://eslint.style/rules/member-delimiter-style
*/
'member-delimiter-style': MemberDelimiterStyleRuleOptions;
/**
* Enforce a particular style for multiline comments
* @see https://eslint.style/rules/multiline-comment-style
*/
'multiline-comment-style': MultilineCommentStyleRuleOptions;
/**
* Enforce newlines between operands of ternary expressions
* @see https://eslint.style/rules/multiline-ternary
*/
'multiline-ternary': MultilineTernaryRuleOptions;
/**
* Enforce or disallow parentheses when invoking a constructor with no arguments
* @see https://eslint.style/rules/new-parens
*/
'new-parens': NewParensRuleOptions;
/**
* Require a newline after each call in a method chain
* @see https://eslint.style/rules/newline-per-chained-call
*/
'newline-per-chained-call': NewlinePerChainedCallRuleOptions;
/**
* Disallow arrow functions where they could be confused with comparisons
* @see https://eslint.style/rules/no-confusing-arrow
*/
'no-confusing-arrow': NoConfusingArrowRuleOptions;
/**
* Disallow unnecessary parentheses
* @see https://eslint.style/rules/no-extra-parens
*/
'no-extra-parens': NoExtraParensRuleOptions;
/**
* Disallow unnecessary semicolons
* @see https://eslint.style/rules/no-extra-semi
*/
'no-extra-semi': NoExtraSemiRuleOptions;
/**
* Disallow leading or trailing decimal points in numeric literals
* @see https://eslint.style/rules/no-floating-decimal
*/
'no-floating-decimal': NoFloatingDecimalRuleOptions;
/**
* Disallow mixed binary operators
* @see https://eslint.style/rules/no-mixed-operators
*/
'no-mixed-operators': NoMixedOperatorsRuleOptions;
/**
* Disallow mixed spaces and tabs for indentation
* @see https://eslint.style/rules/no-mixed-spaces-and-tabs
*/
'no-mixed-spaces-and-tabs': NoMixedSpacesAndTabsRuleOptions;
/**
* Disallow multiple spaces
* @see https://eslint.style/rules/no-multi-spaces
*/
'no-multi-spaces': NoMultiSpacesRuleOptions;
/**
* Disallow multiple empty lines
* @see https://eslint.style/rules/no-multiple-empty-lines
*/
'no-multiple-empty-lines': NoMultipleEmptyLinesRuleOptions;
/**
* Disallow all tabs
* @see https://eslint.style/rules/no-tabs
*/
'no-tabs': NoTabsRuleOptions;
/**
* Disallow trailing whitespace at the end of lines
* @see https://eslint.style/rules/no-trailing-spaces
*/
'no-trailing-spaces': NoTrailingSpacesRuleOptions;
/**
* Disallow whitespace before properties
* @see https://eslint.style/rules/no-whitespace-before-property
*/
'no-whitespace-before-property': NoWhitespaceBeforePropertyRuleOptions;
/**
* Enforce the location of single-line statements
* @see https://eslint.style/rules/nonblock-statement-body-position
*/
'nonblock-statement-body-position': NonblockStatementBodyPositionRuleOptions;
/**
* Enforce consistent line breaks after opening and before closing braces
* @see https://eslint.style/rules/object-curly-newline
*/
'object-curly-newline': ObjectCurlyNewlineRuleOptions;
/**
* Enforce consistent spacing inside braces
* @see https://eslint.style/rules/object-curly-spacing
*/
'object-curly-spacing': ObjectCurlySpacingRuleOptions;
/**
* Enforce placing object properties on separate lines
* @see https://eslint.style/rules/object-property-newline
*/
'object-property-newline': ObjectPropertyNewlineRuleOptions;
/**
* Require or disallow newlines around variable declarations
* @see https://eslint.style/rules/one-var-declaration-per-line
*/
'one-var-declaration-per-line': OneVarDeclarationPerLineRuleOptions;
/**
* Enforce consistent linebreak style for operators
* @see https://eslint.style/rules/operator-linebreak
*/
'operator-linebreak': OperatorLinebreakRuleOptions;
/**
* Require or disallow padding within blocks
* @see https://eslint.style/rules/padded-blocks
*/
'padded-blocks': PaddedBlocksRuleOptions;
/**
* Require or disallow padding lines between statements
* @see https://eslint.style/rules/padding-line-between-statements
*/
'padding-line-between-statements': PaddingLineBetweenStatementsRuleOptions;
/**
* Require quotes around object literal, type literal, interfaces and enums property names
* @see https://eslint.style/rules/quote-props
*/
'quote-props': QuotePropsRuleOptions;
/**
* Enforce the consistent use of either backticks, double, or single quotes
* @see https://eslint.style/rules/quotes
*/
'quotes': QuotesRuleOptions;
/**
* Enforce spacing between rest and spread operators and their expressions
* @see https://eslint.style/rules/rest-spread-spacing
*/
'rest-spread-spacing': RestSpreadSpacingRuleOptions;
/**
* Require or disallow semicolons instead of ASI
* @see https://eslint.style/rules/semi
*/
'semi': SemiRuleOptions;
/**
* Enforce consistent spacing before and after semicolons
* @see https://eslint.style/rules/semi-spacing
*/
'semi-spacing': SemiSpacingRuleOptions;
/**
* Enforce location of semicolons
* @see https://eslint.style/rules/semi-style
*/
'semi-style': SemiStyleRuleOptions;
/**
* Enforce consistent spacing before blocks
* @see https://eslint.style/rules/space-before-blocks
*/
'space-before-blocks': SpaceBeforeBlocksRuleOptions;
/**
* Enforce consistent spacing before function parenthesis
* @see https://eslint.style/rules/space-before-function-paren
*/
'space-before-function-paren': SpaceBeforeFunctionParenRuleOptions;
/**
* Enforce consistent spacing inside parentheses
* @see https://eslint.style/rules/space-in-parens
*/
'space-in-parens': SpaceInParensRuleOptions;
/**
* Require spacing around infix operators
* @see https://eslint.style/rules/space-infix-ops
*/
'space-infix-ops': SpaceInfixOpsRuleOptions;
/**
* Enforce consistent spacing before or after unary operators
* @see https://eslint.style/rules/space-unary-ops
*/
'space-unary-ops': SpaceUnaryOpsRuleOptions;
/**
* Enforce consistent spacing after the `//` or `/*` in a comment
* @see https://eslint.style/rules/spaced-comment
*/
'spaced-comment': SpacedCommentRuleOptions;
/**
* Enforce spacing around colons of switch statements
* @see https://eslint.style/rules/switch-colon-spacing
*/
'switch-colon-spacing': SwitchColonSpacingRuleOptions;
/**
* Require or disallow spacing around embedded expressions of template strings
* @see https://eslint.style/rules/template-curly-spacing
*/
'template-curly-spacing': TemplateCurlySpacingRuleOptions;
/**
* Require or disallow spacing between template tags and their literals
* @see https://eslint.style/rules/template-tag-spacing
*/
'template-tag-spacing': TemplateTagSpacingRuleOptions;
/**
* Require consistent spacing around type annotations
* @see https://eslint.style/rules/type-annotation-spacing
*/
'type-annotation-spacing': TypeAnnotationSpacingRuleOptions;
/**
* Enforces consistent spacing inside TypeScript type generics
* @see https://eslint.style/rules/type-generic-spacing
*/
'type-generic-spacing': TypeGenericSpacingRuleOptions;
/**
* Expect space before the type declaration in the named tuple
* @see https://eslint.style/rules/type-named-tuple-spacing
*/
'type-named-tuple-spacing': TypeNamedTupleSpacingRuleOptions;
/**
* Require parentheses around immediate `function` invocations
* @see https://eslint.style/rules/wrap-iife
*/
'wrap-iife': WrapIifeRuleOptions;
/**
* Require parenthesis around regex literals
* @see https://eslint.style/rules/wrap-regex
*/
'wrap-regex': WrapRegexRuleOptions;
/**
* Require or disallow spacing around the `*` in `yield*` expressions
* @see https://eslint.style/rules/yield-star-spacing
*/
'yield-star-spacing': YieldStarSpacingRuleOptions;
}
//#endregion
export { RuleOptions, UnprefixedRuleOptions };
@@ -0,0 +1,22 @@
//#region src/adapter/cloudflare-workers/utils.ts
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
const getContentFromKVAsset = async (path, options) => {
let ASSET_MANIFEST;
if (options && options.manifest) {
if (typeof options.manifest === "string") ASSET_MANIFEST = JSON.parse(options.manifest);
else ASSET_MANIFEST = options.manifest;
} else if (typeof __STATIC_CONTENT_MANIFEST === "string") ASSET_MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST);
else ASSET_MANIFEST = __STATIC_CONTENT_MANIFEST;
let ASSET_NAMESPACE;
if (options && options.namespace) ASSET_NAMESPACE = options.namespace;
else ASSET_NAMESPACE = __STATIC_CONTENT;
const key = ASSET_MANIFEST[path];
if (!key) return null;
const content = await ASSET_NAMESPACE.get(key, { type: "stream" });
if (!content) return null;
return content;
};
//#endregion
export { getContentFromKVAsset };
@@ -0,0 +1,114 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "字符", verb: "包含" },
file: { unit: "字节", verb: "包含" },
array: { unit: "项", verb: "包含" },
set: { unit: "项", verb: "包含" },
map: { unit: "项", verb: "包含" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "输入",
email: "电子邮件",
url: "URL",
emoji: "表情符号",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO日期时间",
date: "ISO日期",
time: "ISO时间",
duration: "ISO时长",
ipv4: "IPv4地址",
ipv6: "IPv6地址",
mac: "MAC地址",
cidrv4: "IPv4网段",
cidrv6: "IPv6网段",
base64: "base64编码字符串",
base64url: "base64url编码字符串",
json_string: "JSON字符串",
e164: "E.164号码",
credit_card: "信用卡号",
currency_code: "货币代码",
iban: "IBAN",
jwt: "JWT",
template_literal: "输入",
};
const TypeDictionary = {
nan: "NaN",
number: "数字",
array: "数组",
null: "空值(null)",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `无效输入:期望 instanceof ${issue.expected},实际接收 ${received}`;
}
return `无效输入:期望 ${expected},实际接收 ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `无效输入:期望 ${util.stringifyPrimitive(issue.values[0])}`;
return `无效选项:期望以下之一 ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "个元素"}`;
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `无效字符串:必须以 "${_issue.prefix}" 开头`;
if (_issue.format === "ends_with")
return `无效字符串:必须以 "${_issue.suffix}" 结尾`;
if (_issue.format === "includes")
return `无效字符串:必须包含 "${_issue.includes}"`;
if (_issue.format === "regex")
return `无效字符串:必须满足正则表达式 ${_issue.pattern}`;
return `无效${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `无效数字:必须是 ${issue.divisor} 的倍数`;
case "unrecognized_keys":
return `出现未知的键(key): ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} 中的键(key)无效`;
case "invalid_union":
return "无效输入";
case "invalid_element":
return `${issue.origin} 中包含无效值(value)`;
default:
return `无效输入`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
{"version":3,"file":"scoring.mjs","sources":["../../../src/matcher/date/scoring.ts"],"sourcesContent":[null],"names":["year","separator","yearSpace","Math","max","abs","REFERENCE_YEAR","MIN_YEAR_SPACE","guesses"],"mappings":";;AAGA,kBAAe,CAAC;EAAEA,IAAI;AAAEC,EAAAA;AAAS,CAAkC,KAAI;AACrE;AACA,EAAA,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACL,IAAI,GAAGM,cAAc,CAAC,EAAEC,cAAc,CAAC;AAE3E,EAAA,IAAIC,OAAO,GAAGN,SAAS,GAAG,GAAG;AAC7B;AACA,EAAA,IAAID,SAAS,EAAE;AACbO,IAAAA,OAAO,IAAI,CAAC;AACd,EAAA;AACA,EAAA,OAAOA,OAAO;AAChB,CAAC;;;;"}
@@ -0,0 +1,49 @@
import type { ChildNode, ParentNode } from "domhandler";
/**
* Remove an element from the dom
*
* @category Manipulation
* @param elem The element to be removed
*/
export declare function removeElement(elem: ChildNode): void;
/**
* Replace an element in the dom
*
* @category Manipulation
* @param elem The element to be replaced
* @param replacement The element to be added
*/
export declare function replaceElement(elem: ChildNode, replacement: ChildNode): void;
/**
* Append a child to an element.
*
* @category Manipulation
* @param parent The element to append to.
* @param child The element to be added as a child.
*/
export declare function appendChild(parent: ParentNode, child: ChildNode): void;
/**
* Append an element after another.
*
* @category Manipulation
* @param elem The element to append after.
* @param next The element be added.
*/
export declare function append(elem: ChildNode, next: ChildNode): void;
/**
* Prepend a child to an element.
*
* @category Manipulation
* @param parent The element to prepend before.
* @param child The element to be added as a child.
*/
export declare function prependChild(parent: ParentNode, child: ChildNode): void;
/**
* Prepend an element before another.
*
* @category Manipulation
* @param elem The element to prepend before.
* @param prev The element be added.
*/
export declare function prepend(elem: ChildNode, prev: ChildNode): void;
//# sourceMappingURL=manipulation.d.ts.map
@@ -0,0 +1,72 @@
# Installation
> `npm install --save @types/esrecurse`
# Summary
This package contains type definitions for esrecurse (https://github.com/estools/esrecurse).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse/index.d.ts)
````ts
/**
* Options for the Visitor constructor and visit function.
*/
interface VisitorOptions {
/**
* Fallback strategy for unknown node types.
* @default 'iteration'
*/
fallback?: "iteration" | ((node: any) => string[]);
/**
* Custom keys for child nodes by node type.
* @default {}
*/
childVisitorKeys?: Record<string, string[]>;
}
/**
* A visitor class for recursively traversing ECMAScript AST.
*/
declare class Visitor {
/**
* Creates a new Visitor instance.
* @param options Configuration options for the visitor.
*/
constructor(visitor?: Visitor | null, options?: VisitorOptions | null);
/**
* Visits a node, invoking the appropriate handler.
* @param node The AST node to visit.
*/
visit(node: any): void;
/**
* Visits the children of a node based on childVisitorKeys.
* @param node The AST node whose children to visit.
*/
visitChildren(node: any): void;
}
/**
* Visits an AST node with the specified visitor.
* @param ast The AST node to traverse.
* @param visitor A visitor instance or visitor object.
* @param options Configuration options for the traversal.
*/
declare function visit(
ast: any,
visitor?: Visitor | Record<string, (node: any) => void> | null,
options?: VisitorOptions,
): void;
export { visit, Visitor, type VisitorOptions };
````
### Additional Details
* Last updated: Sat, 19 Jul 2025 03:47:05 GMT
* Dependencies: none
# Credits
These definitions were written by [Jimmy Leung](https://github.com/hkleungai).
@@ -0,0 +1 @@
{"version":3,"file":"square-arrow-down-right.js","sources":["../../../src/icons/square-arrow-down-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareArrowDownRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Im04IDggOCA4IiAvPgogIDxwYXRoIGQ9Ik0xNiA4djhIOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-arrow-down-right\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SquareArrowDownRight = createLucideIcon('SquareArrowDownRight', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'm8 8 8 8', key: '1imecy' }],\n ['path', { d: 'M16 8v8H8', key: '1lbpgo' }],\n]);\n\nexport default SquareArrowDownRight;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,iBAAiB,sBAAwB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,140 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*
* Based on the Base 64 VLQ implementation in Closure Compiler:
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
*
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var base64 = require('./base64');
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
// the next four bits are the actual value, and the 6th bit is the
// continuation bit. The continuation bit tells us whether there are more
// digits in this value following this digit.
//
// Continuation
// | Sign
// | |
// V V
// 101011
var VLQ_BASE_SHIFT = 5;
// binary: 100000
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
// binary: 011111
var VLQ_BASE_MASK = VLQ_BASE - 1;
// binary: 100000
var VLQ_CONTINUATION_BIT = VLQ_BASE;
/**
* Converts from a two-complement value to a value where the sign bit is
* placed in the least significant bit. For example, as decimals:
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
*/
function toVLQSigned(aValue) {
return aValue < 0
? ((-aValue) << 1) + 1
: (aValue << 1) + 0;
}
/**
* Converts to a two-complement value from a value where the sign bit is
* placed in the least significant bit. For example, as decimals:
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
*/
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative
? -shifted
: shifted;
}
/**
* Returns the base 64 VLQ encoded value.
*/
exports.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
// There are still more digits in this value, so we must make sure the
// continuation bit is marked.
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
/**
* Decodes the next base 64 VLQ value from the given string and returns the
* value and the rest of the string via the out parameter.
*/
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift = 0;
var continuation, digit;
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift);
shift += VLQ_BASE_SHIFT;
} while (continuation);
aOutParam.value = fromVLQSigned(result);
aOutParam.rest = aIndex;
};
@@ -0,0 +1,6 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type MessageIds = 'defineInitializer' | 'defineInitializerSuggestion';
declare const _default: TSESLint.RuleModule<MessageIds, [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,42 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
function checkErrors(a: z.ZodTypeAny, bad: any) {
let expected: any;
try {
a.parse(bad);
} catch (error) {
expected = (error as z.ZodError).formErrors;
}
try {
a.nullable().parse(bad);
} catch (error) {
expect((error as z.ZodError).formErrors).toEqual(expected);
}
}
test("Should have error messages appropriate for the underlying type", () => {
checkErrors(z.string().min(2), 1);
z.string().min(2).nullable().parse(null);
checkErrors(z.number().gte(2), 1);
z.number().gte(2).nullable().parse(null);
checkErrors(z.boolean(), "");
z.boolean().nullable().parse(null);
checkErrors(z.null(), null);
z.null().nullable().parse(null);
checkErrors(z.null(), {});
z.null().nullable().parse(null);
checkErrors(z.object({}), 1);
z.object({}).nullable().parse(null);
checkErrors(z.tuple([]), 1);
z.tuple([]).nullable().parse(null);
checkErrors(z.unknown(), 1);
z.unknown().nullable().parse(null);
});
test("unwrap", () => {
const unwrapped = z.string().nullable().unwrap();
expect(unwrapped).toBeInstanceOf(z.ZodString);
});
@@ -0,0 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=a},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";n.r(t),n.d(t,"styleSingleton",(function(){return l})),n.d(t,"stylesheetSingleton",(function(){return c})),n.d(t,"styleHookSingleton",(function(){return i}));var r,o=n(0);function u(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=r||n.nc;return t&&e.setAttribute("nonce",t),e}var c=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=u())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},i=function(){var e=c();return function(t){o.useEffect((function(){return e.add(t),function(){e.remove()}}),[])}},l=function(){var e=i();return function(t){var n=t.styles;return e(n),null}}}]);
@@ -0,0 +1,50 @@
{
"name": "merge-descriptors",
"version": "2.0.0",
"description": "Merge objects using their property descriptors",
"license": "MIT",
"repository": "sindresorhus/merge-descriptors",
"funding": "https://github.com/sponsors/sindresorhus",
"contributors": [
"Jonathan Ong <me@jongleberry.com>",
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Mike Grabowski <grabbou@gmail.com>",
"Sindre Sorhus <sindresorhus@gmail.com>"
],
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"main": "./index.js",
"types": "./index.d.ts",
"sideEffects": false,
"engines": {
"node": ">=18"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"merge",
"descriptors",
"object",
"property",
"properties",
"merging",
"getter",
"setter"
],
"devDependencies": {
"ava": "^5.3.1",
"xo": "^0.56.0"
},
"xo": {
"rules": {
"unicorn/prefer-module": "off"
}
}
}
@@ -0,0 +1,4 @@
import { AfterGenerateHook, AfterResponseHook, BeforeRequestHook, DEFAULT_OUTPUT_DIR, FileSystemModule, SSGPlugin, ToSSGAdaptorInterface, ToSSGInterface, ToSSGOptions, ToSSGResult, combineAfterGenerateHooks, combineAfterResponseHooks, combineBeforeRequestHooks, defaultExtensionMap, fetchRoutesContent, saveContentToFile, toSSG } from "./ssg.js";
import { X_HONO_DISABLE_SSG_HEADER_KEY, disableSSG, isSSGContext, onlySSG, ssgParams } from "./middleware.js";
import { defaultPlugin, redirectPlugin } from "./plugins.js";
export { AfterGenerateHook, AfterResponseHook, BeforeRequestHook, DEFAULT_OUTPUT_DIR, FileSystemModule, SSGPlugin, ToSSGAdaptorInterface, ToSSGInterface, ToSSGOptions, ToSSGResult, X_HONO_DISABLE_SSG_HEADER_KEY, combineAfterGenerateHooks, combineAfterResponseHooks, combineBeforeRequestHooks, defaultExtensionMap, defaultPlugin, disableSSG, fetchRoutesContent, isSSGContext, onlySSG, redirectPlugin, saveContentToFile, ssgParams, toSSG };
@@ -0,0 +1,4 @@
import { ZodEffectsDef } from "zod/v3";
import { JsonSchema7Type } from "../parseTypes.js";
import { Refs } from "../Refs.js";
export declare function parseEffectsDef(_def: ZodEffectsDef, refs: Refs): JsonSchema7Type | undefined;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,231 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'restrict-plus-operands',
meta: {
type: 'problem',
docs: {
description: 'Require both operands of addition to be the same type and be `bigint`, `number`, or `string`',
recommended: {
recommended: true,
strict: [
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumberAndString: false,
allowRegExp: false,
},
],
},
requiresTypeChecking: true,
},
messages: {
bigintAndNumber: "Numeric '+' operations must either be both bigints or both numbers. Got `{{left}}` + `{{right}}`.",
invalid: "Invalid operand for a '+' operation. Operands must each be a number or {{stringLike}}. Got `{{type}}`.",
mismatched: "Operands of '+' operations must be a number or {{stringLike}}. Got `{{left}}` + `{{right}}`.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowAny: {
type: 'boolean',
description: 'Whether to allow `any` typed values.',
},
allowBoolean: {
type: 'boolean',
description: 'Whether to allow `boolean` typed values.',
},
allowNullish: {
type: 'boolean',
description: 'Whether to allow potentially `null` or `undefined` typed values.',
},
allowNumberAndString: {
type: 'boolean',
description: 'Whether to allow `bigint`/`number` typed values and `string` typed values to be added together.',
},
allowRegExp: {
type: 'boolean',
description: 'Whether to allow `regexp` typed values.',
},
skipCompoundAssignments: {
type: 'boolean',
description: 'Whether to skip compound assignments such as `+=`.',
},
},
},
],
},
defaultOptions: [
{
allowAny: true,
allowBoolean: true,
allowNullish: true,
allowNumberAndString: true,
allowRegExp: true,
skipCompoundAssignments: false,
},
],
create(context, [{ allowAny, allowBoolean, allowNullish, allowNumberAndString, allowRegExp, skipCompoundAssignments, },]) {
const services = (0, util_1.getParserServices)(context);
const typeChecker = services.program.getTypeChecker();
const stringLikes = [
allowAny && '`any`',
allowBoolean && '`boolean`',
allowNullish && '`null`',
allowRegExp && '`RegExp`',
allowNullish && '`undefined`',
].filter((value) => typeof value === 'string');
const stringLike = stringLikes.length
? stringLikes.length === 1
? `string, allowing a string + ${stringLikes[0]}`
: `string, allowing a string + any of: ${stringLikes.join(', ')}`
: 'string';
function getTypeConstrained(node) {
return typeChecker.getBaseTypeOfLiteralType((0, util_1.getConstrainedTypeAtLocation)(services, node));
}
function checkPlusOperands(node) {
const leftType = getTypeConstrained(node.left);
const rightType = getTypeConstrained(node.right);
if (leftType === rightType &&
tsutils.isTypeFlagSet(leftType, ts.TypeFlags.BigIntLike |
ts.TypeFlags.NumberLike |
ts.TypeFlags.StringLike)) {
return;
}
let hadIndividualComplaint = false;
for (const [baseNode, baseType, otherType] of [
[node.left, leftType, rightType],
[node.right, rightType, leftType],
]) {
if (isTypeFlagSetInUnion(baseType, ts.TypeFlags.ESSymbolLike |
ts.TypeFlags.Never |
ts.TypeFlags.Unknown) ||
(!allowAny && isTypeFlagSetInUnion(baseType, ts.TypeFlags.Any)) ||
(!allowBoolean &&
isTypeFlagSetInUnion(baseType, ts.TypeFlags.BooleanLike)) ||
(!allowNullish &&
(0, util_1.isTypeFlagSet)(baseType, ts.TypeFlags.Null | ts.TypeFlags.Undefined))) {
context.report({
node: baseNode,
messageId: 'invalid',
data: {
type: typeChecker.typeToString(baseType),
stringLike,
},
});
hadIndividualComplaint = true;
continue;
}
// RegExps also contain ts.TypeFlags.Any & ts.TypeFlags.Object
for (const subBaseType of tsutils.unionConstituents(baseType)) {
const typeName = (0, util_1.getTypeName)(typeChecker, subBaseType);
if (typeName === 'RegExp'
? !allowRegExp ||
tsutils.isTypeFlagSet(otherType, ts.TypeFlags.NumberLike)
: (!allowAny && (0, util_1.isTypeAnyType)(subBaseType)) ||
isDeeplyObjectType(subBaseType)) {
context.report({
node: baseNode,
messageId: 'invalid',
data: {
type: typeChecker.typeToString(subBaseType),
stringLike,
},
});
hadIndividualComplaint = true;
continue;
}
}
}
if (hadIndividualComplaint) {
return;
}
for (const [baseType, otherType] of [
[leftType, rightType],
[rightType, leftType],
]) {
if (!allowNumberAndString &&
isTypeFlagSetInUnion(baseType, ts.TypeFlags.StringLike) &&
isTypeFlagSetInUnion(otherType, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike)) {
return context.report({
node,
messageId: 'mismatched',
data: {
left: typeChecker.typeToString(leftType),
right: typeChecker.typeToString(rightType),
stringLike,
},
});
}
if (isTypeFlagSetInUnion(baseType, ts.TypeFlags.NumberLike) &&
isTypeFlagSetInUnion(otherType, ts.TypeFlags.BigIntLike)) {
return context.report({
node,
messageId: 'bigintAndNumber',
data: {
left: typeChecker.typeToString(leftType),
right: typeChecker.typeToString(rightType),
},
});
}
}
}
return {
"BinaryExpression[operator='+']": checkPlusOperands,
...(!skipCompoundAssignments && {
"AssignmentExpression[operator='+=']"(node) {
checkPlusOperands(node);
},
}),
};
},
});
function isDeeplyObjectType(type) {
return type.isIntersection()
? tsutils.intersectionConstituents(type).every(tsutils.isObjectType)
: tsutils.unionConstituents(type).every(tsutils.isObjectType);
}
function isTypeFlagSetInUnion(type, flag) {
return tsutils
.unionConstituents(type)
.some(subType => tsutils.isTypeFlagSet(subType, flag));
}
@@ -0,0 +1,84 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _types = require('../parser/tokenizer/types');
var _getImportExportSpecifierInfo = require('./getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo);
/**
* Special case code to scan for imported names in ESM TypeScript. We need to do this so we can
* properly get globals so we can compute shadowed globals.
*
* This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS
* replacement and flow type imports.
*/
function getTSImportedNames(tokens) {
const importedNames = new Set();
for (let i = 0; i < tokens.tokens.length; i++) {
if (
tokens.matches1AtIndex(i, _types.TokenType._import) &&
!tokens.matches3AtIndex(i, _types.TokenType._import, _types.TokenType.name, _types.TokenType.eq)
) {
collectNamesForImport(tokens, i, importedNames);
}
}
return importedNames;
} exports.default = getTSImportedNames;
function collectNamesForImport(
tokens,
index,
importedNames,
) {
index++;
if (tokens.matches1AtIndex(index, _types.TokenType.parenL)) {
// Dynamic import, so nothing to do
return;
}
if (tokens.matches1AtIndex(index, _types.TokenType.name)) {
importedNames.add(tokens.identifierNameAtIndex(index));
index++;
if (tokens.matches1AtIndex(index, _types.TokenType.comma)) {
index++;
}
}
if (tokens.matches1AtIndex(index, _types.TokenType.star)) {
// * as
index += 2;
importedNames.add(tokens.identifierNameAtIndex(index));
index++;
}
if (tokens.matches1AtIndex(index, _types.TokenType.braceL)) {
index++;
collectNamesForNamedImport(tokens, index, importedNames);
}
}
function collectNamesForNamedImport(
tokens,
index,
importedNames,
) {
while (true) {
if (tokens.matches1AtIndex(index, _types.TokenType.braceR)) {
return;
}
const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, tokens, index);
index = specifierInfo.endIndex;
if (!specifierInfo.isType) {
importedNames.add(specifierInfo.rightName);
}
if (tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.braceR)) {
return;
} else if (tokens.matches1AtIndex(index, _types.TokenType.braceR)) {
return;
} else if (tokens.matches1AtIndex(index, _types.TokenType.comma)) {
index++;
} else {
throw new Error(`Unexpected token: ${JSON.stringify(tokens.tokens[index])}`);
}
}
}
@@ -0,0 +1,33 @@
'use strict'
const textDecoder = new TextDecoder()
/**
* @see https://encoding.spec.whatwg.org/#utf-8-decode
* @param {Uint8Array} buffer
*/
function utf8DecodeBytes (buffer) {
if (buffer.length === 0) {
return ''
}
// 1. Let buffer be the result of peeking three bytes from
// ioQueue, converted to a byte sequence.
// 2. If buffer is 0xEF 0xBB 0xBF, then read three
// bytes from ioQueue. (Do nothing with those bytes.)
if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
buffer = buffer.subarray(3)
}
// 3. Process a queue with an instance of UTF-8’s
// decoder, ioQueue, output, and "replacement".
const output = textDecoder.decode(buffer)
// 4. Return output.
return output
}
module.exports = {
utf8DecodeBytes
}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2020_date: LibDefinition;
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("../core");
const _1 = require(".");
const requireFromString = require("require-from-string");
class AjvPack {
constructor(ajv) {
this.ajv = ajv;
}
validate(schemaKeyRef, data) {
return core_1.default.prototype.validate.call(this, schemaKeyRef, data);
}
compile(schema, meta) {
return this.getStandalone(this.ajv.compile(schema, meta));
}
getSchema(keyRef) {
const v = this.ajv.getSchema(keyRef);
if (!v)
return undefined;
return this.getStandalone(v);
}
getStandalone(v) {
return requireFromString((0, _1.default)(this.ajv, v));
}
addSchema(...args) {
this.ajv.addSchema.call(this.ajv, ...args);
return this;
}
addKeyword(...args) {
this.ajv.addKeyword.call(this.ajv, ...args);
return this;
}
}
exports.default = AjvPack;
//# sourceMappingURL=instance.js.map
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PanelLeftOpen = createLucideIcon("PanelLeftOpen", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M9 3v18", key: "fh3hqa" }],
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
]);
export { PanelLeftOpen as default };
//# sourceMappingURL=panel-left-open.js.map
@@ -0,0 +1,10 @@
'use strict';
var $Object = require('./');
var RequireObjectCoercible = require('./RequireObjectCoercible');
/** @type {import('./ToObject')} */
module.exports = function ToObject(value) {
RequireObjectCoercible(value);
return $Object(value);
};
@@ -0,0 +1,29 @@
var Ru=Object.defineProperty;var yt=(t,e)=>{for(var r in e)Ru(t,r,{get:e[r],enumerable:!0})};var Su={};yt(Su,{__debug:()=>$i,check:()=>Vi,doc:()=>ar,format:()=>Pu,formatWithCursor:()=>Ou,getSupportInfo:()=>Wi,util:()=>fr,version:()=>gu});var X=(t,e)=>(r,n,...u)=>r|1&&n==null?void 0:(e.call(n)??n[t]).apply(n,u);var vu=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},Lu=X("replaceAll",function(){if(typeof this=="string")return vu}),ne=Lu;var Ne=class{diff(e,r,n={}){let u;typeof n=="function"?(u=n,n={}):"callback"in n&&(u=n.callback);let o=this.castInput(e,n),i=this.castInput(r,n),D=this.removeEmpty(this.tokenize(o,n)),s=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(D,s,n,u)}diffWithOptionsObj(e,r,n,u){var o;let i=C=>{if(C=this.postProcess(C,n),u){setTimeout(function(){u(C)},0);return}else return C},D=r.length,s=e.length,a=1,c=D+s;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let p=(o=n.timeout)!==null&&o!==void 0?o:1/0,l=Date.now()+p,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=s&&f+1>=D)return i(this.buildValues(m[0].lastComponent,r,e));let F=-1/0,d=1/0,E=()=>{for(let C=Math.max(F,-a);C<=Math.min(d,a);C+=2){let h,_=m[C-1],P=m[C+1];_&&(m[C-1]=void 0);let A=!1;if(P){let J=P.oldPos-C;A=P&&0<=J&&J<D}let B=_&&_.oldPos+1<s;if(!A&&!B){m[C]=void 0;continue}if(!B||A&&_.oldPos<P.oldPos?h=this.addToPath(P,!0,!1,0,n):h=this.addToPath(_,!1,!0,1,n),f=this.extractCommon(h,r,e,C,n),h.oldPos+1>=s&&f+1>=D)return i(this.buildValues(h.lastComponent,r,e))||!0;m[C]=h,h.oldPos+1>=s&&(d=Math.min(d,C-1)),f+1>=D&&(F=Math.max(F,C+1))}a++};if(u)(function C(){setTimeout(function(){if(a>c||Date.now()>l)return u(void 0);E()||C()},0)})();else for(;a<=c&&Date.now()<=l;){let C=E();if(C)return C}}addToPath(e,r,n,u,o){let i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===r&&i.removed===n?{oldPos:e.oldPos+u,lastComponent:{count:i.count+1,added:r,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+u,lastComponent:{count:1,added:r,removed:n,previousComponent:i}}}extractCommon(e,r,n,u,o){let i=r.length,D=n.length,s=e.oldPos,a=s-u,c=0;for(;a+1<i&&s+1<D&&this.equals(n[s+1],r[a+1],o);)a++,s++,c++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!o.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,a}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){let u=[],o;for(;e;)u.push(e),o=e.previousComponent,delete e.previousComponent,e=o;u.reverse();let i=u.length,D=0,s=0,a=0;for(;D<i;D++){let c=u[D];if(c.removed)c.value=this.join(n.slice(a,a+c.count)),a+=c.count;else{if(!c.added&&this.useLongestToken){let p=r.slice(s,s+c.count);p=p.map(function(l,m){let f=n[a+m];return f.length>l.length?f:l}),c.value=this.join(p)}else c.value=this.join(r.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}return u}};var At=class extends Ne{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}},pr=new At;function xt(t,e,r){return pr.diff(t,e,r)}var Mu=()=>{},k=Mu;var dr="cr",Fr="crlf",Yu="lf",ju=Yu,Bt="\r",Er=`\r
`,ze=`
`,Uu=ze;function Cr(t){let e=t.indexOf(Bt);return e!==-1?t.charAt(e+1)===ze?Fr:dr:ju}function we(t){return t===dr?Bt:t===Fr?Er:Uu}var Vu=new Map([[ze,/\n/g],[Bt,/\r/g],[Er,/\r\n/g]]);function Tt(t,e){let r=Vu.get(e);return t.match(r)?.length??0}var Wu=/\r\n?/g;function hr(t){return ne(0,t,Wu,ze)}var ue=Symbol.for("comments");function $u(t){return this[t<0?this.length+t:t]}var zu=X("at",function(){if(Array.isArray(this)||typeof this=="string")return $u}),y=zu;var G="string",U="array",V="cursor",I="indent",R="align",v="trim",x="group",S="fill",T="if-break",L="indent-if-break",M="line-suffix",Y="line-suffix-boundary",g="line",b="label",N="break-parent",Ge=new Set([V,I,R,v,x,S,T,L,M,Y,g,b,N]);function gr(t){let e=t.length;for(;e>0&&(t[e-1]==="\r"||t[e-1]===`
`);)e--;return e<t.length?t.slice(0,e):t}function Fe(t,e,r){if(!t.has(e)){let n=r(e);t.set(e,n)}return t.get(e)}function Gu(t){if(typeof t=="string")return G;if(Array.isArray(t))return U;if(!t)return;let{type:e}=t;if(Ge.has(e))return e}var q=Gu;var Ku=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Hu(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(q(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Ku([...Ge].map(u=>`'${u}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${n}.`}var Nt=class extends Error{name="InvalidDocError";constructor(e){super(Hu(e)),this.doc=e}},Z=Nt;var _r={};function Ju(t,e,r,n){let u=[t];for(;u.length>0;){let o=u.pop();if(o===_r){r(u.pop());continue}r&&u.push(o,_r);let i=q(o);if(!i)throw new Z(o);if(e?.(o)!==!1)switch(i){case U:case S:{let D=i===U?o:o.parts;for(let s=D.length,a=s-1;a>=0;--a)u.push(D[a]);break}case T:u.push(o.flatContents,o.breakContents);break;case x:if(n&&o.expandedStates)for(let D=o.expandedStates.length,s=D-1;s>=0;--s)u.push(o.expandedStates[s]);else u.push(o.contents);break;case R:case I:case L:case b:case M:u.push(o.contents);break;case G:case V:case v:case Y:case g:case N:break;default:throw new Z(o)}}}var Oe=Ju;function Se(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(o){return Fe(r,o,u)}function u(o){switch(q(o)){case U:return e(o.map(n));case S:return e({...o,parts:o.parts.map(n)});case T:return e({...o,breakContents:n(o.breakContents),flatContents:n(o.flatContents)});case x:{let{expandedStates:i,contents:D}=o;return i?(i=i.map(n),D=i[0]):D=n(D),e({...o,contents:D,expandedStates:i})}case R:case I:case L:case b:case M:return e({...o,contents:n(o.contents)});case G:case V:case v:case Y:case g:case N:return e(o);default:throw new Z(o)}}}function Ke(t,e,r){let n=r,u=!1;function o(i){if(u)return!1;let D=e(i);D!==void 0&&(u=!0,n=D)}return Oe(t,o),n}function qu(t){if(t.type===x&&t.break||t.type===g&&t.hard||t.type===N)return!0}function xr(t){return Ke(t,qu,!1)}function yr(t){if(t.length>0){let e=y(0,t,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function Br(t){let e=new Set,r=[];function n(o){if(o.type===N&&yr(r),o.type===x){if(r.push(o),e.has(o))return!1;e.add(o)}}function u(o){o.type===x&&r.pop().break&&yr(r)}Oe(t,n,u,!0)}function Xu(t){return t.type===g&&!t.hard?t.soft?"":" ":t.type===T?t.flatContents:t}function Tr(t){return Se(t,Xu)}function Ar(t){for(t=[...t];t.length>=2&&y(0,t,-2).type===g&&y(0,t,-1).type===N;)t.length-=2;if(t.length>0){let e=Pe(y(0,t,-1));t[t.length-1]=e}return t}function Pe(t){switch(q(t)){case I:case L:case x:case M:case b:{let e=Pe(t.contents);return{...t,contents:e}}case T:return{...t,breakContents:Pe(t.breakContents),flatContents:Pe(t.flatContents)};case S:return{...t,parts:Ar(t.parts)};case U:return Ar(t);case G:return gr(t);case R:case V:case v:case Y:case g:case N:break;default:throw new Z(t)}return t}function He(t){return Pe(Zu(t))}function Qu(t){switch(q(t)){case S:{let{parts:e}=t;if(e.every(r=>r===""))return"";if(e.length===1)return e[0];break}case x:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===x&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case R:case I:case L:case M:if(!t.contents)return"";break;case T:if(!t.flatContents&&!t.breakContents)return"";break;case U:{let e=[];for(let r of t){if(!r)continue;let[n,...u]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(0,e,-1)=="string"?e[e.length-1]+=n:e.push(n),e.push(...u)}return e.length===0?"":e.length===1?e[0]:e}case G:case V:case v:case Y:case g:case b:case N:break;default:throw new Z(t)}return t}function Zu(t){return Se(t,e=>Qu(e))}function Nr(t,e=Je){return Se(t,r=>typeof r=="string"?be(e,r.split(`
`)):r)}function eo(t){if(t.type===g)return!0}function wr(t){return Ke(t,eo,!1)}function Ee(t,e){return t.type===b?{...t,contents:e(t.contents)}:e(t)}var w=k,qe=k,Or=k,Pr=k;function oe(t){return w(t),{type:I,contents:t}}function De(t,e){return Pr(t),w(e),{type:R,contents:e,n:t}}function Sr(t){return De(Number.NEGATIVE_INFINITY,t)}function Xe(t){return De({type:"root"},t)}function br(t){return De(-1,t)}function Qe(t,e,r){w(t);let n=t;if(e>0){for(let u=0;u<Math.floor(e/r);++u)n=oe(n);n=De(e%r,n),n=De(Number.NEGATIVE_INFINITY,n)}return n}var ae={type:N};var ee={type:V};function kr(t){return Or(t),{type:S,parts:t}}function wt(t,e={}){return w(t),qe(e.expandedStates,!0),{type:x,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Ir(t,e){return wt(t[0],{...e,expandedStates:t})}function Rr(t,e="",r={}){return w(t),e!==""&&w(e),{type:T,breakContents:t,flatContents:e,groupId:r.groupId}}function vr(t,e){return w(t),{type:L,contents:t,groupId:e.groupId,negate:e.negate}}function be(t,e){w(t),qe(e);let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}function Lr(t,e){return w(e),t?{type:b,label:t,contents:e}:e}var Ze={type:g},Mr={type:g,soft:!0},ke={type:g,hard:!0},W=[ke,ae],Ot={type:g,hard:!0,literal:!0},Je=[Ot,ae];function Ie(t){return w(t),{type:M,contents:t}}var Yr={type:Y};var jr={type:v};function te(t){if(!t)return"";if(Array.isArray(t)){let e=[];for(let r of t)if(Array.isArray(r))e.push(...te(r));else{let n=te(r);n!==""&&e.push(n)}return e}return t.type===T?{...t,breakContents:te(t.breakContents),flatContents:te(t.flatContents)}:t.type===x?{...t,contents:te(t.contents),expandedStates:t.expandedStates?.map(te)}:t.type===S?{type:"fill",parts:t.parts.map(te)}:t.contents?{...t,contents:te(t.contents)}:t}function Ur(t){let e=Object.create(null),r=new Set;return n(te(t));function n(o,i,D){if(typeof o=="string")return JSON.stringify(o);if(Array.isArray(o)){let s=o.map(n).filter(Boolean);return s.length===1?s[0]:`[${s.join(", ")}]`}if(o.type===g){let s=D?.[i+1]?.type===N;return o.literal?s?"literalline":"literallineWithoutBreakParent":o.hard?s?"hardline":"hardlineWithoutBreakParent":o.soft?"softline":"line"}if(o.type===N)return D?.[i-1]?.type===g&&D[i-1].hard?void 0:"breakParent";if(o.type===v)return"trim";if(o.type===I)return"indent("+n(o.contents)+")";if(o.type===R)return o.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(o.contents)+")":o.n<0?"dedent("+n(o.contents)+")":o.n.type==="root"?"markAsRoot("+n(o.contents)+")":"align("+JSON.stringify(o.n)+", "+n(o.contents)+")";if(o.type===T)return"ifBreak("+n(o.breakContents)+(o.flatContents?", "+n(o.flatContents):"")+(o.groupId?(o.flatContents?"":', ""')+`, { groupId: ${u(o.groupId)} }`:"")+")";if(o.type===L){let s=[];o.negate&&s.push("negate: true"),o.groupId&&s.push(`groupId: ${u(o.groupId)}`);let a=s.length>0?`, { ${s.join(", ")} }`:"";return`indentIfBreak(${n(o.contents)}${a})`}if(o.type===x){let s=[];o.break&&o.break!=="propagated"&&s.push("shouldBreak: true"),o.id&&s.push(`id: ${u(o.id)}`);let a=s.length>0?`, { ${s.join(", ")} }`:"";return o.expandedStates?`conditionalGroup([${o.expandedStates.map(c=>n(c)).join(",")}]${a})`:`group(${n(o.contents)}${a})`}if(o.type===S)return`fill([${o.parts.map(s=>n(s)).join(", ")}])`;if(o.type===M)return"lineSuffix("+n(o.contents)+")";if(o.type===Y)return"lineSuffixBoundary";if(o.type===b)return`label(${JSON.stringify(o.label)}, ${n(o.contents)})`;if(o.type===V)return"cursor";throw new Error("Unknown doc type "+o.type)}function u(o){if(typeof o!="symbol")return JSON.stringify(String(o));if(o in e)return e[o];let i=o.description||"symbol";for(let D=0;;D++){let s=i+(D>0?` #${D}`:"");if(!r.has(s))return r.add(s),e[o]=`Symbol.for(${JSON.stringify(s)})`}}}var Vr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uLine truncated
`?ne(0,d,`
`,u):d;E&&(a.write(E),i.length>0&&(o+=Re(E)));break}case U:for(let E=d.length-1;E>=0;E--)i.push({indent:f,mode:F,doc:d[E]});break;case V:a.markPosition();break;case I:i.push({indent:Qr(f,e),mode:F,doc:d.contents});break;case R:i.push({indent:Xr(f,d.n,e),mode:F,doc:d.contents});break;case v:o-=a.trim();break;case x:{let E=(function(){if(F===Q&&!D)return{indent:f,mode:d.break?K:Q,doc:d.contents};D=!1;let h=n-o,_=s.length>0,P={indent:f,mode:Q,doc:d.contents};if(!d.break&&tt(P,i,h,_,r))return P;if(!d.expandedStates)return{indent:f,mode:K,doc:d.contents};if(!d.break)for(let A=1;A<d.expandedStates.length-1;A++){let B={indent:f,mode:Q,doc:d.expandedStates[A]};if(tt(B,i,h,_,r))return B}return{indent:f,mode:K,doc:y(0,d.expandedStates,-1)}})();i.push(E),d.id&&(r[d.id]=E.mode);break}case S:{let E=n-o,C=d[vt]??0,{parts:h}=d,_=h.length-C;if(_===0)break;let P=h[C+0],A=h[C+1],B={indent:f,mode:Q,doc:P},J={indent:f,mode:K,doc:P},$e=tt(B,[],E,s.length>0,r,!0);if(_===1){$e?i.push(B):i.push(J);break}let lr={indent:f,mode:Q,doc:A},_t={indent:f,mode:K,doc:A};if(_===2){$e?i.push(lr,B):i.push(_t,J);break}let bu=h[C+2],ku={indent:f,mode:F,doc:{...d,[vt]:C+2}},Iu=tt({indent:f,mode:Q,doc:[P,A,bu]},[],E,s.length>0,r,!0);i.push(ku),Iu?i.push(lr,B):$e?i.push(_t,B):i.push(_t,J);break}case T:case L:{let E=d.groupId?r[d.groupId]:F;if(E===K){let C=d.type===T?d.breakContents:d.negate?d.contents:oe(d.contents);C&&i.push({indent:f,mode:F,doc:C})}if(E===Q){let C=d.type===T?d.flatContents:d.negate?oe(d.contents):d.contents;C&&i.push({indent:f,mode:F,doc:C})}break}case M:s.push({indent:f,mode:F,doc:d.contents});break;case Y:s.length>0&&i.push({indent:f,mode:F,doc:ke});break;case g:switch(F){case Q:if(!d.hard){d.soft||(a.write(" "),o+=1);break}D=!0;case K:if(s.length>0){i.push({indent:f,mode:F,doc:d},...s.reverse()),s.length=0;break}d.literal?(a.write(u),o=0,f.root&&(f.root.value&&a.write(f.root.value),o=f.root.length)):(a.trim(),a.write(u+f.value),o=f.length);break}break;case b:i.push({indent:f,mode:F,doc:d.contents});break;case N:break;default:throw new Z(d)}i.length===0&&s.length>0&&(i.push(...s.reverse()),s.length=0)}let{text:c,positions:p}=a.finish();if(p.length!==2)return{formatted:c};let[l,m]=p;return{formatted:c,cursorNodeStart:l,cursorNodeText:c.slice(l,m)}}function co(t,e,r=0){let n=0;for(let u=r;u<t.length;++u)t[u]===" "?n=n+e-n%e:n++;return n}var he=co;var Lt=class{constructor(e){this.stack=[e]}get key(){let{stack:e,siblings:r}=this;return y(0,e,r===null?-2:-4)??null}get index(){return this.siblings===null?null:y(0,this.stack,-2)}get node(){return y(0,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,r=y(0,e,-3);return Array.isArray(r)?r:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:r}=this;return e!==null&&r===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#e()]}getName(){let{stack:e}=this,{length:r}=e;return r>1?y(0,e,-2):null}getValue(){return y(0,this.stack,-1)}getNode(e=0){let r=this.#t(e);return r===-1?null:this.stack[r]}getParentNode(e=0){return this.getNode(e+1)}#t(e){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--e<0)return n;return-1}call(e,...r){let{stack:n}=this,{length:u}=n,o=y(0,n,-1);for(let i of r)o=o?.[i],n.push(i,o);try{return e(this)}finally{n.length=u}}callParent(e,r=0){let n=this.#t(r+1),u=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...u)}}each(e,...r){let{stack:n}=this,{length:u}=n,o=y(0,n,-1);for(let i of r)o=o[i],n.push(i,o);try{for(let i=0;i<o.length;++i)n.push(i,o[i]),e(this,i,o),n.length-=2}finally{n.length=u}}map(e,...r){let n=[];return this.each((u,o,i)=>{n[o]=e(u,o,i)},...r),n}match(...e){let r=this.stack.length-1,n=null,u=this.stack[r--];for(let o of e){if(u===void 0)return!1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],u=this.stack[r--]),o&&!o(u,n,i))return!1;n=this.stack[r--],u=this.stack[r--]}return!0}findAncestor(e){for(let r of this.#e())if(e(r))return r}hasAncestor(e){for(let r of this.#e())if(e(r))return!0;return!1}*#e(){let{stack:e}=this;for(let r=e.length-3;r>=0;r-=2){let n=e[r];Array.isArray(n)||(yield n)}}},en=Lt;function fo(t){return Array.isArray(t)&&t.length>0}var rt=fo;function lo(t){return t!==null&&typeof t=="object"}var ge=lo;function _e(t){return(e,r,n)=>{if(r===!1)return!1;let u=!!n?.backwards,{length:o}=e,i=r;for(;i>=0&&i<o;){let D=e.charAt(i);if(t instanceof RegExp){if(!t.test(D))return i}else if(!t.includes(D))return i;u?i--:i++}return i===-1||i===o?i:!1}}var tn=_e(/\s/),j=_e(" "),nt=_e(",; "),ut=_e(/[^\n\r]/);var rn=t=>t===`
`||t==="\r"||t==="\u2028"||t==="\u2029";function po(t,e,r){if(e===!1)return!1;let n=!!r?.backwards,u=t.charAt(e);if(n){if(t.charAt(e-1)==="\r"&&u===`
`)return e-2;if(rn(u))return e-1}else{if(u==="\r"&&t.charAt(e+1)===`
`)return e+2;if(rn(u))return e+1}return e}var $=po;function mo(t,e,r={}){let n=j(t,r.backwards?e-1:e,r),u=$(t,n,r);return n!==u}var H=mo;function*ye(t,e){let{getVisitorKeys:r,filter:n=()=>!0}=e,u=o=>ge(o)&&n(o);for(let o of r(t)){let i=t[o];if(Array.isArray(i))for(let D of i)u(D)&&(yield D);else u(i)&&(yield i)}}function*nn(t,e){let r=[t];for(let n=0;n<r.length;n++){let u=r[n];for(let o of ye(u,e))yield o,r.push(o)}}function un(t,e){return ye(t,e).next().done}function Fo(t,e,r){let{filter:n}=r;if(!n)return[];let u,o=(r.getChildren?.(t,r)??[...ye(t,{getVisitorKeys:r.getVisitorKeys})]).flatMap(s=>(u??(u=[t,...e]),n(s,u)?[s]:on(s,u,r))),{locStart:i,locEnd:D}=r;return o.sort((s,a)=>i(s)-i(a)||D(s)-D(a)),o}function on(t,e,r){return Fe(r.cache,t,n=>Fo(n,e,r))}var ot=on;function Eo(t){let e=t.type||t.kind||"(unknown type)",r=String(t.name||t.id&&(typeof t.id=="object"?t.id.name:t.id)||t.key&&(typeof t.key=="object"?t.key.name:t.key)||t.value&&(typeof t.value=="object"?"":String(t.value))||t.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),e+(r?" "+r:"")}function Mt(t,e){(t.comments??(t.comments=[])).push(e),e.printed=!1,e.nodeDescription=Eo(t)}function ce(t,e){e.leading=!0,e.trailing=!1,Mt(t,e)}function re(t,e,r){e.leading=!1,e.trailing=!1,r&&(e.marker=r),Mt(t,e)}function fe(t,e){e.leading=!1,e.trailing=!0,Mt(t,e)}var Ut=new WeakMap;function Dn(t,e,r,n,u=[]){let{locStart:o,locEnd:i}=r,D=o(e),s=i(e),a=ot(t,u,{cache:Ut,locStart:o,locEnd:i,getVisitorKeys:r.getVisitorKeys,filter:r.printer.canAttachComment,getChildren:r.printer.getCommentChildNodes}),c,p,l=0,m=a.length;for(;l<m;){let f=l+m>>1,F=a[f],d=o(F),E=i(F);if(d<=D&&s<=E)return Dn(F,e,r,F,[F,...u]);if(E<=D){c=F,l=f+1;continue}if(s<=d){p=F,m=f;continue}throw new Error("Comment location overlaps with node location")}if(n?.type==="TemplateLiteral"){let{quasis:f}=n,F=jt(f,e,r);c&&jt(f,c,r)!==F&&(c=null),p&&jt(f,p,r)!==F&&(p=null)}return{enclosingNode:n,precedingNode:c,followingNode:p}}var Yt=()=>!1;function an(t,e){let{comments:r}=t;if(delete t.comments,!rt(r)||!e.printer.canAttachComment)return;let n=[],{printer:{features:{experimental_avoidAstMutation:u},handleComments:o={}},originalText:i}=e,{ownLine:D=Yt,endOfLine:s=Yt,remaining:a=Yt}=o,c=r.map((l,m)=>({...Dn(t,l,e),comment:l,text:i,options:e,ast:t,isLastComment:r.length-1===m,placement:void 0})),p=!u;for(let[l,m]of c.entries()){let{comment:f,precedingNode:F,enclosingNode:d,followingNode:E,text:C,options:h,ast:_,isLastComment:P}=m,A=Co(C,h,c,l)?"ownLine":ho(C,h,c,l)?"endOfLine":"remaining",B;if(u?(m.placement=A,B=[m]):B=[f,C,h,_,P],p&&(f.enclosingNode=d,f.precedingNode=F,f.followingNode=E),f.placement=A,A==="ownLine")D(...B)||(E?ce(E,f):F?fe(F,f):d?re(d,f):re(_,f));else if(A==="endOfLine")s(...B)||(F?fe(F,f):E?ce(E,f):d?re(d,f):re(_,f));else if(!a(...B))if(F&&E){let J=n.length;J>0&&n[J-1].followingNode!==E&&sn(n,h),n.push(m)}else F?fe(F,f):E?ce(E,f):d?re(d,f):re(_,f)}if(sn(n,e),p)for(let l of r)delete l.precedingNode,delete l.enclosingNode,delete l.followingNode}var cn=t=>!/[\S\n\u2028\u2029]/.test(t);function Co(t,e,r,n){let{comment:u,precedingNode:o}=r[n],{locStart:i,locEnd:D}=e,s=i(u);if(o)for(let a=n-1;a>=0;a--){let{comment:c,precedingNode:p}=r[a];if(p!==o||!cn(t.slice(D(c),s)))break;s=i(c)}return H(t,s,{backwards:!0})}function ho(t,e,r,n){let{comment:u,followingNode:o}=r[n],{locStart:i,locEnd:D}=e,s=D(u);if(o)for(let a=n+1;a<r.length;a++){let{comment:c,followingNode:p}=r[a];if(p!==o||!cn(t.slice(s,i(c))))break;s=D(c)}return H(t,s)}function sn(t,e){let r=t.length;if(r===0)return;let{precedingNode:n,followingNode:u}=t[0],o=e.locStart(u),i;for(i=r;i>0;--i){let{comment:D,precedingNode:s,followingNode:a}=t[i-1];k(s,n),k(a,u);let c=e.originalText.slice(e.locEnd(D),o);if(e.printer.isGap?.(c,e)??/^[\s(]*$/.test(c))o=e.locStart(D);else break}for(let[D,{comment:s}]of t.entries())D<i?fe(n,s):ce(u,s);for(let D of[n,u])D.comments&&D.comments.length>1&&D.comments.sort((s,a)=>e.locStart(s)-e.locStart(a));t.length=0}function jt(t,e,r){let n=r.locStart(e)-1;for(let u=1;u<t.length;++u)if(n<r.locStart(t[u]))return u-1;return 0}function go(t,e){let r=e-1;r=j(t,r,{backwards:!0}),r=$(t,r,{backwards:!0}),r=j(t,r,{backwards:!0});let n=$(t,r,{backwards:!0});return r!==n}var ve=go;var fn=()=>!0;function ln(t,e){let r=t.node;return r.printed=!0,e.printer.printComment(t,e)}function _o(t,e){let r=t.node,n=[ln(t,e)],{printer:u,originalText:o,locStart:i,locEnd:D}=e;if(u.isBlockComment?.(r)){let c=" ";H(o,D(r))&&(H(o,i(r),{backwards:!0})?c=W:c=Ze),n.push(c)}else n.push(W);let a=$(o,j(o,D(r)));return a!==!1&&H(o,a)&&n.push(W),n}function yo(t,e,r){let n=t.node,u=ln(t,e),{printer:o,originalText:i,locStart:D}=e,s=o.isBlockComment?.(n);if(r?.hasLineSuffix&&!r?.isBlock||H(i,D(n),{backwards:!0})){let a=ve(i,D(n));return{doc:Ie([W,a?W:"",u]),isBlock:s,hasLineSuffix:!0}}return!s||r?.hasLineSuffix?{doc:[Ie([" ",u]),ae],isBlock:s,hasLineSuffix:!0}:{doc:[" ",u],isBlock:s,hasLineSuffix:!1}}function Ao(t,e,r){let n=e[Symbol.for("printedCommLine truncated
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:t=>typeof t=="string"||typeof t=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:t=>typeof t=="string"||typeof t=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function it({plugins:t=[],showDeprecated:e=!1}={}){let r=t.flatMap(u=>u.languages??[]),n=[];for(let u of No(Object.assign({},...t.map(({options:o})=>o),Fn)))!e&&u.deprecated||(Array.isArray(u.choices)&&(e||(u.choices=u.choices.filter(o=>!o.deprecated)),u.name==="parser"&&(u.choices=[...u.choices,...To(u.choices,r,t)])),u.pluginDefaults=Object.fromEntries(t.filter(o=>o.defaultOptions?.[u.name]!==void 0).map(o=>[o.name,o.defaultOptions[u.name]])),n.push(u));return{languages:r,options:n}}function*To(t,e,r){let n=new Set(t.map(u=>u.value));for(let u of e)if(u.parsers){for(let o of u.parsers)if(!n.has(o)){n.add(o);let i=r.find(s=>s.parsers&&le(s.parsers,o)),D=u.name;i?.name&&(D+=` (plugin: ${i.name})`),yield{value:o,description:D}}}}function No(t){let e=[];for(let[r,n]of Object.entries(t)){let u={name:r,...n};Array.isArray(u.default)&&(u.default=y(0,u.default,-1).value),e.push(u)}return e}var wo=Array.prototype.toReversed??function(){return[...this].reverse()},Oo=X("toReversed",function(){if(Array.isArray(this))return wo}),En=Oo;function Po(){let t=globalThis,e=t.process?.platform;if(typeof e=="string")return e.startsWith("win");let r=t.Deno?.build?.os;return typeof r=="string"?r==="windows":t.navigator?.platform?.startsWith("Win")??!1}var So=Po();function Cn(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function bo(t){return t=Cn(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function ko(t){t=Cn(t);let e=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(e=`\\\\${t.hostname}${e}`),e}function Vt(t){return So?ko(t):bo(t)}var hn=t=>String(t).split(/[/\\]/).pop(),gn=t=>String(t).startsWith("file:");function _n(t,e){if(!e)return;let r=hn(e).toLowerCase();return t.find(({filenames:n})=>n?.some(u=>u.toLowerCase()===r))??t.find(({extensions:n})=>n?.some(u=>r.endsWith(u)))}function Io(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r?.includes(e))??t.find(({extensions:r})=>r?.includes(`.${e}`))}var Ro=void 0;function yn(t,e){if(e){if(gn(e))try{e=Vt(e)}catch{return}if(typeof e=="string")return t.find(({isSupported:r})=>r?.({filepath:e}))}}function vo(t,e){let r=En(0,t.plugins).flatMap(u=>u.languages??[]);return(Io(r,e.language)??_n(r,e.physicalFile)??_n(r,e.file)??yn(r,e.physicalFile)??yn(r,e.file)??Ro?.(r,e.physicalFile))?.parsers[0]}var st=vo;var ie={key:t=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(t)?t:JSON.stringify(t),value(t){if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(r=>ie.value(r)).join(", ")}]`;let e=Object.keys(t);return e.length===0?"{}":`{ ${e.map(r=>`${ie.key(r)}: ${ie.value(t[r])}`).join(", ")} }`},pair:({key:t,value:e})=>ie.value({[t]:e})};var An=new Proxy(String,{get:()=>An}),z=An;var xn=(t,e,{descriptor:r})=>{let n=[`${z.yellow(typeof t=="string"?r.key(t):r.pair(t))} is deprecated`];return e&&n.push(`we now treat it as ${z.blue(typeof e=="string"?r.key(e):r.pair(e))}`),n.join("; ")+"."};var Dt=Symbol.for("vnopts.VALUE_NOT_EXIST"),Ae=Symbol.for("vnopts.VALUE_UNCHANGED");var Bn=" ".repeat(2),Nn=(t,e,r)=>{let{text:n,list:u}=r.normalizeExpectedResult(r.schemas[t].expected(r)),o=[];return n&&o.push(Tn(t,e,n,r.descriptor)),u&&o.push([Tn(t,e,u.title,r.descriptor)].concat(u.values.map(i=>wn(i,r.loggerPrintWidth))).join(`
`)),On(o,r.loggerPrintWidth)};function Tn(t,e,r,n){return[`Invalid ${z.red(n.key(t))} value.`,`Expected ${z.blue(r)},`,`but received ${e===Dt?z.gray("nothing"):z.red(n.value(e))}.`].join(" ")}function wn({text:t,list:e},r){let n=[];return t&&n.push(`- ${z.blue(t)}`),e&&n.push([`- ${z.blue(e.title)}:`].concat(e.values.map(u=>wn(u,r-Bn.length).replace(/^|\n/g,`$&${Bn}`))).join(`
`)),On(n,r)}function On(t,e){if(t.length===1)return t[0];let[r,n]=t,[u,o]=t.map(i=>i.split(`
`,1)[0].length);return u>e&&u>o?n:r}var xe=[],Wt=[];function at(t,e,r){if(t===e)return 0;let n=r?.maxDistance,u=t;t.length>e.length&&(t=e,e=u);let o=t.length,i=e.length;for(;o>0&&t.charCodeAt(~-o)===e.charCodeAt(~-i);)o--,i--;let D=0;for(;D<o&&t.charCodeAt(D)===e.charCodeAt(D);)D++;if(o-=D,i-=D,n!==void 0&&i-o>n)return n;if(o===0)return n!==void 0&&i>n?n:i;let s,a,c,p,l=0,m=0;for(;l<o;)Wt[l]=t.charCodeAt(D+l),xe[l]=++l;for(;m<i;){for(s=e.charCodeAt(D+m),c=m++,a=m,l=0;l<o;l++)p=s===Wt[l]?c:c+1,c=xe[l],a=xe[l]=c>a?p>a?a+1:p:p>c?c+1:p;if(n!==void 0){let f=a;for(l=0;l<o;l++)xe[l]<f&&(f=xe[l]);if(f>n)return n}}return xe.length=o,Wt.length=o,n!==void 0&&a>n?n:a}function Pn(t,e,r){if(!Array.isArray(e)||e.length===0)return;let n=r?.maxDistance,u=t.length;for(let s of e)if(s===t)return s;if(n===0)return;let o,i=Number.POSITIVE_INFINITY,D=new Set;for(let s of e){if(D.has(s))continue;D.add(s);let a=Math.abs(s.length-u);if(a>=i||n!==void 0&&a>n)continue;let c=Number.isFinite(i)?n===void 0?i:Math.min(i,n):n,p=c===void 0?at(t,s):at(t,s,{maxDistance:c});if(n!==void 0&&p>n)continue;let l=p;if(c!==void 0&&p===c&&c===n&&(l=at(t,s)),l<i&&(i=l,o=s,i===0))break}if(!(n!==void 0&&i>n))return o}var ct=(t,e,{descriptor:r,logger:n,schemas:u})=>{let o=[`Ignored unknown option ${z.yellow(r.pair({key:t,value:e}))}.`],i=Pn(t,Object.keys(u),{maxDistance:3});i&&o.push(`Did you mean ${z.blue(r.key(i))}?`),n.warn(o.join(" "))};var Lo=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Mo(t,e){let r=new t(e),n=Object.create(r);for(let u of Lo)u in e&&(n[u]=Yo(e[u],r,O.prototype[u].length));return n}var O=class{static create(e){return Mo(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,r){return!1}deprecated(e,r){return!1}forward(e,r){}redirect(e,r){}overlap(e,r,n){return e}preprocess(e,r){return e}postprocess(e,r){return Ae}};function Yo(t,e,r){return typeof t=="function"?(...n)=>t(...n.slice(0,r-1),e,...n.slice(r-1)):()=>t}var ft=class extends O{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,r){return r.schemas[this._sourceName].validate(e,r)}redirect(e,r){return this._sourceName}};var lt=class extends O{expected(){return"anything"}validate(){return!0}};var pt=class extends O{constructor({valueSchema:e,name:r=e.name,...n}){super({...n,name:r}),this._valueSchema=e}expected(e){let{text:r,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,r){if(!Array.isArray(e))return!1;let n=[];for(let u of e){let o=r.normalizeValidateResult(this._valueSchema.validate(u,r),u);o!==!0&&n.push(o.value)}return n.length===0?!0:{value:n}}deprecated(e,r){let n=[];for(let u of e){let o=r.normalizeDeprecatedResult(this._valueSchema.deprecated(u,r),u);o!==!1&&n.push(...o.map(({value:i})=>({value:[i]})))}return n}forward(e,r){let n=[];for(let u of e){let o=r.normalizeForwardResult(this._valueSchema.forward(u,r),u);n.push(...o.map(Sn))}return n}redirect(e,r){let n=[],u=[];for(let o of e){let i=r.normalizeRedirectResult(this._valueSchema.redirect(o,r),o);"remain"in i&&n.push(i.remain),u.push(...i.redirect.map(Sn))}return n.length===0?{redirect:u}:{redirect:u,remain:n}}overlap(e,r){return e.concat(r)}};function Sn({from:t,to:e}){return{from:[t],to:e}}var mt=class extends O{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function kn(t,e){let r=Object.create(null);for(let n of t){let u=n[e];if(r[u])throw new Error(`Duplicate ${e} ${JSON.stringify(u)}`);r[u]=n}return r}function In(t,e){let r=new Map;for(let n of t){let u=n[e];if(r.has(u))throw new Error(`Duplicate ${e} ${JSON.stringify(u)}`);r.set(u,n)}return r}function Rn(){let t=Object.create(null);return e=>{let r=JSON.stringify(e);return t[r]?!0:(t[r]=!0,!1)}}function vn(t,e){let r=[],n=[];for(let u of t)e(u)?r.push(u):n.push(u);return[r,n]}function Ln(t){return t===Math.floor(t)}function Mn(t,e){if(t===e)return 0;let r=typeof t,n=typeof e,u=["undefined","object","boolean","number","string"];return r!==n?u.indexOf(r)-u.indexOf(n):r!=="string"?Number(t)-Number(e):t.localeCompare(e)}function Yn(t){return(...e)=>{let r=t(...e);return typeof r=="string"?new Error(r):r}}function $t(t){return t===void 0?{}:t}function zt(t){if(typeof t=="string")return{text:t};let{text:e,list:r}=t;return jo((e||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:e,list:{title:r.title,values:r.values.map(zt)}}:{text:e}}function Gt(t,e){return t===!0?!0:t===!1?{value:e}:t}function Kt(t,e,r=!1){return t===!1?!1:t===!0?r?!0:[{value:e}]:"value"in t?[t]:t.length===0?!1:t}function bn(t,e){return typeof t=="string"||"key"in t?{from:e,to:t}:"from"in t?{from:t.from,to:t.to}:{from:e,to:t.to}}function dt(t,e){return t===void 0?[]:Array.isArray(t)?t.map(r=>bn(r,e)):[bn(t,e)]}function Ht(t,eLine truncated
`,u.gutter(h.replace(/\d/g," "))," ",B,u.marker("^").repeat(J)].join(""),P&&r.message&&(A+=" "+u.message(r.message))}return[u.marker(">"),u.gutter(h),F.length>0?` ${F}`:"",A].join("")}else return` ${u.gutter(h)}${F.length>0?` ${F}`:""}`}).join(`
`);return r.message&&!p&&(f=`${" ".repeat(l+1)}${r.message}
${f}`),u.reset(f)}function Zn(t,e,r={}){return Qn(t,e,r)}async function ii(t,e){let r=await Ue(e),n=r.preprocess?await r.preprocess(t,e):t;e.originalText=n;let u;try{u=await r.parse(n,e,e)}catch(o){si(o,t)}return{text:n,ast:u}}function si(t,e){let{loc:r}=t;if(r){let{start:n,end:u}=r;n&&(n={line:n.line,column:n.column-1}),u&&(u={line:u.line,column:u.column-1});let o=Zn(e,{start:n,end:u},{highlightCode:!0});t.message+=`
`+o,t.codeFrame=o}throw t}var me=ii;async function eu(t,e,r,n,u){if(r.embeddedLanguageFormatting!=="auto")return;let{printer:o}=r,{embed:i}=o;if(!i)return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let{hasPrettierIgnore:D}=o,{getVisitorKeys:s}=i,a=[];l();let c=t.stack;for(let{print:m,node:f,pathStack:F}of a)try{t.stack=F;let d=await m(p,e,t,r);d&&u.set(f,d)}catch(d){if(globalThis.PRETTIER_DEBUG)throw d}t.stack=c;function p(m,f){return Di(m,f,r,n)}function l(){let{node:m}=t;if(m===null||typeof m!="object"||D?.(t))return;for(let F of s(m))Array.isArray(m[F])?t.each(l,F):t.call(l,F);let f=i(t,r);if(f){if(typeof f=="function"){a.push({print:f,node:m,pathStack:[...t.stack]});return}u.set(m,f)}}}async function Di(t,e,r,n){let u=await se({...r,...e,parentParser:r.parser,originalText:t,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:o}=await me(t,u),i=await n(o,u);return He(i)}function ai(t,e,r,n){let{originalText:u,[ue]:o,locStart:i,locEnd:D,[Symbol.for("printedComments")]:s}=e,{node:a}=t,c=i(a),p=D(a);for(let m of o)i(m)>=c&&D(m)<=p&&s.add(m);let{printPrettierIgnored:l}=e.printer;return l?l(t,e,r,n):u.slice(c,p)}var tu=ai;async function Ve(t,e){({ast:t}=await ur(t,e));let r=new Map,n=new en(t),u=dn(e),o=new Map;await eu(n,D,e,Ve,o);let i=await ru(n,e,D,void 0,o);if(mn(e),e.cursorOffset>=0){if(e.nodeAfterCursor&&!e.nodeBeforeCursor)return[ee,i];if(e.nodeBeforeCursor&&!e.nodeAfterCursor)return[i,ee]}return i;function D(a,c){return a===void 0||a===n?s(c):Array.isArray(a)?n.call(()=>s(c),...a):n.call(()=>s(c),a)}function s(a){u(n);let c=n.node;if(c==null)return"";let p=ge(c)&&a===void 0;if(p&&r.has(c))return r.get(c);let l=ru(n,e,D,a,o);return p&&r.set(c,l),l}}function ru(t,e,r,n,u){let{node:o}=t,{printer:i}=e,D;switch(i.hasPrettierIgnore?.(t)?D=tu(t,e,r,n):u.has(o)?D=u.get(o):D=i.print(t,e,r,n),o){case e.cursorNode:D=Ee(D,s=>[ee,s,ee]);break;case e.nodeBeforeCursor:D=Ee(D,s=>[s,ee]);break;case e.nodeAfterCursor:D=Ee(D,s=>[ee,s]);break}return i.printComment&&rt(o.comments)&&!i.willPrintOwnComments?.(t,e)&&(D=pn(t,D,e)),D}async function ur(t,e){let r=t.comments??[];e[ue]=r,e[Symbol.for("printedComments")]=new Set,an(t,e);let{printer:{preprocess:n}}=e;return t=n?await n(t,e):t,{ast:t,comments:r}}function ci(t,e){let{cursorOffset:r,locStart:n,locEnd:u,getVisitorKeys:o}=e,i=m=>n(m)<=r&&u(m)>=r,D=t,s=[t];for(let m of nn(t,{getVisitorKeys:o,filter:i}))s.push(m),D=m;if(un(D,{getVisitorKeys:o}))return{cursorNode:D};let a,c,p=-1,l=Number.POSITIVE_INFINITY;for(;s.length>0&&(a===void 0||c===void 0);){D=s.pop();let m=a!==void 0,f=c!==void 0;for(let F of ye(D,{getVisitorKeys:o})){if(!m){let d=u(F);d<=r&&d>p&&(a=F,p=d)}if(!f){let d=n(F);d>=r&&d<l&&(c=F,l=d)}}}return{nodeBeforeCursor:a,nodeAfterCursor:c}}var or=ci;function fi(t,e){let{printer:r}=e,n=r.massageAstNode;if(!n)return t;let{getVisitorKeys:u}=r,{ignoredProperties:o}=n;return i(t);function i(D,s){if(!ge(D))return D;if(Array.isArray(D))return D.map(l=>i(l,s)).filter(Boolean);let a={},c=new Set(u(D));for(let l in D)!le(D,l)||o?.has(l)||(c.has(l)?a[l]=i(D[l],D):a[l]=D[l]);let p=n(D,a,s);if(p!==null)return p??a}}var nu=fi;var li=Array.prototype.findLastIndex??function(t){for(let e=this.length-1;e>=0;e--){let r=this[e];if(t(r,e,this))return e}return-1},pi=X("findLastIndex",function(){if(Array.isArray(this))return li}),uu=pi;function mi(t,e){return e=new Set(e),t.find(r=>su.has(r.type)&&e.has(r))}function ou(t){let e=uu(0,t,r=>r.type!=="Program"&&r.type!=="File");return e===-1?t:t.slice(0,e+1)}function di(t,e,{locStart:r,locEnd:n}){let[u,...o]=t,[i,...D]=e;if(u===i)return[u,i];let s=r(u);for(let c of ou(D))if(r(c)>=s)i=c;else break;let a=n(i);for(let c of ou(o)){if(n(c)<=a)u=c;else break;if(u===i)break}return[u,i]}function ir(t,e,r,n,u=[],o,i){let{locStart:D,locEnd:s}=i,a=D(t),c=s(t);if(e>c||e<a||o==="rangeEnd"&&e===a||o==="rangeStart"&&e===c)return;let p=[t,...u],l=ot(t,p,{cache:Ut,locStart:D,locEnd:s,getVisitorKeys:r.getVisitorKeys,filter:r.printer.canAttachComment,getChildren:r.printer.getCommentChildNodes});for(let m of l){let f=ir(m,e,r,n,p,o,i);if(f)return f}if(n(t,u[0]))return p}function Fi(t,e){return e!=="DeclareExportDeclaration"&&t!=="TypeParameterDeclaration"&&(t==="Directive"||t==="TypeAlias"||t==="TSExportAssignment"||t.startsWith("Declare")||t.startsWith("TSDeclare")||t.endsWith("Statement")||t.endsWith("Declaration"))}var su=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),Ei=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDeLine truncated
`,u)+1),s=n.slice(D,u).match(/^\s*/)[0],a=he(s,e.tabWidth),c=await pu(i,{...e,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:e.cursorOffset>u&&e.cursorOffset<=o?e.cursorOffset-u:-1,endOfLine:"lf"},a),p=c.formatted.trimEnd(),{cursorOffset:l}=e;l>o?l+=p.length-i.length:c.cursorOffset>=0&&(l=c.cursorOffset+u);let m=n.slice(0,u)+p+n.slice(o);if(e.endOfLine!=="lf"){let f=we(e.endOfLine);l>=0&&f===`\r
`&&(l+=Tt(m.slice(0,l),`
`)),m=ne(0,m,`
`,f)}return{formatted:m,cursorOffset:l,comments:c.comments}}function sr(t,e,r){return typeof e!="number"||Number.isNaN(e)||e<0||e>t.length?r:e}function cu(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:u}=e;return r=sr(t,r,-1),n=sr(t,n,0),u=sr(t,u,t.length),{...e,cursorOffset:r,rangeStart:n,rangeEnd:u}}function mu(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o}=cu(t,e),i=t.charAt(0)===lu;if(i&&(t=t.slice(1),r--,n--,u--),o==="auto"&&(o=Cr(t)),t.includes("\r")){let D=s=>Tt(t.slice(0,Math.max(s,0)),`\r
`);r-=D(r),n-=D(n),u-=D(u),t=hr(t)}return{hasBOM:i,text:t,options:cu(t,{...e,cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o})}}async function fu(t,e){let r=await Ue(e);return!r.hasPragma||r.hasPragma(t)}async function hi(t,e){return(await Ue(e)).hasIgnorePragma?.(t)}async function Dr(t,e){let{hasBOM:r,text:n,options:u}=mu(t,await se(e));if(u.rangeStart>=u.rangeEnd&&n!==""||u.requirePragma&&!await fu(n,u)||u.checkIgnorePragma&&await hi(n,u))return{formatted:t,cursorOffset:e.cursorOffset,comments:[]};let o;return u.rangeStart>0||u.rangeEnd<n.length?o=await Ci(n,u):(!u.requirePragma&&u.insertPragma&&u.printer.insertPragma&&!await fu(n,u)&&(n=u.printer.insertPragma(n)),o=await pu(n,u)),r&&(o.formatted=lu+o.formatted,o.cursorOffset>=0&&o.cursorOffset++),o}async function du(t,e,r){let{text:n,options:u}=mu(t,await se(e)),o=await me(n,u);return r&&(r.preprocessForPrint&&(o.ast=await ur(o.ast,u)),r.massage&&(o.ast=nu(o.ast,u))),o}async function Fu(t,e){e=await se(e);let r=await Ve(t,e);return Ce(r,e)}async function Eu(t,e){let r=Ur(t),{formatted:n}=await Dr(r,{...e,parser:"__js_expression"});return n}async function Cu(t,e){e=await se(e);let{ast:r}=await me(t,e);return e.cursorOffset>=0&&(e={...e,...or(r,e)}),Ve(r,e)}async function hu(t,e){return Ce(t,await se(e))}var ar={};yt(ar,{builders:()=>_i,printer:()=>yi,utils:()=>Ai});var _i={join:be,line:Ze,softline:Mr,hardline:W,literalline:Je,group:wt,conditionalGroup:Ir,fill:kr,lineSuffix:Ie,lineSuffixBoundary:Yr,cursor:ee,breakParent:ae,ifBreak:Rr,trim:jr,indent:oe,indentIfBreak:vr,align:De,addAlignmentToDoc:Qe,markAsRoot:Xe,dedentToRoot:Sr,dedent:br,hardlineWithoutBreakParent:ke,literallineWithoutBreakParent:Ot,label:Lr,concat:t=>t},yi={printDocToString:Ce},Ai={willBreak:xr,traverseDoc:Oe,findInDoc:Ke,mapDoc:Se,removeLines:Tr,stripTrailingHardline:He,replaceEndOfLine:Nr,canBreak:wr};var gu="3.9.10";var fr={};yt(fr,{addDanglingComment:()=>re,addLeadingComment:()=>ce,addTrailingComment:()=>fe,getAlignmentSize:()=>he,getIndentSize:()=>_u,getMaxContinuousCount:()=>yu,getNextNonSpaceNonCommentCharacter:()=>Au,getNextNonSpaceNonCommentCharacterIndex:()=>vi,getPreferredQuote:()=>Tu,getStringWidth:()=>Re,hasNewline:()=>H,hasNewlineInRange:()=>Nu,hasSpaces:()=>wu,isNextLineEmpty:()=>Ui,isNextLineEmptyAfterIndex:()=>gt,isPreviousLineEmpty:()=>Mi,makeString:()=>ji,skip:()=>_e,skipEverythingButNewLine:()=>ut,skipInlineComment:()=>Be,skipNewline:()=>$,skipSpaces:()=>j,skipToLineEnd:()=>nt,skipTrailingComment:()=>Te,skipWhitespace:()=>tn});function xi(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let r=e+2;r<t.length;++r)if(t.charAt(r)==="*"&&t.charAt(r+1)==="/")return r+2}return e}var Be=xi;function Bi(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?ut(t,e):e}var Te=Bi;function Ti(t,e){let r=null,n=e;for(;n!==r;)r=n,n=j(t,n),n=Be(t,n),n=Te(t,n),n=$(t,n);return n}var We=Ti;function Ni(t,e){let r=null,n=e;for(;n!==r;)r=n,n=nt(t,n),n=Be(t,n),n=j(t,n);return n=Te(t,n),n=$(t,n),n!==!1&&H(t,n)}var gt=Ni;function wi(t,e){let r=t.lastIndexOf(`
`);return r===-1?0:he(t.slice(r+1).match(/^[\t ]*/)[0],e)}var _u=wi;function cr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Oi(t,e){let r=t.matchAll(new RegExp(`(?:${cr(e)})+`,"g"));return r.reduce||(r=[...r]),r.reduce((n,[u])=>Math.max(n,u.length),0)/e.length}var yu=Oi;function Pi(t,e){let r=We(t,e);return r===!1?"":t.charAt(r)}var Au=Pi;var xu=Object.freeze({character:"'",codePoint:39}),Bu=Object.freeze({character:'"',codePoint:34}),Si=Object.freeze({preferred:xu,alternate:Bu}),bi=Object.freeze({preferred:Bu,alternate:xu});function Tu(t,e){let{preferred:r,alternate:n}=e===!0||e==="'"?Si:bi,{length:u}=t,o=0,i=0;for(let D=0;D<u;D++){let s=t.charCodeAt(D);s===r.codePoint?o++:s===n.codePoint&&i++}return(o>i?n:r).character}function ki(t,e,r){for(let n=e;n<r;++n)if(t.charAt(n)===`
`)return!0;return!1}var Nu=ki;function Ii(t,e,r={}){return j(t,r.backwards?e-1:e,r)!==e}var wu=Ii;function Ri(t,e,r){return We(t,r(e))}function vi(t,e){return arguments.length===2||typeof e=="number"?We(t,e):Ri(...arguments)}function Li(t,e,r){return ve(t,r(e))}function Mi(t,e){return arguments.length===2||typeof e=="number"?ve(t,e):Li(...arguments)}function Yi(t,e,r){return gt(t,r(e))}function ji(t,e,r){let n=e==='"'?"'":'"',o=ne(0,t,/\\(.)|(["'])/gs,(i,D,s)=>D===n?D:s===e?"\\"+s:s||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(D)?D:"\\"+D));return e+o+e}function Ui(t,e){return arguments.length===2||typeof e=="number"?gt(t,e):Yi(...arguments)}function de(t,e=1){return async(...r)=>{let n=r[e]??{},u=n.plugins??[];return r[e]={...n,plugins:Array.isArray(u)?u:Object.values(u)},await t(...r)}}var Ou=de(Dr);async function Pu(t,e){let{formatted:r}=await Ou(t,{...e,cursorOffset:-1});return r}async function Vi(t,e){return await Pu(t,e)===t}var Wi=de(it,0),$i={parse:de(du),formatAST:de(Fu),formatDoc:de(Eu),printToDoc:de(Cu),printDocToString:de(hu)};export{$i as __debug,Vi as check,Su as default,ar as doc,Pu as format,Ou as formatWithCursor,Wi as getSupportInfo,fr as util,gu as version};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_w","2":"_f"},D:{"1":"_Q"},E:{"1":"_DB","2":"_e"},F:{"1":"_a","2":"_VE","132":"aC"},G:{"2":"_M"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:2,C:"CSS resize property",D:true};
@@ -0,0 +1,2 @@
import type * as ts from 'typescript/lib/tsserverlibrary';
export declare function getParsedConfigFileFromTSServer(tsserver: typeof ts, defaultProject: string, throwOnFailure: boolean, tsconfigRootDir?: string): ts.ParsedCommandLine | undefined;
@@ -0,0 +1,10 @@
"use strict";
const absFloor = require("./absFloor-CImRXpov.js");
const constants = require("./constants-DR3SPJ7u.js");
const parse = require("./parse.js");
function diffInHours(date, input, asFloat) {
const parsed = parse(input);
const output = (+date - +parsed) / constants.MS_IN_HOUR;
return asFloat ? output : absFloor.absFloor(output);
}
module.exports = diffInHours;
@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CalendarArrowUp = createLucideIcon("CalendarArrowUp", [
["path", { d: "m14 18 4-4 4 4", key: "ftkppy" }],
["path", { d: "M16 2v4", key: "4m81vk" }],
["path", { d: "M18 22v-8", key: "su0gjh" }],
["path", { d: "M21 11.343V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h9", key: "1exg90" }],
["path", { d: "M3 10h18", key: "8toen8" }],
["path", { d: "M8 2v4", key: "1cmpym" }]
]);
export { CalendarArrowUp as default };
//# sourceMappingURL=calendar-arrow-up.js.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Luggage = createLucideIcon("Luggage", [
[
"path",
{ d: "M6 20a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2", key: "1m57jg" }
],
["path", { d: "M8 18V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v14", key: "1l99gc" }],
["path", { d: "M10 20h4", key: "ni2waw" }],
["circle", { cx: "16", cy: "20", r: "2", key: "1vifvg" }],
["circle", { cx: "8", cy: "20", r: "2", key: "ckkr5m" }]
]);
export { Luggage as default };
//# sourceMappingURL=luggage.js.map
@@ -0,0 +1 @@
{"version":3,"file":"clock-arrow-up.js","sources":["../../../src/icons/clock-arrow-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ClockArrowUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuMjI4IDIxLjkyNUExMCAxMCAwIDEgMSAyMS45OTQgMTIuMzM4IiAvPgogIDxwYXRoIGQ9Ik0xMiA2djZsMS41NjIuNzgxIiAvPgogIDxwYXRoIGQ9Im0xNCAxOCA0LTQgNCA0IiAvPgogIDxwYXRoIGQ9Ik0xOCAyMnYtOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/clock-arrow-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ClockArrowUp = createLucideIcon('ClockArrowUp', [\n ['path', { d: 'M13.228 21.925A10 10 0 1 1 21.994 12.338', key: '1fzlyi' }],\n ['path', { d: 'M12 6v6l1.562.781', key: '1ujuk9' }],\n ['path', { d: 'm14 18 4-4 4 4', key: 'ftkppy' }],\n ['path', { d: 'M18 22v-8', key: 'su0gjh' }],\n]);\n\nexport default ClockArrowUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,27 @@
{
"name": "@babel/template",
"version": "7.29.7",
"description": "Generate an AST from a string template.",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-template",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-template"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/code-frame": "^7.29.7",
"@babel/parser": "^7.29.7",
"@babel/types": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
@@ -0,0 +1,2 @@
'use strict';
require('../register')('q', {Promise: require('q').Promise})
@@ -0,0 +1,141 @@
# PoolStats
<!--introduced_in=v4.15.0-->
<!--type=module-->
<!-- source_link=lib/util/stats.js -->
> Stability: 2 - Stable
`PoolStats` exposes a read-only snapshot of the aggregate connection and request
counters for a [`Pool`][] or [`BalancedPool`][]. An instance is created lazily
each time the `pool.stats` getter is accessed, so the values reflect the state of
the pool at the moment of access.
`PoolStats` is not constructed directly in normal use; obtain an instance from
the `stats` property of a pool:
```mjs
import { Pool } from 'undici'
const pool = new Pool('http://localhost:3000')
const { stats } = pool
console.log(stats.connected, stats.running, stats.size)
```
## Class: `PoolStats`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
Each property is a plain number computed from the pool's internal state when the
instance is created. The instance is a snapshot; read `pool.stats` again to
observe later changes.
### `new PoolStats(pool)`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* `pool` {Pool|BalancedPool} The pool to read counters from.
Creates a new `PoolStats` instance from the current state of `pool`. Prefer the
`pool.stats` getter, which returns a fresh `PoolStats` on each access.
### `poolStats.connected`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* Type: {number}
Number of open socket connections in this pool.
### `poolStats.free`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* Type: {number}
Number of open socket connections in this pool that do not have an active
request.
### `poolStats.pending`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* Type: {number}
Number of pending requests across all clients in this pool.
### `poolStats.queued`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* Type: {number}
Number of queued requests across all clients in this pool.
### `poolStats.running`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* Type: {number}
Number of currently active requests across all clients in this pool.
### `poolStats.size`
<!-- YAML
added: v4.15.0
changes:
- version: v7.9.0
pr-url: https://github.com/nodejs/undici/pull/4157
description: Pool and client stats are exposed through `Agent`.
-->
* Type: {number}
Number of active, pending, or queued requests across all clients in this pool.
[`BalancedPool`]: BalancedPool.md#class-balancedpool
[`Pool`]: Pool.md#class-pool
@@ -0,0 +1,40 @@
import { w as workerInit } from '../chunks/init-threads.6kl1khcL.js';
import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.CXMd5FHa.js';
import 'node:worker_threads';
import '../chunks/init.k9zZ9sLh.js';
import 'node:fs';
import 'node:module';
import 'node:url';
import 'pathe';
import 'vite/module-runner';
import '../chunks/startVitestModuleRunner.DB-7oCpn.js';
import '@vitest/utils/helpers';
import '../chunks/modules.BJuCwlRJ.js';
import '../chunks/utils.BX5Fg8C4.js';
import '@vitest/utils/timers';
import '../path.js';
import 'node:path';
import '../module-evaluator.js';
import 'node:vm';
import '../chunks/traces.DT5aQ62U.js';
import '@vitest/mocker';
import '@vitest/mocker/redirect';
import '../chunks/index.DC7d2Pf8.js';
import 'node:console';
import '@vitest/utils/serialize';
import '@vitest/utils/error';
import 'tinyrainbow';
import '../chunks/rpc.MzXet3jl.js';
import '../chunks/index.Chj8NDwU.js';
import '@vitest/utils/source-map';
import '../chunks/inspector.CvyFGlXm.js';
import '../chunks/evaluatedModules.Dg1zASAC.js';
import '../chunks/console.3WNpx0tS.js';
import 'node:stream';
import '@vitest/utils/resolver';
import '@vitest/utils/constants';
workerInit({
runTests: runVmTests,
setup: setupVmWorker
});
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _typeof;
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
exports.default = _typeof = function (obj) {
return typeof obj;
};
} else {
exports.default = _typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
//# sourceMappingURL=typeof.js.map
@@ -0,0 +1,10 @@
//#region src/utils/compress.d.ts
/**
* @module
* Constants for compression.
*/
/**
* Match for compressible content type.
*/
export declare const COMPRESSIBLE_CONTENT_TYPE_REGEX: RegExp;
//#endregion
@@ -0,0 +1,89 @@
{
"name": "cross-env",
"version": "10.1.0",
"description": "Run scripts that set and use environment variables across platforms",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"bin": {
"cross-env": "./dist/bin/cross-env.js",
"cross-env-shell": "./dist/bin/cross-env-shell.js"
},
"engines": {
"node": ">=20"
},
"scripts": {
"build": "zshy",
"dev": "zshy --watch",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:ui": "vitest --ui",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"test:e2e": "node e2e/test-cross-env.js && node e2e/test-cross-env-shell.js && node e2e/test-default-values.js",
"validate": "npm run build && npm run typecheck && npm run lint && npm run format:check && npm run test:run"
},
"files": [
"dist"
],
"keywords": [
"cross-environment",
"environment variable",
"windows",
"cross-platform"
],
"author": "Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)",
"license": "MIT",
"dependencies": {
"@epic-web/invariant": "^1.0.0",
"cross-spawn": "^7.0.6"
},
"devDependencies": {
"@epic-web/config": "^1.21.1",
"@types/cross-spawn": "^6.0.6",
"@types/node": "^24.1.0",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "^3.2.4",
"eslint": "^9.32.0",
"prettier": "^3.6.2",
"typescript": "^5.8.3",
"vitest": "^3.2.4",
"zshy": "^0.3.0"
},
"repository": {
"type": "git",
"url": "https://github.com/kentcdodds/cross-env.git"
},
"bugs": {
"url": "https://github.com/kentcdodds/cross-env/issues"
},
"homepage": "https://github.com/kentcdodds/cross-env#readme",
"zshy": {
"cjs": false,
"exports": {
".": "./src/index.ts",
"./bin/cross-env": "./src/bin/cross-env.ts",
"./bin/cross-env-shell": "./src/bin/cross-env-shell.ts"
}
},
"prettier": "@epic-web/config/prettier",
"module": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./bin/cross-env": {
"types": "./dist/bin/cross-env.d.ts",
"import": "./dist/bin/cross-env.js"
},
"./bin/cross-env-shell": {
"types": "./dist/bin/cross-env-shell.d.ts",
"import": "./dist/bin/cross-env-shell.js"
}
}
}
@@ -0,0 +1,940 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var acorn = require('acorn');
var jsx = require('acorn-jsx');
var visitorKeys = require('eslint-visitor-keys');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys);
/**
* @fileoverview Translates tokens between Acorn format and Esprima format.
* @author Nicholas C. Zakas
*/
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// none!
//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------
// Esprima Token Types
const Token = {
Boolean: "Boolean",
EOF: "<end>",
Identifier: "Identifier",
PrivateIdentifier: "PrivateIdentifier",
Keyword: "Keyword",
Null: "Null",
Numeric: "Numeric",
Punctuator: "Punctuator",
String: "String",
RegularExpression: "RegularExpression",
Template: "Template",
JSXIdentifier: "JSXIdentifier",
JSXText: "JSXText"
};
/**
* Converts part of a template into an Esprima token.
* @param {AcornToken[]} tokens The Acorn tokens representing the template.
* @param {string} code The source code.
* @returns {EsprimaToken} The Esprima equivalent of the template token.
* @private
*/
function convertTemplatePart(tokens, code) {
const firstToken = tokens[0],
lastTemplateToken = tokens.at(-1);
const token = {
type: Token.Template,
value: code.slice(firstToken.start, lastTemplateToken.end)
};
if (firstToken.loc) {
token.loc = {
start: firstToken.loc.start,
end: lastTemplateToken.loc.end
};
}
if (firstToken.range) {
token.start = firstToken.range[0];
token.end = lastTemplateToken.range[1];
token.range = [token.start, token.end];
}
return token;
}
/**
* Contains logic to translate Acorn tokens into Esprima tokens.
* @param {Object} acornTokTypes The Acorn token types.
* @param {string} code The source code Acorn is parsing. This is necessary
* to correct the "value" property of some tokens.
* @constructor
*/
function TokenTranslator(acornTokTypes, code) {
// token types
this._acornTokTypes = acornTokTypes;
// token buffer for templates
this._tokens = [];
// track the last curly brace
this._curlyBrace = null;
// the source code
this._code = code;
}
TokenTranslator.prototype = {
constructor: TokenTranslator,
/**
* Translates a single Esprima token to a single Acorn token. This may be
* inaccurate due to how templates are handled differently in Esprima and
* Acorn, but should be accurate for all other tokens.
* @param {AcornToken} token The Acorn token to translate.
* @param {Object} extra Espree extra object.
* @returns {EsprimaToken} The Esprima version of the token.
*/
translate(token, extra) {
const type = token.type,
tt = this._acornTokTypes;
if (type === tt.name) {
token.type = Token.Identifier;
// TODO: See if this is an Acorn bug
if (token.value === "static") {
token.type = Token.Keyword;
}
if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) {
token.type = Token.Keyword;
}
} else if (type === tt.privateId) {
token.type = Token.PrivateIdentifier;
} else if (type === tt.semi || type === tt.comma ||
type === tt.parenL || type === tt.parenR ||
type === tt.braceL || type === tt.braceR ||
type === tt.dot || type === tt.bracketL ||
type === tt.colon || type === tt.question ||
type === tt.bracketR || type === tt.ellipsis ||
type === tt.arrow || type === tt.jsxTagStart ||
type === tt.incDec || type === tt.starstar ||
type === tt.jsxTagEnd || type === tt.prefix ||
type === tt.questionDot ||
(type.binop && !type.keyword) ||
type.isAssign) {
token.type = Token.Punctuator;
token.value = this._code.slice(token.start, token.end);
} else if (type === tt.jsxName) {
token.type = Token.JSXIdentifier;
} else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
token.type = Token.JSXText;
} else if (type.keyword) {
if (type.keyword === "true" || type.keyword === "false") {
token.type = Token.Boolean;
} else if (type.keyword === "null") {
token.type = Token.Null;
} else {
token.type = Token.Keyword;
}
} else if (type === tt.num) {
token.type = Token.Numeric;
token.value = this._code.slice(token.start, token.end);
} else if (type === tt.string) {
if (extra.jsxAttrValueToken) {
extra.jsxAttrValueToken = false;
token.type = Token.JSXText;
} else {
token.type = Token.String;
}
token.value = this._code.slice(token.start, token.end);
} else if (type === tt.regexp) {
token.type = Token.RegularExpression;
const value = token.value;
token.regex = {
flags: value.flags,
pattern: value.pattern
};
token.value = `/${value.pattern}/${value.flags}`;
}
return token;
},
/**
* Function to call during Acorn's onToken handler.
* @param {AcornToken} token The Acorn token.
* @param {Object} extra The Espree extra object.
* @returns {void}
*/
onToken(token, extra) {
const tt = this._acornTokTypes,
tokens = extra.tokens,
templateTokens = this._tokens;
/**
* Flushes the buffered template tokens and resets the template
* tracking.
* @returns {void}
* @private
*/
const translateTemplateTokens = () => {
tokens.push(convertTemplatePart(this._tokens, this._code));
this._tokens = [];
};
if (token.type === tt.eof) {
// might be one last curlyBrace
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
}
return;
}
if (token.type === tt.backQuote) {
// if there's already a curly, it's not part of the template
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
this._curlyBrace = null;
}
templateTokens.push(token);
// it's the end
if (templateTokens.length > 1) {
translateTemplateTokens();
}
return;
}
if (token.type === tt.dollarBraceL) {
templateTokens.push(token);
translateTemplateTokens();
return;
}
if (token.type === tt.braceR) {
// if there's already a curly, it's not part of the template
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
}
// store new curly for later
this._curlyBrace = token;
return;
}
if (token.type === tt.template || token.type === tt.invalidTemplate) {
if (this._curlyBrace) {
templateTokens.push(this._curlyBrace);
this._curlyBrace = null;
}
templateTokens.push(token);
return;
}
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
this._curlyBrace = null;
}
tokens.push(this.translate(token, extra));
}
};
/**
* @fileoverview A collection of methods for processing Espree's options.
* @author Kai Cataldo
*/
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SUPPORTED_VERSIONS = [
3,
5,
6, // 2015
7, // 2016
8, // 2017
9, // 2018
10, // 2019
11, // 2020
12, // 2021
13, // 2022
14, // 2023
15, // 2024
16, // 2025
17 // 2026
];
/**
* Get the latest ECMAScript version supported by Espree.
* @returns {number} The latest ECMAScript version.
*/
function getLatestEcmaVersion() {
return SUPPORTED_VERSIONS.at(-1);
}
/**
* Get the list of ECMAScript versions supported by Espree.
* @returns {number[]} An array containing the supported ECMAScript versions.
*/
function getSupportedEcmaVersions() {
return [...SUPPORTED_VERSIONS];
}
/**
* Normalize ECMAScript version from the initial config
* @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config
* @throws {Error} throws an error if the ecmaVersion is invalid.
* @returns {number} normalized ECMAScript version
*/
function normalizeEcmaVersion(ecmaVersion = 5) {
let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;
if (typeof version !== "number") {
throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);
}
// Calculate ECMAScript edition number from official year version starting with
// ES2015, which corresponds with ES6 (or a difference of 2009).
if (version >= 2015) {
version -= 2009;
}
if (!SUPPORTED_VERSIONS.includes(version)) {
throw new Error("Invalid ecmaVersion.");
}
return version;
}
/**
* Normalize sourceType from the initial config
* @param {string} sourceType to normalize
* @throws {Error} throw an error if sourceType is invalid
* @returns {string} normalized sourceType
*/
function normalizeSourceType(sourceType = "script") {
if (sourceType === "script" || sourceType === "module") {
return sourceType;
}
if (sourceType === "commonjs") {
return "script";
}
throw new Error("Invalid sourceType.");
}
/**
* Normalize parserOptions
* @param {Object} options the parser options to normalize
* @throws {Error} throw an error if found invalid option.
* @returns {Object} normalized options
*/
function normalizeOptions(options) {
const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
const sourceType = normalizeSourceType(options.sourceType);
const ranges = options.range === true;
const locations = options.loc === true;
if (ecmaVersion !== 3 && options.allowReserved) {
// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
throw new Error("`allowReserved` is only supported when ecmaVersion is 3");
}
if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") {
throw new Error("`allowReserved`, when present, must be `true` or `false`");
}
const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false;
const ecmaFeatures = options.ecmaFeatures || {};
const allowReturnOutsideFunction = options.sourceType === "commonjs" ||
Boolean(ecmaFeatures.globalReturn);
if (sourceType === "module" && ecmaVersion < 6) {
throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
}
return Object.assign({}, options, {
ecmaVersion,
sourceType,
ranges,
locations,
allowReserved,
allowReturnOutsideFunction
});
}
/* eslint no-param-reassign: 0 -- stylistic choice */
const STATE = Symbol("espree's internal state");
const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
/**
* Converts an Acorn comment to a Esprima comment.
* @param {boolean} block True if it's a block comment, false if not.
* @param {string} text The text of the comment.
* @param {int} start The index at which the comment starts.
* @param {int} end The index at which the comment ends.
* @param {Location} startLoc The location at which the comment starts.
* @param {Location} endLoc The location at which the comment ends.
* @param {string} code The source code being parsed.
* @returns {Object} The comment object.
* @private
*/
function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) {
let type;
if (block) {
type = "Block";
} else if (code.slice(start, start + 2) === "#!") {
type = "Hashbang";
} else {
type = "Line";
}
const comment = {
type,
value: text
};
if (typeof start === "number") {
comment.start = start;
comment.end = end;
comment.range = [start, end];
}
if (typeof startLoc === "object") {
comment.loc = {
start: startLoc,
end: endLoc
};
}
return comment;
}
var espree = () => Parser => {
const tokTypes = Object.assign({}, Parser.acorn.tokTypes);
if (Parser.acornJsx) {
Object.assign(tokTypes, Parser.acornJsx.tokTypes);
}
return class Espree extends Parser {
constructor(opts, code) {
if (typeof opts !== "object" || opts === null) {
opts = {};
}
if (typeof code !== "string" && !(code instanceof String)) {
code = String(code);
}
// save original source type in case of commonjs
const originalSourceType = opts.sourceType;
const options = normalizeOptions(opts);
const ecmaFeatures = options.ecmaFeatures || {};
const tokenTranslator =
options.tokens === true
? new TokenTranslator(tokTypes, code)
: null;
/*
* Data that is unique to Espree and is not represented internally
* in Acorn.
*
* For ES2023 hashbangs, Espree will call `onComment()` during the
* constructor, so we must define state before having access to
* `this`.
*/
const state = {
originalSourceType: originalSourceType || options.sourceType,
tokens: tokenTranslator ? [] : null,
comments: options.comment === true ? [] : null,
impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5,
ecmaVersion: options.ecmaVersion,
jsxAttrValueToken: false,
lastToken: null,
templateElements: []
};
// Initialize acorn parser.
super({
// do not use spread, because we don't want to pass any unknown options to acorn
ecmaVersion: options.ecmaVersion,
sourceType: options.sourceType,
ranges: options.ranges,
locations: options.locations,
allowReserved: options.allowReserved,
// Truthy value is true for backward compatibility.
allowReturnOutsideFunction: options.allowReturnOutsideFunction,
// Collect tokens
onToken(token) {
if (tokenTranslator) {
// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
tokenTranslator.onToken(token, state);
}
if (token.type !== tokTypes.eof) {
state.lastToken = token;
}
},
// Collect comments
onComment(block, text, start, end, startLoc, endLoc) {
if (state.comments) {
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);
state.comments.push(comment);
}
}
}, code);
/*
* We put all of this data into a symbol property as a way to avoid
* potential naming conflicts with future versions of Acorn.
*/
this[STATE] = state;
}
tokenize() {
do {
this.next();
} while (this.type !== tokTypes.eof);
// Consume the final eof token
this.next();
const extra = this[STATE];
const tokens = extra.tokens;
if (extra.comments) {
tokens.comments = extra.comments;
}
return tokens;
}
finishNode(...args) {
const result = super.finishNode(...args);
return this[ESPRIMA_FINISH_NODE](result);
}
finishNodeAt(...args) {
const result = super.finishNodeAt(...args);
return this[ESPRIMA_FINISH_NODE](result);
}
parse() {
const extra = this[STATE];
const program = super.parse();
program.sourceType = extra.originalSourceType;
if (extra.comments) {
program.comments = extra.comments;
}
if (extra.tokens) {
program.tokens = extra.tokens;
}
/*
* Adjust opening and closing position of program to match Esprima.
* Acorn always starts programs at range 0 whereas Esprima starts at the
* first AST node's start (the only real difference is when there's leading
* whitespace or leading comments). Acorn also counts trailing whitespace
* as part of the program whereas Esprima only counts up to the last token.
*/
if (program.body.length) {
const [firstNode] = program.body;
if (program.range) {
program.range[0] = firstNode.range[0];
}
if (program.loc) {
program.loc.start = firstNode.loc.start;
}
program.start = firstNode.start;
}
if (extra.lastToken) {
if (program.range) {
program.range[1] = extra.lastToken.range[1];
}
if (program.loc) {
program.loc.end = extra.lastToken.loc.end;
}
program.end = extra.lastToken.end;
}
/*
* https://github.com/eslint/espree/issues/349
* Ensure that template elements have correct range information.
* This is one location where Acorn produces a different value
* for its start and end properties vs. the values present in the
* range property. In order to avoid confusion, we set the start
* and end properties to the values that are present in range.
* This is done here, instead of in finishNode(), because Acorn
* uses the values of start and end internally while parsing, making
* it dangerous to change those values while parsing is ongoing.
* By waiting until the end of parsing, we can safely change these
* values without affect any other part of the process.
*/
this[STATE].templateElements.forEach(templateElement => {
const startOffset = -1;
const endOffset = templateElement.tail ? 1 : 2;
templateElement.start += startOffset;
templateElement.end += endOffset;
if (templateElement.range) {
templateElement.range[0] += startOffset;
templateElement.range[1] += endOffset;
}
if (templateElement.loc) {
templateElement.loc.start.column += startOffset;
templateElement.loc.end.column += endOffset;
}
});
return program;
}
parseTopLevel(node) {
if (this[STATE].impliedStrict) {
this.strict = true;
}
return super.parseTopLevel(node);
}
/**
* Overwrites the default raise method to throw Esprima-style errors.
* @param {int} pos The position of the error.
* @param {string} message The error message.
* @throws {SyntaxError} A syntax error.
* @returns {void}
*/
raise(pos, message) {
const loc = Parser.acorn.getLineInfo(this.input, pos);
const err = new SyntaxError(message);
err.index = pos;
err.lineNumber = loc.line;
err.column = loc.column + 1; // acorn uses 0-based columns
throw err;
}
/**
* Overwrites the default raise method to throw Esprima-style errors.
* @param {int} pos The position of the error.
* @param {string} message The error message.
* @throws {SyntaxError} A syntax error.
* @returns {void}
*/
raiseRecoverable(pos, message) {
this.raise(pos, message);
}
/**
* Overwrites the default unexpected method to throw Esprima-style errors.
* @param {int} pos The position of the error.
* @throws {SyntaxError} A syntax error.
* @returns {void}
*/
unexpected(pos) {
let message = "Unexpected token";
if (pos !== null && pos !== void 0) {
this.pos = pos;
if (this.options.locations) {
while (this.pos < this.lineStart) {
this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1;
--this.curLine;
}
}
this.nextToken();
}
if (this.end > this.start) {
message += ` ${this.input.slice(this.start, this.end)}`;
}
this.raise(this.start, message);
}
/*
* Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX
* uses regular tt.string without any distinction between this and regular JS
* strings. As such, we intercept an attempt to read a JSX string and set a flag
* on extra so that when tokens are converted, the next token will be switched
* to JSXText via onToken.
*/
jsx_readString(quote) { // eslint-disable-line camelcase -- required by API
const result = super.jsx_readString(quote);
if (this.type === tokTypes.string) {
this[STATE].jsxAttrValueToken = true;
}
return result;
}
/**
* Performs last-minute Esprima-specific compatibility checks and fixes.
* @param {ASTNode} result The node to check.
* @returns {ASTNode} The finished node.
*/
[ESPRIMA_FINISH_NODE](result) {
// Acorn doesn't count the opening and closing backticks as part of templates
// so we have to adjust ranges/locations appropriately.
if (result.type === "TemplateElement") {
// save template element references to fix start/end later
this[STATE].templateElements.push(result);
}
if (result.type.includes("Function") && !result.generator) {
result.generator = false;
}
return result;
}
};
};
const version$1 = "10.4.0";
/**
* @fileoverview Main Espree file that converts Acorn into Esprima output.
*
* This file contains code from the following MIT-licensed projects:
* 1. Acorn
* 2. Babylon
* 3. Babel-ESLint
*
* This file also contains code from Esprima, which is BSD licensed.
*
* Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
* Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
* Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// To initialize lazily.
const parsers = {
_regular: null,
_jsx: null,
get regular() {
if (this._regular === null) {
this._regular = acorn__namespace.Parser.extend(espree());
}
return this._regular;
},
get jsx() {
if (this._jsx === null) {
this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree());
}
return this._jsx;
},
get(options) {
const useJsx = Boolean(
options &&
options.ecmaFeatures &&
options.ecmaFeatures.jsx
);
return useJsx ? this.jsx : this.regular;
}
};
//------------------------------------------------------------------------------
// Tokenizer
//------------------------------------------------------------------------------
/**
* Tokenizes the given code.
* @param {string} code The code to tokenize.
* @param {Object} options Options defining how to tokenize.
* @returns {Token[]} An array of tokens.
* @throws {SyntaxError} If the input code is invalid.
* @private
*/
function tokenize(code, options) {
const Parser = parsers.get(options);
// Ensure to collect tokens.
if (!options || options.tokens !== true) {
options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
}
return new Parser(options, code).tokenize();
}
//------------------------------------------------------------------------------
// Parser
//------------------------------------------------------------------------------
/**
* Parses the given code.
* @param {string} code The code to tokenize.
* @param {Object} options Options defining how to tokenize.
* @returns {ASTNode} The "Program" AST node.
* @throws {SyntaxError} If the input code is invalid.
*/
function parse(code, options) {
const Parser = parsers.get(options);
return new Parser(options, code).parse();
}
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
const version = version$1;
const name = "espree";
/* istanbul ignore next */
const VisitorKeys = (function() {
return visitorKeys__namespace.KEYS;
}());
// Derive node types from VisitorKeys
/* istanbul ignore next */
const Syntax = (function() {
let key,
types = {};
if (typeof Object.create === "function") {
types = Object.create(null);
}
for (key in VisitorKeys) {
if (Object.hasOwn(VisitorKeys, key)) {
types[key] = key;
}
}
if (typeof Object.freeze === "function") {
Object.freeze(types);
}
return types;
}());
const latestEcmaVersion = getLatestEcmaVersion();
const supportedEcmaVersions = getSupportedEcmaVersions();
exports.Syntax = Syntax;
exports.VisitorKeys = VisitorKeys;
exports.latestEcmaVersion = latestEcmaVersion;
exports.name = name;
exports.parse = parse;
exports.supportedEcmaVersions = supportedEcmaVersions;
exports.tokenize = tokenize;
exports.version = version;
@@ -0,0 +1 @@
module.exports={C:{"115":0.04344,"147":0.12489,"151":11.51703,"152":0.08145,"153":0.08145,"155":1.39551,"156":0.04344,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 148 149 150 154 157 158 159 160 3.5 3.6"},D:{"103":0.36924,"104":0.20634,"105":0.24435,"106":0.20634,"107":0.40725,"108":0.24435,"109":1.39551,"110":0.24435,"111":0.20634,"112":0.69504,"116":0.53214,"117":0.24435,"118":0.08145,"120":0.24435,"124":0.1629,"131":0.61359,"133":0.45069,"134":0.04344,"135":0.1629,"137":0.1629,"138":0.08145,"139":0.1629,"140":0.08145,"141":0.20634,"142":0.3258,"144":0.12489,"146":0.04344,"148":0.65703,"149":1.14573,"150":3.02994,"151":1.80276,"152":5.00103,"153":3.56751,"154":1.14573,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 113 114 115 119 121 122 123 125 126 127 128 129 130 132 136 143 145 147 155 156 157"},F:{"135":0.04344,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 133 134 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"126":0.3258,"139":0.08145,"143":0.04344,"148":0.04344,"149":0.77649,"150":0.08145,"151":1.14573,"152":3.81186,"153":2.91048,"154":0.57558,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 127 128 129 130 131 132 133 134 135 136 137 138 140 141 142 144 145 146 147"},E:{_:"4 5 6 7 8 9 10 11 12 13 14 15 27 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 16.6 17.0 17.1 17.2 17.3 17.4 17.5 17.6 18.0 18.1 18.2 18.3 18.4 18.5-18.7 26.0 26.1 26.2 26.3 26.4 27.1 27.2 TP","26.5":0.04344,"26.6":3.11682},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00091,"5.0-5.1":0.00091,"6.0-6.1":0,"7.0-7.1":0.00183,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00913,"11.0-11.2":0.00091,"11.3-11.4":0.00183,"12.0-12.1":0,"12.2-12.5":0.02374,"13.0-13.1":0,"13.2":0.00456,"13.3":0,"13.4-13.7":0.00091,"14.0-14.4":0.00365,"14.5-14.8":0.00548,"15.0-15.1":0.00548,"15.2-15.3":0.00365,"15.4":0.00456,"15.5":0.00548,"15.6-15.8":0.11868,"16.0":0.00913,"16.1":0.01643,"16.2":0.00913,"16.3":0.02008,"16.4":0.00456,"16.5":0.0073,"16.6-16.7":0.16523,"17.0":0.00639,"17.1":0.00913,"17.2":0.00913,"17.3":0.01369,"17.4":0.01917,"17.5":0.03743,"17.6-17.7":0.09677,"18.0":0.02008,"18.1":0.04017,"18.2":0.05477,"18.3":0.09494,"18.4":0.05934,"18.5-18.7":1.22601,"26.0":0.05934,"26.1":0.06025,"26.2":0.15702,"26.3":0.1698,"26.4":0.12415,"26.5":0.83164,"26.6":5.13133,"27.0":0.39345,"27.1":0,"27.2":0.01004},P:{"4":0.12001,"28":0.12001,"29":0.04,"30":8.93107,_:"20 21 22 23 24 25 26 27 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":24.13647},R:{_:"0"},M:{"0":6.0722},Q:{_:"14.9"},O:{_:"0"},H:{all:0}};
@@ -0,0 +1,8 @@
//#region src/ssr/handlerCallback.ts
function defineHandlerCallback(handler) {
return handler;
}
//#endregion
export { defineHandlerCallback };
//# sourceMappingURL=handlerCallback.js.map
@@ -0,0 +1,217 @@
import { concat, uint64be } from './buffer_utils.js';
import { checkEncCryptoKey } from './crypto_key.js';
import { invalidKeyInput } from './invalid_key_input.js';
import { JOSENotSupported, JWEDecryptionFailed, JWEInvalid } from '../util/errors.js';
import { isCryptoKey } from './is_key_like.js';
export function cekLength(alg) {
switch (alg) {
case 'A128GCM':
return 128;
case 'A192GCM':
return 192;
case 'A256GCM':
case 'A128CBC-HS256':
return 256;
case 'A192CBC-HS384':
return 384;
case 'A256CBC-HS512':
return 512;
default:
throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`);
}
}
export const generateCek = (alg) => crypto.getRandomValues(new Uint8Array(cekLength(alg) >> 3));
function checkCekLength(cek, expected) {
const actual = cek.byteLength << 3;
if (actual !== expected) {
throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);
}
}
function ivBitLength(alg) {
switch (alg) {
case 'A128GCM':
case 'A128GCMKW':
case 'A192GCM':
case 'A192GCMKW':
case 'A256GCM':
case 'A256GCMKW':
return 96;
case 'A128CBC-HS256':
case 'A192CBC-HS384':
case 'A256CBC-HS512':
return 128;
default:
throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`);
}
}
export const generateIv = (alg) => crypto.getRandomValues(new Uint8Array(ivBitLength(alg) >> 3));
export function checkIvLength(enc, iv) {
if (iv.length << 3 !== ivBitLength(enc)) {
throw new JWEInvalid('Invalid Initialization Vector length');
}
}
async function cbcKeySetup(enc, cek, usage) {
if (!(cek instanceof Uint8Array)) {
throw new TypeError(invalidKeyInput(cek, 'Uint8Array'));
}
const keySize = parseInt(enc.slice(1, 4), 10);
const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [usage]);
const macKey = await crypto.subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
hash: `SHA-${keySize << 1}`,
name: 'HMAC',
}, false, ['sign']);
return { encKey, macKey, keySize };
}
async function cbcHmacTag(macKey, macData, keySize) {
return new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3));
}
async function cbcEncrypt(enc, plaintext, cek, iv, aad) {
const { encKey, macKey, keySize } = await cbcKeySetup(enc, cek, 'encrypt');
const ciphertext = new Uint8Array(await crypto.subtle.encrypt({
iv: iv,
name: 'AES-CBC',
}, encKey, plaintext));
const macData = concat(aad, iv, ciphertext, uint64be(aad.length << 3));
const tag = await cbcHmacTag(macKey, macData, keySize);
return { ciphertext, tag, iv };
}
async function timingSafeEqual(a, b) {
if (!(a instanceof Uint8Array)) {
throw new TypeError('First argument must be a buffer');
}
if (!(b instanceof Uint8Array)) {
throw new TypeError('Second argument must be a buffer');
}
const algorithm = { name: 'HMAC', hash: 'SHA-256' };
const key = (await crypto.subtle.generateKey(algorithm, false, ['sign']));
const aHmac = new Uint8Array(await crypto.subtle.sign(algorithm, key, a));
const bHmac = new Uint8Array(await crypto.subtle.sign(algorithm, key, b));
let out = 0;
let i = -1;
while (++i < 32) {
out |= aHmac[i] ^ bHmac[i];
}
return out === 0;
}
async function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
const { encKey, macKey, keySize } = await cbcKeySetup(enc, cek, 'decrypt');
const macData = concat(aad, iv, ciphertext, uint64be(aad.length << 3));
const expectedTag = await cbcHmacTag(macKey, macData, keySize);
let macCheckPassed;
try {
macCheckPassed = await timingSafeEqual(tag, expectedTag);
}
catch {
}
if (!macCheckPassed) {
throw new JWEDecryptionFailed();
}
let plaintext;
try {
plaintext = new Uint8Array(await crypto.subtle.decrypt({ iv: iv, name: 'AES-CBC' }, encKey, ciphertext));
}
catch {
}
if (!plaintext) {
throw new JWEDecryptionFailed();
}
return plaintext;
}
async function gcmEncrypt(enc, plaintext, cek, iv, aad) {
let encKey;
if (cek instanceof Uint8Array) {
encKey = await crypto.subtle.importKey('raw', cek, 'AES-GCM', false, ['encrypt']);
}
else {
checkEncCryptoKey(cek, enc, 'encrypt');
encKey = cek;
}
const encrypted = new Uint8Array(await crypto.subtle.encrypt({
additionalData: aad,
iv: iv,
name: 'AES-GCM',
tagLength: 128,
}, encKey, plaintext));
const tag = encrypted.slice(-16);
const ciphertext = encrypted.slice(0, -16);
return { ciphertext, tag, iv };
}
async function gcmDecrypt(enc, cek, ciphertext, iv, tag, aad) {
let encKey;
if (cek instanceof Uint8Array) {
encKey = await crypto.subtle.importKey('raw', cek, 'AES-GCM', false, ['decrypt']);
}
else {
checkEncCryptoKey(cek, enc, 'decrypt');
encKey = cek;
}
try {
return new Uint8Array(await crypto.subtle.decrypt({
additionalData: aad,
iv: iv,
name: 'AES-GCM',
tagLength: 128,
}, encKey, concat(ciphertext, tag)));
}
catch {
throw new JWEDecryptionFailed();
}
}
const unsupportedEnc = 'Unsupported JWE Content Encryption Algorithm';
export async function encrypt(enc, plaintext, cek, iv, aad) {
if (!isCryptoKey(cek) && !(cek instanceof Uint8Array)) {
throw new TypeError(invalidKeyInput(cek, 'CryptoKey', 'KeyObject', 'Uint8Array', 'JSON Web Key'));
}
if (iv) {
checkIvLength(enc, iv);
}
else {
iv = generateIv(enc);
}
switch (enc) {
case 'A128CBC-HS256':
case 'A192CBC-HS384':
case 'A256CBC-HS512':
if (cek instanceof Uint8Array) {
checkCekLength(cek, parseInt(enc.slice(-3), 10));
}
return cbcEncrypt(enc, plaintext, cek, iv, aad);
case 'A128GCM':
case 'A192GCM':
case 'A256GCM':
if (cek instanceof Uint8Array) {
checkCekLength(cek, parseInt(enc.slice(1, 4), 10));
}
return gcmEncrypt(enc, plaintext, cek, iv, aad);
default:
throw new JOSENotSupported(unsupportedEnc);
}
}
export async function decrypt(enc, cek, ciphertext, iv, tag, aad) {
if (!isCryptoKey(cek) && !(cek instanceof Uint8Array)) {
throw new TypeError(invalidKeyInput(cek, 'CryptoKey', 'KeyObject', 'Uint8Array', 'JSON Web Key'));
}
if (!iv) {
throw new JWEInvalid('JWE Initialization Vector missing');
}
if (!tag) {
throw new JWEInvalid('JWE Authentication Tag missing');
}
checkIvLength(enc, iv);
switch (enc) {
case 'A128CBC-HS256':
case 'A192CBC-HS384':
case 'A256CBC-HS512':
if (cek instanceof Uint8Array)
checkCekLength(cek, parseInt(enc.slice(-3), 10));
return cbcDecrypt(enc, cek, ciphertext, iv, tag, aad);
case 'A128GCM':
case 'A192GCM':
case 'A256GCM':
if (cek instanceof Uint8Array)
checkCekLength(cek, parseInt(enc.slice(1, 4), 10));
return gcmDecrypt(enc, cek, ciphertext, iv, tag, aad);
default:
throw new JOSENotSupported(unsupportedEnc);
}
}
@@ -0,0 +1 @@
{"version":3,"file":"align-center-vertical.js","sources":["../../../src/icons/align-center-vertical.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlignCenterVertical\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMnYyMCIgLz4KICA8cGF0aCBkPSJNOCAxMEg0YTIgMiAwIDAgMS0yLTJWNmMwLTEuMS45LTIgMi0yaDQiIC8+CiAgPHBhdGggZD0iTTE2IDEwaDRhMiAyIDAgMCAwIDItMlY2YTIgMiAwIDAgMC0yLTJoLTQiIC8+CiAgPHBhdGggZD0iTTggMjBIN2EyIDIgMCAwIDEtMi0ydi0yYzAtMS4xLjktMiAyLTJoMSIgLz4KICA8cGF0aCBkPSJNMTYgMTRoMWEyIDIgMCAwIDEgMiAydjJhMiAyIDAgMCAxLTIgMmgtMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/align-center-vertical\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst AlignCenterVertical = createLucideIcon('AlignCenterVertical', [\n ['path', { d: 'M12 2v20', key: 't6zp3m' }],\n ['path', { d: 'M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4', key: '14d6g8' }],\n ['path', { d: 'M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4', key: '1e2lrw' }],\n ['path', { d: 'M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1', key: '1fkdwx' }],\n ['path', { d: 'M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1', key: '1euafb' }],\n]);\n\nexport default AlignCenterVertical;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,iBAAiB,qBAAuB,CAAA,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,15 @@
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
__title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"
__version__ = "23.3.dev0"
__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"
__license__ = "BSD-2-Clause or Apache-2.0"
__copyright__ = "2014 %s" % __author__
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_intl: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"names":["helpers","data","require","_traverse","_codeFrame","_t","_semver","_babel7Helpers","cloneNode","interpreterDirective","traverseFast","File","constructor","options","code","ast","inputMap","_map","Map","opts","declarations","path","scope","metadata","hub","file","getCode","getScope","addHelper","bind","buildError","buildCodeFrameError","NodePath","get","parentPath","parent","container","key","setContext","shebang","interpreter","node","value","replaceWith","remove","set","val","Error","has","availableHelper","name","versionRange","isInternal","minVersion","err","semver","valid","intersects","_addHelper","declar","generator","res","uid","generateUidIdentifier","dependencies","dep","getDependencies","nodes","globals","Object","keys","getAllBindings","forEach","hasBinding","rename","_compact","added","unshiftContainer","isVariableDeclaration","registerDeclaration","msg","_Error","SyntaxError","loc","stop","txt","highlightCode","codeFrameColumns","start","line","column","end","undefined","exports","default","prototype","addImport","addTemplateObject","getModuleName","babel7"],"sources":["../../../src/transformation/file/file.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport { NodePath } from \"@babel/traverse\";\nimport type { HubInterface, Scope } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport { cloneNode, interpreterDirective, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file.ts\";\n\n// @ts-expect-error This file is `any`\nimport babel7 from \"./babel-7-helpers.cjs\" with { if: \"!process.env.BABEL_8_BREAKING && (!USE_ESM || IS_STANDALONE)\" };\nimport type { ResolvedOptions } from \"../../config/validation/options.ts\";\nimport type { SourceMapConverter } from \"convert-source-map\";\n\nexport default class File {\n _map = new Map<unknown, unknown>();\n opts: ResolvedOptions;\n declarations: Record<string, t.Identifier> = {};\n path: NodePath<t.Program>;\n ast: t.File;\n scope: Scope;\n metadata: Record<string, any> = {};\n code: string = \"\";\n inputMap: SourceMapConverter;\n\n hub: HubInterface & { file: File } = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(\n options: ResolvedOptions,\n { code, ast, inputMap }: NormalizedFile,\n ) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext() as NodePath<t.Program>;\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string) {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: unknown, val: unknown) {\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n }\n\n this._map.set(key, val);\n }\n\n get(key: unknown): any {\n return this._map.get(key);\n }\n\n has(key: unknown): boolean {\n return this._map.has(key);\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange?: string | null): boolean {\n if (helpers.isInternal(name)) return false;\n\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects() hasLine truncated
@@ -0,0 +1,14 @@
require("./_virtual/_rolldown/runtime.cjs");
const require_useRouter = require("./useRouter.cjs");
let _tanstack_react_store = require("@tanstack/react-store");
let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
//#region src/useCanGoBack.ts
function useCanGoBack() {
const router = require_useRouter.useRouter();
if (_tanstack_router_core_isServer.isServer ?? router.isServer) return router.stores.location.get().state.__TSR_index !== 0;
return (0, _tanstack_react_store.useStore)(router.stores.location, (location) => location.state.__TSR_index !== 0);
}
//#endregion
exports.useCanGoBack = useCanGoBack;
//# sourceMappingURL=useCanGoBack.cjs.map
@@ -0,0 +1,39 @@
{
"name": "load-tsconfig",
"version": "0.2.5",
"description": "Load tsconfig.json",
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"type": "module",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}
},
"scripts": {
"build-fast": "tsup src/index.ts --format esm,cjs --target node12.20.0",
"build": "pnpm build-fast --dts-resolve",
"test": "npm run build-fast && vitest run",
"prepublishOnly": "pnpm build"
},
"license": "MIT",
"devDependencies": {
"@egoist/prettier-config": "1.0.0",
"@types/node": "18.15.3",
"kanpai": "0.11.0",
"prettier": "2.8.4",
"strip-json-comments": "5.0.0",
"tsup": "6.6.3",
"typescript": "5.0.2",
"vitest": "0.29.3"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}
}
@@ -0,0 +1,4 @@
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldBeLast", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,86 @@
'use strict';
module.exports = function generate_uniqueItems(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
if (($schema || $isData) && it.opts.uniqueItems !== false) {
if ($isData) {
out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { ';
}
out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';
var $itemType = it.schema.items && it.schema.items.type,
$typeIsArray = Array.isArray($itemType);
if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {
out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';
} else {
out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
if ($typeIsArray) {
out += ' if (typeof item == \'string\') item = \'"\' + item; ';
}
out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';
}
out += ' } ';
if ($isData) {
out += ' } ';
}
out += ' if (!' + ($valid) + ') { ';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';
if (it.opts.messages !== false) {
out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + ($schema);
}
out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += ' } ';
if ($breakOnError) {
out += ' else { ';
}
} else {
if ($breakOnError) {
out += ' if (true) { ';
}
}
return out;
}
@@ -0,0 +1,924 @@
flf2a$ 9 6 30 1 5
larry3d.flf by Larry Gelberg (larryg@avs.com)
(stolen liberally from Juan Car's puffy.flf)
tweaked by Glenn Chappell <ggc@uiuc.edu>
Version 1.2 2/24/94
$$$ @
$$$ @
$$$ @
$$$ @
$$$ @
$$$ @
$$$ @
$$$ @
$$$@@
__ @
/\ \ @
\ \ \ @
\ \ \ @
\ \_\ @
\/\_\@
\/_/@
@
@@
__ __ @
/\ \\ \ @
\ \_\\_\ @
\/_//_/$ @
$ $ @
$ $@
@
@
@@
__ __ @
_\ \\ \__ @
/\__ _ _\ @
\/_L\ \\ \L_ @
/\_ _ _\@
\/_/\_\\_\/@
\/_//_/ @
@
@@
__ @
/\ \_ @
\/'__`\ @
/\ \_\_\ @
\ \____ \ @
\/\ \_\ \@
\ `\_ _/@
`\_/\_\@
\/_/@@
__ __ @
/\_\ / / @
\/_/ / / @
/ / @
/ / __ @
/_/ /\_\@
/_/ \/_/@
@
@@
____ @
/| _ \ @
|/\ | @
\// __`\/\ @
/| \L> <_@
| \_____/\/@
\/____/\/ @
@
@@
__ @
/\ \ @
\ \/$ @
\/ $ @
$ $ @
$ $@
@
@
@@
_ @
/' \ @
/\ ,/' @
\ \ \ @
\ \ `\ @
\ `\__\@
`\/_/ @
@
@@
__ @
/\ `\ @
\`\ \ @
`\`\ \ @
`\/' \@
/\__/@
\/_/ @
@
@@
__ @
_\ \ _ @
/\_` ' \ @
\/_> <_ @
/\_, ,_\@
\/_/\_\/@
\/_/ @
@
@@
__ @
/\ \ @
\_\ \___ @
/\___ __\@
\/__/\ \_/@
\ \_\ @
\/_/ @
@
@@
@
@
@
@
__ @
/\ \@
\ \/@
\/ @
@@
@
@
@
_______ @
/\______\@
\/______/@
@
@
@@
@
@
@
@
__ @
/\_\@
\/_/@
@
@@
__@
/ /@
/ / @
/ / @
/ / @
/_/ @
/_/ @
@
@@
__ @
/'__`\ @
/\ \/\ \ @
\ \ \ \ \ @
\ \ \_\ \@
\ \____/@
\/___/ @
@
@@
_ @
/' \ @
/\_, \ @
\/_/\ \ @
\ \ \ @
\ \_\@
\/_/@
@
@@
___ @
/'___`\ @
/\_\ /\ \ @
\/_/// /__ @
// /_\ \@
/\______/@
\/_____/ @
@
@@
__ @
/'__`\ @
/\_\L\ \ @
\/_/_\_<_ @
/\ \L\ \@
\ \____/@
\/___/ @
@
@@
__ __ @
/\ \\ \ @
\ \ \\ \ @
\ \ \\ \_ @
\ \__ ,__\@
\/_/\_\_/@
\/_/ @
@
@@
______ @
/\ ___\ @
\ \ \__/ @
\ \___``\ @
\/\ \L\ \@
\ \____/@
\/___/ @
@
@@
____ @
/'___\ @
/\ \__/ @
\ \ _``\ @
\ \ \L\ \@
\ \____/@
\/___/ @
@
@@
________ @
/\_____ \@
\/___//'/'@
/' /' @
/' /' @
/\_/ @
\// @
@
@@
__ @
/'_ `\ @
/\ \L\ \ @
\/_> _ <_ @
/\ \L\ \@
\ \____/@
\/___/ @
@
@@
__ @
/'_ `\ @
/\ \L\ \ @
\ \___, \ @
\/__,/\ \ @
\ \_\@
\/_/@
@
@@
@
@
__ @
/\_\ @
\/_/_ @
/\_\@
\/_/@
@
@@
@
@
__ @
/\_\ @
\/_/_ @
/\ \@
\ \/@
\/ @
@@
___ @
/ / @
/ / @
/< < @
\ `\ `\ @
`\ `\_|@
`\// @
@
@@
@
_______ @
/\______\ @
\/______/_ @
/\______\@
\/______/@
@
@
@@
__ @
/\ `\ @
\ `\ `\ @
`\ > >@
/ / @
/\_/ @
\// @
@
@@
_ @
/'_`\ @
/\_\/\`\@
\/_//'/'@
/\_\ @
\/\_\@
\/_/@
@
@@
@
__ @
/'_`\_ @
/'/'_` \ @
/\ \ \L\ \ @
\ \ `\__,_\@
\ `\_____\@
`\/_____/@
@@
______ @
/\ _ \ @
\ \ \L\ \ @
\ \ __ \ @
\ \ \/\ \ @
\ \_\ \_\@
\/_/\/_/@
@
@@
____ @
/\ _`\ @
\ \ \L\ \ @
\ \ _ <' @
\ \ \L\ \@
\ \____/@
\/___/ @
@
@@
____ @
/\ _`\ @
\ \ \/\_\ @
\ \ \/_/_ @
\ \ \L\ \@
\ \____/@
\/___/ @
@
@@
____ @
/\ _`\ @
\ \ \/\ \ @
\ \ \ \ \ @
\ \ \_\ \@
\ \____/@
\/___/ @
@
@@
____ @
/\ _`\ @
\ \ \L\_\ @
\ \ _\L @
\ \ \L\ \@
\ \____/@
\/___/ @
@
@@
____ @
/\ _`\ @
\ \ \L\_\@
\ \ _\/@
\ \ \/ @
\ \_\ @
\/_/ @
@
@@
____ @
/\ _`\ @
\ \ \L\_\ @
\ \ \L_L @
\ \ \/, \@
\ \____/@
\/___/ @
@
@@
__ __ @
/\ \/\ \ @
\ \ \_\ \ @
\ \ _ \ @
\ \ \ \ \ @
\ \_\ \_\@
\/_/\/_/@
@
@@
______ @
/\__ _\ @
\/_/\ \/ @
\ \ \ @
\_\ \__ @
/\_____\@
\/_____/@
@
@@
_____ @
/\___ \ @
\/__/\ \ @
_\ \ \ @
/\ \_\ \@
\ \____/@
\/___/ @
@
@@
__ __ @
/\ \/\ \ @
\ \ \/'/' @
\ \ , < @
\ \ \\`\ @
\ \_\ \_\@
\/_/\/_/@
@
@@
__ @
/\ \ @
\ \ \ @
\ \ \ __ @
\ \ \L\ \@
\ \____/@
\/___/ @
@
@@
@
/'\_/`\ @
/\ \ @
\ \ \__\ \ @
\ \ \_/\ \ @
\ \_\\ \_\@
\/_/ \/_/@
@
@@
__ __ @
/\ \/\ \ @
\ \ `\\ \ @
\ \ , ` \ @
\ \ \`\ \ @
\ \_\ \_\@
\/_/\/_/@
@
@@
_____ @
/\ __`\ @
\ \ \/\ \ @
\ \ \ \ \ @
\ \ \_\ \ @
\ \_____\@
\/_____/@
@
@@
____ @
/\ _`\ @
\ \ \L\ \@
\ \ ,__/@
\ \ \/ @
\ \_\ @
\/_/ @
@
@@
_____ @
/\ __`\ @
\ \ \/\ \ @
\ \ \ \ \ @
\ \ \\'\\ @
\ \___\_\@
\/__//_/@
@
@@
____ @
/\ _`\ @
\ \ \L\ \ @
\ \ , / @
\ \ \\ \ @
\ \_\ \_\@
\/_/\/ /@
@
@@
____ @
/\ _`\ @
\ \,\L\_\ @
\/_\__ \ @
/\ \L\ \ @
\ `\____\@
\/_____/@
@
@@
______ @
/\__ _\ @
\/_/\ \/ @
\ \ \ @
\ \ \ @
\ \_\@
\/_/@
@
@@
__ __ @
/\ \/\ \ @
\ \ \ \ \ @
\ \ \ \ \ @
\ \ \_\ \ @
\ \_____\@
\/_____/@
@
@@
__ __ @
/\ \/\ \ @
\ \ \ \ \ @
\ \ \ \ \ @
\ \ \_/ \@
\ `\___/@
`\/__/ @
@
@@
__ __ @
/\ \ __/\ \ @
\ \ \/\ \ \ \ @
\ \ \ \ \ \ \ @
\ \ \_/ \_\ \@
\ `\___x___/@
'\/__//__/ @
@
@@
__ __ @
/\ \ /\ \ @
\ `\`\/'/' @
`\/ > < @
\/'/\`\ @
/\_\\ \_\@
\/_/ \/_/@
@
@@
__ __ @
/\ \ /\ \@
\ `\`\\/'/@
`\ `\ /' @
`\ \ \ @
\ \_\@
\/_/@
@
@@
________ @
/\_____ \ @
\/____//'/' @
//'/' @
//'/'___ @
/\_______\@
\/_______/@
@
@@
____ @
/\ _\ @
\ \ \/ @
\ \ \ @
\ \ \_ @
\ \___\@
\/___/@
@
@@
__ @
/\ `\ @
\`\ `\ @
`\`\ `\ @
`\`\ `\ @
`\`\__\@
`\/__/@
@
@@
____ @
/\__ \ @
\/_/\ \ @
\ \ \ @
\_\ \ @
/\___\@
\/___/@
@
@@
__ @
/ `\ @
/\_/\_\ @
\//\// $ @
$ $ @
$ $@
@
@
@@
@
@
@
@
@
$ $ @
$_______ @
/\______\@
\/______/@@
__ @
/\ \ @
\ \\$ @
\// $ @
$ $ @
$ $@
@
@
@@
@
@
__ @
/'__`\ @
/\ \L\.\_ @
\ \__/.\_\@
\/__/\/_/@
@
@@
__ @
/\ \ @
\ \ \____ @
\ \ '__`\ @
\ \ \L\ \@
\ \_,__/@
\/___/ @
@
@@
@
@
___ @
/'___\ @
/\ \__/ @
\ \____\@
\/____/@
@
@@
__ @
/\ \ @
\_\ \ @
/'_` \ @
/\ \L\ \ @
\ \___,_\@
\/__,_ /@
@
@@
@
@
__ @
/'__`\ @
/\ __/ @
\ \____\@
\/____/@
@
@@
___ @
/'___\ @
/\ \__/ @
\ \ ,__\@
\ \ \_/@
\ \_\ @
\/_/ @
@
@@
@
@
__ @
/'_ `\ @
/\ \L\ \ @
\ \____ \ @
\/___L\ \@
/\____/@
\_/__/ @@
__ @
/\ \ @
\ \ \___ @
\ \ _ `\ @
\ \ \ \ \ @
\ \_\ \_\@
\/_/\/_/@
@
@@
@
__ @
/\_\ @
\/\ \ @
\ \ \ @
\ \_\@
\/_/@
@
@@
@
__ @
/\_\ @
\/\ \ @
\ \ \ @
_\ \ \ @
/\ \_\ \@
\ \____/@
\/___/ @@
__ @
/\ \ @
\ \ \/'\ @
\ \ , < @
\ \ \\`\ @
\ \_\ \_\@
\/_/\/_/@
@
@@
___ @
/\_ \ @
\//\ \ @
\ \ \ @
\_\ \_ @
/\____\@
\/____/@
@
@@
@
@
___ ___ @
/' __` __`\ @
/\ \/\ \/\ \ @
\ \_\ \_\ \_\@
\/_/\/_/\/_/@
@
@@
@
@
___ @
/' _ `\ @
/\ \/\ \ @
\ \_\ \_\@
\/_/\/_/@
@
@@
@
@
___ @
/ __`\ @
/\ \L\ \@
\ \____/@
\/___/ @
@
@@
@
@
_____ @
/\ '__`\ @
\ \ \L\ \@
\ \ ,__/@
\ \ \/ @
\ \_\ @
\/_/ @@
@
@
__ @
/'__`\ @
/\ \L\ \ @
\ \___, \ @
\/___/\ \ @
\ \_\@
\/_/@@
@
@
_ __ @
/\`'__\@
\ \ \/ @
\ \_\ @
\/_/ @
@
@@
@
@
____ @
/',__\ @
/\__, `\@
\/\____/@
\/___/ @
@
@@
__ @
/\ \__ @
\ \ ,_\ @
\ \ \/ @
\ \ \_ @
\ \__\@
\/__/@
@
@@
@
@
__ __ @
/\ \/\ \ @
\ \ \_\ \@
\ \____/@
\/___/ @
@
@@
@
@
__ __ @
/\ \/\ \ @
\ \ \_/ |@
\ \___/ @
\/__/ @
@
@@
@
@
__ __ __ @
/\ \/\ \/\ \ @
\ \ \_/ \_/ \@
\ \___x___/'@
\/__//__/ @
@
@@
@
@
__ _ @
/\ \/'\ @
\/> </ @
/\_/\_\@
\//\/_/@
@
@@
@
@
__ __ @
/\ \/\ \ @
\ \ \_\ \ @
\/`____ \ @
`/___/> \@
/\___/@
\/__/ @@
@
@
____ @
/\_ ,`\ @
\/_/ /_ @
/\____\@
\/____/@
@
@@
_ @
/' \@
\ ,/'@
<' \ @
< \ `\ @
\`\__\@
\/__/@
@
@@
__ @
/\ \ @
\ \ \ @
\ \ \ @
\ \ \ @
\ \ \ @
\ \ \ @
\ \_\@
\/_/@@
__ @
/\ `\ @
\`\ \ @
\ \ `>@
//' \ @
/\__/' @
\/_/ @
@
@@
_ _ @
/' \/' \ @
/\_/\__//$ @
\//\/__/ $ @
$ $@
@
@
@
@@
__ __ @
/\_\/\_\ @
\/\ _ \ @
\ \ \L\ \ @
\ \ __ \ @
\ \_\/\_\@
\/_/\/_/@
@
@@
__ __ @
/\_\/\_\ @
\/\ __ \ @
\ \ \/\ \ @
\ \ \_\ \ @
\ \_____\@
\/_____/@
@
@@
__ __ @
/\_\/\_\ @
\/\ \/\ \ @
\ \ \ \ \ @
\ \ \_\ \ @
\ \_____\@
\/_____/@
@
@@
__ __ @
/\_\/\_\ @
\/_/\/_/_ @
/'_` \ @
/\ \L\ \ @
\ `\__,_\@
`\/_,__/@
@
@@
__ __ @
/\_\/\_\ @
\/_/\/_/ @
/'_`\ @
/\ \L\ \@
\ `\___/@
`\/__/ @
@
@@
__ __ @
/\_\ \_\ @
\/_/\/_/_ @
/\ \/\ \ @
\ \ \_\ \@
\ `\___/@
`\/__/ @
@
@@
______ @
/\ __ \ @
\ \ \/\ \ @
\ \ \<_<_ @
\ \ \ \ \@
\ \ \\_/@
\ \_\/ @
\/_/ @
@@
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_b","520":"_V"},B:{"1":"_K","8":"_KB","388":"_fN"},C:{"1":"_wR","2":"_f","132":"_kJ"},D:{"1":"_4G","2":"_5","132":"_fC _0E"},E:{"2":"MD","8":"_5 lC ND","520":"_zN _zB _ID","16385":"_1C","17412":"M _DE","23556":"N","24580":"G _EE"},F:{"1":"_QG _eF","2":"_1G","132":"_6 G _2K"},G:{"2":"_ND","16385":"_NM","17412":"_4K","19460":"_nN _aG _pE"},H:{"2":"1D"},I:{"1":"I","2":"_m","132":"_CO"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"8":"_A"},O:{"1":"bC"},P:{"1":"_U","132":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"WebM video format",D:true};
@@ -0,0 +1,199 @@
/**
* @fileoverview An object that creates fix commands for rules.
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* @import { SourceRange } from "@eslint/core";
*/
/* eslint class-methods-use-this: off -- Methods desired on instance */
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// none!
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Creates a fix command that inserts text at the specified index in the source text.
* @param {number} index The 0-based index at which to insert the new text.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @private
*/
function insertTextAt(index, text) {
return {
range: [index, index],
text,
};
}
/**
* Asserts that the provided text is a string.
* @param {unknown} text The text to validate.
* @returns {void}
* @throws {TypeError} If `text` is not a string.
*/
function assertIsString(text) {
if (typeof text !== "string") {
throw new TypeError("'text' must be a string");
}
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Creates code fixing commands for rules.
*/
class RuleFixer {
/**
* The source code object representing the text to be fixed.
* @type {SourceCode}
*/
#sourceCode;
/**
* Creates a new instance.
* @param {Object} options The options for the fixer.
* @param {SourceCode} options.sourceCode The source code object representing the text to be fixed.
*/
constructor({ sourceCode }) {
this.#sourceCode = sourceCode;
}
/**
* Creates a fix command that inserts text after the given node or token.
* The fix is not applied until applyFixes() is called.
* @param {ASTNode|Token} nodeOrToken The node or token to insert after.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @throws {TypeError} If `text` is not a string.
*/
insertTextAfter(nodeOrToken, text) {
assertIsString(text);
const range = this.#sourceCode.getRange(nodeOrToken);
return this.insertTextAfterRange(range, text);
}
/**
* Creates a fix command that inserts text after the specified range in the source text.
* The fix is not applied until applyFixes() is called.
* @param {SourceRange} range The range to replace, first item is start of range, second
* is end of range.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @throws {TypeError} If `text` is not a string.
*/
insertTextAfterRange(range, text) {
assertIsString(text);
return insertTextAt(range[1], text);
}
/**
* Creates a fix command that inserts text before the given node or token.
* The fix is not applied until applyFixes() is called.
* @param {ASTNode|Token} nodeOrToken The node or token to insert before.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @throws {TypeError} If `text` is not a string.
*/
insertTextBefore(nodeOrToken, text) {
assertIsString(text);
const range = this.#sourceCode.getRange(nodeOrToken);
return this.insertTextBeforeRange(range, text);
}
/**
* Creates a fix command that inserts text before the specified range in the source text.
* The fix is not applied until applyFixes() is called.
* @param {SourceRange} range The range to replace, first item is start of range, second
* is end of range.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @throws {TypeError} If `text` is not a string.
*/
insertTextBeforeRange(range, text) {
assertIsString(text);
return insertTextAt(range[0], text);
}
/**
* Creates a fix command that replaces text at the node or token.
* The fix is not applied until applyFixes() is called.
* @param {ASTNode|Token} nodeOrToken The node or token to remove.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @throws {TypeError} If `text` is not a string.
*/
replaceText(nodeOrToken, text) {
assertIsString(text);
const range = this.#sourceCode.getRange(nodeOrToken);
return this.replaceTextRange(range, text);
}
/**
* Creates a fix command that replaces text at the specified range in the source text.
* The fix is not applied until applyFixes() is called.
* @param {SourceRange} range The range to replace, first item is start of range, second
* is end of range.
* @param {string} text The text to insert.
* @returns {Object} The fix command.
* @throws {TypeError} If `text` is not a string.
*/
replaceTextRange(range, text) {
assertIsString(text);
return {
range,
text,
};
}
/**
* Creates a fix command that removes the node or token from the source.
* The fix is not applied until applyFixes() is called.
* @param {ASTNode|Token} nodeOrToken The node or token to remove.
* @returns {Object} The fix command.
*/
remove(nodeOrToken) {
const range = this.#sourceCode.getRange(nodeOrToken);
return this.removeRange(range);
}
/**
* Creates a fix command that removes the specified range of text from the source.
* The fix is not applied until applyFixes() is called.
* @param {SourceRange} range The range to remove, first item is start of range, second
* is end of range.
* @returns {Object} The fix command.
*/
removeRange(range) {
return {
range,
text: "",
};
}
}
module.exports = { RuleFixer };
@@ -0,0 +1,112 @@
'use strict'
const assert = require('node:assert')
const { AsyncResource } = require('node:async_hooks')
const { InvalidArgumentError, SocketError } = require('../core/errors')
const util = require('../core/util')
const { addSignal, removeSignal } = require('./abort-signal')
class ConnectHandler extends AsyncResource {
constructor (opts, callback) {
if (!opts || typeof opts !== 'object') {
throw new InvalidArgumentError('invalid opts')
}
if (typeof callback !== 'function') {
throw new InvalidArgumentError('invalid callback')
}
const { signal, opaque, responseHeaders } = opts
if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
}
super('UNDICI_CONNECT')
this.opaque = opaque || null
this.responseHeaders = responseHeaders || null
this.callback = callback
this.abort = null
addSignal(this, signal)
}
onRequestStart (controller, context) {
if (this.reason) {
controller.abort(this.reason)
return
}
assert(this.callback)
this.abort = (reason) => controller.abort(reason)
this.context = context
}
onResponseStart () {
throw new SocketError('bad connect', null)
}
onRequestUpgrade (controller, statusCode, headers, socket) {
const { callback, opaque, context } = this
removeSignal(this)
this.callback = null
let responseHeaders = headers
const rawHeaders = controller?.rawHeaders
// Indicates is an HTTP2Session
if (responseHeaders != null) {
responseHeaders = this.responseHeaders === 'raw'
? util.parseRawHeaders(rawHeaders)
: headers
}
this.runInAsyncScope(callback, null, null, {
statusCode,
headers: responseHeaders,
socket,
opaque,
context
})
}
onResponseError (_controller, err) {
const { callback, opaque } = this
removeSignal(this)
if (callback) {
this.callback = null
queueMicrotask(() => {
this.runInAsyncScope(callback, null, err, { opaque })
})
}
}
}
function connect (opts, callback) {
if (callback === undefined) {
return new Promise((resolve, reject) => {
connect.call(this, opts, (err, data) => {
return err ? reject(err) : resolve(data)
})
})
}
try {
const connectHandler = new ConnectHandler(opts, callback)
const connectOptions = { ...opts, method: 'CONNECT' }
this.dispatch(connectOptions, connectHandler)
} catch (err) {
if (typeof callback !== 'function') {
throw err
}
const opaque = opts?.opaque
queueMicrotask(() => callback(err, { opaque }))
}
}
module.exports = connect
@@ -0,0 +1,20 @@
Copyright JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,34 @@
/**
* @license React
* react-jsx-runtime.profiling.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
function jsxProd(type, config, maybeKey) {
var key = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
config = maybeKey.ref;
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
ref: void 0 !== config ? config : null,
props: maybeKey
};
}
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsxProd;
exports.jsxs = jsxProd;
@@ -0,0 +1,37 @@
"use client";
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_ClientOnly = require("./ClientOnly.cjs");
const require_useRouter = require("./useRouter.cjs");
const require_Asset = require("./Asset.cjs");
const require_headContentUtils = require("./headContentUtils.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/HeadContent.dev.tsx
var DEV_STYLES_ATTR = "data-tanstack-router-dev-styles";
/**
* Render route-managed head tags (title, meta, links, styles, head scripts).
* Place inside the document head of your app shell.
*
* Development version: filters out dev styles link after hydration and
* includes a fallback cleanup effect for hydration mismatch cases.
*
* @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management
*/
function HeadContent(props) {
const tags = require_headContentUtils.useTags(props.assetCrossOrigin);
const nonce = require_useRouter.useRouter().options.ssr?.nonce;
const hydrated = require_ClientOnly.useHydrated();
react.useEffect(() => {
if (hydrated) document.querySelectorAll(`link[${DEV_STYLES_ATTR}]`).forEach((el) => el.remove());
}, [hydrated]);
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: (hydrated ? tags.filter((tag) => !tag.attrs?.[DEV_STYLES_ATTR]) : tags).map((tag) => /* @__PURE__ */ (0, react.createElement)(require_Asset.Asset, {
...tag,
key: `tsr-meta-${JSON.stringify(tag)}`,
nonce
})) });
}
//#endregion
exports.HeadContent = HeadContent;
//# sourceMappingURL=HeadContent.dev.cjs.map
@@ -0,0 +1,8 @@
function isRefObject(ref) {
return (ref &&
typeof ref === "object" &&
Object.prototype.hasOwnProperty.call(ref, "current"));
}
export { isRefObject };
//# sourceMappingURL=is-ref-object.mjs.map
@@ -0,0 +1,14 @@
//#region src/utils/filepath.d.ts
/**
* @module
* FilePath utility.
*/
type FilePathOptions = {
filename: string;
root?: string;
defaultDocument?: string;
};
export declare const getFilePath: (options: FilePathOptions) => string | undefined;
export declare const getFilePathWithoutDefaultDocument: (options: Omit<FilePathOptions, "defaultDocument">) => string | undefined;
//#endregion
export {};
@@ -0,0 +1 @@
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../src/server/mcp.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,589 @@
import { _ as DEFAULT_MAX_SUBSCRIPTIONS, i as installModernOnlyHandlers, o as serverIdentityOf, t as McpServer, v as StdioListenRouter } from "./mcp-DIH4cS6P.mjs";
import { F as carriesValidModernEnvelopeClaim, J as isJSONRPCErrorResponse, Q as isJSONRPCResultResponse, R as modernOnlyStrictRejection, X as isJSONRPCRequest, Y as isJSONRPCNotification, at as requestMetaOf, c as ReadBuffer, d as serializeMessage, ft as UnsupportedProtocolVersionError, it as hasEnvelopeClaim, mt as ProtocolErrorCode, ot as validateEnvelopeMeta, rt as envelopeClaimVersion, vt as SUPPORTED_MODERN_PROTOCOL_VERSIONS, y as setNegotiatedProtocolVersion } from "./src-Cqbh3MYc.mjs";
import { process } from "@modelcontextprotocol/server/_shims";
//#region src/server/stdio.ts
/**
* Marks a stdout `'error'` listener that a closed transport left attached purely to
* swallow late write failures (see {@link StdioServerTransport.close}). A fresh
* transport taking over the same stream removes listeners carrying this tag in
* `start()`, so repeated create→close cycles on the process-global `process.stdout`
* don't accumulate listeners.
*/
const swallowsErrorsAfterClose = Symbol("swallowsErrorsAfterClose");
/**
* Server transport for stdio: this communicates with an MCP client by reading from the current process' `stdin` and writing to `stdout`.
*
* This transport is only available in Node.js environments.
*
* When the client closes its end of the pipe (stdin reaches end-of-file), the transport
* closes itself and fires `onclose`, per the MCP stdio binding's guidance that servers
* should exit promptly when their standard input is closed. A server that holds no other
* keep-alive handles will then exit naturally. Requests still in flight when stdin ends are
* aborted and not answered; a client that expects responses keeps stdin open until it has
* read them.
*
* @example
* ```ts source="./stdio.examples.ts#StdioServerTransport_basicUsage"
* const server = new McpServer({ name: 'my-server', version: '1.0.0' });
* const transport = new StdioServerTransport();
* await server.connect(transport);
* ```
*/
var StdioServerTransport = class {
_readBuffer;
_started = false;
_closed = false;
constructor(_stdin = process.stdin, _stdout = process.stdout, options) {
this._stdin = _stdin;
this._stdout = _stdout;
this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
}
onclose;
onerror;
onmessage;
_ondata = (chunk) => {
try {
this._readBuffer.append(chunk);
this.processReadBuffer();
} catch (error) {
this.onerror?.(error);
this.close().catch(() => {});
}
};
_onerror = (error) => {
this.onerror?.(error);
};
_onstdouterror = (error) => {
if (this._closed) return;
this.onerror?.(error);
this.close().catch(() => {});
};
_onstdinclose = () => {
this.close().catch(() => {});
};
/**
* Starts listening for messages on `stdin`.
*/
async start() {
if (this._started) throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
this._started = true;
for (const listener of this._stdout.listeners("error")) if (listener[swallowsErrorsAfterClose]) this._stdout.off("error", listener);
if (this._stdin.readableEnded || this._stdin.destroyed) setImmediate(this._onstdinclose);
this._stdin.on("data", this._ondata);
this._stdin.on("error", this._onerror);
this._stdin.on("end", this._onstdinclose);
this._stdin.on("close", this._onstdinclose);
this._stdout.on("error", this._onstdouterror);
}
processReadBuffer() {
while (true) try {
const message = this._readBuffer.readMessage();
if (message === null) break;
this.onmessage?.(message);
} catch (error) {
this.onerror?.(error);
}
}
async close() {
if (this._closed) return;
this._closed = true;
this._stdin.off("data", this._ondata);
this._stdin.off("error", this._onerror);
this._stdin.off("end", this._onstdinclose);
this._stdin.off("close", this._onstdinclose);
this._onstdouterror[swallowsErrorsAfterClose] = true;
if (this._stdin.listenerCount("data") === 0) this._stdin.pause();
this._readBuffer.clear();
this.onclose?.();
}
send(message) {
if (this._closed) return Promise.reject(/* @__PURE__ */ new Error("StdioServerTransport is closed"));
return new Promise((resolve, reject) => {
const json = serializeMessage(message);
let settled = false;
const onError = (error) => {
if (settled) return;
settled = true;
this._stdout.off("error", onError);
this._stdout.off("drain", onDrain);
reject(error);
};
const onDrain = () => {
if (settled) return;
settled = true;
this._stdout.off("error", onError);
this._stdout.off("drain", onDrain);
resolve();
};
this._stdout.once("error", onError);
if (this._stdout.write(json)) {
if (settled) return;
settled = true;
this._stdout.off("error", onError);
resolve();
} else if (!settled) this._stdout.once("drain", onDrain);
});
}
};
//#endregion
//#region src/server/serveStdio.ts
/**
* How long the probe-discard path waits for the probe instance to answer the
* requests it was delivered before closing it. The wait normally settles as
* soon as the DiscoverResult is handed to the wire (or immediately, when a
* delivered cancellation already settled the probe); the bound is a backstop
* so no edge can ever hold the connection's inbound pump indefinitely behind
* the discard.
*/
const DISCARD_ANSWER_TIMEOUT_MS = 3e3;
/**
* The transport a pinned instance is connected to: a thin channel that writes
* through to the entry-owned wire transport and receives the messages the
* entry forwards. The wire transport itself is never handed to an instance —
* that is what lets the entry discard an optimistic probe instance (close the
* channel) without tearing down the connection.
*/
var StdioConnectionChannel = class {
onclose;
onerror;
onmessage;
_closed = false;
/** Request ids the entry delivered to the instance that the instance has not yet answered. */
_pendingRequests = /* @__PURE__ */ new Set();
_drainWaiters = [];
constructor(_wire, _onInstanceClose, _outboundIntercept) {
this._wire = _wire;
this._onInstanceClose = _onInstanceClose;
this._outboundIntercept = _outboundIntercept;
}
async start() {}
async send(message, options) {
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
const { id } = message;
if (id !== void 0) this._settle(id);
}
if (this._closed) return;
if (this._outboundIntercept?.(message) === "handled") return;
return this._wire.send(message, options);
}
setProtocolVersion = (version) => {
this._wire.setProtocolVersion?.(version);
};
/** Forwards one inbound message to the connected instance. */
deliver(message, extra) {
if (this._closed) return;
if (isJSONRPCRequest(message)) this._pendingRequests.add(message.id);
else if (isJSONRPCNotification(message) && message.method === "notifications/cancelled") {
const cancelledId = message.params?.requestId;
if (cancelledId !== void 0) this._settle(cancelledId);
}
this.onmessage?.(message, extra);
}
/**
* Resolves once every request delivered to the instance has been answered
* through {@linkcode send}, settled by a delivered cancellation, or the
* channel has been closed and nothing further can be answered. The wait is
* bounded by `timeoutMs` as a backstop so no edge can hold the caller
* indefinitely; resolves `false` only when the bound elapsed with requests
* still unanswered. Used by the probe-discard path so a probe request the
* entry accepted is never silently dropped.
*/
async whenRequestsAnswered(timeoutMs) {
if (this._closed || this._pendingRequests.size === 0) return true;
return await new Promise((resolve) => {
const waiter = () => {
clearTimeout(timer);
resolve(true);
};
const timer = setTimeout(() => {
this._drainWaiters = this._drainWaiters.filter((pending) => pending !== waiter);
resolve(false);
}, timeoutMs);
this._drainWaiters.push(waiter);
});
}
async close() {
if (this._closed) return;
this._closed = true;
this._pendingRequests.clear();
this._releaseDrainWaiters();
try {
this._onInstanceClose();
} finally {
this.onclose?.();
}
}
_settle(id) {
this._pendingRequests.delete(id);
if (this._pendingRequests.size === 0) this._releaseDrainWaiters();
}
_releaseDrainWaiters() {
const waiters = this._drainWaiters;
this._drainWaiters = [];
for (const waiter of waiters) waiter();
}
};
/**
* Classifies one message of the opening exchange with the same body-primary
* rules the HTTP entry applies per request: `initialize` is the legacy
* handshake unless it carries a valid modern envelope claim; a present claim
* is validated (never silently ignored); a claim-less message is 2025-era
* traffic. There is no header layer on stdio, so the body is the only signal.
*/
function classifyOpeningMessage(message) {
const params = message.params;
if (message.method === "initialize" && !carriesValidModernEnvelopeClaim(params)) {
const requestedVersion = params !== null && typeof params === "object" && typeof params.protocolVersion === "string" ? params.protocolVersion : void 0;
return {
kind: "legacy",
reason: "initialize",
...requestedVersion !== void 0 && { requestedVersion }
};
}
if (!hasEnvelopeClaim(params)) return {
kind: "legacy",
reason: "no-claim"
};
const meta = requestMetaOf(params);
const firstIssue = (meta === void 0 ? [] : validateEnvelopeMeta(meta))[0];
if (firstIssue !== void 0) return {
kind: "invalid-envelope",
issue: firstIssue
};
const claimedVersion = envelopeClaimVersion(params);
if (claimedVersion === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedVersion)) return {
kind: "unsupported-revision",
requested: claimedVersion ?? "unknown"
};
return {
kind: "modern",
revision: claimedVersion,
classification: {
era: "modern",
revision: claimedVersion
}
};
}
/**
* Serves MCP over stdio from a server factory, owning the era decision for
* the connection: the opening exchange selects the era, ONE instance from the
* factory is pinned for the connection lifetime, and everything after passes
* straight through to it. See the module documentation for the opening rules.
*
* ```ts
* import { serveStdio } from '@modelcontextprotocol/server/stdio';
*
* serveStdio(() => {
* const server = new McpServer({ name: 'my-server', version: '1.0.0' }, { capabilities: { tools: {} } });
* // register tools/resources/prompts once — the same factory serves both eras
* return server;
* });
* ```
*/
function serveStdio(factory, options = {}) {
const legacyMode = options.legacy ?? "serve";
const wire = options.transport ?? new StdioServerTransport();
let state = { phase: "opening" };
/** Channel currently being discarded (its close must not tear the connection down). */
let discarding;
let closing = false;
/**
* Whether the connection has been torn down (`handle.close()` or the wire
* closing). The opening arms re-check this after every await: a close can
* race factory construction, and the continuation must neither resurrect
* the connection state nor keep a late-resolved instance around.
*/
const isTornDown = () => closing || state.phase === "closed";
const reportError = (error) => {
try {
options.onerror?.(error);
} catch {}
};
const writeErrorResponse = (id, code, message, data) => wire.send({
jsonrpc: "2.0",
id,
error: {
code,
message,
...data !== void 0 && { data }
}
}).catch((error) => reportError(toError(error)));
/**
* Entry-handled `subscriptions/listen` for this connection: holds the
* active subscriptions, serves inbound listen / cancelled-of-listen
* before the pinned instance is consulted, and rewrites the instance's
* outbound change notifications onto the active subscriptions. Only
* consulted on a modern-pinned connection — on a legacy connection
* change notifications pass straight through (the 2025 unsolicited
* delivery model is unchanged).
*/
const listenRouter = new StdioListenRouter(options.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS);
/** Outbound intercept installed on a modern instance's channel. */
const modernOutboundIntercept = (message) => {
if (!isJSONRPCNotification(message)) return void 0;
const routed = listenRouter.routeOutbound(message);
if (routed === "passthrough") return void 0;
for (const stamped of routed) wire.send({
jsonrpc: "2.0",
...stamped
}).catch((error) => reportError(toError(error)));
return "handled";
};
/**
* Entry-handled inbound listen routing for a modern-pinned connection.
* Returns `true` when the message was served at the entry and must NOT
* be delivered to the pinned instance.
*/
const tryServeListen = async (message) => {
if (isJSONRPCRequest(message) && message.method === "subscriptions/listen") {
const meta = requestMetaOf(message.params);
const issue = hasEnvelopeClaim(message.params) ? (meta === void 0 ? [] : validateEnvelopeMeta(meta))[0] : {
key: "_meta",
problem: "the per-request envelope is required on protocol revision 2026-07-28"
};
const claimedVersion = envelopeClaimVersion(message.params);
let reply;
if (issue !== void 0) reply = {
jsonrpc: "2.0",
id: message.id,
error: {
code: -32602,
message: `Invalid _meta envelope: ${issue.key}: ${issue.problem}`
}
};
else if (claimedVersion === void 0 || !SUPPORTED_MODERN_PROTOCOL_VERSIONS.includes(claimedVersion)) {
const error = new UnsupportedProtocolVersionError({
supported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],
requested: claimedVersion ?? "unknown"
});
reply = {
jsonrpc: "2.0",
id: message.id,
error: {
code: error.code,
message: error.message,
data: error.data
}
};
} else reply = listenRouter.serve(message);
await wire.send("error" in reply ? reply : {
jsonrpc: "2.0",
method: reply.method,
params: reply.params
}).catch((error) => reportError(toError(error)));
return true;
}
if (isJSONRPCNotification(message) && message.method === "notifications/cancelled") {
const cancelledId = message.params?.requestId;
if (cancelledId !== void 0 && listenRouter.cancel(cancelledId)) return true;
}
return false;
};
/** Answers a 2025-era request the entry will not serve (the modern-only rejection cells). */
const answerLegacyRejection = (request, reason, requestedVersion) => {
const rejection = modernOnlyStrictRejection({
kind: "legacy",
reason,
...requestedVersion !== void 0 && { requestedVersion }
}, SUPPORTED_MODERN_PROTOCOL_VERSIONS);
if (rejection === void 0) return Promise.resolve();
reportError(/* @__PURE__ */ new Error(`Rejected 2025-era request on a modern-only stdio connection (${rejection.cell}): ${rejection.message}`));
return writeErrorResponse(request.id, rejection.code, rejection.message, rejection.data);
};
const onInstanceClosed = (channel) => {
if (closing || channel === discarding) return;
closeAll();
};
const connectInstance = async (era, revision) => {
const product = await factory({ era });
const server = product instanceof McpServer ? product.server : product;
if (era === "modern") {
setNegotiatedProtocolVersion(server, revision);
installModernOnlyHandlers(server, SUPPORTED_MODERN_PROTOCOL_VERSIONS);
listenRouter.setServerCapabilities(server.getCapabilities(), serverIdentityOf(server));
}
const channel = new StdioConnectionChannel(wire, () => onInstanceClosed(channel), era === "modern" ? modernOutboundIntercept : void 0);
await product.connect(channel);
return {
product,
channel
};
};
/** Closes an instance whose factory resolved only after the connection was torn down. */
const disposeLateInstance = (instance) => instance.product.close().catch((error) => reportError(toError(error)));
const discardProbeInstance = async (instance) => {
discarding = instance.channel;
try {
if (!await instance.channel.whenRequestsAnswered(DISCARD_ANSWER_TIMEOUT_MS)) reportError(/* @__PURE__ */ new Error(`Discarded the probe instance with requests still unanswered after ${DISCARD_ANSWER_TIMEOUT_MS}ms; continuing with the fallback`));
await instance.product.close();
} catch (error) {
reportError(toError(error));
} finally {
discarding = void 0;
}
};
const processMessage = async (message) => {
if (state.phase === "closed") return;
if (state.phase === "pinned") {
if (state.era === "modern" && isJSONRPCRequest(message) && message.method === "initialize" && !carriesValidModernEnvelopeClaim(message.params)) {
await answerLegacyRejection(message, "initialize", message.params !== null && typeof message.params === "object" && typeof message.params.protocolVersion === "string" ? message.params.protocolVersion : void 0);
return;
}
if (state.era === "modern" && await tryServeListen(message)) return;
if (isTornDown()) return;
state.instance.channel.deliver(message);
return;
}
if (!isJSONRPCRequest(message) && !isJSONRPCNotification(message)) {
reportError(/* @__PURE__ */ new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));
return;
}
const opening = classifyOpeningMessage(message);
switch (opening.kind) {
case "invalid-envelope": {
const detail = `Invalid _meta envelope for protocol revision 2026-07-28: ${opening.issue.key}: ${opening.issue.problem}`;
if (isJSONRPCRequest(message)) await writeErrorResponse(message.id, ProtocolErrorCode.InvalidParams, detail, { envelope: opening.issue });
else reportError(/* @__PURE__ */ new Error(`Discarded a notification with a malformed envelope: ${detail}`));
return;
}
case "unsupported-revision":
if (isJSONRPCRequest(message)) {
const error = new UnsupportedProtocolVersionError({
supported: [...SUPPORTED_MODERN_PROTOCOL_VERSIONS],
requested: opening.requested
});
reportError(error);
await writeErrorResponse(message.id, error.code, error.message, error.data);
} else reportError(/* @__PURE__ */ new Error(`Discarded a notification claiming unsupported protocol revision ${opening.requested}`));
return;
case "modern":
if (isJSONRPCRequest(message) && message.method === "server/discover") {
if (state.phase === "probe") {
state.instance.channel.deliver(message, { classification: opening.classification });
return;
}
const instance = await connectInstance("modern", opening.revision);
if (isTornDown()) {
await disposeLateInstance(instance);
return;
}
state = {
phase: "probe",
instance
};
instance.channel.deliver(message, { classification: opening.classification });
return;
}
if (state.phase === "probe") {
if (isJSONRPCNotification(message)) {
state.instance.channel.deliver(message, { classification: opening.classification });
return;
}
state = {
phase: "pinned",
era: "modern",
instance: state.instance
};
} else {
const instance = await connectInstance("modern", opening.revision);
if (isTornDown()) {
await disposeLateInstance(instance);
return;
}
state = {
phase: "pinned",
era: "modern",
instance
};
}
if (await tryServeListen(message)) return;
if (isTornDown()) return;
state.instance.channel.deliver(message, { classification: opening.classification });
return;
case "legacy": {
if (legacyMode === "reject") {
if (isJSONRPCRequest(message)) await answerLegacyRejection(message, opening.reason, opening.requestedVersion);
return;
}
if (state.phase === "probe") {
await discardProbeInstance(state.instance);
if (isTornDown()) return;
state = { phase: "opening" };
}
const instance = await connectInstance("legacy");
if (isTornDown()) {
await disposeLateInstance(instance);
return;
}
state = {
phase: "pinned",
era: "legacy",
instance
};
state.instance.channel.deliver(message);
return;
}
}
};
const queue = [];
let pumping = false;
const pump = async () => {
if (pumping) return;
pumping = true;
try {
while (queue.length > 0) {
const message = queue.shift();
try {
await processMessage(message);
} catch (error) {
if (isJSONRPCRequest(message)) await writeErrorResponse(message.id, ProtocolErrorCode.InternalError, "Internal server error");
reportError(toError(error));
}
}
} finally {
pumping = false;
}
};
const closeAll = async () => {
if (closing || state.phase === "closed") return;
closing = true;
const current = state;
state = { phase: "closed" };
for (const result of listenRouter.teardownAll()) await wire.send(result).catch((error) => reportError(toError(error)));
if (current.phase === "probe" || current.phase === "pinned") await current.instance.product.close().catch((error) => reportError(toError(error)));
await wire.close().catch((error) => reportError(toError(error)));
};
wire.onmessage = (message) => {
queue.push(message);
pump();
};
wire.onerror = (error) => {
reportError(error);
if (state.phase === "probe" || state.phase === "pinned") state.instance.channel.onerror?.(error);
};
wire.onclose = () => {
if (closing || state.phase === "closed") return;
closing = true;
const current = state;
state = { phase: "closed" };
if (current.phase === "probe" || current.phase === "pinned") current.instance.product.close().catch((error) => reportError(toError(error)));
};
const started = wire.start().catch((error) => {
reportError(toError(error));
throw error;
});
started.catch(() => {});
return { close: async () => {
await started.catch(() => {});
await closeAll();
} };
}
function toError(value) {
return value instanceof Error ? value : new Error(String(value));
}
//#endregion
export { StdioServerTransport, serveStdio };
//# sourceMappingURL=stdio.mjs.map
@@ -0,0 +1,362 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeModuleAndLoadMetadata;
exports.hasExports = hasExports;
exports.isSideEffectImport = isSideEffectImport;
exports.validateImportInteropOption = validateImportInteropOption;
var _path = require("path");
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
function hasExports(metadata) {
return metadata.hasExports;
}
function isSideEffectImport(source) {
return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;
}
function validateImportInteropOption(importInterop) {
if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") {
throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`);
}
return importInterop;
}
function resolveImportInterop(importInterop, source, filename) {
if (typeof importInterop === "function") {
return validateImportInteropOption(importInterop(source, filename));
}
return importInterop;
}
function normalizeModuleAndLoadMetadata(programPath, exportName, {
importInterop,
initializeReexports = false,
getWrapperPayload,
esNamespaceOnly = false,
filename
}) {
if (!exportName) {
exportName = programPath.scope.generateUidIdentifier("exports").name;
}
const stringSpecifiers = new Set();
nameAnonymousExports(programPath);
const {
local,
sources,
hasExports
} = getModuleMetadata(programPath, {
initializeReexports,
getWrapperPayload
}, stringSpecifiers);
removeImportExportDeclarations(programPath);
for (const [source, metadata] of sources) {
const {
importsNamespace,
imports
} = metadata;
if (importsNamespace.size > 0 && imports.size === 0) {
const [nameOfnamespace] = importsNamespace;
metadata.name = nameOfnamespace;
}
const resolvedInterop = resolveImportInterop(importInterop, source, filename);
if (resolvedInterop === "none") {
metadata.interop = "none";
} else if (resolvedInterop === "node" && metadata.interop === "namespace") {
metadata.interop = "node-namespace";
} else if (resolvedInterop === "node" && metadata.interop === "default") {
metadata.interop = "node-default";
} else if (esNamespaceOnly && metadata.interop === "namespace") {
metadata.interop = "default";
}
}
return {
exportName,
exportNameListName: null,
hasExports,
local,
source: sources,
stringSpecifiers
};
}
function getExportSpecifierName(path, stringSpecifiers) {
if (path.isIdentifier()) {
return path.node.name;
} else if (path.isStringLiteral()) {
const stringValue = path.node.value;
if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) {
stringSpecifiers.add(stringValue);
}
return stringValue;
} else {
throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`);
}
}
function assertExportSpecifier(path) {
if (path.isExportSpecifier()) {
return;
} else if (path.isExportNamespaceSpecifier()) {
throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.");
} else {
throw path.buildCodeFrameError("Unexpected export specifier type");
}
}
function getModuleMetadata(programPath, {
getWrapperPayload,
initializeReexports
}, stringSpecifiers) {
const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers);
const importNodes = new Map();
const sourceData = new Map();
const getData = (sourceNode, node) => {
const source = sourceNode.value;
let data = sourceData.get(source);
if (!data) {
data = {
name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name,
interop: "none",
loc: null,
imports: new Map(),
importsNamespace: new Set(),
reexports: new Map(),
reexportNamespace: new Set(),
reexportAll: null,
wrap: null,
get lazy() {
return this.wrap === "lazy";
},
referenced: false
};
sourceData.set(source, data);
importNodes.set(source, [node]);
} else {
importNodes.get(source).push(node);
}
return data;
};
let hasExports = false;
programPath.get("body").forEach(child => {
if (child.isImportDeclaration()) {
const data = getData(child.node.source, child.node);
if (!data.loc) data.loc = child.node.loc;
child.get("specifiers").forEach(spec => {
if (spec.isImportDefaultSpecifier()) {
const localName = spec.get("local").node.name;
data.imports.set(localName, "default");
const reexport = localData.get(localName);
if (reexport) {
localData.delete(localName);
reexport.names.forEach(name => {
data.reexports.set(name, "default");
});
data.referenced = true;
}
} else if (spec.isImportNamespaceSpecifier()) {
const localName = spec.get("local").node.name;
data.importsNamespace.add(localName);
const reexport = localData.get(localName);
if (reexport) {
localData.delete(localName);
reexport.names.forEach(name => {
data.reexportNamespace.add(name);
});
data.referenced = true;
}
} else if (spec.isImportSpecifier()) {
const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers);
const localName = spec.get("local").node.name;
data.imports.set(localName, importName);
const reexport = localData.get(localName);
if (reexport) {
localData.delete(localName);
reexport.names.forEach(name => {
data.reexports.set(name, importName);
});
data.referenced = true;
}
}
});
} else if (child.isExportAllDeclaration()) {
hasExports = true;
const data = getData(child.node.source, child.node);
if (!data.loc) data.loc = child.node.loc;
data.reexportAll = {
loc: child.node.loc
};
data.referenced = true;
} else if (child.isExportNamedDeclaration() && child.node.source) {
hasExports = true;
const data = getData(child.node.source, child.node);
if (!data.loc) data.loc = child.node.loc;
child.get("specifiers").forEach(spec => {
assertExportSpecifier(spec);
const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers);
const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers);
data.reexports.set(exportName, importName);
data.referenced = true;
if (exportName === "__esModule") {
throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".');
}
});
} else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {
hasExports = true;
}
});
for (const metadata of sourceData.values()) {
let needsDefault = false;
let needsNamed = false;
if (metadata.importsNamespace.size > 0) {
needsDefault = true;
needsNamed = true;
}
if (metadata.reexportAll) {
needsNamed = true;
}
for (const importName of metadata.imports.values()) {
if (importName === "default") needsDefault = true;else needsNamed = true;
}
for (const importName of metadata.reexports.values()) {
if (importName === "default") needsDefault = true;else needsNamed = true;
}
if (needsDefault && needsNamed) {
metadata.interop = "namespace";
} else if (needsDefault) {
metadata.interop = "default";
}
}
if (getWrapperPayload) {
for (const [source, metadata] of sourceData) {
metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source));
}
}
return {
hasExports,
local: localData,
sources: sourceData
};
}
function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) {
const bindingKindLookup = new Map();
const programScope = programPath.scope;
const programChildren = programPath.get("body");
programChildren.forEach(child => {
let kind;
if (child.isImportDeclaration()) {
kind = "import";
} else {
if (child.isExportDefaultDeclaration()) {
child = child.get("declaration");
}
if (child.isExportNamedDeclaration()) {
if (child.node.declaration) {
child = child.get("declaration");
} else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) {
child.get("specifiers").forEach(spec => {
assertExportSpecifier(spec);
bindingKindLookup.set(spec.get("local").node.name, "block");
});
return;
}
}
if (child.isFunctionDeclaration()) {
kind = "hoisted";
} else if (child.isClassDeclaration()) {
kind = "block";
} else if (child.isVariableDeclaration({
kind: "var"
})) {
kind = "var";
} else if (child.isVariableDeclaration()) {
kind = "block";
} else {
return;
}
}
Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {
bindingKindLookup.set(name, kind);
});
});
const localMetadata = new Map();
const getLocalMetadata = idPath => {
const localName = idPath.node.name;
let metadata = localMetadata.get(localName);
if (!metadata) {
var _bindingKindLookup$ge, _programScope$getBind;
const kind = (_bindingKindLookup$ge = bindingKindLookup.get(localName)) != null ? _bindingKindLookup$ge : (_programScope$getBind = programScope.getBinding(localName)) == null ? void 0 : _programScope$getBind.kind;
if (kind === undefined) {
throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);
}
metadata = {
names: [],
kind
};
localMetadata.set(localName, metadata);
}
return metadata;
};
programChildren.forEach(child => {
if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) {
if (child.node.declaration) {
const declaration = child.get("declaration");
const ids = declaration.getOuterBindingIdentifierPaths();
Object.keys(ids).forEach(name => {
if (name === "__esModule") {
throw declaration.buildCodeFrameError('Illegal export "__esModule".');
}
getLocalMetadata(ids[name]).names.push(name);
});
} else {
child.get("specifiers").forEach(spec => {
const local = spec.get("local");
const exported = spec.get("exported");
const localMetadata = getLocalMetadata(local);
const exportName = getExportSpecifierName(exported, stringSpecifiers);
if (exportName === "__esModule") {
throw exported.buildCodeFrameError('Illegal export "__esModule".');
}
localMetadata.names.push(exportName);
});
}
} else if (child.isExportDefaultDeclaration()) {
const declaration = child.get("declaration");
if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
getLocalMetadata(declaration.get("id")).names.push("default");
} else {
throw declaration.buildCodeFrameError("Unexpected default expression export.");
}
}
});
return localMetadata;
}
function nameAnonymousExports(programPath) {
programPath.get("body").forEach(child => {
var _child$splitExportDec;
if (!child.isExportDefaultDeclaration()) return;
(_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
child.splitExportDeclaration();
});
}
function removeImportExportDeclarations(programPath) {
programPath.get("body").forEach(child => {
if (child.isImportDeclaration()) {
child.remove();
} else if (child.isExportNamedDeclaration()) {
if (child.node.declaration) {
child.node.declaration._blockHoist = child.node._blockHoist;
child.replaceWith(child.node.declaration);
} else {
child.remove();
}
} else if (child.isExportDefaultDeclaration()) {
const declaration = child.get("declaration");
if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
declaration._blockHoist = child.node._blockHoist;
child.replaceWith(declaration);
} else {
throw declaration.buildCodeFrameError("Unexpected default expression export.");
}
} else if (child.isExportAllDeclaration()) {
child.remove();
}
});
}
//# sourceMappingURL=normalize-and-load-metadata.js.map
@@ -0,0 +1 @@
{"version":3,"file":"simpleTaskInteractiveClient.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleTaskInteractiveClient.ts"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,21 @@
function resolveElements(elementOrSelector, scope, selectorCache) {
if (elementOrSelector == null) {
return [];
}
if (elementOrSelector instanceof EventTarget) {
return [elementOrSelector];
}
else if (typeof elementOrSelector === "string") {
let root = document;
if (scope) {
root = scope.current;
}
const elements = selectorCache?.[elementOrSelector] ??
root.querySelectorAll(elementOrSelector);
return elements ? Array.from(elements) : [];
}
return Array.from(elementOrSelector).filter((element) => element != null);
}
export { resolveElements };
//# sourceMappingURL=resolve-elements.mjs.map
@@ -0,0 +1,35 @@
{
"name": "ipaddr.js",
"description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.",
"version": "1.9.1",
"author": "whitequark <whitequark@whitequark.org>",
"directories": {
"lib": "./lib"
},
"dependencies": {},
"devDependencies": {
"coffee-script": "~1.12.6",
"nodeunit": "^0.11.3",
"uglify-js": "~3.0.19"
},
"scripts": {
"test": "cake build test"
},
"files": [
"lib/",
"LICENSE",
"ipaddr.min.js"
],
"keywords": [
"ip",
"ipv4",
"ipv6"
],
"repository": "git://github.com/whitequark/ipaddr.js",
"main": "./lib/ipaddr.js",
"engines": {
"node": ">= 0.10"
},
"license": "MIT",
"types": "./lib/ipaddr.js.d.ts"
}
@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RuleCreator = RuleCreator;
const applyDefault_1 = require("./applyDefault");
/**
* Creates reusable function to create rules with default options and docs URLs.
*
* @param urlCreator Creates a documentation URL for a given rule name.
* @returns Function to create a rule with the docs URL format.
*/
function RuleCreator(urlCreator) {
// This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349
// TODO - when the above PR lands; add type checking for the context.report `data` property
return function createNamedRule({ meta, name, ...rule }) {
const ruleWithDocs = createRule({
meta: {
...meta,
docs: {
...meta.docs,
url: urlCreator(name),
},
},
name,
...rule,
});
return ruleWithDocs;
};
}
function createRule({ create,
// Keep accepting deprecated defaultOptions for backward compatibility.
// eslint-disable-next-line @typescript-eslint/no-deprecated
defaultOptions, meta, name, }) {
const resolvedDefaultOptions = (meta.defaultOptions ??
defaultOptions ??
[]);
return {
create(context) {
const optionsWithDefault = (0, applyDefault_1.applyDefault)(resolvedDefaultOptions, context.options);
return create(context, optionsWithDefault);
},
defaultOptions,
meta,
name,
};
}
/**
* Creates a well-typed TSESLint custom ESLint rule without a docs URL.
*
* @returns Well-typed TSESLint custom ESLint rule.
* @remarks It is generally better to provide a docs URL function to RuleCreator.
*/
RuleCreator.withoutDocs = function withoutDocs(args) {
return createRule(args);
};
@@ -0,0 +1 @@
module.exports={C:{"52":0.01869,"59":0.00467,"78":0.01869,"113":0.00467,"115":0.28038,"119":0.00467,"120":0.02804,"121":0.05608,"123":0.00467,"124":0.00935,"125":0.00467,"128":0.00467,"130":0.00467,"132":0.00467,"133":0.00467,"134":0.00935,"135":0.00467,"136":0.00935,"139":0.00467,"140":0.09813,"142":0.00467,"143":0.02337,"144":0.00467,"145":0.00467,"146":0.00935,"147":0.00467,"148":0.00467,"149":0.00935,"150":0.01869,"151":0.01869,"152":0.04673,"153":0.06075,"154":0.35515,"155":1.24769,"156":1.36452,"157":0.04673,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 122 126 127 129 131 137 138 141 158 159 160 3.5 3.6"},D:{"49":0.00935,"70":0.01402,"79":0.00467,"86":0.02337,"87":0.01402,"88":0.00467,"91":0.00467,"95":0.00467,"100":0.00467,"101":0.00467,"102":0.00935,"103":0.07477,"104":0.03271,"105":0.03738,"106":0.03738,"107":0.03738,"108":0.04206,"109":0.79908,"110":0.03738,"111":0.05608,"112":0.03738,"113":0.00467,"114":0.01402,"115":0.00467,"116":0.16356,"117":0.03738,"118":0.13552,"119":0.07944,"120":0.10281,"121":0.02337,"122":0.04673,"123":0.01402,"124":0.04673,"125":0.00467,"126":0.01869,"127":0.01869,"128":0.08879,"129":0.00467,"130":0.01402,"131":0.09813,"132":0.01402,"133":0.14019,"134":0.08411,"135":0.08411,"136":0.11215,"137":0.08411,"138":0.23832,"139":0.09346,"140":0.12617,"141":0.1215,"142":0.33646,"143":0.06075,"144":0.06075,"145":0.12617,"146":0.09346,"147":0.10748,"148":0.18692,"149":0.24767,"150":0.59347,"151":1.85985,"152":10.65444,"153":11.10772,"154":2.42529,"155":0.03271,"156":0.00467,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 78 80 81 83 84 85 89 90 92 93 94 96 97 98 99 157"},F:{"46":0.00935,"90":0.00467,"95":0.01402,"100":0.00467,"101":0.02804,"102":0.00467,"105":0.00467,"106":0.00467,"107":0.00467,"114":0.00467,"122":0.00467,"133":0.00935,"134":0.08411,"135":0.71497,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 96 97 98 99 103 104 108 109 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00467,"109":0.04206,"114":0.00467,"119":0.02804,"120":0.02804,"122":0.03271,"123":0.00467,"124":0.00467,"129":0.00467,"131":0.00467,"132":0.00467,"133":0.00467,"134":0.00467,"135":0.00467,"136":0.00467,"137":0.00935,"138":0.00467,"139":0.00467,"140":0.00935,"141":0.00467,"142":0.00467,"143":0.00935,"144":0.00935,"145":0.00935,"146":0.00467,"147":0.00935,"148":0.02337,"149":0.01402,"150":0.1215,"151":0.16823,"152":1.63088,"153":2.14958,"154":0.59347,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 125 126 127 128 130"},E:{"14":0.00935,"27":0.27103,_:"4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 15.2-15.3 27.1 TP","11.1":0.00467,"12.1":0.00467,"13.1":0.03271,"14.1":0.02337,"15.1":0.00467,"15.4":0.00467,"15.5":0.00467,"15.6":0.11683,"16.0":0.00935,"16.1":0.00935,"16.2":0.00467,"16.3":0.01869,"16.4":0.01402,"16.5":0.00467,"16.6":0.11683,"17.0":0.00467,"17.1":0.08411,"17.2":0.00935,"17.3":0.01402,"17.4":0.01869,"17.5":0.02804,"17.6":0.15421,"18.0":0.01402,"18.1":0.01869,"18.2":0.00935,"18.3":0.02337,"18.4":0.02804,"18.5-18.7":0.04673,"26.0":0.03738,"26.1":0.01869,"26.2":0.0701,"26.3":0.08411,"26.4":0.07944,"26.5":0.42057,"26.6":1.28508,"27.2":0.00467},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00143,"5.0-5.1":0.00143,"6.0-6.1":0,"7.0-7.1":0.00286,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01429,"11.0-11.2":0.00143,"11.3-11.4":0.00286,"12.0-12.1":0,"12.2-12.5":0.03716,"13.0-13.1":0,"13.2":0.00715,"13.3":0,"13.4-13.7":0.00143,"14.0-14.4":0.00572,"14.5-14.8":0.00858,"15.0-15.1":0.00858,"15.2-15.3":0.00572,"15.4":0.00715,"15.5":0.00858,"15.6-15.8":0.1858,"16.0":0.01429,"16.1":0.02573,"16.2":0.01429,"16.3":0.03144,"16.4":0.00715,"16.5":0.01143,"16.6-16.7":0.25869,"17.0":0.01,"17.1":0.01429,"17.2":0.01429,"17.3":0.02144,"17.4":0.03001,"17.5":0.0586,"17.6-17.7":0.1515,"18.0":0.03144,"18.1":0.06289,"18.2":0.08575,"18.3":0.14864,"18.4":0.0929,"18.5-18.7":1.91946,"26.0":0.0929,"26.1":0.09433,"26.2":0.24583,"26.3":0.26584,"26.4":0.19438,"26.5":1.30203,"26.6":8.03372,"27.0":0.616,"27.1":0,"27.2":0.01572},P:{"4":0.00935,"21":0.00935,"22":0.00935,"23":0.00935,"24":0.08417,"25":0.00935,"26":0.03741,"27":0.0187,"28":0.06547,"29":0.12158,"30":2.08556,_:"20 6.2-6.4 7.2-7.Line truncated
@@ -0,0 +1,51 @@
'use strict'
const { InvalidArgumentError } = require('../core/errors')
const Client = require('./client')
class H2CClient extends Client {
constructor (origin, clientOpts) {
if (typeof origin === 'string') {
origin = new URL(origin)
}
if (origin.protocol !== 'http:') {
throw new InvalidArgumentError(
'h2c-client: Only h2c protocol is supported'
)
}
const { maxConcurrentStreams, pipelining, ...opts } =
clientOpts ?? {}
const defaultMaxConcurrentStreams = maxConcurrentStreams ?? 100
let defaultPipelining = 100
if (
maxConcurrentStreams != null &&
(!Number.isInteger(maxConcurrentStreams) ||
maxConcurrentStreams < 1)
) {
throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0')
}
if (pipelining != null && Number.isInteger(pipelining) && pipelining > 0) {
defaultPipelining = pipelining
}
if (defaultPipelining > defaultMaxConcurrentStreams) {
throw new InvalidArgumentError(
'h2c-client: pipelining cannot be greater than maxConcurrentStreams'
)
}
super(origin, {
...opts,
maxConcurrentStreams: defaultMaxConcurrentStreams,
pipelining: defaultPipelining,
allowH2: true,
useH2c: true
})
}
}
module.exports = H2CClient
@@ -0,0 +1,21 @@
import SourceMap from './source-map.mts';
import type { SourceMapInput, SourceMapLoader, Options } from './types.mts';
export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.mts';
export type { SourceMap };
/**
* Traces through all the mappings in the root sourcemap, through the sources
* (and their sourcemaps), all the way back to the original source location.
*
* `loader` will be called every time we encounter a source file. If it returns
* a sourcemap, we will recurse into that sourcemap to continue the trace. If
* it returns a falsey value, that source file is treated as an original,
* unmodified source file.
*
* Pass `excludeContent` to exclude any self-containing source file content
* from the output sourcemap.
*
* Pass `decodedMappings` to receive a SourceMap with decoded (instead of
* VLQ encoded) mappings.
*/
export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap;
//# sourceMappingURL=remapping.d.ts.map
@@ -0,0 +1,72 @@
import { f as createRule, g as import_ast_utils } from "../utils.js";
var function_call_argument_newline_default = createRule({
name: "function-call-argument-newline",
meta: {
type: "layout",
docs: { description: "Enforce line breaks between arguments of a function call" },
fixable: "whitespace",
schema: [{
type: "string",
enum: [
"always",
"never",
"consistent"
]
}],
defaultOptions: ["always"],
messages: {
unexpectedLineBreak: "There should be no line break here.",
missingLineBreak: "There should be a line break after this argument."
}
},
create(context, [option]) {
const sourceCode = context.sourceCode;
const checkers = {
unexpected: {
messageId: "unexpectedLineBreak",
check: (prevToken, currentToken) => !(0, import_ast_utils.isTokenOnSameLine)(prevToken, currentToken),
createFix: (token, tokenBefore) => (fixer) => fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " ")
},
missing: {
messageId: "missingLineBreak",
check: (prevToken, currentToken) => (0, import_ast_utils.isTokenOnSameLine)(prevToken, currentToken),
createFix: (token, tokenBefore) => (fixer) => fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n")
}
};
function checkArguments(argumentNodes, checker) {
for (let i = 1; i < argumentNodes.length; i++) {
const argumentNode = argumentNodes[i - 1];
const prevArgToken = sourceCode.getLastToken(argumentNode);
const currentArgToken = sourceCode.getFirstToken(argumentNodes[i]);
if (checker.check(prevArgToken, currentArgToken)) {
const tokenBefore = sourceCode.getTokenBefore(currentArgToken, { includeComments: true });
const hasLineCommentBefore = tokenBefore.type === "Line";
context.report({
node: argumentNodes[i - 1],
loc: {
start: tokenBefore.loc.end,
end: currentArgToken.loc.start
},
messageId: checker.messageId,
fix: hasLineCommentBefore ? null : checker.createFix(currentArgToken, tokenBefore)
});
}
}
}
function check(argumentNodes) {
if (argumentNodes.length < 2) return;
if (option === "never") checkArguments(argumentNodes, checkers.unexpected);
else if (option === "always") checkArguments(argumentNodes, checkers.missing);
else if (option === "consistent") if ((0, import_ast_utils.isTokenOnSameLine)(sourceCode.getLastToken(argumentNodes[0]), sourceCode.getFirstToken(argumentNodes[1]))) checkArguments(argumentNodes, checkers.unexpected);
else checkArguments(argumentNodes, checkers.missing);
}
return {
CallExpression: (node) => check(node.arguments),
NewExpression: (node) => check(node.arguments),
ImportExpression: (node) => {
if (node.options) check([node.source, node.options]);
}
};
}
});
export { function_call_argument_newline_default as t };
@@ -0,0 +1,513 @@
# body-parser
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
Node.js body parsing middleware.
Parse incoming request bodies in a middleware before your handlers, available
under the `req.body` property.
**Note** As `req.body`'s shape is based on user-controlled input, all
properties and values in this object are untrusted and should be validated
before trusting. For example, `req.body.foo.toString()` may fail in multiple
ways, for example the `foo` property may not be there or may not be a string,
and `toString` may not be a function and instead a string or other user input.
[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/learn/http/anatomy-of-an-http-transaction).
_This does not handle multipart bodies_, due to their complex and typically
large nature. For multipart bodies, you may be interested in the following
modules:
* [busboy](https://www.npmjs.com/package/busboy#readme) and
[connect-busboy](https://www.npmjs.com/package/connect-busboy#readme)
* [multiparty](https://www.npmjs.com/package/multiparty#readme) and
[connect-multiparty](https://www.npmjs.com/package/connect-multiparty#readme)
* [formidable](https://www.npmjs.com/package/formidable#readme)
* [multer](https://www.npmjs.com/package/multer#readme)
This module provides the following parsers:
* [JSON body parser](#bodyparserjsonoptions)
* [Raw body parser](#bodyparserrawoptions)
* [Text body parser](#bodyparsertextoptions)
* [URL-encoded form body parser](#bodyparserurlencodedoptions)
All parsers support automatic inflation of `gzip`, `br` (brotli), `deflate`
and `zstd` encodings. `zstd` is available in Node.js `^22.15.0` and
`>=23.8.0`.
Other body parsers you might be interested in:
- [body](https://www.npmjs.com/package/body#readme)
- [co-body](https://www.npmjs.com/package/co-body#readme)
## Installation
```sh
$ npm install body-parser
```
## API
```js
// Import all parsers
const bodyParser = require('body-parser')
// Or import individual parsers directly
const json = require('body-parser/json')
const urlencoded = require('body-parser/urlencoded')
const raw = require('body-parser/raw')
const text = require('body-parser/text')
```
The `bodyParser` object exposes various factories to create middlewares. All
middlewares will populate the `req.body` property with the parsed body when
the `Content-Type` request header matches the `type` option.
**Note** As of v2, `req.body` is left `undefined` when no body is parsed (for
example when the request has neither `Content-Length` nor `Transfer-Encoding`,
or when `Content-Type` does not match). In v1, `req.body` was always initialized
to `{}`. Code that assumes `req.body` is always an object should use optional
chaining (for example `req.body?.username`) or set a default.
The various errors returned by this module are described in the
[errors section](#errors).
### bodyParser.json([options])
Returns middleware that only parses `json` and only looks at requests where
the `Content-Type` header matches the `type` option. This parser accepts any
Unicode encoding of the body.
A new `body` object containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`).
#### Options
The `json` function takes an optional `options` object that may contain any of
the following keys:
##### defaultCharset
Specify the default character set for the json content if the charset is not
specified in the `Content-Type` header of the request. Defaults to `utf-8`.
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur.
##### reviver
The `reviver` option is passed directly to `JSON.parse` as the second
argument. You can find more information on this argument
[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#the_reviver_parameter).
##### strict
When set to `true`, it will only accept arrays and objects; when `false`, it will
accept anything `JSON.parse` accepts. Defaults to `true`.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function. If not a
function, `type` option is passed directly to the
[type-is](https://www.npmjs.com/package/type-is#readme) library and this can
be an extension name (like `json`), a mime type (like `application/json`), or
a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`
option is called as `fn(req)` and the request is parsed if it returns a truthy
value. Defaults to `application/json`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
### bodyParser.raw([options])
Returns middleware that parses all bodies as a `Buffer` and only looks at
requests where the `Content-Type` header matches the `type` option.
A new `body` object containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`). This will be a `Buffer` object
of the body.
#### Options
The `raw` function takes an optional `options` object that may contain any of
the following keys:
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function.
If not a function, `type` option is passed directly to the
[type-is](https://www.npmjs.com/package/type-is#readme) library and this
can be an extension name (like `bin`), a mime type (like
`application/octet-stream`), or a mime type with a wildcard (like `*/*` or
`application/*`). If a function, the `type` option is called as `fn(req)`
and the request is parsed if it returns a truthy value. Defaults to
`application/octet-stream`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
### bodyParser.text([options])
Returns middleware that parses all bodies as a string and only looks at
requests where the `Content-Type` header matches the `type` option.
A new `body` string containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`). This will be a string of the
body.
#### Options
The `text` function takes an optional `options` object that may contain any of
the following keys:
##### defaultCharset
Specify the default character set for the text content if the charset is not
specified in the `Content-Type` header of the request. Defaults to `utf-8`.
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function. If not
a function, `type` option is passed directly to the
[type-is](https://www.npmjs.com/package/type-is#readme) library and this can
be an extension name (like `txt`), a mime type (like `text/plain`), or a mime
type with a wildcard (like `*/*` or `text/*`). If a function, the `type`
option is called as `fn(req)` and the request is parsed if it returns a
truthy value. Defaults to `text/plain`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
### bodyParser.urlencoded([options])
Returns middleware that only parses `urlencoded` bodies and only looks at
requests where the `Content-Type` header matches the `type` option. This
parser accepts only UTF-8 and ISO-8859-1 encodings of the body.
A new `body` object containing the parsed data is populated on the `request`
object after the middleware (i.e. `req.body`). This object will contain
key-value pairs, where the value can be a string or array (when `extended` is
`false`), or any type (when `extended` is `true`).
#### Options
The `urlencoded` function takes an optional `options` object that may contain
any of the following keys:
##### extended
The "extended" syntax allows for rich objects and arrays to be encoded into the
URL-encoded format, allowing for a JSON-like experience with URL-encoded. For
more information, please [see the qs
library](https://www.npmjs.com/package/qs#readme).
Defaults to `false`.
##### inflate
When set to `true`, then deflated (compressed) bodies will be inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number, then the value
specifies the number of bytes; if it is a string, the value is passed to the
[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults
to `'100kb'`.
> It’s recommended not to configure a very high limit and to use the default value whenever possible. Allowing larger payloads increases memory usage because of the resources required for decoding and transformations, and it can also lead to longer response times as more data is processed. By ‘very high’, we mean values above the default, for example payloads of 5 MB or more can already start to introduce these risks. With the default limits, these issues do not occur.
##### parameterLimit
The `parameterLimit` option controls the maximum number of parameters that
are allowed in the URL-encoded data. If a request contains more parameters
than this value, a 413 will be returned to the client. Defaults to `1000`.
##### type
The `type` option is used to determine what media type the middleware will
parse. This option can be a string, array of strings, or a function. If not
a function, `type` option is passed directly to the
[type-is](https://www.npmjs.com/package/type-is#readme) library and this can
be an extension name (like `urlencoded`), a mime type (like
`application/x-www-form-urlencoded`), or a mime type with a wildcard (like
`*/x-www-form-urlencoded`). If a function, the `type` option is called as
`fn(req)` and the request is parsed if it returns a truthy value. Defaults
to `application/x-www-form-urlencoded`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding` is the
encoding of the request. The parsing can be aborted by throwing an error.
##### defaultCharset
The default charset to parse as, if not specified in content-type. Must be
either `utf-8` or `iso-8859-1`. Defaults to `utf-8`.
##### charsetSentinel
Whether to let the value of the `utf8` parameter take precedence as the charset
selector. It requires the form to contain a parameter named `utf8` with a value
of `✓`. Defaults to `false`.
##### interpretNumericEntities
Whether to decode numeric entities such as `&#9786;` when parsing an iso-8859-1
form. Defaults to `false`.
##### depth
The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible.
## Errors
The middlewares provided by this module create errors using the
[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
will typically have a `status`/`statusCode` property that contains the suggested
HTTP response code, an `expose` property to determine if the `message` property
should be displayed to the client, a `type` property to determine the type of
error without matching against the `message`, and a `body` property containing
the read body, if available.
The following are the common errors created, though any error can come through
for various reasons.
### content encoding unsupported
This error will occur when the request had a `Content-Encoding` header that
contained an encoding but the "inflation" option was set to `false`. The
`status` property is set to `415`, the `type` property is set to
`'encoding.unsupported'`, and the `charset` property will be set to the
encoding that is unsupported.
### entity parse failed
This error will occur when the request contained an entity that could not be
parsed by the middleware. The `status` property is set to `400`, the `type`
property is set to `'entity.parse.failed'`, and the `body` property is set to
the entity value that failed parsing.
### entity verify failed
This error will occur when the request contained an entity that could not be
verified by the defined `verify` option. The `status` property is
set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
`body` property is set to the entity value that failed verification.
### request aborted
This error will occur when the request is aborted by the client before reading
the body has finished. The `received` property will be set to the number of
bytes received before the request was aborted and the `expected` property is
set to the number of expected bytes. The `status` property is set to `400`
and `type` property is set to `'request.aborted'`.
### request entity too large
This error will occur when the request body's size is larger than the "limit"
option. The `limit` property will be set to the byte limit and the `length`
property will be set to the request body's length. The `status` property is
set to `413` and the `type` property is set to `'entity.too.large'`.
### request size did not match content length
This error will occur when the request's length did not match the length from
the `Content-Length` header. This typically occurs when the request is malformed,
typically when the `Content-Length` header was calculated based on characters
instead of bytes. The `status` property is set to `400` and the `type` property
is set to `'request.size.invalid'`.
### stream encoding should not be set
This error will occur when something called the `req.setEncoding` method prior
to this middleware. This module operates directly on bytes only and you cannot
call `req.setEncoding` when using this module. The `status` property is set to
`500` and the `type` property is set to `'stream.encoding.set'`.
### stream is not readable
This error will occur when the request is no longer readable when this middleware
attempts to read it. This typically means something other than a middleware from
this module read the request body already and the middleware was also configured to
read the same request. The `status` property is set to `500` and the `type`
property is set to `'stream.not.readable'`.
### too many parameters
This error will occur when the content of the request exceeds the configured
`parameterLimit` for the `urlencoded` parser. The `status` property is set to
`413` and the `type` property is set to `'parameters.too.many'`.
### unsupported charset "BOGUS"
This error will occur when the request had a charset parameter in the
`Content-Type` header, but the `iconv-lite` module does not support it OR the
parser does not support it. The charset is contained in the message as well
as in the `charset` property. The `status` property is set to `415`, the
`type` property is set to `'charset.unsupported'`, and the `charset` property
is set to the charset that is unsupported.
### unsupported content encoding "bogus"
This error will occur when the request had a `Content-Encoding` header that
contained an unsupported encoding. The encoding is contained in the message
as well as in the `encoding` property. The `status` property is set to `415`,
the `type` property is set to `'encoding.unsupported'`, and the `encoding`
property is set to the encoding that is unsupported.
### The input exceeded the depth
This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. With the default `depth` of `32`, an input with 33 or more levels of nesting gets this error.
## Examples
### Express/Connect top-level generic
This example demonstrates adding a generic JSON and URL-encoded parser as a
top-level middleware, which will parse the bodies of all incoming requests.
This is the simplest setup.
```js
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded())
// parse application/json
app.use(bodyParser.json())
app.use(function (req, res) {
res.setHeader('Content-Type', 'text/plain')
res.write('you posted:\n')
res.end(String(JSON.stringify(req.body, null, 2)))
})
```
### Express route-specific
This example demonstrates adding body parsers specifically to the routes that
need them. In general, this is the most recommended way to use body-parser with
Express.
```js
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// create application/json parser
const jsonParser = bodyParser.json()
// create application/x-www-form-urlencoded parser
const urlencodedParser = bodyParser.urlencoded()
// POST /login gets urlencoded bodies
app.post('/login', urlencodedParser, function (req, res) {
if (!req.body || !req.body.username) res.sendStatus(400)
res.send('welcome, ' + req.body.username)
})
// POST /api/users gets JSON bodies
app.post('/api/users', jsonParser, function (req, res) {
if (!req.body) res.sendStatus(400)
// create user in req.body
})
```
### Change accepted type for parsers
All the parsers accept a `type` option which allows you to change the
`Content-Type` that the middleware will parse.
```js
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// parse various different custom JSON types as JSON
app.use(bodyParser.json({ type: 'application/*+json' }))
// parse some custom thing into a Buffer
app.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))
// parse an HTML body into a string
app.use(bodyParser.text({ type: 'text/html' }))
```
## License
[MIT](LICENSE)
[ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/body-parser/ci.yml?branch=master&label=ci
[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/body-parser?branch=master
[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
[npm-downloads-image]: https://img.shields.io/npm/dm/body-parser
[npm-url]: https://npmjs.com/package/body-parser
[npm-version-image]: https://img.shields.io/npm/v/body-parser
[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge
[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser
@@ -0,0 +1 @@
{"version":3,"file":"shimsBrowser.d.mts","names":[],"sources":["../src/shimsBrowser.ts"],"sourcesContent":[],"mappings":";;;;cAmBa"}
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ArrowBigLeftDash = createLucideIcon("ArrowBigLeftDash", [
["path", { d: "M19 15V9", key: "1hci5f" }],
["path", { d: "M15 15h-3v4l-7-7 7-7v4h3v6z", key: "16tjna" }]
]);
export { ArrowBigLeftDash as default };
//# sourceMappingURL=arrow-big-left-dash.js.map
@@ -0,0 +1,47 @@
/**
* In-memory OAuth client provider for demonstration purposes
* In production, you should persist tokens securely
*/
export class InMemoryOAuthClientProvider {
constructor(_redirectUrl, _clientMetadata, onRedirect, clientMetadataUrl) {
this._redirectUrl = _redirectUrl;
this._clientMetadata = _clientMetadata;
this.clientMetadataUrl = clientMetadataUrl;
this._onRedirect =
onRedirect ||
(url => {
console.log(`Redirect to: ${url.toString()}`);
});
}
get redirectUrl() {
return this._redirectUrl;
}
get clientMetadata() {
return this._clientMetadata;
}
clientInformation() {
return this._clientInformation;
}
saveClientInformation(clientInformation) {
this._clientInformation = clientInformation;
}
tokens() {
return this._tokens;
}
saveTokens(tokens) {
this._tokens = tokens;
}
redirectToAuthorization(authorizationUrl) {
this._onRedirect(authorizationUrl);
}
saveCodeVerifier(codeVerifier) {
this._codeVerifier = codeVerifier;
}
codeVerifier() {
if (!this._codeVerifier) {
throw new Error('No code verifier saved');
}
return this._codeVerifier;
}
}
//# sourceMappingURL=simpleOAuthClientProvider.js.map
@@ -0,0 +1,15 @@
import { type Handler, type ParserOptions } from "./Parser.js";
import { Writable } from "node:stream";
/**
* WritableStream makes the `Parser` interface available as a NodeJS stream.
*
* @see Parser
*/
export declare class WritableStream extends Writable {
private readonly _parser;
private readonly _decoder;
constructor(cbs: Partial<Handler>, options?: ParserOptions);
_write(chunk: string | Buffer, encoding: string, callback: () => void): void;
_final(callback: () => void): void;
}
//# sourceMappingURL=WritableStream.d.ts.map
@@ -0,0 +1,157 @@
/**
* @fileoverview Rule to enforce the position of line comments
* @author Alberto Rodríguez
* @deprecated in ESLint v9.3.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "9.3.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "line-comment-position",
url: "https://eslint.style/rules/line-comment-position",
},
},
],
},
type: "layout",
docs: {
description: "Enforce position of line comments",
recommended: false,
url: "https://eslint.org/docs/latest/rules/line-comment-position",
},
schema: [
{
oneOf: [
{
enum: ["above", "beside"],
},
{
type: "object",
properties: {
position: {
enum: ["above", "beside"],
},
ignorePattern: {
type: "string",
},
applyDefaultPatterns: {
type: "boolean",
},
applyDefaultIgnorePatterns: {
type: "boolean",
},
},
additionalProperties: false,
},
],
},
],
messages: {
above: "Expected comment to be above code.",
beside: "Expected comment to be beside code.",
},
},
create(context) {
const options = context.options[0];
let above,
ignorePattern,
applyDefaultIgnorePatterns = true;
if (!options || typeof options === "string") {
above = !options || options === "above";
} else {
above = !options.position || options.position === "above";
ignorePattern = options.ignorePattern;
if (Object.hasOwn(options, "applyDefaultIgnorePatterns")) {
applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns;
} else {
applyDefaultIgnorePatterns =
options.applyDefaultPatterns !== false;
}
}
const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN;
const fallThroughRegExp = /^\s*falls?\s?through/u;
const customIgnoreRegExp = new RegExp(ignorePattern, "u");
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program() {
const comments = sourceCode.getAllComments();
comments
.filter(token => token.type === "Line")
.forEach(node => {
if (
applyDefaultIgnorePatterns &&
(defaultIgnoreRegExp.test(node.value) ||
fallThroughRegExp.test(node.value))
) {
return;
}
if (
ignorePattern &&
customIgnoreRegExp.test(node.value)
) {
return;
}
const previous = sourceCode.getTokenBefore(node, {
includeComments: true,
});
const isOnSameLine =
previous &&
previous.loc.end.line === node.loc.start.line;
if (above) {
if (isOnSameLine) {
context.report({
node,
messageId: "above",
});
}
} else {
if (!isOnSameLine) {
context.report({
node,
messageId: "beside",
});
}
}
});
},
};
},
};
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlignStartHorizontal = createLucideIcon("AlignStartHorizontal", [
["rect", { width: "6", height: "16", x: "4", y: "6", rx: "2", key: "1n4dg1" }],
["rect", { width: "6", height: "9", x: "14", y: "6", rx: "2", key: "17khns" }],
["path", { d: "M22 2H2", key: "fhrpnj" }]
]);
export { AlignStartHorizontal as default };
//# sourceMappingURL=align-start-horizontal.js.map
@@ -0,0 +1,411 @@
flf2a$ 4 4 20 1 2
serifcap by Bruce M. Binder
$$@
$$@
$$@
$$@@
_ @
/ \@
\_/@
(_)@@
_ _ @
(_(_)@
@
@@
@
@
@
@@
@
@
@
@@
_ _ @
(_)/ ) @
/ /_ @
(_/(_)@@
___ @
( __) @
/ _) )@
\___/ @@
_ @
/_)@
@
@@
_ @
/ )@
( ( @
\_)@@
_ @
( \ @
) )@
(_/ @@
@
@
@
@@
_ @
_( )_ @
(_ _)@
(_) @@
@
@
_ @
/_)@@
@
___ @
(___)@
@@
@
@
_ @
(_)@@
_ @
/ )@
/ / @
(_/ @@
__ @
/ \ @
( () )@
\__/ @@
__ @
( )@
)( @
(__)@@
___ @
(__ \@
/ __/@
\___)@@
___ @
(__ )@
(_ \@
(___/@@
__ @
/ ,) @
(_ _)@
(_) @@
___ @
/ __)@
\__ \@
(___/@@
_ @
/ ) @
/ , \@
\___/@@
___ @
(__ )@
/ / @
(_/ @@
___ @
( , )@
/ , \@
\___/@@
___ @
/ , \@
\ /@
(_/ @@
_ @
(_)@
_ @
(_)@@
_ @
(_)@
_ @
/_)@@
_ @
/ )@
( ( @
\_)@@
___ @
(___)@
___ @
(___)@@
_ @
( \ @
) )@
(_/ @@
___ @
(__ )@
(_/ @
(_) @@
@
@
@
@@
__ @
( ) @
/__\ @
(_)(_)@@
___ @
( ,)@
) ,\@
(___/@@
__ @
/ _)@
( (_ @
\__)@@
___ @
( \ @
) ) )@
(___/ @@
___ @
( _)@
) _)@
(___)@@
___ @
( _)@
) _)@
(_) @@
__ @
/ _)@
( (/\@
\__/@@
_ _ @
( )( )@
)__( @
(_)(_)@@
__ @
( )@
)( @
(__)@@
__ @
( )@
__)( @
(___/ @@
_ _ @
( ) ) @
) \ @
(_)\_)@@
__ @
( ) @
)(__ @
(____)@@
__ __ @
( \/ )@
) ( @
(_/\/\_)@@
_ _ @
( \( )@
) ( @
(_)\_)@@
__ @
/ \ @
( () )@
\__/ @@
___ @
( ,\@
) _/@
(_) @@
__ @
/ \ @
( () )@
\___\@@
___ @
( ,) @
) \ @
(_)\_)@@
___ @
/ __)@
\__ \@
(___/@@
____ @
(_ _)@
)( @
(__) @@
_ _ @
( )( )@
)()( @
\__/ @@
_ _ @
( )( )@
\\// @
(__) @@
_ _ @
( \/\/ )@
\ / @
\/\/ @@
_ _ @
( \/ )@
) ( @
(_/\_)@@
_ _ @
( \/ )@
\ / @
(__/ @@
___ @
(_ )@
/ / @
(___)@@
@
@
@
@@
_ @
( \ @
\ \ @
\_)@@
@
@
@
@@
__ @
/ \ @
(_/\_)@
@@
@
@
___ @
(___)@@
_ @
(_\@
@
@@
__ @
( ) @
/__\ @
(_)(_)@@
___ @
( ,)@
) ,\@
(___/@@
__ @
/ _)@
( (_ @
\__)@@
___ @
( \ @
) ) )@
(___/ @@
___ @
( _)@
) _)@
(___)@@
___ @
( _)@
) _)@
(_) @@
__ @
/ _)@
( (/\@
\__/@@
_ _ @
( )( )@
)__( @
(_)(_)@@
__ @
( )@
)( @
(__)@@
__ @
( )@
__)( @
(___/ @@
_ _ @
( ) ) @
) \ @
(_)\_)@@
__ @
( ) @
)(__ @
(____)@@
__ __ @
( \/ )@
) ( @
(_/\/\_)@@
_ _ @
( \( )@
) ( @
(_)\_)@@
__ @
/ \ @
( () )@
\__/ @@
___ @
( ,\@
) _/@
(_) @@
__ @
/ \ @
( () )@
\___\@@
___ @
( ,) @
) \ @
(_)\_)@@
___ @
/ __)@
\__ \@
(___/@@
____ @
(_ _)@
)( @
(__) @@
_ _ @
( )( )@
)()( @
\__/ @@
_ _ @
( )( )@
\\// @
(__) @@
_ _ @
( \/\/ )@
\ / @
\/\/ @@
_ _ @
( \/ )@
) ( @
(_/\_)@@
_ _ @
( \/ )@
\ / @
(__/ @@
___ @
(_ )@
/ / @
(___)@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@@ -0,0 +1,168 @@
import * as util from "../core/util.js";
function getRussianPlural(count, one, few, many) {
const absCount = Math.abs(count);
const lastDigit = absCount % 10;
const lastTwoDigits = absCount % 100;
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
return many;
}
if (lastDigit === 1) {
return one;
}
if (lastDigit >= 2 && lastDigit <= 4) {
return few;
}
return many;
}
const error = () => {
const Sizable = {
string: {
unit: {
one: "символ",
few: "символа",
many: "символов",
},
verb: "иметь",
},
file: {
unit: {
one: "байт",
few: "байта",
many: "байт",
},
verb: "иметь",
},
array: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
set: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
map: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "ввод",
email: "email адрес",
url: "URL",
emoji: "эмодзи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO дата и время",
date: "ISO дата",
time: "ISO время",
duration: "ISO длительность",
ipv4: "IPv4 адрес",
ipv6: "IPv6 адрес",
mac: "MAC адрес",
cidrv4: "IPv4 диапазон",
cidrv6: "IPv6 диапазон",
base64: "строка в формате base64",
base64url: "строка в формате base64url",
json_string: "JSON строка",
e164: "номер E.164",
credit_card: "номер кредитной карты",
currency_code: "код валюты",
iban: "IBAN",
jwt: "JWT",
template_literal: "ввод",
};
const TypeDictionary = {
nan: "NaN",
number: "число",
array: "массив",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Неверный ввод: ожидалось instanceof ${issue.expected}, получено ${received}`;
}
return `Неверный ввод: ожидалось ${expected}, получено ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
const maxValue = Number(issue.maximum);
const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
}
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
const minValue = Number(issue.minimum);
const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
}
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Неверная строка: должна содержать "${_issue.includes}"`;
if (_issue.format === "regex")
return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
return `Неверный ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Неверное число: должно быть кратным ${issue.divisor}`;
case "unrecognized_keys":
return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Неверный ключ в ${issue.origin}`;
case "invalid_union":
return "Неверные входные данные";
case "invalid_element":
return `Неверное значение в ${issue.origin}`;
default:
return `Неверные входные данные`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,56 @@
import { LRUCache } from './lru-cache.js';
/** Join path segments, cleaning duplicate slashes between parts. */
export declare function joinPaths(paths: Array<string | undefined>): string;
/** Remove repeated slashes from a path string. */
export declare function cleanPath(path: string): string;
/** Trim leading slashes (except preserving root '/'). */
export declare function trimPathLeft(path: string): string;
/** Trim trailing slashes (except preserving root '/'). */
export declare function trimPathRight(path: string): string;
/** Trim both leading and trailing slashes. */
export declare function trimPath(path: string): string;
/** Remove a trailing slash from value when appropriate for comparisons. */
export declare function removeTrailingSlash(value: string, basepath: string): string;
/**
* Compare two pathnames for exact equality after normalizing trailing slashes
* relative to the provided `basepath`.
*/
export declare function exactPathTest(pathName1: string, pathName2: string, basepath: string): boolean;
interface ResolvePathOptions {
base: string;
to: string;
trailingSlash?: 'always' | 'never' | 'preserve';
cache?: LRUCache<string, string>;
}
/**
* Resolve a destination path against a base, honoring trailing-slash policy
* and supporting relative segments (`.`/`..`) and absolute `to` values.
*/
export declare function resolvePath({ base, to, trailingSlash, cache, }: ResolvePathOptions): string;
/**
* Create a pre-compiled decode config from allowed characters.
* This should be called once at router initialization.
*/
export declare function compileDecodeCharMap(pathParamsAllowedCharacters: ReadonlyArray<string>): (encoded: string) => string;
interface InterpolatePathOptions {
path?: string;
params: Record<string, unknown>;
/**
* A function that decodes a path parameter value.
* Obtained from `compileDecodeCharMap(pathParamsAllowedCharacters)`.
*/
decoder?: (encoded: string) => string;
}
type InterPolatePathResult = {
interpolatedPath: string;
usedParams: Record<string, unknown>;
isMissingParams: boolean;
};
/**
* Interpolate params and wildcards into a route path template.
*
* - Encodes params safely (configurable allowed characters)
* - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards
*/
export declare function interpolatePath({ path, params, decoder, ...rest }: InterpolatePathOptions): InterPolatePathResult;
export {};