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,28 @@
/**
* @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 Cog = createLucideIcon("Cog", [
["path", { d: "M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", key: "sobvz5" }],
["path", { d: "M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z", key: "11i496" }],
["path", { d: "M12 2v2", key: "tus03m" }],
["path", { d: "M12 22v-2", key: "1osdcq" }],
["path", { d: "m17 20.66-1-1.73", key: "eq3orb" }],
["path", { d: "M11 10.27 7 3.34", key: "16pf9h" }],
["path", { d: "m20.66 17-1.73-1", key: "sg0v6f" }],
["path", { d: "m3.34 7 1.73 1", key: "1ulond" }],
["path", { d: "M14 12h8", key: "4f43i9" }],
["path", { d: "M2 12h2", key: "1t8f8n" }],
["path", { d: "m20.66 7-1.73 1", key: "1ow05n" }],
["path", { d: "m3.34 17 1.73-1", key: "nuk764" }],
["path", { d: "m17 3.34-1 1.73", key: "2wel8s" }],
["path", { d: "m11 13.73-4 6.93", key: "794ttg" }]
]);
export { Cog as default };
//# sourceMappingURL=cog.js.map
@@ -0,0 +1,25 @@
import Dispatcher from './dispatcher'
import buildConnector from './connector'
import { IncomingHttpHeaders } from './header'
import Pool from './pool'
export default Socks5ProxyAgent
declare class Socks5ProxyAgent extends Dispatcher {
constructor (proxyUrl: string | URL, options?: Socks5ProxyAgent.Options)
}
declare namespace Socks5ProxyAgent {
export interface Options extends Pool.Options {
/** Additional headers to send with the proxy connection */
headers?: IncomingHttpHeaders;
/** SOCKS5 proxy username for authentication */
username?: string;
/** SOCKS5 proxy password for authentication */
password?: string;
/** Custom connector function for proxy connection */
connect?: buildConnector.connector;
/** TLS options for the proxy connection (for SOCKS5 over TLS) */
proxyTls?: buildConnector.BuildOptions;
}
}
@@ -0,0 +1,158 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
/**
* This transform strips all Flow types.
*
* It is expected that all transforms create valid ESTree AST output. If
* the transform requires outputting Babel specific AST nodes then it
* should live in `ConvertESTreeToBabel.js`
*/
'use strict';
import type {ParserOptions} from '../ParserOptions';
import type {Program, ESNode} from 'hermes-estree';
import {SimpleTransform} from '../transform/SimpleTransform';
const nodeWith = SimpleTransform.nodeWith;
export function transformProgram(
program: Program,
_options: ParserOptions,
): Program {
return SimpleTransform.transformProgram(program, {
transform(node: ESNode) {
switch (node.type) {
case 'AsExpression':
case 'AsConstExpression':
case 'TypeCastExpression': {
return node.expression;
}
case 'CallExpression':
case 'NewExpression': {
if (node.typeArguments != null) {
return nodeWith(node, {typeArguments: null});
}
return node;
}
case 'ObjectPattern':
case 'ArrayPattern':
case 'Identifier': {
if (node.typeAnnotation != null) {
return nodeWith(node, {typeAnnotation: null});
}
return node;
}
case 'DeclareClass':
case 'DeclareFunction':
case 'DeclareInterface':
case 'DeclareModule':
case 'DeclareModuleExports':
case 'DeclareNamespace':
case 'DeclareOpaqueType':
case 'DeclareTypeAlias':
case 'DeclareVariable':
case 'InterfaceDeclaration':
case 'OpaqueType':
case 'TypeAlias': {
return null;
}
case 'FunctionDeclaration':
case 'ArrowFunctionExpression':
case 'FunctionExpression': {
const newParams = [];
for (let i = 0; i < node.params.length; i++) {
if (
i === 0 &&
node.params[0].type === 'Identifier' &&
node.params[0].name === 'this'
) {
continue;
}
let param = node.params[i];
if (param.type === 'AssignmentPattern') {
param = param.left;
}
if (param.optional === true) {
param = nodeWith(param, {optional: false});
}
newParams.push(param);
}
return nodeWith(node, {
params: newParams,
returnType: null,
typeParameters: null,
predicate: null,
});
}
case 'ClassDeclaration':
case 'ClassExpression': {
return nodeWith(node, {
typeParameters: null,
superTypeParameters: null,
implements: [],
decorators: [],
});
}
case 'PropertyDefinition': {
return nodeWith(node, {
typeAnnotation: null,
variance: null,
declare: false,
optional: false,
});
}
case 'ImportDeclaration': {
if (node.importKind === 'type' || node.importKind === 'typeof') {
return null;
}
const nonTypeSpecifiers = node.specifiers.filter(
s =>
s.type !== 'ImportSpecifier' ||
(s.importKind !== 'type' && s.importKind !== 'typeof'),
);
if (nonTypeSpecifiers.length === 0) {
return null;
}
if (nonTypeSpecifiers.length === node.specifiers.length) {
return node;
}
return nodeWith(node, {
specifiers: nonTypeSpecifiers,
});
}
case 'ExportAllDeclaration':
case 'ExportNamedDeclaration': {
if (node.exportKind === 'type') {
return null;
}
return node;
}
default: {
return node;
}
}
},
});
}
@@ -0,0 +1,12 @@
/*
@license
Rollup.js v4.60.4
Thu, 14 May 2026 17:52:21 GMT - commit d311a84b0bb4d4a6f50d19ffd2c29cca28660c88
https://github.com/rollup/rollup
Released under the MIT License.
*/
import '../native.js';
export { parseAst, parseAstAsync } from './shared/parseAst.js';
import 'node:path';
@@ -0,0 +1 @@
{"version":3,"file":"drama.js","sources":["../../../src/icons/drama.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Drama\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMTFoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xNCA2aC4wMSIgLz4KICA8cGF0aCBkPSJNMTggNmguMDEiIC8+CiAgPHBhdGggZD0iTTYuNSAxMy4xaC4wMSIgLz4KICA8cGF0aCBkPSJNMjIgNWMwIDktNCAxMi02IDEycy02LTMtNi0xMmMwLTIgMi0zIDYtM3M2IDEgNiAzIiAvPgogIDxwYXRoIGQ9Ik0xNy40IDkuOWMtLjguOC0yIC44LTIuOCAwIiAvPgogIDxwYXRoIGQ9Ik0xMC4xIDcuMUM5IDcuMiA3LjcgNy43IDYgOC42Yy0zLjUgMi00LjcgMy45LTMuNyA1LjYgNC41IDcuOCA5LjUgOC40IDExLjIgNy40LjktLjUgMS45LTIuMSAxLjktNC43IiAvPgogIDxwYXRoIGQ9Ik05LjEgMTYuNWMuMy0xLjEgMS40LTEuNyAyLjQtMS40IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/drama\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 Drama = createLucideIcon('Drama', [\n ['path', { d: 'M10 11h.01', key: 'd2at3l' }],\n ['path', { d: 'M14 6h.01', key: 'k028ub' }],\n ['path', { d: 'M18 6h.01', key: '1v4wsw' }],\n ['path', { d: 'M6.5 13.1h.01', key: '1748ia' }],\n ['path', { d: 'M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3', key: '172yzv' }],\n ['path', { d: 'M17.4 9.9c-.8.8-2 .8-2.8 0', key: '1obv0w' }],\n [\n 'path',\n {\n d: 'M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7',\n key: 'rqjl8i',\n },\n ],\n ['path', { d: 'M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4', key: '1mr6wy' }],\n]);\n\nexport default Drama;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3D,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/numbers/index.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,QAAQ;AAC1C,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,CAAC;;AAGxB,MAAM,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;AAGrC,MAAM,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,OAAO,EAAE,CAAC;;;;;"}
@@ -0,0 +1,731 @@
flf2a$ 7 7 14 0 16 0 8031 0
Author : MJP
Date : 2003/9/23 6:27:51
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
!#
#
#
#
#
#
##
"#
#
#
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
'#
#
#
#
#
#
##
(#
#
#
#
#
#
##
)#
#
#
#
#
#
##
*#
#
#
#
#
#
##
+#
#
#
#
#
#
##
,#
#
#
#
#
#
##
-#
#
#
#
#
#
##
.#
#
#
#
#
#
##
/#
#
#
#
#
#
##
0#
#
#
#
#
#
##
1#
#
#
#
#
#
##
2#
#
#
#
#
#
##
3#
#
#
#
#
#
##
4#
#
#
#
#
#
##
5#
#
#
#
#
#
##
6#
#
#
#
#
#
##
7#
#
#
#
#
#
##
8#
#
#
#
#
#
##
9#
#
#
#
#
#
##
:#
#
#
#
#
#
##
;#
#
#
#
#
#
##
<#
#
#
#
#
#
##
=#
#
#
#
#
#
##
>#
#
#
#
#
#
##
?#
#
#
#
#
#
##
@#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
_ #
/||_ #
/`_) #
| `. #
| (_)) #
(.'-' #
) ##
c c #
(OO) #
,'.--.) #
/ //_|_\ #
| \___ #
'. ) #
`-.' ##
_ #
_||\ #
(_'\ #
.' | #
((_) | #
`-`.) #
( ##
#
wWw #
(O)_ #
.' __) #
( _) #
`.__) #
##
#
wWw #
(O)_ #
.' __) #
( _) #
)/ #
( ##
\/ #
(OO) #
,'.--.) #
/ /|_|_\ #
| \_.--. #
'. \) \ #
`-.(_.' ##
\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\ #
-' `- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\_) #
##
_ #
_||\ #
(_'\ #
( | #
(\_) | #
`-`.) #
( ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\ \ #
(/\)\ `. #
`._) ##
W W #
(O)(O) #
|| #
| \ #
| `. #
(.-.__) #
`-' ##
\\\ /// #
((O) (O)) #
| \ / | #
||\\//|| #
|| \/ || #
|| || #
(_/ \_) ##
\\\ /// #
((O)(O)) #
| \ || #
||\\|| #
|| \ | #
|| || #
(_/ \_) ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\) #
( ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \___.--.| #
'. `---\) \ #
`-...(_.' ##
)) #
(Oo)-. #
| (_)) #
| .' #
)|\\ #
(/ \) #
) ##
oo_ #
/ _)-< #
\__ `. #
`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \ / / #
/ \/ \ #
\ `--' / #
`-..-' ##
(O)) ((O) #
|| || #
|| /\ || #
||//\\|| #
/ / \ \ #
( / \ ) #
) ( ##
wW Ww #
(O)\ /(O) #
`. \/ .' #
\ / #
/ \ #
.' /\ `. #
(_.' `._) ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \/ / #
\o / #
_/ / #
(_.' ##
_oo #
>-(_ \ #
/ _/ #
/ / #
/ ( #
( `-. #
`--.._) ##
[#
#
#
#
#
#
##
\#
#
#
#
#
#
##
]#
#
#
#
#
#
##
^#
#
#
#
#
#
##
_#
#
#
#
#
#
##
`#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
_ #
/||_ #
/`_) #
| `. #
| (_)) #
(.'-' #
) ##
c c #
(OO) #
,'.--.) #
/ //_|_\ #
| \___ #
'. ) #
`-.' ##
_ #
_||\ #
(_'\ #
.' | #
((_) | #
`-`.) #
( ##
#
wWw #
(O)_ #
.' __) #
( _) #
`.__) #
##
#
wWw #
(O)_ #
.' __) #
( _) #
)/ #
( ##
\/ #
(OO) #
,'.--.) #
/ /|_|_\ #
| \_.--. #
'. \) \ #
`-.(_.' ##
\\ // #
(o)(o) #
|| || #
|(__)| #
/.--.\ #
-' `- #
##
wW Ww #
(O)(O) #
(..) #
|| #
_||_ #
(_/\_) #
##
_ #
_||\ #
(_'\ #
( | #
(\_) | #
`-`.) #
( ##
_ #
(OO) .' ) #
||_/ .' #
| / #
||\ \ #
(/\)\ `. #
`._) ##
W W #
(O)(O) #
|| #
| \ #
| `. #
(.-.__) #
`-' ##
\\\ /// #
((O) (O)) #
| \ / | #
||\\//|| #
|| \/ || #
|| || #
(_/ \_) ##
\\\ /// #
((O)(O)) #
| \ || #
||\\|| #
|| \ | #
|| || #
(_/ \_) ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
)) #
(o0)-. #
| (_)) #
| .-' #
|( #
\) #
( ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \___.--.| #
'. `---\) \ #
`-...(_.' ##
)) #
(Oo)-. #
| (_)) #
| .' #
)|\\ #
(/ \) #
) ##
oo_ #
/ _)-< #
\__ `. #
`. | #
_| | #
,-' | #
(_..--' ##
(o)__(o) #
(__ __) #
( ) #
)( #
( ) #
)/ #
( ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \ / / #
/ \/ \ #
\ `--' / #
`-..-' ##
(O)) ((O) #
|| || #
|| /\ || #
||//\\|| #
/ / \ \ #
( / \ ) #
) ( ##
wW Ww #
(O)\ /(O) #
`. \/ .' #
\ / #
/ \ #
.' /\ `. #
(_.' `._) ##
wWw wWw #
(O) (O) #
( \ / ) #
\ \/ / #
\o / #
_/ / #
(_.' ##
_oo #
>-(_ \ #
/ _/ #
/ / #
/ ( #
( `-. #
`--.._) ##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
#
/) #
(o)(O) #
//\\ #
|(__)| #
/,-. | #
-' '' ##
.-. #
c(O_O)c #
,'.---.`, #
/ /|_|_|\ \ #
| \_____/ | #
'. `---' .` #
`-...-' ##
wWw wWw #
(O) (O) #
/ ) ( \ #
/ / \ \ #
| \____/ | #
'. `--' .` #
`-..-' ##
ß#
#
#
#
#
#
##
@@ -0,0 +1,728 @@
export default `flf2a$ 7 5 12 -1 12
Tinker-toy by Wendell Hicken 11/93 (whicken@parasoft.com)
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
7 - height of a character
5 - height of a character, not including descenders
5 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
12 - number of comment lines
$@
$@
$@
$@
$@
$@
$@@
o @
| @
o @
@
O @
@
@@
o o @
| | @
@
@
@
@
@@
| | @
-O-O- @
| | @
-O-O- @
| | @
@
@@
| | @
-O-O- @
o | | @
-O-O- @
| | o @
-O-O- @
| | @@
o O @
/ @
/ @
/ @
O o @
@
@@
@
o @
/| @
o-O-@
| @
@
@@
o @
| @
@
@
@
@
@@
/ @
o @
| @
o @
\\ @
@
@@
\\ @
o @
| @
o @
/ @
@
@@
@
o | o @
\\|/ @
--O-- @
/|\\ @
o | o @
@@
@
| @
-o- @
| @
@
@
@@
@
@
@
@
o @
| @
@@
@
@
o-o @
@
@
@
@@
@
@
@
@
O @
@
@@
o@
/ @
o @
/ @
o @
@
@@
o-o @
o /o @
| / | @
o/ o @
o-o @
@
@@
0 @
/| @
o | @
| @
o-o-o @
@
@@
-- @
o o @
/ @
/ @
o--o @
@
@@
o-o @
| @
oo @
| @
o-o @
@
@@
o o @
| | @
o--O @
| @
o @
@
@@
o--o @
| @
o-o @
| @
o-o @
@
@@
o @
/ @
O--o @
o | @
o-o @
@
@@
o---o @
/ @
o @
| @
o @
@
@@
o-o @
| | @
o-o @
| | @
o-o @
@
@@
o-o @
| o @
o--O @
/ @
o @
@
@@
@
O @
@
O @
@
@
@@
@
o @
@
o @
| @
@
@@
o @
/ @
O @
\\ @
o @
@
@@
@
@
o--o @
o--o @
@
@
@@
o @
\\ @
O @
/ @
o @
@
@@
o-o @
o o @
/ @
o @
@
O @
@@
o @
/ \\ @
o O-o @
\\ @
o- @
@
@@
O @
/ \\ @
o---o@
| |@
o o@
@
@@
o--o @
| | @
O--o @
| | @
o--o @
@
@@
o-o @
/ @
O @
\\ @
o-o @
@
@@
o-o @
| \\ @
| O @
| / @
o-o @
@
@@
o--o @
| @
O-o @
| @
o--o @
@
@@
o--o @
| @
O-o @
| @
o @
@
@@
o-o @
o @
| -o @
o | @
o-o @
@
@@
o o @
| | @
O--O @
| | @
o o @
@
@@
o-O-o @
| @
| @
| @
o-O-o @
@
@@
o @
| @
| @
\\ o @
o-o @
@
@@
o o @
| / @
OO @
| \\ @
o o @
@
@@
o @
| @
| @
| @
O---o@
@
@@
o o @
|\\ /| @
| O | @
| | @
o o @
@
@@
o o @
|\\ | @
| \\ | @
| \\| @
o o @
@
@@
o-o @
o o @
| | @
o o @
o-o @
@
@@
o--o @
| | @
O--o @
| @
o @
@
@@
o-o @
o o @
| | @
o O @
o-O\\ @
@
@@
o--o @
| | @
O-Oo @
| \\ @
o o @
@
@@
o-o @
| @
o-o @
| @
o--o @
@
@@
o-O-o @
| @
| @
| @
o @
@
@@
o o @
| | @
| | @
| | @
o-o @
@
@@
o o @
| | @
o o @
\\ / @
o @
@
@@
o o @
| | @
o o o @
\\ / \\ / @
o o @
@
@@
o o @
\\ / @
O @
/ \\ @
o o @
@
@@
o o @
\\ / @
O @
| @
o @
@
@@
o---o @
/ @
-O- @
/ @
o---o @
@
@@
O-o @
| @
| @
| @
O-o @
@
@@
o @
\\ @
o @
\\ @
o@
@
@@
o-O @
| @
| @
| @
o-O @
@
@@
o @
/ \\ @
@
@
@
@
@@
@
@
@
@
@
o---o@
@@
0 @
| @
@
@
@
@
@@
@
@
oo @
| | @
o-o-@
@
@@
o @
| @
O-o @
| | @
o-o @
@
@@
@
@
o-o @
| @
o-o @
@
@@
o @
| @
o-O @
| | @
o-o @
@
@@
@
@
o-o @
|-' @
o-o @
@
@@
o-o@
| @
-O- @
| @
o @
@
@@
@
@
o--o @
| | @
o--O @
| @
o--o @@
o @
| @
O--o @
| | @
o o @
@
@@
@
o @
@
| @
| @
@
@@
@
o @
@
o @
| @
o o @
o-o @@
o @
| / @
OO @
| \\ @
o o @
@
@@
o @
| @
| @
| @
o @
@
@@
@
@
o-O-o @
| | | @
o o o @
@
@@
@
@
o-o @
| | @
o o @
@
@@
@
@
o-o @
| | @
o-o @
@
@@
@
@
o-o @
| | @
O-o @
| @
o @@
@
@
o-o @
| | @
o-O @
| @
o @@
@
@
o-o @
| @
o @
@
@@
@
@
o-o @
\\ @
o-o @
@
@@
o @
| @
-o- @
| @
o @
@
@@
@
@
o o @
| | @
o--o @
@
@@
@
@
o o @
\\ / @
o @
@
@@
@
@
o o o@
\\ / \\ / @
o o @
@
@@
@
@
\\ / @
o @
/ \\ @
@
@@
@
@
o o @
| | @
o--O @
| @
o--o @@
@
@
o-o @
/ @
o-o @
@
@@
o-o @
| @
o-O @
| @
o-o @
@
@@
o @
| @
o @
| @
o @
@
@@
o-o @
| @
O-o @
| @
o-o @
@
@@
@
o_ / @
/ o @
@
@
@
@@
o O o@
/ \\ @
o---o@
| |@
o o@
@
@@
o o-o o@
o o @
| | @
o o @
o-o @
@
@@
o o o o @
| | @
o o @
\\ / @
o-o @
@
@@
o o @
@
oo @
| | @
o-o-@
@
@@
o o @
@
o-o @
| | @
o-o @
@
@@
o o @
@
o o @
| | @
o--o @
@
@@
o--o @
| | @
O--o @
| | @
o--o @
| @
o @@
`
@@ -0,0 +1,413 @@
export default `flf2a$ 4 1 6 -1 3 0 8192 0
Font Name: tmplr
Font Author: Eugene Ghanizadeh Khoub
FIGFont created with: http://patorjk.com/figfont-editor
@
@
@
@@
╻@
┃@
•@
@@
╹╹@
@
@
@@
╋╋@
┃┃@
╋╋@
@@
┏┻┓@
┗━┓@
┗┳┛@
@@
•┏ @
┃ @
┛•@
@@
┏┓@
┣╋@
┗┻@
@@
╹@
@
@
@@
┏@
┃@
┗@
@@
┓@
┃@
┛@
@@
┓┏@
┛┗@
@
@@
╻ @
━╋━@
╹ @
@@
@
@
╻@
@@
@
━━@
@
@@
@
@
•@
@@
┏@
┃@
┛@
@@
┏┓@
┃┫@
┗┛@
@@
┓@
┃@
┻@
@@
┏┓@
┏┛@
┗━@
@@
┏┓@
┫@
┗┛@
@@
┏┓@
┃┃@
┗╋@
@@
┏━@
┗┓@
┗┛@
@@
┏┓@
┣┓@
┗┛@
@@
━┓@
┃@
╹@
@@
┏┓@
┣┫@
┗┛@
@@
┏┓@
┗┫@
┗┛@
@@
@
•@
•@
@@
@
•@
╻@
@@
┏@
━┫@
┗@
@@
━━@
━━@
━━@
@@
┓ @
┣━@
┛ @
@@
┏┓@
┏┛@
• @
@@
┏━┓@
┃┗┛@
┗━┛@
@@
┏┓@
┣┫@
┛┗@
@@
┳┓@
┣┫@
┻┛@
@@
┏┓@
┃ @
┗┛@
@@
┳┓@
┃┃@
┻┛@
@@
┏┓@
┣ @
┗┛@
@@
┏┓@
┣ @
┻ @
@@
┏┓@
┃┓@
┗┛@
@@
┓┏@
┣┫@
┛┗@
@@
┳@
┃@
┻@
@@
┏┳@
┃@
┗┛@
@@
┓┏┓@
┃┫ @
┛┗┛@
@@
┓ @
┃ @
┗┛@
@@
┳┳┓@
┃┃┃@
┛ ┗@
@@
┳┓@
┃┃@
┛┗@
@@
┏┓@
┃┃@
┗┛@
@@
┏┓@
┃┃@
┣┛@
@@
┏┓@
┃┃@
┗┻@
@@
┳┓@
┣┫@
┛┗@
@@
┏┓@
┗┓@
┗┛@
@@
┏┳┓@
┃ @
┻ @
@@
┳┳@
┃┃@
┗┛@
@@
┓┏@
┃┃@
┗┛@
@@
┓ ┏@
┃┃┃@
┗┻┛@
@@
┏┓┏┓@
┃┃ @
┗┛┗┛@
@@
┓┏@
┗┫@
┗┛@
@@
┏┓@
┏┛@
┗┛@
@@
┏━@
┃ @
┗━@
@@
╻ @
┗┓@
╹@
@@
━┓@
┃@
━┛@
@@
┏┓@
@
@
@@
@
@
━@
@@
┓@
@
@
@@
@
┏┓@
┗┻@
@@
┓ @
┣┓@
┗┛@
@@
@
┏@
┗@
@@
┓@
┏┫@
┗┻@
@@
@
┏┓@
┗ @
@@
┏@
╋@
┛@
@@
@
┏┓@
┗┫@
┛@@
┓ @
┣┓@
┛┗@
@@
•@
┓@
┗@
@@
•@
┓@
┃@
┛@@
┓ @
┃┏@
┛┗@
@@
┓@
┃@
┗@
@@
@
┏┳┓@
┛┗┗@
@@
@
┏┓@
┛┗@
@@
@
┏┓@
┗┛@
@@
@
┏┓@
┣┛@
┛ @@
@
┏┓@
┗┫@
┗@@
@
┏┓@
┛ @
@@
@
┏@
┛@
@@
@
╋@
┗@
@@
@
┓┏@
┗┻@
@@
@
┓┏@
┗┛@
@@
@
┓┏┏@
┗┻┛@
@@
@
┓┏@
┛┗@
@@
@
┓┏@
┗┫@
┛@@
@
┓@
┗@
@@
┏@
┫@
┗@
@@
╻@
┃@
╹@
@@
┓@
┣@
┛@
@@
@
┏━┛@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
••@
┏┓@
┗┻@
@@
••@
┏┓@
┗┛@
@@
••@
┓┏@
┗┻@
@@
┏┓@
┣┫@
┻┛@
@@
`
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PoundSterling = createLucideIcon("PoundSterling", [
["path", { d: "M18 7c0-5.333-8-5.333-8 0", key: "1prm2n" }],
["path", { d: "M10 7v14", key: "18tmcs" }],
["path", { d: "M6 21h12", key: "4dkmi1" }],
["path", { d: "M6 13h10", key: "ybwr4a" }]
]);
export { PoundSterling as default };
//# sourceMappingURL=pound-sterling.js.map
@@ -0,0 +1,14 @@
import Range = require("../classes/range");
import SemVer = require("../classes/semver");
import semver = require("../index");
/**
* Return true if version is less than all the versions possible in the range.
*/
declare function ltr(
version: string | SemVer,
range: string | Range,
optionsOrLoose?: boolean | semver.RangeOptions,
): boolean;
export = ltr;
@@ -0,0 +1,521 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const isTypeImport_1 = require("../util/isTypeImport");
const allowedFunctionVariableDefTypes = new Set([
utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
utils_1.AST_NODE_TYPES.TSFunctionType,
utils_1.AST_NODE_TYPES.TSMethodSignature,
utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
utils_1.AST_NODE_TYPES.TSDeclareFunction,
utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
utils_1.AST_NODE_TYPES.TSConstructorType,
]);
const functionsHoistedNodes = new Set([utils_1.AST_NODE_TYPES.FunctionDeclaration]);
const typesHoistedNodes = new Set([
utils_1.AST_NODE_TYPES.TSInterfaceDeclaration,
utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration,
]);
exports.default = (0, util_1.createRule)({
name: 'no-shadow',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow variable declarations from shadowing variables declared in the outer scope',
extendsBaseRule: true,
},
messages: {
noShadow: "'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.",
noShadowGlobal: "'{{name}}' is already a global variable.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allow: {
type: 'array',
description: 'Identifier names for which shadowing is allowed.',
items: {
type: 'string',
},
},
builtinGlobals: {
type: 'boolean',
description: 'Whether to report shadowing of built-in global variables.',
},
hoist: {
type: 'string',
description: 'Whether to report shadowing before outer functions or variables are defined.',
enum: ['all', 'functions', 'functions-and-types', 'never', 'types'],
},
ignoreFunctionTypeParameterNameValueShadow: {
type: 'boolean',
description: 'Whether to ignore function parameters named the same as a variable.',
},
ignoreOnInitialization: {
type: 'boolean',
description: 'Whether to ignore the variable initializers when the shadowed variable is presumably still unitialized.',
},
ignoreTypeValueShadow: {
type: 'boolean',
description: 'Whether to ignore types named the same as a variable.',
},
},
},
],
},
defaultOptions: [
{
allow: [],
builtinGlobals: false,
hoist: 'functions-and-types',
ignoreFunctionTypeParameterNameValueShadow: true,
ignoreOnInitialization: false,
ignoreTypeValueShadow: true,
},
],
create(context, [options]) {
/**
* Check if a scope is a TypeScript module augmenting the global namespace.
*/
function isGlobalAugmentation(scope) {
return ((scope.type === scope_manager_1.ScopeType.tsModule && scope.block.kind === 'global') ||
(!!scope.upper && isGlobalAugmentation(scope.upper)));
}
/**
* Check if variable is a `this` parameter.
*/
function isThisParam(variable) {
return (variable.defs[0].type === scope_manager_1.DefinitionType.Parameter &&
variable.name === 'this');
}
function isTypeValueShadow(variable, shadowed) {
if (options.ignoreTypeValueShadow !== true) {
return false;
}
if (!('isValueVariable' in variable)) {
// this shouldn't happen...
return false;
}
const firstDefinition = shadowed.defs.at(0);
const isShadowedValue = !('isValueVariable' in shadowed) ||
!firstDefinition ||
(!(0, isTypeImport_1.isTypeImport)(firstDefinition) && shadowed.isValueVariable);
return variable.isValueVariable !== isShadowedValue;
}
function isFunctionTypeParameterNameValueShadow(variable, shadowed) {
if (options.ignoreFunctionTypeParameterNameValueShadow !== true) {
return false;
}
if (!('isValueVariable' in variable)) {
// this shouldn't happen...
return false;
}
const isShadowedValue = 'isValueVariable' in shadowed ? shadowed.isValueVariable : true;
if (!isShadowedValue) {
return false;
}
return variable.defs.every(def => allowedFunctionVariableDefTypes.has(def.node.type));
}
function isGenericOfStaticMethod(variable) {
if (!('isTypeVariable' in variable)) {
// this shouldn't happen...
return false;
}
if (!variable.isTypeVariable) {
return false;
}
if (variable.identifiers.length === 0) {
return false;
}
const typeParameter = variable.identifiers[0].parent;
if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) {
return false;
}
const typeParameterDecl = typeParameter.parent;
if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) {
return false;
}
const functionExpr = typeParameterDecl.parent;
if (functionExpr.type !== utils_1.AST_NODE_TYPES.FunctionExpression &&
functionExpr.type !== utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) {
return false;
}
const methodDefinition = functionExpr.parent;
if (methodDefinition.type !== utils_1.AST_NODE_TYPES.MethodDefinition) {
return false;
}
return methodDefinition.static;
}
function isGenericOfClass(variable) {
if (!('isTypeVariable' in variable)) {
// this shouldn't happen...
return false;
}
if (!variable.isTypeVariable) {
return false;
}
if (variable.identifiers.length === 0) {
return false;
}
const typeParameter = variable.identifiers[0].parent;
if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) {
return false;
}
const typeParameterDecl = typeParameter.parent;
if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) {
return false;
}
const classDecl = typeParameterDecl.parent;
return (classDecl.type === utils_1.AST_NODE_TYPES.ClassDeclaration ||
classDecl.type === utils_1.AST_NODE_TYPES.ClassExpression);
}
function isGenericOfAStaticMethodShadow(variable, shadowed) {
return isGenericOfStaticMethod(variable) && isGenericOfClass(shadowed);
}
function isImportDeclaration(definition) {
return definition.type === utils_1.AST_NODE_TYPES.ImportDeclaration;
}
function isExternalModuleDeclarationWithName(scope, name) {
return (scope.type === scope_manager_1.ScopeType.tsModule &&
scope.block.id.type === utils_1.AST_NODE_TYPES.Literal &&
scope.block.id.value === name);
}
function isExternalDeclarationMerging(scope, variable, shadowed) {
const [firstDefinition] = shadowed.defs;
const [secondDefinition] = variable.defs;
return ((0, isTypeImport_1.isTypeImport)(firstDefinition) &&
isImportDeclaration(firstDefinition.parent) &&
isExternalModuleDeclarationWithName(scope, firstDefinition.parent.source.value) &&
(secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration ||
secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration));
}
/**
* Check if variable name is allowed.
* @param variable The variable to check.
* @returns Whether or not the variable name is allowed.
*/
function isAllowed(variable) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return options.allow.includes(variable.name);
}
/**
* Checks if a variable of the class name in the class scope of ClassDeclaration.
*
* ClassDeclaration creates two variables of its name into its outer scope and its class scope.
* So we should ignore the variable in the class scope.
* @param variable The variable to check.
* @returns Whether or not the variable of the class name in the class scope of ClassDeclaration.
*/
function isDuplicatedClassNameVariable(variable) {
const block = variable.scope.block;
return (block.type === utils_1.AST_NODE_TYPES.ClassDeclaration &&
block.id === variable.identifiers[0]);
}
/**
* Checks if a variable of the class name in the class scope of TSEnumDeclaration.
*
* TSEnumDeclaration creates two variables of its name into its outer scope and its class scope.
* So we should ignore the variable in the class scope.
* @param variable The variable to check.
* @returns Whether or not the variable of the class name in the class scope of TSEnumDeclaration.
*/
function isDuplicatedEnumNameVariable(variable) {
const block = variable.scope.block;
return (block.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration &&
block.id === variable.identifiers[0]);
}
/**
* Checks whether or not a given location is inside of the range of a given node.
* @param node An node to check.
* @param location A location to check.
* @returns `true` if the location is inside of the range of the node.
*/
function isInRange(node, location) {
return node && node.range[0] <= location && location <= node.range[1];
}
/**
* Searches from the current node through its ancestry to find a matching node.
* @param node a node to get.
* @param match a callback that checks whether or not the node verifies its condition or not.
* @returns the matching node.
*/
function findSelfOrAncestor(node, match) {
let currentNode = node;
while (currentNode && !match(currentNode)) {
currentNode = currentNode.parent;
}
return currentNode;
}
/**
* Finds function's outer scope.
* @param scope Function's own scope.
* @returns Function's outer scope.
*/
function getOuterScope(scope) {
const upper = scope.upper;
if (upper?.type === scope_manager_1.ScopeType.functionExpressionName) {
return upper.upper;
}
return upper;
}
/**
* Checks if a variable and a shadowedVariable have the same init pattern ancestor.
* @param variable a variable to check.
* @param shadowedVariable a shadowedVariable to check.
* @returns Whether or not the variable and the shadowedVariable have the same init pattern ancestor.
*/
function isInitPatternNode(variable, shadowedVariable) {
const outerDef = shadowedVariable.defs.at(0);
if (!outerDef) {
return false;
}
const { variableScope } = variable.scope;
if (!((variableScope.block.type ===
utils_1.AST_NODE_TYPES.ArrowFunctionExpression ||
variableScope.block.type === utils_1.AST_NODE_TYPES.FunctionExpression) &&
getOuterScope(variableScope) === shadowedVariable.scope)) {
return false;
}
const fun = variableScope.block;
const { parent } = fun;
const callExpression = findSelfOrAncestor(parent, node => node.type === utils_1.AST_NODE_TYPES.CallExpression);
if (!callExpression) {
return false;
}
let node = outerDef.name;
const location = callExpression.range[1];
while (node) {
if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) {
if (isInRange(node.init, location)) {
return true;
}
if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement ||
node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) &&
isInRange(node.parent.parent.right, location)) {
return true;
}
break;
}
else if (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern) {
if (isInRange(node.right, location)) {
return true;
}
}
else if ([
utils_1.AST_NODE_TYPES.ArrowFunctionExpression,
utils_1.AST_NODE_TYPES.CatchClause,
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.ClassExpression,
utils_1.AST_NODE_TYPES.ExportNamedDeclaration,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
utils_1.AST_NODE_TYPES.FunctionExpression,
utils_1.AST_NODE_TYPES.ImportDeclaration,
].includes(node.type)) {
break;
}
node = node.parent;
}
return false;
}
/**
* Checks if a variable is inside the initializer of scopeVar.
*
* To avoid reporting at declarations such as `var a = function a() {};`.
* But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`.
* @param variable The variable to check.
* @param scopeVar The scope variable to look for.
* @returns Whether or not the variable is inside initializer of scopeVar.
*/
function isOnInitializer(variable, scopeVar) {
const outerScope = scopeVar.scope;
const outerDef = scopeVar.defs.at(0);
const outer = outerDef?.parent?.range;
const innerScope = variable.scope;
const innerDef = variable.defs.at(0);
const inner = innerDef?.name.range;
return !!(outer &&
inner &&
outer[0] < inner[0] &&
inner[1] < outer[1] &&
((innerDef.type === scope_manager_1.DefinitionType.FunctionName &&
innerDef.node.type === utils_1.AST_NODE_TYPES.FunctionExpression) ||
innerDef.node.type === utils_1.AST_NODE_TYPES.ClassExpression) &&
outerScope === innerScope.upper);
}
/**
* Get a range of a variable's identifier node.
* @param variable The variable to get.
* @returns The range of the variable's identifier node.
*/
function getNameRange(variable) {
const def = variable.defs.at(0);
return def?.name.range;
}
/**
* Checks if a variable is in TDZ of scopeVar.
* @param variable The variable to check.
* @param scopeVar The variable of TDZ.
* @returns Whether or not the variable is in TDZ of scopeVar.
*/
function isInTdz(variable, scopeVar) {
const outerDef = scopeVar.defs.at(0);
const inner = getNameRange(variable);
const outer = getNameRange(scopeVar);
if (!inner || !outer || inner[1] >= outer[0]) {
return false;
}
if (!outerDef) {
return true;
}
if (options.hoist === 'functions') {
return !functionsHoistedNodes.has(outerDef.node.type);
}
if (options.hoist === 'types') {
return !typesHoistedNodes.has(outerDef.node.type);
}
if (options.hoist === 'functions-and-types') {
return (!functionsHoistedNodes.has(outerDef.node.type) &&
!typesHoistedNodes.has(outerDef.node.type));
}
return true;
}
/**
* Get declared line and column of a variable.
* @param variable The variable to get.
* @returns The declared line and column of the variable.
*/
function getDeclaredLocation(variable) {
const identifier = variable.identifiers.at(0);
if (identifier) {
return {
column: identifier.loc.start.column + 1,
global: false,
line: identifier.loc.start.line,
};
}
return {
global: true,
};
}
/**
* Checks if the initialization of a variable has the declare modifier in a
* definition file.
*/
function isDeclareInDTSFile(variable) {
const fileName = context.filename;
if (!(0, util_1.isDefinitionFile)(fileName)) {
return false;
}
return variable.defs.some(def => {
return ((def.type === scope_manager_1.DefinitionType.Variable && def.parent.declare) ||
(def.type === scope_manager_1.DefinitionType.ClassName && def.node.declare) ||
(def.type === scope_manager_1.DefinitionType.TSEnumName && def.node.declare) ||
(def.type === scope_manager_1.DefinitionType.TSModuleName && def.node.declare));
});
}
/**
* Checks the current context for shadowed variables.
* @param scope Fixme
*/
function checkForShadows(scope) {
// ignore global augmentation
if (isGlobalAugmentation(scope)) {
return;
}
const variables = scope.variables;
for (const variable of variables) {
// ignore "arguments"
if (variable.identifiers.length === 0) {
continue;
}
// this params are pseudo-params that cannot be shadowed
if (isThisParam(variable)) {
continue;
}
// ignore variables of a class name in the class scope of ClassDeclaration
if (isDuplicatedClassNameVariable(variable)) {
continue;
}
// ignore variables of a class name in the class scope of ClassDeclaration
if (isDuplicatedEnumNameVariable(variable)) {
continue;
}
// ignore configured allowed names
if (isAllowed(variable)) {
continue;
}
// ignore variables with the declare keyword in .d.ts files
if (isDeclareInDTSFile(variable)) {
continue;
}
// Gets shadowed variable.
const shadowed = scope.upper
? utils_1.ASTUtils.findVariable(scope.upper, variable.name)
: null;
if (!shadowed) {
continue;
}
// ignore type value variable shadowing if configured
if (isTypeValueShadow(variable, shadowed)) {
continue;
}
// ignore function type parameter name shadowing if configured
if (isFunctionTypeParameterNameValueShadow(variable, shadowed)) {
continue;
}
// ignore static class method generic shadowing class generic
// this is impossible for the scope analyser to understand
// so we have to handle this manually in this rule
if (isGenericOfAStaticMethodShadow(variable, shadowed)) {
continue;
}
if (isExternalDeclarationMerging(scope, variable, shadowed)) {
continue;
}
const isESLintGlobal = 'writeable' in shadowed;
if ((shadowed.identifiers.length > 0 ||
(options.builtinGlobals && isESLintGlobal)) &&
!isOnInitializer(variable, shadowed) &&
!(options.ignoreOnInitialization &&
isInitPatternNode(variable, shadowed)) &&
!(options.hoist !== 'all' && isInTdz(variable, shadowed))) {
const location = getDeclaredLocation(shadowed);
context.report({
node: variable.identifiers[0],
...(location.global
? {
messageId: 'noShadowGlobal',
data: {
name: variable.name,
},
}
: {
messageId: 'noShadow',
data: {
name: variable.name,
shadowedColumn: location.column,
shadowedLine: location.line,
},
}),
});
}
}
}
return {
'Program:exit'(node) {
const globalScope = context.sourceCode.getScope(node);
const stack = [...globalScope.childScopes];
while (stack.length) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const scope = stack.pop();
stack.push(...scope.childScopes);
checkForShadows(scope);
}
},
};
},
});
@@ -0,0 +1,32 @@
import { calcLength } from './delta-calc.mjs';
function isAxisDeltaZero(delta) {
return delta.translate === 0 && delta.scale === 1;
}
function isDeltaZero(delta) {
return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);
}
function axisEquals(a, b) {
return a.min === b.min && a.max === b.max;
}
function boxEquals(a, b) {
return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);
}
function axisEqualsRounded(a, b) {
return (Math.round(a.min) === Math.round(b.min) &&
Math.round(a.max) === Math.round(b.max));
}
function boxEqualsRounded(a, b) {
return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);
}
function aspectRatio(box) {
return calcLength(box.x) / calcLength(box.y);
}
function axisDeltaEquals(a, b) {
return (a.translate === b.translate &&
a.scale === b.scale &&
a.originPoint === b.originPoint);
}
export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };
//# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_b","260":"F","516":"_A"},B:{"1":"_J"},C:{"1":"_FI","2":"_f","33":"_FC"},D:{"1":"_NF","2":"_aL","33":"_TJ MB"},E:{"1":"_jB","2":"_u","33":"L"},F:{"1":"_a","2":"_T"},G:{"1":"_2","2":"_1","33":"fD"},H:{"2":"1D"},I:{"1":"I","2":"_W","132":"_y"},J:{"1":"A","2":"D"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"calc() as CSS unit value",D:true};
@@ -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 CassetteTape = createLucideIcon("CassetteTape", [
["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
["circle", { cx: "8", cy: "10", r: "2", key: "1xl4ub" }],
["path", { d: "M8 12h8", key: "1wcyev" }],
["circle", { cx: "16", cy: "10", r: "2", key: "r14t7q" }],
["path", { d: "m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3", key: "l01ucn" }]
]);
export { CassetteTape as default };
//# sourceMappingURL=cassette-tape.js.map
@@ -0,0 +1 @@
export declare const xhtmlEntities: Record<string, string>;
@@ -0,0 +1,42 @@
export default class TrieNode {
children = new Map<string, TrieNode>()
subs?: string[]
constructor(public parents: string[] = []) {}
addSub(key: string, ...subs: string[]): this {
const firstChar = key.charAt(0)
if (!this.children.has(firstChar)) {
this.children.set(firstChar, new TrieNode([...this.parents, firstChar]))
}
let cur = this.children.get(firstChar)!
for (let i = 1; i < key.length; i += 1) {
const c = key.charAt(i)
if (!cur.hasChild(c)) {
cur.addChild(c)
}
cur = cur.getChild(c)!
}
cur.subs = (cur.subs || []).concat(subs)
return this
}
getChild(child: string): TrieNode | undefined {
return this.children.get(child)
}
isTerminal(): boolean {
return !!this.subs
}
addChild(child: string): void {
if (!this.hasChild(child)) {
this.children.set(child, new TrieNode([...this.parents, child]))
}
}
hasChild(child: string): boolean {
return this.children.has(child)
}
}
@@ -0,0 +1,72 @@
import { DateInput, Unit } from './types';
/**
* Checks if a date is between two other dates or specified time units.
* 检查一个日期是否在两个其他日期或指定的时间单位之间。
*
* @param date - The date to check. (要检查的日期。)
* @param from - The start date or time unit. (起始日期或时间单位。)
* @param to - The end date or time unit. (结束日期或时间单位。)
* @param unit - The unit of time to compare (e.g., 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond').
* (要比较的时间单位,例如 'year'、'month'、'day'、'hour'、'minute'、'second'、'millisecond'。)
* @param inclusivity - A string indicating whether the comparison is inclusive or exclusive.
* (表示比较是否包含边界的字符串。)
* - '()' means exclusive (不包含边界) (默认值)
* - '[)' means inclusive on the start, exclusive on the end (包含起始边界,不包含结束边界)
* - '(]' means exclusive on the start, inclusive on the end (不包含起始边界,包含结束边界)
* - '[]' means inclusive (包含边界)
* @returns A boolean indicating whether the date is between the two specified dates or time units.
* (布尔值,表示日期是否在两个指定的日期或时间单位之间。)
* @example
* ```ts
* // Checking if a date is between two dates (检查一个日期是否在两个日期之间)
* const date = new Date('2023-10-01');
* const from = new Date('2023-09-01');
* const to = new Date('2023-11-01');
* const isBetweenDates = isBetween(date, from, to, 'day');
* console.log(isBetweenDates); // Outputs: true (输出: true)
*
* // Checking if a date is between two years (检查一个日期是否在两个年份之间)
* const date2 = new Date('2023-01-01');
* const isBetweenYears = isBetween(date2, 2022, 2024, 'year');
* console.log(isBetweenYears); // Outputs: true (输出: true)
*
* // Checking if a date is between two months (检查一个日期是否在两个月份之间)
* const date3 = new Date('2023-10-01');
* const isBetweenMonths = isBetween(date3, '2023-09', '2023-11', 'month');
* console.log(isBetweenMonths); // Outputs: true (输出: true)
*
* // Checking if a date is between two days (检查一个日期是否在两个天数之间)
* const date4 = new Date('2023-10-02');
* const isBetweenDays = isBetween(date4, '2023-10-01', '2023-10-03', 'day');
* console.log(isBetweenDays); // Outputs: true (输出: true)
*
* // Checking if a date is between two hours (检查一个日期是否在两个小时之间)
* const date5 = new Date('2023-10-01T12:00:00');
* const isBetweenHours = isBetween(date5, '2023-10-01T11:00:00', '2023-10-01T13:00:00', 'hour');
* console.log(isBetweenHours); // Outputs: true (输出: true)
*
* // Checking if a date is between two minutes (检查一个日期是否在两个分钟之间)
* const date6 = new Date('2023-10-01T12:01:00');
* const isBetweenMinutes = isBetween(date6, '2023-10-01T12:00:00', '2023-10-01T12:02:00', 'minute');
* console.log(isBetweenMinutes); // Outputs: true (输出: true)
*
* // Checking if a date is between two seconds (检查一个日期是否在两个秒数之间)
* const date7 = new Date('2023-10-01T12:00:01');
* const isBetweenSeconds = isBetween(date7, '2023-10-01T12:00:00', '2023-10-01T12:00:02', 'second');
* console.log(isBetweenSeconds); // Outputs: true (输出: true)
*
* // Checking if a date is between two milliseconds (检查一个日期是否在两个毫秒数之间)
* const date8 = new Date('2023-10-01T12:00:00.500');
* const isBetweenMilliseconds = isBetween(date8, '2023-10-01T12:00:00.000', '2023-10-01T12:00:00.999', 'millisecond');
* console.log(isBetweenMilliseconds); // Outputs: true (输出: true)
*
* // Using different inclusivity options (使用不同的包含选项)
* const date9 = new Date('2023-10-01');
* const isBetweenInclusive = isBetween(date9, '2023-10-01', '2023-10-01', 'day', '[]');
* console.log(isBetweenInclusive); // Outputs: true (输出: true)
*
* const isBetweenExclusive = isBetween(date9, '2023-10-01', '2023-10-01', 'day', '()');
* console.log(isBetweenExclusive); // Outputs: false (输出: false)
* ```
*/
export default function isBetween(date: Date, from: DateInput, to: DateInput, unit?: Unit, inclusivity?: string): boolean;
@@ -0,0 +1 @@
module.exports={A:{A:{"16":"FD","132":"_SC"},B:{"1":"_NI","132":"_2F"},C:{"1":"_6P _ZR","132":"_5D","260":"_nC CC","772":"_rB _UO"},D:{"1":"_MS","132":"_uF","260":"_TF _hC _tL","772":"_YF _kH"},E:{"1":"_BI","16":"_4","132":"_DI","260":"B _ID"},F:{"1":"_H _2N","16":"_VE","132":"aC","260":"_NB _ME _5E","772":"_0E"},G:{"1":"_9","16":"_1","132":"_SD _FF"},H:{"132":"1D"},I:{"1":"I","16":"_LB","132":"_oF","772":"_y"},J:{"132":"_B"},K:{"1":"H","16":"_cB","132":"aC"},L:{"1":"I"},M:{"1":"YC"},N:{"132":"_A"},O:{"1":"bC"},P:{"1":"_sF","260":"_4F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","132":"LE"}},B:6,C:"Date.prototype.toLocaleDateString",D:true};
@@ -0,0 +1,11 @@
import { a as absFloor } from "./absFloor-BlD_nfEw.mjs";
import { b as MS_IN_MINUTE } from "./constants-BuFquuHl.mjs";
import parse from "./parse.mjs";
function diffInMinutes(date, input, asFloat) {
const parsed = parse(input);
const output = (+date - +parsed) / MS_IN_MINUTE;
return asFloat ? output : absFloor(output);
}
export {
diffInMinutes as default
};
@@ -0,0 +1,24 @@
import {KeywordCxt} from "../../ajv"
import type {CodeKeywordDefinition} from "../../types"
import {alwaysValidSchema} from "../../compile/util"
const def: CodeKeywordDefinition = {
keyword: "metadata",
schemaType: "object",
code(cxt: KeywordCxt) {
checkMetadata(cxt)
const {gen, schema, it} = cxt
if (alwaysValidSchema(it, schema)) return
const valid = gen.name("valid")
cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid)
cxt.ok(valid)
},
}
export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void {
if (it.jtdMetadata !== metadata) {
throw new Error(`JTD: "${keyword}" cannot be used in this schema location`)
}
}
export default def
@@ -0,0 +1,167 @@
import { encode as b64u } from '../../util/base64url.js';
import { unprotected, assertNotSet } from '../../lib/helpers.js';
import { encrypt } from '../../lib/content_encryption.js';
import { encryptKeyManagement } from '../../lib/key_management.js';
import { JOSENotSupported, JWEInvalid } from '../../util/errors.js';
import { isDisjoint } from '../../lib/type_checks.js';
import { concat, encode } from '../../lib/buffer_utils.js';
import { validateCrit } from '../../lib/validate_crit.js';
import { normalizeKey } from '../../lib/normalize_key.js';
import { checkKeyType } from '../../lib/check_key_type.js';
import { compress } from '../../lib/deflate.js';
export class FlattenedEncrypt {
#plaintext;
#protectedHeader;
#sharedUnprotectedHeader;
#unprotectedHeader;
#aad;
#cek;
#iv;
#keyManagementParameters;
constructor(plaintext) {
if (!(plaintext instanceof Uint8Array)) {
throw new TypeError('plaintext must be an instance of Uint8Array');
}
this.#plaintext = plaintext;
}
setKeyManagementParameters(parameters) {
assertNotSet(this.#keyManagementParameters, 'setKeyManagementParameters');
this.#keyManagementParameters = parameters;
return this;
}
setProtectedHeader(protectedHeader) {
assertNotSet(this.#protectedHeader, 'setProtectedHeader');
this.#protectedHeader = protectedHeader;
return this;
}
setSharedUnprotectedHeader(sharedUnprotectedHeader) {
assertNotSet(this.#sharedUnprotectedHeader, 'setSharedUnprotectedHeader');
this.#sharedUnprotectedHeader = sharedUnprotectedHeader;
return this;
}
setUnprotectedHeader(unprotectedHeader) {
assertNotSet(this.#unprotectedHeader, 'setUnprotectedHeader');
this.#unprotectedHeader = unprotectedHeader;
return this;
}
setAdditionalAuthenticatedData(aad) {
this.#aad = aad;
return this;
}
setContentEncryptionKey(cek) {
assertNotSet(this.#cek, 'setContentEncryptionKey');
this.#cek = cek;
return this;
}
setInitializationVector(iv) {
assertNotSet(this.#iv, 'setInitializationVector');
this.#iv = iv;
return this;
}
async encrypt(key, options) {
if (!this.#protectedHeader && !this.#unprotectedHeader && !this.#sharedUnprotectedHeader) {
throw new JWEInvalid('either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()');
}
if (!isDisjoint(this.#protectedHeader, this.#unprotectedHeader, this.#sharedUnprotectedHeader)) {
throw new JWEInvalid('JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint');
}
const joseHeader = {
...this.#protectedHeader,
...this.#unprotectedHeader,
...this.#sharedUnprotectedHeader,
};
validateCrit(JWEInvalid, new Map(), options?.crit, this.#protectedHeader, joseHeader);
if (joseHeader.zip !== undefined && joseHeader.zip !== 'DEF') {
throw new JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value.');
}
if (joseHeader.zip !== undefined && !this.#protectedHeader?.zip) {
throw new JWEInvalid('JWE "zip" (Compression Algorithm) Header Parameter MUST be in a protected header.');
}
const { alg, enc } = joseHeader;
if (typeof alg !== 'string' || !alg) {
throw new JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');
}
if (typeof enc !== 'string' || !enc) {
throw new JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');
}
let encryptedKey;
if (this.#cek && (alg === 'dir' || alg === 'ECDH-ES')) {
throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${alg}`);
}
checkKeyType(alg === 'dir' ? enc : alg, key, 'encrypt');
let cek;
{
let parameters;
const k = await normalizeKey(key, alg);
({ cek, encryptedKey, parameters } = await encryptKeyManagement(alg, enc, k, this.#cek, this.#keyManagementParameters));
if (parameters) {
if (options && unprotected in options) {
if (!this.#unprotectedHeader) {
this.setUnprotectedHeader(parameters);
}
else {
this.#unprotectedHeader = { ...this.#unprotectedHeader, ...parameters };
}
}
else if (!this.#protectedHeader) {
this.setProtectedHeader(parameters);
}
else {
this.#protectedHeader = { ...this.#protectedHeader, ...parameters };
}
}
}
let additionalData;
let protectedHeaderS;
let protectedHeaderB;
let aadMember;
if (this.#protectedHeader) {
protectedHeaderS = b64u(JSON.stringify(this.#protectedHeader));
protectedHeaderB = encode(protectedHeaderS);
}
else {
protectedHeaderS = '';
protectedHeaderB = new Uint8Array();
}
if (this.#aad) {
aadMember = b64u(this.#aad);
const aadMemberBytes = encode(aadMember);
additionalData = concat(protectedHeaderB, encode('.'), aadMemberBytes);
}
else {
additionalData = protectedHeaderB;
}
let plaintext = this.#plaintext;
if (joseHeader.zip === 'DEF') {
plaintext = await compress(plaintext).catch((cause) => {
throw new JWEInvalid('Failed to compress plaintext', { cause });
});
}
const { ciphertext, tag, iv } = await encrypt(enc, plaintext, cek, this.#iv, additionalData);
const jwe = {
ciphertext: b64u(ciphertext),
};
if (iv) {
jwe.iv = b64u(iv);
}
if (tag) {
jwe.tag = b64u(tag);
}
if (encryptedKey) {
jwe.encrypted_key = b64u(encryptedKey);
}
if (aadMember) {
jwe.aad = aadMember;
}
if (this.#protectedHeader) {
jwe.protected = protectedHeaderS;
}
if (this.#sharedUnprotectedHeader) {
jwe.unprotected = this.#sharedUnprotectedHeader;
}
if (this.#unprotectedHeader) {
jwe.header = this.#unprotectedHeader;
}
return jwe;
}
}
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -e
mkdir -p .browser
echo
echo Preparing browser tests:
find spec -type f -name '*.spec.js' | \
xargs -I {} sh -c \
'export f="{}"; echo $f; browserify $f -t require-globify -t brfs -x ajv -u buffer -o $(echo $f | sed -e "s/spec/.browser/");'
@@ -0,0 +1 @@
{"version":3,"file":"state.mjs","sources":["../../../../src/projection/node/state.ts"],"sourcesContent":["/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACI,MAAM,qBAAqB,GAAG;AACjC;;;AAGG;AACH,IAAA,sBAAsB,EAAE,IAAI;AAE5B;;;AAGG;AACH,IAAA,cAAc,EAAE,KAAK;;;;;"}
@@ -0,0 +1,818 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// web/index.ts
var web_exports = {};
__export(web_exports, {
AbortSignalPlugin: () => abort_signal_default,
BlobPlugin: () => blob_default,
CustomEventPlugin: () => custom_event_default,
DOMExceptionPlugin: () => dom_exception_default,
EventPlugin: () => event_default,
FilePlugin: () => file_default,
FormDataPlugin: () => form_data_default,
HeadersPlugin: () => headers_default,
ImageDataPlugin: () => image_data_default,
ReadableStreamPlugin: () => readable_stream_default,
RequestPlugin: () => request_default,
ResponsePlugin: () => response_default,
URLPlugin: () => url_default,
URLSearchParamsPlugin: () => url_search_params_default
});
module.exports = __toCommonJS(web_exports);
// web/abort-signal.ts
var import_seroval = require("seroval");
var PROMISE_TO_ABORT_SIGNAL = (promise) => {
const controller = new AbortController();
const abort = controller.abort.bind(controller);
promise.then(abort, abort);
return controller;
};
function resolveAbortSignalResult(resolve) {
resolve(this.reason);
}
function resolveAbortSignal(resolve) {
this.addEventListener("abort", resolveAbortSignalResult.bind(this, resolve), {
once: true
});
}
function abortSignalToPromise(signal) {
return new Promise(resolveAbortSignal.bind(signal));
}
var ABORT_CONTROLLER = {};
var AbortControllerFactoryPlugin = /* @__PURE__ */ (0, import_seroval.createPlugin)({
tag: "seroval-plugins/web/AbortControllerFactoryPlugin",
test(value) {
return value === ABORT_CONTROLLER;
},
parse: {
sync() {
return ABORT_CONTROLLER;
},
async async() {
return await Promise.resolve(ABORT_CONTROLLER);
},
stream() {
return ABORT_CONTROLLER;
}
},
serialize() {
return PROMISE_TO_ABORT_SIGNAL.toString();
},
deserialize() {
return PROMISE_TO_ABORT_SIGNAL;
}
});
var AbortSignalPlugin = /* @__PURE__ */ (0, import_seroval.createPlugin)({
tag: "seroval-plugins/web/AbortSignal",
extends: [AbortControllerFactoryPlugin],
test(value) {
if (typeof AbortSignal === "undefined") {
return false;
}
return value instanceof AbortSignal;
},
parse: {
sync(value, ctx) {
if (value.aborted) {
return {
reason: ctx.parse(value.reason)
};
}
return {};
},
async async(value, ctx) {
if (value.aborted) {
return {
reason: await ctx.parse(value.reason)
};
}
const result = await abortSignalToPromise(value);
return {
reason: await ctx.parse(result)
};
},
stream(value, ctx) {
if (value.aborted) {
return {
reason: ctx.parse(value.reason)
};
}
const promise = abortSignalToPromise(value);
return {
factory: ctx.parse(ABORT_CONTROLLER),
controller: ctx.parse(promise)
};
}
},
serialize(node, ctx) {
if (node.reason) {
return "AbortSignal.abort(" + ctx.serialize(node.reason) + ")";
}
if (node.controller && node.factory) {
return "(" + ctx.serialize(node.factory) + ")(" + ctx.serialize(node.controller) + ").signal";
}
return "(new AbortController).signal";
},
deserialize(node, ctx) {
if (node.reason) {
return AbortSignal.abort(ctx.deserialize(node.reason));
}
if (node.controller) {
return PROMISE_TO_ABORT_SIGNAL(ctx.deserialize(node.controller)).signal;
}
const controller = new AbortController();
return controller.signal;
}
});
var abort_signal_default = AbortSignalPlugin;
// web/blob.ts
var import_seroval2 = require("seroval");
var BlobPlugin = /* @__PURE__ */ (0, import_seroval2.createPlugin)({
tag: "seroval-plugins/web/Blob",
test(value) {
if (typeof Blob === "undefined") {
return false;
}
return value instanceof Blob;
},
parse: {
async async(value, ctx) {
return {
type: await ctx.parse(value.type),
buffer: await ctx.parse(await value.arrayBuffer())
};
}
},
serialize(node, ctx) {
return "new Blob([" + ctx.serialize(node.buffer) + "],{type:" + ctx.serialize(node.type) + "})";
},
deserialize(node, ctx) {
return new Blob([ctx.deserialize(node.buffer)], {
type: ctx.deserialize(node.type)
});
}
});
var blob_default = BlobPlugin;
// web/custom-event.ts
var import_seroval3 = require("seroval");
function createCustomEventOptions(current) {
return {
detail: current.detail,
bubbles: current.bubbles,
cancelable: current.cancelable,
composed: current.composed
};
}
var CustomEventPlugin = /* @__PURE__ */ (0, import_seroval3.createPlugin)({
tag: "seroval-plugins/web/CustomEvent",
test(value) {
if (typeof CustomEvent === "undefined") {
return false;
}
return value instanceof CustomEvent;
},
parse: {
sync(value, ctx) {
return {
type: ctx.parse(value.type),
options: ctx.parse(createCustomEventOptions(value))
};
},
async async(value, ctx) {
return {
type: await ctx.parse(value.type),
options: await ctx.parse(createCustomEventOptions(value))
};
},
stream(value, ctx) {
return {
type: ctx.parse(value.type),
options: ctx.parse(createCustomEventOptions(value))
};
}
},
serialize(node, ctx) {
return "new CustomEvent(" + ctx.serialize(node.type) + "," + ctx.serialize(node.options) + ")";
},
deserialize(node, ctx) {
return new CustomEvent(
ctx.deserialize(node.type),
ctx.deserialize(node.options)
);
}
});
var custom_event_default = CustomEventPlugin;
// web/dom-exception.ts
var import_seroval4 = require("seroval");
var DOMExceptionPlugin = /* @__PURE__ */ (0, import_seroval4.createPlugin)({
tag: "seroval-plugins/web/DOMException",
test(value) {
if (typeof DOMException === "undefined") {
return false;
}
return value instanceof DOMException;
},
parse: {
sync(value, ctx) {
return {
name: ctx.parse(value.name),
message: ctx.parse(value.message)
};
},
async async(value, ctx) {
return {
name: await ctx.parse(value.name),
message: await ctx.parse(value.message)
};
},
stream(value, ctx) {
return {
name: ctx.parse(value.name),
message: ctx.parse(value.message)
};
}
},
serialize(node, ctx) {
return "new DOMException(" + ctx.serialize(node.message) + "," + ctx.serialize(node.name) + ")";
},
deserialize(node, ctx) {
return new DOMException(
ctx.deserialize(node.message),
ctx.deserialize(node.name)
);
}
});
var dom_exception_default = DOMExceptionPlugin;
// web/event.ts
var import_seroval5 = require("seroval");
function createEventOptions(current) {
return {
bubbles: current.bubbles,
cancelable: current.cancelable,
composed: current.composed
};
}
var EventPlugin = /* @__PURE__ */ (0, import_seroval5.createPlugin)({
tag: "seroval-plugins/web/Event",
test(value) {
if (typeof Event === "undefined") {
return false;
}
return value instanceof Event;
},
parse: {
sync(value, ctx) {
return {
type: ctx.parse(value.type),
options: ctx.parse(createEventOptions(value))
};
},
async async(value, ctx) {
return {
type: await ctx.parse(value.type),
options: await ctx.parse(createEventOptions(value))
};
},
stream(value, ctx) {
return {
type: ctx.parse(value.type),
options: ctx.parse(createEventOptions(value))
};
}
},
serialize(node, ctx) {
return "new Event(" + ctx.serialize(node.type) + "," + ctx.serialize(node.options) + ")";
},
deserialize(node, ctx) {
return new Event(
ctx.deserialize(node.type),
ctx.deserialize(node.options)
);
}
});
var event_default = EventPlugin;
// web/file.ts
var import_seroval6 = require("seroval");
var FilePlugin = /* @__PURE__ */ (0, import_seroval6.createPlugin)({
tag: "seroval-plugins/web/File",
test(value) {
if (typeof File === "undefined") {
return false;
}
return value instanceof File;
},
parse: {
async async(value, ctx) {
return {
name: await ctx.parse(value.name),
options: await ctx.parse({
type: value.type,
lastModified: value.lastModified
}),
buffer: await ctx.parse(await value.arrayBuffer())
};
}
},
serialize(node, ctx) {
return "new File([" + ctx.serialize(node.buffer) + "]," + ctx.serialize(node.name) + "," + ctx.serialize(node.options) + ")";
},
deserialize(node, ctx) {
return new File(
[ctx.deserialize(node.buffer)],
ctx.deserialize(node.name),
ctx.deserialize(node.options)
);
}
});
var file_default = FilePlugin;
// web/form-data.ts
var import_seroval7 = require("seroval");
function convertFormData(instance) {
const items = [];
instance.forEach((value, key) => {
items.push([key, value]);
});
return items;
}
var FORM_DATA_FACTORY = {};
var FORM_DATA_FACTORY_CONSTRUCTOR = (e, f = new FormData(), i = 0, s = e.length, t) => {
for (; i < s; i++) {
t = e[i];
f.append(t[0], t[1]);
}
return f;
};
var FormDataFactoryPlugin = /* @__PURE__ */ (0, import_seroval7.createPlugin)({
tag: "seroval-plugins/web/FormDataFactory",
test(value) {
return value === FORM_DATA_FACTORY;
},
parse: {
sync() {
return FORM_DATA_FACTORY;
},
async async() {
return await Promise.resolve(FORM_DATA_FACTORY);
},
stream() {
return FORM_DATA_FACTORY;
}
},
serialize() {
return FORM_DATA_FACTORY_CONSTRUCTOR.toString();
},
deserialize() {
return FORM_DATA_FACTORY;
}
});
var FormDataPlugin = /* @__PURE__ */ (0, import_seroval7.createPlugin)({
tag: "seroval-plugins/web/FormData",
extends: [file_default, FormDataFactoryPlugin],
test(value) {
if (typeof FormData === "undefined") {
return false;
}
return value instanceof FormData;
},
parse: {
sync(value, ctx) {
return {
factory: ctx.parse(FORM_DATA_FACTORY),
entries: ctx.parse(convertFormData(value))
};
},
async async(value, ctx) {
return {
factory: await ctx.parse(FORM_DATA_FACTORY),
entries: await ctx.parse(convertFormData(value))
};
},
stream(value, ctx) {
return {
factory: ctx.parse(FORM_DATA_FACTORY),
entries: ctx.parse(convertFormData(value))
};
}
},
serialize(node, ctx) {
return "(" + ctx.serialize(node.factory) + ")(" + ctx.serialize(node.entries) + ")";
},
deserialize(node, ctx) {
return FORM_DATA_FACTORY_CONSTRUCTOR(
ctx.deserialize(node.entries)
);
}
});
var form_data_default = FormDataPlugin;
// web/headers.ts
var import_seroval8 = require("seroval");
function convertHeaders(instance) {
const items = [];
instance.forEach((value, key) => {
items.push([key, value]);
});
return items;
}
var HeadersPlugin = /* @__PURE__ */ (0, import_seroval8.createPlugin)({
tag: "seroval-plugins/web/Headers",
test(value) {
if (typeof Headers === "undefined") {
return false;
}
return value instanceof Headers;
},
parse: {
sync(value, ctx) {
return {
value: ctx.parse(convertHeaders(value))
};
},
async async(value, ctx) {
return {
value: await ctx.parse(convertHeaders(value))
};
},
stream(value, ctx) {
return {
value: ctx.parse(convertHeaders(value))
};
}
},
serialize(node, ctx) {
return "new Headers(" + ctx.serialize(node.value) + ")";
},
deserialize(node, ctx) {
return new Headers(ctx.deserialize(node.value));
}
});
var headers_default = HeadersPlugin;
// web/image-data.ts
var import_seroval9 = require("seroval");
var ImageDataPlugin = /* @__PURE__ */ (0, import_seroval9.createPlugin)({
tag: "seroval-plugins/web/ImageData",
test(value) {
if (typeof ImageData === "undefined") {
return false;
}
return value instanceof ImageData;
},
parse: {
sync(value, ctx) {
return {
data: ctx.parse(value.data),
width: ctx.parse(value.width),
height: ctx.parse(value.height),
options: ctx.parse({
colorSpace: value.colorSpace
})
};
},
async async(value, ctx) {
return {
data: await ctx.parse(value.data),
width: await ctx.parse(value.width),
height: await ctx.parse(value.height),
options: await ctx.parse({
colorSpace: value.colorSpace
})
};
},
stream(value, ctx) {
return {
data: ctx.parse(value.data),
width: ctx.parse(value.width),
height: ctx.parse(value.height),
options: ctx.parse({
colorSpace: value.colorSpace
})
};
}
},
serialize(node, ctx) {
return "new ImageData(" + ctx.serialize(node.data) + "," + ctx.serialize(node.width) + "," + ctx.serialize(node.height) + "," + ctx.serialize(node.options) + ")";
},
deserialize(node, ctx) {
return new ImageData(
ctx.deserialize(node.data),
ctx.deserialize(node.width),
ctx.deserialize(node.height),
ctx.deserialize(node.options)
);
}
});
var image_data_default = ImageDataPlugin;
// web/readable-stream.ts
var import_seroval10 = require("seroval");
var READABLE_STREAM_FACTORY = {};
var READABLE_STREAM_FACTORY_CONSTRUCTOR = (stream) => new ReadableStream({
start: (controller) => {
stream.on({
next: (value) => {
try {
controller.enqueue(value);
} catch (_error) {
}
},
throw: (value) => {
controller.error(value);
},
return: () => {
try {
controller.close();
} catch (_error) {
}
}
});
}
});
var ReadableStreamFactoryPlugin = /* @__PURE__ */ (0, import_seroval10.createPlugin)({
tag: "seroval-plugins/web/ReadableStreamFactory",
test(value) {
return value === READABLE_STREAM_FACTORY;
},
parse: {
sync() {
return READABLE_STREAM_FACTORY;
},
async async() {
return await Promise.resolve(READABLE_STREAM_FACTORY);
},
stream() {
return READABLE_STREAM_FACTORY;
}
},
serialize() {
return READABLE_STREAM_FACTORY_CONSTRUCTOR.toString();
},
deserialize() {
return READABLE_STREAM_FACTORY;
}
});
function toStream(value) {
const stream = (0, import_seroval10.createStream)();
const reader = value.getReader();
async function push() {
try {
const result = await reader.read();
if (result.done) {
stream.return(result.value);
} else {
stream.next(result.value);
await push();
}
} catch (error) {
stream.throw(error);
}
}
push().catch(() => {
});
return stream;
}
var ReadableStreamPlugin = /* @__PURE__ */ (0, import_seroval10.createPlugin)({
tag: "seroval/plugins/web/ReadableStream",
extends: [ReadableStreamFactoryPlugin],
test(value) {
if (typeof ReadableStream === "undefined") {
return false;
}
return value instanceof ReadableStream;
},
parse: {
sync(_value, ctx) {
return {
factory: ctx.parse(READABLE_STREAM_FACTORY),
stream: ctx.parse((0, import_seroval10.createStream)())
};
},
async async(value, ctx) {
return {
factory: await ctx.parse(READABLE_STREAM_FACTORY),
stream: await ctx.parse(toStream(value))
};
},
stream(value, ctx) {
return {
factory: ctx.parse(READABLE_STREAM_FACTORY),
stream: ctx.parse(toStream(value))
};
}
},
serialize(node, ctx) {
return "(" + ctx.serialize(node.factory) + ")(" + ctx.serialize(node.stream) + ")";
},
deserialize(node, ctx) {
const stream = ctx.deserialize(node.stream);
return READABLE_STREAM_FACTORY_CONSTRUCTOR(stream);
}
});
var readable_stream_default = ReadableStreamPlugin;
// web/request.ts
var import_seroval11 = require("seroval");
function createRequestOptions(current, body) {
return {
body,
cache: current.cache,
credentials: current.credentials,
headers: current.headers,
integrity: current.integrity,
keepalive: current.keepalive,
method: current.method,
mode: current.mode,
redirect: current.redirect,
referrer: current.referrer,
referrerPolicy: current.referrerPolicy
};
}
var RequestPlugin = /* @__PURE__ */ (0, import_seroval11.createPlugin)({
tag: "seroval-plugins/web/Request",
extends: [readable_stream_default, headers_default],
test(value) {
if (typeof Request === "undefined") {
return false;
}
return value instanceof Request;
},
parse: {
async async(value, ctx) {
return {
url: await ctx.parse(value.url),
options: await ctx.parse(
createRequestOptions(
value,
value.body && !value.bodyUsed ? await value.clone().arrayBuffer() : null
)
)
};
},
stream(value, ctx) {
return {
url: ctx.parse(value.url),
options: ctx.parse(
createRequestOptions(
value,
value.body && !value.bodyUsed ? value.clone().body : null
)
)
};
}
},
serialize(node, ctx) {
return "new Request(" + ctx.serialize(node.url) + "," + ctx.serialize(node.options) + ")";
},
deserialize(node, ctx) {
return new Request(
ctx.deserialize(node.url),
ctx.deserialize(node.options)
);
}
});
var request_default = RequestPlugin;
// web/response.ts
var import_seroval12 = require("seroval");
function createResponseOptions(current) {
return {
headers: current.headers,
status: current.status,
statusText: current.statusText
};
}
var ResponsePlugin = /* @__PURE__ */ (0, import_seroval12.createPlugin)({
tag: "seroval-plugins/web/Response",
extends: [readable_stream_default, headers_default],
test(value) {
if (typeof Response === "undefined") {
return false;
}
return value instanceof Response;
},
parse: {
async async(value, ctx) {
return {
body: await ctx.parse(
value.body && !value.bodyUsed ? await value.clone().arrayBuffer() : null
),
options: await ctx.parse(createResponseOptions(value))
};
},
stream(value, ctx) {
return {
body: ctx.parse(
value.body && !value.bodyUsed ? value.clone().body : null
),
options: ctx.parse(createResponseOptions(value))
};
}
},
serialize(node, ctx) {
return "new Response(" + ctx.serialize(node.body) + "," + ctx.serialize(node.options) + ")";
},
deserialize(node, ctx) {
return new Response(
ctx.deserialize(node.body),
ctx.deserialize(node.options)
);
}
});
var response_default = ResponsePlugin;
// web/url.ts
var import_seroval13 = require("seroval");
var URLPlugin = /* @__PURE__ */ (0, import_seroval13.createPlugin)({
tag: "seroval-plugins/web/URL",
test(value) {
if (typeof URL === "undefined") {
return false;
}
return value instanceof URL;
},
parse: {
sync(value, ctx) {
return {
value: ctx.parse(value.href)
};
},
async async(value, ctx) {
return {
value: await ctx.parse(value.href)
};
},
stream(value, ctx) {
return {
value: ctx.parse(value.href)
};
}
},
serialize(node, ctx) {
return "new URL(" + ctx.serialize(node.value) + ")";
},
deserialize(node, ctx) {
return new URL(ctx.deserialize(node.value));
}
});
var url_default = URLPlugin;
// web/url-search-params.ts
var import_seroval14 = require("seroval");
var URLSearchParamsPlugin = /* @__PURE__ */ (0, import_seroval14.createPlugin)({
tag: "seroval-plugins/web/URLSearchParams",
test(value) {
if (typeof URLSearchParams === "undefined") {
return false;
}
return value instanceof URLSearchParams;
},
parse: {
sync(value, ctx) {
return {
value: ctx.parse(value.toString())
};
},
async async(value, ctx) {
return {
value: await ctx.parse(value.toString())
};
},
stream(value, ctx) {
return {
value: ctx.parse(value.toString())
};
}
},
serialize(node, ctx) {
return "new URLSearchParams(" + ctx.serialize(node.value) + ")";
},
deserialize(node, ctx) {
return new URLSearchParams(ctx.deserialize(node.value));
}
});
var url_search_params_default = URLSearchParamsPlugin;
//# sourceMappingURL=web.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"pi.js","sources":["../../../src/icons/pi.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Pi\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iOSIgeDI9IjkiIHkxPSI0IiB5Mj0iMjAiIC8+CiAgPHBhdGggZD0iTTQgN2MwLTEuNyAxLjMtMyAzLTNoMTMiIC8+CiAgPHBhdGggZD0iTTE4IDIwYy0xLjcgMC0zLTEuMy0zLTNWNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/pi\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 Pi = createLucideIcon('Pi', [\n ['line', { x1: '9', x2: '9', y1: '4', y2: '20', key: 'ovs5a5' }],\n ['path', { d: 'M4 7c0-1.7 1.3-3 3-3h13', key: '10pag4' }],\n ['path', { d: 'M18 20c-1.7 0-3-1.3-3-3V4', key: '1gaosr' }],\n]);\n\nexport default Pi;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,iBAAiB,IAAM,CAAA,CAAA,CAAA;AAAA,CAChC,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,CAAA,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
'use strict';
module.exports = (flag, argv = process.argv) => {
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
const position = argv.indexOf(prefix + flag);
const terminatorPosition = argv.indexOf('--');
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
};
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2014-2018 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FunctionTypeScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class FunctionTypeScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.functionType, upperScope, block, false);
}
}
exports.FunctionTypeScope = FunctionTypeScope;
@@ -0,0 +1,50 @@
export class InvariantError extends Error {
constructor(message) {
super(message);
Object.setPrototypeOf(this, InvariantError.prototype);
}
}
/**
* Provide a condition and if that condition is falsey, this throws an error
* with the given message.
*
* inspired by invariant from 'tiny-invariant' except will still include the
* message in production.
*
* @example
* invariant(typeof value === 'string', `value must be a string`)
*
* @param condition The condition to check
* @param message The message to throw (or a callback to generate the message)
* @param responseInit Additional response init options if a response is thrown
*
* @throws {InvariantError} if condition is falsey
*/
export function invariant(condition, message) {
if (!condition) {
throw new InvariantError(typeof message === 'function' ? message() : message);
}
}
/**
* Provide a condition and if that condition is falsey, this throws a 400
* Response with the given message.
*
* inspired by invariant from 'tiny-invariant'
*
* @example
* invariantResponse(typeof value === 'string', `value must be a string`)
*
* @param condition The condition to check
* @param message The message to throw (or a callback to generate the message)
* @param responseInit Additional response init options if a response is thrown
*
* @throws {Response} if condition is falsey
*/
export function invariantResponse(condition, message, responseInit) {
if (!condition) {
throw new Response(typeof message === 'function' ? message() : message, {
status: 400,
...responseInit,
});
}
}
@@ -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 CircleArrowOutUpLeft = createLucideIcon("CircleArrowOutUpLeft", [
["path", { d: "M2 8V2h6", key: "hiwtdz" }],
["path", { d: "m2 2 10 10", key: "1oh8rs" }],
["path", { d: "M12 2A10 10 0 1 1 2 12", key: "rrk4fa" }]
]);
export { CircleArrowOutUpLeft as default };
//# sourceMappingURL=circle-arrow-out-up-left.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_isNode","require","assertNode","node","isNode","_node$type","type","JSON","stringify","TypeError"],"sources":["../../src/asserts/assertNode.ts"],"sourcesContent":["import isNode from \"../validators/isNode.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type}\"`);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGe,SAASC,UAAUA,CAACC,IAAU,EAA0B;EACrE,IAAI,CAAC,IAAAC,eAAM,EAACD,IAAI,CAAC,EAAE;IAAA,IAAAE,UAAA;IACjB,MAAMC,IAAI,IAAAD,UAAA,GAAGF,IAAI,oBAAJA,IAAI,CAAEG,IAAI,YAAAD,UAAA,GAAIE,IAAI,CAACC,SAAS,CAACL,IAAI,CAAC;IAC/C,MAAM,IAAIM,SAAS,CAAC,6BAA6BH,IAAI,GAAG,CAAC;EAC3D;AACF","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"clientAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAShG,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAWH,MAAM,UAAU,kBAAkB,CAAC,EAAE,YAAY,EAAyC;IACtF,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,gCAAgC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,IAAI,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,CAAC;YACD,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;YACjD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACvD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;YACtD,CAAC;YACD,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;gBACvB,IAAI,CAAC,aAAa,EAAE,CAAC;oBACjB,MAAM,IAAI,kBAAkB,CAAC,2BAA2B,CAAC,CAAC;gBAC9D,CAAC;gBACD,IAAI,MAAM,CAAC,aAAa,KAAK,aAAa,EAAE,CAAC;oBACzC,MAAM,IAAI,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;gBAC1D,CAAC;gBACD,IAAI,MAAM,CAAC,wBAAwB,IAAI,MAAM,CAAC,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;oBACrG,MAAM,IAAI,kBAAkB,CAAC,2BAA2B,CAAC,CAAC;gBAC9D,CAAC;YACL,CAAC;YAED,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,6 @@
// Accepts an easing function and returns a new one that outputs mirrored values for
// the second half of the animation. Turns easeIn into easeInOut.
const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
export { mirrorEasing };
//# sourceMappingURL=mirror.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"gamepad.js","sources":["../../../src/icons/gamepad.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Gamepad\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNiIgeDI9IjEwIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iOCIgeDI9IjgiIHkxPSIxMCIgeTI9IjE0IiAvPgogIDxsaW5lIHgxPSIxNSIgeDI9IjE1LjAxIiB5MT0iMTMiIHkyPSIxMyIgLz4KICA8bGluZSB4MT0iMTgiIHgyPSIxOC4wMSIgeTE9IjExIiB5Mj0iMTEiIC8+CiAgPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjEyIiB4PSIyIiB5PSI2IiByeD0iMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/gamepad\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 Gamepad = createLucideIcon('Gamepad', [\n ['line', { x1: '6', x2: '10', y1: '12', y2: '12', key: '161bw2' }],\n ['line', { x1: '8', x2: '8', y1: '10', y2: '14', key: '1i6ji0' }],\n ['line', { x1: '15', x2: '15.01', y1: '13', y2: '13', key: 'dqpgro' }],\n ['line', { x1: '18', x2: '18.01', y1: '11', y2: '11', key: 'meh2c' }],\n ['rect', { width: '20', height: '12', x: '2', y: '6', rx: '2', key: '9lu3g6' }],\n]);\n\nexport default Gamepad;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACrE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/drag/index.ts"],"sourcesContent":["import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature<HTMLElement> {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement<HTMLElement>) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n"],"names":[],"mappings":";;;;AAIM,MAAO,WAAY,SAAQ,OAAoB,CAAA;AAMjD,IAAA,WAAA,CAAY,IAAgC,EAAA;QACxC,KAAK,CAAC,IAAI,CAAC;QAJf,IAAA,CAAA,mBAAmB,GAAa,IAAI;QACpC,IAAA,CAAA,eAAe,GAAa,IAAI;QAI5B,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC;IACvD;IAEA,KAAK,GAAA;;;QAGD,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAE7C,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpE;QAEA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,IAAI;IAC/D;IAEA,MAAM,GAAA;QACF,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC7C,QAAA,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE;AAEpE,QAAA,IAAI,YAAY,KAAK,gBAAgB,EAAE;YACnC,IAAI,CAAC,mBAAmB,EAAE;YAC1B,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;YACpE;QACJ;IACJ;IAEA,OAAO,GAAA;QACH,IAAI,CAAC,mBAAmB,EAAE;QAC1B,IAAI,CAAC,eAAe,EAAE;AACtB;;;;;;;;;AASG;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AAC3B,YAAA,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QACjC;IACJ;AACH;;;;"}
@@ -0,0 +1,742 @@
const require_utils = require("./utils.cjs");
const require_invariant = require("./invariant.cjs");
const require_lru_cache = require("./lru-cache.cjs");
const SEGMENT_TYPE_INDEX = 4;
const SEGMENT_TYPE_PATHLESS = 5;
function getOpenAndCloseBraces(part) {
const openBrace = part.indexOf("{");
if (openBrace === -1) return null;
const closeBrace = part.indexOf("}", openBrace);
if (closeBrace === -1) return null;
if (openBrace + 1 >= part.length) return null;
return [openBrace, closeBrace];
}
/**
* Populates the `output` array with the parsed representation of the given `segment` string.
*
* Usage:
* ```ts
* let output
* let cursor = 0
* while (cursor < path.length) {
* output = parseSegment(path, cursor, output)
* const end = output[5]
* cursor = end + 1
* ```
*
* `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed
* or initialized, it will be done automatically.
*/
function parseSegment(path, start, output = new Uint16Array(6)) {
const next = path.indexOf("/", start);
const end = next === -1 ? path.length : next;
const part = path.substring(start, end);
if (!part || !part.includes("$")) {
output[0] = 0;
output[1] = start;
output[2] = start;
output[3] = end;
output[4] = end;
output[5] = end;
return output;
}
if (part === "$") {
const total = path.length;
output[0] = 2;
output[1] = start;
output[2] = start;
output[3] = total;
output[4] = total;
output[5] = total;
return output;
}
if (part.charCodeAt(0) === 36) {
output[0] = 1;
output[1] = start;
output[2] = start + 1;
output[3] = end;
output[4] = end;
output[5] = end;
return output;
}
const braces = getOpenAndCloseBraces(part);
if (braces) {
const [openBrace, closeBrace] = braces;
const firstChar = part.charCodeAt(openBrace + 1);
if (firstChar === 45) {
if (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) {
const paramStart = openBrace + 3;
const paramEnd = closeBrace;
if (paramStart < paramEnd) {
output[0] = 3;
output[1] = start + openBrace;
output[2] = start + paramStart;
output[3] = start + paramEnd;
output[4] = start + closeBrace + 1;
output[5] = end;
return output;
}
}
} else if (firstChar === 36) {
const dollarPos = openBrace + 1;
const afterDollar = openBrace + 2;
if (afterDollar === closeBrace) {
output[0] = 2;
output[1] = start + openBrace;
output[2] = start + dollarPos;
output[3] = start + afterDollar;
output[4] = start + closeBrace + 1;
output[5] = path.length;
return output;
}
output[0] = 1;
output[1] = start + openBrace;
output[2] = start + afterDollar;
output[3] = start + closeBrace;
output[4] = start + closeBrace + 1;
output[5] = end;
return output;
}
}
output[0] = 0;
output[1] = start;
output[2] = start;
output[3] = end;
output[4] = end;
output[5] = end;
return output;
}
/**
* Recursively parses the segments of the given route tree and populates a segment trie.
*
* @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations)
* @param route The current route to parse.
* @param start The starting index for parsing within the route's full path.
* @param node The current segment node in the trie to populate.
* @param onRoute Callback invoked for each route processed.
*/
function parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) {
onRoute?.(route);
let cursor = start;
{
const path = route.fullPath ?? route.from;
const length = path.length;
const caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive;
const parseParams = route.options?.params?.parse ?? route.options?.parseParams;
while (cursor < length) {
const segment = parseSegment(path, cursor, data);
let nextNode;
const start = cursor;
const end = segment[5];
cursor = end + 1;
depth++;
switch (segment[0]) {
case 0: {
const value = path.substring(segment[2], segment[3]);
if (caseSensitive) {
const existingNode = node.static?.get(value);
if (existingNode) nextNode = existingNode;
else {
node.static ??= /* @__PURE__ */ new Map();
const next = createStaticNode(route.fullPath ?? route.from);
next.parent = node;
next.depth = depth;
nextNode = next;
node.static.set(value, next);
}
} else {
const name = value.toLowerCase();
const existingNode = node.staticInsensitive?.get(name);
if (existingNode) nextNode = existingNode;
else {
node.staticInsensitive ??= /* @__PURE__ */ new Map();
const next = createStaticNode(route.fullPath ?? route.from);
next.parent = node;
next.depth = depth;
nextNode = next;
node.staticInsensitive.set(name, next);
}
}
break;
}
case 1: {
const prefix_raw = path.substring(start, segment[1]);
const suffix_raw = path.substring(segment[4], end);
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
const existingNode = !parseParams && node.dynamic?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
if (existingNode) nextNode = existingNode;
else {
const next = createDynamicNode(1, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
nextNode = next;
next.depth = depth;
next.parent = node;
node.dynamic ??= [];
node.dynamic.push(next);
}
break;
}
case 3: {
const prefix_raw = path.substring(start, segment[1]);
const suffix_raw = path.substring(segment[4], end);
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
const existingNode = !parseParams && node.optional?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
if (existingNode) nextNode = existingNode;
else {
const next = createDynamicNode(3, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
nextNode = next;
next.parent = node;
next.depth = depth;
node.optional ??= [];
node.optional.push(next);
}
break;
}
case 2: {
const prefix_raw = path.substring(start, segment[1]);
const suffix_raw = path.substring(segment[4], end);
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
const next = createDynamicNode(2, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
nextNode = next;
next.parent = node;
next.depth = depth;
node.wildcard ??= [];
node.wildcard.push(next);
}
}
node = nextNode;
}
if (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf("/") + 1) === 95) {
const pathlessNode = createStaticNode(route.fullPath ?? route.from);
pathlessNode.kind = SEGMENT_TYPE_PATHLESS;
pathlessNode.parent = node;
depth++;
pathlessNode.depth = depth;
node.pathless ??= [];
node.pathless.push(pathlessNode);
node = pathlessNode;
}
const isLeaf = (route.path || !route.children) && !route.isRoot;
if (isLeaf && path.endsWith("/")) {
const indexNode = createStaticNode(route.fullPath ?? route.from);
indexNode.kind = SEGMENT_TYPE_INDEX;
indexNode.parent = node;
depth++;
indexNode.depth = depth;
node.index = indexNode;
node = indexNode;
}
node.parse = parseParams ?? null;
if (isLeaf && !node.route) {
node.route = route;
node.fullPath = route.fullPath ?? route.from;
}
}
if (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, onRoute);
}
function sortDynamic(a, b) {
if (a.parse && !b.parse) return -1;
if (!a.parse && b.parse) return 1;
if (a.prefix && b.prefix && a.prefix !== b.prefix) {
if (a.prefix.startsWith(b.prefix)) return -1;
if (b.prefix.startsWith(a.prefix)) return 1;
}
if (a.suffix && b.suffix && a.suffix !== b.suffix) {
if (a.suffix.endsWith(b.suffix)) return -1;
if (b.suffix.endsWith(a.suffix)) return 1;
}
if (a.prefix && !b.prefix) return -1;
if (!a.prefix && b.prefix) return 1;
if (a.suffix && !b.suffix) return -1;
if (!a.suffix && b.suffix) return 1;
if (a.caseSensitive && !b.caseSensitive) return -1;
if (!a.caseSensitive && b.caseSensitive) return 1;
return 0;
}
function sortTreeNodes(node) {
if (node.pathless) for (const child of node.pathless) sortTreeNodes(child);
if (node.static) for (const child of node.static.values()) sortTreeNodes(child);
if (node.staticInsensitive) for (const child of node.staticInsensitive.values()) sortTreeNodes(child);
if (node.dynamic?.length) {
node.dynamic.sort(sortDynamic);
for (const child of node.dynamic) sortTreeNodes(child);
}
if (node.optional?.length) {
node.optional.sort(sortDynamic);
for (const child of node.optional) sortTreeNodes(child);
}
if (node.wildcard?.length) {
node.wildcard.sort(sortDynamic);
for (const child of node.wildcard) sortTreeNodes(child);
}
}
function createStaticNode(fullPath) {
return {
kind: 0,
depth: 0,
pathless: null,
index: null,
static: null,
staticInsensitive: null,
dynamic: null,
optional: null,
wildcard: null,
route: null,
fullPath,
parent: null,
parse: null
};
}
/**
* Keys must be declared in the same order as in `SegmentNode` type,
* to ensure they are represented as the same object class in the engine.
*/
function createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) {
return {
kind,
depth: 0,
pathless: null,
index: null,
static: null,
staticInsensitive: null,
dynamic: null,
optional: null,
wildcard: null,
route: null,
fullPath,
parent: null,
parse: null,
caseSensitive,
prefix,
suffix
};
}
function processRouteMasks(routeList, processedTree) {
const segmentTree = createStaticNode("/");
const data = new Uint16Array(6);
for (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0);
sortTreeNodes(segmentTree);
processedTree.masksTree = segmentTree;
processedTree.flatCache = require_lru_cache.createLRUCache(1e3);
}
/**
* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.
*/
function findFlatMatch(path, processedTree) {
path ||= "/";
const cached = processedTree.flatCache.get(path);
if (cached) return cached;
const result = findMatch(path, processedTree.masksTree);
processedTree.flatCache.set(path, result);
return result;
}
/**
* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree
*/
function findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {
from ||= "/";
path ||= "/";
const key = caseSensitive ? `case\0${from}` : from;
let tree = processedTree.singleCache.get(key);
if (!tree) {
tree = createStaticNode("/");
parseSegments(caseSensitive, new Uint16Array(6), { from }, 1, tree, 0);
processedTree.singleCache.set(key, tree);
}
return findMatch(path, tree, fuzzy);
}
function findRouteMatch(path, processedTree, fuzzy = false) {
const key = fuzzy ? path : `nofuzz\0${path}`;
const cached = processedTree.matchCache.get(key);
if (cached !== void 0) return cached;
path ||= "/";
let result;
try {
result = findMatch(path, processedTree.segmentTree, fuzzy);
} catch (err) {
if (err instanceof URIError) result = null;
else throw err;
}
if (result) result.branch = buildRouteBranch(result.route);
processedTree.matchCache.set(key, result);
return result;
}
/** Trim trailing slashes (except preserving root '/'). */
function trimPathRight(path) {
return path === "/" ? path : path.replace(/\/{1,}$/, "");
}
/**
* Processes a route tree into a segment trie for efficient path matching.
* Also builds lookup maps for routes by ID and by trimmed full path.
*/
function processRouteTree(routeTree, caseSensitive = false, initRoute) {
const segmentTree = createStaticNode(routeTree.fullPath);
const data = new Uint16Array(6);
const routesById = {};
const routesByPath = {};
let index = 0;
parseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => {
initRoute?.(route, index);
if (route.id in routesById) {
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);
require_invariant.invariant();
}
routesById[route.id] = route;
if (index !== 0 && route.path) {
const trimmedFullPath = trimPathRight(route.fullPath);
if (!routesByPath[trimmedFullPath] || route.fullPath.endsWith("/")) routesByPath[trimmedFullPath] = route;
}
index++;
});
sortTreeNodes(segmentTree);
return {
processedTree: {
segmentTree,
singleCache: require_lru_cache.createLRUCache(1e3),
matchCache: require_lru_cache.createLRUCache(1e3),
flatCache: null,
masksTree: null
},
routesById,
routesByPath
};
}
function findMatch(path, segmentTree, fuzzy = false) {
const parts = path.split("/");
const leaf = getNodeMatch(path, parts, segmentTree, fuzzy);
if (!leaf) return null;
const [rawParams] = extractParams(path, parts, leaf);
return {
route: leaf.node.route,
rawParams
};
}
/**
* This function is "resumable":
* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call
* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off
*
* Inputs are *not* mutated.
*/
function extractParams(path, parts, leaf) {
const list = buildBranch(leaf.node);
let nodeParts = null;
const rawParams = Object.create(null);
/** which segment of the path we're currently processing */
let partIndex = leaf.extract?.part ?? 0;
/** which node of the route tree branch we're currently processing */
let nodeIndex = leaf.extract?.node ?? 0;
/** index of the 1st character of the segment we're processing in the path string */
let pathIndex = leaf.extract?.path ?? 0;
/** which fullPath segment we're currently processing */
let segmentCount = leaf.extract?.segment ?? 0;
for (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) {
const node = list[nodeIndex];
if (node.kind === SEGMENT_TYPE_INDEX) break;
if (node.kind === SEGMENT_TYPE_PATHLESS) {
segmentCount--;
partIndex--;
pathIndex--;
continue;
}
const part = parts[partIndex];
const currentPathIndex = pathIndex;
if (part) pathIndex += part.length;
if (node.kind === 1) {
nodeParts ??= leaf.node.fullPath.split("/");
const nodePart = nodeParts[segmentCount];
const preLength = node.prefix?.length ?? 0;
if (nodePart.charCodeAt(preLength) === 123) {
const sufLength = node.suffix?.length ?? 0;
const name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1);
const value = part.substring(preLength, part.length - sufLength);
rawParams[name] = decodeURIComponent(value);
} else {
const name = nodePart.substring(1);
rawParams[name] = decodeURIComponent(part);
}
} else if (node.kind === 3) {
if (leaf.skipped & 1 << nodeIndex) {
partIndex--;
pathIndex = currentPathIndex - 1;
continue;
}
nodeParts ??= leaf.node.fullPath.split("/");
const nodePart = nodeParts[segmentCount];
const preLength = node.prefix?.length ?? 0;
const sufLength = node.suffix?.length ?? 0;
const name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1);
const value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part;
if (value) rawParams[name] = decodeURIComponent(value);
} else if (node.kind === 2) {
const n = node;
const value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0));
const splat = decodeURIComponent(value);
rawParams["*"] = splat;
rawParams._splat = splat;
break;
}
}
if (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);
return [rawParams, {
part: partIndex,
node: nodeIndex,
path: pathIndex,
segment: segmentCount
}];
}
function buildRouteBranch(route) {
const list = [route];
while (route.parentRoute) {
route = route.parentRoute;
list.push(route);
}
list.reverse();
return list;
}
function buildBranch(node) {
const list = Array(node.depth + 1);
do {
list[node.depth] = node;
node = node.parent;
} while (node);
return list;
}
function getNodeMatch(path, parts, segmentTree, fuzzy) {
if (path === "/" && segmentTree.index) return {
node: segmentTree.index,
skipped: 0
};
const trailingSlash = !require_utils.last(parts);
const pathIsIndex = trailingSlash && path !== "/";
const partsLength = parts.length - (trailingSlash ? 1 : 0);
const stack = [{
node: segmentTree,
index: 1,
skipped: 0,
depth: 1,
statics: 0,
dynamics: 0,
optionals: 0
}];
let bestFuzzy = null;
let bestMatch = null;
while (stack.length) {
const frame = stack.pop();
const { node, index, skipped, depth, statics, dynamics, optionals } = frame;
let { extract, rawParams } = frame;
if (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;
if (node.parse) {
if (!validateParseParams(path, parts, frame)) continue;
rawParams = frame.rawParams;
extract = frame.extract;
}
if (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;
const isBeyondPath = index === partsLength;
if (isBeyondPath) {
if (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;
if (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;
}
const part = isBeyondPath ? void 0 : parts[index];
let lowerPart;
if (isBeyondPath && node.index) {
const indexFrame = {
node: node.index,
index,
skipped,
depth: depth + 1,
statics,
dynamics,
optionals,
extract,
rawParams
};
let indexValid = true;
if (node.index.parse) {
if (!validateParseParams(path, parts, indexFrame)) indexValid = false;
}
if (indexValid) {
if (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;
if (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;
}
}
if (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {
const segment = node.wildcard[i];
const { prefix, suffix } = segment;
if (prefix) {
if (isBeyondPath) continue;
if (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;
}
if (suffix) {
if (isBeyondPath) continue;
const end = parts.slice(index).join("/").slice(-suffix.length);
if ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue;
}
stack.push({
node: segment,
index: partsLength,
skipped,
depth: depth + 1,
statics,
dynamics,
optionals,
extract,
rawParams
});
}
if (node.optional) {
const nextSkipped = skipped | 1 << depth;
const nextDepth = depth + 1;
for (let i = node.optional.length - 1; i >= 0; i--) {
const segment = node.optional[i];
stack.push({
node: segment,
index,
skipped: nextSkipped,
depth: nextDepth,
statics,
dynamics,
optionals,
extract,
rawParams
});
}
if (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {
const segment = node.optional[i];
const { prefix, suffix } = segment;
if (prefix || suffix) {
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
if (prefix && !casePart.startsWith(prefix)) continue;
if (suffix && !casePart.endsWith(suffix)) continue;
}
stack.push({
node: segment,
index: index + 1,
skipped,
depth: nextDepth,
statics,
dynamics,
optionals: optionals + segmentScore(partsLength, index),
extract,
rawParams
});
}
}
if (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {
const segment = node.dynamic[i];
const { prefix, suffix } = segment;
if (prefix || suffix) {
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
if (prefix && !casePart.startsWith(prefix)) continue;
if (suffix && !casePart.endsWith(suffix)) continue;
}
stack.push({
node: segment,
index: index + 1,
skipped,
depth: depth + 1,
statics,
dynamics: dynamics + segmentScore(partsLength, index),
optionals,
extract,
rawParams
});
}
if (!isBeyondPath && node.staticInsensitive) {
const match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());
if (match) stack.push({
node: match,
index: index + 1,
skipped,
depth: depth + 1,
statics: statics + segmentScore(partsLength, index),
dynamics,
optionals,
extract,
rawParams
});
}
if (!isBeyondPath && node.static) {
const match = node.static.get(part);
if (match) stack.push({
node: match,
index: index + 1,
skipped,
depth: depth + 1,
statics: statics + segmentScore(partsLength, index),
dynamics,
optionals,
extract,
rawParams
});
}
if (node.pathless) {
const nextDepth = depth + 1;
for (let i = node.pathless.length - 1; i >= 0; i--) {
const segment = node.pathless[i];
stack.push({
node: segment,
index,
skipped,
depth: nextDepth,
statics,
dynamics,
optionals,
extract,
rawParams
});
}
}
}
if (bestMatch) return bestMatch;
if (fuzzy && bestFuzzy) {
let sliceIndex = bestFuzzy.index;
for (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;
const splat = sliceIndex === path.length ? "/" : path.slice(sliceIndex);
bestFuzzy.rawParams ??= Object.create(null);
bestFuzzy.rawParams["**"] = decodeURIComponent(splat);
return bestFuzzy;
}
return null;
}
function segmentScore(partsLength, index) {
return 2 ** (partsLength - index - 1);
}
function isPerfectStaticMatch(statics, partsLength) {
return statics === 2 ** (partsLength - 1) - 1;
}
function validateParseParams(path, parts, frame) {
let rawParams;
let state;
try {
[rawParams, state] = extractParams(path, parts, frame);
} catch {
return null;
}
frame.rawParams = rawParams;
frame.extract = state;
if (!frame.node.parse) return true;
try {
if (frame.node.parse(rawParams) === false) return null;
} catch {}
return true;
}
function isFrameMoreSpecific(prev, next) {
if (!prev) return true;
return next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth)));
}
//#endregion
exports.buildRouteBranch = buildRouteBranch;
exports.findFlatMatch = findFlatMatch;
exports.findRouteMatch = findRouteMatch;
exports.findSingleMatch = findSingleMatch;
exports.parseSegment = parseSegment;
exports.processRouteMasks = processRouteMasks;
exports.processRouteTree = processRouteTree;
//# sourceMappingURL=new-process-route-tree.cjs.map
@@ -0,0 +1,502 @@
import { encode, decode } from '@jridgewell/sourcemap-codec';
import resolver from './resolve';
import maybeSort from './sort';
import buildBySources from './by-source';
import {
memoizedState,
memoizedBinarySearch,
upperBound,
lowerBound,
found as bsFound,
} from './binary-search';
import {
COLUMN,
SOURCES_INDEX,
SOURCE_LINE,
SOURCE_COLUMN,
NAMES_INDEX,
REV_GENERATED_LINE,
REV_GENERATED_COLUMN,
} from './sourcemap-segment';
import { parse } from './types';
import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';
import type {
SourceMapV3,
DecodedSourceMap,
EncodedSourceMap,
InvalidOriginalMapping,
OriginalMapping,
InvalidGeneratedMapping,
GeneratedMapping,
SourceMapInput,
Needle,
SourceNeedle,
SourceMap,
EachMapping,
Bias,
XInput,
SectionedSourceMap,
Ro,
} from './types';
import type { Source } from './by-source';
import type { MemoState } from './binary-search';
export type { SourceMapSegment } from './sourcemap-segment';
export type {
SourceMap,
DecodedSourceMap,
EncodedSourceMap,
Section,
SectionedSourceMap,
SourceMapV3,
Bias,
EachMapping,
GeneratedMapping,
InvalidGeneratedMapping,
InvalidOriginalMapping,
Needle,
OriginalMapping,
OriginalMapping as Mapping,
SectionedSourceMapInput,
SourceMapInput,
SourceNeedle,
XInput,
EncodedSourceMapXInput,
DecodedSourceMapXInput,
SectionedSourceMapXInput,
SectionXInput,
} from './types';
interface PublicMap {
_encoded: TraceMap['_encoded'];
_decoded: TraceMap['_decoded'];
_decodedMemo: TraceMap['_decodedMemo'];
_bySources: TraceMap['_bySources'];
_bySourceMemos: TraceMap['_bySourceMemos'];
}
const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
export const LEAST_UPPER_BOUND = -1;
export const GREATEST_LOWER_BOUND = 1;
export { FlattenMap, FlattenMap as AnyMap } from './flatten-map';
export class TraceMap implements SourceMap {
declare version: SourceMapV3['version'];
declare file: SourceMapV3['file'];
declare names: SourceMapV3['names'];
declare sourceRoot: SourceMapV3['sourceRoot'];
declare sources: SourceMapV3['sources'];
declare sourcesContent: SourceMapV3['sourcesContent'];
declare ignoreList: SourceMapV3['ignoreList'];
declare resolvedSources: string[];
declare private _encoded: string | undefined;
declare private _decoded: SourceMapSegment[][] | undefined;
declare private _decodedMemo: MemoState;
declare private _bySources: Source[] | undefined;
declare private _bySourceMemos: MemoState[] | undefined;
constructor(map: Ro<SourceMapInput>, mapUrl?: string | null) {
const isString = typeof map === 'string';
if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;
const parsed = parse(map as Exclude<SourceMapInput, TraceMap>);
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
this.version = version;
this.file = file;
this.names = names || [];
this.sourceRoot = sourceRoot;
this.sources = sources;
this.sourcesContent = sourcesContent;
this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined;
const resolve = resolver(mapUrl, sourceRoot);
this.resolvedSources = sources.map(resolve);
const { mappings } = parsed;
if (typeof mappings === 'string') {
this._encoded = mappings;
this._decoded = undefined;
} else if (Array.isArray(mappings)) {
this._encoded = undefined;
this._decoded = maybeSort(mappings, isString);
} else if ((parsed as unknown as SectionedSourceMap).sections) {
throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
} else {
throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
}
this._decodedMemo = memoizedState();
this._bySources = undefined;
this._bySourceMemos = undefined;
}
}
/**
* Typescript doesn't allow friend access to private fields, so this just casts the map into a type
* with public access modifiers.
*/
function cast(map: unknown): PublicMap {
return map as any;
}
/**
* Returns the encoded (VLQ string) form of the SourceMap's mappings field.
*/
export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] {
return (cast(map)._encoded ??= encode(cast(map)._decoded!));
}
/**
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
*/
export function decodedMappings(map: TraceMap): Readonly<DecodedSourceMap['mappings']> {
return (cast(map)._decoded ||= decode(cast(map)._encoded!));
}
/**
* A low-level API to find the segment associated with a generated line/column (think, from a
* stack trace). Line and column here are 0-based, unlike `originalPositionFor`.
*/
export function traceSegment(
map: TraceMap,
line: number,
column: number,
): Readonly<SourceMapSegment> | null {
const decoded = decodedMappings(map);
// It's common for parent source maps to have pointers to lines that have no
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
if (line >= decoded.length) return null;
const segments = decoded[line];
const index = traceSegmentInternal(
segments,
cast(map)._decodedMemo,
line,
column,
GREATEST_LOWER_BOUND,
);
return index === -1 ? null : segments[index];
}
/**
* A higher-level API to find the source/line/column associated with a generated line/column
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
* `source-map` library.
*/
export function originalPositionFor(
map: TraceMap,
needle: Needle,
): OriginalMapping | InvalidOriginalMapping {
let { line, column, bias } = needle;
line--;
if (line < 0) throw new Error(LINE_GTR_ZERO);
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
const decoded = decodedMappings(map);
// It's common for parent source maps to have pointers to lines that have no
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
if (line >= decoded.length) return OMapping(null, null, null, null);
const segments = decoded[line];
const index = traceSegmentInternal(
segments,
cast(map)._decodedMemo,
line,
column,
bias || GREATEST_LOWER_BOUND,
);
if (index === -1) return OMapping(null, null, null, null);
const segment = segments[index];
if (segment.length === 1) return OMapping(null, null, null, null);
const { names, resolvedSources } = map;
return OMapping(
resolvedSources[segment[SOURCES_INDEX]],
segment[SOURCE_LINE] + 1,
segment[SOURCE_COLUMN],
segment.length === 5 ? names[segment[NAMES_INDEX]] : null,
);
}
/**
* Finds the generated line/column position of the provided source/line/column source position.
*/
export function generatedPositionFor(
map: TraceMap,
needle: SourceNeedle,
): GeneratedMapping | InvalidGeneratedMapping {
const { source, line, column, bias } = needle;
return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);
}
/**
* Finds all generated line/column positions of the provided source/line/column source position.
*/
export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] {
const { source, line, column, bias } = needle;
// SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.
return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);
}
/**
* Iterates each mapping in generated position order.
*/
export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void {
const decoded = decodedMappings(map);
const { names, resolvedSources } = map;
for (let i = 0; i < decoded.length; i++) {
const line = decoded[i];
for (let j = 0; j < line.length; j++) {
const seg = line[j];
const generatedLine = i + 1;
const generatedColumn = seg[0];
let source = null;
let originalLine = null;
let originalColumn = null;
let name = null;
if (seg.length !== 1) {
source = resolvedSources[seg[1]];
originalLine = seg[2] + 1;
originalColumn = seg[3];
}
if (seg.length === 5) name = names[seg[4]];
cb({
generatedLine,
generatedColumn,
source,
originalLine,
originalColumn,
name,
} as EachMapping);
}
}
}
function sourceIndex(map: TraceMap, source: string): number {
const { sources, resolvedSources } = map;
let index = sources.indexOf(source);
if (index === -1) index = resolvedSources.indexOf(source);
return index;
}
/**
* Retrieves the source content for a particular source, if its found. Returns null if not.
*/
export function sourceContentFor(map: TraceMap, source: string): string | null {
const { sourcesContent } = map;
if (sourcesContent == null) return null;
const index = sourceIndex(map, source);
return index === -1 ? null : sourcesContent[index];
}
/**
* Determines if the source is marked to ignore by the source map.
*/
export function isIgnored(map: TraceMap, source: string): boolean {
const { ignoreList } = map;
if (ignoreList == null) return false;
const index = sourceIndex(map, source);
return index === -1 ? false : ignoreList.includes(index);
}
/**
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger
* maps.
*/
export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap {
const tracer = new TraceMap(clone(map, []), mapUrl);
cast(tracer)._decoded = map.mappings;
return tracer;
}
/**
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function decodedMap(
map: TraceMap,
): Omit<DecodedSourceMap, 'mappings'> & { mappings: readonly SourceMapSegment[][] } {
return clone(map, decodedMappings(map));
}
/**
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function encodedMap(map: TraceMap): EncodedSourceMap {
return clone(map, encodedMappings(map));
}
function clone<T extends string | readonly SourceMapSegment[][]>(
map: TraceMap | DecodedSourceMap,
mappings: T,
): T extends string ? EncodedSourceMap : DecodedSourceMap {
return {
version: map.version,
file: map.file,
names: map.names,
sourceRoot: map.sourceRoot,
sources: map.sources,
sourcesContent: map.sourcesContent,
mappings,
ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList,
} as any;
}
function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;
function OMapping(
source: string,
line: number,
column: number,
name: string | null,
): OriginalMapping;
function OMapping(
source: string | null,
line: number | null,
column: number | null,
name: string | null,
): OriginalMapping | InvalidOriginalMapping {
return { source, line, column, name } as any;
}
function GMapping(line: null, column: null): InvalidGeneratedMapping;
function GMapping(line: number, column: number): GeneratedMapping;
function GMapping(
line: number | null,
column: number | null,
): GeneratedMapping | InvalidGeneratedMapping {
return { line, column } as any;
}
function traceSegmentInternal(
segments: SourceMapSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number;
function traceSegmentInternal(
segments: ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number;
function traceSegmentInternal(
segments: SourceMapSegment[] | ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number {
let index = memoizedBinarySearch(segments, column, memo, line);
if (bsFound) {
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
} else if (bias === LEAST_UPPER_BOUND) index++;
if (index === -1 || index === segments.length) return -1;
return index;
}
function sliceGeneratedPositions(
segments: ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): GeneratedMapping[] {
let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);
// We ignored the bias when tracing the segment so that we're guarnateed to find the first (in
// insertion order) segment that matched. Even if we did respect the bias when tracing, we would
// still need to call `lowerBound()` to find the first segment, which is slower than just looking
// for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the
// binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to
// match LEAST_UPPER_BOUND.
if (!bsFound && bias === LEAST_UPPER_BOUND) min++;
if (min === -1 || min === segments.length) return [];
// We may have found the segment that started at an earlier column. If this is the case, then we
// need to slice all generated segments that match _that_ column, because all such segments span
// to our desired column.
const matchedColumn = bsFound ? column : segments[min][COLUMN];
// The binary search is not guaranteed to find the lower bound when a match wasn't found.
if (!bsFound) min = lowerBound(segments, matchedColumn, min);
const max = upperBound(segments, matchedColumn, min);
const result = [];
for (; min <= max; min++) {
const segment = segments[min];
result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));
}
return result;
}
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: false,
): GeneratedMapping | InvalidGeneratedMapping;
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: true,
): GeneratedMapping[];
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: boolean,
): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {
line--;
if (line < 0) throw new Error(LINE_GTR_ZERO);
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
const { sources, resolvedSources } = map;
let sourceIndex = sources.indexOf(source);
if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);
if (sourceIndex === -1) return all ? [] : GMapping(null, null);
const bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState));
const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos));
const segments = generated[sourceIndex][line];
if (segments == null) return all ? [] : GMapping(null, null);
const memo = bySourceMemos[sourceIndex];
if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);
const index = traceSegmentInternal(segments, memo, line, column, bias);
if (index === -1) return GMapping(null, null);
const segment = segments[index];
return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
}
@@ -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 CalendarFold = createLucideIcon("CalendarFold", [
["path", { d: "M8 2v4", key: "1cmpym" }],
["path", { d: "M16 2v4", key: "4m81vk" }],
["path", { d: "M21 17V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11Z", key: "kg77oy" }],
["path", { d: "M3 10h18", key: "8toen8" }],
["path", { d: "M15 22v-4a2 2 0 0 1 2-2h4", key: "1gnbqr" }]
]);
export { CalendarFold as default };
//# sourceMappingURL=calendar-fold.js.map
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
keyword: "unevaluatedItems",
type: "array",
schemaType: ["boolean", "object"],
error,
code(cxt) {
const { gen, schema, data, it } = cxt;
const items = it.items || 0;
if (items === true)
return;
const len = gen.const("len", (0, codegen_1._) `${data}.length`);
if (schema === false) {
cxt.setParams({ len: items });
cxt.fail((0, codegen_1._) `${len} > ${items}`);
}
else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`);
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
cxt.ok(valid);
}
it.items = true;
function validateItems(valid, from) {
gen.forRange("i", from, len, (i) => {
cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
if (!it.allErrors)
gen.if((0, codegen_1.not)(valid), () => gen.break());
});
}
},
};
exports.default = def;
//# sourceMappingURL=unevaluatedItems.js.map
@@ -0,0 +1,85 @@
'use strict'
/**
* Module dependencies.
*/
const bytes = require('bytes')
const typeis = require('type-is')
/**
* Module exports.
*/
module.exports = {
normalizeOptions,
passthrough
}
/**
* Get the simple type checker.
*
* @param {string | string[]} type
* @returns {Function}
* @private
*/
function typeChecker (type) {
return function checkType (req) {
return Boolean(typeis(req, type))
}
}
/**
* Normalizes the common options for all parsers.
*
* @param {Object} options options to normalize
* @param {string | string[] | Function} defaultType default content type(s) or a function to determine it
* @returns {Object}
* @private
*/
function normalizeOptions (options, defaultType) {
if (!defaultType) {
// Parsers must define a default content type
throw new TypeError('defaultType must be provided')
}
const inflate = options?.inflate !== false
const limit = typeof options?.limit === 'undefined' || options?.limit === null
? 102400 // 100kb default
: bytes.parse(options.limit)
const type = options?.type || defaultType
const verify = options?.verify || false
const defaultCharset = options?.defaultCharset || 'utf-8'
if (limit === null) {
throw new TypeError(`option limit "${String(options.limit)}" is invalid`)
}
if (verify !== false && typeof verify !== 'function') {
throw new TypeError('option verify must be function')
}
// create the appropriate type checking function
const shouldParse = typeof type !== 'function'
? typeChecker(type)
: type
return {
inflate,
limit,
verify,
defaultCharset,
shouldParse
}
}
/**
* Passthrough function that returns input unchanged.
* Used by parsers that don't need to transform the data.
*
* @param {*} value
* @returns {*}
* @private
*/
function passthrough (value) {
return value
}
@@ -0,0 +1 @@
{"version":3,"file":"square-arrow-down.js","sources":["../../../src/icons/square-arrow-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareArrowDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xMiA4djgiIC8+CiAgPHBhdGggZD0ibTggMTIgNCA0IDQtNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-arrow-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SquareArrowDown = createLucideIcon('SquareArrowDown', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M12 8v8', key: 'napkw2' }],\n ['path', { d: 'm8 12 4 4 4-4', key: 'k98ssh' }],\n]);\n\nexport default SquareArrowDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,3 @@
import { RegExpRouter } from "./router.js";
import { PreparedRegExpRouter, buildInitParams, serializeInitParams } from "./prepared-router.js";
export { PreparedRegExpRouter, RegExpRouter, buildInitParams, serializeInitParams };
@@ -0,0 +1,93 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
// You can regenerate it using `pnpm run generate-configs`
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = __importDefault(require("./base"));
const eslint_recommended_1 = __importDefault(require("./eslint-recommended"));
/**
* A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.
* @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only}
*/
exports.default = (plugin, parser) => [
(0, base_1.default)(plugin, parser),
(0, eslint_recommended_1.default)(plugin, parser),
{
name: 'typescript-eslint/strict-type-checked-only',
rules: {
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-array-delete': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-deprecated': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
'@typescript-eslint/no-meaningless-void-operator': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-misused-spread': 'error',
'@typescript-eslint/no-mixed-enums': 'error',
'@typescript-eslint/no-redundant-type-constituents': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-template-expression': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-type-conversion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unsafe-unary-minus': 'error',
'@typescript-eslint/no-useless-default-assignment': 'error',
'no-throw-literal': 'off',
'@typescript-eslint/only-throw-error': 'error',
'prefer-promise-reject-errors': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-return-this-type': 'error',
'@typescript-eslint/related-getter-setter-pairs': 'error',
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/restrict-plus-operands': [
'error',
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumberAndString: false,
allowRegExp: false,
},
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowAny: false,
allowBoolean: false,
allowNever: false,
allowNullish: false,
allowNumber: false,
allowRegExp: false,
},
],
'no-return-await': 'off',
'@typescript-eslint/return-await': [
'error',
'error-handling-correctness-only',
],
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
},
},
];
@@ -0,0 +1 @@
{"version":3,"file":"winchars.js","sourceRoot":"","sources":["../../src/winchars.ts"],"names":[],"mappings":";AAAA,mEAAmE;AACnE,kCAAkC;;;AAElC,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAErC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACzB,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3D,CAAA;AAED,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC3D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEpD,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAClC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAD3C,QAAA,MAAM,UACqC;AACjD,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAClC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAD3C,QAAA,MAAM,UACqC","sourcesContent":["// When writing files on Windows, translate the characters to their\n// 0xf000 higher-encoded versions.\n\nconst raw = ['|', '<', '>', '?', ':']\n\nconst win = raw.map(char =>\n String.fromCodePoint(0xf000 + Number(char.codePointAt(0))),\n)\n\nconst toWin = new Map(raw.map((char, i) => [char, win[i]]))\nconst toRaw = new Map(win.map((char, i) => [char, raw[i]]))\n\nexport const encode = (s: string) =>\n raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s)\nexport const decode = (s: string) =>\n win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s)\n"]}
@@ -0,0 +1,101 @@
import { raw } from "../../utils/html.js";
import { html } from "../../helper/html/index.js";
import { createContext, useContext } from "../../jsx/context.js";
import { Fragment, jsx } from "../../jsx/base.js";
import { renderToReadableStream } from "../../jsx/streaming.js";
import "../../jsx/index.js";
//#region src/middleware/jsx-renderer/index.ts
const RequestContext = createContext(null);
const createRenderer = (c, Layout, component, options) => (children, props) => {
options = typeof options === "function" ? options(c) : options;
const docType = typeof options?.docType === "string" ? options.docType : options?.docType === false ? "" : "<!DOCTYPE html>";
const currentLayout = component ? jsx((props) => component(props, c), {
Layout,
...props
}, children) : children;
const body = html`${raw(docType)}${jsx(RequestContext.Provider, { value: c }, currentLayout)}`;
if (options?.stream) {
if (options.stream === true) {
c.header("Transfer-Encoding", "chunked");
c.header("Content-Type", "text/html; charset=UTF-8");
c.header("Content-Encoding", "Identity");
} else for (const [key, value] of Object.entries(options.stream)) c.header(key, value);
return c.body(renderToReadableStream(body));
} else return c.html(body);
};
/**
* JSX Renderer Middleware for hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/jsx-renderer}
*
* @param {ComponentWithChildren} [component] - The component to render, which can accept children and props.
* @param {RendererOptions} [options] - The options for the JSX renderer middleware.
* @param {boolean | string} [options.docType=true] - The DOCTYPE to be added at the beginning of the HTML. If set to false, no DOCTYPE will be added.
* @param {boolean | Record<string, string>} [options.stream=false] - If set to true, enables streaming response with default headers. If a record is provided, custom headers will be used.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.get(
* '/page/*',
* jsxRenderer(({ children }) => {
* return (
* <html>
* <body>
* <header>Menu</header>
* <div>{children}</div>
* </body>
* </html>
* )
* })
* )
*
* app.get('/page/about', (c) => {
* return c.render(<h1>About me!</h1>)
* })
* ```
*/
const jsxRenderer = (component, options) => function jsxRenderer(c, next) {
const Layout = c.getLayout() ?? Fragment;
if (component) c.setLayout((props) => {
return component({
...props,
Layout
}, c);
});
c.setRenderer(createRenderer(c, Layout, component, options));
return next();
};
/**
* useRequestContext for Hono.
*
* @template E - The environment type.
* @template P - The parameter type.
* @template I - The input type.
* @returns {Context<E, P, I>} An instance of Context.
*
* @example
* ```ts
* const RequestUrlBadge: FC = () => {
* const c = useRequestContext()
* return <b>{c.req.url}</b>
* }
*
* app.get('/page/info', (c) => {
* return c.render(
* <div>
* You are accessing: <RequestUrlBadge />
* </div>
* )
* })
* ```
*/
const useRequestContext = () => {
const c = useContext(RequestContext);
if (!c) throw new Error("RequestContext is not provided.");
return c;
};
//#endregion
export { RequestContext, jsxRenderer, useRequestContext };
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CakeSlice = createLucideIcon("CakeSlice", [
["circle", { cx: "9", cy: "7", r: "2", key: "1305pl" }],
[
"path",
{ d: "M7.2 7.9 3 11v9c0 .6.4 1 1 1h16c.6 0 1-.4 1-1v-9c0-2-3-6-7-8l-3.6 2.6", key: "xle13f" }
],
["path", { d: "M16 13H3", key: "1wpj08" }],
["path", { d: "M16 17H3", key: "3lvfcd" }]
]);
export { CakeSlice as default };
//# sourceMappingURL=cake-slice.js.map
@@ -0,0 +1 @@
{"version":3,"file":"scan-eye.js","sources":["../../../src/icons/scan-eye.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ScanEye\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA3VjVhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Ik0xNyAzaDJhMiAyIDAgMCAxIDIgMnYyIiAvPgogIDxwYXRoIGQ9Ik0yMSAxN3YyYTIgMiAwIDAgMS0yIDJoLTIiIC8+CiAgPHBhdGggZD0iTTcgMjFINWEyIDIgMCAwIDEtMi0ydi0yIiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEiIC8+CiAgPHBhdGggZD0iTTE4Ljk0NCAxMi4zM2ExIDEgMCAwIDAgMC0uNjYgNy41IDcuNSAwIDAgMC0xMy44ODggMCAxIDEgMCAwIDAgMCAuNjYgNy41IDcuNSAwIDAgMCAxMy44ODggMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/scan-eye\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 ScanEye = createLucideIcon('ScanEye', [\n ['path', { d: 'M3 7V5a2 2 0 0 1 2-2h2', key: 'aa7l1z' }],\n ['path', { d: 'M17 3h2a2 2 0 0 1 2 2v2', key: '4qcy5o' }],\n ['path', { d: 'M21 17v2a2 2 0 0 1-2 2h-2', key: '6vwrx8' }],\n ['path', { d: 'M7 21H5a2 2 0 0 1-2-2v-2', key: 'ioqczr' }],\n ['circle', { cx: '12', cy: '12', r: '1', key: '41hilf' }],\n [\n 'path',\n {\n d: 'M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0',\n key: '11ak4c',\n },\n ],\n]);\n\nexport default ScanEye;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1D,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,CAAA;AAAA,CACzD,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,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_2D","2":"C"},C:{"1":"_FI","2":"_q G _L"},D:{"1":"_NK","2":"_KC"},E:{"1":"_dB","2":"_u"},F:{"1":"_wJ","2":"_qC"},G:{"1":"_9","2":"_iB"},H:{"1":"1D"},I:{"1":"_X","2":"_W"},J:{"1":"_B"},K:{"1":"_CB","2":"A"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"meter element",D:true};
@@ -0,0 +1,3 @@
declare const FormDataPlugin: any;
export default FormDataPlugin;
//# sourceMappingURL=form-data.d.ts.map
@@ -0,0 +1,32 @@
import type {CodeKeywordDefinition, SchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema} from "../../compile/util"
import {validateArray} from "../code"
import {_, not} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullable} from "./nullable"
import {typeError, _JTDTypeError} from "./error"
export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>
const def: CodeKeywordDefinition = {
keyword: "elements",
schemaType: "object",
error: typeError("array"),
code(cxt: KeywordCxt) {
checkMetadata(cxt)
const {gen, data, schema, it} = cxt
if (alwaysValidSchema(it, schema)) return
const [valid] = checkNullable(cxt)
gen.if(not(valid), () =>
gen.if(
_`Array.isArray(${data})`,
() => gen.assign(valid, validateArray(cxt)),
() => cxt.error()
)
)
cxt.ok(valid)
},
}
export default def
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Anton Korzunov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"names":["VALID_OBJECT_CALLEES","VALID_IDENTIFIER_CALLEES","INVALID_METHODS","isValidObjectCallee","val","includes","isValidIdentifierCallee","isInvalidMethod","evaluateTruthy","res","evaluate","confident","value","deopt","path","state","deoptPath","Globals","Map","undefined","Infinity","NaN","evaluateCached","node","seen","has","existing","get","resolved","item","set","_evaluate","isSequenceExpression","exprs","length","isStringLiteral","isNumericLiteral","isBooleanLiteral","isNullLiteral","isTemplateLiteral","evaluateQuasis","quasis","isTaggedTemplateExpression","isMemberExpression","object","name","property","isIdentifier","scope","getBinding","quasi","isConditionalExpression","testResult","isExpressionWrapper","parentPath","isCallExpression","callee","isLiteral","type","key","computed","isReferencedIdentifier","binding","constantViolations","start","end","bindingPathScope","kind","hasUnsafeBlock","isBlockStatement","parent","_scope$path$parentPat","hasValue","bindingPath","isVariableDeclarator","initPath","references","isUnaryExpression","prefix","operator","argument","isFunction","isClass","arg","isArrayExpression","arr","elems","elem","elemValue","push","isObjectExpression","obj","props","prop","isObjectMethod","isSpreadElement","keyPath","valuePath","isLogicalExpression","wasConfident","left","leftConfident","right","rightConfident","isBinaryExpression","Math","pow","context","func","global","hasOwnProperty","call","args","map","apply","raw","str","i","cooked","expr","String"],"sources":["../../src/path/evaluation.ts"],"sourcesContent":["import type NodePath from \"./index.ts\";\nimport type * as t from \"@babel/types\";\n\n// This file contains Babels metainterpreter that can evaluate static code.\n\nconst VALID_OBJECT_CALLEES = [\"Number\", \"String\", \"Math\"] as const;\nconst VALID_IDENTIFIER_CALLEES = [\n \"isFinite\",\n \"isNaN\",\n \"parseFloat\",\n \"parseInt\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n process.env.BABEL_8_BREAKING ? \"btoa\" : null,\n process.env.BABEL_8_BREAKING ? \"atob\" : null,\n] as const;\n\nconst INVALID_METHODS = [\"random\"] as const;\n\nfunction isValidObjectCallee(\n val: string,\n): val is (typeof VALID_OBJECT_CALLEES)[number] {\n return VALID_OBJECT_CALLEES.includes(\n // @ts-expect-error val is a string\n val,\n );\n}\n\nfunction isValidIdentifierCallee(\n val: string,\n): val is NonNullable<(typeof VALID_IDENTIFIER_CALLEES)[number]> {\n return VALID_IDENTIFIER_CALLEES.includes(\n // @ts-expect-error val is a string\n val,\n );\n}\n\nfunction isInvalidMethod(val: string): val is (typeof INVALID_METHODS)[number] {\n return INVALID_METHODS.includes(\n // @ts-expect-error val is a string\n val,\n );\n}\n\n/**\n * Walk the input `node` and statically evaluate if it's truthy.\n *\n * Returning `true` when we're sure that the expression will evaluate to a\n * truthy value, `false` if we're sure that it will evaluate to a falsy\n * value and `undefined` if we aren't sure. Because of this please do not\n * rely on coercion when using this method and check with === if it's false.\n *\n * For example do:\n *\n * if (t.evaluateTruthy(node) === false) falsyLogic();\n *\n * **AND NOT**\n *\n * if (!t.evaluateTruthy(node)) falsyLogic();\n *\n */\n\nexport function evaluateTruthy(this: NodePath): boolean | undefined {\n const res = this.evaluate();\n if (res.confident) return !!res.value;\n}\n\ntype State = {\n confident: boolean;\n deoptPath: NodePath | null;\n seen: Map<t.Node, Result>;\n};\n\ntype Result = {\n resolved: boolean;\n value?: any;\n};\n/**\n * Deopts the evaluation\n */\nfunction deopt(path: NodePath | null, state: State) {\n if (!state.confident) return;\n state.deoptPath = path;\n state.confident = false;\n}\n\nconst Globals = new Map([\n [\"undefined\", undefined],\n [\"Infinity\", Infinity],\n [\"NaN\", NaN],\n]);\n\n/**\n * We wrap the _evaluate method so we can track `seen` nodes, we push an item\n * to the map before we actually evaluate it so we can deopt on self recursive\n * nodes such as:\n *\n * var g = a ? 1 : 2,\n * a = g * this.foo\n */\nfunction evaluateCached(path: NodePath, state: State): any {\n const { node } = path;\n const { seen } = state;\n\n if (seen.has(node)) {\n const existing = seen.get(node)!;\n if (existing.resolved) {\n return existing.value;\n } else {\n deopt(path, state);\n return;\n }\n } else {\n const item: Result = { resolved: false };\n seen.set(node, item);\n\n const val = _evaluate(path, state);\n if (state.confident) {\n item.resolved = true;\n item.value = val;\n }\n return val;\n }\n}\n\nfunction _evaluate(path: NodePath, state: State): any {\n if (!state.confident) return;\n\n if (path.isSequenceExpression()) {\n const exprs = path.get(\"expressions\");\n return evaluateCached(exprs[exprs.length - 1], state);\n }\n\n if (\n Line truncated
@@ -0,0 +1,747 @@
export default `flf2a$ 7 6 100 15 31 1
Jerusalem by Gedaliah Friedenberg - based on Standard by G. Chappell & Ian Chai
Questions and comments regarding jerusalem.flf to gfrieden@nyx.cs.du.edu
Modified for figlet 2.1 by Glenn Chappell 16 Dec 1993
Date: 13 Feb 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
7 - height of a character
6 - height of a character, not including descenders
100 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font
31 - number of comment lines
1 - print right-to-left (figlet 2.1 or later only)
Hebrew keyboard maps:
All capital letters print the english character for that key. All numbers
and symbols are the same in in Hebrew/English except for those shown here.
The * symbol prints as a Jewish star (Star of David).
While in figlet, type ~ on a line by itself to see this list:
aleph = t | zayin = z | lamed = k | ayin = g | shin/sin = a
bet/vet = c | chet = j | mem = n | pey/fey = p | taf/saf = ,
gimmel = d | tet = y | final " = o | final " = ; | ,(comma) = '
daled = s | yud = h | nun = b | tzaadi = m | .(period) = /
hay = v | kaf/chaf = f | final " = i | final " = . | ; = \`
vav = u | final " = l | samekh = x | kuf = e | / = q
The asterisk (*) is a Star of David | resh = r | '(apost.) = w
$@
$@
$@
$@
$@
$@
$@@
@
_ @
| |@
| |@
|_|@
(_)@
@@
@
_ _ @
( | )@
V V @
$ @
$ @
@@
@
_ _ @
_| || |_ @
|_ .. _|@
|_ _|@
|_||_| @
@@
@
_ @
| | @
/ __)@
\\__ \\@
( /@
|_| @@
@
_ __@
(_)/ /@
/ / @
/ /_ @
/_/(_)@
@@
@
___ @
( _ ) @
/ _ \\/\\@
| (_> <@
\\___/\\/@
@@
@
@
@
@
_ @
( )@
|/ @@
@
__@
/ /@
| | @
| | @
| | @
\\_\\@@
@
__ @
\\ \\ @
| |@
| |@
| |@
/_/ @@
@
@
__/\\__@
\\ /@
/_ _\\@
\\/ @
@@
@
@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
______ @
| __ |@
| | | |@
_| | | |@
|___| |_|@
@@
@
@
@
_____ @
|_____|@
$ @
@@
@
__ _ @
|. | | |@
| | // @
| |// @
| | @
|_| @@
@
@
@
@
_ @
(_)@
@@
@
___ @
/ _ \\ @
| | | |@
| |_| |@
\\___/ @
@@
@
_ @
/ |@
| |@
| |@
|_|@
@@
@
____ @
|___ \\ @
__) |@
/ __/ @
|_____|@
@@
@
_____ @
|___ / @
|_ \\ @
___) |@
|____/ @
@@
@
_ _ @
| || | @
| || |_ @
|__ _|@
|_| @
@@
@
____ @
| ___| @
|___ \\ @
___) |@
|____/ @
@@
@
__ @
/ /_ @
| '_ \\ @
| (_) |@
\\___/ @
@@
@
_____ @
|___ |@
/ / @
/ / @
/_/ @
@@
@
___ @
( _ ) @
/ _ \\ @
| (_) |@
\\___/ @
@@
@
___ @
/ _ \\ @
| (_) |@
\\__, |@
/_/ @
@@
@
@
_ @
(_)@
_ @
(_)@
@@
@
______ @
| __ |@
| |_ | |@
|___|| |@
| |@
|_|@@
@
__@
/ /@
/ / @
\\ \\ @
\\_\\@
@@
@
@
_____ @
|_____|@
|_____|@
$ @
@@
@
__ @
\\ \\ @
\\ \\@
/ /@
/_/ @
@@
@
___ @
|__ \\@
/ /@
|_| @
(_) @
@@
@
____ @
/ __ \\ @
/ / _\` |@
| | (_| |@
\\ \\__,_|@
\\____/ @@
@
_ @
/ \\ @
/ _ \\ @
/ ___ \\ @
/_/ \\_\\@
@@
@
____ @
| __ ) @
| _ \\ @
| |_) |@
|____/ @
@@
@
____ @
/ ___|@
| | @
| |___ @
\\____|@
@@
@
____ @
| _ \\ @
| | | |@
| |_| |@
|____/ @
@@
@
_____ @
| ____|@
| _| @
| |___ @
|_____|@
@@
@
_____ @
| ___|@
| |_ @
| _| @
|_| @
@@
@
____ @
/ ___|@
| | _ @
| |_| |@
\\____|@
@@
@
_ _ @
| | | |@
| |_| |@
| _ |@
|_| |_|@
@@
@
___ @
|_ _|@
| | @
| | @
|___|@
@@
@
_ @
| |@
_ | |@
| |_| |@
\\___/ @
@@
@
_ __@
| |/ /@
| ' / @
| . \\ @
|_|\\_\\@
@@
@
_ @
| | @
| | @
| |___ @
|_____|@
@@
@
__ __ @
| \\/ |@
| |\\/| |@
| | | |@
|_| |_|@
@@
@
_ _ @
| \\ | |@
| \\| |@
| |\\ |@
|_| \\_|@
@@
@
___ @
/ _ \\ @
| | | |@
| |_| |@
\\___/ @
@@
@
____ @
| _ \\ @
| |_) |@
| __/ @
|_| @
@@
@
___ @
/ _ \\ @
| | | |@
| |_| |@
\\__\\_\\@
@@
@
____ @
| _ \\ @
| |_) |@
| _ < @
|_| \\_\\@
@@
@
____ @
/ ___| @
\\___ \\ @
___) |@
|____/ @
@@
@
_____ @
|_ _|@
| | @
| | @
|_| @
@@
@
_ _ @
| | | |@
| | | |@
| |_| |@
\\___/ @
@@
@
__ __@
\\ \\ / /@
\\ \\ / / @
\\ V / @
\\_/ @
@@
@
__ __@
\\ \\ / /@
\\ \\ /\\ / / @
\\ V V / @
\\_/\\_/ @
@@
@
__ __@
\\ \\/ /@
\\ / @
/ \\ @
/_/\\_\\@
@@
@
__ __@
\\ \\ / /@
\\ V / @
| | @
|_| @
@@
@
_____@
|__ /@
/ / @
/ /_ @
/____|@
@@
@
__ @
| _|@
| | @
| | @
| | @
|__|@@
@
__ @
\\ \\ @
\\ \\ @
\\ \\ @
\\_\\@
@@
@
__ @
|_ |@
| |@
| |@
| |@
|__|@@
@
/\\ @
|/\\|@
$ @
$ @
$ @
@@
@
@
@
@
@
_____ @
|_____|@@
@
@
_ @
(_)@
_ @
( )@
|/ @@
@
_ _ _ @
| | | | | |@
| | | | | |@
| |/ /_/ / @
|_______/ @
@@
@
___ @
|_ |@
| |@
__| |@
|____|@
@@
@
______ @
|____ | @
| | @
_____| |_@
/________/@
@@
@
____ @
|__ | @
| | @
____| | @
/____/\\_\\@
@@
@
______ @
|____ |@
_ | |@
| | |_|@
| | @
|_| @@
@
_____ @
|____ \\ @
| |@
____| |@
|_____/ @
@@
@
__ _ @
\\ \\ | |@
\\ \\| |@
__\\ \` |@
|______|@
@@
@
___ @
|_ |@
|_|@
$ @
$ @
@@
@
___ @
|_ |@
| |@
| |@
| |@
|_|@@
@
_______ @
|. __ |@
| | | |@
| | | |@
|_| |_|@
@@
_ @
| |____ @
|____ |@
/ / @
/ / @
/_/ @
@@
@
_______ @
|____ .|@
| | @
| | @
| | @
|_| @@
@
__ __.@
\\ \\ / / @
\\ V / @
___\\ \\ @
|______| @
@@
@
_______ @
|. __ |@
| | | |@
| | _| |@
|_||___|@
@@
@
________ @
|. ___ |@
| | | |@
| |___| |@
|_______|@
@@
@
_______ @
| ___ |@
\\_\\ | |@
_____| |@
|_______|@
@@
@
__@
/ /@
/ / @
/ / @
/_/ @
@@
@
______ @
|____ |@
| |@
| |@
|_|@
@@
@
_______ @
|____ |@
| | @
| | @
|_| @
@@
@
__ __@
\\ \\ / /@
| V / @
| |\\ \\ @
|_| \\_\\@
@@
@
___ @
|_ |@
| |@
| |@
|_|@
@@
@
_______ @
|_____ |@
_ | |@
| | | |@
|_| |_|@
@@
@
_ @
( )@
|/ @
$ @
$ @
@@
@
_______ @
|. __ |@
| | | |@
| |__/ |@
|_____/ @
@@
@
__ ___ @
|. | /_ |@
| | | |@
| |___| |@
|_______|@
@@
@
________ @
\\__ __\\@
| | @
| | @
|_| @
@@
@
__@
/ /@
| | @
< < @
| | @
\\_\\@@
@
_ @
| |@
| |@
| |@
| |@
|_|@@
@
__ @
\\ \\ @
| | @
> >@
| | @
/_/ @@
aleph = t | zayin = z | lamed = k | ayin = g | shin/sin = a@
bet/vet = c | chet = j | mem = n | pey/fey = p | taf/saf = ,@
gimmel = d | tet = y | final " = o | final " = ; | ,(comma) = '@
daled = s | yud = h | nun = b | tzaadi = m | .(period) = /@
hay = v | kaf/chaf = f | final " = i | final " = . | ; = \`@
vav = u | final " = l | samekh = x | kuf = e | / = q@
The asterisk (*) is a Star of David | resh = r | '(apost.) = w@@
@
_ _ @
(_)_(_)@
/_\\ @
/ _ \\ @
/_/ \\_\\@
@@
@
_ _ @
(_)_(_)@
/ _ \\ @
| |_| |@
\\___/ @
@@
@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\\___/ @
@@
@
_ _ @
(_)_(_)@
/ _\` |@
| (_| |@
\\__,_|@
@@
@
_ _ @
(_)_(_)@
/ _ \\ @
| (_) |@
\\___/ @
@@
@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\\__,_|@
@@
@
___ @
/ _ \\@
| |/ /@
| |\\ \\@
| ||_/@
|_| @@
`
@@ -0,0 +1,604 @@
import { expect, expectTypeOf, test } from "vitest";
import { z } from "zod/v4";
test("basic catch", () => {
expect(z.string().catch("default").parse(undefined)).toBe("default");
});
test("catch fn does not run when parsing succeeds", () => {
let isCalled = false;
const cb = () => {
isCalled = true;
return "asdf";
};
expect(z.string().catch(cb).parse("test")).toBe("test");
expect(isCalled).toEqual(false);
});
test("basic catch async", async () => {
const result = await z.string().catch("default").parseAsync(1243);
expect(result).toBe("default");
});
test("catch replace wrong types", () => {
expect(z.string().catch("default").parse(true)).toBe("default");
expect(z.string().catch("default").parse(true)).toBe("default");
expect(z.string().catch("default").parse(15)).toBe("default");
expect(z.string().catch("default").parse([])).toBe("default");
expect(z.string().catch("default").parse(new Map())).toBe("default");
expect(z.string().catch("default").parse(new Set())).toBe("default");
expect(z.string().catch("default").parse({})).toBe("default");
});
test("catch with transform", () => {
const stringWithDefault = z
.string()
.transform((val) => val.toUpperCase())
.catch("default");
expect(stringWithDefault.parse(undefined)).toBe("default");
expect(stringWithDefault.parse(15)).toBe("default");
expect(stringWithDefault).toBeInstanceOf(z.ZodCatch);
expect(stringWithDefault.unwrap()).toBeInstanceOf(z.ZodPipe);
expect(stringWithDefault.unwrap().in).toBeInstanceOf(z.ZodString);
expect(stringWithDefault.unwrap().out).toBeInstanceOf(z.ZodTransform);
type inp = z.input<typeof stringWithDefault>;
expectTypeOf<inp>().toEqualTypeOf<string>();
type out = z.output<typeof stringWithDefault>;
expectTypeOf<out>().toEqualTypeOf<string>();
});
test("catch on existing optional", () => {
const stringWithDefault = z.string().optional().catch("asdf");
expect(stringWithDefault.parse(undefined)).toBe(undefined);
expect(stringWithDefault.parse(15)).toBe("asdf");
expect(stringWithDefault).toBeInstanceOf(z.ZodCatch);
expect(stringWithDefault.unwrap()).toBeInstanceOf(z.ZodOptional);
expect(stringWithDefault.unwrap().unwrap()).toBeInstanceOf(z.ZodString);
type inp = z.input<typeof stringWithDefault>;
expectTypeOf<inp>().toEqualTypeOf<string | undefined>();
type out = z.output<typeof stringWithDefault>;
expectTypeOf<out>().toEqualTypeOf<string | undefined>();
});
test("optional on catch", () => {
const stringWithDefault = z.string().catch("asdf").optional();
type inp = z.input<typeof stringWithDefault>;
expectTypeOf<inp>().toEqualTypeOf<string | undefined>();
type out = z.output<typeof stringWithDefault>;
expectTypeOf<out>().toEqualTypeOf<string | undefined>();
});
test("complex chain example", () => {
const complex = z
.string()
.catch("asdf")
.transform((val) => `${val}!`)
.transform((val) => val.toUpperCase())
.catch("qwer")
.unwrap()
.optional()
.catch("asdfasdf");
expect(complex.parse("qwer")).toBe("QWER!");
expect(complex.parse(15)).toBe("ASDF!");
expect(complex.parse(true)).toBe("ASDF!");
});
test("removeCatch", () => {
const stringWithRemovedDefault = z.string().catch("asdf").unwrap();
type out = z.output<typeof stringWithRemovedDefault>;
expectTypeOf<out>().toEqualTypeOf<string>();
});
test("nested", () => {
const inner = z.string().catch("asdf");
const outer = z.object({ inner }).catch({
inner: "asdf",
});
type input = z.input<typeof outer>;
expectTypeOf<input>().toEqualTypeOf<{ inner: string }>();
type out = z.output<typeof outer>;
expectTypeOf<out>().toEqualTypeOf<{ inner: string }>();
expect(outer.parse(undefined)).toEqual({ inner: "asdf" });
expect(outer.parse({})).toEqual({ inner: "asdf" });
expect(outer.parse({ inner: undefined })).toEqual({ inner: "asdf" });
});
test("chained catch", () => {
const stringWithDefault = z.string().catch("inner").catch("outer");
const result = stringWithDefault.parse(undefined);
expect(result).toEqual("inner");
const resultDiff = stringWithDefault.parse(5);
expect(resultDiff).toEqual("inner");
});
test("native enum", () => {
enum Fruits {
apple = "apple",
orange = "orange",
}
const schema = z.object({
fruit: z.nativeEnum(Fruits).catch(Fruits.apple),
});
// Absent keys flow through to the catch handler.
expect(schema.parse({})).toEqual({ fruit: Fruits.apple });
expect(schema.parse({}, { jitless: true })).toEqual({ fruit: Fruits.apple });
expect(schema.parse({ fruit: 15 })).toEqual({ fruit: Fruits.apple });
});
test("enum", () => {
const schema = z.object({
fruit: z.enum(["apple", "orange"]).catch("apple"),
});
expect(schema.parse({})).toEqual({ fruit: "apple" });
expect(schema.parse({}, { jitless: true })).toEqual({ fruit: "apple" });
expect(schema.parse({ fruit: true })).toEqual({ fruit: "apple" });
expect(schema.parse({ fruit: 15 })).toEqual({ fruit: "apple" });
});
test("reported issues with nested usage", () => {
const schema = z.object({
string: z.string(),
obj: z.object({
sub: z.object({
lit: z.literal("a"),
subCatch: z.number().catch(23),
}),
midCatch: z.number().catch(42),
}),
number: z.number().catch(0),
bool: z.boolean(),
});
try {
schema.parse({
string: {},
obj: {
sub: {
lit: "b",
subCatch: "24",
},
midCatch: 444,
},
number: "",
bool: "yes",
});
} catch (error) {
const issues = (error as z.ZodError).issues;
expect(issues.length).toEqual(3);
expect(issues).toMatchInlineSnapshot(`
[
{
"code": "invalid_type",
"expected": "string",
"message": "Invalid input: expected string, received object",
"path": [
"string",
],
},
{
"code": "invalid_value",
"message": "Invalid input: expected "a"",
"path": [
"obj",
"sub",
"lit",
],
"values": [
"a",
],
},
{
"code": "invalid_type",
"expected": "boolean",
"message": "Invalid input: expected boolean, received string",
"path": [
"bool",
],
},
]
`);
// expect(issues[0].message).toMatch("string");
// expect(issues[1].message).toMatch("literal");
// expect(issues[2].message).toMatch("boolean");
}
});
test("catch error", () => {
const schema = z.object({
age: z.number(),
name: z.string().catch((ctx) => {
ctx.issues;
// issues = ctx.issues;
return "John Doe";
}),
});
const result = schema.safeParse({
age: null,
name: null,
});
expect(result.success).toEqual(false);
expect(result.error!).toMatchInlineSnapshot(`
[ZodError: [
{
"expected": "number",
"code": "invalid_type",
"path": [
"age"
],
"message": "Invalid input: expected number, received null"
}
]]
`);
});
test("ctx.input", () => {
const schema = z.string().catch((ctx) => {
return String(ctx.input);
});
expect(schema.parse(123)).toEqual("123");
});
test("ctx.value is the input to the catch, not what the inner schema made of it", async () => {
const seen: unknown[] = [];
const cb = (ctx: z.core.$ZodCatchCtx) => {
seen.push(ctx.value, ctx.input);
return -1;
};
expect(z.coerce.number().min(10).catch(cb).parse("5")).toBe(-1);
expect(
await z.coerce
.number()
.refine(async (n) => n >= 10)
.catch(cb)
.parseAsync("6")
).toBe(-1);
expect(
z
.string()
.transform((s) => s.length)
.refine((n) => n > 10)
.catch(cb)
.parse("abc")
).toBe(-1);
expect(seen).toEqual(["5", "5", "6", "6", "abc", "abc"]);
});
test("ctx.issues outlives the callback", () => {
let stashed!: z.core.$ZodRawIssue[];
z.string()
.min(10)
.catch((ctx) => {
stashed = ctx.issues;
return "fallback";
})
.parse("hi");
expect(stashed).toHaveLength(1);
expect(stashed[0].code).toBe("too_small");
});
test("catch ctx carries the rest of the payload through", () => {
let seen!: z.core.$ZodCatchCtx;
z.string()
.min(10)
.pipe(z.string())
.catch((ctx) => {
seen = ctx;
return "fallback";
})
.parse("hi");
expect(seen.aborted).toBe(true);
});
test("catch does not swallow an issue it did not cause", () => {
// A pipe hands its `out` schema the caller's issues array so an unrecognized key can survive to an enclosing intersection. The catch must not read that as its own inner failing.
const result = z.strictObject({ a: z.string() }).pipe(z.any().catch("CAUGHT")).safeParse({ a: "x", extra: 1 });
expect(result.success).toBe(false);
expect(result.error!.issues.map((i) => i.code)).toEqual(["unrecognized_keys"]);
});
test("catch does not break intersection reconciliation", () => {
// Forwarding the unrecognized key is what lets the intersection reconcile it. A catch that fired on it substituted its fallback into one side, and the merge threw out of safeParse.
const schema = z.intersection(
z.strictObject({ a: z.string() }).pipe(z.any().catch("CAUGHT")),
z.strictObject({ b: z.string() })
);
expect(schema.parse({ a: "x", b: "y" })).toEqual({ a: "x", b: "y" });
});
test("catch propagates a back-edge to whatever wraps it", () => {
// The memoizer marks a payload whose value is a node still being parsed. That mark has to survive the catch: an enclosing readonly must not freeze a half-built object, and the node's checks belong to the node itself rather than to the back-edge.
const Node: any = z.object({
get self() {
return z
.lazy(() => Node)
.catch(null)
.readonly()
.optional();
},
});
const cyclic: any = {};
cyclic.self = cyclic;
const frozen = Node.safeParse(cyclic);
expect(frozen.success).toBe(true);
expect(Object.keys(frozen.data)).toEqual(["self"]);
let checks = 0;
const Checked: any = z.object({
get self() {
return z
.lazy(() => Checked)
.catch(null)
.refine(() => {
checks++;
return true;
})
.optional();
},
});
const cyclic2: any = {};
cyclic2.self = cyclic2;
Checked.safeParse(cyclic2);
expect(checks).toBe(0);
});
test("a catch that fires does not rescue an issue from outside it", () => {
// The callback still runs and still computes its fallback — the inner schema really did fail. What it cannot do is answer for the unrecognized key the pipe forwarded past it, so the parse fails anyway.
let fired = 0;
const result = z
.strictObject({ a: z.string() })
.pipe(
z
.object({ a: z.string() })
.refine(() => false)
.catch(() => {
fired++;
return { a: "FALLBACK" };
})
)
.safeParse({ a: "x", extra: 1 });
expect(fired).toBe(1);
expect(result.success).toBe(false);
expect(result.error!.issues.map((i) => i.code)).toEqual(["unrecognized_keys"]);
});
test("direction-aware catch", () => {
const schema = z.string().catch("fallback");
// Forward direction (regular parse): catch should be applied
expect(schema.parse(123)).toBe("fallback");
// Reverse direction (encode): catch should NOT be applied, invalid value should fail validation
expect(z.safeEncode(schema, 123 as any)).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received number"
}
]],
"success": false,
}
`);
// But valid values should still work in reverse
expect(z.encode(schema, "world")).toBe("world");
});
test("optional clobbers catch through pipe boundaries", () => {
expect(
z
.string()
.catch("X")
.transform((s) => s + "!")
.optional()
.parse(undefined)
).toBeUndefined();
expect(z.string().catch("X").pipe(z.string()).optional().parse(undefined)).toBeUndefined();
expect(
z
.string()
.catch("X")
.transform((s) => s + "!")
.transform((s) => s.toLowerCase())
.optional()
.parse(undefined)
).toBeUndefined();
expect(
z
.object({
a: z
.string()
.catch("X")
.transform((s) => s + "!")
.optional(),
})
.parse({})
).toEqual({});
expect(
z
.string()
.catch("X")
.transform((s) => s + "!")
.parse("hi")
).toBe("hi!");
expect(
z
.string()
.catch("X")
.transform((s) => s + "!")
.parse(123)
).toBe("X!");
});
test("catch does not resurrect issues an inner optional already resolved", () => {
// `.catch()` reads issues off the payload it passed down, so an optional that resolved a failure without clearing that array let the failure resurface. The pipe rows matter: a pipe shares the array with a different payload object.
const chains: [string, () => z.ZodType][] = [
[
"prefault.optional",
() =>
z
.undefined()
.prefault(null as any)
.optional(),
],
[
"default.optional",
() =>
z
.undefined()
.default(null as any)
.optional(),
],
["prefault.pipe.optional", () => z.string().prefault("abc").pipe(z.string().min(10)).optional()],
["default.pipe.optional", () => z.string().default("abc").pipe(z.string().min(10)).optional()],
[
"prefault.optional.optional",
() =>
z
.undefined()
.prefault(null as any)
.optional()
.optional(),
],
[
"prefault.pipe.optional.optional",
() => z.string().prefault("abc").pipe(z.string().min(10)).optional().optional(),
],
];
for (const [name, make] of chains) {
expect(make().safeParse(undefined).success, `${name} without catch`).toBe(true);
expect((make() as any).catch(null).safeParse(undefined).success, `${name} + catch(value)`).toBe(true);
expect((make() as any).catch(() => null).safeParse(undefined).success, `${name} + catch(callback)`).toBe(true);
}
expect(
z
.object({
a: z
.undefined()
.prefault(null as any)
.optional()
.catch(null as any),
})
.safeParse({ a: undefined }).success
).toBe(true);
expect(z.string().catch("FB").parse(123)).toBe("FB");
expect(z.string().optional().safeParse(123).success).toBe(false);
});
test("resolving an optional's failure clears the abort flag with it", () => {
// A pipe marks the payload aborted when its `in` fails, and `util.aborted` tests that flag alone, so leaving it set skips every check after the optional.
const schema = z
.string()
.min(10)
.prefault("abc")
.pipe(z.string())
.optional()
.refine(() => false, "REFINE RAN");
const result = schema.safeParse(undefined);
expect(result.success).toBe(false);
expect(result.error!.issues[0]?.message).toBe("REFINE RAN");
});
test("catch clears the abort flag along with the issues", () => {
// Same as the optional case one wrapper over: a catch that clears only the issues leaves the flag set, skipping every check after it.
const schema = z
.string()
.min(10)
.pipe(z.string())
.catch("FB")
.refine(() => false, "REFINE RAN");
const result = schema.safeParse("abc");
expect(result.success).toBe(false);
expect(result.error!.issues[0]?.message).toBe("REFINE RAN");
expect(
z
.string()
.min(2)
.pipe(z.string())
.catch("FB")
.refine(() => false, "REFINE RAN")
.safeParse("abcdef").success
).toBe(false);
expect(
z
.string()
.min(10)
.catch("FB")
.refine(() => false, "REFINE RAN")
.safeParse("abc").success
).toBe(false);
});
test("catch clears the abort flag on the async branch too", () => {
// Reaching the async branch needs the catch's own inner to be async; an async refinement outside it leaves the inner sync.
const schema = z
.string()
.refine(async () => false, "INNER")
.pipe(z.string())
.catch("FB")
.refine(() => false, "REFINE RAN");
return expect(schema.safeParseAsync("abc")).resolves.toMatchObject({
success: false,
error: { issues: [{ message: "REFINE RAN" }] },
});
});
test("catch resolves the issues array itself, so an outer catch does not resurrect them", () => {
// A pipe runs its `out` on a payload sharing the caller's issues array, so a catch that rebinds its own reference leaves the caller's copy dirty.
const inner = z.string().pipe(z.string().min(10).catch("FB"));
expect(inner.safeParse("abc")).toMatchObject({ success: true, data: "FB" });
expect(inner.catch("FB2").safeParse("abc")).toMatchObject({ success: true, data: "FB" });
expect(z.string().catch("FB").parse(123)).toBe("FB");
expect(z.string().catch("FB").parse("ok")).toBe("ok");
expect(
z
.string()
.catch((ctx) => `n=${ctx.error.issues.length}`)
.parse(123)
).toBe("n=1");
});
test("catch resolves the issues array on the async branch too", () => {
const inner = z.string().pipe(
z
.string()
.refine(async () => false, "INNER")
.catch("FB")
);
return expect(inner.catch("FB2").safeParseAsync("abc")).resolves.toMatchObject({ success: true, data: "FB" });
});
@@ -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 Scissors = createLucideIcon("Scissors", [
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
]);
export { Scissors as default };
//# sourceMappingURL=scissors.js.map
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClassScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class ClassScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.class, upperScope, block, false);
}
}
exports.ClassScope = ClassScope;
@@ -0,0 +1 @@
{"version":3,"file":"is-none.mjs","sources":["../../../../../src/animation/keyframes/utils/is-none.ts"],"sourcesContent":["import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,MAAM,CAAC,KAAiC,EAAA;AACpD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,KAAK,CAAC;IACtB;AAAO,SAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC;IACxE;SAAO;AACH,QAAA,OAAO,IAAI;IACf;AACJ;;;;"}
@@ -0,0 +1,7 @@
import * as core from "../core/index.js";
import { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime } from "./schemas.js";
export { ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime } from "./schemas.js";
export declare function datetime(params?: string | core.$ZodISODateTimeParams): ZodISODateTime;
export declare function date(params?: string | core.$ZodISODateParams): ZodISODate;
export declare function time(params?: string | core.$ZodISOTimeParams): ZodISOTime;
export declare function duration(params?: string | core.$ZodISODurationParams): ZodISODuration;
@@ -0,0 +1,144 @@
import { serialize } from "../utils/cookie.js";
import { buildSearchParams, deepMerge, mergePath, removeIndexString, replaceUrlParam, replaceUrlProtocol } from "./utils.js";
//#region src/client/client.ts
const createProxy = (callback, path) => {
return new Proxy(() => {}, {
get(_obj, key) {
if (typeof key !== "string" || key === "then") return;
return createProxy(callback, [...path, key]);
},
apply(_1, _2, args) {
return callback({
path,
args
});
}
});
};
const appendQueryParams = (url, searchParams) => {
const queryString = searchParams.toString();
return queryString ? `${url}?${queryString}` : url;
};
var ClientRequestImpl = class {
url;
method;
buildSearchParams;
queryParams = void 0;
pathParams = {};
rBody;
cType = void 0;
constructor(url, method, options) {
this.url = url;
this.method = method;
this.buildSearchParams = options.buildSearchParams;
}
fetch = async (args, opt) => {
if (args) {
if (args.query) this.queryParams = this.buildSearchParams(args.query);
if (args.form) {
const form = new FormData();
for (const [k, v] of Object.entries(args.form)) {
if (v === void 0) continue;
if (Array.isArray(v)) for (const v2 of v) {
if (v2 === void 0) continue;
form.append(k, v2);
}
else form.append(k, v);
}
this.rBody = form;
}
if (args.json !== void 0) {
this.rBody = JSON.stringify(args.json);
this.cType = "application/json";
}
if (args.param) this.pathParams = args.param;
}
let methodUpperCase = this.method.toUpperCase();
const headerValues = {
...args?.header,
...typeof opt?.headers === "function" ? await opt.headers() : opt?.headers
};
if (args?.cookie) {
const cookies = [];
for (const [key, value] of Object.entries(args.cookie)) {
if (value === void 0) continue;
cookies.push(serialize(key, value));
}
if (cookies.length > 0) headerValues["Cookie"] = cookies.join("; ");
}
if (this.cType) headerValues["Content-Type"] = this.cType;
const headers = new Headers();
for (const [key, value] of Object.entries(headerValues)) if (value !== void 0) headers.set(key, value);
let url = this.url;
url = removeIndexString(url);
url = replaceUrlParam(url, this.pathParams);
if (this.queryParams) url = appendQueryParams(url, this.queryParams);
methodUpperCase = this.method.toUpperCase();
const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD");
return (opt?.fetch || fetch)(url, {
body: setBody ? this.rBody : void 0,
method: methodUpperCase,
headers,
...opt?.init
});
};
};
const hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
const buildSearchParamsOption = options?.buildSearchParams ?? buildSearchParams;
const parts = [...opts.path];
const lastParts = parts.slice(-3).reverse();
if (lastParts[0] === "toString") {
if (lastParts[1] === "name") return lastParts[2] || "";
return proxyCallback.toString();
}
if (lastParts[0] === "valueOf") {
if (lastParts[1] === "name") return lastParts[2] || "";
return proxyCallback;
}
let method = "";
if (/^\$/.test(lastParts[0])) {
const last = parts.pop();
if (last) method = last.replace(/^\$/, "");
}
const path = parts.join("/");
const url = mergePath(baseUrl, path);
if (method === "url" || method === "path") {
let result = removeIndexString(url);
if (opts.args[0]) {
if (opts.args[0].param) result = replaceUrlParam(result, opts.args[0].param);
if (opts.args[0].query) result = appendQueryParams(result, buildSearchParamsOption(opts.args[0].query));
}
if (method === "url") return new URL(result);
return result.slice(baseUrl.replace(/\/+$/, "").length).replace(/^\/?/, "/");
}
if (method === "ws") {
const normalizedUrl = removeIndexString(url);
const webSocketUrl = replaceUrlProtocol(opts.args[0]?.param ? replaceUrlParam(normalizedUrl, opts.args[0].param) : normalizedUrl, "ws");
const targetUrl = new URL(webSocketUrl);
const queryParams = opts.args[0]?.query;
if (queryParams) buildSearchParamsOption(queryParams).forEach((value, key) => {
targetUrl.searchParams.append(key, value);
});
const establishWebSocket = (...args) => {
if (options?.webSocket !== void 0 && typeof options.webSocket === "function") return options.webSocket(...args);
return new WebSocket(...args);
};
return establishWebSocket(targetUrl.toString());
}
const req = new ClientRequestImpl(url, method, { buildSearchParams: buildSearchParamsOption });
if (method) {
options ??= {};
const reqOptions = { ...opts.args[1] };
const baseHeaders = options.headers;
const reqHeaders = reqOptions.headers;
if (baseHeaders && reqHeaders) reqOptions.headers = async () => ({
...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders,
...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders
});
const args = deepMerge(options, reqOptions);
return req.fetch(opts.args[0], args);
}
return req;
}, []);
//#endregion
export { hc };
@@ -0,0 +1,65 @@
import { FromPathOption, NavigateOptions, PathParamOptions, SearchParamOptions, ToPathOption } from './link.js';
import { RedirectOptions } from './redirect.js';
import { RouteIds } from './routeInfo.js';
import { AnyRouter, RegisteredRouter } from './router.js';
import { UseParamsResult } from './useParams.js';
import { UseSearchResult } from './useSearch.js';
import { Constrain, ConstrainLiteral } from './utils.js';
export type ValidateFromPath<TRouter extends AnyRouter = RegisteredRouter, TFrom = string> = FromPathOption<TRouter, TFrom>;
export type ValidateToPath<TRouter extends AnyRouter = RegisteredRouter, TTo extends string | undefined = undefined, TFrom extends string = string> = ToPathOption<TRouter, TFrom, TTo>;
export type ValidateSearch<TRouter extends AnyRouter = RegisteredRouter, TTo extends string | undefined = undefined, TFrom extends string = string> = SearchParamOptions<TRouter, TFrom, TTo>;
export type ValidateParams<TRouter extends AnyRouter = RegisteredRouter, TTo extends string | undefined = undefined, TFrom extends string = string> = PathParamOptions<TRouter, TFrom, TTo>;
/**
* @private
*/
export type InferFrom<TOptions, TDefaultFrom extends string = string> = TOptions extends {
from: infer TFrom extends string;
} ? TFrom : TDefaultFrom;
/**
* @private
*/
export type InferTo<TOptions> = TOptions extends {
to: infer TTo extends string;
} ? TTo : undefined;
/**
* @private
*/
export type InferMaskTo<TOptions> = TOptions extends {
mask: {
to: infer TTo extends string;
};
} ? TTo : '';
export type InferMaskFrom<TOptions> = TOptions extends {
mask: {
from: infer TFrom extends string;
};
} ? TFrom : string;
export type ValidateNavigateOptions<TRouter extends AnyRouter = RegisteredRouter, TOptions = unknown, TDefaultFrom extends string = string> = Constrain<TOptions, NavigateOptions<TRouter, InferFrom<TOptions, TDefaultFrom>, InferTo<TOptions>, InferMaskFrom<TOptions>, InferMaskTo<TOptions>>>;
export type ValidateNavigateOptionsArray<TRouter extends AnyRouter = RegisteredRouter, TOptions extends ReadonlyArray<any> = ReadonlyArray<unknown>, TDefaultFrom extends string = string> = {
[K in keyof TOptions]: ValidateNavigateOptions<TRouter, TOptions[K], TDefaultFrom>;
};
export type ValidateRedirectOptions<TRouter extends AnyRouter = RegisteredRouter, TOptions = unknown, TDefaultFrom extends string = string> = Constrain<TOptions, RedirectOptions<TRouter, InferFrom<TOptions, TDefaultFrom>, InferTo<TOptions>, InferMaskFrom<TOptions>, InferMaskTo<TOptions>>>;
export type ValidateRedirectOptionsArray<TRouter extends AnyRouter = RegisteredRouter, TOptions extends ReadonlyArray<any> = ReadonlyArray<unknown>, TDefaultFrom extends string = string> = {
[K in keyof TOptions]: ValidateRedirectOptions<TRouter, TOptions[K], TDefaultFrom>;
};
export type ValidateId<TRouter extends AnyRouter = RegisteredRouter, TId extends string = string> = ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>;
/**
* @private
*/
export type InferStrict<TOptions> = TOptions extends {
strict: infer TStrict extends boolean;
} ? TStrict : true;
/**
* @private
*/
export type InferShouldThrow<TOptions> = TOptions extends {
shouldThrow: infer TShouldThrow extends boolean;
} ? TShouldThrow : true;
/**
* @private
*/
export type InferSelected<TOptions> = TOptions extends {
select: (...args: Array<any>) => infer TSelected;
} ? TSelected : unknown;
export type ValidateUseSearchResult<TOptions, TRouter extends AnyRouter = RegisteredRouter> = UseSearchResult<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferSelected<TOptions>>;
export type ValidateUseParamsResult<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseParamsResult<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferSelected<TOptions>>>;
@@ -0,0 +1,78 @@
import { H as HoistMocksOptions } from './hoistMocks.d-w2ILr1dG.js';
export { c as createManualModuleSource } from './hoistMocks.d-w2ILr1dG.js';
import { AutomockOptions } from './automock.js';
export { automockModule } from './automock.js';
import { Plugin, Rollup, ViteDevServer } from 'vite';
import { SourceMap } from 'magic-string';
import { M as MockerRegistry, S as ServerMockResolution, f as ServerIdResolution } from './types.d-BjI5eAwu.js';
export { findMockRedirect } from './redirect.js';
declare function automockPlugin(options?: AutomockOptions): Plugin;
interface DynamicImportPluginOptions {
/**
* @default `"__vitest_mocker__"`
*/
globalThisAccessor?: string;
filter?: (id: string) => boolean;
}
declare function dynamicImportPlugin(options?: DynamicImportPluginOptions): Plugin;
interface HoistMocksPluginOptions extends Omit<HoistMocksOptions, "regexpHoistable"> {
include?: string | RegExp | (string | RegExp)[];
exclude?: string | RegExp | (string | RegExp)[];
/**
* overrides include/exclude options
*/
filter?: (id: string) => boolean;
}
declare function hoistMocksPlugin(options?: HoistMocksPluginOptions): Plugin;
declare function hoistMockAndResolve(code: string, id: string, parse: Rollup.PluginContext["parse"], options?: HoistMocksOptions): HoistMocksResult | undefined;
interface HoistMocksResult {
code: string;
map: SourceMap;
}
interface InterceptorPluginOptions {
/**
* @default "__vitest_mocker__"
*/
globalThisAccessor?: string;
registry?: MockerRegistry;
/**
* Register the `vitest:interceptor:*` WebSocket events in `configureServer`.
* Disable this when mocks are registered through another authenticated
* channel and the raw dev-server socket should not accept them.
* @default true
*/
registerWebSocketEvents?: boolean;
}
declare function interceptorPlugin(options?: InterceptorPluginOptions): Plugin;
interface MockerPluginOptions extends AutomockOptions {
hoistMocks?: HoistMocksPluginOptions;
}
declare function mockerPlugin(options?: MockerPluginOptions): Plugin[];
interface ServerResolverOptions {
/**
* @default ['/node_modules/']
*/
moduleDirectories?: string[];
}
declare class ServerMockResolver {
private server;
private options;
constructor(server: ViteDevServer, options?: ServerResolverOptions);
resolveMock(rawId: string, importer: string, options: {
mock: "spy" | "factory" | "auto";
}): Promise<ServerMockResolution>;
invalidate(ids: string[]): void;
resolveId(id: string, importer?: string): Promise<ServerIdResolution | null>;
private normalizeResolveIdToUrl;
private resolveMockId;
private resolveModule;
}
export { AutomockOptions as AutomockPluginOptions, ServerMockResolver, automockPlugin, dynamicImportPlugin, hoistMockAndResolve as hoistMocks, hoistMocksPlugin, interceptorPlugin, mockerPlugin };
export type { HoistMocksPluginOptions, HoistMocksResult, InterceptorPluginOptions, ServerResolverOptions };
@@ -0,0 +1,199 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-redeclare',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow variable redeclaration',
extendsBaseRule: true,
},
messages: {
redeclared: "'{{id}}' is already defined.",
redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.",
redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
builtinGlobals: {
type: 'boolean',
description: 'Whether to report shadowing of built-in global variables.',
},
ignoreDeclarationMerge: {
type: 'boolean',
description: 'Whether to ignore declaration merges between certain TypeScript declaration types.',
},
},
},
],
},
defaultOptions: [
{
builtinGlobals: true,
ignoreDeclarationMerge: true,
},
],
create(context, [options]) {
const CLASS_DECLARATION_MERGE_NODES = new Set([
utils_1.AST_NODE_TYPES.ClassDeclaration,
utils_1.AST_NODE_TYPES.TSInterfaceDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
]);
const FUNCTION_DECLARATION_MERGE_NODES = new Set([
utils_1.AST_NODE_TYPES.FunctionDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
]);
const ENUM_DECLARATION_MERGE_NODES = new Set([
utils_1.AST_NODE_TYPES.TSEnumDeclaration,
utils_1.AST_NODE_TYPES.TSModuleDeclaration,
]);
function* iterateDeclarations(variable) {
if (options.builtinGlobals &&
'eslintImplicitGlobalSetting' in variable &&
(variable.eslintImplicitGlobalSetting === 'readonly' ||
variable.eslintImplicitGlobalSetting === 'writable')) {
yield { type: 'builtin' };
}
if ('eslintExplicitGlobalComments' in variable &&
variable.eslintExplicitGlobalComments) {
for (const comment of variable.eslintExplicitGlobalComments) {
yield {
loc: (0, util_1.getNameLocationInGlobalDirectiveComment)(context.sourceCode, comment, variable.name),
node: comment,
type: 'comment',
};
}
}
const identifiers = variable.identifiers
.map(id => ({
identifier: id,
parent: id.parent,
}))
// ignore function declarations because TS will treat them as an overload
.filter(({ parent }) => parent.type !== utils_1.AST_NODE_TYPES.TSDeclareFunction);
if (options.ignoreDeclarationMerge && identifiers.length > 1) {
if (
// interfaces merging
identifiers.every(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration)) {
return;
}
if (
// namespace/module merging
identifiers.every(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration)) {
return;
}
if (
// class + interface/namespace merging
identifiers.every(({ parent }) => CLASS_DECLARATION_MERGE_NODES.has(parent.type))) {
const classDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration);
if (classDecls.length === 1) {
// safe declaration merging
return;
}
// there's more than one class declaration, which needs to be reported
for (const { identifier } of classDecls) {
yield { loc: identifier.loc, node: identifier, type: 'syntax' };
}
return;
}
if (
// class + interface/namespace merging
identifiers.every(({ parent }) => FUNCTION_DECLARATION_MERGE_NODES.has(parent.type))) {
const functionDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.FunctionDeclaration);
if (functionDecls.length === 1) {
// safe declaration merging
return;
}
// there's more than one function declaration, which needs to be reported
for (const { identifier } of functionDecls) {
yield { loc: identifier.loc, node: identifier, type: 'syntax' };
}
return;
}
if (
// enum + namespace merging
identifiers.every(({ parent }) => ENUM_DECLARATION_MERGE_NODES.has(parent.type))) {
const enumDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration);
if (enumDecls.length === 1) {
// safe declaration merging
return;
}
// there's more than one enum declaration, which needs to be reported
for (const { identifier } of enumDecls) {
yield { loc: identifier.loc, node: identifier, type: 'syntax' };
}
return;
}
}
for (const { identifier } of identifiers) {
yield { loc: identifier.loc, node: identifier, type: 'syntax' };
}
}
function findVariablesInScope(scope) {
for (const variable of scope.variables) {
const [declaration, ...extraDeclarations] = iterateDeclarations(variable);
if (extraDeclarations.length === 0) {
continue;
}
/*
* If the type of a declaration is different from the type of
* the first declaration, it shows the location of the first
* declaration.
*/
const detailMessageId = declaration.type === 'builtin'
? 'redeclaredAsBuiltin'
: 'redeclaredBySyntax';
const data = { id: variable.name };
// Report extra declarations.
for (const { loc, node, type } of extraDeclarations) {
const messageId = type === declaration.type ? 'redeclared' : detailMessageId;
if (node) {
context.report({ loc, node, messageId, data });
}
else if (loc) {
context.report({ loc, messageId, data });
}
}
}
}
/**
* Find variables in the current scope.
*/
function checkForBlock(node) {
const scope = context.sourceCode.getScope(node);
/*
* In ES5, some node type such as `BlockStatement` doesn't have that scope.
* `scope.block` is a different node in such a case.
*/
if (scope.block === node) {
findVariablesInScope(scope);
}
}
return {
ArrowFunctionExpression: checkForBlock,
BlockStatement: checkForBlock,
ForInStatement: checkForBlock,
ForOfStatement: checkForBlock,
ForStatement: checkForBlock,
FunctionDeclaration: checkForBlock,
FunctionExpression: checkForBlock,
Program(node) {
const scope = context.sourceCode.getScope(node);
findVariablesInScope(scope);
// Node.js or ES modules has a special scope.
if (scope.type === scope_manager_1.ScopeType.global &&
// The special scope's block is the Program node.
scope.block === scope.childScopes[0]?.block) {
findVariablesInScope(scope.childScopes[0]);
}
},
SwitchStatement: checkForBlock,
};
},
});
@@ -0,0 +1,11 @@
//#region src/ssr/ssr-match-id.ts
function dehydrateSsrMatchId(id) {
return id.replaceAll("/", "\0");
}
function hydrateSsrMatchId(id) {
return id.replaceAll("\0", "/").replaceAll("�", "/");
}
//#endregion
export { dehydrateSsrMatchId, hydrateSsrMatchId };
//# sourceMappingURL=ssr-match-id.js.map
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0;
const codegen_1 = require("../../compile/codegen");
function typeError(t) {
return {
message: (cxt) => typeErrorMessage(cxt, t),
params: (cxt) => typeErrorParams(cxt, t),
};
}
exports.typeError = typeError;
function typeErrorMessage({ parentSchema }, t) {
return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`;
}
exports.typeErrorMessage = typeErrorMessage;
function typeErrorParams({ parentSchema }, t) {
return (0, codegen_1._) `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`;
}
exports.typeErrorParams = typeErrorParams;
//# sourceMappingURL=error.js.map
@@ -0,0 +1,9 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { ScopeManager } from '../ScopeManager';
import type { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
export declare class FunctionExpressionNameScope extends ScopeBase<ScopeType.functionExpressionName, TSESTree.FunctionExpression, Scope> {
readonly functionExpressionScope: true;
constructor(scopeManager: ScopeManager, upperScope: FunctionExpressionNameScope['upper'], block: FunctionExpressionNameScope['block']);
}
@@ -0,0 +1,110 @@
import { resolveElements, getValueTransition, getAnimationMap, animationMapKey, getComputedStyle, fillWildcards, applyPxDefaults, NativeAnimation } from 'motion-dom';
import { invariant, secondsToMilliseconds } from 'motion-utils';
function animateElements(elementOrSelector, keyframes, options, scope) {
// Gracefully handle null/undefined elements (e.g., from querySelector returning null)
if (elementOrSelector == null) {
return [];
}
const elements = resolveElements(elementOrSelector, scope);
const numElements = elements.length;
invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements");
/**
* WAAPI doesn't support interrupting animations.
*
* Therefore, starting animations requires a three-step process:
* 1. Stop existing animations (write styles to DOM)
* 2. Resolve keyframes (read styles from DOM)
* 3. Create new animations (write styles to DOM)
*
* The hybrid `animate()` function uses AsyncAnimation to resolve
* keyframes before creating new animations, which removes style
* thrashing. Here, we have much stricter filesize constraints.
* Therefore we do this in a synchronous way that ensures that
* at least within `animate()` calls there is no style thrashing.
*
* In the motion-native-animate-mini-interrupt benchmark this
* was 80% faster than a single loop.
*/
const animationDefinitions = [];
/**
* Step 1: Build options and stop existing animations (write)
*/
for (let i = 0; i < numElements; i++) {
const element = elements[i];
const elementTransition = { ...options };
/**
* Resolve stagger function if provided.
*/
if (typeof elementTransition.delay === "function") {
elementTransition.delay = elementTransition.delay(i, numElements);
}
for (const valueName in keyframes) {
let valueKeyframes = keyframes[valueName];
if (!Array.isArray(valueKeyframes)) {
valueKeyframes = [valueKeyframes];
}
const valueOptions = {
...getValueTransition(elementTransition, valueName),
};
valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));
valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));
/**
* If there's an existing animation playing on this element then stop it
* before creating a new one.
*/
const map = getAnimationMap(element);
const key = animationMapKey(valueName, valueOptions.pseudoElement || "");
const currentAnimation = map.get(key);
currentAnimation && currentAnimation.stop();
animationDefinitions.push({
map,
key,
unresolvedKeyframes: valueKeyframes,
options: {
...valueOptions,
element,
name: valueName,
allowFlatten: !elementTransition.type && !elementTransition.ease,
},
});
}
}
/**
* Step 2: Resolve keyframes (read)
*/
for (let i = 0; i < animationDefinitions.length; i++) {
const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i];
const { element, name, pseudoElement } = animationOptions;
if (!pseudoElement && unresolvedKeyframes[0] === null) {
unresolvedKeyframes[0] = getComputedStyle(element, name);
}
fillWildcards(unresolvedKeyframes);
applyPxDefaults(unresolvedKeyframes, name);
/**
* If we only have one keyframe, explicitly read the initial keyframe
* from the computed style. This is to ensure consistency with WAAPI behaviour
* for restarting animations, for instance .play() after finish, when it
* has one vs two keyframes.
*/
if (!pseudoElement && unresolvedKeyframes.length < 2) {
unresolvedKeyframes.unshift(getComputedStyle(element, name));
}
animationOptions.keyframes = unresolvedKeyframes;
}
/**
* Step 3: Create new animations (write)
*/
const animations = [];
for (let i = 0; i < animationDefinitions.length; i++) {
const { map, key, options: animationOptions } = animationDefinitions[i];
const animation = new NativeAnimation(animationOptions);
map.set(key, animation);
animation.finished.finally(() => map.delete(key));
animations.push(animation);
}
return animations;
}
export { animateElements };
//# sourceMappingURL=animate-elements.mjs.map
@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-import-type-side-effects',
meta: {
type: 'problem',
docs: {
description: 'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers',
},
fixable: 'code',
messages: {
useTopLevelQualifier: 'TypeScript will only remove the inline type specifiers which will leave behind a side effect import at runtime. Convert this to a top-level type qualifier to properly remove the entire import.',
},
schema: [],
},
defaultOptions: [],
create(context) {
return {
'ImportDeclaration[importKind!="type"]'(node) {
if (node.specifiers.length === 0) {
return;
}
const specifiers = [];
for (const specifier of node.specifiers) {
if (specifier.type !== utils_1.AST_NODE_TYPES.ImportSpecifier ||
specifier.importKind !== 'type') {
return;
}
specifiers.push(specifier);
}
context.report({
node,
messageId: 'useTopLevelQualifier',
fix(fixer) {
const fixes = [];
for (const specifier of specifiers) {
const qualifier = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(specifier, util_1.isTypeKeyword), util_1.NullThrowsReasons.MissingToken('type keyword', 'import specifier'));
fixes.push(fixer.removeRange([
qualifier.range[0],
specifier.imported.range[0],
]));
}
const importKeyword = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isImportKeyword), util_1.NullThrowsReasons.MissingToken('import keyword', 'import'));
fixes.push(fixer.insertTextAfter(importKeyword, ' type'));
return fixes;
},
});
},
};
},
});
@@ -0,0 +1 @@
module.exports={C:{"115":0.01206,"120":0.15075,"121":0.25929,"140":0.01206,"146":0.01206,"148":0.00603,"150":0.09648,"151":0.17487,"154":0.04824,"155":0.21105,"156":0.18693,"157":0.01206,"158":0.00603,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 141 142 143 144 145 147 149 152 153 159 160 3.5","3.6":0.00603},D:{"55":0.00603,"76":0.00603,"79":0.00603,"88":0.00603,"89":0.04221,"91":0.00603,"92":0.00603,"101":0.01809,"103":0.49446,"104":0.45828,"105":0.47637,"106":0.51255,"107":0.39798,"108":0.4221,"109":0.75375,"110":0.45828,"111":0.44622,"112":0.44622,"114":0.02412,"116":0.89847,"117":0.54873,"118":0.47034,"119":0.33768,"120":0.78993,"123":0.01206,"124":0.39195,"126":0.09648,"127":0.00603,"128":0.00603,"131":0.89244,"132":0.05427,"133":1.00701,"134":0.12663,"135":0.15075,"136":0.12663,"137":0.12663,"138":0.13266,"139":0.12663,"140":0.15075,"141":0.14472,"142":0.51255,"143":0.22914,"144":0.24723,"145":0.34371,"146":0.02412,"147":0.01809,"148":0.45225,"149":0.62109,"150":3.0753,"151":6.88626,"152":11.28816,"153":5.20389,"154":1.58589,"156":0.02412,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 77 78 80 81 83 84 85 86 87 90 93 94 95 96 97 98 99 100 102 113 115 121 122 125 129 130 155 157"},F:{"95":0.01809,"101":0.01206,"102":0.01206,"134":0.03618,"135":0.45225,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 133 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.01206,"109":0.01206,"119":0.16884,"120":0.15075,"129":0.00603,"133":0.01809,"136":0.00603,"143":0.00603,"145":0.04824,"146":0.00603,"147":0.00603,"148":0.01206,"149":0.03618,"150":0.10854,"151":0.25326,"152":1.53162,"153":3.82302,"154":0.41607,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 122 123 124 125 126 127 128 130 131 132 134 135 137 138 139 140 141 142 144"},E:{"27":0.04221,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 16.0 16.2 16.3 16.4 16.5 17.0 17.2 17.3 17.4 17.5 18.1 18.2 18.3 18.4 26.0 26.4 27.1 27.2 TP","15.5":0.01206,"15.6":4.59486,"16.1":0.02412,"16.6":0.03015,"17.1":0.03015,"17.6":0.03015,"18.0":0.01206,"18.5-18.7":0.00603,"26.1":0.00603,"26.2":0.00603,"26.3":0.04221,"26.5":0.19899,"26.6":1.37484},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00074,"5.0-5.1":0.00074,"6.0-6.1":0,"7.0-7.1":0.00147,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00737,"11.0-11.2":0.00074,"11.3-11.4":0.00147,"12.0-12.1":0,"12.2-12.5":0.01916,"13.0-13.1":0,"13.2":0.00369,"13.3":0,"13.4-13.7":0.00074,"14.0-14.4":0.00295,"14.5-14.8":0.00442,"15.0-15.1":0.00442,"15.2-15.3":0.00295,"15.4":0.00369,"15.5":0.00442,"15.6-15.8":0.09581,"16.0":0.00737,"16.1":0.01327,"16.2":0.00737,"16.3":0.01621,"16.4":0.00369,"16.5":0.0059,"16.6-16.7":0.1334,"17.0":0.00516,"17.1":0.00737,"17.2":0.00737,"17.3":0.01106,"17.4":0.01548,"17.5":0.03022,"17.6-17.7":0.07812,"18.0":0.01621,"18.1":0.03243,"18.2":0.04422,"18.3":0.07665,"18.4":0.04791,"18.5-18.7":0.98981,"26.0":0.04791,"26.1":0.04864,"26.2":0.12677,"26.3":0.13709,"26.4":0.10023,"26.5":0.67142,"26.6":4.14278,"27.0":0.31765,"27.1":0,"27.2":0.00811},P:{"20":0.01979,"23":0.0099,"26":0.0099,"27":0.0099,"28":0.0099,"29":0.0099,"30":1.74163,_:"4 21 22 24 25 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.0099,"14.0":0.0099},I:{"0":0.0119,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.22635,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":32.37143},R:{_:"0"},M:{"0":0.23429},Q:{_:"14.9"},O:{"0":0.01191},H:{all:0}};
@@ -0,0 +1,720 @@
export default `flf2a$ 7 6 22 15 4
starwars.flf by Ryan Youck (youck@cs.uregina.ca) Dec 25/1994
I am not responsible for use of this font
Based on Big.flf by Glenn Chappell
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
__ $@
| |$@
| |$@
| |$@
|__|$@
(__)$@
$@@
_ _ @
( | )@
V V @
$ @
$ @
$ @
@@
_ _ @
_| || |_$@
|_ __ _|@
_| || |_ @
|_ __ _|@
|_||_| $@
@@
__,--,_.@
/ |@
| (----\`@
\\ \\ $@
.----) | $@
|_ __/ $@
'--' $@@
_ ___$ @
/ \\ / /$ @
( o ) / / $ @
\\_/ / / _$ @
/ / / \\ @
/ / ( o )@
/__/ \\_/ @@
@
___ @
( _ ) $@
/ _ \\/\\@
| (_> <@
\\___/\\/@
$@@
__ @
(_ )@
|/ @
$ @
$ @
$ @
@@
___@
/ /@
| |$@
| |$@
| |$@
| |$@
\\__\\@@
___ @
\\ \\ @
| |@
| |@
| |@
| |@
/__/ @@
_ @
/\\| |/\\ @
\\ \` ' /$@
|_ _|@
/ , . \\$@
\\/|_|\\/ @
@@
@
_ @
_| |_$@
|_ _|@
|_| $@
$ @
@@
@
@
$ @
$ @
__ @
(_ )@
|/ @@
@
@
______ @
|______|@
$ @
$ @
@@
@
@
@
$ @
__ @
(__)@
@@
___@
/ /@
/ / @
/ /$ @
/ /$ @
/__/$ @
@@
___ $@
/ _ \\ $@
| | | |$@
| | | |$@
| |_| |$@
\\___/ $@
$@@
__ $@
/_ |$@
| |$@
| |$@
| |$@
|_|$@
$@@
___ $@
|__ \\ $@
$) |$@
/ / $@
/ /_ $@
|____|$@
$@@
____ $@
|___ \\ $@
__) |$@
|__ < $@
___) |$@
|____/ $@
$@@
_ _ $@
| || | $@
| || |_ $@
|__ _|$@
| | $@
|_| $@
$@@
_____ $@
| ____|$@
| |__ $@
|___ \\ $@
___) |$@
|____/ $@
$@@
__ $@
/ / $@
/ /_ $@
| '_ \\ $@
| (_) |$@
\\___/ $@
$@@
______ $@
|____ |$@
$/ / $@
/ / $@
/ / $@
/_/ $@
$@@
___ $@
/ _ \\ $@
| (_) |$@
> _ < $@
| (_) |$@
\\___/ $@
$@@
___ $@
/ _ \\ $@
| (_) |$@
\\__, |$@
/ / $@
/_/ $@
$@@
@
_ @
(_)@
$ @
_ @
(_)@
@@
@
_ @
(_)@
$ @
_ @
( )@
|/ @@
___@
/ /@
/ /$@
< <$ @
\\ \\$@
\\__\\@
@@
@
______ @
|______|@
______ @
|______|@
@
@@
___ @
\\ \\$ @
\\ \\ @
> >@
/ / @
/__/$ @
@@
______ $@
| \\ $@
\`----) |$@
/ / $@
|__| $@
__ $@
(__) $@@
____ @
/ __ \\ @
/ / _\` |@
| | (_| |@
\\ \\__,_|@
\\____/ @
@@
___ $ @
/ \\ $ @
/ ^ \\$ @
/ /_\\ \\$ @
/ _____ \\$ @
/__/ \\__\\$@
$@@
.______ $@
| _ \\ $@
| |_) |$@
| _ < $@
| |_) |$@
|______/ $@
$@@
______$@
/ |@
| ,----'@
| | $@
| \`----.@
\\______|@
$@@
_______ $@
| \\$@
| .--. |@
| | | |@
| '--' |@
|_______/$@
$@@
_______ @
| ____|@
| |__ $@
| __| $@
| |____ @
|_______|@
@@
_______ @
| ____|@
| |__ $@
| __| $@
| | $ @
|__| @
@@
_______ @
/ _____|@
| | __ $@
| | |_ |$@
| |__| |$@
\\______|$@
$@@
__ __ $@
| | | |$@
| |__| |$@
| __ |$@
| | | |$@
|__| |__|$@
$@@
__ $@
| |$@
| |$@
| |$@
| |$@
|__|$@
$@@
__ $@
| |$@
| |$@
.--. | |$@
| \`--' |$@
\\______/ $@
$@@
__ ___$@
| |/ /$@
| ' / $@
| < $@
| . \\ $@
|__|\\__\\$@
$@@
__ $@
| | $@
| | $@
| | $@
| \`----.@
|_______|@
$@@
.___ ___.$@
| \\/ |$@
| \\ / |$@
| |\\/| |$@
| | | |$@
|__| |__|$@
$@@
.__ __.$@
| \\ | |$@
| \\| |$@
| . \` |$@
| |\\ |$@
|__| \\__|$@
$@@
______ $@
/ __ \\ $@
| | | |$@
| | | |$@
| \`--' |$@
\\______/ $@
$@@
.______ $@
| _ \\ $@
| |_) |$@
| ___/ $@
| | $ @
| _| $ @
$ @@
______ $ @
/ __ \\ $ @
| | | | $ @
| | | | $ @
| \`--' '--. @
\\_____\\_____\\@
$ @@
.______ $ @
| _ \\ $ @
| |_) | $ @
| / $ @
| |\\ \\----.@
| _| \`._____|@
$@@
_______.@
/ |@
| (----\`@
\\ \\ $@
.----) | $@
|_______/ $@
$@@
.___________.@
| |@
\`---| |----\`@
| | $ @
| | $ @
|__| $ @
$ @@
__ __ $@
| | | |$@
| | | |$@
| | | |$@
| \`--' |$@
\\______/ $@
$@@
____ ____$@
\\ \\ / /$@
\\ \\/ /$ @
\\ /$ @
\\ /$ @
\\__/$ @
$ @@
____ __ ____$@
\\ \\ / \\ / /$@
\\ \\/ \\/ /$ @
\\ /$ @
\\ /\\ /$ @
\\__/ \\__/$ @
$ @@
___ ___$@
\\ \\ / /$@
\\ V / $@
> < $@
/ . \\ $@
/__/ \\__\\$@
$@@
____ ____$@
\\ \\ / /$@
\\ \\/ /$ @
\\_ _/$ @
| |$ @
|__|$ @
$ @@
________ $@
| / $@
\`---/ / $@
/ / $@
/ /----.@
/________|@
$@@
____ @
| |@
| |-\`@
| | $@
| | $@
| |-.@
|____|@@
___ @
\\ \\ $ @
\\ \\$ @
\\ \\$ @
\\ \\$@
\\__\\@
@@
____ @
| |@
\`-| |@
| |@
| |@
.-| |@
|____|@@
___ @
/ \\ @
/--^--\\@
$@
$@
$@
$@@
@
@
@
$ @
$ @
______ @
|______|@@
__ @
( _)@
\\| @
$ @
$ @
$ @
@@
___ $ @
/ \\ $ @
/ ^ \\$ @
/ /_\\ \\$ @
/ _____ \\$ @
/__/ \\__\\$@
$@@
.______ $@
| _ \\ $@
| |_) |$@
| _ < $@
| |_) |$@
|______/ $@
$@@
______$@
/ |@
| ,----'@
| | $@
| \`----.@
\\______|@
$@@
_______ $@
| \\$@
| .--. |@
| | | |@
| '--' |@
|_______/$@
$@@
_______ @
| ____|@
| |__ $@
| __| $@
| |____ @
|_______|@
@@
_______ @
| ____|@
| |__ $@
| __| $@
| | $ @
|__| @
@@
_______ @
/ _____|@
| | __ $@
| | |_ |$@
| |__| |$@
\\______|$@
$@@
__ __ $@
| | | |$@
| |__| |$@
| __ |$@
| | | |$@
|__| |__|$@
$@@
__ $@
| |$@
| |$@
| |$@
| |$@
|__|$@
$@@
__ $@
| |$@
| |$@
.--. | |$@
| \`--' |$@
\\______/ $@
$@@
__ ___$@
| |/ /$@
| ' / $@
| < $@
| . \\ $@
|__|\\__\\$@
$@@
__ $@
| | $@
| | $@
| | $@
| \`----.@
|_______|@
$@@
.___ ___.$@
| \\/ |$@
| \\ / |$@
| |\\/| |$@
| | | |$@
|__| |__|$@
$@@
.__ __.$@
| \\ | |$@
| \\| |$@
| . \` |$@
| |\\ |$@
|__| \\__|$@
$@@
______ $@
/ __ \\ $@
| | | |$@
| | | |$@
| \`--' |$@
\\______/ $@
$@@
.______ $@
| _ \\ $@
| |_) |$@
| ___/ $@
| | $ @
| _| $ @
$ @@
______ $ @
/ __ \\ $ @
| | | | $ @
| | | | $ @
| \`--' '--. @
\\_____\\_____\\@
$ @@
.______ $ @
| _ \\ $ @
| |_) | $ @
| / $ @
| |\\ \\----.@
| _| \`._____|@
$@@
_______.@
/ |@
| (----\`@
\\ \\ $@
.----) | $@
|_______/ $@
$@@
.___________.@
| |@
\`---| |----\`@
| | $ @
| | $ @
|__| $ @
$ @@
__ __ $@
| | | |$@
| | | |$@
| | | |$@
| \`--' |$@
\\______/ $@
$@@
____ ____$@
\\ \\ / /$@
\\ \\/ /$ @
\\ /$ @
\\ /$ @
\\__/$ @
$ @@
____ __ ____$@
\\ \\ / \\ / /$@
\\ \\/ \\/ /$ @
\\ /$ @
\\ /\\ /$ @
\\__/ \\__/$ @
$ @@
___ ___$@
\\ \\ / /$@
\\ V / $@
> < $@
/ . \\ $@
/__/ \\__\\$@
$@@
____ ____$@
\\ \\ / /$@
\\ \\/ /$ @
\\_ _/$ @
| |$ @
|__|$ @
$ @@
________ $@
| / $@
\`---/ / $@
/ / $@
/ /----.@
/________|@
$@@
___@
/ /@
| |$@
/ /$ @
\\ \\$ @
| |$@
\\__\\@@
__ $@
| |$@
| |$@
| |$@
| |$@
| |$@
|__|$@@
___ @
\\ \\$ @
| | @
\\ \\@
/ /@
| | @
/__/$ @@
__ _ @
/ \\/ |@
|_/\\__/ @
$ @
$ @
$ @
@@
_ _ @
(_)_(_) @
/ \\ @
/ _ \\ @
/ ___ \\ @
/_/ \\_\\@
@@
_ _ @
(_)_(_)@
/ _ \\ @
| | | |@
| |_| |@
\\___/ @
@@
_ _ @
(_) (_)@
| | | |@
| | | |@
| |_| |@
\\___/ @
@@
_ _ @
(_) (_)@
__ _ @
/ _\` |@
| (_| |@
\\__,_|@
@@
_ _ @
(_) (_)@
___ @
/ _ \\ @
| (_) |@
\\___/ @
@@
_ _ @
(_) (_)@
_ _ @
| | | |@
| |_| |@
\\__,_|@
@@
___ @
/ _ \\ @
| | ) |@
| |< < @
| | ) |@
| ||_/ @
|_| @@
`
@@ -0,0 +1,4 @@
export type JsonSchema7BooleanType = {
type: "boolean";
};
export declare function parseBooleanDef(): JsonSchema7BooleanType;
@@ -0,0 +1,63 @@
const React = require('react');
function Ignores({ metrics, metricsToShow }) {
const metricKeys = Object.keys(metricsToShow);
const result = [];
for (let i = 0; i < metricKeys.length; i++) {
const metricKey = metricKeys[i];
if (metricsToShow[metricKey]) {
const skipped = metrics[metricKey].skipped;
if (skipped > 0) {
result.push(
`${skipped} ${metricKey}${
skipped === 1 ? '' : metricKey === 'branch' ? 'es' : 's'
}`
);
}
}
}
if (result.length === 0) {
return false;
}
return (
<div className="toolbar__item">
<span className="strong">{result.join(', ')}</span>
<span className="quiet">Ignored</span>
</div>
);
}
function StatusMetric({ data, name }) {
return (
<div className="toolbar__item">
<span className="strong">{data.pct}%</span>{' '}
<span className="quiet">{name}</span>{' '}
<span className={'fraction ' + data.classForPercent}>
{data.covered}/{data.total}
</span>
</div>
);
}
module.exports = function SummaryHeader({ metrics, metricsToShow }) {
return (
<div className="toolbar">
{metricsToShow.statements && (
<StatusMetric data={metrics.statements} name="Statements" />
)}
{metricsToShow.branches && (
<StatusMetric data={metrics.branches} name="Branches" />
)}
{metricsToShow.functions && (
<StatusMetric data={metrics.functions} name="Functions" />
)}
{metricsToShow.lines && (
<StatusMetric data={metrics.lines} name="Lines" />
)}
<Ignores metrics={metrics} metricsToShow={metricsToShow} />
</div>
);
};
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudMoonRain = createLucideIcon("CloudMoonRain", [
["path", { d: "M10.188 8.5A6 6 0 0 1 16 4a1 1 0 0 0 6 6 6 6 0 0 1-3 5.197", key: "erj67n" }],
["path", { d: "M11 20v2", key: "174qtz" }],
["path", { d: "M3 20a5 5 0 1 1 8.9-4H13a3 3 0 0 1 2 5.24", key: "1qmrp3" }],
["path", { d: "M7 19v2", key: "12npes" }]
]);
export { CloudMoonRain as default };
//# sourceMappingURL=cloud-moon-rain.js.map
@@ -0,0 +1,44 @@
// Lazy materialization for the lanes===1 fast path. Backed by a
// Float64Array (stride 2: start, size, …); VirtualItems are constructed on
// first indexed read and cached. Saves the per-item object allocation at
// large list counts where most items are never visible.
import type { VirtualItem } from './index'
type Key = number | string | bigint
export function createLazyMeasurementsView(
count: number,
flat: Float64Array,
getItemKey: (i: number) => Key,
): Array<VirtualItem> {
const cache: Array<VirtualItem | undefined> = new Array(count)
return new Proxy(cache as any, {
get(target, prop, receiver) {
if (typeof prop === 'string') {
// Cheap digit-prefix sniff before number coerce.
const c = prop.charCodeAt(0)
if (c >= 48 && c <= 57) {
const i = +prop
if (Number.isInteger(i) && i >= 0 && i < count) {
let v = target[i]
if (!v) {
const s = flat[i * 2]!
v = target[i] = {
index: i,
key: getItemKey(i),
start: s,
size: flat[i * 2 + 1]!,
end: s + flat[i * 2 + 1]!,
lane: 0,
}
}
return v
}
}
if (prop === 'length') return count
}
return Reflect.get(target, prop, receiver)
},
}) as Array<VirtualItem>
}
@@ -0,0 +1 @@
{"version":3,"file":"align-vertical-space-between.js","sources":["../../../src/icons/align-vertical-space-between.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlignVerticalSpaceBetween\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iNiIgeD0iNSIgeT0iMTUiIHJ4PSIyIiAvPgogIDxyZWN0IHdpZHRoPSIxMCIgaGVpZ2h0PSI2IiB4PSI3IiB5PSIzIiByeD0iMiIgLz4KICA8cGF0aCBkPSJNMiAyMWgyMCIgLz4KICA8cGF0aCBkPSJNMiAzaDIwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/align-vertical-space-between\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 AlignVerticalSpaceBetween = createLucideIcon('AlignVerticalSpaceBetween', [\n ['rect', { width: '14', height: '6', x: '5', y: '15', rx: '2', key: '1w91an' }],\n ['rect', { width: '10', height: '6', x: '7', y: '3', rx: '2', key: '17wqzy' }],\n ['path', { d: 'M2 21h20', key: '1nyx9w' }],\n ['path', { d: 'M2 3h20', key: '91anmk' }],\n]);\n\nexport default AlignVerticalSpaceBetween;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA4B,iBAAiB,2BAA6B,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9E,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,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,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,CAC9E,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,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"ScriptOnce.cjs","names":[],"sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\n/**\n * Server-only helper to emit a script tag exactly once during SSR.\n */\nexport function ScriptOnce({ children }: { children: string }) {\n const router = useRouter()\n if (!(isServer ?? router.isServer)) {\n return null\n }\n\n return (\n <script\n nonce={router.options.ssr?.nonce}\n dangerouslySetInnerHTML={{\n __html: children + ';document.currentScript.remove()',\n }}\n />\n )\n}\n"],"mappings":";;;;;;;;AAMA,SAAgB,WAAW,EAAE,YAAkC;CAC7D,MAAM,SAAS,kBAAA,WAAW;AAC1B,KAAI,EAAE,+BAAA,YAAY,OAAO,UACvB,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;EACE,OAAO,OAAO,QAAQ,KAAK;EAC3B,yBAAyB,EACvB,QAAQ,WAAW,oCACpB;EACD,CAAA"}
@@ -0,0 +1,36 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_middleware_serve_static_index = require("../../middleware/serve-static/index.js");
let node_path = require("node:path");
//#region src/adapter/deno/serve-static.ts
const { open, lstatSync, errors } = Deno;
/**
* @deprecated `hono/deno` will be removed in v5. Install `@hono/deno` and import from there instead.
*/
const serveStatic = (options = {}) => {
return async function serveStatic(c, next) {
const getContent = async (path) => {
try {
if (isDir(path)) return null;
return (await open(path)).readable;
} catch (e) {
if (!(e instanceof errors.NotFound)) console.warn(`${e}`);
return null;
}
};
const isDir = (path) => {
let isDir;
try {
isDir = lstatSync(path).isDirectory;
} catch {}
return isDir;
};
return require_middleware_serve_static_index.serveStatic({
...options,
getContent,
join: node_path.join,
isDir
})(c, next);
};
};
//#endregion
exports.serveStatic = serveStatic;
@@ -0,0 +1,50 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as _radix_ui_react_context from '@radix-ui/react-context';
import { Scope } from '@radix-ui/react-context';
import * as React from 'react';
import { Primitive } from '@radix-ui/react-primitive';
type ScopedProps<P> = P & {
__scopeCheckbox?: Scope;
};
declare const createCheckboxScope: _radix_ui_react_context.CreateScope;
type CheckedState = boolean | 'indeterminate';
interface CheckboxProviderProps<State extends CheckedState = CheckedState> {
checked?: State | boolean;
defaultChecked?: State | boolean;
required?: boolean;
onCheckedChange?(checked: State | boolean): void;
name?: string;
form?: string;
disabled?: boolean;
value?: string | number | readonly string[];
children?: React.ReactNode;
}
declare function CheckboxProvider<State extends CheckedState = CheckedState>(props: ScopedProps<CheckboxProviderProps<State>>): react_jsx_runtime.JSX.Element;
interface CheckboxTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof Primitive.button>, keyof CheckboxProviderProps> {
children?: React.ReactNode;
}
declare const CheckboxTrigger: React.ForwardRefExoticComponent<CheckboxTriggerProps & React.RefAttributes<HTMLButtonElement>>;
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
interface CheckboxProps extends Omit<PrimitiveButtonProps, 'checked' | 'defaultChecked'> {
checked?: CheckedState;
defaultChecked?: CheckedState;
required?: boolean;
onCheckedChange?(checked: CheckedState): void;
}
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
interface CheckboxIndicatorProps extends PrimitiveSpanProps {
/**
* Used to force mounting when more control is needed. Useful when
* controlling animation with React animation libraries.
*/
forceMount?: true;
}
declare const CheckboxIndicator: React.ForwardRefExoticComponent<CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
type InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;
interface CheckboxBubbleInputProps extends Omit<InputProps, 'checked'> {
}
declare const CheckboxBubbleInput: React.ForwardRefExoticComponent<CheckboxBubbleInputProps & React.RefAttributes<HTMLInputElement>>;
export { Checkbox, CheckboxIndicator, type CheckboxIndicatorProps, type CheckboxProps, type CheckedState, CheckboxIndicator as Indicator, Checkbox as Root, createCheckboxScope, CheckboxBubbleInput as unstable_BubbleInput, CheckboxBubbleInput as unstable_CheckboxBubbleInput, type CheckboxBubbleInputProps as unstable_CheckboxBubbleInputProps, CheckboxProvider as unstable_CheckboxProvider, type CheckboxProviderProps as unstable_CheckboxProviderProps, CheckboxTrigger as unstable_CheckboxTrigger, type CheckboxTriggerProps as unstable_CheckboxTriggerProps, CheckboxProvider as unstable_Provider, CheckboxTrigger as unstable_Trigger };
@@ -0,0 +1 @@
{"version":3,"file":"pencil-line.js","sources":["../../../src/icons/pencil-line.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PencilLine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjBoOSIgLz4KICA8cGF0aCBkPSJNMTYuMzc2IDMuNjIyYTEgMSAwIDAgMSAzLjAwMiAzLjAwMkw3LjM2OCAxOC42MzVhMiAyIDAgMCAxLS44NTUuNTA2bC0yLjg3Mi44MzhhLjUuNSAwIDAgMS0uNjItLjYybC44MzgtMi44NzJhMiAyIDAgMCAxIC41MDYtLjg1NHoiIC8+CiAgPHBhdGggZD0ibTE1IDUgMyAzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/pencil-line\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 PencilLine = createLucideIcon('PencilLine', [\n ['path', { d: 'M12 20h9', key: 't2du7b' }],\n [\n 'path',\n {\n d: 'M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z',\n key: '1ykcvy',\n },\n ],\n ['path', { d: 'm15 5 3 3', key: '1w25hb' }],\n]);\n\nexport default PencilLine;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,209 @@
/**
* @fileoverview Rule that warns about used warning comments
* @author Alexander Schmidt <https://github.com/lxanders>
*/
"use strict";
const escapeRegExp = require("escape-string-regexp");
const astUtils = require("./utils/ast-utils");
const CHAR_LIMIT = 40;
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
location: "start",
terms: ["todo", "fixme", "xxx"],
},
],
docs: {
description: "Disallow specified warning terms in comments",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-warning-comments",
},
schema: [
{
type: "object",
properties: {
terms: {
type: "array",
items: {
type: "string",
},
},
location: {
enum: ["start", "anywhere"],
},
decoration: {
type: "array",
items: {
type: "string",
pattern: "^\\S$",
},
minItems: 1,
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages: {
unexpectedComment:
"Unexpected '{{matchedTerm}}' comment: '{{comment}}'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const [{ decoration, location, terms: warningTerms }] = context.options;
const escapedDecoration = escapeRegExp(
decoration ? decoration.join("") : "",
);
const selfConfigRegEx = /\bno-warning-comments\b/u;
/**
* Convert a warning term into a RegExp which will match a comment containing that whole word in the specified
* location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not
* require word boundaries on that side.
* @param {string} term A term to convert to a RegExp
* @returns {RegExp} The term converted to a RegExp
*/
function convertToRegExp(term) {
const escaped = escapeRegExp(term);
/*
* When matching at the start, ignore leading whitespace, and
* there's no need to worry about word boundaries.
*
* These expressions for the prefix and suffix are designed as follows:
* ^ handles any terms at the beginning of a comment.
* e.g. terms ["TODO"] matches `//TODO something`
* $ handles any terms at the end of a comment
* e.g. terms ["TODO"] matches `// something TODO`
* \b handles terms preceded/followed by word boundary
* e.g. terms: ["!FIX", "FIX!"] matches `// FIX!something` or `// something!FIX`
* terms: ["FIX"] matches `// FIX!` or `// !FIX`, but not `// fixed or affix`
*
* For location start:
* [\s]* handles optional leading spaces
* e.g. terms ["TODO"] matches `// TODO something`
* [\s\*]* (where "\*" is the escaped string of decoration)
* handles optional leading spaces or decoration characters (for "start" location only)
* e.g. terms ["TODO"] matches `/**** TODO something ... `
*/
const wordBoundary = "\\b";
let prefix = "";
if (location === "start") {
prefix = `^[\\s${escapedDecoration}]*`;
} else if (/^\w/u.test(term)) {
prefix = wordBoundary;
}
const suffix = /\w$/u.test(term) ? wordBoundary : "";
const flags = "iu"; // Case-insensitive with Unicode case folding.
/*
* For location "start", the typical regex is:
* /^[\s]*ESCAPED_TERM\b/iu.
* Or if decoration characters are specified (e.g. "*"), then any of
* those characters may appear in any order at the start:
* /^[\s\*]*ESCAPED_TERM\b/iu.
*
* For location "anywhere" the typical regex is
* /\bESCAPED_TERM\b/iu
*
* If it starts or ends with non-word character, the prefix and suffix are empty, respectively.
*/
return new RegExp(`${prefix}${escaped}${suffix}`, flags);
}
const warningRegExps = warningTerms.map(convertToRegExp);
/**
* Checks the specified comment for matches of the configured warning terms and returns the matches.
* @param {string} comment The comment which is checked.
* @returns {Array} All matched warning terms for this comment.
*/
function commentContainsWarningTerm(comment) {
const matches = [];
warningRegExps.forEach((regex, index) => {
if (regex.test(comment)) {
matches.push(warningTerms[index]);
}
});
return matches;
}
/**
* Checks the specified node for matching warning comments and reports them.
* @param {ASTNode} node The AST node being checked.
* @returns {void} undefined.
*/
function checkComment(node) {
const comment = node.value;
if (
astUtils.isDirectiveComment(node) &&
selfConfigRegEx.test(comment)
) {
return;
}
const matches = commentContainsWarningTerm(comment);
matches.forEach(matchedTerm => {
let commentToDisplay = "";
let truncated = false;
for (const c of comment.trim().split(/\s+/u)) {
const tmp = commentToDisplay
? `${commentToDisplay} ${c}`
: c;
if (tmp.length <= CHAR_LIMIT) {
commentToDisplay = tmp;
} else {
truncated = true;
break;
}
}
context.report({
node,
messageId: "unexpectedComment",
data: {
matchedTerm,
comment: `${commentToDisplay}${truncated ? "..." : ""}`,
},
});
});
}
return {
Program() {
const comments = sourceCode.getAllComments();
comments
.filter(token => token.type !== "Shebang")
.forEach(checkComment);
},
};
},
};
@@ -0,0 +1,734 @@
export default `flf2a$ 7 6 19 -1 18
Razor font by LESTER
======================
-> The "G" was rediddled masterfully by: Tre10@ix.netcom.com (Tom R. Earlywine)
-> Conversion to FigLet font by MEPH. (Part of ASCII Editor Service Pack I)
(http://studenten.freepage.de/meph/ascii/ascii/editor/_index.htm)
-> Defined: ASCII code alphanumeric
-> Uppercase characters only.
.-~~-.
(_^..^_)
Lester||||AMC - Anthony Cucchiara
*Mythos Online : Internet Magazine of Lovecraftian Horror - Dead Alice*
http://www.fortunecity.com/victorian/redlion/157/deadal.htm
*Visit my web page ANSI/ASCII/Fonts*
http://members.aol.com/lester5374/
$@
$@
$@
$@
$@
$@
$@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
.-. @
\`/' @
@@
@
@
@
@
@
@
@@
@
@
@
@
.-. @
\`-' @
@@
@
@
@
@
@
@
@@
@
.'|=|\`. @
.' | | \`. @
| |/| | @
\`. | | .' @
\`.|=|.' @
@@
______ @
\`._ | @
| | @
| | @
| | @
|___| @
@@
___ @
\`._|=|\`. @
| \`. @
.'|=|___| @
.' | ___ @
|___|=|_.' @
@@
___ @
\`._|=|\`. @
___ | \`. @
\`._|=| | @
___ | | @
\`._|=|___| @
@@
@
|\`. |\`. @
| | | \`. @
|__|=| | @
| | @
|___| @
@@
___ ___ @
| |=|_.' @
| | @
|___|=|\`. @
___ | \`. @
\`._|=|___| @
@@
___ @
.'|=|_.' @
.' | @
| |=|\`. @
| | | | @
|___|=|__| @
@@
___ ___ @
\`._|=| | @
| .' @
.'|=|.' @
.' | @
|___| @
@@
__ __ @
.' |=| \`. @
\`. | | .' @
.\` |=| \`. @
| | | | @
\`.__|=|__.' @
@@
__ @
| |=|\`. @
| | | \`. @
\`.|=| | @
___ | | @
\`._|=|___| @
@@
@
.-. @
\`-' @
@
.-. @
\`-' @
@@
@
.-. @
\`-' @
@
.-. @
\`/' @
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
.'|=|\`. @
.' | | \`. @
| |=| | @
| | | | @
|___| |___| @
@@
_ @
.'|=| \`. @
.' | | .' @
| |=|'. @
| | | | @
|___|=|_.' @
@@
___ @
.'|=|_.' @
.' | @
| | @
\`. | ___ @
\`.|=|_.' @
@@
@
.'|=|\`. @
.' | | \`. @
| | | | @
| | | .' @
|___|=|.' @
@@
___ @
.'|=|_.' @
.' | ___ @
| |=|_.' @
| | ___ @
|___|=|_.' @
@@
___ @
.'|=|_.' @
.' | ___ @
| |=|_.' @
| | @
|___| @
@@
___ @
.'|=|_.' @
.' |___ @
| |\`._|=. @
\`. | __|| @
\`.|=|_.'' @
@@
@
.'| |\`. @
.' | | \`. @
| |=| | @
| | | | @
|___| |___| @
@@
@
.'| @
.' | @
| | @
| | @
|___| @
@@
@
.'| @
.' | @
| | @
___ | | @
\`._|=|__.' @
@@
@
.'| .'| @
.' | .' .' @
| |=|.: @
| | |'. @
|___| |_| @
@@
@
.'| @
.' | @
| | @
| | ___ @
|___|=|_.' @
@@
@
.'|\\/|\`. @
.' | | \`. @
| | | | @
| | | | @
|___| |___| @
@@
___ @
.'| | | @
.' |\\| | @
| | | | @
| | | .' @
|___| |.' @
@@
@
.'|=|\`. @
.' | | \`. @
| | | | @
\`. | | .' @
\`.|=|.' @
@@
__ @
.'|=| | @
.' | | | @
| |=|.' @
| | @
|___| @
@@
@
.'|=|\`. @
.' | | \`. @
| |\\| | @
\`. | | .' @
\`.|=|.'\\ @
@@
__ @
.'|=| | @
.' | | | @
| |=|.' @
| | |\`. @
|___| |_| @
@@
___ ___ @
| |=|_.' @
\`. | @
\`.|=|\`. @
___ | \`.@
\`._|=|___|@
@@
___ ___ ___ @
\`._|=| |=|_.' @
| | @
| | @
\`. | @
\`.| @
@@
___ @
| | |\`. @
| | | \`. @
| | | | @
\`. | | | @
\`.|=|___| @
@@
___ ___ @
| | | | @
| | | | @
| | | | @
\`. | | .' @
\`.|=|.' @
@@
___ ___ @
| | | | @
| | | | @
| | | | @
\`. | | .' @
\`.|/\\|.' @
@@
___ ___ @
| | | | @
\`. | | .' @
.\` |=| \`. @
| | | | @
|___| |___| @
@@
___ ___ @
| | | | @
\`. |_| .' @
\`. .' @
| | @
|___| @
@@
___ ___ @
\`._|=| | @
| .' @
.'|=|.' @
.' | ___ @
|___|=|_.' @
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
.'|=|\`. @
.' | | \`. @
| |=| | @
| | | | @
|___| |___| @
@@
_ @
.'|=| \`. @
.' | | .' @
| |=|'. @
| | | | @
|___|=|_.' @
@@
___ @
.'|=|_.' @
.' | @
| | @
\`. | ___ @
\`.|=|_.' @
@@
@
.'|=|\`. @
.' | | \`. @
| | | | @
| | | .' @
|___|=|.' @
@@
___ @
.'|=|_.' @
.' | ___ @
| |=|_.' @
| | ___ @
|___|=|_.' @
@@
___ @
.'|=|_.' @
.' | ___ @
| |=|_.' @
| | @
|___| @
@@
___ @
.'|=|_.' @
.' |___ @
| |\`._|=. @
\`. | __|| @
\`.|=|_.'' @
@@
@
.'| |\`. @
.' | | \`. @
| |=| | @
| | | | @
|___| |___| @
@@
@
.'| @
.' | @
| | @
| | @
|___| @
@@
@
.'| @
.' | @
| | @
___ | | @
\`._|=|__.' @
@@
@
.'| .'| @
.' | .' .' @
| |=|.: @
| | |'. @
|___| |_| @
@@
@
.'| @
.' | @
| | @
| | ___ @
|___|=|_.' @
@@
@
.'|\\/|\`. @
.' | | \`. @
| | | | @
| | | | @
|___| |___| @
@@
___ @
.'| | | @
.' |\\| | @
| | | | @
| | | .' @
|___| |.' @
@@
@
.'|=|\`. @
.' | | \`. @
| | | | @
\`. | | .' @
\`.|=|.' @
@@
__ @
.'|=| | @
.' | | | @
| |=|.' @
| | @
|___| @
@@
@
.'|=|\`. @
.' | | \`. @
| |\\| | @
\`. | | .' @
\`.|=|.'\\ @
@@
__ @
.'|=| | @
.' | | | @
| |=|.' @
| | |\`. @
|___| |_| @
@@
___ ___ @
| |=|_.' @
\`. | @
\`.|=|\`. @
___ | \`.@
\`._|=|___|@
@@
___ ___ ___ @
\`._|=| |=|_.' @
| | @
| | @
\`. | @
\`.| @
@@
___ @
| | |\`. @
| | | \`. @
| | | | @
\`. | | | @
\`.|=|___| @
@@
___ ___ @
| | | | @
| | | | @
| | | | @
\`. | | .' @
\`.|=|.' @
@@
___ ___ @
| | | | @
| | | | @
| | | | @
\`. | | .' @
\`.|/\\|.' @
@@
___ ___ @
| | | | @
\`. | | .' @
.\` |=| \`. @
| | | | @
|___| |___| @
@@
___ ___ @
| | | | @
\`. |_| .' @
\`. .' @
| | @
|___| @
@@
___ ___ @
\`._|=| | @
| .' @
.'|=|.' @
.' | ___ @
|___|=|_.' @
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,126 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface ProxyHandler<T extends object> {
/**
* A trap method for a function call.
* @param target The original callable object which is being proxied.
*/
apply?(target: T, thisArg: any, argArray: any[]): any;
/**
* A trap for the `new` operator.
* @param target The original object which is being proxied.
* @param newTarget The constructor that was originally called.
*/
construct?(target: T, argArray: any[], newTarget: Function): object;
/**
* A trap for `Object.defineProperty()`.
* @param target The original object which is being proxied.
* @returns A `Boolean` indicating whether or not the property has been defined.
*/
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
/**
* A trap for the `delete` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to delete.
* @returns A `Boolean` indicating whether or not the property was deleted.
*/
deleteProperty?(target: T, p: string | symbol): boolean;
/**
* A trap for getting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to get.
* @param receiver The proxy or an object that inherits from the proxy.
*/
get?(target: T, p: string | symbol, receiver: any): any;
/**
* A trap for `Object.getOwnPropertyDescriptor()`.
* @param target The original object which is being proxied.
* @param p The name of the property whose description should be retrieved.
*/
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
/**
* A trap for the `[[GetPrototypeOf]]` internal method.
* @param target The original object which is being proxied.
*/
getPrototypeOf?(target: T): object | null;
/**
* A trap for the `in` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to check for existence.
*/
has?(target: T, p: string | symbol): boolean;
/**
* A trap for `Object.isExtensible()`.
* @param target The original object which is being proxied.
*/
isExtensible?(target: T): boolean;
/**
* A trap for `Reflect.ownKeys()`.
* @param target The original object which is being proxied.
*/
ownKeys?(target: T): ArrayLike<string | symbol>;
/**
* A trap for `Object.preventExtensions()`.
* @param target The original object which is being proxied.
*/
preventExtensions?(target: T): boolean;
/**
* A trap for setting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to set.
* @param receiver The object to which the assignment was originally directed.
* @returns A `Boolean` indicating whether or not the property was set.
*/
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
/**
* A trap for `Object.setPrototypeOf()`.
* @param target The original object which is being proxied.
* @param newPrototype The object's new prototype or `null`.
*/
setPrototypeOf?(target: T, v: object | null): boolean;
}
interface ProxyConstructor {
/**
* Creates a revocable Proxy object.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
/**
* Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
* original object, but which may redefine fundamental Object operations like getting, setting, and defining
* properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
new <T extends object>(target: T, handler: ProxyHandler<T>): T;
}
declare var Proxy: ProxyConstructor;