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

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

No files matched your search

@@ -0,0 +1,718 @@
flf2a$ 7 7 20 -1 3
banner4 by Merlin Greywolf merlin@brahms.udel.edu
August 9, 1994
...@
...@
...@
...@
...@
...@
...@@
.####@
.####@
.####@
..##.@
.....@
.####@
.####@@
.####.####@
.####.####@
..##...##.@
..........@
..........@
..........@
..........@@
...##.##..@
...##.##..@
.#########@
...##.##..@
.#########@
...##.##..@
...##.##..@@
..########.@
.##..##..##@
.##..##....@
..########.@
.....##..##@
.##..##..##@
..########.@@
.#####...##..@
.##.##..##...@
.#####.##....@
......##.....@
.....##.#####@
....##..##.##@
...##...#####@@
...####...@
..##..##..@
...####...@
..####....@
.##..##.##@
.##...##..@
..####..##@@
.####@
.####@
..##.@
.##..@
.....@
.....@
.....@@
...###@
..##..@
.##...@
.##...@
.##...@
..##..@
...###@@
.###..@
...##.@
....##@
....##@
....##@
...##.@
.###..@@
..........@
..##...##.@
...##.##..@
.#########@
...##.##..@
..##...##.@
..........@@
.......@
...##..@
...##..@
.######@
...##..@
...##..@
.......@@
.....@
.....@
.....@
.####@
.####@
..##.@
.##..@@
........@
........@
........@
.#######@
........@
........@
........@@
....@
....@
....@
....@
....@
.###@
.###@@
.......##@
......##.@
.....##..@
....##...@
...##....@
..##.....@
.##......@@
...#####..@
..##...##.@
.##.....##@
.##.....##@
.##.....##@
..##...##.@
...#####..@@
....##..@
..####..@
....##..@
....##..@
....##..@
....##..@
..######@@
..#######.@
.##.....##@
........##@
..#######.@
.##.......@
.##.......@
.#########@@
..#######.@
.##.....##@
........##@
..#######.@
........##@
.##.....##@
..#######.@@
.##.......@
.##....##.@
.##....##.@
.##....##.@
.#########@
.......##.@
.......##.@@
.########@
.##......@
.##......@
.#######.@
.......##@
.##....##@
..######.@@
..#######.@
.##.....##@
.##.......@
.########.@
.##.....##@
.##.....##@
..#######.@@
.########@
.##....##@
.....##..@
....##...@
...##....@
...##....@
...##....@@
..#######.@
.##.....##@
.##.....##@
..#######.@
.##.....##@
.##.....##@
..#######.@@
..#######.@
.##.....##@
.##.....##@
..########@
........##@
.##.....##@
..#######.@@
..##.@
.####@
..##.@
.....@
..##.@
.####@
..##.@@
.####@
.####@
.....@
.####@
.####@
..##.@
.##..@@
....##@
...##.@
..##..@
.##...@
..##..@
...##.@
....##@@
......@
......@
.#####@
......@
.#####@
......@
......@@
.##...@
..##..@
...##.@
....##@
...##.@
..##..@
.##...@@
..#######.@
.##.....##@
.......##.@
.....###..@
....##....@
..........@
....##....@@
..#######.@
.##.....##@
.##.###.##@
.##.###.##@
.##.#####.@
.##.......@
..#######.@@
....###...@
...##.##..@
..##...##.@
.##.....##@
.#########@
.##.....##@
.##.....##@@
.########.@
.##.....##@
.##.....##@
.########.@
.##.....##@
.##.....##@
.########.@@
..######.@
.##....##@
.##......@
.##......@
.##......@
.##....##@
..######.@@
.########.@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.########.@@
.########@
.##......@
.##......@
.######..@
.##......@
.##......@
.########@@
.########@
.##......@
.##......@
.######..@
.##......@
.##......@
.##......@@
..######..@
.##....##.@
.##.......@
.##...####@
.##....##.@
.##....##.@
..######..@@
.##.....##@
.##.....##@
.##.....##@
.#########@
.##.....##@
.##.....##@
.##.....##@@
.####@
..##.@
..##.@
..##.@
..##.@
..##.@
.####@@
.......##@
.......##@
.......##@
.......##@
.##....##@
.##....##@
..######.@@
.##....##@
.##...##.@
.##..##..@
.#####...@
.##..##..@
.##...##.@
.##....##@@
.##......@
.##......@
.##......@
.##......@
.##......@
.##......@
.########@@
.##.....##@
.###...###@
.####.####@
.##.###.##@
.##.....##@
.##.....##@
.##.....##@@
.##....##@
.###...##@
.####..##@
.##.##.##@
.##..####@
.##...###@
.##....##@@
..#######.@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
..#######.@@
.########.@
.##.....##@
.##.....##@
.########.@
.##.......@
.##.......@
.##.......@@
..#######.@
.##.....##@
.##.....##@
.##.....##@
.##..##.##@
.##....##.@
..#####.##@@
.########.@
.##.....##@
.##.....##@
.########.@
.##...##..@
.##....##.@
.##.....##@@
..######.@
.##....##@
.##......@
..######.@
.......##@
.##....##@
..######.@@
.########@
....##...@
....##...@
....##...@
....##...@
....##...@
....##...@@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
..#######.@@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
..##...##.@
...##.##..@
....###...@@
.##......##@
.##..##..##@
.##..##..##@
.##..##..##@
.##..##..##@
.##..##..##@
..###..###.@@
.##.....##@
..##...##.@
...##.##..@
....###...@
...##.##..@
..##...##.@
.##.....##@@
.##....##@
..##..##.@
...####..@
....##...@
....##...@
....##...@
....##...@@
.########@
......##.@
.....##..@
....##...@
...##....@
..##.....@
.########@@
.######@
.##....@
.##....@
.##....@
.##....@
.##....@
.######@@
.##......@
..##.....@
...##....@
....##...@
.....##..@
......##.@
.......##@@
.######@
.....##@
.....##@
.....##@
.....##@
.....##@
.######@@
...###..@
..##.##.@
.##...##@
........@
........@
........@
........@@
........@
........@
........@
........@
........@
........@
.#######@@
.####@
.####@
..##.@
...##@
.....@
.....@
.....@@
....###...@
...##.##..@
..##...##.@
.##.....##@
.#########@
.##.....##@
.##.....##@@
.########.@
.##.....##@
.##.....##@
.########.@
.##.....##@
.##.....##@
.########.@@
..######.@
.##....##@
.##......@
.##......@
.##......@
.##....##@
..######.@@
.########.@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.########.@@
.########@
.##......@
.##......@
.######..@
.##......@
.##......@
.########@@
.########@
.##......@
.##......@
.######..@
.##......@
.##......@
.##......@@
..######..@
.##....##.@
.##.......@
.##...####@
.##....##.@
.##....##.@
..######..@@
.##.....##@
.##.....##@
.##.....##@
.#########@
.##.....##@
.##.....##@
.##.....##@@
.####@
..##.@
..##.@
..##.@
..##.@
..##.@
.####@@
.......##@
.......##@
.......##@
.......##@
.##....##@
.##....##@
..######.@@
.##....##@
.##...##.@
.##..##..@
.#####...@
.##..##..@
.##...##.@
.##....##@@
.##......@
.##......@
.##......@
.##......@
.##......@
.##......@
.########@@
.##.....##@
.###...###@
.####.####@
.##.###.##@
.##.....##@
.##.....##@
.##.....##@@
.##....##@
.###...##@
.####..##@
.##.##.##@
.##..####@
.##...###@
.##....##@@
..#######.@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
..#######.@@
.########.@
.##.....##@
.##.....##@
.########.@
.##.......@
.##.......@
.##.......@@
..#######.@
.##.....##@
.##.....##@
.##.....##@
.##..##.##@
.##....##.@
..#####.##@@
.########.@
.##.....##@
.##.....##@
.########.@
.##...##..@
.##....##.@
.##.....##@@
..######.@
.##....##@
.##......@
..######.@
.......##@
.##....##@
..######.@@
.########@
....##...@
....##...@
....##...@
....##...@
....##...@
....##...@@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
..#######.@@
.##.....##@
.##.....##@
.##.....##@
.##.....##@
..##...##.@
...##.##..@
....###...@@
.##......##@
.##..##..##@
.##..##..##@
.##..##..##@
.##..##..##@
.##..##..##@
..###..###.@@
.##.....##@
..##...##.@
...##.##..@
....###...@
...##.##..@
..##...##.@
.##.....##@@
.##....##@
..##..##.@
...####..@
....##...@
....##...@
....##...@
....##...@@
.########@
......##.@
.....##..@
....##...@
...##....@
..##.....@
.########@@
...####@
..##...@
..##...@
.###...@
..##...@
..##...@
...####@@
.##@
.##@
.##@
...@
.##@
.##@
.##@@
.####..@
....##.@
....##.@
....###@
....##.@
....##.@
.####..@@
..####.....@
.##..##..##@
......####.@
...........@
...........@
...........@
...........@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1,14 @@
import type * as core from "../core/index.cjs";
import * as schemas from "./schemas.cjs";
/** Distributes `.partial()` through every object in a schema type, preserving the wrappers around them. */
export type DeepPartial<T extends core.SomeType> = T extends schemas.ZodObject<infer Shape, infer Config> ? schemas.ZodObject<{
-readonly [K in keyof Shape]: schemas.ZodOptional<DeepPartial<Shape[K]>>;
}, Config> : T extends schemas.ZodDiscriminatedUnion<infer Options, any> ? schemas.ZodUnion<{
-readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I];
}> : T extends schemas.ZodUnion<infer Options> ? schemas.ZodUnion<{
-readonly [I in keyof Options]: Options[I] extends core.SomeType ? DeepPartial<Options[I]> : Options[I];
}> : T extends schemas.ZodArray<infer El> ? schemas.ZodArray<DeepPartial<El>> : T extends schemas.ZodTuple<infer Items, infer Rest> ? schemas.ZodTuple<{
-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.ZodIntersection<infer A, infer B> ? schemas.ZodIntersection<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodRecord<infer K, infer V> ? schemas.ZodRecord<K, DeepPartial<V>> : T extends schemas.ZodMap<infer K, infer V> ? schemas.ZodMap<K, DeepPartial<V>> : T extends schemas.ZodSet<infer El> ? schemas.ZodSet<DeepPartial<El>> : T extends schemas.ZodOptional<infer Inner> ? schemas.ZodOptional<DeepPartial<Inner>> : T extends schemas.ZodNullable<infer Inner> ? schemas.ZodNullable<DeepPartial<Inner>> : T extends schemas.ZodDefault<infer Inner> ? schemas.ZodDefault<DeepPartial<Inner>> : T extends schemas.ZodPrefault<infer Inner> ? schemas.ZodPrefault<DeepPartial<Inner>> : T extends schemas.ZodNonOptional<infer Inner> ? schemas.ZodNonOptional<DeepPartial<Inner>> : T extends schemas.ZodCatch<infer Inner> ? schemas.ZodCatch<DeepPartial<Inner>> : T extends schemas.ZodReadonly<infer Inner> ? schemas.ZodReadonly<DeepPartial<Inner>> : T extends schemas.ZodSuccess<infer Inner> ? schemas.ZodSuccess<DeepPartial<Inner>> : T extends schemas.ZodPromise<infer Inner> ? schemas.ZodPromise<DeepPartial<Inner>> : T extends schemas.ZodCodec<infer A, infer B> ? schemas.ZodCodec<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodPreprocess<infer B> ? schemas.ZodPreprocess<DeepPartial<B>> : T extends schemas.ZodPipe<infer A, infer B> ? schemas.ZodPipe<DeepPartial<A>, DeepPartial<B>> : T extends schemas.ZodLazy<infer Inner> ? schemas.ZodLazy<DeepPartial<Inner>> : T;
/** Returns a copy of the schema with every nested object's properties made optional. */
export declare function deepPartial<T extends core.SomeType>(schema: T): DeepPartial<T>;
@@ -0,0 +1,321 @@
flf2a$ 3 2 11 0 14
threepoint by Randall Ransom 4/94 <ransom@girtab.usc.edu>
Figlet release 2.0 -- August 5, 1993
Date: 9 Apr 1994
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be `a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
3 - height of a character
2 - height of a character, not including descenders
11 - max line length (excluding comment lines) + a fudge factor
0 - default smushmode for this font (like "-m 0" on command line)
14 - number of comment lines
$$@
$$@
$$@@
|@
.@
$@@
''@
$$@
$$@@
++@
++@
$$@@
(|~@
_|)@
$ $@@
'/@
/,@
$$@@
() @
(_X@
$ $@@
'@
$@
$@@
/@
| @
\@@
\ @
|@
/ @@
. ,@
-X-@
' `@@
_|_@
! @
$ $@@
$@
,@
$@@
__@
$$@
$$@@
$@
.@
$@@
/@
/ @
$$@@
/X@
X/@
@@
'| @
.|.@
@@
'~)@
/_@
@@
'~)@
._)@
@@
|_|@
|@
@@
L~@
_)@
@@
/ @
(_)@
@@
~/@
/ @
@@
(~)@
(_)@
@@
(~)@
/ @
@@
.@
.@
$@@
.@
,@
$@@
/@
( @
\@@
--@
--@
@@
\ @
)@
/ @@
'~)@
! @
@@
$/~~\@
| (|/@
$\__ @@
/\ @
/~~\@
@@
|~)@
|_)@
@@
/~`@
\_,@
@@
|~\@
|_/@
@@
(~@
(_@
@@
|~@
|~@
@@
/~_@
\_/@
@@
|_|@
| |@
@@
~|~@
_|_@
@@
~|~@
L| @
@@
|/@
|\@
@@
| @
|_@
@@
|\/|@
| |@
@@
|\ |@
| \|@
@@
/~\@
\_/@
@@
|~)@
|~ @
@@
/~\@
\_X@
@@
|~)@
|~\@
@@
(~@
_)@
@@
~|~@
| @
@@
| |@
|_|@
@@
\ /@
\/ @
@@
\ /@
\/\/ @
@@
\/@
/\@
@@
\ /@
| @
@@
~/@
/_@
@@
|~@
| @
|_@@
\ @
\@
@@
~|@
|@
_|@@
'`@
$$@
$$@@
$$@
__@
$$@@
`@
$@
$@@
$_$@
(_|@
@@
|_$@
|_)@
@@
$_@
(_@
@@
$_|@
(_|@
@@
$_$@
(/_@
@@
|`@
~|~@
@@
$_$@
(_|@
_|@@
|_$@
| |@
@@
.@
|@
@@
.@
|@
L|@@
| @
|<@
@@
|@
|@
@@
$_ _$@
| | |@
@@
$_$@
| |@
@@
$_$@
(_)@
@@
$_$@
|_)@
| @@
$_$ @
(_| @
|/@@
$_@
| @
@@
$_@
_\@
@@
_|_@
| @
@@
@
|_|@
@@
@
\/@
@@
@
VV@
@@
@
><@
@@
@
\/@
/ @@
_$@
/_@
@@
|~@
< @
|_@@
|@
|@
|@@
~| @
>@
_| @@
'`'@
$ $@
$ $@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@@ -0,0 +1,2 @@
export { recordStats } from 'motion-dom';
//# sourceMappingURL=debug.mjs.map
@@ -0,0 +1,326 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeComparisonResult = void 0;
exports.compareNodes = compareNodes;
const utils_1 = require("@typescript-eslint/utils");
const visitor_keys_1 = require("@typescript-eslint/visitor-keys");
var NodeComparisonResult;
(function (NodeComparisonResult) {
/** the two nodes are comparably the same */
NodeComparisonResult["Equal"] = "Equal";
/** the left node is a subset of the right node */
NodeComparisonResult["Subset"] = "Subset";
/** the left node is not the same or is a superset of the right node */
NodeComparisonResult["Invalid"] = "Invalid";
})(NodeComparisonResult || (exports.NodeComparisonResult = NodeComparisonResult = {}));
function compareArrays(arrayA, arrayB) {
if (arrayA.length !== arrayB.length) {
return NodeComparisonResult.Invalid;
}
const result = arrayA.every((elA, idx) => {
const elB = arrayB[idx];
if (elA == null || elB == null) {
return elA === elB;
}
return compareUnknownValues(elA, elB) === NodeComparisonResult.Equal;
});
if (result) {
return NodeComparisonResult.Equal;
}
return NodeComparisonResult.Invalid;
}
function isValidNode(x) {
return (typeof x === 'object' &&
x != null &&
'type' in x &&
typeof x.type === 'string');
}
function isValidChainExpressionToLookThrough(node) {
return (!(node.parent?.type === utils_1.AST_NODE_TYPES.MemberExpression &&
node.parent.object === node) &&
!(node.parent?.type === utils_1.AST_NODE_TYPES.CallExpression &&
node.parent.callee === node) &&
node.type === utils_1.AST_NODE_TYPES.ChainExpression);
}
function compareUnknownValues(valueA, valueB) {
/* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */
if (valueA == null || valueB == null) {
if (valueA !== valueB) {
return NodeComparisonResult.Invalid;
}
return NodeComparisonResult.Equal;
}
/* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */
if (!isValidNode(valueA) || !isValidNode(valueB)) {
return NodeComparisonResult.Invalid;
}
return compareNodes(valueA, valueB);
}
function compareByVisiting(nodeA, nodeB) {
const currentVisitorKeys = visitor_keys_1.visitorKeys[nodeA.type];
/* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */
if (currentVisitorKeys == null) {
// we don't know how to visit this node, so assume it's invalid to avoid false-positives / broken fixers
return NodeComparisonResult.Invalid;
}
if (currentVisitorKeys.length === 0) {
// assume nodes with no keys are constant things like keywords
return NodeComparisonResult.Equal;
}
for (const key of currentVisitorKeys) {
// @ts-expect-error - dynamic access but it's safe
const nodeAChildOrChildren = nodeA[key];
// @ts-expect-error - dynamic access but it's safe
const nodeBChildOrChildren = nodeB[key];
if (Array.isArray(nodeAChildOrChildren)) {
const arrayA = nodeAChildOrChildren;
const arrayB = nodeBChildOrChildren;
const result = compareArrays(arrayA, arrayB);
if (result !== NodeComparisonResult.Equal) {
return NodeComparisonResult.Invalid;
}
// fallthrough to the next key as the key was "equal"
}
else {
const result = compareUnknownValues(nodeAChildOrChildren, nodeBChildOrChildren);
if (result !== NodeComparisonResult.Equal) {
return NodeComparisonResult.Invalid;
}
// fallthrough to the next key as the key was "equal"
}
}
return NodeComparisonResult.Equal;
}
function compareNodesUncached(nodeA, nodeB) {
if (nodeA.type !== nodeB.type) {
// special cases where nodes are allowed to be non-equal
// look through a chain expression node at the top-level because it only
// exists to delimit the end of an optional chain
//
// a?.b && a.b.c
// ^^^^ ChainExpression, MemberExpression
// ^^^^^ MemberExpression
//
// except for in this class of cases
// (a?.b).c && a.b.c
// because the parentheses have runtime meaning (sad face)
if (isValidChainExpressionToLookThrough(nodeA)) {
return compareNodes(nodeA.expression, nodeB);
}
if (isValidChainExpressionToLookThrough(nodeB)) {
return compareNodes(nodeA, nodeB.expression);
}
// look through the type-only non-null assertion because its existence could
// possibly be replaced by an optional chain instead
//
// a.b! && a.b.c
// ^^^^ TSNonNullExpression
if (nodeA.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) {
return compareNodes(nodeA.expression, nodeB);
}
if (nodeB.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) {
return compareNodes(nodeA, nodeB.expression);
}
// special case for subset optional chains where the node types don't match,
// but we want to try comparing by discarding the "extra" code
//
// a && a.b
// ^ compare this
// a && a()
// ^ compare this
// a.b && a.b()
// ^^^ compare this
// a() && a().b
// ^^^ compare this
// import.meta && import.meta.b
// ^^^^^^^^^^^ compare this
if (nodeA.type === utils_1.AST_NODE_TYPES.CallExpression ||
nodeA.type === utils_1.AST_NODE_TYPES.Identifier ||
nodeA.type === utils_1.AST_NODE_TYPES.MemberExpression ||
nodeA.type === utils_1.AST_NODE_TYPES.MetaProperty) {
switch (nodeB.type) {
case utils_1.AST_NODE_TYPES.MemberExpression:
if (nodeB.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
// Private identifiers in optional chaining is not currently allowed
// TODO - handle this once TS supports it (https://github.com/microsoft/TypeScript/issues/42734)
return NodeComparisonResult.Invalid;
}
if (compareNodes(nodeA, nodeB.object) !== NodeComparisonResult.Invalid) {
return NodeComparisonResult.Subset;
}
return NodeComparisonResult.Invalid;
case utils_1.AST_NODE_TYPES.CallExpression:
if (compareNodes(nodeA, nodeB.callee) !== NodeComparisonResult.Invalid) {
return NodeComparisonResult.Subset;
}
return NodeComparisonResult.Invalid;
default:
return NodeComparisonResult.Invalid;
}
}
return NodeComparisonResult.Invalid;
}
switch (nodeA.type) {
// these expressions create a new instance each time - so it makes no sense to compare the chain
case utils_1.AST_NODE_TYPES.ArrayExpression:
case utils_1.AST_NODE_TYPES.ArrowFunctionExpression:
case utils_1.AST_NODE_TYPES.ClassExpression:
case utils_1.AST_NODE_TYPES.FunctionExpression:
case utils_1.AST_NODE_TYPES.JSXElement:
case utils_1.AST_NODE_TYPES.JSXFragment:
case utils_1.AST_NODE_TYPES.NewExpression:
case utils_1.AST_NODE_TYPES.ObjectExpression:
return NodeComparisonResult.Invalid;
// chaining from assignments could change the value irrevocably - so it makes no sense to compare the chain
case utils_1.AST_NODE_TYPES.AssignmentExpression:
return NodeComparisonResult.Invalid;
case utils_1.AST_NODE_TYPES.CallExpression: {
const nodeBCall = nodeB;
// check for cases like
// foo() && foo()(bar)
// ^^^^^ nodeA
// ^^^^^^^^^^ nodeB
// we don't want to check the arguments in this case
const aSubsetOfB = compareNodes(nodeA, nodeBCall.callee);
if (aSubsetOfB !== NodeComparisonResult.Invalid) {
return NodeComparisonResult.Subset;
}
const calleeCompare = compareNodes(nodeA.callee, nodeBCall.callee);
if (calleeCompare !== NodeComparisonResult.Equal) {
return NodeComparisonResult.Invalid;
}
// NOTE - we purposely ignore optional flag because for our purposes
// foo?.bar() && foo.bar?.()?.baz
// or
// foo.bar() && foo?.bar?.()?.baz
// are going to be exactly the same
const argumentCompare = compareArrays(nodeA.arguments, nodeBCall.arguments);
if (argumentCompare !== NodeComparisonResult.Equal) {
return NodeComparisonResult.Invalid;
}
const typeParamCompare = compareNodes(nodeA.typeArguments, nodeBCall.typeArguments);
if (typeParamCompare === NodeComparisonResult.Equal) {
return NodeComparisonResult.Equal;
}
return NodeComparisonResult.Invalid;
}
case utils_1.AST_NODE_TYPES.ChainExpression:
// special case handling for ChainExpression because it's allowed to be a subset
return compareNodes(nodeA, nodeB.expression);
case utils_1.AST_NODE_TYPES.Identifier:
case utils_1.AST_NODE_TYPES.PrivateIdentifier:
if (nodeA.name === nodeB.name) {
return NodeComparisonResult.Equal;
}
return NodeComparisonResult.Invalid;
case utils_1.AST_NODE_TYPES.Literal: {
const nodeBLiteral = nodeB;
if (nodeA.raw === nodeBLiteral.raw &&
nodeA.value === nodeBLiteral.value) {
return NodeComparisonResult.Equal;
}
return NodeComparisonResult.Invalid;
}
case utils_1.AST_NODE_TYPES.MemberExpression: {
const nodeBMember = nodeB;
if (nodeBMember.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
// Private identifiers in optional chaining is not currently allowed
// TODO - handle this once TS supports it (https://github.com/microsoft/TypeScript/issues/42734)
return NodeComparisonResult.Invalid;
}
// check for cases like
// foo.bar && foo.bar.baz
// ^^^^^^^ nodeA
// ^^^^^^^^^^^ nodeB
// result === Equal
//
// foo.bar && foo.bar.baz.bam
// ^^^^^^^ nodeA
// ^^^^^^^^^^^^^^^ nodeB
// result === Subset
//
// we don't want to check the property in this case
const aSubsetOfB = compareNodes(nodeA, nodeBMember.object);
if (aSubsetOfB !== NodeComparisonResult.Invalid) {
return NodeComparisonResult.Subset;
}
if (nodeA.computed !== nodeBMember.computed) {
return NodeComparisonResult.Invalid;
}
// NOTE - we purposely ignore optional flag because for our purposes
// foo?.bar && foo.bar?.baz
// or
// foo.bar && foo?.bar?.baz
// are going to be exactly the same
const objectCompare = compareNodes(nodeA.object, nodeBMember.object);
if (objectCompare !== NodeComparisonResult.Equal) {
return NodeComparisonResult.Invalid;
}
return compareNodes(nodeA.property, nodeBMember.property);
}
case utils_1.AST_NODE_TYPES.TSTemplateLiteralType:
case utils_1.AST_NODE_TYPES.TemplateLiteral: {
const nodeBTemplate = nodeB;
const areQuasisEqual = nodeA.quasis.length === nodeBTemplate.quasis.length &&
nodeA.quasis.every((elA, idx) => {
const elB = nodeBTemplate.quasis[idx];
return elA.value.cooked === elB.value.cooked;
});
if (!areQuasisEqual) {
return NodeComparisonResult.Invalid;
}
return NodeComparisonResult.Equal;
}
case utils_1.AST_NODE_TYPES.TemplateElement: {
const nodeBElement = nodeB;
if (nodeA.value.cooked === nodeBElement.value.cooked) {
return NodeComparisonResult.Equal;
}
return NodeComparisonResult.Invalid;
}
// these aren't actually valid expressions.
// https://github.com/typescript-eslint/typescript-eslint/blob/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48/packages/ast-spec/src/unions/Expression.ts#L37-L43
case utils_1.AST_NODE_TYPES.ArrayPattern:
case utils_1.AST_NODE_TYPES.ObjectPattern:
/* istanbul ignore next */
return NodeComparisonResult.Invalid;
// update expression returns a number and also changes the value each time - so it makes no sense to compare the chain
case utils_1.AST_NODE_TYPES.UpdateExpression:
return NodeComparisonResult.Invalid;
// yield returns the value passed to the `next` function, so it may not be the same each time - so it makes no sense to compare the chain
case utils_1.AST_NODE_TYPES.YieldExpression:
return NodeComparisonResult.Invalid;
// general-case automatic handling of nodes to save us implementing every
// single case by hand. This just iterates the visitor keys to recursively
// check the children.
//
// Any specific logic cases or short-circuits should be listed as separate
// cases so that they don't fall into this generic handling
default:
return compareByVisiting(nodeA, nodeB);
}
}
const COMPARE_NODES_CACHE = new WeakMap();
/**
* Compares two nodes' ASTs to determine if the A is equal to or a subset of B
*/
function compareNodes(nodeA, nodeB) {
if (nodeA == null || nodeB == null) {
if (nodeA !== nodeB) {
return NodeComparisonResult.Invalid;
}
return NodeComparisonResult.Equal;
}
const cached = COMPARE_NODES_CACHE.get(nodeA)?.get(nodeB);
if (cached) {
return cached;
}
const result = compareNodesUncached(nodeA, nodeB);
let mapA = COMPARE_NODES_CACHE.get(nodeA);
if (mapA == null) {
mapA = new WeakMap();
COMPARE_NODES_CACHE.set(nodeA, mapA);
}
mapA.set(nodeB, result);
return result;
}
@@ -0,0 +1,96 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_router_utils = require("../utils.js");
//#region src/router/reg-exp-router/node.ts
const LABEL_REG_EXP_STR = "[^/]+";
const ONLY_WILDCARD_REG_EXP_STR = ".*";
const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
const PATH_ERROR = Symbol();
const regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
/**
* Sort order:
* 1. literal
* 2. special pattern (e.g. :label{[0-9]+})
* 3. common label pattern (e.g. :label)
* 4. wildcard
*/
function compareKey(a, b) {
if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
if (b.length === 1) return 1;
if (a === ".*" || a === "(?:|/.*)") return b === "(?:|/.*)" ? -1 : 1;
else if (b === ".*" || b === "(?:|/.*)") return -1;
if (a === "[^/]+") return 1;
else if (b === "[^/]+") return -1;
return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
}
var Node = class Node {
#index;
#varIndex;
#children = require_router_utils.createNullObject();
insert(tokens, index, paramMap, context, isStatic) {
let node = this;
for (let i = 0, len = tokens.length; i < len; i++) {
const token = tokens[i];
const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? [
"",
"",
".*"
] : [
"",
"",
LABEL_REG_EXP_STR
] : null : token === "/*" ? [
"",
"",
TAIL_WILDCARD_REG_EXP_STR
] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
let nextNode;
if (pattern) {
const name = pattern[1];
let regexpStr = pattern[2] || "[^/]+";
if (name && pattern[2]) {
if (regexpStr === ".*") throw PATH_ERROR;
regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
if (/\((?!\?:)/.test(regexpStr)) throw PATH_ERROR;
if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) throw PATH_ERROR;
}
nextNode = node.#children[regexpStr];
if (!nextNode) {
if (regexpStr !== ".*" && regexpStr !== "(?:|/.*)") {
for (const k in node.#children) if ((regexpStr.length > 1 || k.length > 1) && k !== ".*" && k !== "(?:|/.*)") throw PATH_ERROR;
}
nextNode = node.#children[regexpStr] = new Node();
}
if (name !== "") {
nextNode.#varIndex ??= context.varIndex++;
paramMap.push([name, nextNode.#varIndex]);
}
} else {
nextNode = node.#children[token];
if (!nextNode) {
for (const k in node.#children) if (k.length > 1 && k !== ".*" && k !== "(?:|/.*)") throw PATH_ERROR;
nextNode = node.#children[token] = new Node();
}
}
node = nextNode;
}
if (node.#index !== void 0) throw PATH_ERROR;
node.#index = isStatic ? -1 : index;
}
buildRegExpStr() {
const strList = Object.keys(this.#children).sort(compareKey).map((k) => {
const c = this.#children[k];
const childStr = c.buildRegExpStr();
return childStr === "" ? "" : (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + childStr;
}).filter(Boolean);
if (typeof this.#index === "number" && this.#index !== -1) strList.unshift(`#${this.#index}`);
if (strList.length === 0) return "";
if (strList.length === 1) return strList[0];
return "(?:" + strList.join("|") + ")";
}
};
//#endregion
exports.LABEL_REG_EXP_STR = LABEL_REG_EXP_STR;
exports.Node = Node;
exports.ONLY_WILDCARD_REG_EXP_STR = ONLY_WILDCARD_REG_EXP_STR;
exports.PATH_ERROR = PATH_ERROR;
exports.TAIL_WILDCARD_REG_EXP_STR = TAIL_WILDCARD_REG_EXP_STR;
@@ -0,0 +1,3 @@
declare function serializeValue(val: any, seen?: WeakMap<WeakKey, any>): any;
export { serializeValue };
@@ -0,0 +1,825 @@
flf2a$ 8 8 17 -1 8
basic.flf by Craig O'Flaherty <cofl@it.ntu.edu.au>
August 17, 1994
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
db$@
88$@
YP$@
$@
db$@
YP$@
$@
$@@
.o. .o.$@
`8' `8'$@
$@
$@
$@
$@
$@
$@@
$@
db db $@
C88888D$@
88 88 $@
C88888D$@
YP YP $@
$@
$@@
A $@
.d8888.$@
88'8 YP$@
`8b8. $@
`V8b.$@
db 8 8D$@
`8888Y'$@
V $@@
db dD$@
YP d8'$@
d8' $@
d8' $@
d8' db$@
d8' YP$@
$@
$@@
.d888b. $@
8P 8D $@
`Vb d8' $@
d88C dD$@
C8' d8D $@
`888P Yb$@
$@
$@@
Cb$@
`D$@
'$@
$@
$@
$@
$@
$@@
dD$@
d8' $@
d8 $@
C88 $@
V8 $@
V8. $@
VD$@
$@@
Cb $@
`8b $@
8b $@
88D$@
8P $@
.8P $@
CP $@
$@@
$@
8. A .8$@
`8.8.8'$@
888 $@
.d'8`b.$@
8' V `8$@
$@
$@@
$@
db $@
88 $@
C8888D$@
88 $@
VP $@
$@
$@@
$@
$@
$@
$@
db$@
V8$@
P$@
$@@
$@
$@
$@
C8888D$@
$@
$@
$@
$@@
$@
$@
$@
$@
db$@
VP$@
$@
$@@
dD$@
d8'$@
d8' $@
d8' $@
d8' $@
C8' $@
$@
$@@
.d88b. $@
.8P 88.$@
88 d'88$@
88 d' 88$@
`88 d8'$@
`Y88P' $@
$@
$@@
db$@
o88$@
88$@
88$@
88$@
VP$@
$@
$@@
.d888b.$@
VP `8D$@
odD'$@
.88' $@
j88. $@
888888D$@
$@
$@@
d8888b.$@
VP `8D$@
oooY'$@
~~~b.$@
db 8D$@
Y8888P'$@
$@
$@@
j88D $@
j8~88 $@
j8' 88 $@
V88888D$@
88 $@
VP $@
$@
$@@
ooooo$@
8P~~~~$@
dP $@
V8888b.$@
`8D$@
88oobY'$@
$@
$@@
dD $@
d8' $@
d8' $@
d8888b.$@
88' `8D$@
`8888P $@
$@
$@@
d88888D$@
VP d8'$@
d8' $@
d8' $@
d8' $@
d8' $@
$@
$@@
.d888b.$@
88 8D$@
`VoooY'$@
.d~~~b.$@
88 8D$@
`Y888P'$@
$@
$@@
.d888b.$@
88' `8D$@
`V8o88'$@
d8' $@
d8' $@
d8' $@
$@
$@@
$@
db$@
VP$@
$@
db$@
VP$@
$@
$@@
$@
db$@
VP$@
$@
db$@
V8$@
P$@
$@@
$@
.dP$@
.d8 $@
,P $@
`b $@
`Vb $@
`Vb$@
$@@
$@
C8888D$@
$@
C8888D$@
$@
$@
$@
$@@
$@
Vb $@
`Vb $@
`V.$@
.d'$@
.dP $@
dP $@
$@@
.d888b.$@
VP `8D$@
odD'$@
8P' $@
oo $@
VP $@
$@
$@@
.o888b.$@
d8' Y8$@
8P db dP$@
8b V8o8P$@
Y8. d$@
`Y888P'$@
$@
$@@
.d8b. $@
d8' `8b$@
88ooo88$@
88~~~88$@
88 88$@
YP YP$@
$@
$@@
d8888b.$@
88 `8D$@
88oooY'$@
88~~~b.$@
88 8D$@
Y8888P'$@
$@
$@@
.o88b.$@
d8P Y8$@
8P $@
8b $@
Y8b d8$@
`Y88P'$@
$@
$@@
d8888b.$@
88 `8D$@
88 88$@
88 88$@
88 .8D$@
Y8888D'$@
$@
$@@
d88888b$@
88' $@
88ooooo$@
88~~~~~$@
88. $@
Y88888P$@
$@
$@@
d88888b$@
88' $@
88ooo $@
88~~~ $@
88 $@
YP $@
$@
$@@
d888b $@
88' Y8b$@
88 $@
88 ooo$@
88. ~8~$@
Y888P $@
$@
$@@
db db$@
88 88$@
88ooo88$@
88~~~88$@
88 88$@
YP YP$@
$@
$@@
d888888b$@
`88' $@
88 $@
88 $@
.88. $@
Y888888P$@
$@
$@@
d88b$@
`8P'$@
88 $@
88 $@
db. 88 $@
Y8888P $@
$@
$@@
db dD$@
88 ,8P'$@
88,8P $@
88`8b $@
88 `88.$@
YP YD$@
$@
$@@
db $@
88 $@
88 $@
88 $@
88booo.$@
Y88888P$@
$@
$@@
.88b d88.$@
88'YbdP`88$@
88 88 88$@
88 88 88$@
88 88 88$@
YP YP YP$@
$@
$@@
d8b db$@
888o 88$@
88V8o 88$@
88 V8o88$@
88 V888$@
VP V8P$@
$@
$@@
.d88b. $@
.8P Y8.$@
88 88$@
88 88$@
`8b d8'$@
`Y88P' $@
$@
$@@
d8888b.$@
88 `8D$@
88oodD'$@
88~~~ $@
88 $@
88 $@
$@
$@@
.d88b. $@
.8P Y8.$@
88 88$@
88 88$@
`8P d8'$@
`Y88'Y8$@
$@
$@@
d8888b.$@
88 `8D$@
88oobY'$@
88`8b $@
88 `88.$@
88 YD$@
$@
$@@
.d8888.$@
88' YP$@
`8bo. $@
`Y8b.$@
db 8D$@
`8888Y'$@
$@
$@@
d888888b$@
`~~88~~'$@
88 $@
88 $@
88 $@
YP $@
$@
$@@
db db$@
88 88$@
88 88$@
88 88$@
88b d88$@
~Y8888P'$@
$@
$@@
db db$@
88 88$@
Y8 8P$@
`8b d8'$@
`8bd8' $@
YP $@
$@
$@@
db d8b db$@
88 I8I 88$@
88 I8I 88$@
Y8 I8I 88$@
`8b d8'8b d8'$@
`8b8' `8d8' $@
$@
$@@
db db$@
`8b d8'$@
`8bd8' $@
.dPYb. $@
.8P Y8.$@
YP YP$@
$@
$@@
db db$@
`8b d8'$@
`8bd8' $@
88 $@
88 $@
YP $@
$@
$@@
d88888D$@
YP d8'$@
d8' $@
d8' $@
d8' db$@
d88888P$@
$@
$@@
d88D$@
88 $@
88 $@
88 $@
88 $@
L88D$@
$@
$@@
Cb $@
`8b $@
`8b $@
`8b $@
`8b $@
`8D$@
$@
$@@
C88D$@
88$@
88$@
88$@
88$@
C888$@
$@
$@@
db $@
.dPVb. $@
dP' `Vb$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
C88888D$@
$@
$@@
dD$@
C'$@
`$@
$@
$@
$@
$@
$@@
.d8b. $@
d8' `8b$@
88ooo88$@
88~~~88$@
88 88$@
YP YP$@
$@
$@@
d8888b.$@
88 `8D$@
88oooY'$@
88~~~b.$@
88 8D$@
Y8888P'$@
$@
$@@
.o88b.$@
d8P Y8$@
8P $@
8b $@
Y8b d8$@
`Y88P'$@
$@
$@@
d8888b.$@
88 `8D$@
88 88$@
88 88$@
88 .8D$@
Y8888D'$@
$@
$@@
d88888b$@
88' $@
88ooooo$@
88~~~~~$@
88. $@
Y88888P$@
$@
$@@
d88888b$@
88' $@
88ooo $@
88~~~ $@
88 $@
YP $@
$@
$@@
d888b $@
88' Y8b$@
88 $@
88 ooo$@
88. ~8~$@
Y888P $@
$@
$@@
db db$@
88 88$@
88ooo88$@
88~~~88$@
88 88$@
YP YP$@
$@
$@@
d888888b$@
`88' $@
88 $@
88 $@
.88. $@
Y888888P$@
$@
$@@
d88b$@
`8P'$@
88 $@
88 $@
db. 88 $@
Y8888P $@
$@
$@@
db dD$@
88 ,8P'$@
88,8P $@
88`8b $@
88 `88.$@
YP YD$@
$@
$@@
db $@
88 $@
88 $@
88 $@
88booo.$@
Y88888P$@
$@
$@@
.88b d88.$@
88'YbdP`88$@
88 88 88$@
88 88 88$@
88 88 88$@
YP YP YP$@
$@
$@@
d8b db$@
888o 88$@
88V8o 88$@
88 V8o88$@
88 V888$@
VP V8P$@
$@
$@@
.d88b. $@
.8P Y8.$@
88 88$@
88 88$@
`8b d8'$@
`Y88P' $@
$@
$@@
d8888b.$@
88 `8D$@
88oodD'$@
88~~~ $@
88 $@
88 $@
$@
$@@
.d88b. $@
.8P Y8.$@
88 88$@
88 88$@
`8P d8'$@
`Y88'Y8$@
$@
$@@
d8888b.$@
88 `8D$@
88oobY'$@
88`8b $@
88 `88.$@
88 YD$@
$@
$@@
.d8888.$@
88' YP$@
`8bo. $@
`Y8b.$@
db 8D$@
`8888Y'$@
$@
$@@
d888888b$@
`~~88~~'$@
88 $@
88 $@
88 $@
YP $@
$@
$@@
db db$@
88 88$@
88 88$@
88 88$@
88b d88$@
~Y8888P'$@
$@
$@@
db db$@
88 88$@
Y8 8P$@
`8b d8'$@
`8bd8' $@
YP $@
$@
$@@
db d8b db$@
88 I8I 88$@
88 I8I 88$@
Y8 I8I 88$@
`8b d8'8b d8'$@
`8b8' `8d8' $@
$@
$@@
db db$@
`8b d8'$@
`8bd8' $@
.dPYb. $@
.8P Y8.$@
YP YP$@
$@
$@@
db db$@
`8b d8'$@
`8bd8' $@
88 $@
88 $@
YP $@
$@
$@@
d88888D$@
YP d8'$@
d8' $@
d8' $@
d8' db$@
d88888P$@
$@
$@@
.8P$@
8' $@
.dP $@
C88 $@
`Yb $@
8. $@
`8b$@
$@@
8$@
8$@
8$@
$@
8$@
8$@
8$@
$@@
V8. $@
`8 $@
Vb. $@
88D$@
dP' $@
.8 $@
C8' $@
$@@
.oo. .$@
P' `VP'$@
$@
$@
$@
$@
$@
$@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,96 @@
/**
* @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier
* @author Ian Christian Myers
* @deprecated in ESLint v5.1.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow `catch` clause parameters from shadowing variables in the outer scope",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-catch-shadow",
},
deprecated: {
message: "This rule was renamed.",
url: "https://eslint.org/blog/2018/07/eslint-v5.1.0-released/",
deprecatedSince: "5.1.0",
availableUntil: "11.0.0",
replacedBy: [
{
rule: {
name: "no-shadow",
url: "https://eslint.org/docs/rules/no-shadow",
},
},
],
},
schema: [],
messages: {
mutable:
"Value of '{{name}}' may be overwritten in IE 8 and earlier.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Check if the parameters are been shadowed
* @param {Object} scope current scope
* @param {string} name parameter name
* @returns {boolean} True is its been shadowed
*/
function paramIsShadowing(scope, name) {
return astUtils.getVariableByName(scope, name) !== null;
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
"CatchClause[param!=null]"(node) {
let scope = sourceCode.getScope(node);
/*
* When ecmaVersion >= 6, CatchClause creates its own scope
* so start from one upper scope to exclude the current node
*/
if (scope.block === node) {
scope = scope.upper;
}
if (paramIsShadowing(scope, node.param.name)) {
context.report({
node,
messageId: "mutable",
data: { name: node.param.name },
});
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"names":["_classPrivateFieldGet","require","_classExtractFieldDescriptor","receiver","privateMap","classPrivateFieldGet2"],"sources":["../../src/helpers/classExtractFieldDescriptor.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\n\nexport default function _classExtractFieldDescriptor(receiver, privateMap) {\n return classPrivateFieldGet2(privateMap, receiver);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,qBAAA,GAAAC,OAAA;AAEe,SAASC,4BAA4BA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACzE,OAAOC,qBAAqB,CAACD,UAAU,EAAED,QAAQ,CAAC;AACpD","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"names":["_options","require","_parse","_populate","literalTemplate","formatter","tpl","opts","metadata","names","buildLiteralData","arg","defaultReplacements","forEach","replacement","i","replacements","normalizeReplacements","Object","keys","key","hasOwnProperty","call","Error","unwrap","populatePlaceholders","assign","prefix","raw","join","includes","code","buildTemplateCode","parseAndBuildMetadata","parser","placeholderWhitelist","Set","concat","Array","from","placeholderPattern","preserveComments","syntacticPlaceholders","length","value","push"],"sources":["../src/literal.ts"],"sourcesContent":["import type { Formatter } from \"./formatters.ts\";\nimport type { TemplateReplacements, TemplateOpts } from \"./options.ts\";\nimport { normalizeReplacements } from \"./options.ts\";\nimport parseAndBuildMetadata from \"./parse.ts\";\nimport populatePlaceholders from \"./populate.ts\";\n\nexport default function literalTemplate<T>(\n formatter: Formatter<T>,\n tpl: string[],\n opts: TemplateOpts,\n): (_: unknown[]) => (_: unknown) => T {\n const { metadata, names } = buildLiteralData(formatter, tpl, opts);\n\n return arg => {\n const defaultReplacements: TemplateReplacements = {};\n arg.forEach((replacement, i) => {\n defaultReplacements[names[i]] = replacement;\n });\n\n return (arg: unknown) => {\n const replacements = normalizeReplacements(arg);\n\n if (replacements) {\n Object.keys(replacements).forEach(key => {\n if (Object.hasOwn(defaultReplacements, key)) {\n throw new Error(\"Unexpected replacement overlap.\");\n }\n });\n }\n\n return formatter.unwrap(\n populatePlaceholders(\n metadata,\n replacements\n ? Object.assign(replacements, defaultReplacements)\n : defaultReplacements,\n ),\n );\n };\n };\n}\n\nfunction buildLiteralData<T>(\n formatter: Formatter<T>,\n tpl: string[],\n opts: TemplateOpts,\n) {\n let prefix = \"BABEL_TPL$\";\n\n const raw = tpl.join(\"\");\n\n do {\n // If there are cases where the template already contains $$BABEL_TPL$0 or any other\n // matching pattern, we keep adding \"$$\" characters until a unique prefix\n // is found.\n prefix = \"$$\" + prefix;\n } while (raw.includes(prefix));\n\n const { names, code } = buildTemplateCode(tpl, prefix);\n\n const metadata = parseAndBuildMetadata(formatter, formatter.code(code), {\n parser: opts.parser,\n\n // Explicitly include our generated names in the whitelist so users never\n // have to think about whether their placeholder pattern will match.\n placeholderWhitelist: new Set(\n names.concat(\n opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [],\n ),\n ),\n placeholderPattern: opts.placeholderPattern,\n preserveComments: opts.preserveComments,\n syntacticPlaceholders: opts.syntacticPlaceholders,\n });\n\n return { metadata, names };\n}\n\nfunction buildTemplateCode(\n tpl: string[],\n prefix: string,\n): { names: string[]; code: string } {\n const names = [];\n\n let code = tpl[0];\n\n for (let i = 1; i < tpl.length; i++) {\n const value = `${prefix}${i - 1}`;\n names.push(value);\n\n code += value + tpl[i];\n }\n\n return { names, code };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEe,SAASG,eAAeA,CACrCC,SAAuB,EACvBC,GAAa,EACbC,IAAkB,EACmB;EACrC,MAAM;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGC,gBAAgB,CAACL,SAAS,EAAEC,GAAG,EAAEC,IAAI,CAAC;EAElE,OAAOI,GAAG,IAAI;IACZ,MAAMC,mBAAyC,GAAG,CAAC,CAAC;IACpDD,GAAG,CAACE,OAAO,CAAC,CAACC,WAAW,EAAEC,CAAC,KAAK;MAC9BH,mBAAmB,CAACH,KAAK,CAACM,CAAC,CAAC,CAAC,GAAGD,WAAW;IAC7C,CAAC,CAAC;IAEF,OAAQH,GAAY,IAAK;MACvB,MAAMK,YAAY,GAAG,IAAAC,8BAAqB,EAACN,GAAG,CAAC;MAE/C,IAAIK,YAAY,EAAE;QAChBE,MAAM,CAACC,IAAI,CAACH,YAAY,CAAC,CAACH,OAAO,CAACO,GAAG,IAAI;UACvC,IAAIC,cAAA,CAAAC,IAAA,CAAcV,mBAAmB,EAAEQ,GAAG,CAAC,EAAE;YAC3C,MAAM,IAAIG,KAAK,CAAC,iCAAiC,CAAC;UACpD;QACF,CAAC,CAAC;MACJ;MAEA,OAAOlB,SAAS,CAACmB,MAAM,CACrB,IAAAC,iBAAoB,EAClBjB,QAAQ,EACRQ,YAAY,GACRE,MAAM,CAACQ,MAAM,CAACV,YAAY,EAAEJ,mBAAmB,CAAC,GAChDA,mBACN,CACF,CAAC;IACH,CAAC;EACH,CAAC;AACH;AAEA,SAASF,gBAAgBA,CACvBL,SAAuB,EACvBC,GAAa,EACbC,IAAkB,EAClB;EACA,IAAIoB,MAAM,GAAG,YAAY;EAEzB,MAAMC,GAAG,GAAGtB,GAAG,CAACuB,IAAI,CAAC,EAAE,CAAC;EAExB,GAAG;IAIDF,MAAM,GAAG,IAAI,GAAGA,MAAM;EACxB,CAAC,QAAQC,GAAG,CAACE,QAAQ,CAACH,MAAM,CAAC;EAE7B,MAAM;IAAElB,KAAK;IAAEsB;EAAK,CAAC,GAAGC,iBAAiB,CAAC1B,GAAG,EAAEqB,MAAM,CAAC;EAEtD,MAAMnB,QAAQ,GAAG,IAAAyB,cAAqB,EAAC5B,SAAS,EAAEA,SAAS,CAAC0B,IAAI,CAACA,IAAI,CAAC,EAAE;IACtEG,MAAM,EAAE3B,IAAI,CAAC2B,MAAM;IAInBC,oBAAoB,EAAE,IAAIC,GAAG,CAC3B3B,KAAK,CAAC4B,MAAM,CACV9B,IAAI,CAAC4B,oBAAoB,GAAGG,KAAK,CAACC,IAAI,CAAChC,IAAI,CAAC4B,oBAAoB,CAAC,GAAG,EACtE,CACF,CAAC;IACDK,kBAAkB,EAAEjC,IAAI,CAACiC,kBAAkB;IAC3CC,gBAAgB,EAAElC,IAAI,CAACkC,gBAAgB;IACvCC,qBAAqB,EAAEnC,IAAI,CAACmC;EAC9B,CAAC,CAAC;EAEF,OAAO;IAAElC,QAAQ;IAAEC;EAAM,CAAC;AALine truncated
@@ -0,0 +1,9 @@
import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
export { SnapshotEnvironment } from '@vitest/snapshot/environment';
declare class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
getHeader(): string;
resolvePath(filepath: string): Promise<string>;
}
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment };
@@ -0,0 +1,22 @@
import { getDefaultOptions } from "./Options.js";
export const getRefs = (options) => {
const _options = getDefaultOptions(options);
const currentPath = _options.name !== undefined
? [..._options.basePath, _options.definitionPath, _options.name]
: _options.basePath;
return {
..._options,
flags: { hasReferencedOpenAiAnyType: false },
currentPath: currentPath,
propertyPath: undefined,
seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
def._def,
{
def: def._def,
path: [..._options.basePath, _options.definitionPath, name],
// Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
jsonSchema: undefined,
},
])),
};
};
@@ -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 MessagesSquare = createLucideIcon("MessagesSquare", [
["path", { d: "M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z", key: "p1xzt8" }],
["path", { d: "M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1", key: "1cx29u" }]
]);
export { MessagesSquare as default };
//# sourceMappingURL=messages-square.js.map
@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripAbsolutePath = void 0;
// unix absolute paths are also absolute on win32, so we use this for both
const node_path_1 = require("node:path");
const { isAbsolute, parse } = node_path_1.win32;
// returns [root, stripped]
// Note that windows will think that //x/y/z/a has a "root" of //x/y, and in
// those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip /
// explicitly if it's the first character.
// drive-specific relative paths on Windows get their root stripped off even
// though they are not absolute, so `c:../foo` becomes ['c:', '../foo']
const stripAbsolutePath = (path) => {
let r = '';
let parsed = parse(path);
while (isAbsolute(path) || parsed.root) {
// windows will think that //x/y/z has a "root" of //x/y/
// but strip the //?/C:/ off of //?/C:/path
const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ?
'/'
: parsed.root;
path = path.slice(root.length);
r += root;
parsed = parse(path);
}
return [r, path];
};
exports.stripAbsolutePath = stripAbsolutePath;
//# sourceMappingURL=strip-absolute-path.js.map
@@ -0,0 +1 @@
{"version":3,"file":"panel-bottom.js","sources":["../../../src/icons/panel-bottom.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelBottom\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDE1aDE4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/panel-bottom\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 PanelBottom = createLucideIcon('PanelBottom', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M3 15h18', key: '5xshup' }],\n]);\n\nexport default PanelBottom;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Umbrella = createLucideIcon("Umbrella", [
["path", { d: "M22 12a10.06 10.06 1 0 0-20 0Z", key: "1teyop" }],
["path", { d: "M12 12v8a2 2 0 0 0 4 0", key: "ulpmoc" }],
["path", { d: "M12 2v1", key: "11qlp1" }]
]);
export { Umbrella as default };
//# sourceMappingURL=umbrella.js.map
@@ -0,0 +1,354 @@
import type { ParserServices, TSESTree } from '../ts-estree';
import type { Parser } from './Parser';
import type { Scope } from './Scope';
declare class TokenStore {
/**
* Checks whether any comments exist or not between the given 2 nodes.
* @param left The node to check.
* @param right The node to check.
* @returns `true` if one or more comments exist.
*/
commentsExistBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean;
/**
* Gets all comment tokens directly after the given node or token.
* @param nodeOrToken The AST node or token to check for adjacent comment tokens.
* @returns An array of comments in occurrence order.
*/
getCommentsAfter(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[];
/**
* Gets all comment tokens directly before the given node or token.
* @param nodeOrToken The AST node or token to check for adjacent comment tokens.
* @returns An array of comments in occurrence order.
*/
getCommentsBefore(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[];
/**
* Gets all comment tokens inside the given node.
* @param node The AST node to get the comments for.
* @returns An array of comments in occurrence order.
*/
getCommentsInside(node: TSESTree.Node): TSESTree.Comment[];
/**
* Gets the first token of the given node.
* @param node The AST node.
* @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
* @returns An object representing the token.
*/
getFirstToken<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets the first token between two non-overlapping nodes.
* @param left Node before the desired token range.
* @param right Node after the desired token range.
* @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
* @returns An object representing the token.
*/
getFirstTokenBetween<T extends SourceCode.CursorWithSkipOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets the first `count` tokens of the given node.
* @param node The AST node.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
*/
getFirstTokens<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets the first `count` tokens between two non-overlapping nodes.
* @param left Node before the desired token range.
* @param right Node after the desired token range.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
* @returns Tokens between left and right.
*/
getFirstTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets the last token of the given node.
* @param node The AST node.
* @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
* @returns An object representing the token.
*/
getLastToken<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets the last token between two non-overlapping nodes.
* @param left Node before the desired token range.
* @param right Node after the desired token range.
* @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
* @returns An object representing the token.
*/
getLastTokenBetween<T extends SourceCode.CursorWithSkipOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets the last `count` tokens of the given node.
* @param node The AST node.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
*/
getLastTokens<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets the last `count` tokens between two non-overlapping nodes.
* @param left Node before the desired token range.
* @param right Node after the desired token range.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
* @returns Tokens between left and right.
*/
getLastTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets the token that follows a given node or token.
* @param node The AST node or token.
* @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
* @returns An object representing the token.
*/
getTokenAfter<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets the token that precedes a given node or token.
* @param node The AST node or token.
* @param options The option object
* @returns An object representing the token.
*/
getTokenBefore<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets the token starting at the specified index.
* @param offset Index of the start of the token's range.
* @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
* @returns The token starting at index, or null if no such token.
*/
getTokenByRangeStart<T extends {
includeComments?: boolean;
}>(offset: number, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
/**
* Gets all tokens that are related to the given node.
* @param node The AST node.
* @param beforeCount The number of tokens before the node to retrieve.
* @param afterCount The number of tokens after the node to retrieve.
* @returns Array of objects representing tokens.
*/
getTokens(node: TSESTree.Node, beforeCount?: number, afterCount?: number): TSESTree.Token[];
/**
* Gets all tokens that are related to the given node.
* @param node The AST node.
* @param options The option object. If this is a function then it's `options.filter`.
* @returns Array of objects representing tokens.
*/
getTokens<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node, options: T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets the `count` tokens that follows a given node or token.
* @param node The AST node.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
*/
getTokensAfter<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node | TSESTree.Token, options?: number | T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets the `count` tokens that precedes a given node or token.
* @param node The AST node.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
*/
getTokensBefore<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node | TSESTree.Token, options?: number | T): SourceCode.ReturnTypeFromOptions<T>[];
/**
* Gets all of the tokens between two non-overlapping nodes.
* @param left Node before the desired token range.
* @param right Node after the desired token range.
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
* @returns Tokens between left and right.
*/
getTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: number | T): SourceCode.ReturnTypeFromOptions<T>[];
}
declare class SourceCodeBase extends TokenStore {
/**
* Represents parsed source code.
* @param ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
*/
constructor(text: string, ast: SourceCode.Program);
/**
* Represents parsed source code.
* @param config The config object.
*/
constructor(config: SourceCode.SourceCodeConfig);
/**
* The parsed AST for the source code.
*/
ast: SourceCode.Program;
applyInlineConfig(): void;
applyLanguageOptions(): void;
finalize(): void;
/**
* Retrieves an array containing all comments in the source code.
* @returns An array of comment nodes.
*/
getAllComments(): TSESTree.Comment[];
/**
* Converts a (line, column) pair into a range index.
* @param location A line/column location
* @returns The range index of the location in the file.
*/
getIndexFromLoc(location: TSESTree.Position): number;
/**
* Gets the entire source text split into an array of lines.
* @returns The source text as an array of lines.
*/
getLines(): string[];
/**
* Converts a source text index into a (line, column) pair.
* @param index The index of a character in a file
* @returns A {line, column} location object with a 0-indexed column
*/
getLocFromIndex(index: number): TSESTree.Position;
/**
* Gets the deepest node containing a range index.
* @param index Range index of the desired node.
* @returns The node if found or `null` if not found.
*/
getNodeByRangeIndex(index: number): TSESTree.Node | null;
/**
* Gets the source code for the given node.
* @param node The AST node to get the text for.
* @param beforeCount The number of characters before the node to retrieve.
* @param afterCount The number of characters after the node to retrieve.
* @returns The text representing the AST node.
*/
getText(node?: TSESTree.Node | TSESTree.Token, beforeCount?: number, afterCount?: number): string;
/**
* The flag to indicate that the source code has Unicode BOM.
*/
hasBOM: boolean;
/**
* Determines if two nodes or tokens have at least one whitespace character
* between them. Order does not matter. Returns false if the given nodes or
* tokens overlap.
* @param first The first node or token to check between.
* @param second The second node or token to check between.
* @returns True if there is a whitespace character between any of the tokens found between the two given nodes or tokens.
*/
isSpaceBetween(first: TSESTree.Node | TSESTree.Token, second: TSESTree.Node | TSESTree.Token): boolean;
/**
* Determines if two nodes or tokens have at least one whitespace character
* between them. Order does not matter. Returns false if the given nodes or
* tokens overlap.
* For backward compatibility, this method returns true if there are
* `JSXText` tokens that contain whitespace between the two.
* @param first The first node or token to check between.
* @param second The second node or token to check between.
* @returns {boolean} True if there is a whitespace character between
* any of the tokens found between the two given nodes or tokens.
* @deprecated in favor of isSpaceBetween
*/
isSpaceBetweenTokens(first: TSESTree.Token, second: TSESTree.Token): boolean;
/**
* Returns the scope of the given node.
* This information can be used track references to variables.
*/
getScope(node: TSESTree.Node): Scope.Scope;
/**
* Returns an array of the ancestors of the given node, starting at
* the root of the AST and continuing through the direct parent of the current node.
* This array does not include the currently-traversed node itself.
*/
getAncestors(node: TSESTree.Node): TSESTree.Node[];
/**
* Returns a list of variables declared by the given node.
* This information can be used to track references to variables.
*/
getDeclaredVariables(node: TSESTree.Node): readonly Scope.Variable[];
/**
* Marks a variable with the given name in the current scope as used.
* This affects the no-unused-vars rule.
*/
markVariableAsUsed(name: string, node: TSESTree.Node): boolean;
/**
* The source code split into lines according to ECMA-262 specification.
* This is done to avoid each rule needing to do so separately.
*/
lines: string[];
/**
* The indexes in `text` that each line starts
*/
lineStartIndices: number[];
/**
* The parser services of this source code.
*/
parserServices?: Partial<ParserServices>;
/**
* The scope of this source code.
*/
scopeManager: Scope.ScopeManager | null;
/**
* The original text source code. BOM was stripped from this text.
*/
text: string;
/**
* All of the tokens and comments in the AST.
*
* TODO: rename to 'tokens'
*/
tokensAndComments: TSESTree.Token[];
/**
* The visitor keys to traverse AST.
*/
visitorKeys: SourceCode.VisitorKeys;
/**
* Split the source code into multiple lines based on the line delimiters.
* @param text Source code as a string.
* @returns Array of source code lines.
*/
static splitLines(text: string): string[];
}
declare namespace SourceCode {
interface Program extends TSESTree.Program {
comments: TSESTree.Comment[];
tokens: TSESTree.Token[];
}
interface SourceCodeConfig {
/**
* The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
*/
ast: Program;
/**
* The parser services.
*/
parserServices: ParserServices | null;
/**
* The scope of this source code.
*/
scopeManager: Scope.ScopeManager | null;
/**
* The source code text.
*/
text: string;
/**
* The visitor keys to traverse AST.
*/
visitorKeys: VisitorKeys | null;
}
type VisitorKeys = Parser.VisitorKeys;
type FilterPredicate = (token: TSESTree.Token) => boolean;
type GetFilterPredicate<Filter, Default> = Filter extends ((token: TSESTree.Token) => token is infer U extends TSESTree.Token) ? U : Default;
type GetFilterPredicateFromOptions<Options, Default> = Options extends {
filter?: FilterPredicate;
} ? GetFilterPredicate<Options['filter'], Default> : GetFilterPredicate<Options, Default>;
type ReturnTypeFromOptions<T> = T extends {
includeComments: true;
} ? GetFilterPredicateFromOptions<T, TSESTree.Token> : GetFilterPredicateFromOptions<T, Exclude<TSESTree.Token, TSESTree.Comment>>;
type CursorWithSkipOptions = number | FilterPredicate | {
/**
* The predicate function to choose tokens.
*/
filter?: FilterPredicate;
/**
* The flag to iterate comments as well.
*/
includeComments?: boolean;
/**
* The count of tokens the cursor skips.
*/
skip?: number;
};
type CursorWithCountOptions = number | FilterPredicate | {
/**
* The maximum count of tokens the cursor iterates.
*/
count?: number;
/**
* The predicate function to choose tokens.
*/
filter?: FilterPredicate;
/**
* The flag to iterate comments as well.
*/
includeComments?: boolean;
};
}
declare const SourceCode_base: typeof SourceCodeBase;
declare class SourceCode extends SourceCode_base {
}
export { SourceCode };
@@ -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 BookUp2 = createLucideIcon("BookUp2", [
["path", { d: "M12 13V7", key: "h0r20n" }],
["path", { d: "M18 2h1a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20", key: "161d7n" }],
["path", { d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2", key: "1lorq7" }],
["path", { d: "m9 10 3-3 3 3", key: "11gsxs" }],
["path", { d: "m9 5 3-3 3 3", key: "l8vdw6" }]
]);
export { BookUp2 as default };
//# sourceMappingURL=book-up-2.js.map
@@ -0,0 +1,67 @@
/**
* The `node:string_decoder` module provides an API for decoding `Buffer` objects
* into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
* characters. It can be accessed using:
*
* ```js
* import { StringDecoder } from 'node:string_decoder';
* ```
*
* The following example shows the basic use of the `StringDecoder` class.
*
* ```js
* import { StringDecoder } from 'node:string_decoder';
* const decoder = new StringDecoder('utf8');
*
* const cent = Buffer.from([0xC2, 0xA2]);
* console.log(decoder.write(cent)); // Prints: ¢
*
* const euro = Buffer.from([0xE2, 0x82, 0xAC]);
* console.log(decoder.write(euro)); // Prints: €
* ```
*
* When a `Buffer` instance is written to the `StringDecoder` instance, an
* internal buffer is used to ensure that the decoded string does not contain
* any incomplete multibyte characters. These are held in the buffer until the
* next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
*
* In the following example, the three UTF-8 encoded bytes of the European Euro
* symbol (`€`) are written over three separate operations:
*
* ```js
* import { StringDecoder } from 'node:string_decoder';
* const decoder = new StringDecoder('utf8');
*
* decoder.write(Buffer.from([0xE2]));
* decoder.write(Buffer.from([0x82]));
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
* ```
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/string_decoder.js)
*/
declare module "string_decoder" {
class StringDecoder {
constructor(encoding?: BufferEncoding);
/**
* Returns a decoded string, ensuring that any incomplete multibyte characters at
* the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
* returned string and stored in an internal buffer for the next call to `stringDecoder.write()` or `stringDecoder.end()`.
* @since v0.1.99
* @param buffer The bytes to decode.
*/
write(buffer: string | NodeJS.ArrayBufferView): string;
/**
* Returns any remaining input stored in the internal buffer as a string. Bytes
* representing incomplete UTF-8 and UTF-16 characters will be replaced with
* substitution characters appropriate for the character encoding.
*
* If the `buffer` argument is provided, one final call to `stringDecoder.write()` is performed before returning the remaining input.
* After `end()` is called, the `stringDecoder` object can be reused for new input.
* @since v0.9.3
* @param buffer The bytes to decode.
*/
end(buffer?: string | NodeJS.ArrayBufferView): string;
}
}
declare module "node:string_decoder" {
export * from "string_decoder";
}
@@ -0,0 +1,89 @@
import { HonoJsonWebKey } from "./jws.js";
//#region src/utils/jwt/types.d.ts
/**
* @module
* Type definitions for JWT utilities.
*/
export declare class JwtAlgorithmNotImplemented extends Error {
constructor(alg: string);
}
export declare class JwtAlgorithmRequired extends Error {
constructor();
}
export declare class JwtAlgorithmMismatch extends Error {
constructor(expected: string, actual: string);
}
export declare class JwtTokenInvalid extends Error {
constructor(token: string);
}
export declare class JwtTokenNotBefore extends Error {
constructor(token: string);
}
export declare class JwtTokenExpired extends Error {
constructor(token: string);
}
export declare class JwtTokenIssuedAt extends Error {
constructor(currentTimestamp: number, iat: number);
}
export declare class JwtTokenIssuer extends Error {
constructor(expected: string | RegExp, iss: string | null);
}
export declare class JwtHeaderInvalid extends Error {
constructor(header: object);
}
export declare class JwtHeaderRequiresKid extends Error {
constructor(header: object);
}
export declare class JwtSymmetricAlgorithmNotAllowed extends Error {
constructor(alg: string);
}
export declare class JwtAlgorithmNotAllowed extends Error {
constructor(alg: string, allowedAlgorithms: readonly string[]);
}
export declare class JwtTokenSignatureMismatched extends Error {
constructor(token: string);
}
export declare class JwtPayloadRequiresAud extends Error {
constructor(payload: object);
}
export declare class JwtTokenAudience extends Error {
constructor(expected: string | string[] | RegExp, aud: string | string[]);
}
export declare enum CryptoKeyUsage {
Encrypt = "encrypt",
Decrypt = "decrypt",
Sign = "sign",
Verify = "verify",
DeriveKey = "deriveKey",
DeriveBits = "deriveBits",
WrapKey = "wrapKey",
UnwrapKey = "unwrapKey"
}
/**
* JWT Payload
*/
export type JWTPayload = {
[key: string]: unknown;
/**
* The token is checked to ensure it has not expired.
*/
exp?: number;
/**
* The token is checked to ensure it is not being used before a specified time.
*/
nbf?: number;
/**
* The token is checked to ensure it is not issued in the future.
*/
iat?: number;
/**
* The token is checked to ensure it has been issued by a trusted issuer.
*/
iss?: string;
/**
* The token is checked to ensure it is intended for a specific audience.
*/
aud?: string | string[];
};
//#endregion
export type { HonoJsonWebKey };
@@ -0,0 +1 @@
{"version":3,"file":"file-audio-2.js","sources":["../../../src/icons/file-audio-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileAudio2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2MiIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8Y2lyY2xlIGN4PSIzIiBjeT0iMTciIHI9IjEiIC8+CiAgPHBhdGggZD0iTTIgMTd2LTNhNCA0IDAgMCAxIDggMHYzIiAvPgogIDxjaXJjbGUgY3g9IjkiIGN5PSIxNyIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-audio-2\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 FileAudio2 = createLucideIcon('FileAudio2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2', key: '17k7jt' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['circle', { cx: '3', cy: '17', r: '1', key: 'vo6nti' }],\n ['path', { d: 'M2 17v-3a4 4 0 0 1 8 0v3', key: '1ggdre' }],\n ['circle', { cx: '9', cy: '17', r: '1', key: 'bc1fq4' }],\n]);\n\nexport default FileAudio2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzD,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;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/es-define-property
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL
@@ -0,0 +1,12 @@
# `@typescript-eslint/types`
> Types for the TypeScript-ESTree AST spec
This package exists to help us reduce cycles and provide lighter-weight packages at runtime.
## ✋ Internal Package
This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint).
You likely don't want to use it directly.
👉 See **https://typescript-eslint.io** for docs on typescript-eslint.
@@ -0,0 +1 @@
{"version":3,"file":"lock-keyhole.js","sources":["../../../src/icons/lock-keyhole.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LockKeyhole\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE2IiByPSIxIiAvPgogIDxyZWN0IHg9IjMiIHk9IjEwIiB3aWR0aD0iMTgiIGhlaWdodD0iMTIiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik03IDEwVjdhNSA1IDAgMCAxIDEwIDB2MyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/lock-keyhole\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 LockKeyhole = createLucideIcon('LockKeyhole', [\n ['circle', { cx: '12', cy: '16', r: '1', key: '1au0dj' }],\n ['rect', { x: '3', y: '10', width: '18', height: '12', rx: '2', key: '6s8ecr' }],\n ['path', { d: 'M7 10V7a5 5 0 0 1 10 0v3', key: '1pqi11' }],\n]);\n\nexport default LockKeyhole;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAClD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC3D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,189 @@
import * as ts from 'typescript';
import type { TSESTree } from './ts-estree';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from './ts-estree';
declare const SyntaxKind: typeof ts.SyntaxKind;
type LogicalOperatorKind = ts.SyntaxKind.AmpersandAmpersandToken | ts.SyntaxKind.BarBarToken | ts.SyntaxKind.QuestionQuestionToken;
interface TokenToText extends TSESTree.PunctuatorTokenToText, TSESTree.BinaryOperatorToText {
[SyntaxKind.ImportKeyword]: 'import';
[SyntaxKind.KeyOfKeyword]: 'keyof';
[SyntaxKind.NewKeyword]: 'new';
[SyntaxKind.ReadonlyKeyword]: 'readonly';
[SyntaxKind.UniqueKeyword]: 'unique';
}
type AssignmentOperatorKind = keyof TSESTree.AssignmentOperatorToText;
type BinaryOperatorKind = keyof TSESTree.BinaryOperatorToText;
type DeclarationKind = TSESTree.VariableDeclaration['kind'];
/**
* Returns true if the given ts.Token is a logical operator
*/
export declare function isLogicalOperator(operator: ts.BinaryOperatorToken): operator is ts.Token<LogicalOperatorKind>;
export declare function isESTreeBinaryOperator(operator: ts.BinaryOperatorToken): operator is ts.Token<BinaryOperatorKind>;
type TokenForTokenKind<T extends ts.SyntaxKind> = T extends keyof TokenToText ? TokenToText[T] : string | undefined;
/**
* Returns the string form of the given TSToken SyntaxKind
*/
export declare function getTextForTokenKind<T extends ts.SyntaxKind>(kind: T): TokenForTokenKind<T>;
/**
* Returns true if the given ts.Node is a valid ESTree class member
*/
export declare function isESTreeClassMember(node: ts.Node): boolean;
/**
* Checks if a ts.Node has a modifier
*/
export declare function hasModifier(modifierKind: ts.KeywordSyntaxKind, node: ts.Node): boolean;
/**
* Get last last modifier in ast
* @returns returns last modifier if present or null
*/
export declare function getLastModifier(node: ts.Node): ts.Modifier | null;
/**
* Returns true if the given ts.Token is a comma
*/
export declare function isComma(token: ts.Node): token is ts.Token<ts.SyntaxKind.CommaToken>;
/**
* Returns true if the given ts.Node is a comment
*/
export declare function isComment(node: ts.Node): boolean;
/**
* Returns the binary expression type of the given ts.Token
*/
export declare function getBinaryExpressionType(operator: ts.BinaryOperatorToken): {
operator: TokenForTokenKind<AssignmentOperatorKind>;
type: AST_NODE_TYPES.AssignmentExpression;
} | {
operator: TokenForTokenKind<BinaryOperatorKind>;
type: AST_NODE_TYPES.BinaryExpression;
} | {
operator: TokenForTokenKind<LogicalOperatorKind>;
type: AST_NODE_TYPES.LogicalExpression;
};
/**
* Returns line and column data for the given positions
*/
export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.Position;
/**
* Returns line and column data for the given start and end positions,
* for the given AST
*/
export declare function getLocFor(range: TSESTree.Range, ast: ts.SourceFile): TSESTree.SourceLocation;
/**
* Check whatever node can contain directive
*/
export declare function canContainDirective(node: ts.Block | ts.ClassStaticBlockDeclaration | ts.ModuleBlock | ts.SourceFile): boolean;
/**
* Returns range for the given ts.Node
*/
export declare function getRange(node: Pick<ts.Node, 'getEnd' | 'getStart'>, ast: ts.SourceFile): [number, number];
/**
* Returns true if a given ts.Node is a JSX token
*/
export declare function isJSXToken(node: ts.Node): boolean;
/**
* Returns the declaration kind of the given ts.Node
*/
export declare function getDeclarationKind(node: ts.VariableDeclarationList): DeclarationKind;
/**
* Gets a ts.Node's accessibility level
*/
export declare function getTSNodeAccessibility(node: ts.Node): 'private' | 'protected' | 'public' | undefined;
/**
* Finds the next token based on the previous one and its parent
* Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren
*/
export declare function findNextToken(previousToken: ts.TextRange, parent: ts.Node, ast: ts.SourceFile): ts.Node | undefined;
/**
* Find the first matching ancestor based on the given predicate function.
* @param node The current ts.Node
* @param predicate The predicate function to apply to each checked ancestor
* @returns a matching parent ts.Node
*/
export declare function findFirstMatchingAncestor(node: ts.Node, predicate: (node: ts.Node) => boolean): ts.Node | undefined;
/**
* Returns true if a given ts.Node has a JSX token within its hierarchy
*/
export declare function hasJSXAncestor(node: ts.Node): boolean;
/**
* Unescape the text content of string literals, e.g. &amp; -> &
* @param text The escaped string literal text.
* @returns The unescaped string literal text.
*/
export declare function unescapeStringLiteralText(text: string): string;
/**
* Returns true if a given ts.Node is a computed property
*/
export declare function isComputedProperty(node: ts.Node): node is ts.ComputedPropertyName;
/**
* Returns true if a given ts.Node is optional (has QuestionToken)
* @param node ts.Node to be checked
*/
export declare function isOptional(node: {
questionToken?: ts.QuestionToken;
}): boolean;
/**
* Returns true if the node is an optional chain node
*/
export declare function isChainExpression(node: TSESTree.Node): node is TSESTree.ChainExpression;
/**
* Returns true of the child of property access expression is an optional chain
*/
export declare function isChildUnwrappableOptionalChain(node: ts.CallExpression | ts.ElementAccessExpression | ts.NonNullExpression | ts.PropertyAccessExpression, child: TSESTree.Node): boolean;
/**
* Returns the type of a given ts.Token
*/
export declare function getTokenType(token: ts.Identifier | ts.Token<ts.SyntaxKind>): Exclude<AST_TOKEN_TYPES, AST_TOKEN_TYPES.Block | AST_TOKEN_TYPES.Line>;
/**
* Extends and formats a given ts.Token, for a given AST
*/
export declare function convertToken(token: ts.Token<ts.TokenSyntaxKind>, ast: ts.SourceFile): TSESTree.Token;
/**
* Converts all tokens for the given AST
* @param ast the AST object
* @returns the converted Tokens
*/
export declare function convertTokens(ast: ts.SourceFile): TSESTree.Token[];
export declare class TSError extends Error {
readonly fileName: string;
readonly location: {
end: {
column: number;
line: number;
offset: number;
};
start: {
column: number;
line: number;
offset: number;
};
};
name: string;
constructor(message: string, fileName: string, location: {
end: {
column: number;
line: number;
offset: number;
};
start: {
column: number;
line: number;
offset: number;
};
});
get index(): number;
get lineNumber(): number;
get column(): number;
}
export declare function createError(node: ts.Node, message: string): TSError;
export declare function createError(node: number | ts.Node | TSESTree.Range, message: string, sourceFile: ts.SourceFile): TSError;
export declare function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean;
/**
* Like `forEach`, but suitable for use with numbers and strings (which may be falsy).
*/
export declare function firstDefined<T, U>(array: readonly T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
export declare function identifierIsThisKeyword(id: ts.Identifier): boolean;
export declare function isThisIdentifier(node: ts.Node | undefined): node is ts.Identifier;
export declare function isThisInTypeQuery(node: ts.Node): boolean;
export declare function isValidAssignmentTarget(node: ts.Node): boolean;
export declare function getNamespaceModifiers(node: ts.ModuleDeclaration): ts.Modifier[] | undefined;
export declare function declarationNameToString(node: ts.Node): string;
export declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression;
export {};
@@ -0,0 +1,115 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "តួអក្សរ", verb: "គួរមាន" },
file: { unit: "បៃ", verb: "គួរមាន" },
array: { unit: "ធាតុ", verb: "គួរមាន" },
set: { unit: "ធាតុ", verb: "គួរមាន" },
map: { unit: "ធាតុ", verb: "គួរមាន" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "ទិន្នន័យបញ្ចូល",
email: "អាសយដ្ឋានអ៊ីមែល",
url: "URL",
emoji: "សញ្ញាអារម្មណ៍",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "កាលបរិច្ឆេទ និងម៉ោង ISO",
date: "កាលបរិច្ឆេទ ISO",
time: "ម៉ោង ISO",
duration: "រយៈពេល ISO",
ipv4: "អាសយដ្ឋាន IPv4",
ipv6: "អាសយដ្ឋាន IPv6",
mac: "អាសយដ្ឋាន MAC",
cidrv4: "ដែនអាសយដ្ឋាន IPv4",
cidrv6: "ដែនអាសយដ្ឋាន IPv6",
base64: "ខ្សែអក្សរអ៊ិកូដ base64",
base64url: "ខ្សែអក្សរអ៊ិកូដ base64url",
json_string: "ខ្សែអក្សរ JSON",
e164: "លេខ E.164",
credit_card: "លេខប័ណ្ណឥណទាន",
currency_code: "កូដរូបិយប័ណ្ណ",
iban: "IBAN",
jwt: "JWT",
template_literal: "ទិន្នន័យបញ្ចូល",
};
const TypeDictionary = {
nan: "NaN",
number: "លេខ",
array: "អារេ (Array)",
null: "គ្មានតម្លៃ (null)",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${issue.expected} ប៉ុន្តែទទួលបាន ${received}`;
}
return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${expected} ប៉ុន្តែទទួលបាន ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${util.stringifyPrimitive(issue.values[0])}`;
return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `ធំពេក៖ ត្រូវការ ${issue.origin ?? "តម្លៃ"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "ធាតុ"}`;
return `ធំពេក៖ ត្រូវការ ${issue.origin ?? "តម្លៃ"} ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `តូចពេក៖ ត្រូវការ ${issue.origin} ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `តូចពេក៖ ត្រូវការ ${issue.origin} ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${_issue.suffix}"`;
if (_issue.format === "includes")
return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${_issue.includes}"`;
if (_issue.format === "regex")
return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${_issue.pattern}`;
return `មិនត្រឹមត្រូវ៖ ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${issue.divisor}`;
case "unrecognized_keys":
return `រកឃើញសោមិនស្គាល់៖ ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `សោមិនត្រឹមត្រូវនៅក្នុង ${issue.origin}`;
case "invalid_union":
return `ទិន្នន័យមិនត្រឹមត្រូវ`;
case "invalid_element":
return `ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${issue.origin}`;
default:
return `ទិន្នន័យមិនត្រឹមត្រូវ`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
{"version":3,"file":"chart-column-increasing.js","sources":["../../../src/icons/chart-column-increasing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartColumnIncreasing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMgMTdWOSIgLz4KICA8cGF0aCBkPSJNMTggMTdWNSIgLz4KICA8cGF0aCBkPSJNMyAzdjE2YTIgMiAwIDAgMCAyIDJoMTYiIC8+CiAgPHBhdGggZD0iTTggMTd2LTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-column-increasing\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 ChartColumnIncreasing = createLucideIcon('ChartColumnIncreasing', [\n ['path', { d: 'M13 17V9', key: '1fwyjl' }],\n ['path', { d: 'M18 17V5', key: 'sfb6ij' }],\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }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A,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isReferenceToGlobalFunction = isReferenceToGlobalFunction;
function isReferenceToGlobalFunction(calleeName, node, sourceCode) {
const ref = sourceCode
.getScope(node)
.references.find(ref => ref.identifier.name === calleeName);
// ensure it's the "global" version
return !ref?.resolved?.defs.length;
}
@@ -0,0 +1,40 @@
"use client";
require("./_virtual/_rolldown/runtime.cjs");
const require_useRouter = require("./useRouter.cjs");
let _tanstack_router_core = require("@tanstack/router-core");
let react = require("react");
let _tanstack_react_store = require("@tanstack/react-store");
let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
//#region src/useLocation.tsx
/**
* Read the current location from the router state with optional selection.
* Useful for subscribing to just the pieces of location you care about.
*
* Options:
* - `select`: Project the `location` object to a derived value
* - `structuralSharing`: Enable structural sharing for stable references
*
* @returns The current location (or selected value).
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook
*/
function useLocation(opts) {
const router = require_useRouter.useRouter();
if (_tanstack_router_core_isServer.isServer ?? router.isServer) {
const location = router.stores.location.get();
return opts?.select ? opts.select(location) : location;
}
const previousResult = (0, react.useRef)(void 0);
return (0, _tanstack_react_store.useStore)(router.stores.location, (location) => {
const selected = opts?.select ? opts.select(location) : location;
if (opts?.structuralSharing ?? router.options.defaultStructuralSharing) {
const shared = (0, _tanstack_router_core.replaceEqualDeep)(previousResult.current, selected);
previousResult.current = shared;
return shared;
}
return selected;
});
}
//#endregion
exports.useLocation = useLocation;
//# sourceMappingURL=useLocation.cjs.map
@@ -0,0 +1,16 @@
/**
* Adds a specified number of months to a date.
* 向日期添加指定数量的月份。
*
* @param date - The date to add months to. (要添加月份的日期。)
* @param months - The number of months to add. (要添加的月份数。)
* @returns A new date with the added months. (添加月份后的新日期。)
* @example
* ```ts
* // Adding 2 months to a date (向日期添加2个月)
* const originalDate = new Date('2023-10-31T12:00:00');
* addMonths(originalDate, 2);
* console.log(originalDate.toISOString()); // Outputs: '2023-12-31T12:00:00.000Z' (输出: '2023-12-31T12:00:00.000Z')
* ```
*/
export default function addMonths(date: Date, months: number): Date;
@@ -0,0 +1,32 @@
export { JSON5ParseOptions, JSON5StringifyOptions, parseJSON5, stringifyJSON5 } from './json5.cjs';
export { JSONCParseError, JSONCParseOptions, parseJSONC, stringifyJSONC } from './jsonc.cjs';
export { YAMLParseOptions, YAMLStringifyOptions, parseYAML, stringifyYAML } from './yaml.cjs';
import { F as FormatOptions } from './shared/confbox.9745c98f.cjs';
export { parseTOML, stringifyTOML } from './toml.cjs';
/**
* Converts a [JSON](https://www.json.org/json-en.html) string into an object.
*
* Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
*/
declare function parseJSON<T = unknown>(text: string, options?: JSONParseOptions): T;
/**
* Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
*
* Indentation status is auto detected and preserved when using value from parseJSON.
*/
declare function stringifyJSON(value: any, options?: JSONStringifyOptions): string;
interface JSONParseOptions extends FormatOptions {
/**
* A function that transforms the results. This function is called for each member of the object.
*/
reviver?: (this: any, key: string, value: any) => any;
}
interface JSONStringifyOptions extends FormatOptions {
/**
* A function that transforms the results. This function is called for each member of the object.
*/
replacer?: (this: any, key: string, value: any) => any;
}
export { type JSONParseOptions, type JSONStringifyOptions, parseJSON, stringifyJSON };
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.skipChainExpression = skipChainExpression;
const utils_1 = require("@typescript-eslint/utils");
function skipChainExpression(node) {
return node.type === utils_1.AST_NODE_TYPES.ChainExpression ? node.expression : node;
}
@@ -0,0 +1,7 @@
# vitest
[![NPM version](https://img.shields.io/npm/v/vitest?color=a1b858&label=)](https://npmx.dev/package/vitest)
Next generation testing framework powered by Vite.
[GitHub](https://github.com/vitest-dev/vitest) | [Documentation](https://vitest.dev/)
@@ -0,0 +1,2 @@
import { a as detectCodeFormat, i as parseModule, n as generateCode, o as MagicastError, r as parseExpression, t as builders } from "./builders-mk_DIY8_.js";
export { MagicastError, builders, detectCodeFormat, generateCode, parseExpression, parseModule };
@@ -0,0 +1,3 @@
/* ajv 6.14.0: Another JSON Schema Validator */
(e=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,e())})(function(){return function a(s,o,i){function n(r,e){if(!o[r]){if(!s[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(l)return l(r,!0);throw(e=new Error("Cannot find module '"+r+"'")).code="MODULE_NOT_FOUND",e}t=o[r]={exports:{}},s[r][0].call(t.exports,function(e){return n(s[r][1][e]||e)},t,t.exports,a,s,o,i)}return o[r].exports}for(var l="function"==typeof require&&require,e=0;e<i.length;e++)n(i[e]);return n}({1:[function(e,r,t){r=r.exports=function(){this._cache={}};r.prototype.put=function(e,r){this._cache[e]=r},r.prototype.get=function(e){return this._cache[e]},r.prototype.del=function(e){delete this._cache[e]},r.prototype.clear=function(){this._cache={}}},{}],2:[function(e,r,t){var a=e("./error_classes").MissingRef;function s(r,i,t){var n=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof i&&(t=i,i=void 0);var e=l(r).then(function(){var e=n._addSchema(r,void 0,i);return e.validate||function s(o){try{return n._compile(o)}catch(e){if(e instanceof a)return r(e);throw e}function r(e){var r=e.missingSchema;if(a(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");e=n._loadingSchemas[r];return e||(e=n._loadingSchemas[r]=n._opts.loadSchema(r)).then(t,t),e.then(function(e){if(!a(r))return l(e).then(function(){a(r)||n.addSchema(e,r,void 0,i)})}).then(function(){return s(o)});function t(){delete n._loadingSchemas[r]}function a(e){return n._refs[e]||n._schemas[e]}}}(e)});return t&&e.then(function(e){t(null,e)},t),e;function l(e){e=e.$schema;return e&&!n.getSchema(e)?s.call(n,{$ref:e},!0):Promise.resolve()}}r.exports=s},{"./error_classes":3}],3:[function(e,r,t){var a=e("./resolve");function s(e,r,t){this.message=t||s.message(e,r),this.missingRef=a.url(e,r),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}r.exports={Validation:o(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:o(s)},s.message=function(e,r){return"can't resolve reference "+r+" from id "+e}},{"./resolve":6}],4:[function(e,r,t){var a=e("./util"),s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,e=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,n=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9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F\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])Line truncated
//# sourceMappingURL=ajv.min.js.map
@@ -0,0 +1,34 @@
'use strict';
var Module = require('module');
var path = require('path');
module.exports = function requireFromString(code, filename, opts) {
if (typeof filename === 'object') {
opts = filename;
filename = undefined;
}
opts = opts || {};
filename = filename || '';
opts.appendPaths = opts.appendPaths || [];
opts.prependPaths = opts.prependPaths || [];
if (typeof code !== 'string') {
throw new Error('code must be a string, not ' + typeof code);
}
var paths = Module._nodeModulePaths(path.dirname(filename));
var parent = module.parent;
var m = new Module(filename, parent);
m.filename = filename;
m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths);
m._compile(code, filename);
var exports = m.exports;
parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1);
return exports;
};
@@ -0,0 +1 @@
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../src/pack.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,qEAAqE;AACrE,+BAA+B;AAC/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nC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAA;gBACjB,CAAC;gBACD,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAChD,CAAC;YACD,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;gBACb,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACjC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAA;gBACf,CAAC;gBACD,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC5C,CAAC;YACD,oBAAoB;YACpB,IAAI,CAAC,IAAI,CAAC,GAAG;gBAAE,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;YAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YACpB,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAA0B,CAAC,CAAC,CAAA;YAChE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;YAChC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GALine truncated
@@ -0,0 +1,20 @@
"use client";
import { useRef } from 'react';
/**
* Creates a constant value over the lifecycle of a component.
*
* Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
* a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
* you can ensure that initialisers don't execute twice or more.
*/
function useConstant(init) {
const ref = useRef(null);
if (ref.current === null) {
ref.current = init();
}
return ref.current;
}
export { useConstant };
//# sourceMappingURL=use-constant.mjs.map
@@ -0,0 +1,19 @@
import { useRouter } from "./useRouter.js";
import { jsx } from "react/jsx-runtime";
import { isServer } from "@tanstack/router-core/isServer";
//#region src/ScriptOnce.tsx
/**
* Server-only helper to emit a script tag exactly once during SSR.
*/
function ScriptOnce({ children }) {
const router = useRouter();
if (!(isServer ?? router.isServer)) return null;
return /* @__PURE__ */ jsx("script", {
nonce: router.options.ssr?.nonce,
dangerouslySetInnerHTML: { __html: children + ";document.currentScript.remove()" }
});
}
//#endregion
export { ScriptOnce };
//# sourceMappingURL=ScriptOnce.js.map
@@ -0,0 +1 @@
{"version":3,"file":"circle-dollar-sign.js","sources":["../../../src/icons/circle-dollar-sign.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleDollarSign\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTYgOGgtNmEyIDIgMCAxIDAgMCA0aDRhMiAyIDAgMSAxIDAgNEg4IiAvPgogIDxwYXRoIGQ9Ik0xMiAxOFY2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-dollar-sign\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 CircleDollarSign = createLucideIcon('CircleDollarSign', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 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 +1,14 @@
import { transformPropOrder } from './keys-transform.mjs';
const positionalKeys = new Set([
"width",
"height",
"top",
"left",
"right",
"bottom",
...transformPropOrder,
]);
export { positionalKeys };
//# sourceMappingURL=keys-position.mjs.map
@@ -0,0 +1,162 @@
import Benchmark from "benchmark";
import { z } from "zod/v3";
import { Mocker } from "../tests/Mocker.js";
const val = new Mocker();
const enumSuite = new Benchmark.Suite("z.enum");
const enumSchema = z.enum(["a", "b", "c"]);
enumSuite
.add("valid", () => {
enumSchema.parse("a");
})
.add("invalid", () => {
try {
enumSchema.parse("x");
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`z.enum: ${e.target}`);
});
const longEnumSuite = new Benchmark.Suite("long z.enum");
const longEnumSchema = z.enum([
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
"fifteen",
"sixteen",
"seventeen",
]);
longEnumSuite
.add("valid", () => {
longEnumSchema.parse("five");
})
.add("invalid", () => {
try {
longEnumSchema.parse("invalid");
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`long z.enum: ${e.target}`);
});
const undefinedSuite = new Benchmark.Suite("z.undefined");
const undefinedSchema = z.undefined();
undefinedSuite
.add("valid", () => {
undefinedSchema.parse(undefined);
})
.add("invalid", () => {
try {
undefinedSchema.parse(1);
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`z.undefined: ${e.target}`);
});
const literalSuite = new Benchmark.Suite("z.literal");
const short = "short";
const bad = "bad";
const literalSchema = z.literal("short");
literalSuite
.add("valid", () => {
literalSchema.parse(short);
})
.add("invalid", () => {
try {
literalSchema.parse(bad);
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`z.literal: ${e.target}`);
});
const numberSuite = new Benchmark.Suite("z.number");
const numberSchema = z.number().int();
numberSuite
.add("valid", () => {
numberSchema.parse(1);
})
.add("invalid type", () => {
try {
numberSchema.parse("bad");
} catch (_e: any) {}
})
.add("invalid number", () => {
try {
numberSchema.parse(0.5);
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`z.number: ${e.target}`);
});
const dateSuite = new Benchmark.Suite("z.date");
const plainDate = z.date();
const minMaxDate = z.date().min(new Date("2021-01-01")).max(new Date("2030-01-01"));
dateSuite
.add("valid", () => {
plainDate.parse(new Date());
})
.add("invalid", () => {
try {
plainDate.parse(1);
} catch (_e: any) {}
})
.add("valid min and max", () => {
minMaxDate.parse(new Date("2023-01-01"));
})
.add("invalid min", () => {
try {
minMaxDate.parse(new Date("2019-01-01"));
} catch (_e: any) {}
})
.add("invalid max", () => {
try {
minMaxDate.parse(new Date("2031-01-01"));
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`z.date: ${e.target}`);
});
const symbolSuite = new Benchmark.Suite("z.symbol");
const symbolSchema = z.symbol();
symbolSuite
.add("valid", () => {
symbolSchema.parse(val.symbol);
})
.add("invalid", () => {
try {
symbolSchema.parse(1);
} catch (_e: any) {}
})
.on("cycle", (e: Benchmark.Event) => {
console.log(`z.symbol: ${e.target}`);
});
export default {
suites: [enumSuite, longEnumSuite, undefinedSuite, literalSuite, numberSuite, dateSuite, symbolSuite],
};
@@ -0,0 +1 @@
{"version":3,"file":"git-branch.js","sources":["../../../src/icons/git-branch.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GitBranch\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNiIgeDI9IjYiIHkxPSIzIiB5Mj0iMTUiIC8+CiAgPGNpcmNsZSBjeD0iMTgiIGN5PSI2IiByPSIzIiAvPgogIDxjaXJjbGUgY3g9IjYiIGN5PSIxOCIgcj0iMyIgLz4KICA8cGF0aCBkPSJNMTggOWE5IDkgMCAwIDEtOSA5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/git-branch\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 GitBranch = createLucideIcon('GitBranch', [\n ['line', { x1: '6', x2: '6', y1: '3', y2: '15', key: '17qcm7' }],\n ['circle', { cx: '18', cy: '6', r: '3', key: '1h7g24' }],\n ['circle', { cx: '6', cy: '18', r: '3', key: 'fqmcym' }],\n ['path', { d: 'M18 9a9 9 0 0 1-9 9', key: 'n2h4wq' }],\n]);\n\nexport default GitBranch;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC/D,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,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,CAAuB,CAAA,CAAA,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;AACtD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,164 @@
import type { Primitive } from "./helpers/typeAliases.js";
import { util, type ZodParsedType } from "./helpers/util.js";
import type { TypeOf, ZodType } from "./index.js";
type allKeys<T> = T extends any ? keyof T : never;
export type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
export type typeToFlattenedError<T, U = string> = {
formErrors: U[];
fieldErrors: {
[P in allKeys<T>]?: U[];
};
};
export declare const ZodIssueCode: {
invalid_type: "invalid_type";
too_big: "too_big";
too_small: "too_small";
not_multiple_of: "not_multiple_of";
unrecognized_keys: "unrecognized_keys";
invalid_union: "invalid_union";
custom: "custom";
invalid_literal: "invalid_literal";
invalid_union_discriminator: "invalid_union_discriminator";
invalid_enum_value: "invalid_enum_value";
invalid_arguments: "invalid_arguments";
invalid_return_type: "invalid_return_type";
invalid_date: "invalid_date";
invalid_string: "invalid_string";
invalid_intersection_types: "invalid_intersection_types";
not_finite: "not_finite";
};
export type ZodIssueCode = keyof typeof ZodIssueCode;
export type ZodIssueBase = {
path: (string | number)[];
message?: string | undefined;
};
export interface ZodInvalidTypeIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_type;
expected: ZodParsedType;
received: ZodParsedType;
}
export interface ZodInvalidLiteralIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_literal;
expected: unknown;
received: unknown;
}
export interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
code: typeof ZodIssueCode.unrecognized_keys;
keys: string[];
}
export interface ZodInvalidUnionIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_union;
unionErrors: ZodError[];
}
export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_union_discriminator;
options: Primitive[];
}
export interface ZodInvalidEnumValueIssue extends ZodIssueBase {
received: string | number;
code: typeof ZodIssueCode.invalid_enum_value;
options: (string | number)[];
}
export interface ZodInvalidArgumentsIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_arguments;
argumentsError: ZodError;
}
export interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_return_type;
returnTypeError: ZodError;
}
export interface ZodInvalidDateIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_date;
}
export type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
includes: string;
position?: number | undefined;
} | {
startsWith: string;
} | {
endsWith: string;
};
export interface ZodInvalidStringIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_string;
validation: StringValidation;
}
export interface ZodTooSmallIssue extends ZodIssueBase {
code: typeof ZodIssueCode.too_small;
minimum: number | bigint;
inclusive: boolean;
exact?: boolean;
type: "array" | "string" | "number" | "set" | "date" | "bigint";
}
export interface ZodTooBigIssue extends ZodIssueBase {
code: typeof ZodIssueCode.too_big;
maximum: number | bigint;
inclusive: boolean;
exact?: boolean;
type: "array" | "string" | "number" | "set" | "date" | "bigint";
}
export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
code: typeof ZodIssueCode.invalid_intersection_types;
}
export interface ZodNotMultipleOfIssue extends ZodIssueBase {
code: typeof ZodIssueCode.not_multiple_of;
multipleOf: number | bigint;
}
export interface ZodNotFiniteIssue extends ZodIssueBase {
code: typeof ZodIssueCode.not_finite;
}
export interface ZodCustomIssue extends ZodIssueBase {
code: typeof ZodIssueCode.custom;
params?: {
[k: string]: any;
};
}
export type DenormalizedError = {
[k: string]: DenormalizedError | string[];
};
export type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
export type ZodIssue = ZodIssueOptionalMessage & {
fatal?: boolean | undefined;
message: string;
};
export declare const quotelessJson: (obj: any) => string;
type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
[K in keyof T]?: ZodFormattedError<T[K]>;
} : T extends any[] ? {
[k: number]: ZodFormattedError<T[number]>;
} : T extends object ? {
[K in keyof T]?: ZodFormattedError<T[K]>;
} : unknown;
export type ZodFormattedError<T, U = string> = {
_errors: U[];
} & recursiveZodFormattedError<NonNullable<T>>;
export type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
export declare class ZodError<T = any> extends Error {
issues: ZodIssue[];
get errors(): ZodIssue[];
constructor(issues: ZodIssue[]);
format(): ZodFormattedError<T>;
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
static create: (issues: ZodIssue[]) => ZodError<any>;
static assert(value: unknown): asserts value is ZodError;
toString(): string;
get message(): string;
get isEmpty(): boolean;
addIssue: (sub: ZodIssue) => void;
addIssues: (subs?: ZodIssue[]) => void;
flatten(): typeToFlattenedError<T>;
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
get formErrors(): typeToFlattenedError<T, string>;
}
type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
export type IssueData = stripPath<ZodIssueOptionalMessage> & {
path?: (string | number)[];
fatal?: boolean | undefined;
};
export type ErrorMapCtx = {
defaultError: string;
data: any;
};
export type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
message: string;
};
export {};
@@ -0,0 +1 @@
{"version":3,"names":["_removalHooks","require","_cache","_replacement","_index","t","_modification","_context","remove","_this$opts","_assertUnremoved","call","resync","_callRemovalHooks","_markRemoved","opts","noScope","_removeFromScope","shareCommentsWithSiblings","_remove","bindings","getBindingIdentifiers","node","Object","keys","forEach","name","scope","removeBinding","parentPath","fn","hooks","Array","isArray","container","splice","key","updateSiblingKeys","_replaceWith","_traverseFlags","SHOULD_SKIP","REMOVED","parent","_getCachedPaths","getCachedPaths","delete","removed","buildCodeFrameError"],"sources":["../../src/path/removal.ts"],"sourcesContent":["// This file contains methods responsible for removing a node.\n\nimport { hooks } from \"./lib/removal-hooks.ts\";\nimport { getCachedPaths } from \"../cache.ts\";\nimport { _replaceWith } from \"./replacement.ts\";\nimport type NodePath from \"./index.ts\";\nimport { REMOVED, SHOULD_SKIP } from \"./index.ts\";\nimport * as t from \"@babel/types\";\nimport { updateSiblingKeys } from \"./modification.ts\";\nimport { resync } from \"./context.ts\";\n\nexport function remove(this: NodePath) {\n _assertUnremoved.call(this);\n\n resync.call(this);\n\n if (_callRemovalHooks.call(this)) {\n _markRemoved.call(this);\n return;\n }\n\n if (!this.opts?.noScope) {\n _removeFromScope.call(this);\n }\n\n this.shareCommentsWithSiblings();\n _remove.call(this);\n _markRemoved.call(this);\n}\n\nexport function _removeFromScope(this: NodePath) {\n const bindings = t.getBindingIdentifiers(this.node, false, false, true);\n Object.keys(bindings).forEach(name => this.scope.removeBinding(name));\n}\n\nexport function _callRemovalHooks(this: NodePath) {\n if (this.parentPath) {\n for (const fn of hooks) {\n if (fn(this, this.parentPath)) return true;\n }\n }\n}\n\nexport function _remove(this: NodePath) {\n if (Array.isArray(this.container)) {\n this.container.splice(this.key as number, 1);\n updateSiblingKeys.call(this, this.key as number, -1);\n } else {\n _replaceWith.call(this, null);\n }\n}\n\nexport function _markRemoved(this: NodePath) {\n // this.shouldSkip = true; this.removed = true;\n this._traverseFlags |= SHOULD_SKIP | REMOVED;\n if (this.parent) {\n getCachedPaths(this)?.delete(this.node);\n }\n // @ts-expect-error TODO: better types\n this.node = null;\n}\n\nexport function _assertUnremoved(this: NodePath) {\n if (this.removed) {\n throw this.buildCodeFrameError(\n \"NodePath has been removed so is read-only.\",\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,CAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAEO,SAASO,MAAMA,CAAA,EAAiB;EAAA,IAAAC,UAAA;EACrCC,gBAAgB,CAACC,IAAI,CAAC,IAAI,CAAC;EAE3BC,eAAM,CAACD,IAAI,CAAC,IAAI,CAAC;EAEjB,IAAIE,iBAAiB,CAACF,IAAI,CAAC,IAAI,CAAC,EAAE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cAAc,IAAIC,kBAAW,GAAGC,cAAO;EAC5C,IAAI,IAAI,CAACC,MAAM,EAAE;IAAA,IAAAC,eAAA;IACf,CAAAA,eAAA,OAAAC,qBAAc,EAAC,IAAI,CAAC,aAApBD,eAAA,CAAsBE,MAAM,CAAC,IAAI,CAACvB,IAAI,CAAC;EACzC;EAEA,IAAI,CAACA,IAAI,GAAG,IAAI;AAClB;AAEO,SAASZ,gBAAgBA,CAAA,EAAiB;EAC/C,IAAI,IAAI,CAACoC,OAAO,EAAE;IAChB,MAAM,IAAI,CAACC,mBAAmB,CAC5B,4CACF,CAAC;EACH;AACF","ignoreList":[]}
@@ -0,0 +1,47 @@
{
"name": "@radix-ui/number",
"version": "1.1.2",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"devDependencies": {
"typescript": "^5.9.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git",
"directory": "packages/core/number"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "oxlint --max-warnings 0 src",
"clean": "rm -rf dist",
"reset": "rm -rf dist node_modules",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,33 @@
/**
* A callback-mode method that this module can wrap.
*/
export type Traceable = (this: unknown, ...args: unknown[]) => unknown;
/**
* A callback-mode method that this module can wrap.
*
* @typedef {(this: unknown, ...args: unknown[]) => unknown} Traceable
*/
/**
* Wraps `object[property]` so that an error delivered to its callback
* carries the call site's stack, augmented with the wrapped call.
*
* The callback is found at `pos` (negative counts from the end, the
* default -1 meaning the last argument). Only callback-mode calls are
* affected: without a function in that position the wrapper is a
* pass-through, which is why verbose() traces the callback cores and
* then rebuilds the dual-mode wrappers around them.
*
* @param {Record<string, Traceable>} object the holder of the method.
* @param {string} property the method name on `object`.
* @param {number} [pos=-1] position of the callback argument.
* @returns {void}
*/
declare function extendTrace(object: Record<string, Traceable>, property: string, pos?: number): void;
/**
* Drops this file's own frames from a stack string.
*
* @param {string | undefined} stackStr the stack to filter.
* @returns {string[]} the surviving frames.
*/
declare function filter(stackStr: string | undefined): string[];
export { extendTrace, filter };
@@ -0,0 +1,114 @@
/**
* @fileoverview Rule to disallow assignments to native objects or read-only global variables
* @author Ilya Volodin
* @deprecated in ESLint v3.3.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow assignments to native objects or read-only global variables",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-native-reassign",
},
deprecated: {
message: "Renamed rule.",
url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
deprecatedSince: "3.3.0",
availableUntil: "11.0.0",
replacedBy: [
{
rule: {
name: "no-global-assign",
url: "https://eslint.org/docs/rules/no-global-assign",
},
},
],
},
schema: [
{
type: "object",
properties: {
exceptions: {
type: "array",
items: { type: "string" },
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages: {
nativeReassign:
"Read-only global '{{name}}' should not be modified.",
},
},
create(context) {
const config = context.options[0];
const exceptions = (config && config.exceptions) || [];
const sourceCode = context.sourceCode;
/**
* Reports write references.
* @param {Reference} reference A reference to check.
* @param {number} index The index of the reference in the references.
* @param {Reference[]} references The array that the reference belongs to.
* @returns {void}
*/
function checkReference(reference, index, references) {
const identifier = reference.identifier;
if (
reference.init === false &&
reference.isWrite() &&
/*
* Destructuring assignments can have multiple default value,
* so possibly there are multiple writeable references for the same identifier.
*/
(index === 0 || references[index - 1].identifier !== identifier)
) {
context.report({
node: identifier,
messageId: "nativeReassign",
data: identifier,
});
}
}
/**
* Reports write references if a given variable is read-only builtin.
* @param {Variable} variable A variable to check.
* @returns {void}
*/
function checkVariable(variable) {
if (
variable.writeable === false &&
!exceptions.includes(variable.name)
) {
variable.references.forEach(checkReference);
}
}
return {
Program(node) {
const globalScope = sourceCode.getScope(node);
globalScope.variables.forEach(checkVariable);
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"scale-border-radius.mjs","sources":["../../../../src/projection/styles/scale-border-radius.ts"],"sourcesContent":["import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n"],"names":[],"mappings":";;AAIM,SAAU,eAAe,CAAC,MAAc,EAAE,IAAU,EAAA;AACtD,IAAA,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,CAAC;AACnC,IAAA,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG;AACjD;AAEA;;;;;;AAMG;AACI,MAAM,mBAAmB,GAA6B;AACzD,IAAA,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,KAAI;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,MAAM;AAE/B;;;AAGG;AACH,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B,YAAA,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACjB,gBAAA,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YAC/B;iBAAO;AACH,gBAAA,OAAO,MAAM;YACjB;QACJ;AAEA;;;AAGG;AACH,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhD,QAAA,OAAO,CAAA,EAAG,CAAC,CAAA,EAAA,EAAK,CAAC,GAAG;IACxB,CAAC;;;;;"}
@@ -0,0 +1,24 @@
/**
* @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 Fuel = createLucideIcon("Fuel", [
["line", { x1: "3", x2: "15", y1: "22", y2: "22", key: "xegly4" }],
["line", { x1: "4", x2: "14", y1: "9", y2: "9", key: "xcnuvu" }],
["path", { d: "M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18", key: "16j0yd" }],
[
"path",
{
d: "M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2a2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5",
key: "7cu91f"
}
]
]);
export { Fuel as default };
//# sourceMappingURL=fuel.js.map
@@ -0,0 +1,47 @@
{
"name": "@radix-ui/primitive",
"version": "1.1.3",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"devDependencies": {
"eslint": "^9.18.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@repo/eslint-config": "0.0.0"
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = tsRewriteRelativeImportExtensions;
function tsRewriteRelativeImportExtensions(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
});
}
return path;
}
//# sourceMappingURL=tsRewriteRelativeImportExtensions.js.map
@@ -0,0 +1,65 @@
import type * as core from "./core.cjs";
import type { SomeType } from "./schemas.cjs";
/** @internal Sentinel the compiled fast path returns when validation fails. */
export declare const INVALID: unique symbol;
/** @internal */
export type INVALID = typeof INVALID;
interface CompileFnOptions {
debug?: boolean | undefined;
/** Emit a validator instead of a parser: skip building the output value where nothing reads it. */
assertOnly?: boolean | undefined;
}
type CompiledFn<T> = ((input: unknown) => T | INVALID) & {
code?: string | undefined;
/** False when this function's INVALID does not strictly mean "the runtime would reject". */
definite?: boolean | undefined;
};
/** Raised when the schema contains async refinements or transforms. Surfaces only under `compile(schema, { strict: true })`. */
export declare class ZodCompileAsyncError extends Error {
constructor(message?: string);
}
/**
* Raised when the schema contains a feature whose semantics the fast path
* can't fully model. Both the shim in `zod/compile` and the default
* `compile()` fall back to the runtime parser for that schema; only
* `compile(schema, { strict: true })` lets it surface.
*/
export declare class ZodCompileUnsupportedError extends Error {
/** Whether a container may absorb this refusal by running the child through the runtime (see `compileChild`). False when running only that node on the runtime is not equivalent to running the whole parse there — a runtime island gets no parse context, so a node that *consumes* issues rather than propagating them would finalize them against the wrong error map and still succeed. */
readonly islandable: boolean;
constructor(feature: string, islandable?: boolean);
}
export interface CompileOptions {
/** Throw the refusal instead of returning the schema uncompiled. */
strict?: boolean | undefined;
}
/**
* AOT-compile a Zod schema. Returns a clone whose `_zod.run` calls a generated
* fast path first and falls back to the original runtime parser on failure.
*
* - Forward direction only. Backward (encode), async, and `skipChecks` paths
* bypass the fast path and use the runtime directly.
* - Never throws. A schema the fast path can't model is returned unchanged and
* keeps using the runtime parser. Pass `{ strict: true }` to get the refusal
* as a thrown `ZodCompileUnsupportedError` / `ZodCompileAsyncError` instead.
* - The original schema is unchanged. The clone shares children by reference.
*/
export declare function compile<T extends SomeType>(schema: T, options?: CompileOptions): T;
/**
* Install an already-generated parser as a schema's fast path. Returns a clone; the original is
* unchanged.
*
* The parser takes the input and returns the parsed value, or `INVALID` to hand the parse to the
* runtime. It must be synchronous and forward-direction, and it must build fresh output rather than
* return its input — Zod cannot check either, and a wrong *success* is returned to the caller as-is.
*
* `compile()` is the ordinary entry point. This is for a build-time or native compiler that produces
* a parser where `new Function` is unavailable.
*/
export declare function withParser<T extends SomeType>(schema: T, parser: (input: unknown) => core.output<T> | INVALID): T;
/**
* @internal Generate the standalone compiled function: a parser by default, a validator under
* `assertOnly`. Returns the parsed value, `true` where nothing reads the output, or `INVALID`. Consumers use `compile()`.
*/
export declare function compileFn<T extends SomeType>(schema: T, options?: CompileFnOptions): CompiledFn<core.output<T>>;
export {};
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","16":"FD","900":"_RC"},B:{"1":"_K","1025":"_I"},C:{"1":"_pF","900":"_f","1025":"_IC"},D:{"1":"_Q"},E:{"1":"_YB","16":"mB MD","900":"_TQ"},F:{"1":"_a","16":"F","132":"_6 _O"},G:{"1":"_FG _jL _s","16":"lC","2052":"_lC"},H:{"132":"1D"},I:{"1":"_CO","16":"_m","4097":"I"},J:{"1":"_B"},K:{"132":"_D","4097":"H"},L:{"4097":"I"},M:{"4097":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"4097":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1025":"_C"}},B:1,C:"maxlength attribute for input and textarea elements",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"helpers.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,YAAY,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgB;IAC1C,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IAEvB;;;OAGG;IACH,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAChB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAExB;;;;WAIG;QACH,IAAI,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACrB,SAAS;QACb,CAAC;QAED,KAAK,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ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,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChB,MAAM,QAAQ,GAAG,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/C,IAAI,QAAQ,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,QAAQ,GAAG,gBAAgB,CAAC,SAAS,EAAE,CAAC;YAC/C,OAAO,CAAC,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -0,0 +1,70 @@
1.2.2 / 2024-10-29
==================
* various metadata/documentation tweaks (incl. #51)
1.2.1 / 2023-02-27
==================
* update annotations for allowed secret key types (#44, thanks @jyasskin!)
1.2.0 / 2022-02-17
==================
* allow buffer and other node-supported types as key (#33)
* be pickier about extra content after signed portion (#40)
* some internal code clarity/cleanup improvements (#26)
1.1.0 / 2018-01-18
==================
* switch to built-in `crypto.timingSafeEqual` for validation instead of previous double-hash method (thank you @jodevsa!)
1.0.7 / 2023-04-12
==================
Later release for older node.js versions. See the [v1.0.x branch notes](https://github.com/tj/node-cookie-signature/blob/v1.0.x/History.md#107--2023-04-12).
1.0.6 / 2015-02-03
==================
* use `npm test` instead of `make test` to run tests
* clearer assertion messages when checking input
1.0.5 / 2014-09-05
==================
* add license to package.json
1.0.4 / 2014-06-25
==================
* corrected avoidance of timing attacks (thanks @tenbits!)
1.0.3 / 2014-01-28
==================
* [incorrect] fix for timing attacks
1.0.2 / 2014-01-28
==================
* fix missing repository warning
* fix typo in test
1.0.1 / 2013-04-15
==================
* Revert "Changed underlying HMAC algo. to sha512."
* Revert "Fix for timing attacks on MAC verification."
0.0.1 / 2010-01-03
==================
* Initial release
@@ -0,0 +1,67 @@
import { $ as warnDeprecation, c as hasLinesAndGetLocFromIndex, f as createRule, u as isTextSourceCode } from "../utils.js";
var eol_last_default = createRule({
name: "eol-last",
meta: {
type: "layout",
docs: { description: "Require or disallow newline at the end of files" },
fixable: "whitespace",
schema: [{
type: "string",
enum: [
"always",
"never",
"unix",
"windows"
]
}],
defaultOptions: ["always"],
messages: {
missing: "Newline required at end of file but not found.",
unexpected: "Newline not allowed at end of file."
}
},
create(context, [mode]) {
const sourceCode = context.sourceCode;
if (!isTextSourceCode(sourceCode) || !hasLinesAndGetLocFromIndex(sourceCode)) return {};
const src = sourceCode.text;
const LF = "\n";
const CRLF = `\r${LF}`;
const endsWithNewline = src.endsWith(LF);
if (!src.length) return {};
let appendCRLF = false;
if (mode === "unix") {
warnDeprecation("option(\"unix\")", "\"always\" and \"@stylistic/eslint-plugin/rules/linebreak-style\"", "eol-last");
mode = "always";
}
if (mode === "windows") {
warnDeprecation("option(\"windows\")", "\"always\" and \"@stylistic/eslint-plugin/rules/linebreak-style\"", "eol-last");
mode = "always";
appendCRLF = true;
}
if (mode === "always" && !endsWithNewline) context.report({
loc: sourceCode.getLocFromIndex(src.length),
messageId: "missing",
fix(fixer) {
return fixer.insertTextAfterRange([0, src.length], appendCRLF ? CRLF : LF);
}
});
else if (mode === "never" && endsWithNewline) {
const startLoc = sourceCode.getLocFromIndex(src.length - (src.endsWith(CRLF) ? 2 : 1));
const endLoc = sourceCode.getLocFromIndex(src.length);
context.report({
loc: {
start: startLoc,
end: endLoc
},
messageId: "unexpected",
fix(fixer) {
const start = /(?:\r?\n)+$/u.exec(src).index;
const end = src.length;
return fixer.replaceTextRange([start, end], "");
}
});
}
return {};
}
});
export { eol_last_default as t };