docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

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,107 @@
/**
* @typedef {{ type: 'hmr:module-registered', modules: string[] }} DevRuntimeMessage
* @typedef {{ send(message: DevRuntimeMessage): void }} Messenger
*/
export class DevRuntime {
/**
* @param {Messenger} messenger
* @param {string} clientId
*/
constructor(messenger: Messenger, clientId: string);
/**
* Client ID generated at runtime initialization, used for lazy compilation requests.
* @type {string}
*/
clientId: string;
messenger: Messenger;
/**
* @type {Record<string, Module>}
*/
modules: Record<string, Module>;
/**
* @param {string} _moduleId
*/
createModuleHotContext(_moduleId: string): void;
/**
* @param {[string, string][]} _boundaries
*/
applyUpdates(_boundaries: [string, string][]): void;
/**
* @param {string} id
* @param {{ exports: any }} exportsHolder
*/
registerModule(id: string, exportsHolder: {
exports: any;
}): void;
/**
* @param {string} id
*/
loadExports(id: string): any;
/**
* __esmMin
*
* When `dedup` is truthy and `id` is already registered on the runtime,
* skip the factory: another lazy blob got there first. HMR patches pass
* no `dedup` so they always re-run the factory and replace the registered
* exports.
*
* @type {<T>(id: string, fn: any, dedup: any, res: T) => () => T}
* @internal
*/
createEsmInitializer: <T>(id: string, fn: any, dedup: any, res: T) => () => T;
/**
* __commonJSMin
*
* Same dedup gate as createEsmInitializer. With `dedup` truthy and `id`
* registered, reuse the registered exports object; otherwise run the
* factory.
*
* @type {<T extends { exports: any }>(id: string, cb: any, dedup: any, mod: { exports: any }, registered: any) => () => T}
* @internal
*/
createCjsInitializer: <T extends {
exports: any;
}>(id: string, cb: any, dedup: any, mod: {
exports: any;
}, registered: any) => () => T;
/** @internal */
__toESM: any;
/** @internal */
__toCommonJS: any;
/** @internal */
__exportAll: any;
/**
* @param {boolean} [isNodeMode]
* @returns {(mod: any) => any}
* @internal
*/
__toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
/** @internal */
__reExport: any;
sendModuleRegisteredMessage: (module: string) => void;
}
export type DevRuntimeMessage = {
type: "hmr:module-registered";
modules: string[];
};
export type Messenger = {
send(message: DevRuntimeMessage): void;
};
declare class Module {
/**
* @param {string} id
*/
constructor(id: string);
/**
* @type {{ exports: any }}
*/
exportsHolder: {
exports: any;
};
/**
* @type {string}
*/
id: string;
get exports(): any;
}
export {};
@@ -0,0 +1,19 @@
import type { Type, TypeChecker } from 'typescript';
import type { TypeOrValueSpecifier } from '../util';
import { isTypeAnyType, isTypeNeverType } from '../util';
type OptionTester = (type: Type, checker: TypeChecker, recursivelyCheckType: (type: Type) => boolean) => boolean;
declare const optionTesters: {
type: "Array" | "RegExp" | "Boolean" | "Number" | "Any" | "Nullish" | "Never";
option: "allowAny" | "allowBoolean" | "allowNullish" | "allowRegExp" | "allowNever" | "allowNumber" | "allowArray";
tester: typeof isTypeAnyType | typeof isTypeNeverType | OptionTester | ((type: Type, checker: TypeChecker, recursivelyCheckType: (type: Type) => boolean) => boolean) | ((type: Type, checker: TypeChecker) => boolean);
}[];
export type Options = [
{
allow?: TypeOrValueSpecifier[];
} & Partial<Record<(typeof optionTesters)[number]['option'], boolean>>
];
export type MessageId = 'invalidType';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidType", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { flushSync } from 'react-dom'\nimport {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nexport * from '@tanstack/virtual-core'\n\nconst useIsomorphicLayoutEffect =\n typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nexport type ReactVirtualizer<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> = Virtualizer<TScrollElement, TItemElement> & {\n /**\n * Ref callback for the inner size container element. Only meaningful when\n * `directDomUpdates: true` — the virtualizer writes the container's\n * main-axis size (`height` or `width`) directly to skip React re-renders.\n */\n containerRef: (node: HTMLElement | null) => void\n}\n\nexport type ReactVirtualizerOptions<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> = VirtualizerOptions<TScrollElement, TItemElement> & {\n useFlushSync?: boolean\n /**\n * Skip React re-renders for scroll-only updates. The virtualizer writes\n * item positions (`top`/`left`) and the container size (`height`/`width`)\n * directly to the DOM, and only re-renders when the visible index range\n * or `isScrolling` changes.\n *\n * Requirements when enabled:\n * - Item elements must be `position: absolute`; in `'transform'` mode they\n * must also be anchored with `top: 0` / `left: 0`.\n * - Item elements must NOT set the main-axis position in their style — the\n * virtualizer owns `top` / `left` in `'position'` mode and `transform` in\n * `'transform'` mode.\n * - The inner size container must receive `virtualizer.containerRef` and\n * must NOT set `height` / `width` in its style.\n * - For multi-lane layouts (grids / masonry), the cross-axis position\n * (e.g. `left: ${(item.lane * 100) / lanes}%`) is stable per item and\n * must still be set in your JSX — only the main axis is automated.\n *\n * This flag is intended to be set once at mount. Toggling it (or\n * `directDomUpdatesMode`) at runtime can leave stale inline styles on\n * items and the container.\n */\n directDomUpdates?: boolean\n /**\n * How `directDomUpdates` positions item elements.\n * - `'transform'` (default): writes `transform: translate3d(...)`.\n * Promotes items to their own compositor layer — usually smoother on long\n * lists, but creates a stacking context and can interfere with\n * `position: fixed` descendants. Item elements must still be anchored with\n * `position: absolute`, `top: 0`, and `left: 0`.\n * - `'position'`: writes `top` / `left`. Item elements must be\n * `position: absolute`.\n */\n directDomUpdatesMode?: 'position' | 'transform'\n}\n\nfunction useVirtualizerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n>({\n useFlushSync = true,\n directDomUpdates = false,\n directDomUpdatesMode = 'transform',\n ...options\n}: ReactVirtualizerOptions<TScrollElement, TItemElement>): ReactVirtualizer<\n TScrollElement,\n TItemElement\n> {\n const rerender = React.useReducer((x: number) => x + 1, 0)[1]\n\n // Mutable across renders so the onChange closure captured by setOptions\n // always reads the latest values without us having to re-create it.\n const directRef = React.useRef({\n enabled: directDomUpdates,\n mode: directDomUpdatesMode,\n container: null as HTMLElement | null,\n lastSize: null as number | null,\n // Keyed by the element itself so a remounted node (same key, new DOM\n // node — e.g. when `enabled` is toggled off then on) is treated as fresh\n // and gets its style written.\n lastPositions: new WeakMap<HTMLElement, number>(),\n prevRange: null as {\n startIndex: number\n endIndex: number\n isScrolling: boolean\n } | null,\n })\n directRef.current.enabled = directDomUpdates\n directRef.current.mode = directDomUpdatesMode\n\n // Writes container size + item positions to the DOM. Idempotent — guarded\n // by lastSize / lastPositions. Called from onChange (covers scroll-driven\n // updates) and from a layout effect (covers post-render commits when refs\n // have just registered new items in elementsCache).\n const applyDirectStyles = (\n instance: Virtualizer<TScrollElement, TItemElement>,\n ) => {\n const state = directRef.current\n if (!state.enabled || !state.container) return\n\n const totalSize = instance.getTotalSize()\n if (totalSize !== state.lastSize) {\n state.lastSize = totalSize\n const sizeAxis = instance.options.horizontal ? 'width' : 'height'\n state.container.style[sizeAxis] = `${totalSize}px`\n }\n\n const horizontal = Line truncated
@@ -0,0 +1,53 @@
var inspect = require('../');
var test = require('tape');
test('element', function (t) {
t.plan(3);
var elem = {
nodeName: 'div',
attributes: [{ name: 'class', value: 'row' }],
getAttribute: function (key) { return key; },
childNodes: []
};
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div class="row"></div>, 3 ]');
t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1, <div class='row'></div>, 3 ]");
t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1, <div class="row"></div>, 3 ]');
});
test('element no attr', function (t) {
t.plan(1);
var elem = {
nodeName: 'div',
getAttribute: function (key) { return key; },
childNodes: []
};
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div></div>, 3 ]');
});
test('element with contents', function (t) {
t.plan(1);
var elem = {
nodeName: 'div',
getAttribute: function (key) { return key; },
childNodes: [{ nodeName: 'b' }]
};
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div>...</div>, 3 ]');
});
test('element instance', function (t) {
t.plan(1);
var h = global.HTMLElement;
global.HTMLElement = function (name, attr) {
this.nodeName = name;
this.attributes = attr;
};
global.HTMLElement.prototype.getAttribute = function () {};
var elem = new global.HTMLElement('div', []);
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div></div>, 3 ]');
global.HTMLElement = h;
});
@@ -0,0 +1 @@
{"version":3,"file":"arrow-left-right.js","sources":["../../../src/icons/arrow-left-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowLeftRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAzIDQgN2w0IDQiIC8+CiAgPHBhdGggZD0iTTQgN2gxNiIgLz4KICA8cGF0aCBkPSJtMTYgMjEgNC00LTQtNCIgLz4KICA8cGF0aCBkPSJNMjAgMTdINCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-left-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 ArrowLeftRight = createLucideIcon('ArrowLeftRight', [\n ['path', { d: 'M8 3 4 7l4 4', key: '9rb6wj' }],\n ['path', { d: 'M4 7h16', key: '6tx8e3' }],\n ['path', { d: 'm16 21 4-4-4-4', key: 'siv7j2' }],\n ['path', { d: 'M20 17H4', key: 'h6l3hr' }],\n]);\n\nexport default ArrowLeftRight;\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,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,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,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,615 @@
flf2a$ 6 4 20 0 2
invita.flf 06/94 pk6811s@acad.drake.edu
alas, the computer has better handwriting than I do
@
$$@
$$ @
$$ @
$$ @
$$ @@
/$$@
$/$ @
/ @
$o$ @
@
@@
@
//$@
@
$ @
@
@@
@
-/--/-$@
-/--/-$ @
@
@
@@
__/_ @
( / )$@
\ $ @
(__/_)$ @
/ @
@@
@
()/$$@
/ @
$/()$ @
@
@@
__ $@
( )$@
,\ $ @
(__\_ @
($@
@@
@
/ $@
@
$ @
@
@@
$ .-$@
$ / $ @
$ / $ @
$ / $ @
$ (__ $ @
@@
$-. $@
$ / $ @
$ / $ @
$ / $ @
$_./ $ @
@@
@
@
$_\/_$@
$ /\ $@
@
@@
@
$ @
$_|_$@
$ | $@
@
@@
$@
$@
$@
$ $@
$/ @
@@
@
$ $@
__ $@
$ $ @
$ $ @
@@
$@
@
@
$o $@
@
@@
$@
$ /$@
/ @
$/ $ @
$ @
@@
__ $@
/ )$@
/ / $@
(__ / $ @
@
@@
_ $@
/ / $@
/ $@
/ $ @
/ @
@@
_ $@
' )$@
,--' $@
/___ $ @
$@
@@
_ $@
' )$@
-( $@
(__ )$ @
@
@@
_ $@
/ /$@
/___/_$@
/ $@
/ @
@@
___$@
/ $@
/__ $@
____)$ @
@
@@
$__$@
/ $@
/__ $@
(__ )$ @
@
@@
___ $@
/ / $@
/ $@
/ $ @
/ @
@@
___ $@
( )$@
.--' $@
(___)$ @
@
@@
__ $@
/ )$@
(__,/ $@
/ $ @
/ @
@@
@
$@
$'$ @
$'$ @
@
@@
@
@
$o$ @
$ $ @
$/$ @
@@
@
/$$@
$<$$$@
\$$@
@
@@
$@
$__$@
$__$@
$@
@
@@
@
\ @
$>$$@
/ @
@
@@
___ $@
( )$@
/ $ @
o $ @
@
@@
_ $@
/ )$@
/ () $@
\____/$@
@
@@
_____ $ @
(, / |$ @
/---|$ @
) / |_ @
(_/ @
@@
______ $ @
(, / )$@
/---( $ @
) / ____) @
(_/ ( @
@@
) ___ $ @
(__/_____)$@
/ $ @
/ @
(______)$ @
@@
______ $ @
(, / )$@
/ / @
_/___ /_ @
(_/___ / @
@@
_____)$@
/ $ @
)__ $ @
/ @
(_____)$ @
@@
________)$@
(, / $ @
/___,$ @
) / $ @
(_/ @
@@
_____)$@
/ $ @
/ ___ $ @
/ / )$ @
(____ / $ @
@@
____ ___)$@
(, / / $ @
/---/$ @
) / (__ @
(_/ @
@@
_____$@
(, / $ @
/$ @
___/__ @
(__ / $ @
@@
_____$@
(, / $ @
/$ @
___/__ @
/ / $ @
(__ / $ @@
__ __)$@
(, ) / $ @
/( $ @
) / \_ @
(_/ @
@@
_ $ @
$___/__)$ @
(, / $ @
/ $ @
(_____$ @
) @@
__ __)$@
(, /| /|$ @
/ | / |$ @
) / |/ |_ @
(_/ ' $ @
@@
__ __)$@
(, /| / $ @
/ | / $ @
) / |/ $ @
(_/ ' $ @
@@
___ $@
/(, )$@
/ /$ @
/ /$ @
(___ /$ @
@@
_____ $ @
(, / )$@
_/__ /$ @
/ $ @
) / $ @
(_/ @@
____ $ @
(, )$@
/$ @
____ /$ @
(____ ( @
) @@
_____ $ @
(, / )$@
/__ /$ @
) / \_ @
(_/ @
@@
__ $@
(__/ )$@
/$ @
) /$ @
(_/$ @
@@
______)$@
(, / $ @
/ $ @
$ ) / $ @
$(_/ $ @
@@
__ __)$@
(, / / $ @
/ /$ @
/ /$ @
(___(_ @
@@
__ __)$@
(, ) / $ @
| /$ @
|/$ @
|$ @
@@
__ __)$@
(, ) | / $ @
| /| /$ @
|/ |/$ @
/ |$ @
@@
__ __)$ @
(, |/ $ @
| $ @
) /|_ @
(_/ $ @
@@
__ __)$@
(, ) / $ @
/ /$ @
(___/_ @
) / $ @
(__ / $ @@
___$ @
(, )$@
/$ @
_/_ @
) / @
(__ / @@
$ _ $@
$ / $ @
$ / $ @
$ / $ @
$ /_ $ @
@@
$ @
$\ $ @
\ @
$ \$@
$@
@@
$ _ $@
$ / $ @
$ / $ @
$ / $ @
$ _/ $ @
@@
_ @
$/ \$@
@
$ $@
@
@@
@
@
@
@
_@
@@
@
$$$\$$$@
@
$ $ @
@
@@
@
@
_$ @
(_(_@
@
@@
@
/)$@
(/_ @
/_)$ @
@
@@
@
@
_$@
(__@
@
@@
@
/)$@
_(/$ @
(_(_ @
@
@@
@
@
$_$@
_(/_@
@
@@
@
/)$@
//$ @
/(_ @
/) @
(/ @@
@
@
_ $@
(_/_@
.-/ @
(_/ @@
@
/)$@
(/ $@
/ )_@
@
@@
@
,$@
$ @
_(_ @
@
@@
@
$,$@
$ @
$/_ @
.-/ @
(_/ @@
@
/)$@
(/_$@
/(__@
@
@@
@
/)$@
//$ @
(/_ @
@
@@
@
@
___$ @
// (_@
@
@@
@
@
__$ @
/ (_@
@
@@
@
@
___@
(_) @
@
@@
@
@
__ $@
/_)_@
.-/ @
(_/ @@
@
@
_ $@
(_/_@
/( @
(_) @@
@
@
__$@
/ (_@
@
@@
@
@
$_ $@
/_)_@
@
@@
@
@
_/_ @
(__ @
@
@@
@
@
$@
(_(_@
@
@@
@
@
_ _ @
(/__@
@
@@
@
@
_ _@
(_(/$@
@
@@
@
@
__/$$@
$/(__@
/ @
@@
@
@
$ $@
(_/_@
.-/ @
(_/ @@
@
@
_ $@
'_)_@
.-/ @
(_/ @@
$ .-$@
$ / $ @
$ - $ @
$ / $ @
$ (__ $ @
@@
$ $@
$ | $@
$ | $@
$ | $@
@
@@
$-. $@
$ / $ @
$ - $ @
$ / $ @
$_./ $ @
@@
_ _$@
$' `-' @
@
$ $ @
@
@@
___'_'$ @
(, / |$ @
/---|$ @
) / |_ @
(_/ @
@@
'__'$@
/(, )$@
/ /$ @
/ /$ @
(___ /$ @
@@
__ ' '__)$@
(, / / $ @
/ /$ @
/ /$ @
(___(_ @
@@
@
. .@
_ @
(_(_@
@
@@
@
. .@
___@
(_) @
@
@@
@
. .@
$@
(_(_@
@
@@
______ $ @
(, // )$@
//--( $ @
) //____) @
(_// @
@@
@@ -0,0 +1,190 @@
/**
* @fileoverview Rule to disallow loops with a body that allows only one iteration
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const allLoopTypes = [
"WhileStatement",
"DoWhileStatement",
"ForStatement",
"ForInStatement",
"ForOfStatement",
];
/**
* Checks all segments in a set and returns true if any are reachable.
* @param {Set<CodePathSegment>} segments The segments to check.
* @returns {boolean} True if any segment is reachable; false otherwise.
*/
function isAnySegmentReachable(segments) {
for (const segment of segments) {
if (segment.reachable) {
return true;
}
}
return false;
}
/**
* Determines whether the given node is the first node in the code path to which a loop statement
* 'loops' for the next iteration.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node is a looping target.
*/
function isLoopingTarget(node) {
const parent = node.parent;
if (parent) {
switch (parent.type) {
case "WhileStatement":
return node === parent.test;
case "DoWhileStatement":
return node === parent.body;
case "ForStatement":
return node === (parent.update || parent.test || parent.body);
case "ForInStatement":
case "ForOfStatement":
return node === parent.left;
// no default
}
}
return false;
}
/**
* Creates an array with elements from the first given array that are not included in the second given array.
* @param {Array} arrA The array to compare from.
* @param {Array} arrB The array to compare against.
* @returns {Array} a new array that represents `arrA \ arrB`.
*/
function getDifference(arrA, arrB) {
return arrA.filter(a => !arrB.includes(a));
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [{ ignore: [] }],
docs: {
description:
"Disallow loops with a body that allows only one iteration",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-unreachable-loop",
},
schema: [
{
type: "object",
properties: {
ignore: {
type: "array",
items: {
enum: allLoopTypes,
},
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages: {
invalid: "Invalid loop. Its body allows only one iteration.",
},
},
create(context) {
const [{ ignore: ignoredLoopTypes }] = context.options;
const loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes),
loopSelector = loopTypesToCheck.join(","),
loopsByTargetSegments = new Map(),
loopsToReport = new Set();
const codePathSegments = [];
let currentCodePathSegments = new Set();
return {
onCodePathStart() {
codePathSegments.push(currentCodePathSegments);
currentCodePathSegments = new Set();
},
onCodePathEnd() {
currentCodePathSegments = codePathSegments.pop();
},
onUnreachableCodePathSegmentStart(segment) {
currentCodePathSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
currentCodePathSegments.delete(segment);
},
onCodePathSegmentEnd(segment) {
currentCodePathSegments.delete(segment);
},
onCodePathSegmentStart(segment, node) {
currentCodePathSegments.add(segment);
if (isLoopingTarget(node)) {
const loop = node.parent;
loopsByTargetSegments.set(segment, loop);
}
},
onCodePathSegmentLoop(_, toSegment, node) {
const loop = loopsByTargetSegments.get(toSegment);
/**
* The second iteration is reachable, meaning that the loop is valid by the logic of this rule,
* only if there is at least one loop event with the appropriate target (which has been already
* determined in the `loopsByTargetSegments` map), raised from either:
*
* - the end of the loop's body (in which case `node === loop`)
* - a `continue` statement
*
* This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes.
*/
if (node === loop || node.type === "ContinueStatement") {
// Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw.
loopsToReport.delete(loop);
}
},
[loopSelector](node) {
/**
* Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise.
* For unreachable segments, the code path analysis does not raise events required for this implementation.
*/
if (isAnySegmentReachable(currentCodePathSegments)) {
loopsToReport.add(node);
}
},
"Program:exit"() {
loopsToReport.forEach(node =>
context.report({ node, messageId: "invalid" }),
);
},
};
},
};
@@ -0,0 +1,900 @@
export default `flf2a$ 4 3 14 0 10 0 1920
SmShadow by Glenn Chappell 4/93 -- based on Small
Includes ISO Latin-1
figlet release 2.1 -- 12 Aug 1994
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
supported by FIGlet and FIGWin. May also be slightly modified for better use
of new full-width/kern/smush alternatives, but default output is NOT changed.
$$@
$$@
$$@
$$@@
|$@
_|$@
_)$@
@@
| )$@
V V$ @
@
@@
| |$ @
_ |_ |_|$@
_ |_ |_|$@
_| _|$ @@
|$ @
(_-<$@
_ _/$@
_|$ @@
_) /$ @
/$ @
_/ _)$@
@@
_|$ @
_| _|$@
\\____|$ @
@@
)$@
/$ @
@
@@
/$@
|$ @
|$ @
\\_\\$@@
\\ \\$ @
|$@
|$@
_/$ @@
\\ \\ /$ @
_ _|$@
_/ _\\$ @
@@
|$ @
__ __|$@
_|$ @
@@
@
@
)$@
/$ @@
@
____|$@
@
@@
@
@
_)$@
@@
/$@
/$ @
_/$ @
@@
\\$ @
( |$@
\\__/$ @
@@
_ |$@
|$@
_|$@
@@
_ )$@
/$ @
___|$@
@@
__ /$@
_ \\$@
___/$@
@@
| |$ @
__ _|$@
_|$ @
@@
__|$@
__ \\$@
___/$@
@@
/$ @
_ \\$@
\\___/$@
@@
__ /$@
/$ @
_/$ @
@@
_ )$@
_ \\$@
\\___/$@
@@
_ \\$@
\\_ /$@
_/$ @
@@
_)$@
@
_)$@
@@
_)$@
@
)$@
/$ @@
/$@
< <$ @
\\_\\$@
@@
@
____|$@
____|$@
@@
\\ \\$ @
> >$@
_/$ @
@@
__ \\$@
_/$@
_)$ @
@@
__ \\$ @
/ _\` |$@
\\__,_|$@
\\____/$ @@
\\$ @
_ \\$ @
_/ _\\$@
@@
_ )$@
_ \\$@
___/$@
@@
__|$@
($ @
\\___|$@
@@
_ \\$ @
| |$@
___/$ @
@@
__|$@
_|$ @
___|$@
@@
__|$@
_|$ @
_|$ @
@@
__|$@
(_ |$@
\\___|$@
@@
| |$@
__ |$@
_| _|$@
@@
_ _|$@
|$ @
___|$@
@@
|$@
\\ |$@
\\__/$ @
@@
| /$@
. <$ @
_|\\_\\$@
@@
|$ @
|$ @
____|$@
@@
\\ |$@
|\\/ |$@
_| _|$@
@@
\\ |$@
. |$@
_|\\_|$@
@@
_ \\$ @
( |$@
\\___/$ @
@@
_ \\$@
__/$@
_|$ @
@@
_ \\$ @
( |$@
\\__\\_\\$@
@@
_ \\$@
/$@
_|_\\$@
@@
__|$@
\\__ \\$@
____/$@
@@
__ __|$@
|$ @
_|$ @
@@
| |$@
| |$@
\\__/$ @
@@
\\ \\ /$@
\\ \\ /$ @
\\_/$ @
@@
\\ \\ /$@
\\ \\ \\ /$ @
\\_/\\_/$ @
@@
\\ \\ /$@
> <$ @
_/\\_\\$@
@@
\\ \\ /$@
\\ /$ @
_|$ @
@@
__ /$@
/$ @
____|$@
@@
_|$@
|$ @
|$ @
__|$@@
\\ \\$ @
\\ \\$ @
\\_\\$@
@@
_ |$@
|$@
|$@
__|$@@
\\$ @
/\\|$@
@
@@
@
@
@
____|$@@
)$@
\\|$@
@
@@
@
_\` |$@
\\__,_|$@
@@
|$ @
_ \\$@
_.__/$@
@@
@
_|$@
\\__|$@
@@
|$@
_\` |$@
\\__,_|$@
@@
@
-_)$@
\\___|$@
@@
_|$@
_|$@
_|$ @
@@
@
_\` |$@
\\__, |$@
____/$ @@
|$ @
\\$ @
_| _|$@
@@
_)$@
|$@
_|$@
@@
_)$@
|$@
|$@
__/$ @@
|$ @
| /$@
_\\_\\$@
@@
|$@
|$@
_|$@
@@
@
\` \\$ @
_|_|_|$@
@@
@
\\$ @
_| _|$@
@@
@
_ \\$@
\\___/$@
@@
@
_ \\$@
.__/$@
_|$ @@
@
_\` |$@
\\__, |$@
_|$@@
@
_|$@
_|$ @
@@
@
(_-<$@
___/$@
@@
|$ @
_|$@
\\__|$@
@@
@
| |$@
\\_,_|$@
@@
@
\\ \\ /$@
\\_/$ @
@@
@
\\ \\ \\ /$@
\\_/\\_/$ @
@@
@
\\ \\ /$@
_\\_\\$@
@@
@
| |$@
\\_, |$@
___/$ @@
@
_ /$@
___|$@
@@
/$@
_ |$ @
|$ @
\\_\\$@@
|$@
|$@
|$@
_|$@@
\\ \\$ @
|_$@
|$ @
_/$ @@
\\ |$@
/\\/$ @
@
@@
_) \\_)$@
_ \\$ @
/ _\\$@
@@
_) _)$@
__ \\$@
\\____/$@
@@
_) _)$@
| |$@
\\__/$ @
@@
_) _)$@
_\` |$@
\\__,_|$@
@@
_) _)$@
_ \\$@
\\___/$@
@@
_) _)$@
| |$@
\\_,_|$@
@@
_ \\$@
|< <$@
|__/$@
_|$ @@
160 NO-BREAK SPACE
$$@
$$@
$$@
$$@@
161 INVERTED EXCLAMATION MARK
_)$@
|$@
_|$@
@@
162 CENT SIGN
|$ @
_)$@
\\ _)$@
|$ @@
163 POUND SIGN
_\\$ @
_ _|$ @
_,___|$@
@@
164 CURRENCY SIGN
\\ . /$@
_ \\$@
\\/ /$@
@@
165 YEN SIGN
\\ \\ /$ @
__ __|$@
__ __|$@
_|$ @@
166 BROKEN BAR
|$@
_|$@
|$@
_|$@@
167 SECTION SIGN
_)$@
\\ \\$ @
\\ \\/$ @
__/$ @@
168 DIAERESIS
_) _)$@
@
@
@@
169 COPYRIGHT SIGN
\\$ @
_| \\$@
\\ \\__| /$@
\\____/$ @@
170 FEMININE ORDINAL INDICATOR
_\` |$@
\\__,_|$@
_____|$@
@@
171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
/ /$@
< < <$ @
\\_\\_\\$@
@@
172 NOT SIGN
____ |$@
_|$@
@
@@
173 SOFT HYPHEN
@
___|$@
@
@@
174 REGISTERED SIGN
\\$ @
-) \\$@
\\ |\\\\ /$@
\\____/$ @@
175 MACRON
___|$@
@
@
@@
176 DEGREE SIGN
.\\$@
\\_/$@
@
@@
177 PLUS-MINUS SIGN
|$ @
_ _|$@
_|$ @
_____|$@@
178 SUPERSCRIPT TWO
_ )$@
__|$@
@
@@
179 SUPERSCRIPT THREE
_ /$@
__)$@
@
@@
180 ACUTE ACCENT
_/$@
@
@
@@
181 MICRO SIGN
@
| |$@
.,_|$@
_|$ @@
182 PILCROW SIGN
|$@
\\_ | |$@
_|_|$@
@@
183 MIDDLE DOT
@
_)$@
@
@@
184 CEDILLA
@
@
@
_)$@@
185 SUPERSCRIPT ONE
_ |$@
_|$@
@
@@
186 MASCULINE ORDINAL INDICATOR
_ \\$@
\\___/$@
____|$@
@@
187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\\ \\ \\$ @
> > >$@
_/_/$ @
@@
188 VULGAR FRACTION ONE QUARTER
_ | /$ @
_| /_' |$@
_/ _|$@
@@
189 VULGAR FRACTION ONE HALF
_ | /$ @
_| /_ )$@
_/ __|$@
@@
190 VULGAR FRACTION THREE QUARTERS
_ / /$ @
__) /_' |$@
_/ _|$@
@@
191 INVERTED QUESTION MARK
_)$ @
/$ @
\\___|$@
@@
192 LATIN CAPITAL LETTER A WITH GRAVE
\\_\\$ @
--\\$ @
_/\\_\\$@
@@
193 LATIN CAPITAL LETTER A WITH ACUTE
_/$ @
--\\$ @
_/\\_\\$@
@@
194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
/\\\\$ @
--\\$ @
_/\\_\\$@
@@
195 LATIN CAPITAL LETTER A WITH TILDE
/ _/$ @
--\\$ @
_/\\_\\$@
@@
196 LATIN CAPITAL LETTER A WITH DIAERESIS
_) \\_)$@
_ \\$ @
/ _\\$@
@@
197 LATIN CAPITAL LETTER A WITH RING ABOVE
( )$ @
_ \\$ @
_/ _\\$@
@@
198 LATIN CAPITAL LETTER AE
, __|$@
_ _|$ @
_/ ___|$@
@@
199 LATIN CAPITAL LETTER C WITH CEDILLA
|$@
($ @
\\___|$@
_)$ @@
200 LATIN CAPITAL LETTER E WITH GRAVE
\\_\\$@
-<$@
__<$@
@@
201 LATIN CAPITAL LETTER E WITH ACUTE
_/$@
-<$@
__<$@
@@
202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
/\\\\$@
-<$@
__<$@
@@
203 LATIN CAPITAL LETTER E WITH DIAERESIS
_) _)$@
-<$ @
__<$ @
@@
204 LATIN CAPITAL LETTER I WITH GRAVE
\\_\\$ @
_ _|$@
___|$@
@@
205 LATIN CAPITAL LETTER I WITH ACUTE
_/$ @
_ _|$@
___|$@
@@
206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
/\\\\$ @
_ _|$@
___|$@
@@
207 LATIN CAPITAL LETTER I WITH DIAERESIS
_) _)$@
_ _|$ @
___|$ @
@@
208 LATIN CAPITAL LETTER ETH
_ \\$ @
_ _| |$@
___/$ @
@@
209 LATIN CAPITAL LETTER N WITH TILDE
/ _/$@
\\ |$@
_|\\_|$@
@@
210 LATIN CAPITAL LETTER O WITH GRAVE
\\_\\$ @
__ \\$@
\\____/$@
@@
211 LATIN CAPITAL LETTER O WITH ACUTE
_/$ @
__ \\$@
\\____/$@
@@
212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
/\\\\$ @
__ \\$@
\\____/$@
@@
213 LATIN CAPITAL LETTER O WITH TILDE
/ _/$ @
__ \\$@
\\____/$@
@@
214 LATIN CAPITAL LETTER O WITH DIAERESIS
_) _)$@
__ \\$@
\\____/$@
@@
215 MULTIPLICATION SIGN
\\ \\$@
, '$@
\\/\\/$@
@@
216 LATIN CAPITAL LETTER O WITH STROKE
_ /\\$ @
( / |$@
\\_/__/$ @
@@
217 LATIN CAPITAL LETTER U WITH GRAVE
\\_\\$ @
| |$@
\\__/$ @
@@
218 LATIN CAPITAL LETTER U WITH ACUTE
_/$ @
| |$@
\\__/$ @
@@
219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
/\\\\$ @
| |$@
\\__/$ @
@@
220 LATIN CAPITAL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\\__/$ @
@@
221 LATIN CAPITAL LETTER Y WITH ACUTE
_/$ @
\\ \\ /$@
_|$ @
@@
222 LATIN CAPITAL LETTER THORN
|$ @
-_)$@
_|$ @
@@
223 LATIN SMALL LETTER SHARP S
_ \\$@
|< <$@
|__/$@
_|$ @@
224 LATIN SMALL LETTER A WITH GRAVE
\\_\\$ @
_\` |$@
\\__,_|$@
@@
225 LATIN SMALL LETTER A WITH ACUTE
_/$ @
_\` |$@
\\__,_|$@
@@
226 LATIN SMALL LETTER A WITH CIRCUMFLEX
/\\\\$ @
_\` |$@
\\__,_|$@
@@
227 LATIN SMALL LETTER A WITH TILDE
/ _/$ @
_\` |$@
\\__,_|$@
@@
228 LATIN SMALL LETTER A WITH DIAERESIS
_) _)$@
_\` |$@
\\__,_|$@
@@
229 LATIN SMALL LETTER A WITH RING ABOVE
( )$ @
_\` |$@
\\__,_|$@
@@
230 LATIN SMALL LETTER AE
@
_\` -_)$@
\\__,___|$@
@@
231 LATIN SMALL LETTER C WITH CEDILLA
@
_|$@
\\__|$@
_)$@@
232 LATIN SMALL LETTER E WITH GRAVE
\\_\\$ @
-_)$@
\\___|$@
@@
233 LATIN SMALL LETTER E WITH ACUTE
_/$ @
-_)$@
\\___|$@
@@
234 LATIN SMALL LETTER E WITH CIRCUMFLEX
/\\\\$ @
-_)$@
\\___|$@
@@
235 LATIN SMALL LETTER E WITH DIAERESIS
_) _)$@
-_)$ @
\\___|$ @
@@
236 LATIN SMALL LETTER I WITH GRAVE
\\_\\$@
|$@
_|$@
@@
237 LATIN SMALL LETTER I WITH ACUTE
_/$@
|$@
_|$@
@@
238 LATIN SMALL LETTER I WITH CIRCUMFLEX
/\\\\$@
|$ @
_|$ @
@@
239 LATIN SMALL LETTER I WITH DIAERESIS
_) _)$@
|$ @
_|$ @
@@
240 LATIN SMALL LETTER ETH
, \\'$@
_\` |$@
\\___/$ @
@@
241 LATIN SMALL LETTER N WITH TILDE
/ _/$ @
' \\$ @
_| _|$@
@@
242 LATIN SMALL LETTER O WITH GRAVE
\\_\\$ @
_ \\$@
\\___/$@
@@
243 LATIN SMALL LETTER O WITH ACUTE
_/$ @
_ \\$@
\\___/$@
@@
244 LATIN SMALL LETTER O WITH CIRCUMFLEX
/\\\\$ @
_ \\$@
\\___/$@
@@
245 LATIN SMALL LETTER O WITH TILDE
/ _/$@
_ \\$@
\\___/$@
@@
246 LATIN SMALL LETTER O WITH DIAERESIS
_) _)$@
_ \\$@
\\___/$@
@@
247 DIVISION SIGN
_)$ @
___|$@
_)$ @
@@
248 LATIN SMALL LETTER O WITH STROKE
@
/\\$@
\\_/_/$@
@@
249 LATIN SMALL LETTER U WITH GRAVE
\\_\\$ @
| |$@
\\_,_|$@
@@
250 LATIN SMALL LETTER U WITH ACUTE
_/$ @
| |$@
\\_,_|$@
@@
251 LATIN SMALL LETTER U WITH CIRCUMFLEX
/\\\\$ @
| |$@
\\_,_|$@
@@
252 LATIN SMALL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\\_,_|$@
@@
253 LATIN SMALL LETTER Y WITH ACUTE
_/$ @
| |$@
\\_, |$@
___/$ @@
254 LATIN SMALL LETTER THORN
|$ @
'_ \\$@
.__/$@
_|$ @@
255 LATIN SMALL LETTER Y WITH DIAERESIS
_) _)$@
| |$@
\\_, |$@
___/$ @@
`
@@ -0,0 +1,186 @@
import * as aeskw from './aeskw.js';
import * as ecdhes from './ecdhes.js';
import * as pbes2kw from './pbes2kw.js';
import * as rsaes from './rsaes.js';
import { encode as b64u } from '../util/base64url.js';
import { normalizeKey } from './normalize_key.js';
import { JOSENotSupported, JWEInvalid } from '../util/errors.js';
import { decodeBase64url } from './helpers.js';
import { generateCek, cekLength } from './content_encryption.js';
import { importJWK } from '../key/import.js';
import { exportJWK } from '../key/export.js';
import { isObject } from './type_checks.js';
import { wrap as aesGcmKwWrap, unwrap as aesGcmKwUnwrap } from './aesgcmkw.js';
import { assertCryptoKey } from './is_key_like.js';
const unsupportedAlgHeader = 'Invalid or unsupported "alg" (JWE Algorithm) header value';
function assertEncryptedKey(encryptedKey) {
if (encryptedKey === undefined)
throw new JWEInvalid('JWE Encrypted Key missing');
}
export async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
switch (alg) {
case 'dir': {
if (encryptedKey !== undefined)
throw new JWEInvalid('Encountered unexpected JWE Encrypted Key');
return key;
}
case 'ECDH-ES':
if (encryptedKey !== undefined)
throw new JWEInvalid('Encountered unexpected JWE Encrypted Key');
case 'ECDH-ES+A128KW':
case 'ECDH-ES+A192KW':
case 'ECDH-ES+A256KW': {
if (!isObject(joseHeader.epk))
throw new JWEInvalid(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);
assertCryptoKey(key);
if (!ecdhes.allowed(key))
throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime');
const epk = await importJWK(joseHeader.epk, alg);
assertCryptoKey(epk);
let partyUInfo;
let partyVInfo;
if (joseHeader.apu !== undefined) {
if (typeof joseHeader.apu !== 'string')
throw new JWEInvalid(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);
partyUInfo = decodeBase64url(joseHeader.apu, 'apu', JWEInvalid);
}
if (joseHeader.apv !== undefined) {
if (typeof joseHeader.apv !== 'string')
throw new JWEInvalid(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);
partyVInfo = decodeBase64url(joseHeader.apv, 'apv', JWEInvalid);
}
const sharedSecret = await ecdhes.deriveKey(epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? cekLength(joseHeader.enc) : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
if (alg === 'ECDH-ES')
return sharedSecret;
assertEncryptedKey(encryptedKey);
return aeskw.unwrap(alg.slice(-6), sharedSecret, encryptedKey);
}
case 'RSA-OAEP':
case 'RSA-OAEP-256':
case 'RSA-OAEP-384':
case 'RSA-OAEP-512': {
assertEncryptedKey(encryptedKey);
assertCryptoKey(key);
return rsaes.decrypt(alg, key, encryptedKey);
}
case 'PBES2-HS256+A128KW':
case 'PBES2-HS384+A192KW':
case 'PBES2-HS512+A256KW': {
assertEncryptedKey(encryptedKey);
if (typeof joseHeader.p2c !== 'number')
throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);
const p2cLimit = options?.maxPBES2Count || 10_000;
if (joseHeader.p2c > p2cLimit)
throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);
if (typeof joseHeader.p2s !== 'string')
throw new JWEInvalid(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);
let p2s;
p2s = decodeBase64url(joseHeader.p2s, 'p2s', JWEInvalid);
return pbes2kw.unwrap(alg, key, encryptedKey, joseHeader.p2c, p2s);
}
case 'A128KW':
case 'A192KW':
case 'A256KW': {
assertEncryptedKey(encryptedKey);
return aeskw.unwrap(alg, key, encryptedKey);
}
case 'A128GCMKW':
case 'A192GCMKW':
case 'A256GCMKW': {
assertEncryptedKey(encryptedKey);
if (typeof joseHeader.iv !== 'string')
throw new JWEInvalid(`JOSE Header "iv" (Initialization Vector) missing or invalid`);
if (typeof joseHeader.tag !== 'string')
throw new JWEInvalid(`JOSE Header "tag" (Authentication Tag) missing or invalid`);
let iv;
iv = decodeBase64url(joseHeader.iv, 'iv', JWEInvalid);
let tag;
tag = decodeBase64url(joseHeader.tag, 'tag', JWEInvalid);
return aesGcmKwUnwrap(alg, key, encryptedKey, iv, tag);
}
default: {
throw new JOSENotSupported(unsupportedAlgHeader);
}
}
}
export async function encryptKeyManagement(alg, enc, key, providedCek, providedParameters = {}) {
let encryptedKey;
let parameters;
let cek;
switch (alg) {
case 'dir': {
cek = key;
break;
}
case 'ECDH-ES':
case 'ECDH-ES+A128KW':
case 'ECDH-ES+A192KW':
case 'ECDH-ES+A256KW': {
assertCryptoKey(key);
if (!ecdhes.allowed(key)) {
throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime');
}
const { apu, apv } = providedParameters;
let ephemeralKey;
if (providedParameters.epk) {
ephemeralKey = (await normalizeKey(providedParameters.epk, alg));
}
else {
ephemeralKey = (await crypto.subtle.generateKey(key.algorithm, true, ['deriveBits'])).privateKey;
}
const { x, y, crv, kty } = await exportJWK(ephemeralKey);
const sharedSecret = await ecdhes.deriveKey(key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? cekLength(enc) : parseInt(alg.slice(-5, -2), 10), apu, apv);
parameters = { epk: { x, crv, kty } };
if (kty === 'EC')
parameters.epk.y = y;
if (apu)
parameters.apu = b64u(apu);
if (apv)
parameters.apv = b64u(apv);
if (alg === 'ECDH-ES') {
cek = sharedSecret;
break;
}
cek = providedCek || generateCek(enc);
const kwAlg = alg.slice(-6);
encryptedKey = await aeskw.wrap(kwAlg, sharedSecret, cek);
break;
}
case 'RSA-OAEP':
case 'RSA-OAEP-256':
case 'RSA-OAEP-384':
case 'RSA-OAEP-512': {
cek = providedCek || generateCek(enc);
assertCryptoKey(key);
encryptedKey = await rsaes.encrypt(alg, key, cek);
break;
}
case 'PBES2-HS256+A128KW':
case 'PBES2-HS384+A192KW':
case 'PBES2-HS512+A256KW': {
cek = providedCek || generateCek(enc);
const { p2c, p2s } = providedParameters;
({ encryptedKey, ...parameters } = await pbes2kw.wrap(alg, key, cek, p2c, p2s));
break;
}
case 'A128KW':
case 'A192KW':
case 'A256KW': {
cek = providedCek || generateCek(enc);
encryptedKey = await aeskw.wrap(alg, key, cek);
break;
}
case 'A128GCMKW':
case 'A192GCMKW':
case 'A256GCMKW': {
cek = providedCek || generateCek(enc);
const { iv } = providedParameters;
({ encryptedKey, ...parameters } = await aesGcmKwWrap(alg, key, cek, iv));
break;
}
default: {
throw new JOSENotSupported(unsupportedAlgHeader);
}
}
return { cek, encryptedKey, parameters };
}
@@ -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 SquareActivity = createLucideIcon("SquareActivity", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M17 12h-2l-2 5-2-10-2 5H7", key: "15hlnc" }]
]);
export { SquareActivity as default };
//# sourceMappingURL=square-activity.js.map
@@ -0,0 +1,239 @@
"use strict";var _=Object.defineProperty;var A=(e,n,t)=>n in e?_(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var b=(e,n,t)=>(A(e,typeof n!="symbol"?n+"":n,t),t),E=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var c=(e,n,t)=>(E(e,n,"read from private field"),t?t.call(e):n.get(e)),O=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},d=(e,n,t,i)=>(E(e,n,"write to private field"),i?i.call(e,t):n.set(e,t),t);var h,w,s;const _format=require("./shared/confbox.3768c7e9.cjs");/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/function getLineColFromPtr(e,n){let t=e.slice(0,n).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function makeCodeBlock(e,n,t){let i=e.split(/\r\n|\n|\r/g),l="",r=(Math.log10(n+1)|0)+1;for(let f=n-1;f<=n+1;f++){let o=i[f-1];o&&(l+=f.toString().padEnd(r," "),l+=": ",l+=o,l+=`
`,f===n&&(l+=" ".repeat(r+t+2),l+=`^
`))}return l}class TomlError extends Error{constructor(t,i){const[l,r]=getLineColFromPtr(i.toml,i.ptr),f=makeCodeBlock(i.toml,l,r);super(`Invalid TOML document: ${t}
${f}`,i);b(this,"line");b(this,"column");b(this,"codeblock");this.line=l,this.column=r,this.codeblock=f}}/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/function indexOfNewline(e,n=0,t=e.length){let i=e.indexOf(`
`,n);return e[i-1]==="\r"&&i--,i<=t?i:-1}function skipComment(e,n){for(let t=n;t<e.length;t++){let i=e[t];if(i===`
`)return t;if(i==="\r"&&e[t+1]===`
`)return t+1;if(i<" "&&i!==" "||i==="\x7F")throw new TomlError("control characters are not allowed in comments",{toml:e,ptr:n})}return e.length}function skipVoid(e,n,t,i){let l;for(;(l=e[n])===" "||l===" "||!t&&(l===`
`||l==="\r"&&e[n+1]===`
`);)n++;return i||l!=="#"?n:skipVoid(e,skipComment(e,n),t)}function skipUntil(e,n,t,i,l=!1){if(!i)return n=indexOfNewline(e,n),n<0?e.length:n;for(let r=n;r<e.length;r++){let f=e[r];if(f==="#")r=indexOfNewline(e,r);else{if(f===t)return r+1;if(f===i)return r;if(l&&(f===`
`||f==="\r"&&e[r+1]===`
`))return r}}throw new TomlError("cannot find end of structure",{toml:e,ptr:n})}function getStringEnd(e,n){let t=e[n],i=t===e[n+1]&&e[n+1]===e[n+2]?e.slice(n,n+3):t;n+=i.length-1;do n=e.indexOf(i,++n);while(n>-1&&t!=="'"&&e[n-1]==="\\"&&e[n-2]!=="\\");return n>-1&&(n+=i.length,i.length>1&&(e[n]===t&&n++,e[n]===t&&n++)),n}/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/let DATE_TIME_RE=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;const g=class g extends Date{constructor(t){let i=!0,l=!0,r="Z";if(typeof t=="string"){let f=t.match(DATE_TIME_RE);f?(f[1]||(i=!1,t=`0000-01-01T${t}`),l=!!f[2],f[2]&&+f[2]>23?t="":(r=f[3]||null,t=t.toUpperCase(),!r&&l&&(t+="Z"))):t=""}super(t);O(this,h,!1);O(this,w,!1);O(this,s,null);isNaN(this.getTime())||(d(this,h,i),d(this,w,l),d(this,s,r))}isDateTime(){return c(this,h)&&c(this,w)}isLocal(){return!c(this,h)||!c(this,w)||!c(this,s)}isDate(){return c(this,h)&&!c(this,w)}isTime(){return c(this,w)&&!c(this,h)}isValid(){return c(this,h)||c(this,w)}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(c(this,s)===null)return t.slice(0,-1);if(c(this,s)==="Z")return t;let i=+c(this,s).slice(1,3)*60+ +c(this,s).slice(4,6);return i=c(this,s)[0]==="-"?i:-i,new Date(this.getTime()-i*6e4).toISOString().slice(0,-1)+c(this,s)}static wrapAsOffsetDateTime(t,i="Z"){let l=new g(t);return d(l,s,i),l}static wrapAsLocalDateTime(t){let i=new g(t);return d(i,s,null),i}static wrapAsLocalDate(t){let i=new g(t);return d(i,w,!1),d(i,s,null),i}static wrapAsLocalTime(t){let i=new g(t);return d(i,h,!1),d(i,s,null),i}};h=new WeakMap,w=new WeakMap,s=new WeakMap;let TomlDate=g;/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/let INT_REGEX=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,FLOAT_REGEX=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,LEADING_ZERO=/^[+-]?0[0-9_]/,ESCAPE_REGEX=/^[0-9a-f]{4,8}$/i,ESC_MAP={b:"\b",t:" ",n:`
`,f:"\f",r:"\r",'"':'"',"\\":"\\"};function parseString(e,n=0,t=e.length){let i=e[n]==="'",l=e[n++]===e[n]&&e[n]===e[n+1];l&&(t-=2,e[n+=2]==="\r"&&n++,e[n]===`
`&&n++);let r=0,f,o="",a=n;for(;n<t-1;){let u=e[n++];if(u===`
`||u==="\r"&&e[n]===`
`){if(!l)throw new TomlError("newlines are not allowed in strings",{toml:e,ptr:n-1})}else if(u<" "&&u!==" "||u==="\x7F")throw new TomlError("control characters are not allowed in strings",{toml:e,ptr:n-1});if(f){if(f=!1,u==="u"||u==="U"){let m=e.slice(n,n+=u==="u"?4:8);if(!ESCAPE_REGEX.test(m))throw new TomlError("invalid unicode escape",{toml:e,ptr:r});try{o+=String.fromCodePoint(parseInt(m,16))}catch{throw new TomlError("invalid unicode escape",{toml:e,ptr:r})}}else if(l&&(u===`
`||u===" "||u===" "||u==="\r")){if(n=skipVoid(e,n-1,!0),e[n]!==`
`&&e[n]!=="\r")throw new TomlError("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:r});n=skipVoid(e,n)}else if(u in ESC_MAP)o+=ESC_MAP[u];else throw new TomlError("unrecognized escape sequence",{toml:e,ptr:r});a=n}else!i&&u==="\\"&&(r=n-1,f=!0,o+=e.slice(a,r))}return o+e.slice(a,t-1)}function parseValue(e,n,t){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return 0;let i;if((i=INT_REGEX.test(e))||FLOAT_REGEX.test(e)){if(LEADING_ZERO.test(e))throw new TomlError("leading zeroes are not allowed",{toml:n,ptr:t});let r=+e.replace(/_/g,"");if(isNaN(r))throw new TomlError("invalid number",{toml:n,ptr:t});if(i&&!Number.isSafeInteger(r))throw new TomlError("integer value cannot be represented losslessly",{toml:n,ptr:t});return r}let l=new TomlDate(e);if(!l.isValid())throw new TomlError("invalid value",{toml:n,ptr:t});return l}/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/function sliceAndTrimEndOf(e,n,t,i){let l=e.slice(n,t),r=l.indexOf("#");r>-1&&(skipComment(e,r),l=l.slice(0,r));let f=l.trimEnd();if(!i){let o=l.indexOf(`
`,f.length);if(o>-1)throw new TomlError("newlines are not allowed in inline tables",{toml:e,ptr:n+o})}return[f,r]}function extractValue(e,n,t){let i=e[n];if(i==="["||i==="{"){let[f,o]=i==="["?parseArray(e,n):parseInlineTable(e,n),a=skipUntil(e,o,",",t);if(t==="}"){let u=indexOfNewline(e,o,a);if(u>-1)throw new TomlError("newlines are not allowed in inline tables",{toml:e,ptr:u})}return[f,a]}let l;if(i==='"'||i==="'"){l=getStringEnd(e,n);let f=parseString(e,n,l);if(t){if(l=skipVoid(e,l,t!=="]"),e[l]&&e[l]!==","&&e[l]!==t&&e[l]!==`
`&&e[l]!=="\r")throw new TomlError("unexpected character encountered",{toml:e,ptr:l});l+=+(e[l]===",")}return[f,l]}l=skipUntil(e,n,",",t);let r=sliceAndTrimEndOf(e,n,l-+(e[l-1]===","),t==="]");if(!r[0])throw new TomlError("incomplete key-value declaration: no value specified",{toml:e,ptr:n});return t&&r[1]>-1&&(l=skipVoid(e,n+r[1]),l+=+(e[l]===",")),[parseValue(r[0],e,n),l]}/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/let KEY_PART_RE=/^[a-zA-Z0-9-_]+[ \t]*$/;function parseKey(e,n,t="="){let i=n-1,l=[],r=e.indexOf(t,n);if(r<0)throw new TomlError("incomplete key-value: cannot find end of key",{toml:e,ptr:n});do{let f=e[n=++i];if(f!==" "&&f!==" ")if(f==='"'||f==="'"){if(f===e[n+1]&&f===e[n+2])throw new TomlError("multiline strings are not allowed in keys",{toml:e,ptr:n});let o=getStringEnd(e,n);if(o<0)throw new TomlError("unfinished string encountered",{toml:e,ptr:n});i=e.indexOf(".",o);let a=e.slice(o,i<0||i>r?r:i),u=indexOfNewline(a);if(u>-1)throw new TomlError("newlines are not allowed in keys",{toml:e,ptr:n+i+u});if(a.trimStart())throw new TomlError("found extra tokens after the string part",{toml:e,ptr:o});if(r<o&&(r=e.indexOf(t,o),r<0))throw new TomlError("incomplete key-value: cannot find end of key",{toml:e,ptr:n});l.push(parseString(e,n,o))}else{i=e.indexOf(".",n);let o=e.slice(n,i<0||i>r?r:i);if(!KEY_PART_RE.test(o))throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:n});l.push(o.trimEnd())}}while(i+1&&i<r);return[l,skipVoid(e,r+1,!0,!0)]}function parseInlineTable(e,n){let t={},i=new Set,l,r=0;for(n++;(l=e[n++])!=="}"&&l;){if(l===`
`)throw new TomlError("newlines are not allowed in inline tables",{toml:e,ptr:n-1});if(l==="#")throw new TomlError("inline tables cannot contain comments",{toml:e,ptr:n-1});if(l===",")throw new TomlError("expected key-value, found comma",{toml:e,ptr:n-1});if(l!==" "&&l!==" "){let f,o=t,a=!1,[u,m]=parseKey(e,n-1);for(let y=0;y<u.length;y++){if(y&&(o=a?o[f]:o[f]={}),f=u[y],(a=Object.hasOwn(o,f))&&(typeof o[f]!="object"||i.has(o[f])))throw new TomlError("trying to redefine an already defined value",{toml:e,ptr:n});!a&&f==="__proto__"&&Object.defineProperty(o,f,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new TomlError("trying to redefine an already defined value",{toml:e,ptr:n});let[T,x]=extractValue(e,m,"}");i.add(T),o[f]=T,n=x,r=e[n-1]===","?n-1:0}}if(r)throw new TomlError("trailing commas are not allowed in inline tables",{toml:e,ptr:r});if(!l)throw new TomlError("unfinished table encountered",{toml:e,ptr:n});return[t,n]}function parseArray(e,n){let t=[],i;for(n++;(i=e[n++])!=="]"&&i;){if(i===",")throw new TomlError("expected value, found comma",{toml:e,ptr:n-1});if(i==="#")n=skipComment(e,n);else if(i!==" "&&i!==" "&&i!==`
`&&i!=="\r"){let l=extractValue(e,n-1,"]");t.push(l[0]),n=l[1]}}if(!i)throw new TomlError("unfinished array encountered",{toml:e,ptr:n});return[t,n]}/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/function peekTable(e,n,t,i){let l=n,r=t,f,o=!1,a;for(let u=0;u<e.length;u++){if(u){if(l=o?l[f]:l[f]={},r=(a=r[f]).c,i===0&&(a.t===1||a.t===2))return null;if(a.t===2){let m=l.length-1;l=l[m],r=r[m].c}}if(f=e[u],(o=Object.hasOwn(l,f))&&r[f]?.t===0&&r[f]?.d)return null;o||(f==="__proto__"&&(Object.defineProperty(l,f,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,f,{enumerable:!0,configurable:!0,writable:!0})),r[f]={t:u<e.length-1&&i===2?3:i,d:!1,i:0,c:{}})}if(a=r[f],a.t!==i&&!(i===1&&a.t===3)||(i===2&&(a.d||(a.d=!0,l[f]=[]),l[f].push(l={}),a.c[a.i++]=a={t:1,d:!1,i:0,c:{}}),a.d))return null;if(a.d=!0,i===1)l=o?l[f]:l[f]={};else if(i===0&&o)return null;return[f,l,a.c]}function parse(e){let n={},t={},i=n,l=t;for(let r=skipVoid(e,0);r<e.length;){if(e[r]==="["){let f=e[++r]==="[",o=parseKey(e,r+=+f,"]");if(f){if(e[o[1]-1]!=="]")throw new TomlError("expected end of table declaration",{toml:e,ptr:o[1]-1});o[1]++}let a=peekTable(o[0],n,t,f?2:1);if(!a)throw new TomlError("trying to redefine an already defined table or value",{toml:e,ptr:r});l=a[2],i=a[1],r=o[1]}else{let f=parseKey(e,r),o=peekTable(f[0],i,l,0);if(!o)throw new TomlError("trying to redefine an already defined table or value",{toml:e,ptr:r});let a=extractValue(e,f[1]);o[1][o[0]]=a[0],r=a[1]}if(r=skipVoid(e,r,!0),e[r]&&e[r]!==`
`&&e[r]!=="\r")throw new TomlError("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:r});r=skipVoid(e,r)}return n}/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
* 3. Neither the name of the copyright holder 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 HOLDER 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.
*/const BARE_KEY=/^[a-z0-9-_]+$/i;function extendedTypeOf(e){let n=typeof e;if(n==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return n}function isArrayOfTables(e){for(let n=0;n<e.length;n++)if(extendedTypeOf(e[n])!=="object")return!1;return e.length!=0}function formatString(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function stringifyValue(e,n=extendedTypeOf(e)){if(n==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":e.toString();if(n==="bigint"||n==="boolean")return e.toString();if(n==="string")return formatString(e);if(n==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(n==="object")return stringifyInlineTable(e);if(n==="array")return stringifyArray(e)}function stringifyInlineTable(e){let n=Object.keys(e);if(n.length===0)return"{}";let t="{ ";for(let i=0;i<n.length;i++){let l=n[i];i&&(t+=", "),t+=BARE_KEY.test(l)?l:formatString(l),t+=" = ",t+=stringifyValue(e[l])}return t+" }"}function stringifyArray(e){if(e.length===0)return"[]";let n="[ ";for(let t=0;t<e.length;t++){if(t&&(n+=", "),e[t]===null||e[t]===void 0)throw new TypeError("arrays cannot contain null or undefined values");n+=stringifyValue(e[t])}return n+" ]"}function stringifyArrayTable(e,n){let t="";for(let i=0;i<e.length;i++)t+=`[[${n}]]
`,t+=stringifyTable(e[i],n),t+=`
`;return t}function stringifyTable(e,n=""){let t="",i="",l=Object.keys(e);for(let r=0;r<l.length;r++){let f=l[r];if(e[f]!==null&&e[f]!==void 0){let o=extendedTypeOf(e[f]);if(o==="symbol"||o==="function")throw new TypeError(`cannot serialize values of type '${o}'`);let a=BARE_KEY.test(f)?f:formatString(f);if(o==="array"&&isArrayOfTables(e[f]))i+=stringifyArrayTable(e[f],n?`${n}.${a}`:a);else if(o==="object"){let u=n?`${n}.${a}`:a;i+=`[${u}]
`,i+=stringifyTable(e[f],u),i+=`
`}else t+=a,t+=" = ",t+=stringifyValue(e[f],o),t+=`
`}}return`${t}
${i}`.trim()}function stringify(e){if(extendedTypeOf(e)!=="object")throw new TypeError("stringify can only be called with an object");return stringifyTable(e)}function parseTOML(e){const n=parse(e);return _format.storeFormat(e,n,{preserveIndentation:!1}),n}function stringifyTOML(e){const n=_format.getFormat(e,{preserveIndentation:!1}),t=stringify(e);return n.whitespace.start+t+n.whitespace.end}exports.parseTOML=parseTOML,exports.stringifyTOML=stringifyTOML;
@@ -0,0 +1 @@
{"version":3,"file":"pin-off.js","sources":["../../../src/icons/pin-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PinOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTd2NSIgLz4KICA8cGF0aCBkPSJNMTUgOS4zNFY3YTEgMSAwIDAgMSAxLTEgMiAyIDAgMCAwIDAtNEg3Ljg5IiAvPgogIDxwYXRoIGQ9Im0yIDIgMjAgMjAiIC8+CiAgPHBhdGggZD0iTTkgOXYxLjc2YTIgMiAwIDAgMS0xLjExIDEuNzlsLTEuNzguOUEyIDIgMCAwIDAgNSAxNS4yNFYxNmExIDEgMCAwIDAgMSAxaDExIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/pin-off\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 PinOff = createLucideIcon('PinOff', [\n ['path', { d: 'M12 17v5', key: 'bb1du9' }],\n ['path', { d: 'M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89', key: 'znwnzq' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n [\n 'path',\n {\n d: 'M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11',\n key: 'c9qhm2',\n },\n ],\n]);\n\nexport default PinOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,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,CAA+C,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,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,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,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,344 @@
import { VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER } from './constants.js';
// port from nanoid
// https://github.com/ai/nanoid
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
function nanoid(size = 21) {
let id = "";
let i = size;
while (i--) {
id += urlAlphabet[Math.random() * 64 | 0];
}
return id;
}
const RealDate = Date;
function random(seed) {
const x = Math.sin(seed++) * 1e4;
return x - Math.floor(x);
}
function shuffle(array, seed = RealDate.now()) {
let length = array.length;
while (length) {
const index = Math.floor(random(seed) * length--);
const previous = array[length];
array[length] = array[index];
array[index] = previous;
++seed;
}
return array;
}
/**
* Get original stacktrace without source map support the most performant way.
* - Create only 1 stack frame.
* - Rewrite prepareStackTrace to bypass "support-stack-trace" (usually takes ~250ms).
*/
function createSimpleStackTrace(options) {
const { message = "$$stack trace error", stackTraceLimit = 1 } = options || {};
const limit = Error.stackTraceLimit;
const prepareStackTrace = Error.prepareStackTrace;
Error.stackTraceLimit = stackTraceLimit;
Error.prepareStackTrace = (e) => e.stack;
const err = new Error(message);
const stackTrace = err.stack || "";
Error.prepareStackTrace = prepareStackTrace;
Error.stackTraceLimit = limit;
return stackTrace;
}
function notNullish(v) {
return v != null;
}
function assertTypes(value, name, types) {
const receivedType = typeof value;
const pass = types.includes(receivedType);
if (!pass) {
throw new TypeError(`${name} value must be ${types.join(" or ")}, received "${receivedType}"`);
}
}
function isPrimitive(value) {
return value === null || typeof value !== "function" && typeof value !== "object";
}
function slash(path) {
return path.replace(/\\/g, "/");
}
const postfixRE = /[?#].*$/;
function cleanUrl(url) {
return url.replace(postfixRE, "");
}
function splitFileAndPostfix(path) {
const file = cleanUrl(path);
return {
file,
postfix: path.slice(file.length)
};
}
const externalRE = /^(?:[a-z]+:)?\/\//;
const isExternalUrl = (url) => externalRE.test(url);
/**
* Prepend `/@id/` and replace null byte so the id is URL-safe.
* This is prepended to resolved ids that are not valid browser
* import specifiers by the importAnalysis plugin.
*/
function wrapId(id) {
return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER);
}
/**
* Undo {@link wrapId}'s `/@id/` and null byte replacements.
*/
function unwrapId(id) {
return id.startsWith(VALID_ID_PREFIX) ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0") : id;
}
function withTrailingSlash(path) {
if (path.at(-1) !== "/") {
return `${path}/`;
}
return path;
}
function filterOutComments(s) {
const result = [];
let commentState = "none";
for (let i = 0; i < s.length; ++i) {
if (commentState === "singleline") {
if (s[i] === "\n") {
commentState = "none";
}
} else if (commentState === "multiline") {
if (s[i - 1] === "*" && s[i] === "/") {
commentState = "none";
}
} else if (commentState === "none") {
if (s[i] === "/" && s[i + 1] === "/") {
commentState = "singleline";
} else if (s[i] === "/" && s[i + 1] === "*") {
commentState = "multiline";
i += 2;
} else {
result.push(s[i]);
}
}
}
return result.join("");
}
const bareImportRE = /^(?![a-z]:)[\w@](?!.*:\/\/)/i;
function isBareImport(id) {
return bareImportRE.test(id);
}
function toArray(array) {
if (array === null || array === undefined) {
array = [];
}
if (Array.isArray(array)) {
return array;
}
return [array];
}
function isObject(item) {
return item != null && typeof item === "object" && !Array.isArray(item);
}
function isFinalObj(obj) {
return obj === Object.prototype || obj === Function.prototype || obj === RegExp.prototype;
}
function getType(value) {
return Object.prototype.toString.apply(value).slice(8, -1);
}
function collectOwnProperties(obj, collector) {
const collect = typeof collector === "function" ? collector : (key) => collector.add(key);
Object.getOwnPropertyNames(obj).forEach(collect);
Object.getOwnPropertySymbols(obj).forEach(collect);
}
function getOwnProperties(obj) {
const ownProps = new Set();
if (isFinalObj(obj)) {
return [];
}
collectOwnProperties(obj, ownProps);
return Array.from(ownProps);
}
const defaultCloneOptions = { forceWritable: false };
function deepClone(val, options = defaultCloneOptions) {
const seen = new WeakMap();
return clone(val, seen, options);
}
function clone(val, seen, options = defaultCloneOptions) {
let k, out;
if (seen.has(val)) {
return seen.get(val);
}
if (Array.isArray(val)) {
out = Array.from({ length: k = val.length });
seen.set(val, out);
while (k--) {
out[k] = clone(val[k], seen, options);
}
return out;
}
if (Object.prototype.toString.call(val) === "[object Object]") {
out = Object.create(Object.getPrototypeOf(val));
seen.set(val, out);
// we don't need properties from prototype
const props = getOwnProperties(val);
for (const k of props) {
const descriptor = Object.getOwnPropertyDescriptor(val, k);
if (!descriptor) {
continue;
}
const cloned = clone(val[k], seen, options);
if (options.forceWritable) {
Object.defineProperty(out, k, {
enumerable: descriptor.enumerable,
configurable: true,
writable: true,
value: cloned
});
} else if ("get" in descriptor) {
Object.defineProperty(out, k, {
...descriptor,
get() {
return cloned;
}
});
} else {
Object.defineProperty(out, k, {
...descriptor,
value: cloned
});
}
}
return out;
}
return val;
}
function noop() {}
function objectAttr(source, path, defaultValue = undefined) {
// a[3].b -> a.3.b
const paths = path.replace(/\[(\d+)\]/g, ".$1").split(".");
let result = source;
for (const p of paths) {
result = new Object(result)[p];
if (result === undefined) {
return defaultValue;
}
}
return result;
}
function createDefer() {
let resolve = null;
let reject = null;
const p = new Promise((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
});
p.resolve = resolve;
p.reject = reject;
return p;
}
/**
* If code starts with a function call, will return its last index, respecting arguments.
* This will return 25 - last ending character of toMatch ")"
* Also works with callbacks
* ```
* toMatch({ test: '123' });
* toBeAliased('123')
* ```
*/
function getCallLastIndex(code) {
let charIndex = -1;
let inString = null;
let startedBracers = 0;
let endedBracers = 0;
let beforeChar = null;
while (charIndex <= code.length) {
beforeChar = code[charIndex];
charIndex++;
const char = code[charIndex];
const isCharString = char === "\"" || char === "'" || char === "`";
if (isCharString && beforeChar !== "\\") {
if (inString === char) {
inString = null;
} else if (!inString) {
inString = char;
}
}
if (!inString) {
if (char === "(") {
startedBracers++;
}
if (char === ")") {
endedBracers++;
}
}
if (startedBracers && endedBracers && startedBracers === endedBracers) {
return charIndex;
}
}
return null;
}
function isNegativeNaN(val) {
if (!Number.isNaN(val)) {
return false;
}
const f64 = new Float64Array(1);
f64[0] = val;
const u32 = new Uint32Array(f64.buffer);
const isNegative = u32[1] >>> 31 === 1;
return isNegative;
}
function toString(v) {
return Object.prototype.toString.call(v);
}
function isPlainObject(val) {
return toString(val) === "[object Object]" && (!val.constructor || val.constructor.name === "Object");
}
function isMergeableObject(item) {
return isPlainObject(item) && !Array.isArray(item);
}
function ordinal(i) {
const j = i % 10;
const k = i % 100;
if (j === 1 && k !== 11) {
return `${i}st`;
}
if (j === 2 && k !== 12) {
return `${i}nd`;
}
if (j === 3 && k !== 13) {
return `${i}rd`;
}
return `${i}th`;
}
/**
* Deep merge :P
*
* Will merge objects only if they are plain
*
* Do not merge types - it is very expensive and usually it's better to case a type here
*/
function deepMerge(target, ...sources) {
if (!sources.length) {
return target;
}
const source = sources.shift();
if (source === undefined) {
return target;
}
if (isMergeableObject(target) && isMergeableObject(source)) {
Object.keys(source).forEach((key) => {
const _source = source;
if (isMergeableObject(_source[key])) {
if (!target[key]) {
target[key] = {};
}
deepMerge(target[key], _source[key]);
} else {
target[key] = _source[key];
}
});
}
return deepMerge(target, ...sources);
}
function unique(array) {
return Array.from(new Set(array));
}
export { assertTypes, cleanUrl, clone, createDefer, createSimpleStackTrace, deepClone, deepMerge, filterOutComments, getCallLastIndex, getOwnProperties, getType, isBareImport, isExternalUrl, isNegativeNaN, isObject, isPrimitive, nanoid, noop, notNullish, objectAttr, ordinal, shuffle, slash, splitFileAndPostfix, toArray, unique, unwrapId, withTrailingSlash, wrapId };
@@ -0,0 +1,665 @@
semver(1) -- The semantic versioner for npm
===========================================
## Install
```bash
npm install semver
````
## Usage
As a node module:
```js
const semver = require('semver')
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```
You can also just load the module for the function that you care about if
you'd like to minimize your footprint.
```js
// load the whole API at once in a single object
const semver = require('semver')
// or just load the bits you need
// all of them listed here, just pick and choose what you want
// classes
const SemVer = require('semver/classes/semver')
const Comparator = require('semver/classes/comparator')
const Range = require('semver/classes/range')
// functions for working with versions
const semverParse = require('semver/functions/parse')
const semverValid = require('semver/functions/valid')
const semverClean = require('semver/functions/clean')
const semverInc = require('semver/functions/inc')
const semverDiff = require('semver/functions/diff')
const semverMajor = require('semver/functions/major')
const semverMinor = require('semver/functions/minor')
const semverPatch = require('semver/functions/patch')
const semverPrerelease = require('semver/functions/prerelease')
const semverCompare = require('semver/functions/compare')
const semverRcompare = require('semver/functions/rcompare')
const semverCompareLoose = require('semver/functions/compare-loose')
const semverCompareBuild = require('semver/functions/compare-build')
const semverSort = require('semver/functions/sort')
const semverRsort = require('semver/functions/rsort')
// low-level comparators between versions
const semverGt = require('semver/functions/gt')
const semverLt = require('semver/functions/lt')
const semverEq = require('semver/functions/eq')
const semverNeq = require('semver/functions/neq')
const semverGte = require('semver/functions/gte')
const semverLte = require('semver/functions/lte')
const semverCmp = require('semver/functions/cmp')
const semverCoerce = require('semver/functions/coerce')
// working with ranges
const semverSatisfies = require('semver/functions/satisfies')
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
const semverMinSatisfying = require('semver/ranges/min-satisfying')
const semverToComparators = require('semver/ranges/to-comparators')
const semverMinVersion = require('semver/ranges/min-version')
const semverValidRange = require('semver/ranges/valid')
const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
const semverSimplifyRange = require('semver/ranges/simplify')
const semverRangeSubset = require('semver/ranges/subset')
```
As a command-line utility:
```
$ semver -h
A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter
Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence
Options:
-r --range <range>
Print versions that match the specified range.
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, prerelease, or release. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
-l --loose
Interpret versions and ranges loosely
-n <0|1|false>
Base number for prerelease identifier (default: 0).
Use false to omit the number altogether.
-p --include-prerelease
Always include prerelease versions in range matching
-c --coerce
Coerce a string into SemVer if possible
(does not imply --loose)
--rtl
Coerce version strings right to left
--ltr
Coerce version strings left to right (default)
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```
## Versions
A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.
A leading `"="` or `"v"` character is stripped off and ignored.
Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer
specification but should not be used anymore.
## Ranges
A `version range` is a set of `comparators` that specify versions
that satisfy the range.
A `comparator` is composed of an `operator` and a `version`. The set
of primitive `operators` is:
* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal. If no operator is specified, then equality is assumed,
so this operator is optional but MAY be included.
For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
would match the versions `2.0.0` and `3.1.0`, but not the versions
`1.0.1` or `1.1.0`.
Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.
A range is composed of one or more comparator sets, joined by `||`. A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.
For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
### Prerelease Tags
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.
For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
range only accepts prerelease tags on the `1.2.3` version.
Version `3.4.5` *would* satisfy the range because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
The purpose of this behavior is twofold. First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range-matching
semantics.
Second, a user who has opted into using a prerelease version has
indicated the intent to use *that specific* set of
alpha/beta/rc versions. By including a prerelease tag in the range,
the user is indicating that they are aware of the risk. However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.
Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for range-matching)
by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.
#### Prerelease Identifiers
The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:
```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```
Which then can be used to increment further:
```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```
To get out of the prerelease phase, use the `release` option:
```bash
$ semver 1.2.4-beta.1 -i release
1.2.4
```
#### Prerelease Identifier Base
The method `.inc` takes an optional parameter 'identifierBase' string
that will let you let your prerelease number as zero-based or one-based.
Set to `false` to omit the prerelease number altogether.
If you do not specify this parameter, it will default to zero-based.
```javascript
semver.inc('1.2.3', 'prerelease', 'beta', '1')
// '1.2.4-beta.1'
```
```javascript
semver.inc('1.2.3', 'prerelease', 'beta', false)
// '1.2.4-beta'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta -n 1
1.2.4-beta.1
```
```bash
$ semver 1.2.3 -i prerelease --preid beta -n false
1.2.4-beta
```
### Advanced Range Syntax
Advanced range syntax desugars to primitive comparators in
deterministic ways.
Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.
#### Hyphen Ranges `X.Y.Z - A.B.C`
Specifies an inclusive set.
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
`includePrerelease` is specified, in which case any version at all
satisfies)
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
Allows changes that do not modify the left-most non-zero element in the
`[major, minor, patch]` tuple. In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.
Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
* `^0.0` := `>=0.0.0 <0.1.0-0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
* `^1.x` := `>=1.0.0 <2.0.0-0`
* `^0.x` := `>=0.0.0 <1.0.0-0`
### Range Grammar
Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:
```bnf
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
```
## Functions
All methods and classes take a final `options` object argument. All
options in this object are `false` by default. The options supported
are:
- `loose`: Be more forgiving about not-quite-valid semver strings.
(Any resulting output will always be 100% strict compliant, of
course.) For backwards compatibility reasons, if the `options`
argument is a boolean value instead of an object, it is interpreted
to be the `loose` param.
- `includePrerelease`: Set to suppress the [default
behavior](https://github.com/npm/node-semver#prerelease-tags) of
excluding prerelease tagged versions from ranges unless they are
explicitly opted into.
Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.
* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, releaseType, options, identifier, identifierBase)`:
Return the version incremented by the release
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
`prepatch`, `prerelease`, or `release`), or null if it's not valid
* `premajor` in one call will bump the version up to the next major
version and down to a prerelease of that major version.
`preminor`, and `prepatch` work the same way.
* If called from a non-prerelease version, `prerelease` will work the
same as `prepatch`. It increments the patch version and then makes a
prerelease. If the input version is already a prerelease it simply
increments it.
* `release` will remove any prerelease part of the version.
* `identifier` can be used to prefix `premajor`, `preminor`,
`prepatch`, or `prerelease` version increments. `identifierBase`
is the base to be used for the `prerelease` identifier.
* `prerelease(v)`: Returns an array of prerelease components, or null
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
a `SemVer` object or `null`.
### Comparison
* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
even if they're not the same string. You already know how to
compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
the corresponding function above. `"==="` and `"!=="` do simple
string comparison, but are included for completeness. Throws if an
invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions
in descending order when passed to `Array.sort()`.
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
are equal. Sorts in ascending order if passed to `Array.sort()`.
* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
* `diff(v1, v2)`: Returns the difference between two versions by the release type
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
or null if the versions are the same.
### Sorting
* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild`
function.
* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
the `compareBuild` function in descending order.
### Comparators
* `intersects(comparator)`: Return true if the comparators intersect
### Ranges
* `validRange(range)`: Return the valid range or null if it's not valid.
* `satisfies(version, range)`: Return true if the version satisfies the
range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can match
the given range.
* `gtr(version, range)`: Return `true` if the version is greater than all the
versions possible in the range.
* `ltr(version, range)`: Return `true` if the version is less than all the
versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
the bounds of the range in either the high or low direction. The
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the range comparators intersect.
* `simplifyRange(versions, range)`: Return a "simplified" range that
matches the same items in the `versions` list as the range specified. Note
that it does *not* guarantee that it would match the same versions in all
cases, only for the set of versions provided. This is useful when
generating ranges by joining together multiple versions with `||`
programmatically, to provide the user with something a bit more
ergonomic. If the provided range is shorter in string-length than the
generated range, then that is returned.
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
entirely contained by the `superRange` range.
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.
If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.
### Coercion
* `coerce(version, options)`: Coerces a string to semver if possible
This aims to provide a very forgiving translation of a non-semver string to
semver. It looks for the first digit in a string and consumes all
remaining characters which satisfy at least a partial semver (e.g., `1`,
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
is not valid). The maximum length for any semver component considered for
coercion is 16 characters; longer components will be ignored
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
components are invalid (`9999999999999999.4.7.4` is likely invalid).
If the `options.rtl` flag is set, then `coerce` will return the right-most
coercible tuple that does not share an ending index with a longer coercible
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
any other overlapping SemVer tuple.
If the `options.includePrerelease` flag is set, then the `coerce` result will contain
prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2`
will preserve prerelease `rc.1` and build `rev.2` in the result.
### Clean
* `clean(version)`: Clean a string to be a valid semver if possible
This will return a cleaned and trimmed semver version. If the provided
version is not valid a null will be returned. This does not work for
ranges.
ex.
* `s.clean(' = v 2.1.5foo')`: `null`
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean(' = v 2.1.5-foo')`: `null`
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean('=v2.1.5')`: `'2.1.5'`
* `s.clean(' =v2.1.5')`: `'2.1.5'`
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
* `s.clean('~1.0.0')`: `null`
## Constants
As a convenience, helper constants are exported to provide information about what `node-semver` supports:
### `RELEASE_TYPES`
- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease
```
const semver = require('semver');
if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
console.log('This is a valid release type!');
} else {
console.warn('This is NOT a valid release type!');
}
```
### `SEMVER_SPEC_VERSION`
2.0.0
```
const semver = require('semver');
console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
```
## Exported Modules
<!--
TODO: Make sure that all of these items are documented (classes aren't,
eg), and then pull the module name into the documentation for that specific
thing.
-->
You may pull in just the part of this semver utility that you need if you
are sensitive to packing and tree-shaking concerns. The main
`require('semver')` export uses getter functions to lazily load the parts
of the API that are used.
The following modules are available:
* `require('semver')`
* `require('semver/classes')`
* `require('semver/classes/comparator')`
* `require('semver/classes/range')`
* `require('semver/classes/semver')`
* `require('semver/functions/clean')`
* `require('semver/functions/cmp')`
* `require('semver/functions/coerce')`
* `require('semver/functions/compare')`
* `require('semver/functions/compare-build')`
* `require('semver/functions/compare-loose')`
* `require('semver/functions/diff')`
* `require('semver/functions/eq')`
* `require('semver/functions/gt')`
* `require('semver/functions/gte')`
* `require('semver/functions/inc')`
* `require('semver/functions/lt')`
* `require('semver/functions/lte')`
* `require('semver/functions/major')`
* `require('semver/functions/minor')`
* `require('semver/functions/neq')`
* `require('semver/functions/parse')`
* `require('semver/functions/patch')`
* `require('semver/functions/prerelease')`
* `require('semver/functions/rcompare')`
* `require('semver/functions/rsort')`
* `require('semver/functions/satisfies')`
* `require('semver/functions/sort')`
* `require('semver/functions/valid')`
* `require('semver/ranges/gtr')`
* `require('semver/ranges/intersects')`
* `require('semver/ranges/ltr')`
* `require('semver/ranges/max-satisfying')`
* `require('semver/ranges/min-satisfying')`
* `require('semver/ranges/min-version')`
* `require('semver/ranges/outside')`
* `require('semver/ranges/simplify')`
* `require('semver/ranges/subset')`
* `require('semver/ranges/to-comparators')`
* `require('semver/ranges/valid')`
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-extra-non-null-assertion',
meta: {
type: 'problem',
docs: {
description: 'Disallow extra non-null assertions',
recommended: 'recommended',
},
fixable: 'code',
messages: {
noExtraNonNullAssertion: 'Forbidden extra non-null assertion.',
},
schema: [],
},
defaultOptions: [],
create(context) {
function checkExtraNonNullAssertion(node) {
context.report({
node,
messageId: 'noExtraNonNullAssertion',
fix(fixer) {
return fixer.removeRange([node.range[1] - 1, node.range[1]]);
},
});
}
return {
'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
};
},
});
@@ -0,0 +1,67 @@
'use strict'
let Document = require('./document')
let LazyResult = require('./lazy-result')
let NoWorkResult = require('./no-work-result')
let Root = require('./root')
class Processor {
constructor(plugins = []) {
this.version = '8.5.27'
this.plugins = this.normalize(plugins)
}
normalize(plugins) {
let normalized = []
for (let i of plugins) {
if (i.postcss === true) {
i = i()
} else if (i.postcss) {
i = i.postcss
}
if (typeof i === 'object' && Array.isArray(i.plugins)) {
normalized = normalized.concat(i.plugins)
} else if (typeof i === 'object' && i.postcssPlugin) {
normalized.push(i)
} else if (typeof i === 'function') {
normalized.push(i)
} else if (typeof i === 'object' && (i.parse || i.stringify)) {
if (process.env.NODE_ENV !== 'production') {
throw new Error(
'PostCSS syntaxes cannot be used as plugins. Instead, please use ' +
'one of the syntax/parser/stringifier options as outlined ' +
'in your PostCSS runner documentation.'
)
}
} else {
throw new Error(i + ' is not a PostCSS plugin')
}
}
return normalized
}
process(css, opts = {}) {
if (
!this.plugins.length &&
!opts.parser &&
!opts.stringifier &&
!opts.syntax
) {
return new NoWorkResult(this, css, opts)
} else {
return new LazyResult(this, css, opts)
}
}
use(plugin) {
this.plugins = this.plugins.concat(this.normalize([plugin]))
return this
}
}
module.exports = Processor
Processor.default = Processor
Root.registerProcessor(Processor)
Document.registerProcessor(Processor)
@@ -0,0 +1 @@
{"version":3,"file":"AsyncMotionValueAnimation.mjs","sources":["../../../src/animation/AsyncMotionValueAnimation.ts"],"sourcesContent":["import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes<T extends AnyResolvedKeyframe> = Omit<\n ValueAnimationOptions<T>,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation<T extends AnyResolvedKeyframe>\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions<T>) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes<T> = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes<T>,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false\n\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLLine truncated
@@ -0,0 +1,21 @@
/**
* @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 ReceiptIndianRupee = createLucideIcon("ReceiptIndianRupee", [
[
"path",
{ d: "M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z", key: "q3az6g" }
],
["path", { d: "M8 7h8", key: "i86dvs" }],
["path", { d: "M12 17.5 8 15h1a4 4 0 0 0 0-8", key: "grpkl4" }],
["path", { d: "M8 11h8", key: "vwpz6n" }]
]);
export { ReceiptIndianRupee as default };
//# sourceMappingURL=receipt-indian-rupee.js.map
@@ -0,0 +1,19 @@
import { circInOut, backInOut, anticipate } from 'motion-utils';
const unsupportedEasingFunctions = {
anticipate,
backInOut,
circInOut,
};
function isUnsupportedEase(key) {
return key in unsupportedEasingFunctions;
}
function replaceStringEasing(transition) {
if (typeof transition.ease === "string" &&
isUnsupportedEase(transition.ease)) {
transition.ease = unsupportedEasingFunctions[transition.ease];
}
}
export { replaceStringEasing };
//# sourceMappingURL=unsupported-easing.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAsBA,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,aAAa,QAAwB;IACrC,UAAU,MAAwB;CACrC;AAuCD,oBAAY,YAAY;IACpB,8DAA8D;IAC9D,MAAM,IAAI;IACV,uDAAuD;IACvD,MAAM,IAAI;IACV,oEAAoE;IACpE,SAAS,IAAI;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,uCAAuC,IAAI,IAAI,CAAC;IAChD,0CAA0C,CACtC,kBAAkB,EAAE,MAAM,GAC3B,IAAI,CAAC;IACR,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzD;AAED;;GAEG;AACH,qBAAa,aAAa;IAElB,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;;IAbxB,wCAAwC;IACvB,UAAU,EAAE,WAAW;IACxC;;;;;;;;OAQG;IACc,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI;IACtE,gDAAgD;IAC/B,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS;IAG7D,wCAAwC;IACxC,OAAO,CAAC,KAAK,CAAkC;IAC/C,6DAA6D;IAC7D,OAAO,CAAC,QAAQ,CAAK;IACrB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAK;IAEnB,4CAA4C;IAC5C,OAAO,CAAC,SAAS,CAAK;IACtB,6DAA6D;IAC7D,OAAO,CAAC,MAAM,CAAK;IACnB,kDAAkD;IAClD,OAAO,CAAC,UAAU,CAAuB;IAEzC,+CAA+C;IAC/C,WAAW,CAAC,UAAU,EAAE,YAAY,GAAG,IAAI;IAS3C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IA8B5C;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,kBAAkB;IAe1B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAkB3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,YAAkC,GACzC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAGD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EACH,eAAe,EACf,gBAAgB,EAChB,aAAa,GAChB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,357 @@
"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 _isAsyncOperation = require('./util/isAsyncOperation'); var _isAsyncOperation2 = _interopRequireDefault(_isAsyncOperation);
class TokenProcessor {
__init() {this.resultCode = ""}
// Array mapping input token index to optional string index position in the
// output code.
__init2() {this.resultMappings = new Array(this.tokens.length)}
__init3() {this.tokenIndex = 0}
constructor(
code,
tokens,
isFlowEnabled,
disableESTransforms,
helperManager,
) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);}
/**
* Snapshot the token state in a way that can be restored later, useful for
* things like lookahead.
*
* resultMappings do not need to be copied since in all use cases, they will
* be overwritten anyway after restore.
*/
snapshot() {
return {
resultCode: this.resultCode,
tokenIndex: this.tokenIndex,
};
}
restoreToSnapshot(snapshot) {
this.resultCode = snapshot.resultCode;
this.tokenIndex = snapshot.tokenIndex;
}
/**
* Remove and return the code generated since the snapshot, leaving the
* current token position in-place. Unlike most TokenProcessor operations,
* this operation can result in input/output line number mismatches because
* the removed code may contain newlines, so this operation should be used
* sparingly.
*/
dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) {
const result = this.resultCode.slice(snapshot.resultCode.length);
this.resultCode = snapshot.resultCode;
return result;
}
reset() {
this.resultCode = "";
this.resultMappings = new Array(this.tokens.length);
this.tokenIndex = 0;
}
matchesContextualAtIndex(index, contextualKeyword) {
return (
this.matches1AtIndex(index, _types.TokenType.name) &&
this.tokens[index].contextualKeyword === contextualKeyword
);
}
identifierNameAtIndex(index) {
// TODO: We need to process escapes since technically you can have unicode escapes in variable
// names.
return this.identifierNameForToken(this.tokens[index]);
}
identifierNameAtRelativeIndex(relativeIndex) {
return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex));
}
identifierName() {
return this.identifierNameForToken(this.currentToken());
}
identifierNameForToken(token) {
return this.code.slice(token.start, token.end);
}
rawCodeForToken(token) {
return this.code.slice(token.start, token.end);
}
stringValueAtIndex(index) {
return this.stringValueForToken(this.tokens[index]);
}
stringValue() {
return this.stringValueForToken(this.currentToken());
}
stringValueForToken(token) {
// This is used to identify when two imports are the same and to resolve TypeScript enum keys.
// Ideally we'd process escapes within the strings, but for now we pretty much take the raw
// code.
return this.code.slice(token.start + 1, token.end - 1);
}
matches1AtIndex(index, t1) {
return this.tokens[index].type === t1;
}
matches2AtIndex(index, t1, t2) {
return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2;
}
matches3AtIndex(index, t1, t2, t3) {
return (
this.tokens[index].type === t1 &&
this.tokens[index + 1].type === t2 &&
this.tokens[index + 2].type === t3
);
}
matches1(t1) {
return this.tokens[this.tokenIndex].type === t1;
}
matches2(t1, t2) {
return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2;
}
matches3(t1, t2, t3) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3
);
}
matches4(t1, t2, t3, t4) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3 &&
this.tokens[this.tokenIndex + 3].type === t4
);
}
matches5(t1, t2, t3, t4, t5) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3 &&
this.tokens[this.tokenIndex + 3].type === t4 &&
this.tokens[this.tokenIndex + 4].type === t5
);
}
matchesContextual(contextualKeyword) {
return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword);
}
matchesContextIdAndLabel(type, contextId) {
return this.matches1(type) && this.currentToken().contextId === contextId;
}
previousWhitespaceAndComments() {
let whitespaceAndComments = this.code.slice(
this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0,
this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length,
);
if (this.isFlowEnabled) {
whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, "");
}
return whitespaceAndComments;
}
replaceToken(newCode) {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += newCode;
this.appendTokenSuffix();
this.tokenIndex++;
}
replaceTokenTrimmingLeftWhitespace(newCode) {
this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, "");
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += newCode;
this.appendTokenSuffix();
this.tokenIndex++;
}
removeInitialToken() {
this.replaceToken("");
}
removeToken() {
this.replaceTokenTrimmingLeftWhitespace("");
}
/**
* Remove all code until the next }, accounting for balanced braces.
*/
removeBalancedCode() {
let braceDepth = 0;
while (!this.isAtEnd()) {
if (this.matches1(_types.TokenType.braceL)) {
braceDepth++;
} else if (this.matches1(_types.TokenType.braceR)) {
if (braceDepth === 0) {
return;
}
braceDepth--;
}
this.removeToken();
}
}
copyExpectedToken(tokenType) {
if (this.tokens[this.tokenIndex].type !== tokenType) {
throw new Error(`Expected token ${tokenType}`);
}
this.copyToken();
}
copyToken() {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += this.code.slice(
this.tokens[this.tokenIndex].start,
this.tokens[this.tokenIndex].end,
);
this.appendTokenSuffix();
this.tokenIndex++;
}
copyTokenWithPrefix(prefix) {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultCode += prefix;
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += this.code.slice(
this.tokens[this.tokenIndex].start,
this.tokens[this.tokenIndex].end,
);
this.appendTokenSuffix();
this.tokenIndex++;
}
appendTokenPrefix() {
const token = this.currentToken();
if (token.numNullishCoalesceStarts || token.isOptionalChainStart) {
token.isAsyncOperation = _isAsyncOperation2.default.call(void 0, this);
}
if (this.disableESTransforms) {
return;
}
if (token.numNullishCoalesceStarts) {
for (let i = 0; i < token.numNullishCoalesceStarts; i++) {
if (token.isAsyncOperation) {
this.resultCode += "await ";
this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce");
} else {
this.resultCode += this.helperManager.getHelperName("nullishCoalesce");
}
this.resultCode += "(";
}
}
if (token.isOptionalChainStart) {
if (token.isAsyncOperation) {
this.resultCode += "await ";
}
if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === _types.TokenType._delete) {
if (token.isAsyncOperation) {
this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete");
} else {
this.resultCode += this.helperManager.getHelperName("optionalChainDelete");
}
} else if (token.isAsyncOperation) {
this.resultCode += this.helperManager.getHelperName("asyncOptionalChain");
} else {
this.resultCode += this.helperManager.getHelperName("optionalChain");
}
this.resultCode += "([";
}
}
appendTokenSuffix() {
const token = this.currentToken();
if (token.isOptionalChainEnd && !this.disableESTransforms) {
this.resultCode += "])";
}
if (token.numNullishCoalesceEnds && !this.disableESTransforms) {
for (let i = 0; i < token.numNullishCoalesceEnds; i++) {
this.resultCode += "))";
}
}
}
appendCode(code) {
this.resultCode += code;
}
currentToken() {
return this.tokens[this.tokenIndex];
}
currentTokenCode() {
const token = this.currentToken();
return this.code.slice(token.start, token.end);
}
tokenAtRelativeIndex(relativeIndex) {
return this.tokens[this.tokenIndex + relativeIndex];
}
currentIndex() {
return this.tokenIndex;
}
/**
* Move to the next token. Only suitable in preprocessing steps. When
* generating new code, you should use copyToken or removeToken.
*/
nextToken() {
if (this.tokenIndex === this.tokens.length) {
throw new Error("Unexpectedly reached end of input.");
}
this.tokenIndex++;
}
previousToken() {
this.tokenIndex--;
}
finish() {
if (this.tokenIndex !== this.tokens.length) {
throw new Error("Tried to finish processing tokens before reaching the end.");
}
this.resultCode += this.previousWhitespaceAndComments();
return {code: this.resultCode, mappings: this.resultMappings};
}
isAtEnd() {
return this.tokenIndex === this.tokens.length;
}
} exports.default = TokenProcessor;
@@ -0,0 +1,32 @@
export {};
import { webcrypto } from "crypto";
declare global {
var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : {
prototype: webcrypto.Crypto;
new(): webcrypto.Crypto;
};
var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : {
prototype: webcrypto.CryptoKey;
new(): webcrypto.CryptoKey;
};
var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : {
prototype: webcrypto.SubtleCrypto;
new(): webcrypto.SubtleCrypto;
supports(
operation: string,
algorithm: webcrypto.AlgorithmIdentifier,
length?: number,
): boolean;
supports(
operation: string,
algorithm: webcrypto.AlgorithmIdentifier,
additionalAlgorithm: webcrypto.AlgorithmIdentifier,
): boolean;
};
var crypto: typeof globalThis extends { onmessage: any; crypto: infer T } ? T : webcrypto.Crypto;
}
@@ -0,0 +1 @@
import{i as a}from"./chunk-TDNFF6A4.mjs";import"./chunk-X4GG3EDV.mjs";export{a as default};
@@ -0,0 +1,270 @@
import { useRouter } from "./useRouter.js";
import { deepEqual, escapeHtml, getAssetCrossOrigin, isInlinableStylesheet, resolveManifestAssetLink } from "@tanstack/router-core";
import * as React$1 from "react";
import { useStore } from "@tanstack/react-store";
import { isServer } from "@tanstack/router-core/isServer";
//#region src/headContentUtils.tsx
function buildTagsFromMatches(router, nonce, matches, assetCrossOrigin) {
const routeMeta = matches.map((match) => match.meta).filter(Boolean);
const resultMeta = [];
const metaByAttribute = {};
let title;
for (let i = routeMeta.length - 1; i >= 0; i--) {
const metas = routeMeta[i];
for (let j = metas.length - 1; j >= 0; j--) {
const m = metas[j];
if (!m) continue;
if (m.title) {
if (!title) title = {
tag: "title",
children: m.title
};
} else if ("script:ld+json" in m) try {
const json = JSON.stringify(m["script:ld+json"]);
resultMeta.push({
tag: "script",
attrs: { type: "application/ld+json" },
children: escapeHtml(json)
});
} catch {}
else {
const attribute = m.name ?? m.property;
if (attribute) if (metaByAttribute[attribute]) continue;
else metaByAttribute[attribute] = true;
resultMeta.push({
tag: "meta",
attrs: {
...m,
nonce
}
});
}
}
}
if (title) resultMeta.push(title);
if (nonce) resultMeta.push({
tag: "meta",
attrs: {
property: "csp-nonce",
content: nonce
}
});
resultMeta.reverse();
const constructedLinks = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
tag: "link",
attrs: {
...link,
nonce
}
}));
const manifest = router.ssr?.manifest;
const assetLinks = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).flatMap((asset) => {
if (asset.tag === "link") {
if (isInlinableStylesheet(manifest, asset)) return [];
return [{
tag: "link",
attrs: {
...asset.attrs,
crossOrigin: getAssetCrossOrigin(assetCrossOrigin, "stylesheet") ?? asset.attrs?.crossOrigin,
suppressHydrationWarning: true,
nonce
}
}];
}
if (asset.tag === "style") return [{
tag: "style",
attrs: {
...asset.attrs,
nonce
},
children: asset.children,
...asset.inlineCss ? { inlineCss: true } : {}
}];
return [];
});
const preloadLinks = [];
matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
const preloadLink = resolveManifestAssetLink(preload);
preloadLinks.push({
tag: "link",
attrs: {
rel: "modulepreload",
href: preloadLink.href,
crossOrigin: getAssetCrossOrigin(assetCrossOrigin, "modulepreload") ?? preloadLink.crossOrigin,
nonce
}
});
}));
const styles = matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({
tag: "style",
attrs: {
...attrs,
nonce
},
children
}));
const headScripts = matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
tag: "script",
attrs: {
...script,
nonce
},
children
}));
return uniqBy([
...resultMeta,
...preloadLinks,
...constructedLinks,
...assetLinks,
...styles,
...headScripts
], (d) => JSON.stringify(d));
}
/**
* Build the list of head/link/meta/script tags to render for active matches.
* Used internally by `HeadContent`.
*/
var useTags = (assetCrossOrigin) => {
const router = useRouter();
const nonce = router.options.ssr?.nonce;
if (isServer ?? router.isServer) return buildTagsFromMatches(router, nonce, router.stores.matches.get(), assetCrossOrigin);
const routeMeta = useStore(router.stores.matches, (matches) => {
return matches.map((match) => match.meta).filter(Boolean);
}, deepEqual);
const meta = React$1.useMemo(() => {
const resultMeta = [];
const metaByAttribute = {};
let title;
for (let i = routeMeta.length - 1; i >= 0; i--) {
const metas = routeMeta[i];
for (let j = metas.length - 1; j >= 0; j--) {
const m = metas[j];
if (!m) continue;
if (m.title) {
if (!title) title = {
tag: "title",
children: m.title
};
} else if ("script:ld+json" in m) try {
const json = JSON.stringify(m["script:ld+json"]);
resultMeta.push({
tag: "script",
attrs: { type: "application/ld+json" },
children: escapeHtml(json)
});
} catch {}
else {
const attribute = m.name ?? m.property;
if (attribute) if (metaByAttribute[attribute]) continue;
else metaByAttribute[attribute] = true;
resultMeta.push({
tag: "meta",
attrs: {
...m,
nonce
}
});
}
}
}
if (title) resultMeta.push(title);
if (nonce) resultMeta.push({
tag: "meta",
attrs: {
property: "csp-nonce",
content: nonce
}
});
resultMeta.reverse();
return resultMeta;
}, [routeMeta, nonce]);
const links = useStore(router.stores.matches, (matches) => {
const constructed = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
tag: "link",
attrs: {
...link,
nonce
}
}));
const manifest = router.ssr?.manifest;
const assets = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).flatMap((asset) => {
if (asset.tag === "link") {
if (isInlinableStylesheet(manifest, asset)) return [];
return [{
tag: "link",
attrs: {
...asset.attrs,
crossOrigin: getAssetCrossOrigin(assetCrossOrigin, "stylesheet") ?? asset.attrs?.crossOrigin,
suppressHydrationWarning: true,
nonce
}
}];
}
if (asset.tag === "style") return [{
tag: "style",
attrs: {
...asset.attrs,
nonce
},
children: asset.children,
...asset.inlineCss ? { inlineCss: true } : {}
}];
return [];
});
return [...constructed, ...assets];
}, deepEqual);
const preloadLinks = useStore(router.stores.matches, (matches) => {
const preloadLinks = [];
matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
const preloadLink = resolveManifestAssetLink(preload);
preloadLinks.push({
tag: "link",
attrs: {
rel: "modulepreload",
href: preloadLink.href,
crossOrigin: getAssetCrossOrigin(assetCrossOrigin, "modulepreload") ?? preloadLink.crossOrigin,
nonce
}
});
}));
return preloadLinks;
}, deepEqual);
const styles = useStore(router.stores.matches, (matches) => matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({
tag: "style",
attrs: {
...attrs,
nonce
},
children
})), deepEqual);
const headScripts = useStore(router.stores.matches, (matches) => matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
tag: "script",
attrs: {
...script,
nonce
},
children
})), deepEqual);
return uniqBy([
...meta,
...preloadLinks,
...links,
...styles,
...headScripts
], (d) => {
return JSON.stringify(d);
});
};
function uniqBy(arr, fn) {
const seen = /* @__PURE__ */ new Set();
return arr.filter((item) => {
const key = fn(item);
if (seen.has(key)) return false;
seen.add(key);
return true;
});
}
//#endregion
export { useTags };
//# sourceMappingURL=headContentUtils.js.map
@@ -0,0 +1 @@
{"version":3,"file":"tangent.js","sources":["../../../src/icons/tangent.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Tangent\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxNyIgY3k9IjQiIHI9IjIiIC8+CiAgPHBhdGggZD0iTTE1LjU5IDUuNDEgNS40MSAxNS41OSIgLz4KICA8Y2lyY2xlIGN4PSI0IiBjeT0iMTciIHI9IjIiIC8+CiAgPHBhdGggZD0iTTEyIDIycy00LTktMS41LTExLjVTMjIgMTIgMjIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/tangent\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 Tangent = createLucideIcon('Tangent', [\n ['circle', { cx: '17', cy: '4', r: '2', key: 'y5j2s2' }],\n ['path', { d: 'M15.59 5.41 5.41 15.59', key: 'l0vprr' }],\n ['circle', { cx: '4', cy: '17', r: '2', key: '9p4efm' }],\n ['path', { d: 'M12 22s-4-9-1.5-11.5S22 12 22 12', key: '1twk4o' }],\n]);\n\nexport default Tangent;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,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,CACvD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoC,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;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,57 @@
import { S as Suite, c as File, e as Task, a1 as TestTagDefinition, a5 as VitestRunnerConfig, a as Test } from './tasks.d-DEYaIMIu.js';
export { ag as ChainableFunction, ah as createChainable } from './tasks.d-DEYaIMIu.js';
import { ParsedStack, Arrayable } from '@vitest/utils';
import '@vitest/utils/diff';
/**
* If any tasks been marked as `only`, mark all other tasks as `skip`.
*/
declare function interpretTaskModes(file: Suite, namePattern?: string | RegExp, testLocations?: number[] | undefined, testIds?: string[] | undefined, testTagsFilter?: ((testTags: string[]) => boolean) | undefined, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean): void;
declare function someTasksAreOnly(suite: Suite): boolean;
declare function generateHash(str: string): string;
declare function calculateSuiteHash(parent: Suite): void;
declare function createFileTask(filepath: string, root: string, projectName: string | undefined, pool?: string, viteEnvironment?: string): File;
/**
* Generate a unique ID for a file based on its path and project name
* @param file File relative to the root of the project to keep ID the same between different machines
* @param projectName The name of the test project
*/
declare function generateFileHash(file: string, projectName: string | undefined): string;
declare function findTestFileStackTrace(testFilePath: string, error: string): ParsedStack | undefined;
interface ConcurrencyLimiter extends ConcurrencyLimiterFn {
acquire: () => (() => void) | Promise<() => void>;
}
type ConcurrencyLimiterFn = <
Args extends unknown[],
T
>(func: (...args: Args) => PromiseLike<T> | T, ...args: Args) => Promise<T>;
/**
* Return a function for running multiple async operations with limited concurrency.
*/
declare function limitConcurrency(concurrency?: number): ConcurrencyLimiter;
/**
* Partition in tasks groups by consecutive concurrent
*/
declare function partitionSuiteChildren(suite: Suite): Task[][];
/**
* @experimental
*/
declare function matchesTags(testTags: string[]): boolean;
declare function validateTags(config: VitestRunnerConfig, tags: string[]): void;
declare function createTagsFilter(tagsExpr: string[], availableTags: TestTagDefinition[]): (testTags: string[]) => boolean;
declare function isTestCase(s: Task): s is Test;
declare function getTests(suite: Arrayable<Task>): Test[];
declare function getTasks(tasks?: Arrayable<Task>): Task[];
declare function getSuites(suite: Arrayable<Task>): Suite[];
declare function hasTests(suite: Arrayable<Suite>): boolean;
declare function hasFailed(suite: Arrayable<Task>): boolean;
declare function getNames(task: Task): string[];
declare function getFullName(task: Task, separator?: string): string;
declare function getTestName(task: Task, separator?: string): string;
declare function createTaskName(names: readonly (string | undefined)[], separator?: string): string;
export { calculateSuiteHash, createFileTask, createTagsFilter, createTaskName, findTestFileStackTrace, generateFileHash, generateHash, getFullName, getNames, getSuites, getTasks, getTestName, getTests, hasFailed, hasTests, interpretTaskModes, isTestCase, limitConcurrency, matchesTags, partitionSuiteChildren, someTasksAreOnly, validateTags };
@@ -0,0 +1,89 @@
# exponential-backoff
A utility that allows retrying a function with an exponential delay between attempts.
## Installation
```
npm i exponential-backoff
```
## Usage
The `backOff<T>` function takes a promise-returning function to retry, and an optional `BackOffOptions` object. It returns a `Promise<T>`.
```ts
function backOff<T>(
request: () => Promise<T>,
options?: BackOffOptions
): Promise<T>;
```
Here is an example retrying a function that calls a hypothetical weather endpoint:
```js
import { backOff } from "exponential-backoff";
function getWeather() {
return fetch("weather-endpoint");
}
async function main() {
try {
const response = await backOff(() => getWeather());
// process response
} catch (e) {
// handle error
}
}
main();
```
Migrating across major versions? Here are our [breaking changes](https://github.com/coveo/exponential-backoff/tree/master/doc/migration-guide.md).
### `BackOffOptions`
- `delayFirstAttempt?: boolean`
Decides whether the `startingDelay` should be applied before the first call. If `false`, the first call will occur without a delay.
Default value is `false`.
- `jitter?: JitterType | string`
Decides whether a [jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/) should be applied to the delay. Possible values are `full` and `none`.
Default value is `none`.
- `maxDelay?: number`
The maximum delay, in milliseconds, between two consecutive attempts.
Default value is `Infinity`.
- `numOfAttempts?: number`
The maximum number of times to attempt the function.
Default value is `10`.
Minimum value is `1`.
- `retry?: (e: any, attemptNumber: number) => boolean | Promise<boolean>`
The `retry` function can be used to run logic after every failed attempt (e.g. logging a message, assessing the last error, etc.). It is called with the last error and the upcoming attempt number. Returning `true` will retry the function as long as the `numOfAttempts` has not been exceeded. Returning `false` will end the execution.
Default value is a function that always returns `true`.
- `startingDelay?: number`
The delay, in milliseconds, before executing the function for the first time.
Default value is `100` ms.
- `timeMultiple?: number`
The `startingDelay` is multiplied by the `timeMultiple` to increase the delay between reattempts.
Default value is `2`.
@@ -0,0 +1,44 @@
{
"name": "esutils",
"description": "utility box for ECMAScript language tools",
"homepage": "https://github.com/estools/esutils",
"main": "lib/utils.js",
"version": "2.0.3",
"engines": {
"node": ">=0.10.0"
},
"directories": {
"lib": "./lib"
},
"files": [
"LICENSE.BSD",
"README.md",
"lib"
],
"maintainers": [
{
"name": "Yusuke Suzuki",
"email": "utatane.tea@gmail.com",
"web": "http://github.com/Constellation"
}
],
"repository": {
"type": "git",
"url": "http://github.com/estools/esutils.git"
},
"devDependencies": {
"chai": "~1.7.2",
"coffee-script": "~1.6.3",
"jshint": "2.6.3",
"mocha": "~2.2.1",
"regenerate": "~1.3.1",
"unicode-9.0.0": "~0.7.0"
},
"license": "BSD-2-Clause",
"scripts": {
"test": "npm run-script lint && npm run-script unit-test",
"lint": "jshint lib/*.js",
"unit-test": "mocha --compilers coffee:coffee-script -R spec",
"generate-regex": "node tools/generate-identifier-regex.js"
}
}
@@ -0,0 +1,23 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext_bigint = void 0;
const base_config_1 = require("./base-config");
const es2020_intl_1 = require("./es2020.intl");
exports.esnext_bigint = {
libs: [es2020_intl_1.es2020_intl],
variables: [
['BigIntToLocaleStringOptions', base_config_1.TYPE],
['BigInt', base_config_1.TYPE_VALUE],
['BigIntConstructor', base_config_1.TYPE],
['BigInt64Array', base_config_1.TYPE_VALUE],
['BigInt64ArrayConstructor', base_config_1.TYPE],
['BigUint64Array', base_config_1.TYPE_VALUE],
['BigUint64ArrayConstructor', base_config_1.TYPE],
['DataView', base_config_1.TYPE],
['Intl', base_config_1.TYPE_VALUE],
],
};
@@ -0,0 +1,5 @@
import { SEPERATOR_CHAR_COUNT } from '../../data/const'
export default () => {
return SEPERATOR_CHAR_COUNT
}
@@ -0,0 +1,348 @@
'use strict'
const { webidl } = require('../webidl')
const { kEnumerableProperty } = require('../../core/util')
const { kConstruct } = require('../../core/symbols')
let createFastMessageEvent
/**
* @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
*/
class MessageEvent extends Event {
#eventInit
constructor (type, eventInitDict = {}) {
if (type === kConstruct) {
super(arguments[1], arguments[2])
webidl.util.markAsUncloneable(this)
return
}
const prefix = 'MessageEvent constructor'
webidl.argumentLengthCheck(arguments, 1, prefix)
type = webidl.converters.DOMString(type, prefix, 'type')
eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, 'eventInitDict')
super(type, eventInitDict)
this.#eventInit = eventInitDict
webidl.util.markAsUncloneable(this)
}
get data () {
webidl.brandCheck(this, webidl.is.MessageEvent)
return this.#eventInit.data
}
get origin () {
webidl.brandCheck(this, webidl.is.MessageEvent)
return this.#eventInit.origin
}
get lastEventId () {
webidl.brandCheck(this, webidl.is.MessageEvent)
return this.#eventInit.lastEventId
}
get source () {
webidl.brandCheck(this, webidl.is.MessageEvent)
return this.#eventInit.source
}
get ports () {
webidl.brandCheck(this, webidl.is.MessageEvent)
if (!Object.isFrozen(this.#eventInit.ports)) {
Object.freeze(this.#eventInit.ports)
}
return this.#eventInit.ports
}
initMessageEvent (
type,
bubbles = false,
cancelable = false,
data = null,
origin = '',
lastEventId = '',
source = null,
ports = []
) {
webidl.brandCheck(this, webidl.is.MessageEvent)
webidl.argumentLengthCheck(arguments, 1, 'MessageEvent.initMessageEvent')
return new MessageEvent(type, {
bubbles, cancelable, data, origin, lastEventId, source, ports
})
}
static {
createFastMessageEvent = (type, init) => {
const messageEvent = new MessageEvent(kConstruct, type, init)
messageEvent.#eventInit = init
messageEvent.#eventInit.data ??= null
messageEvent.#eventInit.origin ??= ''
messageEvent.#eventInit.lastEventId ??= ''
messageEvent.#eventInit.source ??= null
messageEvent.#eventInit.ports ??= []
return messageEvent
}
webidl.is.MessageEvent = (arg) => {
return arg != null && typeof arg === 'object' && #eventInit in arg
}
}
}
/**
* @see https://websockets.spec.whatwg.org/#the-closeevent-interface
*/
class CloseEvent extends Event {
#eventInit
constructor (type, eventInitDict = {}) {
const prefix = 'CloseEvent constructor'
webidl.argumentLengthCheck(arguments, 1, prefix)
type = webidl.converters.DOMString(type, prefix, 'type')
eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
super(type, eventInitDict)
this.#eventInit = eventInitDict
webidl.util.markAsUncloneable(this)
}
get wasClean () {
webidl.brandCheck(this, webidl.is.CloseEvent)
return this.#eventInit.wasClean
}
get code () {
webidl.brandCheck(this, webidl.is.CloseEvent)
return this.#eventInit.code
}
get reason () {
webidl.brandCheck(this, webidl.is.CloseEvent)
return this.#eventInit.reason
}
static {
webidl.is.CloseEvent = (arg) => {
return arg != null && typeof arg === 'object' && #eventInit in arg
}
}
}
// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
class ErrorEvent extends Event {
#eventInit
constructor (type, eventInitDict) {
const prefix = 'ErrorEvent constructor'
webidl.argumentLengthCheck(arguments, 1, prefix)
super(type, eventInitDict)
webidl.util.markAsUncloneable(this)
type = webidl.converters.DOMString(type, prefix, 'type')
eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
this.#eventInit = eventInitDict
}
get message () {
webidl.brandCheck(this, webidl.is.ErrorEvent)
return this.#eventInit.message
}
get filename () {
webidl.brandCheck(this, webidl.is.ErrorEvent)
return this.#eventInit.filename
}
get lineno () {
webidl.brandCheck(this, webidl.is.ErrorEvent)
return this.#eventInit.lineno
}
get colno () {
webidl.brandCheck(this, webidl.is.ErrorEvent)
return this.#eventInit.colno
}
get error () {
webidl.brandCheck(this, webidl.is.ErrorEvent)
return this.#eventInit.error
}
static {
webidl.is.ErrorEvent = (arg) => {
return arg != null && typeof arg === 'object' && #eventInit in arg
}
}
}
Object.defineProperties(MessageEvent.prototype, {
[Symbol.toStringTag]: {
value: 'MessageEvent',
configurable: true
},
data: kEnumerableProperty,
origin: kEnumerableProperty,
lastEventId: kEnumerableProperty,
source: kEnumerableProperty,
ports: kEnumerableProperty,
initMessageEvent: kEnumerableProperty
})
Object.defineProperties(CloseEvent.prototype, {
[Symbol.toStringTag]: {
value: 'CloseEvent',
configurable: true
},
reason: kEnumerableProperty,
code: kEnumerableProperty,
wasClean: kEnumerableProperty
})
Object.defineProperties(ErrorEvent.prototype, {
[Symbol.toStringTag]: {
value: 'ErrorEvent',
configurable: true
},
message: kEnumerableProperty,
filename: kEnumerableProperty,
lineno: kEnumerableProperty,
colno: kEnumerableProperty,
error: kEnumerableProperty
})
webidl.converters.MessagePort = webidl.interfaceConverter(
webidl.is.MessagePort,
'MessagePort'
)
webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
webidl.converters.MessagePort
)
const eventInit = [
{
key: 'bubbles',
converter: webidl.converters.boolean,
defaultValue: () => false
},
{
key: 'cancelable',
converter: webidl.converters.boolean,
defaultValue: () => false
},
{
key: 'composed',
converter: webidl.converters.boolean,
defaultValue: () => false
}
]
webidl.converters.MessageEventInit = webidl.dictionaryConverter([
...eventInit,
{
key: 'data',
converter: webidl.converters.any,
defaultValue: () => null
},
{
key: 'origin',
converter: webidl.converters.USVString,
defaultValue: () => ''
},
{
key: 'lastEventId',
converter: webidl.converters.DOMString,
defaultValue: () => ''
},
{
key: 'source',
// Node doesn't implement WindowProxy or ServiceWorker, so the only
// valid value for source is a MessagePort.
converter: webidl.nullableConverter(webidl.converters.MessagePort),
defaultValue: () => null
},
{
key: 'ports',
converter: webidl.converters['sequence<MessagePort>'],
defaultValue: () => []
}
])
webidl.converters.CloseEventInit = webidl.dictionaryConverter([
...eventInit,
{
key: 'wasClean',
converter: webidl.converters.boolean,
defaultValue: () => false
},
{
key: 'code',
converter: webidl.converters['unsigned short'],
defaultValue: () => 0
},
{
key: 'reason',
converter: webidl.converters.USVString,
defaultValue: () => ''
}
])
webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
...eventInit,
{
key: 'message',
converter: webidl.converters.DOMString,
defaultValue: () => ''
},
{
key: 'filename',
converter: webidl.converters.USVString,
defaultValue: () => ''
},
{
key: 'lineno',
converter: webidl.converters['unsigned long'],
defaultValue: () => 0
},
{
key: 'colno',
converter: webidl.converters['unsigned long'],
defaultValue: () => 0
},
{
key: 'error',
converter: webidl.converters.any
}
])
module.exports = {
MessageEvent,
CloseEvent,
ErrorEvent,
createFastMessageEvent
}
@@ -0,0 +1 @@
{"version":3,"file":"square-arrow-down-left.js","sources":["../../../src/icons/square-arrow-down-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareArrowDownLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Im0xNiA4LTggOCIgLz4KICA8cGF0aCBkPSJNMTYgMTZIOFY4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-arrow-down-left\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 SquareArrowDownLeft = createLucideIcon('SquareArrowDownLeft', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'm16 8-8 8', key: '166keh' }],\n ['path', { d: 'M16 16H8V8', key: '1w2ppm' }],\n]);\n\nexport default SquareArrowDownLeft;\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,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"align-horizontal-justify-center.js","sources":["../../../src/icons/align-horizontal-justify-center.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlignHorizontalJustifyCenter\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iNiIgaGVpZ2h0PSIxNCIgeD0iMiIgeT0iNSIgcng9IjIiIC8+CiAgPHJlY3Qgd2lkdGg9IjYiIGhlaWdodD0iMTAiIHg9IjE2IiB5PSI3IiByeD0iMiIgLz4KICA8cGF0aCBkPSJNMTIgMnYyMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/align-horizontal-justify-center\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 AlignHorizontalJustifyCenter = createLucideIcon('AlignHorizontalJustifyCenter', [\n ['rect', { width: '6', height: '14', x: '2', y: '5', rx: '2', key: 'dy24zr' }],\n ['rect', { width: '6', height: '10', x: '16', y: '7', rx: '2', key: '13zkjt' }],\n ['path', { d: 'M12 2v20', key: 't6zp3m' }],\n]);\n\nexport default AlignHorizontalJustifyCenter;\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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+B,iBAAiB,8BAAgC,CAAA,CAAA,CAAA;AAAA,CAAA,CACpF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,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,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,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;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,14 @@
import{s as Fu,g as tu}from"./shared/confbox.9388d834.mjs";function X(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var k={};k.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,k.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC8Line truncated
`?(S++,g=0):D?g+=D.length:g++,D&&(V+=D.length),D}const U={default(){switch(r){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
`:case"\r":case"\u2028":case"\u2029":u();return;case"/":u(),t="comment";return;case void 0:return u(),i("eof")}if(f.isSpaceSeparator(r)){u();return}return U[h]()},comment(){switch(r){case"*":u(),t="multiLineComment";return;case"/":u(),t="singleLineComment";return}throw a(u())},multiLineComment(){switch(r){case"*":u(),t="multiLineCommentAsterisk";return;case void 0:throw a(u())}u()},multiLineCommentAsterisk(){switch(r){case"*":u();return;case"/":u(),t="default";return;case void 0:throw a(u())}u(),t="multiLineComment"},singleLineComment(){switch(r){case`
`:case"\r":case"\u2028":case"\u2029":u(),t="default";return;case void 0:return u(),i("eof")}u()},value(){switch(r){case"{":case"[":return i("punctuator",u());case"n":return u(),P("ull"),i("null",null);case"t":return u(),P("rue"),i("boolean",!0);case"f":return u(),P("alse"),i("boolean",!1);case"-":case"+":u()==="-"&&(w=-1),t="sign";return;case".":e=u(),t="decimalPointLeading";return;case"0":e=u(),t="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":e=u(),t="decimalInteger";return;case"I":return u(),P("nfinity"),i("numeric",1/0);case"N":return u(),P("aN"),i("numeric",NaN);case'"':case"'":$=u()==='"',e="",t="string";return}throw a(u())},identifierNameStartEscape(){if(r!=="u")throw a(u());u();const D=Z();switch(D){case"$":case"_":break;default:if(!f.isIdStartChar(D))throw W();break}e+=D,t="identifierName"},identifierName(){switch(r){case"$":case"_":case"\u200C":case"\u200D":e+=u();return;case"\\":u(),t="identifierNameEscape";return}if(f.isIdContinueChar(r)){e+=u();return}return i("identifier",e)},identifierNameEscape(){if(r!=="u")throw a(u());u();const D=Z();switch(D){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!f.isIdContinueChar(D))throw W();break}e+=D,t="identifierName"},sign(){switch(r){case".":e=u(),t="decimalPointLeading";return;case"0":e=u(),t="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":e=u(),t="decimalInteger";return;case"I":return u(),P("nfinity"),i("numeric",w*(1/0));case"N":return u(),P("aN"),i("numeric",NaN)}throw a(u())},zero(){switch(r){case".":e+=u(),t="decimalPoint";return;case"e":case"E":e+=u(),t="decimalExponent";return;case"x":case"X":e+=u(),t="hexadecimal";return}return i("numeric",w*0)},decimalInteger(){switch(r){case".":e+=u(),t="decimalPoint";return;case"e":case"E":e+=u(),t="decimalExponent";return}if(f.isDigit(r)){e+=u();return}return i("numeric",w*Number(e))},decimalPointLeading(){if(f.isDigit(r)){e+=u(),t="decimalFraction";return}throw a(u())},decimalPoint(){switch(r){case"e":case"E":e+=u(),t="decimalExponent";return}if(f.isDigit(r)){e+=u(),t="decimalFraction";return}return i("numeric",w*Number(e))},decimalFraction(){switch(r){case"e":case"E":e+=u(),t="decimalExponent";return}if(f.isDigit(r)){e+=u();return}return i("numeric",w*Number(e))},decimalExponent(){switch(r){case"+":case"-":e+=u(),t="decimalExponentSign";return}if(f.isDigit(r)){e+=u(),t="decimalExponentInteger";return}throw a(u())},decimalExponentSign(){if(f.isDigit(r)){e+=u(),t="decimalExponentInteger";return}throw a(u())},decimalExponentInteger(){if(f.isDigit(r)){e+=u();return}return i("numeric",w*Number(e))},hexadecimal(){if(f.isHexDigit(r)){e+=u(),t="hexadecimalInteger";return}throw a(u())},hexadecimalInteger(){if(f.isHexDigit(r)){e+=u();return}return i("numeric",w*Number(e))},string(){switch(r){case"\\":u(),e+=Au();return;case'"':if($)return u(),i("string",e);e+=u();return;case"'":if(!$)return u(),i("string",e);e+=u();return;case`
`:case"\r":throw a(u());case"\u2028":case"\u2029":iu(r);break;case void 0:throw a(u())}e+=u()},start(){switch(r){case"{":case"[":return i("punctuator",u())}t="value"},beforePropertyName(){switch(r){case"$":case"_":e=u(),t="identifierName";return;case"\\":u(),t="identifierNameStartEscape";return;case"}":return i("punctuator",u());case'"':case"'":$=u()==='"',t="string";return}if(f.isIdStartChar(r)){e+=u(),t="identifierName";return}throw a(u())},afterPropertyName(){if(r===":")return i("punctuator",u());throw a(u())},beforePropertyValue(){t="value"},afterPropertyValue(){switch(r){case",":case"}":return i("punctuator",u())}throw a(u())},beforeArrayValue(){if(r==="]")return i("punctuator",u());t="value"},afterArrayValue(){switch(r){case",":case"]":return i("punctuator",u())}throw a(u())},end(){throw a(u())}};function i(D,C){return{type:D,value:C,line:S,column:g}}function P(D){for(const C of D){if(b()!==C)throw a(u());u()}}function Au(){switch(b()){case"b":return u(),"\b";case"f":return u(),"\f";case"n":return u(),`
`;case"r":return u(),"\r";case"t":return u()," ";case"v":return u(),"\v";case"0":if(u(),f.isDigit(b()))throw a(u());return"\0";case"x":return u(),Eu();case"u":return u(),Z();case`
`:case"\u2028":case"\u2029":return u(),"";case"\r":return u(),b()===`
`&&u(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw a(u());case void 0:throw a(u())}return u()}function Eu(){let D="",C=b();if(!f.isHexDigit(C)||(D+=u(),C=b(),!f.isHexDigit(C)))throw a(u());return D+=u(),String.fromCodePoint(parseInt(D,16))}function Z(){let D="",C=4;for(;C-- >0;){const E=b();if(!f.isHexDigit(E))throw a(u());D+=u()}return String.fromCodePoint(parseInt(D,16))}const nu={start(){if(l.type==="eof")throw I();K()},beforePropertyName(){switch(l.type){case"identifier":case"string":M=l.value,h="afterPropertyName";return;case"punctuator":_();return;case"eof":throw I()}},afterPropertyName(){if(l.type==="eof")throw I();h="beforePropertyValue"},beforePropertyValue(){if(l.type==="eof")throw I();K()},beforeArrayValue(){if(l.type==="eof")throw I();if(l.type==="punctuator"&&l.value==="]"){_();return}K()},afterPropertyValue(){if(l.type==="eof")throw I();switch(l.value){case",":h="beforePropertyName";return;case"}":_()}},afterArrayValue(){if(l.type==="eof")throw I();switch(l.value){case",":h="beforeArrayValue";return;case"]":_()}},end(){}};function K(){let D;switch(l.type){case"punctuator":switch(l.value){case"{":D={};break;case"[":D=[];break}break;case"null":case"boolean":case"numeric":case"string":D=l.value;break}if(O===void 0)O=D;else{const C=y[y.length-1];Array.isArray(C)?C.push(D):Object.defineProperty(C,M,{value:D,writable:!0,enumerable:!0,configurable:!0})}if(D!==null&&typeof D=="object")y.push(D),Array.isArray(D)?h="beforeArrayValue":h="beforePropertyName";else{const C=y[y.length-1];C==null?h="end":Array.isArray(C)?h="afterArrayValue":h="afterPropertyValue"}}function _(){y.pop();const D=y[y.length-1];D==null?h="end":Array.isArray(D)?h="afterArrayValue":h="afterPropertyValue"}function a(D){return J(D===void 0?`JSON5: invalid end of input at ${S}:${g}`:`JSON5: invalid character '${Y(D)}' at ${S}:${g}`)}function I(){return J(`JSON5: invalid end of input at ${S}:${g}`)}function W(){return g-=5,J(`JSON5: invalid identifier character at ${S}:${g}`)}function iu(D){console.warn(`JSON5: '${Y(D)}' in strings is not valid ECMAScript; consider escaping`)}function Y(D){const C={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(C[D])return C[D];if(D<" "){const E=D.charCodeAt(0).toString(16);return"\\x"+("00"+E).substring(E.length)}return D}function J(D){const C=new SyntaxError(D);return C.lineNumber=S,C.columnNumber=g,C}const au=X(Cu),Q=G;var Bu=function(C,E,n){const m=[];let o="",x,L,N="",R;if(E!=null&&typeof E=="object"&&!Array.isArray(E)&&(n=E.space,R=E.quote,E=E.replacer),typeof E=="function")L=E;else if(Array.isArray(E)){x=[];for(const A of E){let B;typeof A=="string"?B=A:(typeof A=="number"||A instanceof String||A instanceof Number)&&(B=String(A)),B!==void 0&&x.indexOf(B)<0&&x.push(B)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),N=" ".substr(0,n)):typeof n=="string"&&(N=n.substr(0,10)),z("",{"":C});function z(A,B){let F=B[A];switch(F!=null&&(typeof F.toJSON5=="function"?F=F.toJSON5(A):typeof F.toJSON=="function"&&(F=F.toJSON(A))),L&&(F=L.call(B,A,F)),F instanceof Number?F=Number(F):F instanceof String?F=String(F):F instanceof Boolean&&(F=F.valueOf()),F){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof F=="string")return j(F);if(typeof F=="number")return String(F);if(typeof F=="object")return Array.isArray(F)?eu(F):uu(F)}function j(A){const B={"'":.1,'"':.2},F={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let c="";for(let s=0;s<A.length;s++){const p=A[s];switch(p){case"'":case'"':B[p]++,c+=p;continue;case"\0":if(Q.isDigit(A[s+1])){c+="\\x00";continue}}if(F[p]){c+=F[p];continue}if(p<" "){let v=p.charCodeAt(0).toString(16);c+="\\x"+("00"+v).substring(v.length);continue}c+=p}const d=R||Object.keys(B).reduce((s,p)=>B[s]<B[p]?s:p);return c=c.replace(new RegExp(d,"g"),F[d]),d+c+d}function uu(A){if(m.indexOf(A)>=0)throw TypeError("Converting circular structure to JSON5");m.push(A);let B=o;o=o+N;let F=x||Object.keys(A),c=[];for(const s of F){const p=z(s,A);if(p!==void 0){let v=Du(s)+":";N!==""&&(v+=" "),v+=p,c.push(v)}}let d;if(c.length===0)d="{}";else{let s;if(N==="")s=c.join(","),d="{"+s+"}";else{let p=`,
`+o;s=c.join(p),d=`{
`+o+s+`,
`+B+"}"}}return m.pop(),o=B,d}function Du(A){if(A.length===0)return j(A);const B=String.fromCodePoint(A.codePointAt(0));if(!Q.isIdStartChar(B))return j(A);for(let F=B.length;F<A.length;F++)if(!Q.isIdContinueChar(String.fromCodePoint(A.codePointAt(F))))return j(A);return A}function eu(A){if(m.indexOf(A)>=0)throw TypeError("Converting circular structure to JSON5");m.push(A);let B=o;o=o+N;let F=[];for(let d=0;d<A.length;d++){const s=z(String(d),A);F.push(s!==void 0?s:"null")}let c;if(F.length===0)c="[]";else if(N==="")c="["+F.join(",")+"]";else{let d=`,
`+o,s=F.join(d);c=`[
`+o+s+`,
`+B+"]"}return m.pop(),o=B,c}};const su=X(Bu);function ou(D,C){const E=au(D,C?.reviver);return Fu(D,E,C),E}function cu(D,C){const E=tu(D,C),n=su(D,C?.replacer,E.indent);return E.whitespace.start+n+E.whitespace.end}export{ou as parseJSON5,cu as stringifyJSON5};
@@ -0,0 +1,24 @@
import type * as Rolldown from 'rolldown'
export * from 'rolldown'
/** @deprecated use RolldownBuild instead */
export type RollupBuild = Rolldown.RolldownBuild
/** @deprecated use RolldownOptions instead */
export type RollupOptions = Rolldown.RolldownOptions
/** @deprecated use RolldownOutput instead */
export type RollupOutput = Rolldown.RolldownOutput
/** @deprecated use RolldownPlugin instead */
export type RollupPlugin = Rolldown.RolldownPlugin
/** @deprecated use RolldownPluginOption instead */
export type RollupPluginOption = Rolldown.RolldownPluginOption
/** @deprecated use RolldownWatcher instead */
export type RollupWatcher = Rolldown.RolldownWatcher
/** @deprecated use RollupWatcherEvent instead */
export type RollupWatcherEvent = Rolldown.RolldownWatcherEvent
@@ -0,0 +1,526 @@
import { readFileSync } from 'node:fs';
import { pathToFileURL, fileURLToPath } from 'node:url';
import MagicString from 'magic-string';
import { walk } from 'estree-walker';
import module$1, { isBuiltin, createRequire } from 'node:module';
import { extname } from 'node:path';
import { f as filterOutComments } from './chunk-helpers.js';
const isNodeInPatternWeakSet = new WeakSet();
function setIsNodeInPattern(node) {
return isNodeInPatternWeakSet.add(node);
}
function isNodeInPattern(node) {
return isNodeInPatternWeakSet.has(node);
}
/**
* Same logic from \@vue/compiler-core & \@vue/compiler-sfc
* Except this is using acorn AST
*/
function esmWalker(root, { onIdentifier, onImportMeta, onDynamicImport, onCallExpression }) {
const parentStack = [];
const varKindStack = [];
const scopeMap = new WeakMap();
const identifiers = [];
const setScope = (node, name) => {
let scopeIds = scopeMap.get(node);
if (scopeIds && scopeIds.has(name)) {
return;
}
if (!scopeIds) {
scopeIds = new Set();
scopeMap.set(node, scopeIds);
}
scopeIds.add(name);
};
function isInScope(name, parents) {
return parents.some((node) => node && scopeMap.get(node)?.has(name));
}
function handlePattern(p, parentScope) {
if (p.type === "Identifier") {
setScope(parentScope, p.name);
} else if (p.type === "RestElement") {
handlePattern(p.argument, parentScope);
} else if (p.type === "ObjectPattern") {
p.properties.forEach((property) => {
if (property.type === "RestElement") {
setScope(parentScope, property.argument.name);
} else {
handlePattern(property.value, parentScope);
}
});
} else if (p.type === "ArrayPattern") {
p.elements.forEach((element) => {
if (element) {
handlePattern(element, parentScope);
}
});
} else if (p.type === "AssignmentPattern") {
handlePattern(p.left, parentScope);
} else {
setScope(parentScope, p.name);
}
}
walk(root, {
enter(node, parent) {
if (node.type === "ImportDeclaration") {
return this.skip();
}
// track parent stack, skip for "else-if"/"else" branches as acorn nests
// the ast within "if" nodes instead of flattening them
if (parent && !(parent.type === "IfStatement" && node === parent.alternate)) {
parentStack.unshift(parent);
}
// track variable declaration kind stack used by VariableDeclarator
if (node.type === "VariableDeclaration") {
varKindStack.unshift(node.kind);
}
if (node.type === "CallExpression") {
onCallExpression?.(node);
}
if (node.type === "MetaProperty" && node.meta.name === "import") {
onImportMeta?.(node);
} else if (node.type === "ImportExpression") {
onDynamicImport?.(node);
}
if (node.type === "Identifier") {
if (!isInScope(node.name, parentStack) && isRefIdentifier(node, parent, parentStack)) {
// record the identifier, for DFS -> BFS
identifiers.push([node, parentStack.slice(0)]);
}
} else if (node.type === "ClassDeclaration" && node.id) {
// A class declaration name could shadow an import, so add its name to the parent scope
const parentScope = findParentScope(parentStack);
if (parentScope) {
setScope(parentScope, node.id.name);
}
} else if (node.type === "ClassExpression" && node.id) {
// A class expression name could shadow an import, so add its name to the scope
setScope(node, node.id.name);
} else if (isFunctionNode(node)) {
// If it is a function declaration, it could be shadowing an import
// Add its name to the scope so it won't get replaced
if (node.type === "FunctionDeclaration") {
const parentScope = findParentScope(parentStack);
if (parentScope) {
setScope(parentScope, node.id.name);
}
}
// walk function expressions and add its arguments to known identifiers
// so that we don't prefix them
node.params.forEach((p) => {
if (p.type === "ObjectPattern" || p.type === "ArrayPattern") {
handlePattern(p, node);
return;
}
walk(p.type === "AssignmentPattern" ? p.left : p, { enter(child, parent) {
// skip params default value of destructure
if (parent?.type === "AssignmentPattern" && parent?.right === child) {
return this.skip();
}
if (child.type !== "Identifier") {
return;
}
// do not record as scope variable if is a destructuring keyword
if (isStaticPropertyKey(child, parent)) {
return;
}
// do not record if this is a default value
// assignment of a destructuring variable
if (parent?.type === "TemplateLiteral" && parent?.expressions.includes(child) || parent?.type === "CallExpression" && parent?.callee === child) {
return;
}
setScope(node, child.name);
} });
});
} else if (node.type === "Property" && parent.type === "ObjectPattern") {
// mark property in destructuring pattern
setIsNodeInPattern(node);
} else if (node.type === "VariableDeclarator") {
const parentFunction = findParentScope(parentStack, varKindStack[0] === "var");
if (parentFunction) {
handlePattern(node.id, parentFunction);
}
} else if (node.type === "CatchClause" && node.param) {
handlePattern(node.param, node);
}
},
leave(node, parent) {
// untrack parent stack from above
if (parent && !(parent.type === "IfStatement" && node === parent.alternate)) {
parentStack.shift();
}
if (node.type === "VariableDeclaration") {
varKindStack.shift();
}
}
});
// emit the identifier events in BFS so the hoisted declarations
// can be captured correctly
identifiers.forEach(([node, stack]) => {
if (!isInScope(node.name, stack)) {
const parent = stack[0];
const hasBindingShortcut = isStaticProperty(parent) && parent.shorthand && (!isNodeInPattern(parent) || isInDestructuringAssignment(parent, parentStack));
const classDeclaration = parent.type === "ClassDeclaration" && node === parent.superClass;
const classExpression = parent.type === "ClassExpression" && node === parent.id;
onIdentifier?.(node, {
hasBindingShortcut,
classDeclaration,
classExpression
}, stack);
}
});
}
function isRefIdentifier(id, parent, parentStack) {
// declaration id
if (parent.type === "CatchClause" || (parent.type === "VariableDeclarator" || parent.type === "ClassDeclaration") && parent.id === id) {
return false;
}
if (isFunctionNode(parent)) {
// function declaration/expression id
if (parent.id === id) {
return false;
}
// params list
if (parent.params.includes(id)) {
return false;
}
}
// class method name
if (parent.type === "MethodDefinition" && !parent.computed) {
return false;
}
// class property
if (parent.type === "PropertyDefinition" && !parent.computed) {
// Default values can still reference identifiers
return id === parent.value;
}
// property key
if (isStaticPropertyKey(id, parent)) {
return false;
}
// object destructuring pattern
if (isNodeInPattern(parent) && parent.value === id) {
return false;
}
// non-assignment array destructuring pattern
if (parent.type === "ArrayPattern" && !isInDestructuringAssignment(parent, parentStack)) {
return false;
}
// member expression property
if (parent.type === "MemberExpression" && parent.property === id && !parent.computed) {
return false;
}
if (parent.type === "ExportSpecifier") {
return false;
}
// is a special keyword but parsed as identifier
if (id.name === "arguments") {
return false;
}
return true;
}
function isStaticProperty(node) {
return node && node.type === "Property" && !node.computed;
}
function isStaticPropertyKey(node, parent) {
return isStaticProperty(parent) && parent.key === node;
}
const functionNodeTypeRE = /Function(?:Expression|Declaration)$|Method$/;
function isFunctionNode(node) {
return functionNodeTypeRE.test(node.type);
}
const blockNodeTypeRE = /^BlockStatement$|^For(?:In|Of)?Statement$/;
function isBlock(node) {
return blockNodeTypeRE.test(node.type);
}
function findParentScope(parentStack, isVar = false) {
return parentStack.find(isVar ? isFunctionNode : isBlock);
}
function isInDestructuringAssignment(parent, parentStack) {
if (parent && (parent.type === "Property" || parent.type === "ArrayPattern")) {
return parentStack.some((i) => i.type === "AssignmentExpression");
}
return false;
}
function getArbitraryModuleIdentifier(node) {
return node.type === "Identifier" ? node.name : node.raw;
}
/* cjs-module-lexer 2.2.0 */
let A$1;const B$1=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$1(E,g="@"){if(!A$1)throw new Error("Not initialized");const w=E.length+1,D=(A$1.__heap_base.value||A$1.__heap_base)+4*w-A$1.memory.buffer.byteLength;D>0&&A$1.memory.grow(Math.ceil(D/65536));const G=A$1.sa(w);(B$1?C$1:I)(E,new Uint16Array(A$1.memory.buffer,G,w));const S=A$1.parseCJS(G,E.length,0,0,0);if(S){const B=new Error(`Parse error ${g}${A$1.e()}:${E.slice(0,A$1.e()).split("\n").length}:${A$1.e()-E.lastIndexOf("\n",A$1.e()-1)}`);throw Object.assign(B,{idx:A$1.e()}),5!==S&&6!==S&&7!==S||Object.assign(B,{code:"ERR_LEXER_ESM_SYNTAX"}),B}let o=new Set,R=new Set,y=new Set;for(;A$1.rre();){const B=Q$1(E.slice(A$1.res(),A$1.ree()));B&&R.add(B);}for(;A$1.ru();)y.add(Q$1(E.slice(A$1.us(),A$1.ue())));for(;A$1.re();){let B=Q$1(E.slice(A$1.es(),A$1.ee()));void 0===B||y.has(B)||o.add(B);}return {exports:[...o],reexports:[...R]}}function Q$1(A){if('"'!==A[0]&&"'"!==A[0])return A;try{const B=function(A){const B=A[0];if('"'===B)try{return JSON.parse(A)}catch{}else if("'"===B&&A.length>1&&"'"===A[A.length-1]&&-1===A.indexOf('"'))try{return JSON.parse('"'+A.slice(1,-1)+'"')}catch{}let Q="",g={v:1};for(;g.v<A.length;){const I=A[g.v];switch(I){case B:return Q;case "\\":++g.v,Q+=E$1(A,g);break;case "\r":case "\n":throw new SyntaxError;default:++g.v,Q+=I;}}throw new SyntaxError}(A);for(let A=0;A<B.length;A++){const Q=64512&B.charCodeAt(A);if(!(Q<55296)){if(55296!==Q)return;if(56320!=(64512&B.charCodeAt(++A)))return}}return B}catch{}}function E$1(A,B){if(B.v===A.length)throw new SyntaxError;const Q=A[B.v];switch(++B.v,Q){case "\r":"\n"===A[B.v]&&++B.v;case "\n":case "\u2028":case "\u2029":return "";case "r":return "\r";case "n":return "\n";case "t":return "\t";case "b":return "\b";case "f":return "\f";case "v":return "\v";case "x":return function(A,B){const Q=g(A[B.v]);++B.v;const E=g(A[B.v]);return ++B.v,String.fromCodePoint(16*Q+E)}(A,B);case "u":return function(A,B){let Q=0;if("{"===A[B.v]){++B.v;do{if(Q=16*Q+g(A[B.v]),Q>1114111)throw new SyntaxError;++B.v;}while("}"!==A[B.v]);++B.v;}else for(let E=0;E<4;++E)Q=16*Q+g(A[B.v]),++B.v;return String.fromCodePoint(Q)}(A,B);case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":return function(A,B,Q){let E=A<="3"?2:1,g=+A;do{if((A=B[Q.v])<"0"||A>"7")break;g=8*g+ +A,++Q.v,--E;}while(E>0);return String.fromCodePoint(g)}(Q,A,B);default:return Q}}function g(A){if(A>="0"&&A<="9")return +A;if(A>="a"&&A<="f")return A.charCodeAt(0)-87;if(A>="A"&&A<="F")return A.charCodeAt(0)-55;throw new SyntaxError}function I(A,B){const Q=A.length;let E=0;for(;E<Q;){const Q=A.charCodeAt(E);B[E++]=(255&Q)<<8|Q>>>8;}}function C$1(A,B){const Q=A.length;let E=0;for(;E<Q;)B[E]=A.charCodeAt(E++);}function w(){const A="AGFzbQEAAAABXA1gAX8Bf2ACf38AYAABf2AAAGABfwBgBn9/f39/fwF/YAJ/fwF/YAd/f39/f39/AX9gA39/fwF/YAh/f39/f39/fwF/YAV/f39/fwF/YAR/f39/AX9gBH9/f38AAzMyAQEBAwAABAUJBAAEBAMDAAcCAAAICgAFAAAGBQsHBgAAAAAIAAICAgICAgICAgIFDAYEBQFwAQUFBQMBAAEGCAF/AEHQmAILB1wOBm1lbW9yeQIAC19faGVhcF9iYXNlAwACc2EAJAFlACUCZXMAJgJlZQAnA3JlcwAoA3JlZQApAnVzACoCdWUAKwJyZQAsA3JyZQAtAnJ1AC4IcGFyc2VDSlMALwkKAQBBAQsEAAECAwwBAgrJkwEyDgAgACABQcgfQcAfEDALDgAgACABQdQfQcwfEDALDgAgACABQeAfQdgfEDALEgBBzB9BADYCAEHUH0EANgIAC8wBAQN/AkBBvKABKAIAIgNBAmpB5QBB8QBB9QBB6QBB8gBB5QAQEARAQbygASADQQ5qNgIAAkAQEUEoRw0AQbygAUG8oAEoAgBBAmo2AgAQESEBQbygASgCACECIAFBJ0cgAUEiR3ENACABEAxBvKABQbygASgCAEECaiIBNgIAEBFBKUcNAAJAIABBAWsOAgMDAAtBtKABKAIAIAI2AgBBtKABKAIAIAE2AgRBAQ8LQbygASADNgIAC0EADwsgAiABQaAfKAIAEQEAQQELGwAgAEGYHygCAEYEQEEBDwsgAEECay8BABAPC/8CAQV/QZgfKAIAIQQDQAJAIABBAmshASAALwEAIgJBIEcNACAAIARLIAEhAA0BCwsCQCACQT1HDQADQAJAIAFBAmshACABLwEAQSBHDQAgASAESyAAIQENAQsLIABBAmohASAAQQRqIQNBACECA0ACQCABLwEAIgBBgPgDcUGAuANGBEAgAEH/B3EgAUECay8BAEH/B3FBCnRyQYCABGohAAsgAEUgASAETXINACAAQdwARg0CIAAQEkUNACABQX5BfCAAQYCABEkbaiEBIAAQEyECDAELCyACQQFxRQ0AIAEvAQBBIEcNAEG0oAEoAgAiAkGwHygCAEYNACACIAM2AgwgAiABQQJqNgIIA0ACQCABQQJrIQAgAS8BACIDQSBHDQAgASAESyAAIQENAQsLAkACQAJAIANB8gBrDgMAAwEDCyAAQfYAQeEAEBQNAQwCCyAAQewAQeUAEBQNACAAQeMAQe8AQe4AQfMAEBVFDQELQbSgASACQRBqNgIACws7AQF/AkAgAC8BACABRw0AIAAvAQIgAkcNACAALwEEIANHDQAgAC8BBiAERw0AIAAvAQggBUYhBgsgBgtPAQF/AkAgAC8BACABRw0AIAAvAQIgAkcNACAALwEEIANHDQAgAC8BBiAERw0AIAAvAQggBUcNACAALwEKIAZHDQAgAC8BDCAHRiEICyAIC7MFAQN/QbygAUG8oAEoAgAiAkEOajYCAAJAAkAQESIBQdsARwRAIAFBPUYNASABQS5HDQJBvKABQbygASgCAEECajYCABARQbygASgCACEBEBZFDQJBvKABKAIAIQAQEUE9Rw0CIAEgAEGcHygCABEBAA8LQbygAUG8oAEoAgBBAmo2AgAQESIAQSdHIABBIkdxDQFBvKABKAIAIAAQDEG8oAFBvKABKAIAQQJqIgA2AgAQEUHdAEcNAUG8oAFBvKABKAIAQQJqNgIAEBFBPUcNASAAQZwfKAIAEQEADAELIABFDQBBqB8oAgARAwBBvKABQbygASgCAEECajYCABARIgBB8gBHBEAgAEH7AEcNAUG8oAEoAgBBAmshAQJAAkADQEG8oAFBvKABKAIAIgBBAmo2AgAgAEHAoAEoAgBPDQIQESEAQbygASgCACECAkAgABAWBEBBvKABKAIAIQMQESIAQTpGBEBBvKABQbygASgCAEECajYCABAREBZFDQRBvKABKAIALwEAIQALIAIgA0GcHygCABEBAAwBCwJAIABBIkcEQCAAQS5GDQEgAEEnRw0EC0G8oAEoAgAgABAMQbygAUG8oAEoAgBBAmoiAzYCABARIgBBOkcNAUG8oAFBvKABKAIAQQJqNgIAEBEQFkUNA0G8oAEoAgAvAQAhACADQZwfKAIAEQEADAELQbygASgCACIALwECQS5HDQIgAC8BBEEuRw0CQbygASAAQQLine truncated
/* es-module-lexer 2.0.0 */
var ImportType;!function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase",A[A.StaticDeferPhase=6]="StaticDeferPhase",A[A.DynamicDeferPhase=7]="DynamicDeferPhase";}(ImportType||(ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse(E,g="@"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const D=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,D,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const w=[],K=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),o=C.ss(),D=C.se();let K;C.ip()&&(K=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q)));const N=[];for(C.rsa();C.ra();){const A=C.aks(),Q=C.ake(),B=C.avs(),g=C.ave();N.push([J(E.slice(A,Q)),J(E.slice(B,g))]);}w.push({n:K,t:B,s:A,e:Q,ss:o,se:D,d:I,a:g,at:N.length>0?N:null});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=J(E.slice(A,Q)),o=B<0?void 0:J(E.slice(B,g));K.push({s:A,e:Q,ls:B,le:g,n:I,ln:o});}function k(A){try{return (0,eval)(A)}catch(A){}}function J(A){if(!A)return A;const Q=A[0];return ('"'===Q||"'"===Q)&&k(A)||A}return [w,K,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const E=()=>{return A="AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADNzYAAQECAgICAgICAgICAgICAgICAgICAgICAwIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUGw8gALfwBBsPIACwedARsGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABwJpdAAIAmFpAAkCaWQACgJpcAALAmVzAAwCZWUADQNlbHMADgNlbGUADwJyaQAQAnJlABEBZgASAm1zABMCcmEAFANha3MAFQNha2UAFgNhdnMAFwNhdmUAGANyc2EAGQVwYXJzZQAaC19faGVhcF9iYXNlAwEKkkY2aAEBf0EAIAA2AvQJQQAoAtAJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgL4CUEAIAA2AvwJQQBBADYC1AlBAEEANgLkCUEAQQA2AtwJQQBBADYC2AlBAEEANgLsCUEAQQA2AuAJIAEL0wEBA39BACgC5AkhBEEAQQAoAvwJIgU2AuQJQQAgBDYC6AlBACAFQShqNgL8CSAEQSRqQdQJIAQbIAU2AgBBACgCyAkhBEEAKALECSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGIgAbIAQgA0YiBBs2AgwgBSADNgIUIAVBADYCECAFIAI2AgQgBUIANwIgIAVBA0EBQQIgABsgBBs2AhwgBUEAKALECSADRiICOgAYAkACQCACDQBBACgCyAkgA0cNAQtBAEEBOgCACgsLXgEBf0EAKALsCSIEQRBqQdgJIAQbQQAoAvwJIgQ2AgBBACAENgLsCUEAIARBFGo2AvwJQQBBAToAgAogBEEANgIQIAQgAzYCDCAEIAI2AgggBCABNgIEIAQgADYCAAsIAEEAKAKECgsVAEEAKALcCSgCAEEAKALQCWtBAXULHgEBf0EAKALcCSgCBCIAQQAoAtAJa0EBdUF/IAAbCxUAQQAoAtwJKAIIQQAoAtAJa0EBdQseAQF/QQAoAtwJKAIMIgBBACgC0AlrQQF1QX8gABsLCwBBACgC3AkoAhwLHgEBf0EAKALcCSgCECIAQQAoAtAJa0EBdUF/IAAbCzsBAX8CQEEAKALcCSgCFCIAQQAoAsQJRw0AQX8PCwJAIABBACgCyAlHDQBBfg8LIABBACgC0AlrQQF1CwsAQQAoAtwJLQAYCxUAQQAoAuAJKAIAQQAoAtAJa0EBdQsVAEEAKALgCSgCBEEAKALQCWtBAXULHgEBf0EAKALgCSgCCCIAQQAoAtAJa0EBdUF/IAAbCx4BAX9BACgC4AkoAgwiAEEAKALQCWtBAXVBfyAAGwslAQF/QQBBACgC3AkiAEEkakHUCSAAGygCACIANgLcCSAAQQBHCyUBAX9BAEEAKALgCSIAQRBqQdgJIAAbKAIAIgA2AuAJIABBAEcLCABBAC0AiAoLCABBAC0AgAoLKwEBf0EAQQAoAowKIgBBEGpBACgC3AlBIGogABsoAgAiADYCjAogAEEARwsVAEEAKAKMCigCAEEAKALQCWtBAXULFQBBACgCjAooAgRBACgC0AlrQQF1CxUAQQAoAowKKAIIQQAoAtAJa0EBdQsVAEEAKAKMCigCDEEAKALQCWtBAXULCgBBAEEANgKMCgvdDQEFfyMAQYDQAGsiACQAQQBBAToAiApBAEEAKALMCTYClApBAEEAKALQCUF+aiIBNgKoCkEAIAFBACgC9AlBAXRqIgI2AqwKQQBBADoAgApBAEEAOwGQCkEAQQA7AZIKQQBBADoAmApBAEEANgKECkEAQQA6APAJQQAgAEGAEGo2ApwKQQAgADYCoApBAEEAOgCkCgJAAkACQAJAA0BBACABQQJqIgM2AqgKIAEgAk8NAQJAIAMvAQAiAkF3akEFSQ0AAkACQAJAAkACQCACQZt/ag4FAQgICAIACyACQSBGDQQgAkEvRg0DIAJBO0YNAgwHC0EALwGSCg0BIAMQG0UNASABQQRqQYIIQQoQNQ0BEBxBAC0AiAoNAUEAQQAoAqgKIgE2ApQKDAcLIAMQG0UNACABQQRqQYwIQQoQNQ0AEB0LQQBBACgCqAo2ApQKDAELAkAgAS8BBCIDQSpGDQAgA0EvRw0EEB4MAQtBARAfC0EAKAKsCiECQQAoAqgKIQEMAAsLQQAhAiADIQFBAC0A8AkNAgwBC0EAIAE2AqgKQQBBADoAiAoLA0BBACABQQJqIgM2AqgKAkACQAJAAkACQAJAAkAgAUEAKAKsCk8NACADLwEAIgJBd2pBBUkNBgJAAkACQAJAAkACQAJAAkACQAJAIAJBYGoOChAPBg8PDw8FAQIACwJAAkACQAJAIAJBoH9qDgoLEhIDEgESEhICAAsgAkGFf2oOAwURBgkLQQAvAZIKDRAgAxAbRQ0QIAFBBGpBgghBChA1DRAQHAwQCyADEBtFDQ8gAUEEakGMCEEKEDUNDxAdDA8LIAMQG0UNDiABKQAEQuyAhIOwjsA5Ug0OIAEvAQwiA0F3aiIBQRdLDQxBASABdEGfgIAEcUUNDAwNC0EAQQAvAZIKIgFBAWo7AZIKQQAoApwKIAFBA3RqIgFBATYCACABQQAoApQKNgIEDA0LQQAvAZIKIgNFDQlBACADQX9qIgM7AZIKQQAvAZAKIgJFDQxBACgCnAogA0H//wNxQQN0aigCAEEFRw0MAkAgAkECdEEAKAKgCmpBfGooAgAiAygCBA0AIANBACgClApBAmo2AgQLQQAgAkF/ajsBkAogAyABQQRqNgIMDAwLAkBBACgClAoiAS8BAEEpRw0AQQAoAuQJIgNFDQAgAygCBCABRw0AQQBBACgC6AkiAzYC5AkCQCADRQ0AIANBADYCJAwBC0EAQQA2AtQJC0EAQQAvAZIKIgNBAWo7AZIKQQAoApwKIANBA3RqIgNBBkECQQAtAKQKGzYCACADIAE2AgRBAEEAOgCkCgwLC0EALwGSCiIBRQ0HQQAgAUF/aiIBOwGSCkEAKAKcCiABQf//A3FBA3RqKAIAQQRGDQQMCgtBJxAgDAkLQSIQIAwICyACQS9HDQcCQAJAIAEvAQQiAUEqRg0AIAFBL0cNARAeDAoLQQEQHwwJCwJAAkACQAJAQQAoApQKIgEvAQAiAxAhRQ0AAkACQCADQVVqDgQACQEDCQsgAUF+ai8BAEErRg0DDAgLIAFBfmovAQBBLUYNAgwHCyADQSlHDQFBACgCnApBAC8BkgoiAkEDdGooAgQQIkUNAgwGCyABQX5qLwEAQVBqQf//A3FBCkLine truncated
async function initSyntaxLexers() {
await Promise.all([init$1(), init]);
}
const isTransform = process.execArgv.includes("--experimental-transform-types") || process.env.NODE_OPTIONS?.includes("--experimental-transform-types");
function transformCode(code, filename) {
const ext = extname(filename.split("?")[0]);
const isTs = ext === ".ts" || ext === ".cts" || ext === ".mts";
if (!isTs) {
return code;
}
if (!module$1.stripTypeScriptTypes) {
throw new Error(`Cannot parse '${filename}' because "module.stripTypeScriptTypes" is not supported. Module mocking requires Node.js 22.15 or higher. This is NOT a bug of Vitest.`);
}
return module$1.stripTypeScriptTypes(code, { mode: isTransform ? "transform" : "strip" });
}
const cachedFileExports = new Map();
function collectModuleExports(filename, code, format, exports$1 = []) {
if (format === "module") {
const [imports_, exports_] = parse(code, filename);
const fileExports = [...exports_.map((p) => p.n)];
imports_.forEach(({ ss: start, se: end, n: name }) => {
const substring = code.substring(start, end).replace(/ +/g, " ");
if (name && substring.startsWith("export *") && !substring.startsWith("export * as")) {
fileExports.push(...tryParseModule(name));
}
});
cachedFileExports.set(filename, fileExports);
exports$1.push(...fileExports);
} else {
const { exports: exports_, reexports } = parse$1(code, filename);
const fileExports = [...exports_];
reexports.forEach((name) => {
fileExports.push(...tryParseModule(name));
});
cachedFileExports.set(filename, fileExports);
exports$1.push(...fileExports);
}
function tryParseModule(name) {
try {
return parseModule(name);
} catch (error) {
console.warn(`[module mocking] Failed to parse '${name}' imported from ${filename}:`, error);
return [];
}
}
let __require;
function getModuleRequire() {
return __require ??= createRequire(filename);
}
function parseModule(name) {
if (isBuiltin(name)) {
if (cachedFileExports.has(name)) {
const cachedExports = cachedFileExports.get(name);
return cachedExports;
}
const builtinModule = getBuiltinModule(name);
const builtinExports = Object.keys(builtinModule);
cachedFileExports.set(name, builtinExports);
return builtinExports;
}
const resolvedModuleUrl = format === "module" ? import.meta.resolve(name, pathToFileURL(filename).toString()) : getModuleRequire().resolve(name);
const resolvedModulePath = format === "commonjs" ? resolvedModuleUrl : fileURLToPath(resolvedModuleUrl);
if (cachedFileExports.has(resolvedModulePath)) {
return cachedFileExports.get(resolvedModulePath);
}
const fileContent = readFileSync(resolvedModulePath, "utf-8");
const ext = extname(resolvedModulePath);
const code = transformCode(fileContent, resolvedModulePath);
if (code == null) {
cachedFileExports.set(resolvedModulePath, []);
return [];
}
const resolvedModuleFormat = resolveModuleFormat(resolvedModulePath, code);
if (ext === ".json") {
return ["default"];
} else {
// can't do wasm, for example
console.warn(`Cannot process '${resolvedModuleFormat}' imported from ${filename} because of unknown file extension: ${ext}.`);
}
if (resolvedModuleFormat) {
return collectModuleExports(resolvedModulePath, code, resolvedModuleFormat, exports$1);
}
return [];
}
return Array.from(new Set(exports$1));
}
function resolveModuleFormat(url, code) {
const ext = extname(url);
if (ext === ".cjs" || ext === ".cts") {
return "commonjs";
} else if (ext === ".mjs" || ext === ".mts") {
return "module";
} else if (ext === ".js" || ext === ".ts" || ext === "") {
if (!module$1.findPackageJSON) {
throw new Error(`Cannot parse the module format of '${url}' because "module.findPackageJSON" is not available. Upgrade to Node 22.14 to use this feature. This is NOT a bug of Vitest.`);
}
const pkgJsonPath = module$1.findPackageJSON(url);
const pkgJson = pkgJsonPath ? JSON.parse(readFileSync(pkgJsonPath, "utf-8")) : {};
if (pkgJson?.type === "module") {
return "module";
} else if (pkgJson?.type === "commonjs") {
return "commonjs";
} else {
// Ambiguous input! Check if it has ESM syntax. Node.js is much smarter here,
// but we don't need to run the code, so we can be more relaxed
if (hasESM(filterOutComments(code))) {
return "module";
} else {
return "commonjs";
}
}
}
return undefined;
}
let __globalRequire;
function getBuiltinModule(moduleId) {
__globalRequire ??= module$1.createRequire(import.meta.url);
return __globalRequire(moduleId);
}
const ESM_RE = /(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m;
function hasESM(code) {
return ESM_RE.test(code);
}
// TODO: better source map replacement
function automockModule(code, mockType, parse, options = {}) {
const globalThisAccessor = options.globalThisAccessor || "\"__vitest_mocker__\"";
let ast;
try {
ast = parse(code);
} catch (cause) {
if (options.id) {
throw new Error(`failed to parse ${options.id}`, { cause });
}
throw cause;
}
const m = new MagicString(code);
const allSpecifiers = [];
const replacers = [];
let importIndex = 0;
for (const _node of ast.body) {
if (_node.type === "ExportAllDeclaration") {
const node = _node;
// TODO: pass it down in the browser mode
if (!options.id) {
throw new Error(`automocking files with \`export *\` is not supported because it cannot be easily statically analysed`);
}
const source = node.source.value;
if (typeof source !== "string") {
throw new TypeError(`unknown source type while automocking: ${source}`);
}
const moduleUrl = import.meta.resolve(source, pathToFileURL(options.id).toString());
const modulePath = fileURLToPath(moduleUrl);
const moduleContent = readFileSync(modulePath, "utf-8");
const transformedCode = transformCode(moduleContent, moduleUrl);
const moduleFormat = resolveModuleFormat(moduleUrl, transformedCode);
const moduleExports = collectModuleExports(modulePath, transformedCode, moduleFormat || "module");
replacers.push(() => {
const importNames = [];
moduleExports.forEach((exportName) => {
const isReexported = allSpecifiers.some(({ name, alias }) => name === exportName || alias === exportName);
if (!isReexported) {
importNames.push(exportName);
allSpecifiers.push({ name: exportName });
}
});
const importString = `import { ${importNames.join(", ")} } from '${source}';`;
m.overwrite(node.start, node.end, importString);
});
}
if (_node.type === "ExportNamedDeclaration") {
const node = _node;
const declaration = node.declaration;
function traversePattern(expression) {
// export const test = '1'
if (expression.type === "Identifier") {
allSpecifiers.push({ name: expression.name });
} else if (expression.type === "ArrayPattern") {
expression.elements.forEach((element) => {
if (!element) {
return;
}
traversePattern(element);
});
} else if (expression.type === "ObjectPattern") {
expression.properties.forEach((property) => {
// export const { ...rest } = {}
if (property.type === "RestElement") {
traversePattern(property);
} else if (property.type === "Property") {
traversePattern(property.value);
} else ;
});
} else if (expression.type === "RestElement") {
traversePattern(expression.argument);
} else if (expression.type === "AssignmentPattern") {
throw new Error(`AssignmentPattern is not supported. Please open a new bug report.`);
} else if (expression.type === "MemberExpression") {
throw new Error(`MemberExpression is not supported. Please open a new bug report.`);
} else ;
}
if (declaration) {
if (declaration.type === "FunctionDeclaration") {
allSpecifiers.push({ name: declaration.id.name });
} else if (declaration.type === "VariableDeclaration") {
declaration.declarations.forEach((declaration) => {
traversePattern(declaration.id);
});
} else if (declaration.type === "ClassDeclaration") {
allSpecifiers.push({ name: declaration.id.name });
} else ;
m.remove(node.start, declaration.start);
}
const specifiers = node.specifiers || [];
const source = node.source;
if (!source && specifiers.length) {
specifiers.forEach((specifier) => {
allSpecifiers.push({
alias: getArbitraryModuleIdentifier(specifier.exported),
name: getArbitraryModuleIdentifier(specifier.local)
});
});
m.remove(node.start, node.end);
} else if (source && specifiers.length) {
const importNames = [];
specifiers.forEach((specifier) => {
const importedName = `__vitest_imported_${importIndex++}__`;
importNames.push([getArbitraryModuleIdentifier(specifier.local), importedName]);
allSpecifiers.push({
name: importedName,
alias: getArbitraryModuleIdentifier(specifier.exported)
});
});
const importString = `import { ${importNames.map(([name, alias]) => `${name} as ${alias}`).join(", ")} } from '${source.value}'`;
m.overwrite(node.start, node.end, importString);
}
}
if (_node.type === "ExportDefaultDeclaration") {
const node = _node;
const declaration = node.declaration;
allSpecifiers.push({
name: "__vitest_default",
alias: "default"
});
m.overwrite(node.start, declaration.start, `const __vitest_default = `);
}
}
replacers.forEach((cb) => cb());
const moduleObject = `
const __vitest_current_es_module__ = {
__esModule: true,
${allSpecifiers.map(({ name }) => `["${name}"]: ${name},`).join("\n ")}
}
const __vitest_mocked_module__ = globalThis[${globalThisAccessor}].mockObject(__vitest_current_es_module__, "${mockType}")
`;
const assigning = allSpecifiers.map(({ name }, index) => {
return `const __vitest_mocked_${index}__ = __vitest_mocked_module__["${name}"]`;
}).join("\n");
const redeclarations = allSpecifiers.map(({ name, alias }, index) => {
return ` __vitest_mocked_${index}__ as ${alias || name},`;
}).join("\n");
const specifiersExports = `
export {
${redeclarations}
}
`;
m.append(moduleObject + assigning + specifiersExports);
return m;
}
export { automockModule as a, collectModuleExports as c, esmWalker as e, initSyntaxLexers as i };
@@ -0,0 +1,9 @@
'use strict';
var $floor = require('./floor');
/** @type {import('./mod')} */
module.exports = function mod(number, modulo) {
var remain = number % modulo;
return $floor(remain >= 0 ? remain : remain + modulo);
};
@@ -0,0 +1,188 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _regenerator;
var _regeneratorDefine = require("./regeneratorDefine.js");
function _regenerator() {
var undefined;
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var _;
function wrap(innerFn, outerFn, self, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
(0, _regeneratorDefine.default)(generator, "_invoke", makeInvokeMethod(innerFn, self, tryLocsList), true);
return generator;
}
var ContinueSentinel = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
_ = Object.getPrototypeOf;
var IteratorPrototype = [][iteratorSymbol] ? _(_([][iteratorSymbol]())) : ((0, _regeneratorDefine.default)(_ = {}, iteratorSymbol, function () {
return this;
}), _);
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = GeneratorFunctionPrototype;
(0, _regeneratorDefine.default)(Gp, "constructor", GeneratorFunctionPrototype);
(0, _regeneratorDefine.default)(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
GeneratorFunction.displayName = "GeneratorFunction";
(0, _regeneratorDefine.default)(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
(0, _regeneratorDefine.default)(Gp);
(0, _regeneratorDefine.default)(Gp, toStringTagSymbol, "Generator");
(0, _regeneratorDefine.default)(Gp, iteratorSymbol, function () {
return this;
});
(0, _regeneratorDefine.default)(Gp, "toString", function () {
return "[object Generator]";
});
function mark(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
(0, _regeneratorDefine.default)(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
}
function makeInvokeMethod(innerFn, self, tryLocsList) {
var state = 0;
function invoke(_methodName, _method, _arg) {
if (state > 1) {
throw TypeError("Generator is already running");
} else if (done) {
if (_method === 1) {
Context_dispatchExceptionOrFinishOrAbrupt(_method, _arg);
}
}
method = _method;
arg = _arg;
while ((_ = method < 2 ? undefined : arg) || !done) {
if (!delegateIterator) {
if (!method) {
ctx.v = arg;
} else if (method < 3) {
if (method > 1) ctx.n = -1;
Context_dispatchExceptionOrFinishOrAbrupt(method, arg);
} else {
ctx.n = arg;
}
}
try {
state = 2;
if (delegateIterator) {
if (!method) _methodName = "next";
if (_ = delegateIterator[_methodName]) {
if (!(_ = _.call(delegateIterator, arg))) {
throw TypeError("iterator result is not an object");
}
if (!_.done) {
return _;
}
arg = _.value;
if (method < 2) {
method = 0;
}
} else {
if (method === 1 && (_ = delegateIterator["return"])) {
_.call(delegateIterator);
}
if (method < 2) {
arg = TypeError("The iterator does not provide a '" + _methodName + "' method");
method = 1;
}
}
delegateIterator = undefined;
} else {
if (done = ctx.n < 0) {
_ = arg;
} else {
_ = innerFn.call(self, ctx);
}
if (_ !== ContinueSentinel) {
break;
}
}
} catch (e) {
delegateIterator = undefined;
method = 1;
arg = e;
} finally {
state = 1;
}
}
return {
value: _,
done: done
};
}
var tryEntries = tryLocsList || [];
var done = false;
var delegateIterator;
var method;
var arg;
var ctx = {
p: 0,
n: 0,
v: undefined,
a: Context_dispatchExceptionOrFinishOrAbrupt,
f: Context_dispatchExceptionOrFinishOrAbrupt.bind(undefined, 4),
d: function (iterable, nextLoc) {
delegateIterator = iterable;
method = 0;
arg = undefined;
ctx.n = nextLoc;
return ContinueSentinel;
}
};
function Context_dispatchExceptionOrFinishOrAbrupt(_type, _arg) {
method = _type;
arg = _arg;
for (_ = 0; !done && state && !shouldReturn && _ < tryEntries.length; _++) {
var entry = tryEntries[_];
var prev = ctx.p;
var finallyLoc = entry[2];
var shouldReturn;
if (_type > 3) {
if (shouldReturn = finallyLoc === _arg) {
arg = entry[(method = entry[4]) ? 5 : (method = 3, 3)];
entry[4] = entry[5] = undefined;
}
} else {
if (entry[0] <= prev) {
if (shouldReturn = _type < 2 && prev < entry[1]) {
method = 0;
ctx.v = _arg;
ctx.n = entry[1];
} else if (prev < finallyLoc) {
if (shouldReturn = _type < 3 || entry[0] > _arg || _arg > finallyLoc) {
entry[4] = _type;
entry[5] = _arg;
ctx.n = finallyLoc;
method = 0;
}
}
}
}
}
if (shouldReturn || _type > 1) {
return ContinueSentinel;
}
done = true;
throw _arg;
}
return invoke;
}
return (exports.default = _regenerator = function () {
return {
w: wrap,
m: mark
};
})();
}
//# sourceMappingURL=regenerator.js.map
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/popper.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size,\n} from '@floating-ui/react-dom';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useSize } from '@radix-ui/react-use-size';\n\nimport type { Placement, Middleware } from '@floating-ui/react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Measurable } from '@radix-ui/rect';\n\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\ntype Side = (typeof SIDE_OPTIONS)[number];\ntype Align = (typeof ALIGN_OPTIONS)[number];\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n const anchorRef = React.useRef<Measurable | null>(null);\n React.useEffect(() => {\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef?.current || ref.current;\n if (previousAnchor !== anchorRef.current) {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(anchorRef.current);\n }\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial<Record<Side, number>>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n updatePositionStrategy?: 'optimized' | 'always';\n onPlaced?: () => void;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n siLine truncated
"mappings": ";;;AAAA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACK;AACP,YAAY,oBAAoB;AAChC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAkCpB;AA5BJ,IAAM,eAAe,CAAC,OAAO,SAAS,UAAU,MAAM;AACtD,IAAM,gBAAgB,CAAC,SAAS,UAAU,KAAK;AAS/C,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,IAAI,mBAAmB,WAAW;AAM/E,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,oBAAwC,WAAW;AAK9F,IAAM,SAAgC,CAAC,UAAoC;AACzE,QAAM,EAAE,eAAe,SAAS,IAAI;AACpC,QAAM,CAAC,QAAQ,SAAS,IAAU,eAA4B,IAAI;AAClE,SACE,oBAAC,kBAAe,OAAO,eAAe,QAAgB,gBAAgB,WACnE,UACH;AAEJ;AAEA,OAAO,cAAc;AAMrB,IAAM,cAAc;AAQpB,IAAM,eAAqB;AAAA,EACzB,CAAC,OAAuC,iBAAiB;AACvD,UAAM,EAAE,eAAe,YAAY,GAAG,YAAY,IAAI;AACtD,UAAM,UAAU,iBAAiB,aAAa,aAAa;AAC3D,UAAM,MAAY,aAA4B,IAAI;AAClD,UAAM,eAAe,gBAAgB,cAAc,GAAG;AAEtD,UAAM,YAAkB,aAA0B,IAAI;AACtD,IAAM,gBAAU,MAAM;AACpB,YAAM,iBAAiB,UAAU;AACjC,gBAAU,UAAU,YAAY,WAAW,IAAI;AAC/C,UAAI,mBAAmB,UAAU,SAAS;AAIxC,gBAAQ,eAAe,UAAU,OAAO;AAAA,MAC1C;AAAA,IACF,CAAC;AAED,WAAO,aAAa,OAAO,oBAAC,UAAU,KAAV,EAAe,GAAG,aAAa,KAAK,cAAc;AAAA,EAChF;AACF;AAEA,aAAa,cAAc;AAM3B,IAAM,eAAe;AAUrB,IAAM,CAAC,uBAAuB,iBAAiB,IAC7C,oBAA+C,YAAY;AAoB7D,IAAM,gBAAsB;AAAA,EAC1B,CAAC,OAAwC,iBAAiB;AACxD,UAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,eAAe;AAAA,MACf,kBAAkB;AAAA,MAClB,oBAAoB,CAAC;AAAA,MACrB,kBAAkB,uBAAuB;AAAA,MACzC,SAAS;AAAA,MACT,mBAAmB;AAAA,MACnB,yBAAyB;AAAA,MACzB;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AAEJ,UAAM,UAAU,iBAAiB,cAAc,aAAa;AAE5D,UAAM,CAAC,SAAS,UAAU,IAAU,eAAgC,IAAI;AACxE,UAAM,eAAe,gBAAgB,cAAc,CAAC,SAAS,WAAW,IAAI,CAAC;AAE7E,UAAM,CAAC,OAAO,QAAQ,IAAU,eAAiC,IAAI;AACrE,UAAM,YAAY,QAAQ,KAAK;AAC/B,UAAM,aAAa,WAAW,SAAS;AACvC,UAAM,cAAc,WAAW,UAAU;AAEzC,UAAM,mBAAoB,QAAQ,UAAU,WAAW,MAAM,QAAQ;AAErE,UAAM,mBACJ,OAAO,yBAAyB,WAC5B,uBACA,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,GAAG,qBAAqB;AAEtE,UAAM,WAAW,MAAM,QAAQ,iBAAiB,IAAI,oBAAoB,CAAC,iBAAiB;AAC1F,UAAM,wBAAwB,SAAS,SAAS;AAEhD,UAAM,wBAAwB;AAAA,MAC5B,SAAS;AAAA,MACT,UAAU,SAAS,OAAO,SAAS;AAAA;AAAA,MAEnC,aAAa;AAAA,IACf;AAEA,UAAM,EAAE,MAAM,gBAAgB,WAAW,cAAc,eAAe,IAAI,YAAY;AAAA;AAAA,MAEpF,UAAU;AAAA,MACV,WAAW;AAAA,MACX,sBAAsB,IAAI,SAAS;AACjC,cAAM,UAAU,WAAW,GAAG,MAAM;AAAA,UAClC,gBAAgB,2BAA2B;AAAA,QAC7C,CAAC;AACD,eAAO;AAAA,MACT;AAAA,MACA,UAAU;AAAA,QACR,WAAW,QAAQ;AAAA,MACrB;AAAA,MACA,YAAY;AAAA,QACV,OAAO,EAAE,UAAU,aAAa,aAAa,eAAe,YAAY,CAAC;AAAA,QACzE,mBACE,MAAM;AAAA,UACJ,UAAU;AAAA,UACV,WAAW;AAAA,UACX,SAAS,WAAW,YAAY,WAAW,IAAI;AAAA,UAC/C,GAAG;AAAA,QACL,CAAC;AAAA,QACH,mBAAmB,KAAK,EAAE,GAAG,sBAAsB,CAAC;AAAA,QACpD,KAAK;AAAA,UACH,GAAG;AAAA,UACH,OAAO,CAAC,EAAE,UAAU,OAAO,gBAAgB,gBAAgB,MAAM;AAC/D,kBAAM,EAAE,OAAO,aAAa,QAAQ,aAAa,IAAI,MAAM;AAC3D,kBAAM,eAAe,SAAS,SAAS;AACvC,yBAAa,YAAY,kCAAkC,GAAG,cAAc,IAAI;AAChF,yBAAa,YAAY,mCAAmC,GAAG,eAAe,IAAI;AAClF,yBAAa,YAAY,+BAA+B,GAAG,WAAW,IAAI;AAC1E,yBAAa,YAAY,gCAAgC,GAAG,YAAY,IAAI;AAAA,UAC9E;AAAA,QACF,CAAC;AAAA,QACD,SAAS,gBAAgB,EAAE,SAAS,OAAO,SAAS,aAAa,CAAC;AAAA,QAClE,gBAAgB,EAAE,YAAY,YAAY,CAAC;AAAA,QAC3C,oBAAoB,KAAK,EAAE,UAAU,mBAAmB,GAAG,sBAAsB,CAAC;AAAA,MACpF;AAAA,IACF,CAAC;AAED,UAAM,CAAC,YAAY,WAAW,IAAI,6BAA6B,SAAS;AAExE,UAAM,eAAe,eAAe,QAAQ;AAC5C,oBAAgB,MAAM;AACpB,UAAI,cAAc;AAChB,uBAAe;AAAA,MACjB;AAAA,IACF,GAAG,CAAC,cAAc,YAAY,CAAC;AAE/B,UAAM,SAAS,eAAe,OAAO;AACrC,UAAM,SAAS,eAAe,OAAO;AACrC,UAAM,oBAAoB,eAAe,OAAO,iBAAiB;AAEjE,UAAM,CAAC,eAAe,gBAAgB,IAAU,eAAiB;AACjE,oBAAgB,MAAM;AACpB,UAAI,QAAS,kBAAiB,OAAO,iBAAiB,OAAO,EAAE,MAAM;AAAA,IACvE,GAAG,CAAC,OAAO,CAAC;AAEZ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,KAAK;AAAA,QACV,qCAAkC;AAAA,QAClC,OAAO;AAAA,UACL,GAAG;AAAA,UACH,WAAW,eAAe,eAAe,YAAY;AAAA;AAAA,UACrD,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,CAAC,iCAAwC,GAAG;AAAA,YAC1C,eAAe,iBAAiB;AAAA,YAChC,eAAe,iBAAiB;AAAA,UAClC,EAAE,KAAK,GAAG;AAAA;AAAA;AAAA;AAAA,UAKV,GAAI,eAAe,MAAM,mBAAmB;AAAA,YAC1C,YAAY;AAAA,YACZ,eAAe;AAAA,UACjB;AAAA,QACF;AAAA,QAIA,KAAK,MAAM;AAAA,QAEX;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP;AAAA,YACA,eAAe;AAAA,YACf;AAAA,YACA;AAAA,YACA,iBAAiB;AAAA,YAEjB;AAAA,cAAC,UAAU;AAAA,cAAV;AAAA,gBACC,aAAW;AAAA,gBACX,cAAY;AAAA,gBACX,GAAG;AAAA,gBACJ,KAAK;AAAA,gBACL,OAAO;AAAA,kBACL,GAAG,aAAa;AAAA;AAAA;AAAA,kBAGhB,WAAW,CAAC,eAAe,SAAS;AAAA,gBACtC;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,cAAc,cAAc;AAM5B,IAAM,aAAa;AAEnB,IAAM,gBAAoC;AAAA,EACxC,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACR;AAMA,IAAM,cAAoB,iBAAiD,SAASA,aAClF,OACA,cACA;AACA,QAAM,EAAE,eAAe,GAAG,WAAW,IAAI;AACzC,QAAM,iBAAiB,kBAAkB,YAAY,aAAa;AAClE,QAAM,WAAW,cAAc,eAAe,UAAU;AAExD;AAAA;AAAA;AAAA;AAAA,IAIE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,eAAe;AAAA,QACpB,OAAO;AAAA,UACL,UAAU;AAAA,UACV,MAAM,eAAe;AAAA,UACrB,KAAK,eAAe;AAAA,UACpB,CAAC,QAAQ,GAAG;AAAA,UACZ,iBAAiB;AAAA,YACf,KAAK;AAAA,YACL,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,MAAM;AAAA,UACR,EAAE,eAAe,UAAU;AAAA,UAC3B,WAAW;AAAA,YACT,KAAK;AAAA,YACL,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,MAAM;AAAA,UACR,EAAE,eAAe,UAAU;AAAA,UAC3B,YAAY,eAAe,kBAAkB,WAAW;AAAA,QAC1D;AAAA,QAEA;AAAA,UAAgB;AAAA,UAAf;AAAA,YACE,GAAG;AAAA,YACJ,KAAK;AAAA,YACL,OAAO;AAAA,cACL,GAAG,WAAW;AAAA;AAAA,cAEd,SAAS;AAAA,YACX;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA;AAEJ,CAACLine truncated
"names": ["PopperArrow", "Root"]
}
@@ -0,0 +1,520 @@
export default `flf2a$ 5 5 79 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.0 -- 3 may 1995
____________________________________________________________ /\`____
| Michel Eftimakis | "Ascii-Artist" '\\/ |
| Michel.Eftimakis@vlsi.com | Boo)- (00) ||
| Tel : (33) 92 96 27 19 | (_\`'_) ||
|__ Fax : (33) 92 96 27 01 _________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
@
@
@
@
$$$$$$$$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
$$$$$$$$$@@
#########@
#########@
#########@
#########@
#########@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
_ _ _ __ __ _ @
/\\ |_) / | \\ |_ |_ / |_| @
/--\\ |_) \\_ |_/ |__ | \\_? | | @
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@
@
/| @
| @
@
$$$$$@@
_ @
) @
/_ @
@
$$$$$@@
_ @
_) @
_) @
@
$$$$$@@
. @
/| @
'-| @
@
$$$$$@@
_ @
|_ @
_) @
@
$$$$$@@
@
/ @
(_) @
@
$$$$$@@
__ @
/ @
/ @
@
$$$$$@@
_ @
(_) @
(_) @
@
$$$$$@@
@
@
@
@
@@
@
@
@
@
$$$$$$$$$@@
#########@
#########@
#########@
#########@
#########@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
######### ######### ___ ######### ######### @
##[\`'\`']# \\\`~'/ ##'\\v/\`## /\\*/\\ ##|\`+'|## '\\v/\` ##\\\`~'/## [\`'\`'] @
###| |## (o o) ##(o 0)## /(o o)\\ ##(o o)## (o 0) ##(o o)## | | @
###|__|## \\ / \\ ###(_)### (_) ###(_)### (_) ###\\ / \\# |__| @
######### " ######### ######### ####"####$$$$$$$$$@@
@
'\\v/\` @
(o 0) @
(_) @
$$$$$$$$$@@
@
\\\`~'/ @
(o o) @
\\ / \\ @
$$$$"$$$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
|\`+'| @
(o o) @
(_) @
$$$$$$$$$@@
@
|:+:| @
(o:o) @
(:) @
$$$$$$$$$@@
@
@
@
@
@@
@
':v:\` @
(o:0) @
(:) @
$$$$$$$$$@@
_ @
(:) @
|:| @
|:| @
$$$$$$$$$@@
_ @
(_) @
| | @
|_| @
$$$$$$$$$@@
___ @
/\\*/\\ @
/(o o)\\ @
(_) @
$$$$$$$$$@@
@
[\`'\`'] @
| | @
|__| @
$$$$$$$$$@@
@
@
@
@
@@
@
[\`'\`'] @
|::| @
|::| @
$$$$$$$$$@@
@
@
@
@
@@
@
\\\`.'/ @
(o:o) @
\\:/:\\ @
$$$$"$$$$@@
___ @
/\\:/\\ @
/(o:o)\\ @
(:) @
$$$$$$$$$@@
@
@
@
@
@@
######### ######### ######### ######### @
######### ######### ######### ######### @
######### ######### ######### ######### @
######### ######### ######### ######### @
######### ######### ######### #########$$$$$$$$$@@
_ ######### _ ######### _ ######### _ #########@
(_) ###(_)### (_) ###(_)### (_) ###(_)### (_) ###(_)###@
| | ###| |### | | ###| |### | | ###| |### | | ###| |###@
|_| ###|_|### |_| ###|_|### |_| ###|_|### |_| ###|_|###@
$$$$$$$$$######### ######### ######### #########@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
######### ######### ######### #########@
[\`'\`'] ##\\\`.'/## ':v:\` ##/\\:/\\## |:+:| ##':v:\`## \\\`.'/ ##[\`'\`']#@
|::| ##(o:o)## (o:0) #/(o:o)\\# (o:o) ##(o:0)## (o:o) ###|::|##@
|::| ###\\:/:\\# (:) ###(:)### (:) ###(:)### \\:/:\\ ###|::|##@
$$$$$$$$$####"#### ######### ######### " #########@@
#########@
##'\\v/\`##@
##(o 0)##@
###(_)###@
#########@@
#########@
##\\\`~'/##@
##(o o)##@
###\\ / \\#@
####"####@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
#########@
##|\`+'|##@
##(o o)##@
###(_)###@
#########@@
#########@
##|:+:|##@
##(o:o)##@
###(:)###@
#########@@
@
@
@
@
@@
#########@
##':v:\`##@
##(o:0)##@
###(:)###@
#########@@
#########@
###(:)###@
###|:|###@
###|:|###@
#########@@
#########@
###(_)###@
###| |###@
###|_|###@
#########@@
#########@
##/\\*/\\##@
#/(o o)\\#@
###(_)###@
#########@@
#########@
##[\`'\`']#@
###| |##@
###|__|##@
#########@@
@
@
@
@
@@
#########@
##[\`'\`']#@
###|::|##@
###|::|##@
#########@@
@
@
@
@
@@
#########@
##\\\`.'/##@
##(o:o)##@
###\\:/:\\#@
####"####@@
#########@
##/\\:/\\##@
#/(o:o)\\#@
###(:)###@
#########@@
@
@
@
@
@@
######### ######### ######### #########@
######### ######### ######### #########@
######### ######### ######### #########@
######### ######### ######### #########@
$$$$$$$$$######### ######### ######### #########@@
######### _ ######### _ ######### _ ######### _ @
###(:)### (:) ###(:)### (:) ###(:)### (:) ###(:)### (:) @
###|:|### |:| ###|:|### |:| ###|:|### |:| ###|:|### |:| @
###|:|### |:| ###|:|### |:| ###|:|### |:| ###|:|### |:| @
######### ######### ######### #########$$$$$$$$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
`
@@ -0,0 +1 @@
{"version":3,"file":"loader.js","sources":["../../../src/icons/loader.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Loader\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMnY0IiAvPgogIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogIDxwYXRoIGQ9Ik0xOCAxMmg0IiAvPgogIDxwYXRoIGQ9Im0xNi4yIDE2LjIgMi45IDIuOSIgLz4KICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICA8cGF0aCBkPSJtNC45IDE5LjEgMi45LTIuOSIgLz4KICA8cGF0aCBkPSJNMiAxMmg0IiAvPgogIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/loader\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 Loader = createLucideIcon('Loader', [\n ['path', { d: 'M12 2v4', key: '3427ic' }],\n ['path', { d: 'm16.2 7.8 2.9-2.9', key: 'r700ao' }],\n ['path', { d: 'M18 12h4', key: 'wj9ykh' }],\n ['path', { d: 'm16.2 16.2 2.9 2.9', key: '1bxg5t' }],\n ['path', { d: 'M12 18v4', key: 'jadmvz' }],\n ['path', { d: 'm4.9 19.1 2.9-2.9', key: 'bwix9q' }],\n ['path', { d: 'M2 12h4', key: 'j09sii' }],\n ['path', { d: 'm4.9 4.9 2.9 2.9', key: 'giyufr' }],\n]);\n\nexport default Loader;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,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,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,CAAsB,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,CACnD,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,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,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;AACnD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,16 @@
/**
* @license React
* react-compiler-runtime.production.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 ReactSharedInternals =
require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
exports.c = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
};
@@ -0,0 +1 @@
{"version":3,"file":"defaultRenderHandler.cjs","names":[],"sources":["../../../src/ssr/defaultRenderHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { renderRouterToString } from './renderRouterToString'\nimport { RouterServer } from './RouterServer'\n\nexport const defaultRenderHandler = defineHandlerCallback(\n ({ router, responseHeaders }) =>\n renderRouterToString({\n router,\n responseHeaders,\n children: <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;;AAIA,IAAa,wBAAA,+CAAA,wBACV,EAAE,QAAQ,sBACT,6BAAA,qBAAqB;CACnB;CACA;CACA,UAAU,iBAAA,GAAA,kBAAA,KAAC,qBAAA,cAAD,EAAsB,QAAU,CAAA;CAC3C,CAAC,CACL"}
@@ -0,0 +1 @@
{"version":3,"file":"corner-left-down.js","sources":["../../../src/icons/corner-left-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CornerLeftDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxNCAxNSA5IDIwIDQgMTUiIC8+CiAgPHBhdGggZD0iTTIwIDRoLTdhNCA0IDAgMCAwLTQgNHYxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-left-down\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 CornerLeftDown = createLucideIcon('CornerLeftDown', [\n ['polyline', { points: '14 15 9 20 4 15', key: 'nkc4i' }],\n ['path', { d: 'M20 4h-7a4 4 0 0 0-4 4v12', key: 'nbpdq2' }],\n]);\n\nexport default CornerLeftDown;\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,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,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;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,3 @@
declare const DOMExceptionPlugin: any;
export default DOMExceptionPlugin;
//# sourceMappingURL=dom-exception.d.ts.map
@@ -0,0 +1,195 @@
#!/usr/bin/env node
/**
* @fileoverview Main CLI that is run via the eslint command.
* @author Nicholas C. Zakas
*/
/* eslint no-console:off -- CLI */
"use strict";
const mod = require("node:module");
// to use V8's code cache to speed up instantiation time
mod.enableCompileCache?.();
// must do this initialization *before* other requires in order to work
if (process.argv.includes("--debug")) {
require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*");
}
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Read data from stdin til the end.
*
* Note: See
* - https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin
* - https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io
* - https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html
* - https://github.com/nodejs/node/issues/7439 (historical)
*
* On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems
* to read 4096 bytes before blocking and never drains to read further data.
*
* The investigation on the Emacs thread indicates:
*
* > Emacs on MS-Windows uses pipes to communicate with subprocesses; a
* > pipe on Windows has a 4K buffer. So as soon as Emacs writes more than
* > 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for
* > the subprocess to read its end of the pipe, at which time Emacs will
* > write the rest of the stuff.
* @returns {Promise<string>} The read text.
*/
function readStdin() {
return new Promise((resolve, reject) => {
let content = "";
let chunk = "";
process.stdin
.setEncoding("utf8")
.on("readable", () => {
while ((chunk = process.stdin.read()) !== null) {
content += chunk;
}
})
.on("end", () => resolve(content))
.on("error", reject);
});
}
/**
* Get the error message of a given value.
* @param {any} error The value to get.
* @returns {string} The error message.
*/
function getErrorMessage(error) {
// Lazy loading because this is used only if an error happened.
const util = require("node:util");
// Foolproof -- third-party module might throw non-object.
if (typeof error !== "object" || error === null) {
return String(error);
}
// Use templates if `error.messageTemplate` is present.
if (typeof error.messageTemplate === "string") {
try {
const template = require(`../messages/${error.messageTemplate}.js`);
return template(error.messageData || {});
} catch {
// Ignore template error then fallback to use `error.stack`.
}
}
// Use the stacktrace if it's an error object.
if (typeof error.stack === "string") {
return error.stack;
}
// Otherwise, dump the object.
return util.format("%o", error);
}
/**
* Tracks error messages that are shown to the user so we only ever show the
* same message once.
* @type {Set<string>}
*/
const displayedErrors = new Set();
/**
* Tracks whether an unexpected error was caught
* @type {boolean}
*/
let hadFatalError = false;
/**
* Catch and report unexpected error.
* @param {any} error The thrown error object.
* @returns {void}
*/
function onFatalError(error) {
process.exitCode = 2;
hadFatalError = true;
const { version } = require("../package.json");
const message = `
Oops! Something went wrong! :(
ESLint: ${version}
${getErrorMessage(error)}`;
if (!displayedErrors.has(message)) {
console.error(message);
displayedErrors.add(message);
}
}
//------------------------------------------------------------------------------
// Execution
//------------------------------------------------------------------------------
(async function main() {
process.on("uncaughtException", onFatalError);
process.on("unhandledRejection", onFatalError);
// Call the config initializer if `--init` is present.
if (process.argv.includes("--init")) {
// `eslint --init` has been moved to `@eslint/create-config`
console.warn(
"You can also run this command directly using 'npm init @eslint/config@latest'.",
);
const spawn = require("cross-spawn");
spawn.sync("npm", ["init", "@eslint/config@latest"], {
encoding: "utf8",
stdio: "inherit",
});
return;
}
// start the MCP server if `--mcp` is present
if (process.argv.includes("--mcp")) {
console.warn(
"You can also run this command directly using 'npx @eslint/mcp@latest'.",
);
const spawn = require("cross-spawn");
spawn.sync("npx", ["@eslint/mcp@latest"], {
encoding: "utf8",
stdio: "inherit",
});
return;
}
// Otherwise, call the CLI.
const cli = require("../lib/cli");
const exitCode = await cli.execute(
process.argv,
process.argv.includes("--stdin") ? await readStdin() : void 0,
);
/*
* If an uncaught exception or unhandled rejection was detected in the meantime,
* keep the fatal exit code 2 that is already assigned to `process.exitCode`.
* Without this condition, exit code 2 (unsuccessful execution) could be overwritten with
* 1 (successful execution, lint problems found) or even 0 (successful execution, no lint problems found).
* This ensures that unexpected errors that seemingly don't affect the success
* of the execution will still cause a non-zero exit code, as it's a common
* practice and the default behavior of Node.js to exit with non-zero
* in case of an uncaught exception or unhandled rejection.
*
* Otherwise, assign the exit code returned from CLI.
*/
if (!hadFatalError) {
process.exitCode = exitCode;
}
})().catch(onFatalError);
@@ -0,0 +1,197 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-explicit-any',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow the `any` type',
recommended: 'recommended',
},
fixable: 'code',
hasSuggestions: true,
messages: {
suggestNever: "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
suggestPropertyKey: 'Use `PropertyKey` instead, this is more explicit than `keyof any`.',
suggestUnknown: 'Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.',
unexpectedAny: 'Unexpected any. Specify a different type.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
fixToUnknown: {
type: 'boolean',
description: 'Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.',
},
ignoreRestArgs: {
type: 'boolean',
description: 'Whether to ignore rest parameter arrays.',
},
},
},
],
},
defaultOptions: [
{
fixToUnknown: false,
ignoreRestArgs: false,
},
],
create(context, [{ fixToUnknown, ignoreRestArgs }]) {
/**
* Checks if the node is an arrow function, function/constructor declaration or function expression
* @param node the node to be validated.
* @returns true if the node is any kind of function declaration or expression
* @private
*/
function isNodeValidFunction(node) {
return [
utils_1.AST_NODE_TYPES.ArrowFunctionExpression, // const x = (...args: any[]) => {};
utils_1.AST_NODE_TYPES.FunctionDeclaration, // function f(...args: any[]) {}
utils_1.AST_NODE_TYPES.FunctionExpression, // const x = function(...args: any[]) {};
utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, // type T = {(...args: any[]): unknown};
utils_1.AST_NODE_TYPES.TSConstructorType, // type T = new (...args: any[]) => unknown
utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, // type T = {new (...args: any[]): unknown};
utils_1.AST_NODE_TYPES.TSDeclareFunction, // declare function _8(...args: any[]): unknown;
utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, // declare class A { f(...args: any[]): unknown; }
utils_1.AST_NODE_TYPES.TSFunctionType, // type T = (...args: any[]) => unknown;
utils_1.AST_NODE_TYPES.TSMethodSignature, // type T = {f(...args: any[]): unknown};
].includes(node.type);
}
/**
* Checks if the node is a rest element child node of a function
* @param node the node to be validated.
* @returns true if the node is a rest element child node of a function
* @private
*/
function isNodeRestElementInFunction(node) {
return (node.type === utils_1.AST_NODE_TYPES.RestElement &&
isNodeValidFunction(node.parent));
}
/**
* Checks if the node is a TSTypeOperator node with a readonly operator
* @param node the node to be validated.
* @returns true if the node is a TSTypeOperator node with a readonly operator
* @private
*/
function isNodeReadonlyTSTypeOperator(node) {
return (node.type === utils_1.AST_NODE_TYPES.TSTypeOperator &&
node.operator === 'readonly');
}
/**
* Checks if the node is a TSTypeReference node with an Array identifier
* @param node the node to be validated.
* @returns true if the node is a TSTypeReference node with an Array identifier
* @private
*/
function isNodeValidArrayTSTypeReference(node) {
return (node.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
node.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
['Array', 'ReadonlyArray'].includes(node.typeName.name));
}
/**
* Checks if the node is a valid TSTypeOperator or TSTypeReference node
* @param node the node to be validated.
* @returns true if the node is a valid TSTypeOperator or TSTypeReference node
* @private
*/
function isNodeValidTSType(node) {
return (isNodeReadonlyTSTypeOperator(node) ||
isNodeValidArrayTSTypeReference(node));
}
/**
* Checks if the great grand-parent node is a RestElement node in a function
* @param node the node to be validated.
* @returns true if the great grand-parent node is a RestElement node in a function
* @private
*/
function isGreatGrandparentRestElement(node) {
return (node.parent?.parent?.parent != null &&
isNodeRestElementInFunction(node.parent.parent.parent));
}
/**
* Checks if the great great grand-parent node is a valid RestElement node in a function
* @param node the node to be validated.
* @returns true if the great great grand-parent node is a valid RestElement node in a function
* @private
*/
function isGreatGreatGrandparentRestElement(node) {
return (node.parent?.parent?.parent?.parent != null &&
isNodeValidTSType(node.parent.parent) &&
isNodeRestElementInFunction(node.parent.parent.parent.parent));
}
/**
* Checks if the great grand-parent or the great great grand-parent node is a RestElement node
* @param node the node to be validated.
* @returns true if the great grand-parent or the great great grand-parent node is a RestElement node
* @private
*/
function isNodeDescendantOfRestElementInFunction(node) {
return (isGreatGrandparentRestElement(node) ||
isGreatGreatGrandparentRestElement(node));
}
/**
* Checks if the node is within a keyof any expression
* @param node the node to be validated.
* @returns true if the node is within a keyof any expression, false otherwise
* @private
*/
function isNodeWithinKeyofAny(node) {
return (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeOperator &&
node.parent.operator === 'keyof');
}
/**
* Creates a fixer that replaces a keyof any with PropertyKey
* @param node the node to be fixed.
* @returns a function that will fix the node.
* @private
*/
function createPropertyKeyFixer(node) {
return (fixer) => {
return fixer.replaceText(node.parent, 'PropertyKey');
};
}
return {
TSAnyKeyword(node) {
const isKeyofAny = isNodeWithinKeyofAny(node);
if (ignoreRestArgs && isNodeDescendantOfRestElementInFunction(node)) {
return;
}
const fixOrSuggest = {
fix: null,
suggest: isKeyofAny
? [
{
messageId: 'suggestPropertyKey',
fix: createPropertyKeyFixer(node),
},
]
: [
{
messageId: 'suggestUnknown',
fix: fixer => fixer.replaceText(node, 'unknown'),
},
{
messageId: 'suggestNever',
fix: fixer => fixer.replaceText(node, 'never'),
},
],
};
if (fixToUnknown) {
fixOrSuggest.fix = isKeyofAny
? createPropertyKeyFixer(node)
: fixer => fixer.replaceText(node, 'unknown');
}
context.report({
node,
messageId: 'unexpectedAny',
...fixOrSuggest,
});
},
};
},
});
@@ -0,0 +1,14 @@
import type * as core from "../core/index.js";
import * as schemas from "./schemas.js";
/** Mini counterpart of `classic/deep-partial.ts`'s `DeepPartial`. */
export type DeepPartial<T extends core.SomeType> = T extends schemas.ZodMiniObject<infer Shape, infer Config> ? schemas.ZodMiniObject<{
-readonly [K in keyof Shape]: schemas.ZodMiniOptional<DeepPartial<Shape[K]>>;
}, Config> : T extends schemas.ZodMiniDiscriminatedUnion<infer Options, any> ? schemas.ZodMiniUnion<{
-readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I];
}> : T extends schemas.ZodMiniUnion<infer Options> ? schemas.ZodMiniUnion<{
-readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I];
}> : T extends schemas.ZodMiniArray<infer El> ? schemas.ZodMiniArray<DeepPartial<El>> : T extends schemas.ZodMiniTuple<infer Items, infer Rest> ? schemas.ZodMiniTuple<{
-readonly [K in keyof Items]: Items[K] extends core.SomeType ? DeepPartial<Items[K]> : Items[K];
}, Rest extends core.SomeType ? DeepPartial<Rest> : Rest> : T extends schemas.ZodMiniIntersection<infer A, infer B> ? schemas.ZodMiniIntersection<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodMiniRecord<infer K, infer V> ? schemas.ZodMiniRecord<K, DeepPartial<V>> : T extends schemas.ZodMiniMap<infer K, infer V> ? schemas.ZodMiniMap<K, DeepPartial<V>> : T extends schemas.ZodMiniSet<infer El> ? schemas.ZodMiniSet<DeepPartial<El>> : T extends schemas.ZodMiniOptional<infer Inner> ? schemas.ZodMiniOptional<DeepPartial<Inner>> : T extends schemas.ZodMiniNullable<infer Inner> ? schemas.ZodMiniNullable<DeepPartial<Inner>> : T extends schemas.ZodMiniDefault<infer Inner> ? schemas.ZodMiniDefault<DeepPartial<Inner>> : T extends schemas.ZodMiniPrefault<infer Inner> ? schemas.ZodMiniPrefault<DeepPartial<Inner>> : T extends schemas.ZodMiniNonOptional<infer Inner> ? schemas.ZodMiniNonOptional<DeepPartial<Inner>> : T extends schemas.ZodMiniCatch<infer Inner> ? schemas.ZodMiniCatch<DeepPartial<Inner>> : T extends schemas.ZodMiniReadonly<infer Inner> ? schemas.ZodMiniReadonly<DeepPartial<Inner>> : T extends schemas.ZodMiniSuccess<infer Inner> ? schemas.ZodMiniSuccess<DeepPartial<Inner>> : T extends schemas.ZodMiniPromise<infer Inner> ? schemas.ZodMiniPromise<DeepPartial<Inner>> : T extends schemas.ZodMiniCodec<infer A, infer B> ? schemas.ZodMiniCodec<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodMiniPipe<infer A, infer B> ? schemas.ZodMiniPipe<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodMiniLazy<infer Inner> ? schemas.ZodMiniLazy<DeepPartial<Inner>> : T;
/** See `classic/deep-partial.ts`. Mini variant uses `mini.partial(...)`. */
export declare function deepPartial<T extends core.SomeType>(schema: T): DeepPartial<T>;
@@ -0,0 +1,152 @@
/**
* The `node:querystring` module provides utilities for parsing and formatting URL
* query strings. It can be accessed using:
*
* ```js
* import querystring from 'node:querystring';
* ```
*
* `querystring` is more performant than `URLSearchParams` but is not a
* standardized API. Use `URLSearchParams` when performance is not critical or
* when compatibility with browser code is desirable.
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/querystring.js)
*/
declare module "querystring" {
interface StringifyOptions {
/**
* The function to use when converting URL-unsafe characters to percent-encoding in the query string.
* @default `querystring.escape()`
*/
encodeURIComponent?: ((str: string) => string) | undefined;
}
interface ParseOptions {
/**
* Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations.
* @default 1000
*/
maxKeys?: number | undefined;
/**
* The function to use when decoding percent-encoded characters in the query string.
* @default `querystring.unescape()`
*/
decodeURIComponent?: ((str: string) => string) | undefined;
}
interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
interface ParsedUrlQueryInput extends
NodeJS.Dict<
| string
| number
| boolean
| bigint
| ReadonlyArray<string | number | boolean | bigint>
| null
>
{}
/**
* The `querystring.stringify()` method produces a URL query string from a
* given `obj` by iterating through the object's "own properties".
*
* It serializes the following types of values passed in `obj`: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
* [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
* [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
* [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
* [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
* [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
* [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
* [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
* empty strings.
*
* ```js
* querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });
* // Returns 'foo=bar&#x26;baz=qux&#x26;baz=quux&#x26;corge='
*
* querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':');
* // Returns 'foo:bar;baz:qux'
* ```
*
* By default, characters requiring percent-encoding within the query string will
* be encoded as UTF-8\. If an alternative encoding is required, then an alternative `encodeURIComponent` option will need to be specified:
*
* ```js
* // Assuming gbkEncodeURIComponent function already exists,
*
* querystring.stringify({ w: '中文', foo: 'bar' }, null, null,
* { encodeURIComponent: gbkEncodeURIComponent });
* ```
* @since v0.1.25
* @param obj The object to serialize into a URL query string
* @param [sep='&'] The substring used to delimit key and value pairs in the query string.
* @param [eq='='] . The substring used to delimit keys and values in the query string.
*/
function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
/**
* The `querystring.parse()` method parses a URL query string (`str`) into a
* collection of key and value pairs.
*
* For example, the query string `'foo=bar&#x26;abc=xyz&#x26;abc=123'` is parsed into:
*
* ```json
* {
* "foo": "bar",
* "abc": ["xyz", "123"]
* }
* ```
*
* The object returned by the `querystring.parse()` method _does not_ prototypically inherit from the JavaScript `Object`. This means that typical `Object` methods such as `obj.toString()`,
* `obj.hasOwnProperty()`, and others
* are not defined and _will not work_.
*
* By default, percent-encoded characters within the query string will be assumed
* to use UTF-8 encoding. If an alternative character encoding is used, then an
* alternative `decodeURIComponent` option will need to be specified:
*
* ```js
* // Assuming gbkDecodeURIComponent function already exists...
*
* querystring.parse('w=%D6%D0%CE%C4&#x26;foo=bar', null, null,
* { decodeURIComponent: gbkDecodeURIComponent });
* ```
* @since v0.1.25
* @param str The URL query string to parse
* @param [sep='&'] The substring used to delimit key and value pairs in the query string.
* @param [eq='='] The substring used to delimit keys and values in the query string.
*/
function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
/**
* The querystring.encode() function is an alias for querystring.stringify().
*/
const encode: typeof stringify;
/**
* The querystring.decode() function is an alias for querystring.parse().
*/
const decode: typeof parse;
/**
* The `querystring.escape()` method performs URL percent-encoding on the given `str` in a manner that is optimized for the specific requirements of URL
* query strings.
*
* The `querystring.escape()` method is used by `querystring.stringify()` and is
* generally not expected to be used directly. It is exported primarily to allow
* application code to provide a replacement percent-encoding implementation if
* necessary by assigning `querystring.escape` to an alternative function.
* @since v0.1.25
*/
function escape(str: string): string;
/**
* The `querystring.unescape()` method performs decoding of URL percent-encoded
* characters on the given `str`.
*
* The `querystring.unescape()` method is used by `querystring.parse()` and is
* generally not expected to be used directly. It is exported primarily to allow
* application code to provide a replacement decoding implementation if
* necessary by assigning `querystring.unescape` to an alternative function.
*
* By default, the `querystring.unescape()` method will attempt to use the
* JavaScript built-in `decodeURIComponent()` method to decode. If that fails,
* a safer equivalent that does not throw on malformed URLs will be used.
* @since v0.1.25
*/
function unescape(str: string): string;
}
declare module "node:querystring" {
export * from "querystring";
}
@@ -0,0 +1,86 @@
const { Readable } = require('stream')
const { Agent, EnvHttpProxyAgent, RetryAgent, fetch } = require('undici')
const { promises: fs } = require('graceful-fs')
const log = require('./log')
async function download (gyp, url) {
log.http('GET', url)
const requestOpts = {
headers: {
'User-Agent': `node-gyp v${gyp.version} (node ${process.version})`,
Connection: 'keep-alive'
},
dispatcher: await createDispatcher(gyp)
}
let res
try {
res = await fetch(url, requestOpts)
} catch (err) {
// Built-in fetch wraps low-level errors in "TypeError: fetch failed" with
// the underlying error on .cause. Callers inspect .code (e.g. ENOTFOUND).
if (err.cause) {
throw err.cause
}
throw err
}
log.http(res.status, res.url)
const body = res.body ? Readable.fromWeb(res.body) : Readable.from([])
return {
status: res.status,
url: res.url,
body,
text: async () => {
let data = ''
body.setEncoding('utf8')
for await (const chunk of body) {
data += chunk
}
return data
}
}
}
async function createDispatcher (gyp) {
const env = process.env
const hasProxyEnv = env.http_proxy || env.HTTP_PROXY || env.https_proxy || env.HTTPS_PROXY
if (!gyp.opts.proxy && !gyp.opts.cafile && !hasProxyEnv) {
return new RetryAgent(new Agent(), { maxRetries: 3 })
}
const opts = {}
if (gyp.opts.cafile) {
const ca = await readCAFile(gyp.opts.cafile)
// EnvHttpProxyAgent forwards opts to both its internal Agent (direct) and
// ProxyAgent (proxied). Agent reads TLS config from `connect`; ProxyAgent
// reads it from `requestTls` (origin) / `proxyTls` (proxy). Set all three
// so the custom CA is applied regardless of which path a request takes.
opts.connect = { ca }
opts.requestTls = { ca }
opts.proxyTls = { ca }
}
if (gyp.opts.proxy) {
opts.httpProxy = gyp.opts.proxy
opts.httpsProxy = gyp.opts.proxy
}
if (gyp.opts.noproxy) {
opts.noProxy = gyp.opts.noproxy
}
return new RetryAgent(new EnvHttpProxyAgent(opts), { maxRetries: 3 })
}
async function readCAFile (filename) {
// The CA file can contain multiple certificates so split on certificate
// boundaries. [\S\s]*? is used to match everything including newlines.
const ca = await fs.readFile(filename, 'utf8')
const re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g
return ca.match(re)
}
module.exports = {
download,
readCAFile
}
@@ -0,0 +1,46 @@
{
"name": "fresh",
"description": "HTTP response freshness testing",
"version": "2.0.0",
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
],
"license": "MIT",
"keywords": [
"fresh",
"http",
"conditional",
"cache"
],
"repository": "jshttp/fresh",
"devDependencies": {
"beautify-benchmark": "0.2.4",
"benchmark": "2.1.4",
"eslint": "8.12.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-standard": "4.1.0",
"mocha": "9.2.0",
"nyc": "15.1.0"
},
"files": [
"HISTORY.md",
"LICENSE",
"index.js"
],
"engines": {
"node": ">= 0.8"
},
"scripts": {
"bench": "node benchmark/index.js",
"lint": "eslint .",
"test": "mocha --reporter spec --check-leaks --bail test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
}
}
@@ -0,0 +1,30 @@
//#region src/utils/concurrent.ts
/**
* @module
* Concurrent utility.
*/
const DEFAULT_CONCURRENCY = 1024;
const createPool = ({ concurrency, interval } = {}) => {
concurrency ||= DEFAULT_CONCURRENCY;
if (concurrency === Infinity) return { run: async (fn) => fn() };
const pool = /* @__PURE__ */ new Set();
const run = async (fn, promise, resolve) => {
if (pool.size >= concurrency) {
promise ||= new Promise((r) => resolve = r);
setTimeout(() => run(fn, promise, resolve));
return promise;
}
const marker = {};
pool.add(marker);
const result = await fn();
if (interval) setTimeout(() => pool.delete(marker), interval);
else pool.delete(marker);
if (resolve) {
resolve(result);
return promise;
} else return result;
};
return { run };
};
//#endregion
export { createPool };
@@ -0,0 +1,64 @@
{
"name": "@tanstack/history",
"version": "1.161.6",
"description": "Modern and scalable routing for React applications",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/TanStack/router.git",
"directory": "packages/history"
},
"homepage": "https://tanstack.com/router",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
"history",
"typescript"
],
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"engines": {
"node": ">=20.19"
},
"devDependencies": {
"vite": "*"
},
"scripts": {
"clean": "rimraf ./dist && rimraf ./coverage",
"test:eslint": "eslint ./src",
"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
"test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js",
"test:types:ts59": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"build": "vite build"
}
}
@@ -0,0 +1,42 @@
{
"root": true,
"extends": "@ljharb",
"env": {
"es6": true,
"es2017": true,
"es2020": true,
"es2021": true,
"es2022": true,
},
"globals": {
"Float16Array": false,
},
"rules": {
"array-bracket-newline": 0,
"complexity": 0,
"eqeqeq": [2, "allow-null"],
"func-name-matching": 0,
"id-length": 0,
"max-lines": 0,
"max-lines-per-function": [2, 90],
"max-params": [2, 4],
"max-statements": 0,
"max-statements-per-line": [2, { "max": 2 }],
"multiline-comment-style": 0,
"no-magic-numbers": 0,
"sort-keys": 0,
},
"overrides": [
{
"files": "test/**",
"rules": {
"new-cap": 0,
},
},
],
}
@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseIntersectionDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const isJsonSchema7AllOfType = (type) => {
if ("type" in type && type.type === "string")
return false;
return "allOf" in type;
};
function parseIntersectionDef(def, refs) {
const allOf = [
(0, parseDef_js_1.parseDef)(def.left._def, {
...refs,
currentPath: [...refs.currentPath, "allOf", "0"],
}),
(0, parseDef_js_1.parseDef)(def.right._def, {
...refs,
currentPath: [...refs.currentPath, "allOf", "1"],
}),
].filter((x) => !!x);
let unevaluatedProperties = refs.target === "jsonSchema2019-09"
? { unevaluatedProperties: false }
: undefined;
const mergedAllOf = [];
// If either of the schemas is an allOf, merge them into a single allOf
allOf.forEach((schema) => {
if (isJsonSchema7AllOfType(schema)) {
mergedAllOf.push(...schema.allOf);
if (schema.unevaluatedProperties === undefined) {
// If one of the schemas has no unevaluatedProperties set,
// the merged schema should also have no unevaluatedProperties set
unevaluatedProperties = undefined;
}
}
else {
let nestedSchema = schema;
if ("additionalProperties" in schema &&
schema.additionalProperties === false) {
const { additionalProperties, ...rest } = schema;
nestedSchema = rest;
}
else {
// As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
unevaluatedProperties = undefined;
}
mergedAllOf.push(nestedSchema);
}
});
return mergedAllOf.length
? {
allOf: mergedAllOf,
...unevaluatedProperties,
}
: undefined;
}
exports.parseIntersectionDef = parseIntersectionDef;
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parsePipelineDef = void 0;
const parseDef_js_1 = require("../parseDef.js");
const parsePipelineDef = (def, refs) => {
if (refs.pipeStrategy === "input") {
return (0, parseDef_js_1.parseDef)(def.in._def, refs);
}
else if (refs.pipeStrategy === "output") {
return (0, parseDef_js_1.parseDef)(def.out._def, refs);
}
const a = (0, parseDef_js_1.parseDef)(def.in._def, {
...refs,
currentPath: [...refs.currentPath, "allOf", "0"],
});
const b = (0, parseDef_js_1.parseDef)(def.out._def, {
...refs,
currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"],
});
return {
allOf: [a, b].filter((x) => x !== undefined),
};
};
exports.parsePipelineDef = parsePipelineDef;
@@ -0,0 +1,38 @@
'use strict';
var test = require('tape');
var $Object = require('../');
var isObject = require('../isObject');
var ToObject = require('../ToObject');
var RequireObjectCoercible = require('..//RequireObjectCoercible');
test('errors', function (t) {
t.equal($Object, Object);
// @ts-expect-error
t['throws'](function () { ToObject(null); }, TypeError);
// @ts-expect-error
t['throws'](function () { ToObject(undefined); }, TypeError);
// @ts-expect-error
t['throws'](function () { RequireObjectCoercible(null); }, TypeError);
// @ts-expect-error
t['throws'](function () { RequireObjectCoercible(undefined); }, TypeError);
t.deepEqual(RequireObjectCoercible(true), true);
t.deepEqual(ToObject(true), Object(true));
t.deepEqual(ToObject(42), Object(42));
var f = function () {};
t.equal(ToObject(f), f);
t.equal(isObject(undefined), false);
t.equal(isObject(null), false);
t.equal(isObject({}), true);
t.equal(isObject([]), true);
t.equal(isObject(function () {}), true);
var obj = {};
t.equal(RequireObjectCoercible(obj), obj);
t.equal(ToObject(obj), obj);
t.end();
});
@@ -0,0 +1,19 @@
/**
* @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 Currency = createLucideIcon("Currency", [
["circle", { cx: "12", cy: "12", r: "8", key: "46899m" }],
["line", { x1: "3", x2: "6", y1: "3", y2: "6", key: "1jkytn" }],
["line", { x1: "21", x2: "18", y1: "3", y2: "6", key: "14zfjt" }],
["line", { x1: "3", x2: "6", y1: "21", y2: "18", key: "iusuec" }],
["line", { x1: "21", x2: "18", y1: "21", y2: "18", key: "yj2dd7" }]
]);
export { Currency as default };
//# sourceMappingURL=currency.js.map
@@ -0,0 +1,11 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type Options = [
{
fixMixedExportsWithInlineTypeSpecifier: boolean;
}
];
export type MessageIds = 'multipleExportsAreTypes' | 'singleExportIsType' | 'typeOverValue';
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1 @@
{"version":3,"file":"signpost.js","sources":["../../../src/icons/signpost.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Signpost\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTN2OCIgLz4KICA8cGF0aCBkPSJNMTIgM3YzIiAvPgogIDxwYXRoIGQ9Ik0xOCA2YTIgMiAwIDAgMSAxLjM4Ny41NmwyLjMwNyAyLjIyYTEgMSAwIDAgMSAwIDEuNDRsLTIuMzA3IDIuMjJBMiAyIDAgMCAxIDE4IDEzSDZhMiAyIDAgMCAxLTEuMzg3LS41NmwtMi4zMDYtMi4yMmExIDEgMCAwIDEgMC0xLjQ0bDIuMzA2LTIuMjJBMiAyIDAgMCAxIDYgNnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/signpost\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 Signpost = createLucideIcon('Signpost', [\n ['path', { d: 'M12 13v8', key: '1l5pq0' }],\n ['path', { d: 'M12 3v3', key: '1n5kay' }],\n [\n 'path',\n {\n d: 'M18 6a2 2 0 0 1 1.387.56l2.307 2.22a1 1 0 0 1 0 1.44l-2.307 2.22A2 2 0 0 1 18 13H6a2 2 0 0 1-1.387-.56l-2.306-2.22a1 1 0 0 1 0-1.44l2.306-2.22A2 2 0 0 1 6 6z',\n key: 'gqqp9m',\n },\n ],\n]);\n\nexport default Signpost;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,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,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,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,337 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = generateMissingPluginMessage;
const pluginNameMap = {
asyncDoExpressions: {
syntax: {
name: "@babel/plugin-syntax-async-do-expressions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions"
}
},
decimal: {
syntax: {
name: "@babel/plugin-syntax-decimal",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal"
}
},
decorators: {
syntax: {
name: "@babel/plugin-syntax-decorators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators"
},
transform: {
name: "@babel/plugin-proposal-decorators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators"
}
},
doExpressions: {
syntax: {
name: "@babel/plugin-syntax-do-expressions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions"
},
transform: {
name: "@babel/plugin-proposal-do-expressions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions"
}
},
exportDefaultFrom: {
syntax: {
name: "@babel/plugin-syntax-export-default-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from"
},
transform: {
name: "@babel/plugin-proposal-export-default-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from"
}
},
flow: {
syntax: {
name: "@babel/plugin-syntax-flow",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow"
},
transform: {
name: "@babel/preset-flow",
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow"
}
},
functionBind: {
syntax: {
name: "@babel/plugin-syntax-function-bind",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind"
},
transform: {
name: "@babel/plugin-proposal-function-bind",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind"
}
},
functionSent: {
syntax: {
name: "@babel/plugin-syntax-function-sent",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent"
},
transform: {
name: "@babel/plugin-proposal-function-sent",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent"
}
},
jsx: {
syntax: {
name: "@babel/plugin-syntax-jsx",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx"
},
transform: {
name: "@babel/preset-react",
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react"
}
},
pipelineOperator: {
syntax: {
name: "@babel/plugin-syntax-pipeline-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator"
},
transform: {
name: "@babel/plugin-proposal-pipeline-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator"
}
},
recordAndTuple: {
syntax: {
name: "@babel/plugin-syntax-record-and-tuple",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple"
}
},
throwExpressions: {
syntax: {
name: "@babel/plugin-syntax-throw-expressions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions"
},
transform: {
name: "@babel/plugin-proposal-throw-expressions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions"
}
},
typescript: {
syntax: {
name: "@babel/plugin-syntax-typescript",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript"
},
transform: {
name: "@babel/preset-typescript",
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript"
}
}
};
Object.assign(pluginNameMap, {
asyncGenerators: {
syntax: {
name: "@babel/plugin-syntax-async-generators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
},
transform: {
name: "@babel/plugin-transform-async-generator-functions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions"
}
},
classProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
},
transform: {
name: "@babel/plugin-transform-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
}
},
classPrivateProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
},
transform: {
name: "@babel/plugin-transform-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
}
},
classPrivateMethods: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
},
transform: {
name: "@babel/plugin-transform-private-methods",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods"
}
},
classStaticBlock: {
syntax: {
name: "@babel/plugin-syntax-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
},
transform: {
name: "@babel/plugin-transform-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block"
}
},
dynamicImport: {
syntax: {
name: "@babel/plugin-syntax-dynamic-import",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
}
},
exportNamespaceFrom: {
syntax: {
name: "@babel/plugin-syntax-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
},
transform: {
name: "@babel/plugin-transform-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from"
}
},
importAssertions: {
syntax: {
name: "@babel/plugin-syntax-import-assertions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
}
},
importAttributes: {
syntax: {
name: "@babel/plugin-syntax-import-attributes",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes"
}
},
importMeta: {
syntax: {
name: "@babel/plugin-syntax-import-meta",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
}
},
logicalAssignment: {
syntax: {
name: "@babel/plugin-syntax-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
},
transform: {
name: "@babel/plugin-transform-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators"
}
},
moduleStringNames: {
syntax: {
name: "@babel/plugin-syntax-module-string-names",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
}
},
numericSeparator: {
syntax: {
name: "@babel/plugin-syntax-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
},
transform: {
name: "@babel/plugin-transform-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator"
}
},
nullishCoalescingOperator: {
syntax: {
name: "@babel/plugin-syntax-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
},
transform: {
name: "@babel/plugin-transform-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
}
},
objectRestSpread: {
syntax: {
name: "@babel/plugin-syntax-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
},
transform: {
name: "@babel/plugin-transform-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread"
}
},
optionalCatchBinding: {
syntax: {
name: "@babel/plugin-syntax-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
},
transform: {
name: "@babel/plugin-transform-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding"
}
},
optionalChaining: {
syntax: {
name: "@babel/plugin-syntax-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
},
transform: {
name: "@babel/plugin-transform-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining"
}
},
privateIn: {
syntax: {
name: "@babel/plugin-syntax-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
},
transform: {
name: "@babel/plugin-transform-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object"
}
},
regexpUnicodeSets: {
syntax: {
name: "@babel/plugin-syntax-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
},
transform: {
name: "@babel/plugin-transform-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
}
}
});
const getNameURLCombination = ({
name,
url
}) => `${name} (${url})`;
function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) {
let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;
const pluginInfo = pluginNameMap[missingPluginName];
if (pluginInfo) {
const {
syntax: syntaxPlugin,
transform: transformPlugin
} = pluginInfo;
if (syntaxPlugin) {
const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
if (transformPlugin) {
const transformPluginInfo = getNameURLCombination(transformPlugin);
const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets";
helpMessage += `\n\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.
If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;
} else {
helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`;
}
}
}
const msgFilename = filename === "unknown" ? "<name of the input file>" : filename;
helpMessage += `
If you already added the plugin for this syntax to your config, it's possible that your config \
isn't being loaded.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \
configuration:
\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
`;
return helpMessage;
}
0 && 0;
//# sourceMappingURL=missing-plugin-helper.js.map
@@ -0,0 +1 @@
{"version":3,"file":"batcher.mjs","sources":["../../../src/frameloop/batcher.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(\n flagRunNextFrame,\n allowKeepAlive ? key : undefined\n )\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,UAAU,GAAG,EAAE;AAEf,SAAU,mBAAmB,CAC/B,iBAA+C,EAC/C,cAAuB,EAAA;IAEvB,IAAI,YAAY,GAAG,KAAK;IACxB,IAAI,iBAAiB,GAAG,IAAI;AAE5B,IAAA,MAAM,KAAK,GAAc;AACrB,QAAA,KAAK,EAAE,GAAG;AACV,QAAA,SAAS,EAAE,GAAG;AACd,QAAA,YAAY,EAAE,KAAK;KACtB;IAED,MAAM,gBAAgB,GAAG,OAAO,YAAY,GAAG,IAAI,CAAC;IAEpD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACzC,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,gBAAgB,CACvB,gBAAgB,EAChB,cAAc,GAAG,GAAG,GAAG,SAAS,CACnC;AACD,QAAA,OAAO,GAAG;IACd,CAAC,EAAE,EAAW,CAAC;AAEf,IAAA,MAAM,EACF,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,UAAU,GACb,GAAG,KAAK;IAET,MAAM,YAAY,GAAG,MAAK;AACtB,QAAA,MAAM,eAAe,GAAG,kBAAkB,CAAC,eAAe;QAC1D,MAAM,SAAS,GAAG;cACZ,KAAK,CAAC;AACR,cAAE,WAAW,CAAC,GAAG,EAAE;QACvB,YAAY,GAAG,KAAK;QAEpB,IAAI,CAAC,eAAe,EAAE;YAClB,KAAK,CAAC,KAAK,GAAG;kBACR,IAAI,GAAG;kBACP,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QACxE;AAEA,QAAA,KAAK,CAAC,SAAS,GAAG,SAAS;AAC3B,QAAA,KAAK,CAAC,YAAY,GAAG,IAAI;;AAGzB,QAAA,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACpB,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACnB,QAAA,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC;AAC/B,QAAA,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;AACxB,QAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AACrB,QAAA,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;AACxB,QAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;AACrB,QAAA,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;AAEzB,QAAA,KAAK,CAAC,YAAY,GAAG,KAAK;AAE1B,QAAA,IAAI,YAAY,IAAI,cAAc,EAAE;YAChC,iBAAiB,GAAG,KAAK;YACzB,iBAAiB,CAAC,YAAY,CAAC;QACnC;AACJ,IAAA,CAAC;IAED,MAAM,IAAI,GAAG,MAAK;QACd,YAAY,GAAG,IAAI;QACnB,iBAAiB,GAAG,IAAI;AAExB,QAAA,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;YACrB,iBAAiB,CAAC,YAAY,CAAC;QACnC;AACJ,IAAA,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AAC5C,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC;AACvB,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,KAAI;AAClE,YAAA,IAAI,CAAC,YAAY;AAAE,gBAAA,IAAI,EAAE;YAEzB,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;AACvD,QAAA,CAAC;AACD,QAAA,OAAO,GAAG;IACd,CAAC,EAAE,EAAa,CAAC;AAEjB,IAAA,MAAM,MAAM,GAAG,CAAC,OAAgB,KAAI;AAChC,QAAA,KAAK,IAAI,CAAC,GAALine truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_4D","2":"_KB"},C:{"1":"_LF","2":"_q _ZG _L"},D:{"1":"_AK","2":"_jJ"},E:{"1":"_PC","2":"_3C"},F:{"1":"_0J","2":"_j _BC _O"},G:{"1":"_9N","2":"_AF _sG"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"1":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:7,C:"Directory selection from file input",D:true};
@@ -0,0 +1,11 @@
export type MessageIds = 'omittingRestParameter' | 'omittingSingleParameter' | 'singleParameterDifference';
export type Options = [
{
ignoreDifferentlyNamedParameters?: boolean;
ignoreOverloadsWithDifferentJSDoc?: boolean;
}
];
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,21 @@
Copyright (c) 2013 Kael Zhang <i@kael.me>, contributors
http://kael.me/
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,224 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
/**
* Check whatever node can be considered as simple
* @param node the node to be evaluated.
*/
function isSimpleType(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.Identifier:
case utils_1.AST_NODE_TYPES.TSAnyKeyword:
case utils_1.AST_NODE_TYPES.TSBooleanKeyword:
case utils_1.AST_NODE_TYPES.TSNeverKeyword:
case utils_1.AST_NODE_TYPES.TSNumberKeyword:
case utils_1.AST_NODE_TYPES.TSBigIntKeyword:
case utils_1.AST_NODE_TYPES.TSObjectKeyword:
case utils_1.AST_NODE_TYPES.TSStringKeyword:
case utils_1.AST_NODE_TYPES.TSSymbolKeyword:
case utils_1.AST_NODE_TYPES.TSUnknownKeyword:
case utils_1.AST_NODE_TYPES.TSVoidKeyword:
case utils_1.AST_NODE_TYPES.TSNullKeyword:
case utils_1.AST_NODE_TYPES.TSArrayType:
case utils_1.AST_NODE_TYPES.TSUndefinedKeyword:
case utils_1.AST_NODE_TYPES.TSThisType:
case utils_1.AST_NODE_TYPES.TSQualifiedName:
return true;
case utils_1.AST_NODE_TYPES.TSTypeReference:
if (node.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
node.typeName.name === 'Array') {
if (!node.typeArguments) {
return true;
}
if (node.typeArguments.params.length === 1) {
return isSimpleType(node.typeArguments.params[0]);
}
}
else {
if (node.typeArguments) {
return false;
}
return isSimpleType(node.typeName);
}
return false;
default:
return false;
}
}
/**
* Check if node needs parentheses
* @param node the node to be evaluated.
*/
function typeNeedsParentheses(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSTypeReference:
return typeNeedsParentheses(node.typeName);
case utils_1.AST_NODE_TYPES.TSUnionType:
case utils_1.AST_NODE_TYPES.TSFunctionType:
case utils_1.AST_NODE_TYPES.TSIntersectionType:
case utils_1.AST_NODE_TYPES.TSTypeOperator:
case utils_1.AST_NODE_TYPES.TSInferType:
case utils_1.AST_NODE_TYPES.TSConstructorType:
case utils_1.AST_NODE_TYPES.TSConditionalType:
return true;
case utils_1.AST_NODE_TYPES.Identifier:
return node.name === 'ReadonlyArray';
default:
return false;
}
}
exports.default = (0, util_1.createRule)({
name: 'array-type',
meta: {
type: 'suggestion',
docs: {
description: 'Require consistently using either `T[]` or `Array<T>` for arrays',
recommended: 'stylistic',
},
fixable: 'code',
messages: {
errorStringArray: "Array type using '{{className}}<{{type}}>' is forbidden. Use '{{readonlyPrefix}}{{type}}[]' instead.",
errorStringArrayReadonly: "Array type using '{{className}}<{{type}}>' is forbidden. Use '{{readonlyPrefix}}{{type}}' instead.",
errorStringArraySimple: "Array type using '{{className}}<{{type}}>' is forbidden for simple types. Use '{{readonlyPrefix}}{{type}}[]' instead.",
errorStringArraySimpleReadonly: "Array type using '{{className}}<{{type}}>' is forbidden for simple types. Use '{{readonlyPrefix}}{{type}}' instead.",
errorStringGeneric: "Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden. Use '{{className}}<{{type}}>' instead.",
errorStringGenericSimple: "Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden for non-simple types. Use '{{className}}<{{type}}>' instead.",
},
schema: [
{
type: 'object',
$defs: {
arrayOption: {
type: 'string',
enum: ['array', 'generic', 'array-simple'],
},
},
additionalProperties: false,
properties: {
default: {
$ref: '#/items/0/$defs/arrayOption',
description: 'The array type expected for mutable cases.',
},
readonly: {
$ref: '#/items/0/$defs/arrayOption',
description: 'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
},
},
},
],
},
defaultOptions: [
{
default: 'array',
},
],
create(context, [options]) {
const defaultOption = options.default;
const readonlyOption = options.readonly ?? defaultOption;
/**
* @param node the node to be evaluated.
*/
function getMessageType(node) {
if (isSimpleType(node)) {
return context.sourceCode.getText(node);
}
return 'T';
}
return {
TSArrayType(node) {
const isReadonly = node.parent.type === utils_1.AST_NODE_TYPES.TSTypeOperator &&
node.parent.operator === 'readonly';
const currentOption = isReadonly ? readonlyOption : defaultOption;
if (currentOption === 'array' ||
(currentOption === 'array-simple' && isSimpleType(node.elementType))) {
return;
}
const messageId = currentOption === 'generic'
? 'errorStringGeneric'
: 'errorStringGenericSimple';
const errorNode = isReadonly ? node.parent : node;
context.report({
node: errorNode,
messageId,
data: {
type: getMessageType(node.elementType),
className: isReadonly ? 'ReadonlyArray' : 'Array',
readonlyPrefix: isReadonly ? 'readonly ' : '',
},
fix(fixer) {
const typeNode = node.elementType;
const arrayType = isReadonly ? 'ReadonlyArray' : 'Array';
return [
fixer.replaceTextRange([errorNode.range[0], typeNode.range[0]], `${arrayType}<`),
fixer.replaceTextRange([typeNode.range[1], errorNode.range[1]], '>'),
];
},
});
},
TSTypeReference(node) {
if (node.typeName.type !== utils_1.AST_NODE_TYPES.Identifier ||
!(node.typeName.name === 'Array' ||
node.typeName.name === 'ReadonlyArray' ||
node.typeName.name === 'Readonly') ||
(node.typeName.name === 'Readonly' &&
node.typeArguments?.params[0].type !== utils_1.AST_NODE_TYPES.TSArrayType)) {
return;
}
for (let scope = context.sourceCode.getScope(node); scope.upper; scope = scope.upper) {
if (scope.set.has(node.typeName.name)) {
return;
}
}
const isReadonlyWithGenericArrayType = node.typeName.name === 'Readonly' &&
node.typeArguments?.params[0].type === utils_1.AST_NODE_TYPES.TSArrayType;
const isReadonlyArrayType = node.typeName.name === 'ReadonlyArray' ||
isReadonlyWithGenericArrayType;
const currentOption = isReadonlyArrayType
? readonlyOption
: defaultOption;
if (currentOption === 'generic') {
return;
}
const readonlyPrefix = isReadonlyArrayType ? 'readonly ' : '';
const typeParams = node.typeArguments?.params;
const messageId = currentOption === 'array'
? isReadonlyWithGenericArrayType
? 'errorStringArrayReadonly'
: 'errorStringArray'
: isReadonlyArrayType && node.typeName.name !== 'ReadonlyArray'
? 'errorStringArraySimpleReadonly'
: 'errorStringArraySimple';
if (!typeParams) {
return;
}
if (typeParams.length !== 1 ||
(currentOption === 'array-simple' && !isSimpleType(typeParams[0]))) {
return;
}
const type = typeParams[0];
const typeParens = typeNeedsParentheses(type);
const parentParens = readonlyPrefix &&
node.parent.type === utils_1.AST_NODE_TYPES.TSArrayType &&
!(0, util_1.isParenthesized)(node.parent.elementType, context.sourceCode);
const start = `${parentParens ? '(' : ''}${readonlyPrefix}${typeParens ? '(' : ''}`;
const end = `${typeParens ? ')' : ''}${isReadonlyWithGenericArrayType ? '' : `[]`}${parentParens ? ')' : ''}`;
context.report({
node,
messageId,
data: {
type: getMessageType(type),
className: isReadonlyArrayType ? node.typeName.name : 'Array',
readonlyPrefix,
},
fix(fixer) {
return [
fixer.replaceTextRange([node.range[0], type.range[0]], start),
fixer.replaceTextRange([type.range[1], node.range[1]], end),
];
},
});
},
};
},
});
@@ -0,0 +1,165 @@
import { Autocomplete } from './utility'
/**
* The header type declaration of `undici`.
*/
export type IncomingHttpHeaders = Record<string, string | string[] | undefined>
/**
* The header type declaration of `undici` for outgoing requests.
*/
export type OutgoingHttpHeaders = Record<string, number | string | string[] | undefined>
type HeaderNames = Autocomplete<
| 'Accept'
| 'Accept-CH'
| 'Accept-Charset'
| 'Accept-Encoding'
| 'Accept-Language'
| 'Accept-Patch'
| 'Accept-Post'
| 'Accept-Ranges'
| 'Access-Control-Allow-Credentials'
| 'Access-Control-Allow-Headers'
| 'Access-Control-Allow-Methods'
| 'Access-Control-Allow-Origin'
| 'Access-Control-Expose-Headers'
| 'Access-Control-Max-Age'
| 'Access-Control-Request-Headers'
| 'Access-Control-Request-Method'
| 'Age'
| 'Allow'
| 'Alt-Svc'
| 'Alt-Used'
| 'Authorization'
| 'Cache-Control'
| 'Clear-Site-Data'
| 'Connection'
| 'Content-Disposition'
| 'Content-Encoding'
| 'Content-Language'
| 'Content-Length'
| 'Content-Location'
| 'Content-Range'
| 'Content-Security-Policy'
| 'Content-Security-Policy-Report-Only'
| 'Content-Type'
| 'Cookie'
| 'Cross-Origin-Embedder-Policy'
| 'Cross-Origin-Opener-Policy'
| 'Cross-Origin-Resource-Policy'
| 'Date'
| 'Device-Memory'
| 'ETag'
| 'Expect'
| 'Expect-CT'
| 'Expires'
| 'Forwarded'
| 'From'
| 'Host'
| 'If-Match'
| 'If-Modified-Since'
| 'If-None-Match'
| 'If-Range'
| 'If-Unmodified-Since'
| 'Keep-Alive'
| 'Last-Modified'
| 'Link'
| 'Location'
| 'Max-Forwards'
| 'Origin'
| 'Permissions-Policy'
| 'Priority'
| 'Proxy-Authenticate'
| 'Proxy-Authorization'
| 'Range'
| 'Referer'
| 'Referrer-Policy'
| 'Retry-After'
| 'Sec-Fetch-Dest'
| 'Sec-Fetch-Mode'
| 'Sec-Fetch-Site'
| 'Sec-Fetch-User'
| 'Sec-Purpose'
| 'Sec-WebSocket-Accept'
| 'Server'
| 'Server-Timing'
| 'Service-Worker-Navigation-Preload'
| 'Set-Cookie'
| 'SourceMap'
| 'Strict-Transport-Security'
| 'TE'
| 'Timing-Allow-Origin'
| 'Trailer'
| 'Transfer-Encoding'
| 'Upgrade'
| 'Upgrade-Insecure-Requests'
| 'User-Agent'
| 'Vary'
| 'Via'
| 'WWW-Authenticate'
| 'X-Content-Type-Options'
| 'X-Frame-Options'
>
type IANARegisteredMimeType = Autocomplete<
| 'audio/aac'
| 'video/x-msvideo'
| 'image/avif'
| 'video/av1'
| 'application/octet-stream'
| 'image/bmp'
| 'text/css'
| 'text/csv'
| 'application/vnd.ms-fontobject'
| 'application/epub+zip'
| 'image/gif'
| 'application/gzip'
| 'text/html'
| 'image/x-icon'
| 'text/calendar'
| 'image/jpeg'
| 'text/javascript'
| 'application/json'
| 'application/ld+json'
| 'audio/x-midi'
| 'audio/mpeg'
| 'video/mp4'
| 'video/mpeg'
| 'audio/ogg'
| 'video/ogg'
| 'application/ogg'
| 'audio/opus'
| 'font/otf'
| 'application/pdf'
| 'image/png'
| 'application/rtf'
| 'image/svg+xml'
| 'image/tiff'
| 'video/mp2t'
| 'font/ttf'
| 'text/plain'
| 'application/wasm'
| 'video/webm'
| 'audio/webm'
| 'image/webp'
| 'font/woff'
| 'font/woff2'
| 'application/xhtml+xml'
| 'application/xml'
| 'application/zip'
| 'video/3gpp'
| 'video/3gpp2'
| 'model/gltf+json'
| 'model/gltf-binary'
>
type KnownHeaderValues = {
'content-type': IANARegisteredMimeType
}
export type HeaderRecord = {
[K in HeaderNames | Lowercase<HeaderNames>]?: Lowercase<K> extends keyof KnownHeaderValues
? KnownHeaderValues[Lowercase<K>]
: string
}
@@ -0,0 +1,8 @@
import { ContentSecurityPolicyOptionHandler, NONCE, SecureHeadersVariables, secureHeaders } from "./secure-headers.js";
//#region src/middleware/secure-headers/index.d.ts
declare module '../..' {
interface ContextVariableMap extends SecureHeadersVariables {}
}
//#endregion
export { type ContentSecurityPolicyOptionHandler, NONCE, type SecureHeadersVariables, secureHeaders };
export {};
@@ -0,0 +1,77 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const memorize = require("./memoize");
const getUrl = memorize(() => require("url"));
const PATH_QUERY_FRAGMENT_REGEXP =
/^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
const ZERO_ESCAPE_REGEXP = /\0(.)/g;
const FILE_REG_EXP = /file:/i;
/**
* @param {string} identifier identifier
* @returns {[string, string, string] | null} parsed identifier
*/
function parseIdentifier(identifier) {
if (!identifier) {
return null;
}
if (FILE_REG_EXP.test(identifier)) {
identifier = getUrl().fileURLToPath(identifier);
}
const firstEscape = identifier.indexOf("\0");
// Handle `\0`
if (firstEscape !== -1) {
const match = PATH_QUERY_FRAGMENT_REGEXP.exec(identifier);
if (!match) return null;
return [
match[1].replace(ZERO_ESCAPE_REGEXP, "$1"),
match[2] ? match[2].replace(ZERO_ESCAPE_REGEXP, "$1") : "",
match[3] || "",
];
}
// Fast path for inputs that don't use \0 escaping.
const queryStart = identifier.indexOf("?");
// Start at index 1 to ignore a possible leading hash.
const fragmentStart = identifier.indexOf("#", 1);
if (fragmentStart < 0) {
if (queryStart < 0) {
// No fragment, no query
return [identifier, "", ""];
}
// Query, no fragment
return [identifier.slice(0, queryStart), identifier.slice(queryStart), ""];
}
if (queryStart < 0 || fragmentStart < queryStart) {
// Fragment, no query
return [
identifier.slice(0, fragmentStart),
"",
identifier.slice(fragmentStart),
];
}
// Query and fragment
return [
identifier.slice(0, queryStart),
identifier.slice(queryStart, fragmentStart),
identifier.slice(fragmentStart),
];
}
module.exports.parseIdentifier = parseIdentifier;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"1":"_zH","2":"_tG"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_c"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"1":"_C"}},B:4,C:"Proximity API",D:true};
@@ -0,0 +1,124 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "tecken", verb: "att ha" },
file: { unit: "bytes", verb: "att ha" },
array: { unit: "objekt", verb: "att innehålla" },
set: { unit: "objekt", verb: "att innehålla" },
map: { unit: "objekt", verb: "att innehålla" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "reguljärt uttryck",
email: "e-postadress",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-datum och tid",
date: "ISO-datum",
time: "ISO-tid",
duration: "ISO-varaktighet",
ipv4: "IPv4-adress",
ipv6: "IPv6-adress",
mac: "MAC-adress",
cidrv4: "IPv4-spektrum",
cidrv6: "IPv6-spektrum",
base64: "base64-kodad sträng",
base64url: "base64url-kodad sträng",
json_string: "JSON-sträng",
e164: "E.164-nummer",
credit_card: "kreditkortsnummer",
currency_code: "valutakod",
iban: "IBAN",
jwt: "JWT",
template_literal: "mall-literal",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "antal",
array: "lista",
};
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 `Ogiltig inmatning: förväntat instanceof ${issue.expected}, fick ${received}`;
}
return `Ogiltig inmatning: förväntat ${expected}, fick ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Ogiltig inmatning: förväntat ${util.stringifyPrimitive(issue.values[0])}`;
return `Ogiltigt val: förväntade en av ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
}
return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
}
if (_issue.format === "ends_with") return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
if (_issue.format === "includes") return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
if (_issue.format === "regex") return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
case "invalid_union":
return "Ogiltig input";
case "invalid_element":
return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
default:
return `Ogiltig input`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,21 @@
/**
* @fileoverview Assertion utilities equivalent to the Node.js node:asserts module.
* @author Josh Goldberg
*/
"use strict";
/**
* Throws an error if the input is not truthy.
* @param {unknown} value The input that is checked for being truthy.
* @param {string} message Message to throw if the input is not truthy.
* @returns {void}
* @throws {Error} When the condition is not truthy.
*/
function ok(value, message = "Assertion failed.") {
if (!value) {
throw new Error(message);
}
}
module.exports = ok;