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

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

No files matched your search

@@ -0,0 +1,76 @@
{
"name": "@radix-ui/react-scroll-area",
"version": "1.2.10",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/number": "1.1.1",
"@radix-ui/react-compose-refs": "1.1.2",
"@radix-ui/primitive": "1.1.3",
"@radix-ui/react-context": "1.1.2",
"@radix-ui/react-direction": "1.1.1",
"@radix-ui/react-presence": "1.1.5",
"@radix-ui/react-use-layout-effect": "1.1.1",
"@radix-ui/react-primitive": "2.1.3",
"@radix-ui/react-use-callback-ref": "1.1.1"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@repo/builder": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2436":"_E"},B:{"260":"_AC","2436":"_aB","8196":"_K"},C:{"2":"_HF","772":"_1B _8G","4100":"_3L"},D:{"2":"_VF","2564":"_CC _CE","8196":"_LM","10244":"_AE _EI"},E:{"1":"_BI","16":"_e","2308":"_A _ID","2820":"_UC _UD"},F:{"2":"_0D","16":"C","516":"aC","2564":"_9I","8196":"_vR","10244":"QB _BE _bC"},G:{"1":"_WJ","2":"_d","2820":"_wD _CP"},H:{"2":"1D"},I:{"2":"_W","260":"I","2308":"_y"},J:{"2":"D","2308":"A"},K:{"2":"_cB","16":"aC","8196":"H"},L:{"8196":"I"},M:{"1028":"YC"},N:{"2":"_A"},O:{"8196":"bC"},P:{"2052":"_RH","2308":"J","8196":"_xB"},Q:{"8196":"JE"},R:{"8196":"KE"},S:{"4100":"_C"}},B:5,C:"Synchronous Clipboard API",D:true};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_Z","129":"_A"},B:{"1":"_K","129":"_I"},C:{"2":"_f","129":"_w"},D:{"1":"_NF","16":"_Y _hN MB","129":"_fF"},E:{"1":"_YB","16":"_4"},F:{"1":"_eD","2":"_qC","16":"_hG"},G:{"1":"_t","16":"_d"},H:{"129":"1D"},I:{"1":"_X","16":"_m","129":"_hL"},J:{"1":"D","129":"A"},K:{"1":"_OQ","2":"A","16":"_hG","129":"aC"},L:{"1":"I"},M:{"129":"YC"},N:{"129":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"129":"_C"}},B:1,C:"Search input type",D:true};
@@ -0,0 +1,38 @@
export class Doc {
constructor(args = [], closed = {}) {
this.content = [];
this.indent = 0;
this.args = args;
this.closed = closed;
}
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
indented(fn) {
this.indent += 1;
try {
fn(this);
}
finally {
this.indent -= 1;
}
}
write(arg) {
if (typeof arg === "function") {
arg(this, { execution: "sync" });
arg(this, { execution: "async" });
return;
}
const content = arg;
const lines = content.split("\n").filter((x) => x);
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
for (const line of dedented) {
this.content.push(line);
}
}
compile() {
const F = Function;
const content = this?.content ?? [``];
const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`);
return factory(...Object.values(this.closed));
}
}
@@ -0,0 +1,322 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
var Usefulness;
(function (Usefulness) {
Usefulness["Always"] = "always";
Usefulness["Never"] = "will";
Usefulness["Sometimes"] = "may";
})(Usefulness || (Usefulness = {}));
const canHaveTypeParameters = (declaration) => {
return (ts.isTypeAliasDeclaration(declaration) ||
ts.isInterfaceDeclaration(declaration) ||
ts.isClassDeclaration(declaration));
};
exports.default = (0, util_1.createRule)({
name: 'no-base-to-string',
meta: {
type: 'suggestion',
docs: {
description: 'Require `.toString()` and `.toLocaleString()` to only be called on objects which provide useful information when stringified',
recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
baseArrayJoin: "Using `join()` for {{name}} {{certainty}} use Object's default stringification format ('[object Object]') when stringified.",
baseToString: "'{{name}}' {{certainty}} use Object's default stringification format ('[object Object]') when stringified.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
checkUnknown: {
type: 'boolean',
description: 'Whether to also check values of type `unknown`',
},
ignoredTypeNames: {
type: 'array',
description: 'Stringified type names to ignore.',
items: {
type: 'string',
},
},
},
},
],
},
defaultOptions: [
{
checkUnknown: false,
ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'],
},
],
create(context, [option]) {
const services = (0, util_1.getParserServices)(context);
const { program } = services;
const checker = program.getTypeChecker();
const ignoredTypeNames = option.ignoredTypeNames ?? [];
function checkExpression(node, type) {
if (node.type === utils_1.AST_NODE_TYPES.Literal) {
return;
}
const certainty = collectToStringCertainty(type ?? services.getTypeAtLocation(node), new Set());
if (certainty === Usefulness.Always) {
return;
}
context.report({
node,
messageId: 'baseToString',
data: {
name: context.sourceCode.getText(node),
certainty,
},
});
}
function checkExpressionForArrayJoin(node, type) {
const certainty = collectJoinCertainty(type, new Set());
if (certainty === Usefulness.Always) {
return;
}
context.report({
node,
messageId: 'baseArrayJoin',
data: {
name: context.sourceCode.getText(node),
certainty,
},
});
}
function collectUnionTypeCertainty(type, collectSubTypeCertainty) {
const certainties = type.types.map(t => collectSubTypeCertainty(t));
if (certainties.every(certainty => certainty === Usefulness.Never)) {
return Usefulness.Never;
}
if (certainties.every(certainty => certainty === Usefulness.Always)) {
return Usefulness.Always;
}
return Usefulness.Sometimes;
}
function collectIntersectionTypeCertainty(type, collectSubTypeCertainty) {
for (const subType of type.types) {
const subtypeUsefulness = collectSubTypeCertainty(subType);
if (subtypeUsefulness === Usefulness.Always) {
return Usefulness.Always;
}
}
return Usefulness.Never;
}
function collectTupleCertainty(type, visited) {
const typeArgs = checker.getTypeArguments(type);
const certainties = typeArgs.map(t => collectToStringCertainty(t, visited));
if (certainties.some(certainty => certainty === Usefulness.Never)) {
return Usefulness.Never;
}
if (certainties.some(certainty => certainty === Usefulness.Sometimes)) {
return Usefulness.Sometimes;
}
return Usefulness.Always;
}
function collectArrayCertainty(type, visited) {
const elemType = (0, util_1.nullThrows)(type.getNumberIndexType(), 'array should have number index type');
return collectToStringCertainty(elemType, visited);
}
function collectJoinCertainty(type, visited) {
if (tsutils.isUnionType(type)) {
return collectUnionTypeCertainty(type, t => collectJoinCertainty(t, visited));
}
if (tsutils.isIntersectionType(type)) {
return collectIntersectionTypeCertainty(type, t => collectJoinCertainty(t, visited));
}
if (checker.isTupleType(type)) {
return collectTupleCertainty(type, visited);
}
if (checker.isArrayType(type)) {
return collectArrayCertainty(type, visited);
}
return Usefulness.Always;
}
function collectToStringCertainty(type, visited) {
if (visited.has(type)) {
// don't report if this is a self referencing array or tuple type
return Usefulness.Always;
}
if (tsutils.isTypeParameter(type)) {
const constraint = type.getConstraint();
if (constraint) {
return collectToStringCertainty(constraint, visited);
}
// unconstrained generic means `unknown`
return option.checkUnknown ? Usefulness.Sometimes : Usefulness.Always;
}
// the Boolean type definition missing toString()
if (tsutils.isTypeFlagSet(type, ts.TypeFlags.Boolean) ||
tsutils.isTypeFlagSet(type, ts.TypeFlags.BooleanLiteral)) {
return Usefulness.Always;
}
const symbol = type.aliasSymbol ?? type.getSymbol();
const decl = symbol?.getDeclarations()?.[0];
if (decl &&
canHaveTypeParameters(decl) &&
decl.typeParameters &&
ignoredTypeNames.includes(symbol.name)) {
return Usefulness.Always;
}
if ((0, util_1.matchesTypeOrBaseType)(services, type => ignoredTypeNames.includes((0, util_1.getTypeName)(checker, type)), type)) {
return Usefulness.Always;
}
if (type.isIntersection()) {
return collectIntersectionTypeCertainty(type, t => collectToStringCertainty(t, visited));
}
if (type.isUnion()) {
return collectUnionTypeCertainty(type, t => collectToStringCertainty(t, visited));
}
if (checker.isTupleType(type)) {
return collectTupleCertainty(type, new Set([...visited, type]));
}
if (checker.isArrayType(type)) {
return collectArrayCertainty(type, new Set([...visited, type]));
}
switch (isToStringLikeFromObject(type)) {
case undefined:
// unknown
if (option.checkUnknown && type.flags === ts.TypeFlags.Unknown) {
return Usefulness.Sometimes;
}
// e.g. any
return Usefulness.Always;
case true:
return Usefulness.Never;
case false:
return Usefulness.Always;
}
}
function isBuiltInStringCall(node) {
if (node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
node.callee.name === 'String' &&
node.arguments[0]) {
const scope = context.sourceCode.getScope(node);
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
const variable = scope.set.get('String');
return !variable?.defs.length;
}
return false;
}
function isSymbolToPrimitiveMethod(node) {
return (ts.isMethodSignature(node) &&
ts.isComputedPropertyName(node.name) &&
ts.isPropertyAccessExpression(node.name.expression) &&
ts.isIdentifier(node.name.expression.expression) &&
node.name.expression.expression.text === 'Symbol' &&
ts.isIdentifier(node.name.expression.name) &&
node.name.expression.name.text === 'toPrimitive' &&
(0, util_1.isSymbolFromDefaultLibrary)(program, checker.getSymbolAtLocation(node.name.expression.expression)));
}
function isToStringLikeFromObject(type) {
// An explicit [Symbol.toPrimitive] declaration is always user-defined
if (type
.getProperties()
.some(property => property.valueDeclaration &&
isSymbolToPrimitiveMethod(property.valueDeclaration))) {
return false;
}
// Otherwise, we check for known methods used in type coercion.
// We'll try to find one that's not declared on Object itself.
// Failing that, we'll fall back to one that is.
let foundFallbackOnObject = false;
for (const propertyName of ['toLocaleString', 'toString', 'valueOf']) {
const candidate = checker.getPropertyOfType(type, propertyName);
if (!candidate) {
continue;
}
const declarations = candidate.getDeclarations();
if (!declarations?.length) {
continue;
}
// If any declaration is not from the Object interface, this is
// user-defined (e.g. overloaded toString on a class or module).
// see https://github.com/typescript-eslint/typescript-eslint/issues/8585
// see https://github.com/typescript-eslint/typescript-eslint/issues/11945
if (declarations.some(declaration => !(ts.isInterfaceDeclaration(declaration.parent) &&
declaration.parent.name.text === 'Object'))) {
return false;
}
foundFallbackOnObject = true;
}
return foundFallbackOnObject ? true : undefined;
}
return {
'AssignmentExpression[operator = "+="], BinaryExpression[operator = "+"]'(node) {
const leftType = services.getTypeAtLocation(node.left);
const rightType = services.getTypeAtLocation(node.right);
if ((0, util_1.getTypeName)(checker, leftType) === 'string') {
checkExpression(node.right, rightType);
}
else if ((0, util_1.getTypeName)(checker, rightType) === 'string' &&
node.left.type !== utils_1.AST_NODE_TYPES.PrivateIdentifier) {
checkExpression(node.left, leftType);
}
},
CallExpression(node) {
if (isBuiltInStringCall(node) &&
node.arguments[0].type !== utils_1.AST_NODE_TYPES.SpreadElement) {
checkExpression(node.arguments[0]);
}
},
'CallExpression > MemberExpression.callee > Identifier[name = "join"].property'(node) {
const memberExpr = node.parent;
const type = (0, util_1.getConstrainedTypeAtLocation)(services, memberExpr.object);
checkExpressionForArrayJoin(memberExpr.object, type);
},
'CallExpression > MemberExpression.callee > Identifier[name = /^(toLocaleString|toString)$/].property'(node) {
const memberExpr = node.parent;
checkExpression(memberExpr.object);
},
TemplateLiteral(node) {
if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) {
return;
}
for (const expression of node.expressions) {
checkExpression(expression);
}
},
};
},
});
@@ -0,0 +1,333 @@
# @isaacs/nonrecursive-glob-match
This is a glob matcher that can be applied to a single path
portion (ie, not `/`), which completes in polynomial time because
it doesn't compile to Regular Expressions or any other
backtrack-dependent algorithm.
## USAGE
```ts
import { Matcher } from '@isaacs/nonrecursive-glob-match'
const m = new Matcher('a*a!(y|z)')
console.log(m.test('abcay')) // false
console.log(m.test('abcax')) // true
console.log(m.test('aa')) // true
```
The pattern and the tested string must be a single path portion.
If either one contains a `/` character, the matcher throws an
error.
If you already split a path on `/`, use `m.testUnchecked(s)`. It
gives the same result as `m.test(s)`, but it does not check `s`
for a `/` character. This can make it faster, because some
patterns, such as `*.js`, then do not need to look at each
character. If `s` has a `/`, the result is not defined.
## Why
Patterns like this frustrate most glob matchers: `a*a*a*a*a*a*a`.
They can be used to take down servers if applied to untrusted
input. Fixing these vulns is like playing whack-a-mole with the
whole internet.
If compiled to a regular expression like
`/^a[^/]*a[^/]*a[^/]*a[^/]*a[^/]*a[^/]*a$/`, and then applied to
a path portion like `aaaaaaaaaaaaaaaaaaab`, the engine must check
every possible path through the pattern, constantly rewinding
back to the first character each time and trying a different
number of `a` characters matched against the `[^/]*` to see if it
matches. Because nothing matches, it must test every possible
path before ultimately giving up.
In contrast, the algorithm presented here is based on the
Thompson NFA paper from 1968, which tests every possible path
through the string at the same time, so that it only has to walk
the string one time. This algorithm is also implemented in the
RegExp engines used by `egrep` and `awk`, which is why those
tools are so fast, even when matching complicated RegExps against
extremely large strings.
The `Matcher` objects have a `test` method which takes a string,
just like a `RegExp` object, and can be a drop-in replacement for
the regular expressions used in minimatch and other matchers.
However, they are _not_ a complete drop-in replacement for a
RegExp, so be careful when replacing one with the other. (For
example, they do not capture, do not track match indexes, no
fancy RegExp features, etc.)
## Patterns Supported
Here are the patterns supported, and their effective state
machines drawn in lovely ASCII diagrams.
### `*` 0 or more of any character, not starting with `.`
```
--+-------------------+->
v ^
+<------------------+
v ^
+-->any character-->+
```
### `?`
```
-->any character-->
```
### `[<set>]`
```
-->character in set-->
```
This covers named posix sets like `[[:alpha:]]` as well as
character classes like `[a-b]`. (In this case, a regular
expression actually is compiled, but it's not subject to ReDoS,
becuase it's just a `/[a-z]/` style pattern tested against one
character at a time.)
### `@(e1|e2|...)`
"One" extglob.
```
--+--> e1 -->+-->
v ^
+--> e2 -->+
v ^
+--> e3 -->+
v ... ^
```
### `?(e1|e2|...)`
"Zero or one" extglob.
```
--+--------->+-->
v ^
+--> e1 -->+
v ^
+--> e2 -->+
v ^
+--> e3 -->+
v ... ^
```
### `*(e1|e2|...)`
"Zero or more" extglob.
```
--+--------->+-->
v ^
+<---------+
v ^
+--> e1 -->+
v ^
+--> e2 -->+
v ^
+--> e3 -->+
v ... ^
```
### `+(e1|e2|...)`
"One or more" extglob.
```
+<---------+
v ^
--+--> e1 -->+-->
v ^
+--> e2 -->+
v ^
+--> e3 -->+
v ... ^
```
### `!(e1|e2|...)`
"Negative" extglob.
The challenge with negation is that it opens the door to a whole
heap of edge cases. Especially, _any_ expression can be nested
inside the negation, and it needs to match anything at all, as
long as it _doesn't_ match one of the supplied patterns. This is
where it gets complicated, and past attempts have run into
problems.
We handle this by starting a "Run" that technically does recurse,
and thus can push the performance out from `O(n * m)` to
`O(n * m * r)` where `n` is the string length, `m` is the pattern
length, and `r` is the number of negative extglob portions it
contains. In practice, this is limited by the pattern length, and
still doesn't allow ReDOS-style explosive recursive backtracking,
so this is fine.
## Unicode Normalization
A char such as `é` can be one code point (U+00E9), or `e`
followed by a combining accent (U+0301). Some file systems, such
as on macOS, can give file names in the second form. These two
forms do not match by default.
Set the `normalize` option to normalize the pattern and each
tested string to the same form. Use `'NFC'`, `'NFD'`, `'NFKC'`,
or `'NFKD'`. `true` means `'NFC'`.
```ts
const m = new Matcher('café', { normalize: true })
m.test('café') // true
```
- Use NFC if you are not sure. With NFD and NFKD, `é` is two
code points. Then `?` does not match `é`, and `[é]` can not
match it.
- NFKC and NFKD also fold compatibility chars. For example, `fi`
matches `fi`, and full-width `A` matches `A`.
- Syntax is parsed before normalization. So, a char that
normalizes to a syntax char stays a literal. For example, with
NFKC, full-width `*` matches only `*` or `*`, and it is not a
wildcard.
- Each run of literal chars normalizes as one string. Each member
of a `[...]` class normalizes on its own, and stays as it is if
its normal form is more than one code point.
- A combining mark after a wildcard is its own literal, and does
not compose with the char that the wildcard matches. So, with
NFC, `?́` does not match `é`. With NFD, it does match,
because `é` is also two code points in the string. Patterns
match code points, not grapheme clusters.
- With `nocase`, normalization comes first, then case folding.
- The `/` check uses the strings as given. So, full-width `/`
does not cause an error.
## Differences from Bash
Bash 5 is the reference for this module, with two known
deviations.
### Dotfiles
If `dot` is not set, a string that starts with `.` only matches
if a literal `.` in the pattern matches that first character.
Extglobs before that `.` can match the empty string, and the
pattern can still match. For example, `!(.a|js)@(.*)` matches
`.a`, `.a.js`, and `.js`, because `!(.a|js)` matches the empty
string, and `@(.*)` matches the rest. Bash does not match these
dotfiles. See [this bug
report](https://lists.gnu.org/archive/html/bug-bash/2026-03/msg00034.html).
A `*` can never match at the start of a dotfile, even if it
matches the empty string. So, `*.js` does not match `.js`, as in
Bash.
### Case-insensitive matching
Bash compares chars with the case functions of the C library for
the current locale. So, the results can change with the locale
and the platform.
With `nocase`, this module uses Unicode simple case folding, one
code point at a time. This is the same folding that a JavaScript
RegExp uses with the `iu` flags. It does not change with the
locale, and literals, `[...]` classes, and ranges all use it.
- `Σ`, `σ`, and final sigma `ς` all match each other.
- The micro sign `µ` matches `μ` and `Μ`. The Kelvin sign `K`
matches `k`. The Angstrom sign `Å` matches `å`.
- `ẞ` matches `ß`, but `ß` does not match `ss`. A fold never
changes the number of chars, so ligatures such as `fi` do not
match `fi`.
- There are no Turkish rules. `I` matches `i`, but dotted `İ`
and dotless `ı` only match themselves.
## Algorithm
A glob pattern is parsed and compiled into a series of attached
state machines.
For example, the glob patttern `*(a|[c-d]|+(x|y|z))z` would
compile to a state machine something like the following flow
diagram:
```
-->+----------------------->+-->8 LITERAL(z)-->9 end
v ^
+<-----------------------6
v ^
0-->LITERAL(a)---------->|
v |
1-->CLASS(c-d)---------->|
v |
2-->+<---------------+-->+
v ^
3-->LITERAL(x)-->7
v |
4-->LITERAL(y)-->|
v |
5-->LITERAL(z)-->+
```
Then, for each character in the string, we walk through the
resulting graph until we find a test node.
These test nodes are all executed on the current character, and
for any tests pass, their output nodes are added to the walk, and
we proceed to walk until hitting a test node again.
Because all routes eventually get to the exit, which only passes
when the string is at its last character, we are guaranteed to
eventually either fail (and have no more states to process), or
exit with a match.
At each branching point, effectively we increase the memory usage
by a tiny bit to track which nodes are being processed, but
importantly, we _don't_ have to try all the way to the exit and
then backtrack recursively, storing multiple states of the string
in an exponential explosion.
A pattern like `a*a*a*a*a*a*a*a*a*a*a`, which could be naively
converted into a Regular Expression
`^a.*a.*a.*a.*a.*a.*a.*a.*a.*a.*a$`, would take over 33 seconds
to match the string `'a'.repeat(50) + 'b'` using standard
JavaScript regular expressions, because it must attempt every
possible grouping of characters, backtracking after each failure.
By contrast, this implementation can solve this match for either
a pass or failure in roughly the same amount of time, which
is bound by `C * N`, where `C` is the number of states in the
machine, and `N` is the length of the string, finishing both
failure and success cases in polynomial time.
Even on the first rather naive implementation in JavaScript, with
no optimizations for repeated `*` or other common tweaks, this
finishes in 300-400 µs for the pathological case described, and
as the numbers increase, this time rises roughly linearly.
That's somewhat worse than RegExp's performance in the _success_
case, which is around 40µs, but as it's around 100,000x faster in
the failure case, this is already quite promising. And, future
iterations of this can likely bring that performance closer to
the native RegExp implementation.
## Acknowledgement
The algorithm and ideas in this implementation are inspired,
borrowed, and at times outright stolen from [Russ
Cox](https://research.swtch.com)'s explanation of Ken Thompson's
work in [Regular Expression Matching Can Be Simple And
Fast](https://swtch.com/~rsc/regexp/regexp1.html). I am both
impressed by and grateful for their work.
The code here in this library was written entirely by me, [Isaac
Z. Schlueter](https://izs.me), and so you should not blame either
of them (or anyone else) for any problems it might have. You
should also not blame me. It's open source, after all, no
warrantees express or implied, etc.
@@ -0,0 +1 @@
{"version":3,"file":"unlink.js","sources":["../../../src/icons/unlink.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Unlink\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTguODQgMTIuMjUgMS43Mi0xLjcxaC0uMDJhNS4wMDQgNS4wMDQgMCAwIDAtLjEyLTcuMDcgNS4wMDYgNS4wMDYgMCAwIDAtNi45NSAwbC0xLjcyIDEuNzEiIC8+CiAgPHBhdGggZD0ibTUuMTcgMTEuNzUtMS43MSAxLjcxYTUuMDA0IDUuMDA0IDAgMCAwIC4xMiA3LjA3IDUuMDA2IDUuMDA2IDAgMCAwIDYuOTUgMGwxLjcxLTEuNzEiIC8+CiAgPGxpbmUgeDE9IjgiIHgyPSI4IiB5MT0iMiIgeTI9IjUiIC8+CiAgPGxpbmUgeDE9IjIiIHgyPSI1IiB5MT0iOCIgeTI9IjgiIC8+CiAgPGxpbmUgeDE9IjE2IiB4Mj0iMTYiIHkxPSIxOSIgeTI9IjIyIiAvPgogIDxsaW5lIHgxPSIxOSIgeDI9IjIyIiB5MT0iMTYiIHkyPSIxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/unlink\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 Unlink = createLucideIcon('Unlink', [\n [\n 'path',\n {\n d: 'm18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71',\n key: 'yqzxt4',\n },\n ],\n [\n 'path',\n {\n d: 'm5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71',\n key: '4qinb0',\n },\n ],\n ['line', { x1: '8', x2: '8', y1: '2', y2: '5', key: '1041cp' }],\n ['line', { x1: '2', x2: '5', y1: '8', y2: '8', key: '14m1p5' }],\n ['line', { x1: '16', x2: '16', y1: '19', y2: '22', key: 'rzdirn' }],\n ['line', { x1: '19', x2: '22', y1: '16', y2: '16', key: 'ox905f' }],\n]);\n\nexport default Unlink;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,CACA,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;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,CACA,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,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC9D,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,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC9D,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,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,CAClE,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,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;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,51 @@
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, getProperty, Code, Name} from "../../compile/codegen"
import N from "../../compile/names"
import {callRef} from "../core/ref"
const def: CodeKeywordDefinition = {
keyword: "$dynamicRef",
schemaType: "string",
code: (cxt) => dynamicRef(cxt, cxt.schema),
}
export function dynamicRef(cxt: KeywordCxt, ref: string): void {
const {gen, keyword, it} = cxt
if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`)
const anchor = ref.slice(1)
if (it.allErrors) {
_dynamicRef()
} else {
const valid = gen.let("valid", false)
_dynamicRef(valid)
cxt.ok(valid)
}
function _dynamicRef(valid?: Name): void {
// TODO the assumption here is that `recursiveRef: #` always points to the root
// of the schema object, which is not correct, because there may be $id that
// makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
// Because of that 2 tests in recursiveRef.json fail.
// This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
// (This problem is not tested in JSON-Schema-Test-Suite)
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`)
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid))
} else {
_callRef(it.validateName, valid)()
}
}
function _callRef(validate: Code, valid?: Name): () => void {
return valid
? () =>
gen.block(() => {
callRef(cxt, validate)
gen.let(valid, true)
})
: () => callRef(cxt, validate)
}
}
export default def
@@ -0,0 +1,66 @@
import { Z as skipChainExpression, f as createRule, g as import_ast_utils } from "../utils.js";
var newline_per_chained_call_default = createRule({
name: "newline-per-chained-call",
meta: {
type: "layout",
docs: { description: "Require a newline after each call in a method chain" },
fixable: "whitespace",
schema: [{
type: "object",
properties: { ignoreChainWithDepth: {
type: "integer",
minimum: 1,
maximum: 10
} },
additionalProperties: false
}],
defaultOptions: [{ ignoreChainWithDepth: 2 }],
messages: { expected: "Expected line break before `{{callee}}`." }
},
create(context, [options]) {
const { ignoreChainWithDepth } = options;
const sourceCode = context.sourceCode;
function getPrefix(node) {
if (node.computed) {
if (node.optional) return "?.[";
return "[";
}
if (node.optional) return "?.";
return ".";
}
function getPropertyText(node) {
const prefix = getPrefix(node);
const lines = sourceCode.getText(node.property).split(import_ast_utils.LINEBREAK_MATCHER);
const suffix = node.computed && lines.length === 1 ? "]" : "";
return prefix + lines[0] + suffix;
}
return { "CallExpression:exit": function(node) {
const callee = skipChainExpression(node.callee);
if (callee.type !== "MemberExpression") return;
let parent = skipChainExpression(callee.object);
let depth = 1;
while (parent && "callee" in parent && parent.callee) {
depth += 1;
const parentCallee = skipChainExpression(parent.callee);
if (!("object" in parentCallee)) break;
parent = skipChainExpression(parentCallee.object);
}
if (depth > ignoreChainWithDepth && (0, import_ast_utils.isTokenOnSameLine)(callee.object, callee.property)) {
const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, import_ast_utils.isNotClosingParenToken);
context.report({
node: callee.property,
loc: {
start: firstTokenAfterObject.loc.start,
end: callee.loc.end
},
messageId: "expected",
data: { callee: getPropertyText(callee) },
fix(fixer) {
return fixer.insertTextBefore(firstTokenAfterObject, "\n");
}
});
}
} };
}
});
export { newline_per_chained_call_default as t };
@@ -0,0 +1,80 @@
import type { SourceMapSegment } from './sourcemap-segment.cts';
import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.cts';
export type { SourceMapSegment } from './sourcemap-segment.cts';
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.cts';
export declare const LEAST_UPPER_BOUND = -1;
export declare const GREATEST_LOWER_BOUND = 1;
export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.cts';
export declare class TraceMap implements SourceMap {
version: SourceMapV3['version'];
file: SourceMapV3['file'];
names: SourceMapV3['names'];
sourceRoot: SourceMapV3['sourceRoot'];
sources: SourceMapV3['sources'];
sourcesContent: SourceMapV3['sourcesContent'];
ignoreList: SourceMapV3['ignoreList'];
resolvedSources: string[];
private _encoded;
private _decoded;
private _decodedMemo;
private _bySources;
private _bySourceMemos;
constructor(map: Ro<SourceMapInput>, mapUrl?: string | null);
}
/**
* Returns the encoded (VLQ string) form of the SourceMap's mappings field.
*/
export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'];
/**
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
*/
export declare function decodedMappings(map: TraceMap): Readonly<DecodedSourceMap['mappings']>;
/**
* 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 declare function traceSegment(map: TraceMap, line: number, column: number): Readonly<SourceMapSegment> | null;
/**
* 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 declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping;
/**
* Finds the generated line/column position of the provided source/line/column source position.
*/
export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping;
/**
* Finds all generated line/column positions of the provided source/line/column source position.
*/
export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[];
/**
* Iterates each mapping in generated position order.
*/
export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void;
/**
* Retrieves the source content for a particular source, if its found. Returns null if not.
*/
export declare function sourceContentFor(map: TraceMap, source: string): string | null;
/**
* Determines if the source is marked to ignore by the source map.
*/
export declare function isIgnored(map: TraceMap, source: string): boolean;
/**
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger
* maps.
*/
export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap;
/**
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export declare function decodedMap(map: TraceMap): Omit<DecodedSourceMap, 'mappings'> & {
mappings: readonly SourceMapSegment[][];
};
/**
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export declare function encodedMap(map: TraceMap): EncodedSourceMap;
//# sourceMappingURL=trace-mapping.d.ts.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2025_collection: LibDefinition;
@@ -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 BookHeart = createLucideIcon("BookHeart", [
[
"path",
{
d: "M16 8.2A2.22 2.22 0 0 0 13.8 6c-.8 0-1.4.3-1.8.9-.4-.6-1-.9-1.8-.9A2.22 2.22 0 0 0 8 8.2c0 .6.3 1.2.7 1.6A226.652 226.652 0 0 0 12 13a404 404 0 0 0 3.3-3.1 2.413 2.413 0 0 0 .7-1.7",
key: "1t75a8"
}
],
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
]
]);
export { BookHeart as default };
//# sourceMappingURL=book-heart.js.map
@@ -0,0 +1,28 @@
import type Ajv from "../../core"
import type {AnySchemaObject} from "../../types"
import * as metaSchema from "./schema.json"
import * as applicator from "./meta/applicator.json"
import * as content from "./meta/content.json"
import * as core from "./meta/core.json"
import * as format from "./meta/format.json"
import * as metadata from "./meta/meta-data.json"
import * as validation from "./meta/validation.json"
const META_SUPPORT_DATA = ["/properties"]
export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv {
;[
metaSchema,
applicator,
content,
core,
with$data(this, format),
metadata,
with$data(this, validation),
].forEach((sch) => this.addMetaSchema(sch, undefined, false))
return this
function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject {
return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch
}
}
@@ -0,0 +1,68 @@
import { HTTPException } from "../../http-exception.js";
//#region src/middleware/body-limit/index.ts
const ERROR_MESSAGE = "Payload Too Large";
/**
* Body Limit Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/body-limit}
*
* @param {BodyLimitOptions} options - The options for the body limit middleware.
* @param {number} options.maxSize - The maximum body size allowed.
* @param {OnError} [options.onError] - The error handler to be invoked if the specified body size is exceeded.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.post(
* '/upload',
* bodyLimit({
* maxSize: 50 * 1024, // 50kb
* onError: (c) => {
* return c.text('overflow :(', 413)
* },
* }),
* async (c) => {
* const body = await c.req.parseBody()
* if (body['file'] instanceof File) {
* console.log(`Got file sized: ${body['file'].size}`)
* }
* return c.text('pass :)')
* }
* )
* ```
*/
const bodyLimit = (options) => {
const onError = options.onError || (() => {
const res = new Response(ERROR_MESSAGE, { status: 413 });
throw new HTTPException(413, { res });
});
const maxSize = options.maxSize;
return async function bodyLimit(c, next) {
if (!c.req.raw.body) return next();
const hasTransferEncoding = c.req.raw.headers.has("transfer-encoding");
if (c.req.raw.headers.has("content-length") && !hasTransferEncoding) return parseInt(c.req.raw.headers.get("content-length") || "0", 10) > maxSize ? onError(c) : next();
let size = 0;
const chunks = [];
const rawReader = c.req.raw.body.getReader();
for (;;) {
const { done, value } = await rawReader.read();
if (done) break;
size += value.length;
if (size > maxSize) return onError(c);
chunks.push(value);
}
const requestInit = {
body: new ReadableStream({ start(controller) {
for (const chunk of chunks) controller.enqueue(chunk);
controller.close();
} }),
duplex: "half"
};
c.req.raw = new Request(c.req.raw, requestInit);
return next();
};
};
//#endregion
export { bodyLimit };
@@ -0,0 +1,58 @@
//TODO: handle reviver/dehydrate function like normal
//and handle indentation, like normal.
//if anyone needs this... please send pull request.
exports.stringify = function stringify (o) {
if('undefined' == typeof o) return o
if(o && Buffer.isBuffer(o))
return JSON.stringify(':base64:' + o.toString('base64'))
if(o && o.toJSON)
o = o.toJSON()
if(o && 'object' === typeof o) {
var s = ''
var array = Array.isArray(o)
s = array ? '[' : '{'
var first = true
for(var k in o) {
var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])
if(Object.hasOwnProperty.call(o, k) && !ignore) {
if(!first)
s += ','
first = false
if (array) {
if(o[k] == undefined)
s += 'null'
else
s += stringify(o[k])
} else if (o[k] !== void(0)) {
s += stringify(k) + ':' + stringify(o[k])
}
}
}
s += array ? ']' : '}'
return s
} else if ('string' === typeof o) {
return JSON.stringify(/^:/.test(o) ? ':' + o : o)
} else if ('undefined' === typeof o) {
return 'null';
} else
return JSON.stringify(o)
}
exports.parse = function (s) {
return JSON.parse(s, function (key, value) {
if('string' === typeof value) {
if(/^:base64:/.test(value))
return Buffer.from(value.substring(8), 'base64')
else
return /^:/.test(value) ? value.substring(1) : value
}
return value
})
}
@@ -0,0 +1,3 @@
declare const ImageDataPlugin: any;
export default ImageDataPlugin;
//# sourceMappingURL=image-data.d.ts.map
@@ -0,0 +1,79 @@
"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`
module.exports = {
extends: ['./configs/eslintrc/base', './configs/eslintrc/eslint-recommended'],
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,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const HeartPulse = createLucideIcon("HeartPulse", [
[
"path",
{
d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",
key: "c3ymky"
}
],
["path", { d: "M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27", key: "1uw2ng" }]
]);
export { HeartPulse as default };
//# sourceMappingURL=heart-pulse.js.map
@@ -0,0 +1,949 @@
flf2a$ 9 7 13 15 30
NTGreek by Bruce Jakeway--based on Standard by Glenn Chappell & Ian Chai
Questions and comments regarding ntgreek.flf to pbjakeway@neumann.uwaterloo.ca
For figlet release 2.0
Date: 1994 Apr 2
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
9 - height of a character
7 - height of a character, not including descenders
13 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
30 - number of comment lines
Greek keyboard maps:
All keys map to those in standard except:
alpha = A,a lambda = L,l phi = F,f rough breathing = (
beta = B,b mu = M,m chi = C,c smooth breathing = )
gamma = G,g nu = N,n psi = Y,y acute accent = '
delta = D,d xi = X,x omega = w,w grave accent = `
epsilon = E,e omicron = O,o script theta = J diaresis = ^
zeta = Z,z pi = P,p script phi = j
eta = H,h rho = R,r final sigma = V
theta = Q,q sigma = S,s omega bar = v
iota = I,i tau = T,t raised period = :
kappa = K,k upsilon = U,u iota subscript = _
$@
$@
$@
$@
$@
$@
$@
$@
$@@
@
_ @
| |@
| |@
|_|@
_ @
(_)@
@
@@
@
_ _ @
( )( )@
V V @
@
@
$ @
@
@@
@
_ _ @
_| |_| |_ @
(_ _ _)@
_| |_| |_ @
(_ _ _)@
|_| |_| @
@
@@
_ @
_| |_ @
/ _) @
( (| |_ @
\_ \ @
_| |) )@
(_ _/ @
|_| @
@@
@
_ __@
(_) / /@
/ / @
/ / @
/ / _ @
/_/ (_)@
@
@@
@
___ @
/ \ @
\ O / @
/ _ \/\@
( (_> <@
\___/\/@
@
@@
@
@
//@
// @
@
@
@
@
@@
@
@
@
((@
@
@
@
@
@@
@
@
@
))@
@
@
@
@
@@
@
@
__/\__@
\ /@
/_ _\@
\/ @
@
@
@@
@
@
_ @
_| |_ @
(_ _)@
|_| @
@
@
@@
@
@
$ @
@
@
_ @
( )@
|/ @
@@
@
@
@
_____ @
(_____)@
@
$ @
@
@@
@
@
$ @
@
@
_ @
(_)@
@
@@
@
__@
/ /@
/ / @
/ / @
/ / @
/_/ @
@
@@
@
___ @
/ _ \ @
| | | |@
| | | |@
| |_| |@
\___/ @
@
@@
@
_ @
/ |@
- |@
| |@
| |@
|_|@
@
@@
@
____ @
(___ \ @
__) )@
/ __/ @
| |___ @
|_____)@
@
@@
@
_____ @
(__ / @
/ / @
(__ \ @
___) )@
(____/ @
@
@@
@
_ @
/ | @
/ o |_ @
/__ _)@
| | @
|_| @
@
@@
@
____ @
| __) @
| |__ @
|___ \ @
___) )@
(____/ @
@
@@
@
__ @
/ / @
/ /_ @
| '_ \ @
| (_) )@
\___/ @
@
@@
@
_____ @
(___ )@
_/ / @
( _) @
/ / @
/_/ @
@
@@
@
___ @
/ \ @
\ O / @
/ _ \ @
( (_) )@
\___/ @
@
@@
@
___ @
/ _ \ @
( (_) |@
\__, |@
/ / @
/_/ @
@
@@
@
@
$ @
_ @
(_)@
@
$ @
@
@@
@
@
@
_ @
(_)@
_ @
( )@
|/ @
@@
@
__@
/ /@
/ / @
< < @
\ \ @
\_\@
@
@@
@
@
_____ @
(_____)@
_____ @
(_____)@
@
@
@@
@
__ @
\ \ @
\ \ @
> >@
/ / @
/_/ @
@
@@
@
___ @
(__ \@
/ /@
|_| @
_ @
(_) @
@
@@
@
_____ @
/ ___ \ @
/ / | |@
( ( () | |@
\ \____/_@
\______/@
@
@@
@
___ @
/ _ \ @
| |_| |@
| _ |@
| | | |@
|_| |_|@
@
@@
@
____ @
| _ \ @
| |_) )@
| _ ( @
| |_) )@
|____/ @
@
@@
@
__ __@
\ \ / /@
\ v / @
> < @
/ ^ \ @
/_/ \_\@
@
@@
@
@
/\ @
/ \ @
/ /\ \ @
/ /__\ \ @
/________\@
@
@@
@
_____ @
| ___)@
| |_ @
| _) @
| |___ @
|_____)@
@
@@
@
_ @
_| |_ @
/ \ @
( (| |) )@
\_ _/ @
|_| @
@
@@
@
_____ @
| ___)@
| |$ @
| |$ @
| | @
|_| @
@
@@
@
_ _ @
| | | |@
| |_| |@
| _ |@
| | | |@
|_| |_|@
@
@@
@
___ @
( )@
| | @
| | @
| | @
(___)@
@
@@
@
___ @
/ _ \ @
( (_| |_ @
_ \ _ _)@
| |___| | @
\_____/ @
@
@@
@
_ __@
| | / /@
| |/ / @
| < @
| |\ \ @
|_| \_\@
@
@@
@
@
/\ @
/ \ @
/ /\ \ @
/ / \ \ @
/_/ \_\@
@
@@
@
__ __ @
| \ / |@
| v |@
| |\_/| |@
| | | |@
|_| |_|@
@
@@
@
_ _ @
| \ | |@
| \| |@
| |@
| |\ |@
|_| \_|@
@
@@
@
___ @
/ _ \ @
| | | |@
| | | |@
| |_| |@
\___/ @
@
@@
@
_______ @
( _ )@
| | | | @
| | | | @
| | | | @
|_| |_| @
@
@@
@
____ @
/ __ \ @
| |__| |@
| __ |@
| |__| |@
\____/ @
@
@@
@
____ @
| _ \ @
| |_) )@
| __/ @
| | @
|_| @
@
@@
@
______ @
\ ___)@
\ \ @
> > @
/ /__ @
/_____)@
@
@@
@
_____ @
(_ _)@
| | @
| | @
| | @
|_| @
@
@@
@
__ __ @
(_ \ / _)@
\ v / @
| | @
| | @
|_| @
@
@@
@
@
@
____ @
/ ___)@
( (__ @
\__ \ @
_) )@
(__/ @@
@
____ @
/ __ \ @
| | | | @
| | | | @
_\ \/ /_ @
(___||___)@
@
@@
@
_____ @
(_____)@
___ @
(___) @
_____ @
(_____)@
@
@@
@
_ _ _ @
| || || |@
| \| |/ |@
\_ _/ @
| | @
|_| @
@
@@
@
______@
(___ /@
/ / @
/ / @
/ /__ @
/_____)@
@
@@
___ @
| _)@
| | @
| | @
| | @
| | @
| |_ @
|___)@
@@
@
__ @
\ \ @
\ \ @
\ \ @
\ \ @
\_\@
@
@@
___ @
(_ |@
| |@
| |@
| |@
| |@
_| |@
(___|@
@@
@
_ _ @
(_) (_)@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
||@@
@
@
\\ @
\\@
@
@
@
@
@@
@
@
@
__ __@
/ \/ /@
( () < @
\__/\_\@
@
@@
@
___ @
/ _ \ @
| |_) )@
| _ < @
| |_) )@
| __/ @
| | @
|_| @@
@
@
@
__ __@
\ \ / /@
\ v / @
> < @
/ ^ \ @
/_/ \_\@@
@
__ @
/ _) @
\ \ @
/ _ \ @
( (_) )@
\___/ @
@
@@
@
@
@
___ @
/ __)@
> _) @
\___)@
@
@@
@
_ @
| | @
_| |_ @
/ \ @
( (| |) )@
\_ _/ @
| | @
|_| @@
@
@
@
_ _ @
( \ / )@
\ v / @
| | @
| | @
|_| @@
@
@
@
_ __ @
| '_ \ @
| | | |@
|_| | |@
| |@
|_|@@
@
@
@
_ @
| | @
| | @
\_)@
@
@@
@
@
@
_ __ @
| | / \ @
| || || )@
\_ _/ @
| | @
|_| @@
@
@
@
_ __@
| |/ /@
| < @
|_|\_\@
@
@@
@
__ @
\ \ @
\ \ @
> \ @
/ ^ \ @
/_/ \_\@
@
@@
@
@
@
_ _ @
| | | |@
| |_| |@
| ._,_|@
| | @
|_| @@
@
@
@
_ __@
| |/ /@
| / / @
|__/ @
@
@@
@
@
@
___ @
/ _ \ @
( (_) )@
\___/ @
@
@@
@
@
@
______ @
( __ )@
| || | @
|_||_| @
@
@@
@
___ @
/ _ \ @
| |_| |@
| _ |@
| |_| |@
\___/ @
@
@@
@
@
@
___ @
/ _ \ @
| |_) )@
| __/ @
| | @
|_| @@
@
@
@
____ @
/ ._)@
( () ) @
\__/ @
@
@@
@
@
@
___ @
( )@
| | @
\_)@
@
@@
@
@
@
_ _ @
| | | |@
| |_| |@
\___/ @
@
@@
@
@
@
_________ @
( _____ )@
| |_/ \_| |@
\___^___/ @
@
@@
@
@
@
__ __ @
/ / _ \ \ @
| |_/ \_| |@
\___^___/ @
@
@@
__ @
\ \__ @
> __) @
( (_ @
> _) @
( (__ @
\__ \ @
) )@
(_/ @@
@
@
@
_ _ _ @
| || || |@
| \| |/ |@
\_ _/ @
| | @
|_| @@
@
_____ @
\__ ) @
/ / @
/ / @
| |__ @
\__ \ @
) )@
(_/ @@
__@
/ /@
| | @
| | @
< < @
| | @
| | @
\_\@
@@
_ @
| |@
| |@
| |@
| |@
| |@
| |@
|_|@
@@
__ @
\ \ @
| | @
| | @
> >@
| | @
| | @
/_/ @
@@
@
/\/|@
|/\/ @
@
@
@
@
@
@@
_ _ @
(_)_(_)@
/ _ \ @
| |_| |@
| _ |@
| | | |@
|_| |_|@
@
@@
_ _ @
(_)_(_)@
/ _ \ @
| | | |@
| | | |@
| |_| |@
\___/ @
@
@@
_ _ @
(_) (_)@
| | | |@
| | | |@
| | | |@
| |_| |@
\___/ @
@
@@
@
@
_ _ @
(_)_(_)@
/ _` |@
( (_| |@
\__,_|@
@
@@
@
@
_ _ @
(_)_(_)@
/ _ \ @
( (_) )@
\___/ @
@
@@
@
@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\__,_|@
@
@@
@
___ @
/ _ \ @
| | ) )@
| |< < @
| | ) )@
| ||_/ @
|_| @
@@
@@ -0,0 +1,54 @@
var BrowserslistError = require('./error')
function noop() {}
module.exports = {
loadQueries: function loadQueries() {
throw new BrowserslistError(
'Sharable configs are not supported in client-side build of Browserslist'
)
},
getStat: function getStat(opts) {
return opts.stats
},
loadConfig: function loadConfig(opts) {
if (opts.config) {
throw new BrowserslistError(
'Browserslist config are not supported in client-side build'
)
}
},
loadCountry: function loadCountry() {
throw new BrowserslistError(
'Country statistics are not supported ' +
'in client-side build of Browserslist'
)
},
loadFeature: function loadFeature() {
throw new BrowserslistError(
'Supports queries are not available in client-side build of Browserslist'
)
},
currentNode: function currentNode(resolve, context) {
return resolve(['maintained node versions'], context)[0]
},
parseConfig: noop,
readConfig: noop,
findConfig: noop,
findConfigFile: noop,
clearCaches: noop,
oldDataWarning: noop,
env: {}
}
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isLet;
var _index = require("./generated/index.js");
var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
function isLet(node) {
return (0, _index.isVariableDeclaration)(node) && (node.kind !== "var" || node[BLOCK_SCOPED_SYMBOL]);
}
//# sourceMappingURL=isLet.js.map
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildUndefinedNode = buildUndefinedNode;
var _index = require("./generated/index.js");
function buildUndefinedNode() {
return (0, _index.unaryExpression)("void", (0, _index.numericLiteral)(0), true);
}
//# sourceMappingURL=productions.js.map
@@ -0,0 +1 @@
module.exports={C:{"115":0.10813,"120":0.07398,"121":0.29593,"156":0.36422,_:"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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 157 158 159 160 3.5 3.6"},D:{"92":0.03415,"103":0.03415,"106":0.03415,"111":0.03415,"116":0.03415,"118":1.02438,"119":0.22195,"120":0.29593,"131":0.03415,"132":0.03415,"142":0.10813,"144":0.51219,"148":0.66016,"149":7.07391,"150":9.63486,"151":12.6454,"152":11.65517,"153":2.0886,"154":0.29593,"156":0.14797,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 104 105 107 108 109 110 112 113 114 115 117 121 122 123 124 125 126 127 128 129 130 133 134 135 136 137 138 139 140 141 143 145 146 147 155 157"},F:{"135":0.10813,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 133 134 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"119":0.03415,"120":0.10813,"142":0.03415,"150":0.03415,"151":0.10813,"152":2.38453,"153":1.3943,"154":0.73414,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 143 144 145 146 147 148 149"},E:{"27":0.03415,_:"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 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.4 17.6 18.0 18.1 18.2 18.4 18.5-18.7 26.0 26.1 26.3 26.4 27.1 27.2 TP","16.6":0.03415,"17.5":0.03415,"18.3":0.03415,"26.2":0.18211,"26.5":0.33008,"26.6":1.90649},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00238,"5.0-5.1":0.00238,"6.0-6.1":0,"7.0-7.1":0.00476,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.0238,"11.0-11.2":0.00238,"11.3-11.4":0.00476,"12.0-12.1":0,"12.2-12.5":0.06189,"13.0-13.1":0,"13.2":0.0119,"13.3":0,"13.4-13.7":0.00238,"14.0-14.4":0.00952,"14.5-14.8":0.01428,"15.0-15.1":0.01428,"15.2-15.3":0.00952,"15.4":0.0119,"15.5":0.01428,"15.6-15.8":0.30944,"16.0":0.0238,"16.1":0.04285,"16.2":0.0238,"16.3":0.05237,"16.4":0.0119,"16.5":0.01904,"16.6-16.7":0.43083,"17.0":0.01666,"17.1":0.0238,"17.2":0.0238,"17.3":0.0357,"17.4":0.04999,"17.5":0.09759,"17.6-17.7":0.25231,"18.0":0.05237,"18.1":0.10473,"18.2":0.14282,"18.3":0.24755,"18.4":0.15472,"18.5-18.7":3.19673,"26.0":0.15472,"26.1":0.1571,"26.2":0.40941,"26.3":0.44273,"26.4":0.32372,"26.5":2.16845,"26.6":13.37962,"27.0":1.02591,"27.1":0,"27.2":0.02618},P:{"26":0.04332,"29":0.04332,"30":0.71483,_:"4 20 21 22 23 24 25 27 28 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":19.36064},R:{_:"0"},M:{"0":0.12496},Q:{_:"14.9"},O:{_:"0"},H:{all:0}};
@@ -0,0 +1,46 @@
import * as React from 'react';
type ContextProvider<ContextValueType extends object | null> = React.FC<ContextValueType & {
children: React.ReactNode;
}>;
interface UseAssertedContext<ContextValueType extends object | null> {
(consumerName: string): ContextValueType;
}
interface UseContext<ContextValueType extends object | null> {
(consumerName: string): ContextValueType;
(consumerName: string, options: {
optional: true;
}): ContextValueType | undefined;
}
declare function createContext<ContextValueType extends object | null>(rootComponentName: string): readonly [ContextProvider<ContextValueType>, UseContext<ContextValueType>];
declare function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext: ContextValueType): readonly [ContextProvider<ContextValueType>, UseAssertedContext<ContextValueType>];
type Scope<C = any> = {
[scopeName: string]: React.Context<C>[];
} | undefined;
type ScopeHook = (scope: Scope) => {
[__scopeProp: string]: Scope;
};
interface CreateScope {
scopeName: string;
(): ScopeHook;
}
type ScopedContextProvider<ContextValueType extends object | null> = React.FC<ContextValueType & {
scope: Scope<ContextValueType>;
children: React.ReactNode;
}>;
interface UseScopedContext<ContextValueType extends object | null> {
(consumerName: string, scope: Scope<ContextValueType | undefined>): ContextValueType;
(consumerName: string, scope: Scope<ContextValueType | undefined>, options: {
optional?: true;
}): ContextValueType | undefined;
}
interface UseAssertedScopedContext<ContextValueType extends object | null> {
(consumerName: string, scope: Scope<ContextValueType | undefined>): ContextValueType;
}
interface CreateScopedContext {
<ContextValueType extends object | null>(rootComponentName: string): readonly [ScopedContextProvider<ContextValueType>, UseScopedContext<ContextValueType>];
<ContextValueType extends object | null>(rootComponentName: string, defaultContext: ContextValueType): readonly [ScopedContextProvider<ContextValueType>, UseAssertedScopedContext<ContextValueType>];
}
declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [CreateScopedContext, CreateScope];
export { type CreateScope, type Scope, createContext, createContextScope };
@@ -0,0 +1,882 @@
export declare const draft: "7";
export declare const $schema: "https://json-schema.org/draft-07/schema";
type MaybeReadonlyArray<T> = Array<T> | ReadonlyArray<T>;
type ValueOf<T> = T[keyof T];
/**
* JSON Schema [Draft 7](https://json-schema.org/draft-07/json-schema-validation.html)
*/
export type JSONSchema<Value = any, SchemaType = Value extends boolean ? "boolean" : Value extends null ? "null" : Value extends number ? "number" | "integer" : Value extends string ? "string" : Value extends unknown[] ? "array" : Value extends Record<string | number, unknown> ? "object" : JSONSchema.TypeValue> = boolean | {
/**
* This keyword is reserved for comments from schema authors to readers or
* maintainers of the schema. The value of this keyword MUST be a string.
* Implementations MUST NOT present this string to end users. Tools for
* editing schemas SHOULD support displaying and editing this keyword.
*
* The value of this keyword MAY be used in debug or error output which is
* intended for developers making use of schemas. Schema vocabularies
* SHOULD allow `comment` within any object containing vocabulary
* keywords.
*
* Implementations MAY assume `comment` is allowed unless the vocabulary
* specifically forbids it. Vocabularies MUST NOT specify any effect of
* `comment` beyond what is described in this specification. Tools that
* translate other media types or programming languages to and from
* `application/schema+json` MAY choose to convert that media type or
* programming language's native comments to or from `comment` values.
*
* The behavior of such translation when both native comments and
* `comment` properties are present is implementation-dependent.
* Implementations SHOULD treat `comment` identically to an unknown
* extension keyword.
*
* They MAY strip `comment` values at any point during processing. In
* particular, this allows for shortening schemas when the size of deployed
* schemas is a concern. Implementations MUST NOT take any other action
* based on the presence, absence, or contents of `comment` properties.
*/
$comment?: string;
/**
* The `$id` keyword defines a URI for the schema, and the base URI that
* other URI references within the schema are resolved against. A
* subschema's `$id` is resolved against the base URI of its parent
* schema. If no parent sets an explicit base with `$id`, the base URI is
* that of the entire document, as determined per
* [RFC 3986 section 5][RFC3986].
*
* If present, the value for this keyword MUST be a string, and MUST
* represent a valid [URI-reference][RFC3986]. This value SHOULD be
* normalized, and SHOULD NOT be an empty fragment `#` or an empty string.
*
* [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
*
* @format "uri-reference"
*/
$id?: string;
/**
* The `$ref` keyword is used to reference a schema, and provides the
* ability to validate recursive structures through self-reference.
*
* An object schema with a `$ref` property MUST be interpreted as a
* `$ref` reference. The value of the `$ref` property MUST be a URI
* Reference. Resolved against the current URI base, it identifies the URI
* of a schema to use. All other properties in a `$ref` object MUST be
* ignored.
*
* The URI is not a network locator, only an identifier. A schema need not
* be downloadable from the address if it is a network-addressable URL, and
* implementations SHOULD NOT assume they should perform a network
* operation when they encounter a network-addressable URI.
*
* A schema MUST NOT be run into an infinite loop against a schema. For
* example, if two schemas `"#alice"` and `"#bob"` both have an
* `allOf` property that refers to the other, a naive validator might get
* stuck in an infinite recursive loop trying to validate the instance.
* Schemas SHOULD NOT make use of infinite recursive nesting like this; the
* behavior is undefined.
*
* @format "uri-reference"
*/
$ref?: string;
/**
* The `$schema` keyword is both used as a JSON Schema version identifier
* and the location of a resource which is itself a JSON Schema, which
* describes any schema written for this particular version.
*
* The value of this keyword MUST be a [URI][RFC3986] (containing a scheme)
* and this URI MUST be normalized. The current schema MUST be valid
* against the meta-schema identified by this URI.
*
* If this URI identifies a retrievable resource, that resource SHOULD be
* of media type `application/schema+json`.
*
* The `$schema` keyword SHOULD be used in a root schema. It MUST NOT
* appear in subschemas.
*
* Values for this property are defined in other documents and by other
* parties. JSON Schema implementations SHOULD implement support for
* current and previous published drafts of JSON Schema vocabularies as
* deemed reasonable.
*
* [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
*
* @format "uri"
*/
$schema?: string;
/**
* The value of `additionalItems` MUST be a valid JSON Schema.
*
* This keyword determines how child instances validate for arrays, and
* does not directly validate the immediate instance itself.
*
* If `items` is an array of schemas, validation succeeds if every
* instance element at a position greater than the size of `items`
* validates against `additionalItems`.
*
* Otherwise, `additionalItems` MUST be ignored, as the `items` schema
* (possibly the default value of an empty schema) is applied to all
* elements.
*
* Omitting this keyword has the same behavior as an empty schema.
*/
additionalItems?: JSONSchema;
/**
* The value of `additionalProperties` MUST be a valid JSON Schema.
*
* This keyword determines how child instances validate for objects, and
* does not directly validate the immediate instance itself.
*
* Validation with `additionalProperties` applies only to the child
* values of instance names that do not match any names in `properties`,
* and do not match any regular expression in `patternProperties`.
*
* For all such properties, validation succeeds if the child instance
* validates against the `additionalProperties` schema.
*
* Omitting this keyword has the same behavior as an empty schema.
*/
additionalProperties?: JSONSchema;
/**
* This keyword's value MUST be a non-empty array. Each item of the array
* MUST be a valid JSON Schema.
*
* An instance validates successfully against this keyword if it validates
* successfully against all schemas defined by this keyword's value.
*/
allOf?: MaybeReadonlyArray<JSONSchema<Value, SchemaType>>;
/**
* This keyword's value MUST be a non-empty array. Each item of the array
* MUST be a valid JSON Schema.
*
* An instance validates successfully against this keyword if it validates
* successfully against at least one schema defined by this keyword's
* value.
*/
anyOf?: MaybeReadonlyArray<JSONSchema<Value, SchemaType>>;
/**
* An instance validates successfully against this keyword if its value is
* equal to the value of the keyword.
*
* Use of this keyword is functionally equivalent to the `enum` keyword
* with a single value.
*/
const?: Value;
/**
* The value of this keyword MUST be a valid JSON Schema.
*
* An array instance is valid against `contains` if at least one of its
* elements is valid against the given schema.
*/
contains?: JSONSchema<Value, SchemaType>;
/**
* If the instance value is a string, this property defines that the
* string SHOULD be interpreted as binary data and decoded using the
* encoding named by this property. [RFC 2045, Sec 6.1][RFC2045] lists the
* possible values for this property.
*
* The value of this property SHOULD be ignored if the instance described
* is not a string.
*
* [RFC2045]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.1
*/
contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
/**
* The value of this property must be a media type, as defined by
* [RFC 2046][RFC2046]. This property defines the media type of instances
* which this schema defines.
*
* The value of this property SHOULD be ignored if the instance described
* is not a string.
*
* If the `contentEncoding` property is not present, but the instance
* value is a string, then the value of this property SHOULD specify a text
* document type, and the character set SHOULD be the character set into
* which the JSON string value was decoded (for which the default is
* Unicode).
*
* [RFC2046]: https://datatracker.ietf.org/doc/html/rfc2046
*/
contentMediaType?: string;
/**
* This keyword can be used to supply a default JSON value associated with
* a particular schema. It is RECOMMENDED that a `default` value be valid
* against the associated schema.
*/
default?: Value;
/**
* The `definitions` keywords provides a standardized location for schema
* authors to inline re-usable JSON Schemas into a more general schema. The
* keyword does not directly affect the validation result.
*
* This keyword's value MUST be an object. Each member value of this object
* MUST be a valid JSON Schema.
*/
definitions?: Record<string, JSONSchema>;
/**
* This keyword specifies rules that are evaluated if the instance is an
* object and contains a certain property.
*
* This keyword's value MUST be an object. Each property specifies a
* dependency. Each dependency value MUST be an array or a valid JSON
* Schema.
*
* If the dependency value is a subschema, and the dependency key is a
* property in the instance, the entire instance must validate against the
* dependency value.
*
* If the dependency value is an array, each element in the array, if any,
* MUST be a string, and MUST be unique. If the dependency key is a
* property in the instance, each of the items in the dependency value must
* be a property that exists in the instance.
*
* Omitting this keyword has the same behavior as an empty object.
*/
dependencies?: Record<string, MaybeReadonlyArray<string> | JSONSchema>;
/**
* Can be used to decorate a user interface with explanation or information
* about the data produced.
*/
description?: string;
/**
* This keyword's value MUST be a valid JSON Schema.
*
* When `if` is present, and the instance fails to validate against its
* subschema, then validation succeeds against this keyword if the instance
* successfully validates against this keyword's subschema.
*
* This keyword has no effect when `if` is absent, or when the instance
* successfully validates against its subschema. Implementations MUST NOT
* evaluate the instance against this keyword, for either validation or
* annotation collection purposes, in such cases.
*/
else?: JSONSchema<Value, SchemaType>;
/**
* The value of this keyword MUST be an array. This array SHOULD have at
* least one element. Elements in the array SHOULD be unique.
*
* An instance validates successfully against this keyword if its value is
* equal to one of the elements in this keyword's array value.
*
* Elements in the array might be of any type, including `null`.
*/
enum?: MaybeReadonlyArray<Value>;
/**
* The value of this keyword MUST be an array. When multiple occurrences of
* this keyword are applicable to a single sub-instance, implementations
* MUST provide a flat array of all values rather than an array of arrays.
*
* This keyword can be used to provide sample JSON values associated with a
* particular schema, for the purpose of illustrating usage. It is
* RECOMMENDED that these values be valid against the associated schema.
*
* Implementations MAY use the value(s) of `default`, if present, as an
* additional example. If `examples` is absent, `default` MAY still be
* used in this manner.
*/
examples?: MaybeReadonlyArray<Value>;
/**
* The value of `exclusiveMaximum` MUST be a number, representing an
* exclusive upper limit for a numeric instance.
*
* If the instance is a number, then the instance is valid only if it has a
* value strictly less than (not equal to) `exclusiveMaximum`.
*/
exclusiveMaximum?: number;
/**
* The value of `exclusiveMinimum` MUST be a number, representing an
* exclusive lower limit for a numeric instance.
*
* If the instance is a number, then the instance is valid only if it has a
* value strictly greater than (not equal to) `exclusiveMinimum`.
*/
exclusiveMinimum?: number;
/**
* The `format` keyword functions as both an [annotation][annotation] and
* as an [assertion][assertion]. While no special effort is required to
* implement it as an annotation conveying semantic meaning, implementing
* validation is non-trivial.
*
* Implementations MAY support the `format` keyword as a validation
* assertion.
*
* Implementations MAY add custom `format` attributes. Save for agreement
* between parties, schema authors SHALL NOT expect a peer implementation
* to support this keyword and/or custom `format` attributes.
*
* [annotation]: https://json-schema.org/draft-07/json-schema-validation.html#annotations
* [assertion]: https://json-schema.org/draft-07/json-schema-validation.html#assertions
*/
format?: string;
/**
* This keyword's value MUST be a valid JSON Schema.
*
* This validation outcome of this keyword's subschema has no direct effect
* on the overall validation result. Rather, it controls which of the
* `then` or `else` keywords are evaluated.
*
* Instances that successfully validate against this keyword's subschema
* MUST also be valid against the subschema value of the `then` keyword,
* if present.
*
* Instances that fail to validate against this keyword's subschema MUST
* also be valid against the subschema value of the `else` keyword, if
* present.
*
* If [annotations][annotations] are being collected, they are collected
* from this keyword's subschema in the usual way, including when the
* keyword is present without either `then` or `else`.
*
* [annotations]: https://json-schema.org/draft-07/json-schema-validation.html#annotations
*/
if?: JSONSchema<Value, SchemaType>;
/**
* The value of `items` MUST be either a valid JSON Schema or an array of
* valid JSON Schemas.
*
* This keyword determines how child instances validate for arrays, and
* does not directly validate the immediate instance itself.
*
* If `items` is a schema, validation succeeds if all elements in the
* array successfully validate against that schema.
*
* If `items` is an array of schemas, validation succeeds if each element
* of the instance validates against the schema at the same position, if
* any.
*
* Omitting this keyword has the same behavior as an empty schema.
*/
items?: MaybeReadonlyArray<JSONSchema> | JSONSchema;
/**
* The value of `maximum` MUST be a number, representing an inclusive
* upper limit for a numeric instance.
*
* If the instance is a number, then this keyword validates only if the
* instance is less than or exactly equal to `maximum`.
*/
maximum?: number;
/**
* The value of this keyword MUST be a non-negative integer.
*
* An array instance is valid against `maxItems` if its size is less
* than, or equal to, the value of this keyword.
*
* @minimum 0
*/
maxItems?: number;
/**
* The value of this keyword MUST be a non-negative integer.
*
* A string instance is valid against this keyword if its length is less
* than, or equal to, the value of this keyword.
*
* The length of a string instance is defined as the number of its
* characters as defined by [RFC 7159][RFC7159].
*
* [RFC7159]: https://datatracker.ietf.org/doc/html/rfc7159
*
* @minimum 0
*/
maxLength?: number;
/**
* The value of this keyword MUST be a non-negative integer.
*
* An object instance is valid against `maxProperties` if its number of
* `properties` is less than, or equal to, the value of this keyword.
*
* @minimum 0
*/
maxProperties?: number;
/**
* The value of `minimum` MUST be a number, representing an inclusive
* lower limit for a numeric instance.
*
* If the instance is a number, then this keyword validates only if the
* instance is greater than or exactly equal to `minimum`.
*/
minimum?: number;
/**
* The value of this keyword MUST be a non-negative integer.
*
* An array instance is valid against `minItems` if its size is greater
* than, or equal to, the value of this keyword.
*
* Omitting this keyword has the same behavior as a value of `0`.
*
* @default 0
* @minimum 0
*/
minItems?: number;
/**
* The value of this keyword MUST be a non-negative integer.
*
* A string instance is valid against this keyword if its length is greater
* than, or equal to, the value of this keyword.
*
* The length of a string instance is defined as the number of its
* characters as defined by [RFC 7159][RFC7159].
*
* Omitting this keyword has the same behavior as a value of `0`.
*
* [RFC7159]: https://datatracker.ietf.org/doc/html/rfc7159
*
* @default 0
* @minimum 0
*/
minLength?: number;
/**
* The value of this keyword MUST be a non-negative integer.
*
* An object instance is valid against `minProperties` if its number of
* `properties` is greater than, or equal to, the value of this keyword.
*
* Omitting this keyword has the same behavior as a value of `0`.
*
* @default 0
* @minimum 0
*/
minProperties?: number;
/**
* The value of `multipleOf` MUST be a number, strictly greater than
* `0`.
*
* A numeric instance is valid only if division by this keyword's value
* results in an integer.
*
* @exclusiveMinimum 0
*/
multipleOf?: number;
/**
* This keyword's value MUST be a valid JSON Schema.
*
* An instance is valid against this keyword if it fails to validate
* successfully against the schema defined by this keyword.
*/
not?: JSONSchema<Value, SchemaType>;
/**
* This keyword's value MUST be a non-empty array. Each item of the array
* MUST be a valid JSON Schema.
*
* An instance validates successfully against this keyword if it validates
* successfully against exactly one schema defined by this keyword's value.
*/
oneOf?: MaybeReadonlyArray<JSONSchema<Value, SchemaType>>;
/**
* The value of this keyword MUST be a string. This string SHOULD be a
* valid regular expression, according to the [ECMA-262][ecma262] regular
* expression dialect.
*
* A string instance is considered valid if the regular expression matches
* the instance successfully. Recall: regular expressions are not
* implicitly anchored.
*
* [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
*
* @format "regex"
*/
pattern?: string;
/**
* The value of `patternProperties` MUST be an object. Each property name
* of this object SHOULD be a valid regular expression, according to the
* [ECMA-262][ecma262] regular expression dialect. Each property value of
* this object MUST be a valid JSON Schema.
*
* This keyword determines how child instances validate for objects, and
* does not directly validate the immediate instance itself. Validation of
* the primitive instance type against this keyword always succeeds.
*
* Validation succeeds if, for each instance name that matches any regular
* expressions that appear as a property name in this keyword's value, the
* child instance for that name successfully validates against each schema
* that corresponds to a matching regular expression.
*
* Omitting this keyword has the same behavior as an empty object.
*
* [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
*/
patternProperties?: Record<string, JSONSchema>;
/**
* The value of `properties` MUST be an object. Each value of this object
* MUST be a valid JSON Schema.
*
* This keyword determines how child instances validate for objects, and
* does not directly validate the immediate instance itself.
*
* Validation succeeds if, for each name that appears in both the instance
* and as a name within this keyword's value, the child instance for that
* name successfully validates against the corresponding schema.
*
* Omitting this keyword has the same behavior as an empty object.
*/
properties?: Record<string, JSONSchema>;
/**
* The value of `propertyNames` MUST be a valid JSON Schema.
*
* If the instance is an object, this keyword validates if every property
* name in the instance validates against the provided schema. Note the
* property name that the schema is testing will always be a string.
*
* Omitting this keyword has the same behavior as an empty schema.
*/
propertyNames?: JSONSchema;
/**
* The value of this keyword MUST be a boolean. When multiple occurrences
* of this keyword are applicable to a single sub-instance, the resulting
* value MUST be `true` if any occurrence specifies a `true` value, and
* MUST be `false` otherwise.
*
* If `readOnly` has a value of boolean `true`, it indicates that the
* value of the instance is managed exclusively by the owning authority,
* and attempts by an application to modify the value of this property are
* expected to be ignored or rejected by that owning authority.
*
* An instance document that is marked as `readOnly` for the entire
* document MAY be ignored if sent to the owning authority, or MAY result
* in an error, at the authority's discretion.
*
* For example, `readOnly` would be used to mark a database-generated
* serial number as read-only.
*
* This keyword can be used to assist in user interface instance
* generation.
*
* @default false
*/
readOnly?: boolean;
/**
* The value of this keyword MUST be an array. Elements of this array, if
* any, MUST be strings, and MUST be unique.
*
* An object instance is valid against this keyword if every item in the
* array is the name of a property in the instance.
*
* Omitting this keyword has the same behavior as an empty array.
*/
required?: MaybeReadonlyArray<string>;
/**
* This keyword's value MUST be a valid JSON Schema.
*
* When `if` is present, and the instance successfully validates against
* its subschema, then validation succeeds against this keyword if the
* instance also successfully validates against this keyword's subschema.
*
* This keyword has no effect when `if` is absent, or when the instance
* fails to validate against its subschema. Implementations MUST NOT
* evaluate the instance against this keyword, for either validation or
* annotation collection purposes, in such cases.
*/
then?: JSONSchema<Value, SchemaType>;
/**
* Can be used to decorate a user interface with a short label about the
* data produced.
*/
title?: string;
/**
* The value of this keyword MUST be either a string or an array. If it is
* an array, elements of the array MUST be strings and MUST be unique.
*
* String values MUST be one of the six primitive types (`"null"`,
* `"boolean"`, `"object"`, `"array"`, `"number"`, or
* `"string"`), or `"integer"` which matches any number with a zero
* fractional part.
*
* An instance validates if and only if the instance is in any of the sets
* listed for this keyword.
*/
type?: SchemaType;
/**
* The value of this keyword MUST be a boolean.
*
* If this keyword has boolean value `false`, the instance validates
* successfully. If it has boolean value `true`, the instance validates
* successfully if all of its elements are unique.
*
* Omitting this keyword has the same behavior as a value of `false`.
*
* @default false
*/
uniqueItems?: boolean;
/**
* The value of this keyword MUST be a boolean. When multiple occurrences
* of this keyword is applicable to a single sub-instance, the resulting
* value MUST be `true` if any occurrence specifies a `true` value, and
* MUST be `false` otherwise.
*
* If `writeOnly` has a value of boolean `true`, it indicates that the
* value is never present when the instance is retrieved from the owning
* authority. It can be present when sent to the owning authority to update
* or create the document (or the resource it represents), but it will not
* be included in any updated or newly created version of the instance.
*
* An instance document that is marked as `writeOnly` for the entire
* document MAY be returned as a blank document of some sort, or MAY
* produce an error upon retrieval, or have the retrieval request ignored,
* at the authority's discretion.
*
* For example, `writeOnly` would be used to mark a password input field.
*
* These keywords can be used to assist in user interface instance
* generation. In particular, an application MAY choose to use a widget
* that hides input values as they are typed for write-only fields.
*
* @default false
*/
writeOnly?: boolean;
};
export declare namespace JSONSchema {
type TypeValue = ValueOf<TypeName> | TypeName | Array<ValueOf<TypeName> | TypeName> | ReadonlyArray<ValueOf<TypeName> | TypeName>;
/**
* JSON Schema interface
*/
type Interface<Value = any, SchemaType extends TypeValue = TypeValue> = Exclude<JSONSchema<Value, SchemaType>, boolean>;
type Array<T = any> = Pick<Interface<T, "array">, KeywordByType.Any | KeywordByType.Array>;
type Boolean = Pick<Interface<boolean, "boolean">, KeywordByType.Any>;
type Integer = Pick<Interface<number, "integer">, KeywordByType.Any | KeywordByType.Number>;
type Number = Pick<Interface<number, "number">, KeywordByType.Any | KeywordByType.Number>;
type Null = Pick<Interface<null, "null">, KeywordByType.Any>;
type Object<T = any> = Pick<Interface<T, "object">, KeywordByType.Any | KeywordByType.Object>;
type String = Pick<Interface<string, "string">, KeywordByType.Any | KeywordByType.String>;
}
declare namespace KeywordByType {
type Any = "$comment" | "$id" | "$ref" | "$schema" | "allOf" | "anyOf" | "const" | "default" | "definitions" | "description" | "else" | "enum" | "examples" | "if" | "not" | "oneOf" | "readOnly" | "then" | "title" | "type" | "writeOnly";
type Array = "additionalItems" | "contains" | "items" | "maxItems" | "minItems" | "uniqueItems";
type Number = "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "minimum" | "multipleOf";
type Object = "additionalProperties" | "dependencies" | "maxProperties" | "minProperties" | "patternProperties" | "properties" | "propertyNames" | "required";
type String = "contentEncoding" | "contentMediaType" | "format" | "maxLength" | "minLength" | "pattern";
}
/**
* Content encoding strategy enum.
*
* - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1)
* - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705)
*/
export declare enum ContentEncoding {
/**
* Only US-ASCII characters, which use the lower 7 bits for each character.
*
* Each line must be less than 1,000 characters.
*/
"7bit" = "7bit",
/**
* Allow extended ASCII characters which can use the 8th (highest) bit to
* indicate special characters not available in 7bit.
*
* Each line must be less than 1,000 characters.
*/
"8bit" = "8bit",
/**
* Useful for data that is mostly non-text.
*/
Base64 = "base64",
/**
* Same character set as 8bit, with no line length restriction.
*/
Binary = "binary",
/**
* An extension token defined by a standards-track RFC and registered with
* IANA.
*/
IETFToken = "ietf-token",
/**
* Lines are limited to 76 characters, and line breaks are represented using
* special characters that are escaped.
*/
QuotedPrintable = "quoted-printable",
/**
* The two characters "X-" or "x-" followed, with no intervening white space,
* by any token.
*/
XToken = "x-token"
}
/**
* This enum provides well-known formats that apply to strings.
*/
export declare enum Format {
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "full-date" production in
* [RFC 3339][RFC3339].
*
* [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
*/
Date = "date",
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "date-time" production in
* [RFC 3339][RFC3339].
*
* [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
*/
DateTime = "date-time",
/**
* A string instance is valid against this attribute if it is a valid Internet
* email address as defined by [RFC 5322, section 3.4.1][RFC5322].
*
* [RFC5322]: https://datatracker.ietf.org/doc/html/rfc5322
*/
Email = "email",
/**
* As defined by [RFC 1034, section 3.1][RFC1034], including host names
* produced using the Punycode algorithm specified in
* [RFC 5891, section 4.4][RFC5891].
*
* [RFC1034]: https://datatracker.ietf.org/doc/html/rfc1034
* [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891
*/
Hostname = "hostname",
/**
* A string instance is valid against this attribute if it is a valid Internet
* email address as defined by [RFC 6531][RFC6531].
*
* [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531
*/
IDNEmail = "idn-email",
/**
* As defined by either [RFC 1034, section 3.1][RFC1034] as for hostname, or
* an internationalized hostname as defined by
* [RFC 5890, section 2.3.2.3][RFC5890].
*
* [RFC1034]: https://datatracker.ietf.org/doc/html/rfc1034
* [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890
*/
IDNHostname = "idn-hostname",
/**
* An IPv4 address according to the "dotted-quad" ABNF syntax as defined in
* [RFC 2673, section 3.2][RFC2673].
*
* [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673
*/
IPv4 = "ipv4",
/**
* An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291].
*
* [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291
*/
IPv6 = "ipv6",
/**
* A string instance is valid against this attribute if it is a valid IRI,
* according to [RFC 3987][RFC3987].
*
* [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987
*/
IRI = "iri",
/**
* A string instance is valid against this attribute if it is a valid IRI
* Reference (either an IRI or a relative-reference), according to
* [RFC 3987][RFC3987].
*
* [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987
*/
IRIReference = "iri-reference",
/**
* A string instance is valid against this attribute if it is a valid JSON
* string representation of a JSON Pointer, according to
* [RFC 6901, section 5][RFC6901].
*
* [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901
*/
JSONPointer = "json-pointer",
/**
* A string instance is valid against this attribute if it is a valid JSON
* string representation of a JSON Pointer fragment, according to
* [RFC 6901, section 5][RFC6901].
*
* [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901
*/
JSONPointerURIFragment = "json-pointer-uri-fragment",
/**
* This attribute applies to string instances.
*
* A regular expression, which SHOULD be valid according to the
* [ECMA-262][ecma262] regular expression dialect.
*
* Implementations that validate formats MUST accept at least the subset of
* [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop]
* section of this specification, and SHOULD accept all valid
* [ECMA-262][ecma262] expressions.
*
* [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
* [regexInterop]: https://json-schema.org/draft-07/json-schema-validation.html#regexInterop
*/
RegEx = "regex",
/**
* A string instance is valid against this attribute if it is a valid
* [Relative JSON Pointer][relative-json-pointer].
*
* [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01
*/
RelativeJSONPointer = "relative-json-pointer",
/**
* A string instance is valid against this attribute if it is a valid
* representation according to the "time" production in [RFC 3339][RFC3339].
*
* [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
*/
Time = "time",
/**
* A string instance is valid against this attribute if it is a valid URI,
* according to [RFC3986][RFC3986].
*
* [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
*/
URI = "uri",
/**
* A string instance is valid against this attribute if it is a valid URI
* Reference (either a URI or a relative-reference), according to
* [RFC3986][RFC3986].
*
* [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
*/
URIReference = "uri-reference",
/**
* A string instance is valid against this attribute if it is a valid URI
* Template (of any level), according to [RFC6570][RFC6570].
*
* Note that URI Templates may be used for IRIs; there is no separate IRI
* Template specification.
*
* [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570
*/
URITemplate = "uri-template",
/**
* UUID
*/
UUID = "uuid"
}
/**
* Enum consisting of simple type names for the `type` keyword
*/
export declare enum TypeName {
/**
* Value MUST be an array.
*/
Array = "array",
/**
* Value MUST be a boolean.
*/
Boolean = "boolean",
/**
* Value MUST be an integer, no floating point numbers are allowed. This is a
* subset of the number type.
*/
Integer = "integer",
/**
* Value MUST be null. Note this is mainly for purpose of being able use union
* types to define nullability. If this type is not included in a union, null
* values are not allowed (the primitives listed above do not allow nulls on
* their own).
*/
Null = "null",
/**
* Value MUST be a number, floating point numbers are allowed.
*/
Number = "number",
/**
* Value MUST be an object.
*/
Object = "object",
/**
* Value MUST be a string.
*/
String = "string"
}
export declare const keywords: readonly ["$comment", "$id", "$ref", "$schema", "additionalItems", "additionalProperties", "allOf", "anyOf", "const", "contains", "contentEncoding", "contentMediaType", "default", "definitions", "dependencies", "description", "else", "enum", "examples", "exclusiveMaximum", "exclusiveMinimum", "format", "if", "items", "maximum", "maxItems", "maxLength", "maxProperties", "minimum", "minItems", "minLength", "minProperties", "multipleOf", "not", "oneOf", "pattern", "patternProperties", "properties", "propertyNames", "readOnly", "required", "then", "title", "type", "uniqueItems", "writeOnly"];
export {};
@@ -0,0 +1,524 @@
export default `flf2a$ 5 4 8 -1 12
"infopowr.flf"
Based on a 12 letter font From: "Answers to Frequently Asked Questions
About Today's Cryptography," v2.0 draft 2f, 9/20/93, by Paul Fahn,
copyright 1993, RSA Laboratories
Specifically, the ASCII lettering from the "DISTRIBUTION:" section:
"_ _, _ ___ _, __, _, _ _, ___ _ _, _, _ _ _, __, _, _ _ ___ __, "
| |\\ | |_ / \\ |_) |\\/| / \\ | | / \\ |\\ | | (_ |_) / \\ | | |_ | )
| | \\| | \\ / | \\ | | |~| | | \\ / | \\| | , ) | \\ / |/\\| | |~\\
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~~~ ~ ~
Additional characters & figlet conversion by:
Kent Nassen, kentn@cyberspace.org, 8/16/94
$$@
$$@
$$@
$$@
$$@@
,@
|@
|@
.@
$@@
,,@
''@
$@
$@
$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
,@
'@
$@
$@
$@@
/@
|@
|@
\\@
$@@
\\@
|@
|@
/@
$@@
@
@
@
@
@@
@
@
@
@
@@
$@
$@
,@
'@
$@@
$@
$@
~~@
$@
$@@
$@
$@
,@
~@
$@@
$@
/@
/ @
$@
$@@
_$@
/ \\@
\\ /@
~ @
$@@
,@
|@
|@
~@
$@@
_,@
~ )@
/ @
~~~@
$@@
_,@
~_)@
)@
~~ @
$@@
,@
/ |@
~~|@
~@
$@@
_,@
|_ @
)@
~~ @
$@@
_,@
/_ @
\\ )@
~ @
$@@
__,@
_/ @
/~ @
@
$@@
_,@
(_)@
( )@
~ @
$@@
_,@
(_/@
/ @
' @
$@@
$@
.@
.@
$@
$@@
$@
.@
,@
'@
$@@
/@
/ @
\\ @
\\@
$@@
$@
~~@
~~@
$@
$@@
\\ @
\\@
/@
/ @
$@@
_$@
( )@
/ @
.$@
$@@
$ _,@
$/,)@
$\\\`'@
$ ~~@
$ $@@
_,@
/ \\@
|~|@
~ ~@
$@@
__,@
|_)@
|_)@
~ @
$@@
_,@
/ \`@
\\ ,@
~ @
$@@
__,@
| \\@
|_/@
~ @
$@@
__,@
|_ @
| @
~~~@
$@@
__,@
|_ @
| @
~ @
$@@
_,@
/ _@
\\ /@
~ @
$@@
_,_@
|_|@
| |@
~ ~@
$@@
$_@
$|@
$|@
$~@
$$@@
__@
, |@
( |@
~~@
$@@
_,_@
|_/@
| \\@
~ ~@
$@@
_, @
| @
| ,@
~~~@
$@@
_, _@
|\\/|@
| |@
~ ~@
$@@
_, _@
|\\ |@
| \\|@
~ ~@
$@@
_,@
/ \\@
\\ /@
~ @
$@@
__,@
|_)@
| @
~ @
$@@
_,@
/ \\@
\\\\/@
~\`@
$@@
__,@
|_)@
| \\@
~ ~@
$@@
_,@
(_ @
, )@
~ @
$@@
___@
| @
| @
~ @
$@@
_,_@
| |@
| |@
\`~'@
$@@
_,_@
| /@
|/ @
~ @
$@@
_ _@
| |@
|/\\|@
~ ~@
$@@
_ ,@
'\\/ @
/\\ @
~ ~@
$@@
, _@
\\ |@
\\|@
)@
~'@@
___,@
\` / @
/ @
~~~ @
$@@
.-@
| @
| @
\`-@
$@@
$@
\\ @
\\@
@
$@@
-.@
|@
|@
-'@
$@@
/\\@
$@
$@
$@
$@@
$@
$@
$@
~~~~@
$@@
.@
\`@
$@
$@
$@@
_,@
/_\\@
| |@
~ ~@
$@@
__,@
|_)@
|_)@
~ @
$@@
_,@
/ \`@
\\ ,@
~ @
$@@
__,@
| \\@
|_/@
~ @
$@@
__,@
|_ @
| @
~~~@
$@@
__,@
|_ @
| @
~ @
$@@
_,@
/ _@
\\ /@
~ @
$@@
_,_@
|_|@
| |@
~ ~@
$@@
$_@
$|@
$|@
$~@
$$@@
__,@
, | @
( | @
~~ @
$@@
_,_@
|_/@
| \\@
~ ~@
$@@
_, @
| @
| ,@
~~~@
$@@
_, _@
|\\/|@
| |@
~ ~@
$@@
_, _@
|\\ |@
| \\|@
~ ~@
$@@
_,@
/ \\@
\\ /@
~ @
$@@
__,@
|_)@
| @
~ @
$@@
_,@
/ \\@
\\\\/@
~\`@
$@@
__,@
|_)@
| \\@
~ ~@
$@@
_,@
(_ @
, )@
~ @
$@@
___@
| @
| @
~ @
$@@
_,_@
| |@
| |@
\`~'@
$@@
_,_@
| /@
|/ @
~ @
$@@
_ _@
| |@
|/\\|@
~ ~@
$@@
_ ,@
'\\/ @
/\\ @
~ ~@
$@@
, _@
\\ |@
\\|@
)@
~'@@
___,@
\` / @
/ @
~~~ @
$@@
@
@
@
@
@@
.@
|@
|@
|@
$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
`
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Coffee = createLucideIcon("Coffee", [
["path", { d: "M10 2v2", key: "7u0qdc" }],
["path", { d: "M14 2v2", key: "6buw04" }],
[
"path",
{
d: "M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",
key: "pwadti"
}
],
["path", { d: "M6 2v2", key: "colzsn" }]
]);
export { Coffee as default };
//# sourceMappingURL=coffee.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_OverloadYield","value","kind","v","k"],"sources":["../../src/helpers/OverloadYield.ts"],"sourcesContent":["/* @minVersion 7.18.14 */\n\nconst enum Kind {\n // This yield was an await expression\n Await = 0,\n // This yield comes from yield*\n Delegate = 1,\n}\n\n// _OverloadYield is actually a class\ndeclare class _OverloadYield<T = any> {\n constructor(value: T, /** 0: await 1: delegate */ kind: 0 | 1);\n\n v: T;\n k: Kind;\n}\n\n// The actual implementation of _OverloadYield starts here\nfunction _OverloadYield<T>(this: _OverloadYield<T>, value: T, kind: Kind) {\n this.v = value;\n this.k = kind;\n}\n\nexport { _OverloadYield as default };\n"],"mappings":";;;;;;AAkBA,SAASA,cAAcA,CAA6BC,KAAQ,EAAEC,IAAU,EAAE;EACxE,IAAI,CAACC,CAAC,GAAGF,KAAK;EACd,IAAI,CAACG,CAAC,GAAGF,IAAI;AACf","ignoreList":[]}
@@ -0,0 +1,62 @@
{
"name": "@radix-ui/number",
"version": "1.1.1",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"publishConfig": {
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
},
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"version": "yarn version"
},
"devDependencies": {
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"eslint": "^9.18.0",
"typescript": "^5.7.3"
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"types": "./dist/index.d.ts"
}
@@ -0,0 +1 @@
{"version":3,"file":"map-pin-house.js","sources":["../../../src/icons/map-pin-house.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinHouse\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMjJhMSAxIDAgMCAxLTEtMXYtNGExIDEgMCAwIDEgLjQ0NS0uODMybDMtMmExIDEgMCAwIDEgMS4xMSAwbDMgMkExIDEgMCAwIDEgMjIgMTd2NGExIDEgMCAwIDEtMSAxeiIgLz4KICA8cGF0aCBkPSJNMTggMTBhOCA4IDAgMCAwLTE2IDBjMCA0Ljk5MyA1LjUzOSAxMC4xOTMgNy4zOTkgMTEuNzk5YTEgMSAwIDAgMCAuNjAxLjIiIC8+CiAgPHBhdGggZD0iTTE4IDIydi0zIiAvPgogIDxjaXJjbGUgY3g9IjEwIiBjeT0iMTAiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/map-pin-house\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 MapPinHouse = createLucideIcon('MapPinHouse', [\n [\n 'path',\n {\n d: 'M15 22a1 1 0 0 1-1-1v-4a1 1 0 0 1 .445-.832l3-2a1 1 0 0 1 1.11 0l3 2A1 1 0 0 1 22 17v4a1 1 0 0 1-1 1z',\n key: '1p1rcz',\n },\n ],\n [\n 'path',\n {\n d: 'M18 10a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 .601.2',\n key: 'mcbcs9',\n },\n ],\n ['path', { d: 'M18 22v-3', key: '1t1ugv' }],\n ['circle', { cx: '10', cy: '10', r: '3', key: '1ns7v1' }],\n]);\n\nexport default MapPinHouse;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAClD,CAAA,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;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,CACA,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;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,CAAA;AAAA,CAC1C,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;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,23 @@
/**
* @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 ShieldQuestion = createLucideIcon("ShieldQuestion", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }],
["path", { d: "M12 17h.01", key: "p32p05" }]
]);
export { ShieldQuestion as default };
//# sourceMappingURL=shield-question.js.map
@@ -0,0 +1,8 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_helper_streaming_stream = require("./stream.js");
const require_helper_streaming_sse = require("./sse.js");
const require_helper_streaming_text = require("./text.js");
exports.SSEStreamingApi = require_helper_streaming_sse.SSEStreamingApi;
exports.stream = require_helper_streaming_stream.stream;
exports.streamSSE = require_helper_streaming_sse.streamSSE;
exports.streamText = require_helper_streaming_text.streamText;
@@ -0,0 +1,614 @@
import type { JSONSchema4 } from '../json-schema';
import type { ParserServices, TSESTree } from '../ts-estree';
import type { AST } from './AST';
import type { FlatConfig } from './Config';
import type { Linter } from './Linter';
import type { Scope } from './Scope';
import type { SourceCode } from './SourceCode';
export type RuleRecommendation = 'recommended' | 'strict' | 'stylistic';
export interface RuleRecommendationAcrossConfigs<Options extends readonly unknown[]> {
recommended?: true;
strict: Partial<Options>;
}
export interface RuleMetaDataDocs {
/**
* Concise description of the rule.
*/
description: string;
/**
* The URL of the rule's docs.
*/
url?: string;
/**
* Mark this rule as feature-frozen.
*/
frozen?: boolean;
}
export interface ExternalSpecifier {
/**
* Name of the referenced plugin / rule.
*/
name?: string;
/**
* URL pointing to documentation for the plugin / rule.
*/
url?: string;
}
export interface ReplacedByInfo {
/**
* General message presented to the user, e.g. how to replace the rule
*/
message?: string;
/**
* URL to more information about this replacement in general
*/
url?: string;
/**
* Name should be "eslint" if the replacement is an ESLint core rule. Omit
* the property if the replacement is in the same plugin.
*/
plugin?: ExternalSpecifier;
/**
* Name and documentation of the replacement rule
*/
rule?: ExternalSpecifier;
}
export interface DeprecatedInfo {
/**
* General message presented to the user, e.g. for the key rule why the rule
* is deprecated or for info how to replace the rule.
*/
message?: string;
/**
* URL to more information about this deprecation in general.
*/
url?: string;
/**
* An empty array explicitly states that there is no replacement.
*/
replacedBy?: ReplacedByInfo[];
/**
* The package version since when the rule is deprecated (should use full
* semver without a leading "v").
*/
deprecatedSince?: string;
/**
* The estimated version when the rule is removed (probably the next major
* version). null means the rule is "frozen" (will be available but will not
* be changed).
*/
availableUntil?: string | null;
}
export interface RuleMetaData<MessageIds extends string, PluginDocs = unknown, Options extends readonly unknown[] = []> {
/**
* True if the rule is deprecated, false otherwise
*/
deprecated?: boolean | DeprecatedInfo;
/**
* Documentation for the rule
*/
docs?: PluginDocs & RuleMetaDataDocs;
/**
* The fixer category. Omit if there is no fixer
*/
fixable?: 'code' | 'whitespace';
/**
* Specifies whether rules can return suggestions. Omit if there is no suggestions
*/
hasSuggestions?: boolean;
/**
* A map of messages which the rule can report.
* The key is the messageId, and the string is the parameterised error string.
* See: https://eslint.org/docs/developer-guide/working-with-rules#messageids
*/
messages: Record<MessageIds, string>;
/**
* The name of the rule this rule was replaced by, if it was deprecated.
*
* @deprecated since eslint 9.21.0, in favor of `RuleMetaData#deprecated.replacedBy`
*/
replacedBy?: readonly string[];
/**
* The options schema. Supply an empty array if there are no options.
*/
schema: JSONSchema4 | readonly JSONSchema4[];
/**
* The type of rule.
* - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
* - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed.
* - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST.
*/
type: 'layout' | 'problem' | 'suggestion';
/**
* Specifies default options for the rule. If present, any user-provided options in their config will be merged on top of them recursively.
* This merging will be applied directly to `context.options`.
* If you want backwards-compatible support for earlier ESLint version, consider using the top-level `defaultOptions` instead.
*
* since ESLint 9.15.0
*/
defaultOptions?: Options;
}
export interface RuleMetaDataWithDocs<MessageIds extends string, PluginDocs = unknown, Options extends readonly unknown[] = []> extends RuleMetaData<MessageIds, PluginDocs, Options> {
/**
* Documentation for the rule
*/
docs: PluginDocs & RuleMetaDataDocs;
}
export interface RuleFix {
range: Readonly<AST.Range>;
text: string;
}
export interface RuleFixer {
insertTextAfter(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
insertTextAfterRange(range: Readonly<AST.Range>, text: string): RuleFix;
insertTextBefore(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
insertTextBeforeRange(range: Readonly<AST.Range>, text: string): RuleFix;
remove(nodeOrToken: TSESTree.Node | TSESTree.Token): RuleFix;
removeRange(range: Readonly<AST.Range>): RuleFix;
replaceText(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
replaceTextRange(range: Readonly<AST.Range>, text: string): RuleFix;
}
export interface SuggestionReportDescriptor<MessageIds extends string> extends Omit<ReportDescriptorBase<MessageIds>, 'fix'> {
readonly fix: ReportFixFunction;
}
export type ReportFixFunction = (fixer: RuleFixer) => IterableIterator<RuleFix> | readonly RuleFix[] | RuleFix | null;
export type ReportSuggestionArray<MessageIds extends string> = SuggestionReportDescriptor<MessageIds>[];
export type ReportDescriptorMessageData = Readonly<Record<string, unknown>>;
interface ReportDescriptorBase<MessageIds extends string> {
/**
* The parameters for the message string associated with `messageId`.
*/
readonly data?: ReportDescriptorMessageData;
/**
* The fixer function.
*/
readonly fix?: ReportFixFunction | null;
/**
* The messageId which is being reported.
*/
readonly messageId: MessageIds;
}
interface ReportDescriptorWithSuggestion<MessageIds extends string> extends ReportDescriptorBase<MessageIds> {
/**
* 6.7's Suggestions API
*/
readonly suggest?: Readonly<ReportSuggestionArray<MessageIds>> | null;
}
interface ReportDescriptorNodeOptionalLoc {
/**
* An override of the location of the report
*/
readonly loc?: Readonly<TSESTree.Position> | Readonly<TSESTree.SourceLocation>;
/**
* The Node or AST Token which the report is being attached to
*/
readonly node: TSESTree.Node | TSESTree.Token;
}
interface ReportDescriptorLocOnly {
/**
* An override of the location of the report
*/
loc: Readonly<TSESTree.Position> | Readonly<TSESTree.SourceLocation>;
}
export type ReportDescriptor<MessageIds extends string> = (ReportDescriptorLocOnly | ReportDescriptorNodeOptionalLoc) & ReportDescriptorWithSuggestion<MessageIds>;
/**
* Plugins can add their settings using declaration
* merging against this interface.
*/
export interface SharedConfigurationSettings {
[name: string]: unknown;
}
export interface RuleContext<MessageIds extends string, Options extends readonly unknown[]> {
/**
* The rule ID.
*/
id: string;
/**
* The language options configured for this run
*/
languageOptions: FlatConfig.LanguageOptions & {
parserOptions: FlatConfig.ParserOptions;
};
/**
* An array of the configured options for this rule.
* This array does not include the rule severity.
*/
options: Options;
/**
* The parser options configured for this run
* @deprecated This was deprecated in ESLint 9 and removed in ESLint 10.
*/
parserOptions: Linter.ParserOptions;
/**
* The name of the parser from configuration, if in eslintrc (legacy) config.
* @deprecated This was deprecated in ESLint 9 and removed in ESLint 10.
*/
parserPath: string | undefined;
/**
* An object containing parser-provided services for rules
*
* @deprecated in favor of `SourceCode#parserServices`
*/
parserServices?: ParserServices;
/**
* The shared settings from configuration.
* We do not have any shared settings in this plugin.
*/
settings: SharedConfigurationSettings;
/**
* Returns an array of the ancestors of the currently-traversed node, starting at
* the root of the AST and continuing through the direct parent of the current node.
* This array does not include the currently-traversed node itself.
*
* @deprecated in favor of `SourceCode#getAncestors`
*/
getAncestors(): TSESTree.Node[];
/**
* Returns a list of variables declared by the given node.
* This information can be used to track references to variables.
*
* @deprecated in favor of `SourceCode#getDeclaredVariables`
*/
getDeclaredVariables(node: TSESTree.Node): readonly Scope.Variable[];
/**
* Returns the current working directory passed to Linter.
* It is a path to a directory that should be considered as the current working directory.
* @deprecated in favor of `RuleContext#cwd`
*/
getCwd(): string;
/**
* The current working directory passed to Linter.
* It is a path to a directory that should be considered as the current working directory.
*/
cwd: string;
/**
* Returns the filename associated with the source.
*
* @deprecated in favor of `RuleContext#filename`
*/
getFilename(): string;
/**
* The filename associated with the source.
*/
filename: string;
/**
* Returns the full path of the file on disk without any code block information (unlike `getFilename()`).
* @deprecated in favor of `RuleContext#physicalFilename`
*/
getPhysicalFilename(): string;
/**
* The full path of the file on disk without any code block information (unlike `filename`).
*/
physicalFilename: string;
/**
* Returns the scope of the currently-traversed node.
* This information can be used track references to variables.
*
* @deprecated in favor of `SourceCode#getScope`
*/
getScope(): Scope.Scope;
/**
* Returns a SourceCode object that you can use to work with the source that
* was passed to ESLint.
*
* @deprecated in favor of `RuleContext#sourceCode`
*/
getSourceCode(): Readonly<SourceCode>;
/**
* A SourceCode object that you can use to work with the source that
* was passed to ESLint.
*/
sourceCode: Readonly<SourceCode>;
/**
* Marks a variable with the given name in the current scope as used.
* This affects the no-unused-vars rule.
*
* @deprecated in favor of `SourceCode#markVariableAsUsed`
*/
markVariableAsUsed(name: string): boolean;
/**
* Reports a problem in the code.
*/
report(descriptor: ReportDescriptor<MessageIds>): void;
}
/**
* Part of the code path analysis feature of ESLint:
* https://eslint.org/docs/latest/extend/code-path-analysis
*
* These are used in the `onCodePath*` methods. (Note that the `node` parameter
* of these methods is intentionally omitted.)
*
* @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
*/
export interface CodePath {
/** Code paths of functions this code path contains. */
childCodePaths: CodePath[];
/**
* Segments of the current traversal position.
*
* @deprecated
*/
currentSegments: CodePathSegment[];
/** The final segments which includes both returned and thrown. */
finalSegments: CodePathSegment[];
/**
* A unique string. Respective rules can use `id` to save additional
* information for each code path.
*/
id: string;
initialSegment: CodePathSegment;
/** The final segments which includes only returned. */
returnedSegments: CodePathSegment[];
/** The final segments which includes only thrown. */
thrownSegments: CodePathSegment[];
/** The code path of the upper function/global scope. */
upper: CodePath | null;
}
/**
* Part of the code path analysis feature of ESLint:
* https://eslint.org/docs/latest/extend/code-path-analysis
*
* These are used in the `onCodePath*` methods. (Note that the `node` parameter
* of these methods is intentionally omitted.)
*
* @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
*/
export interface CodePathSegment {
/**
* A unique string. Respective rules can use `id` to save additional
* information for each segment.
*/
id: string;
/**
* The next segments. If forking, there are two or more. If final, there is
* nothing.
*/
nextSegments: CodePathSegment[];
/**
* The previous segments. If merging, there are two or more. If initial, there
* is nothing.
*/
prevSegments: CodePathSegment[];
/**
* A flag which shows whether it is reachable. This becomes `false` when
* preceded by `return`, `throw`, `break`, or `continue`.
*/
reachable: boolean;
}
/**
* Part of the code path analysis feature of ESLint:
* https://eslint.org/docs/latest/extend/code-path-analysis
*
* This type is unused in the `typescript-eslint` codebase since putting it on
* the `nodeSelector` for `RuleListener` would break the existing definition.
* However, it is exported here for the purposes of manual type-assertion.
*
* @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
*/
export type CodePathFunction = ((codePath: CodePath, node: TSESTree.Node) => void) | ((fromSegment: CodePathSegment, toSegment: CodePathSegment, node: TSESTree.Node) => void) | ((segment: CodePathSegment, node: TSESTree.Node) => void);
export type RuleFunction<T extends TSESTree.NodeOrTokenData = never> = (node: T) => void;
interface RuleListenerBaseSelectors {
AccessorProperty?: RuleFunction<TSESTree.AccessorProperty>;
ArrayExpression?: RuleFunction<TSESTree.ArrayExpression>;
ArrayPattern?: RuleFunction<TSESTree.ArrayPattern>;
ArrowFunctionExpression?: RuleFunction<TSESTree.ArrowFunctionExpression>;
AssignmentExpression?: RuleFunction<TSESTree.AssignmentExpression>;
AssignmentPattern?: RuleFunction<TSESTree.AssignmentPattern>;
AwaitExpression?: RuleFunction<TSESTree.AwaitExpression>;
BinaryExpression?: RuleFunction<TSESTree.BinaryExpression>;
BlockStatement?: RuleFunction<TSESTree.BlockStatement>;
BreakStatement?: RuleFunction<TSESTree.BreakStatement>;
CallExpression?: RuleFunction<TSESTree.CallExpression>;
CatchClause?: RuleFunction<TSESTree.CatchClause>;
ChainExpression?: RuleFunction<TSESTree.ChainExpression>;
ClassBody?: RuleFunction<TSESTree.ClassBody>;
ClassDeclaration?: RuleFunction<TSESTree.ClassDeclaration>;
ClassExpression?: RuleFunction<TSESTree.ClassExpression>;
ConditionalExpression?: RuleFunction<TSESTree.ConditionalExpression>;
ContinueStatement?: RuleFunction<TSESTree.ContinueStatement>;
DebuggerStatement?: RuleFunction<TSESTree.DebuggerStatement>;
Decorator?: RuleFunction<TSESTree.Decorator>;
DoWhileStatement?: RuleFunction<TSESTree.DoWhileStatement>;
EmptyStatement?: RuleFunction<TSESTree.EmptyStatement>;
ExportAllDeclaration?: RuleFunction<TSESTree.ExportAllDeclaration>;
ExportDefaultDeclaration?: RuleFunction<TSESTree.ExportDefaultDeclaration>;
ExportNamedDeclaration?: RuleFunction<TSESTree.ExportNamedDeclaration>;
ExportSpecifier?: RuleFunction<TSESTree.ExportSpecifier>;
ExpressionStatement?: RuleFunction<TSESTree.ExpressionStatement>;
ForInStatement?: RuleFunction<TSESTree.ForInStatement>;
ForOfStatement?: RuleFunction<TSESTree.ForOfStatement>;
ForStatement?: RuleFunction<TSESTree.ForStatement>;
FunctionDeclaration?: RuleFunction<TSESTree.FunctionDeclaration>;
FunctionExpression?: RuleFunction<TSESTree.FunctionExpression>;
Identifier?: RuleFunction<TSESTree.Identifier>;
IfStatement?: RuleFunction<TSESTree.IfStatement>;
ImportAttribute?: RuleFunction<TSESTree.ImportAttribute>;
ImportDeclaration?: RuleFunction<TSESTree.ImportDeclaration>;
ImportDefaultSpecifier?: RuleFunction<TSESTree.ImportDefaultSpecifier>;
ImportExpression?: RuleFunction<TSESTree.ImportExpression>;
ImportNamespaceSpecifier?: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
ImportSpecifier?: RuleFunction<TSESTree.ImportSpecifier>;
JSXAttribute?: RuleFunction<TSESTree.JSXAttribute>;
JSXClosingElement?: RuleFunction<TSESTree.JSXClosingElement>;
JSXClosingFragment?: RuleFunction<TSESTree.JSXClosingFragment>;
JSXElement?: RuleFunction<TSESTree.JSXElement>;
JSXEmptyExpression?: RuleFunction<TSESTree.JSXEmptyExpression>;
JSXExpressionContainer?: RuleFunction<TSESTree.JSXExpressionContainer>;
JSXFragment?: RuleFunction<TSESTree.JSXFragment>;
JSXIdentifier?: RuleFunction<TSESTree.JSXIdentifier>;
JSXMemberExpression?: RuleFunction<TSESTree.JSXMemberExpression>;
JSXNamespacedName?: RuleFunction<TSESTree.JSXNamespacedName>;
JSXOpeningElement?: RuleFunction<TSESTree.JSXOpeningElement>;
JSXOpeningFragment?: RuleFunction<TSESTree.JSXOpeningFragment>;
JSXSpreadAttribute?: RuleFunction<TSESTree.JSXSpreadAttribute>;
JSXSpreadChild?: RuleFunction<TSESTree.JSXSpreadChild>;
JSXText?: RuleFunction<TSESTree.JSXText>;
LabeledStatement?: RuleFunction<TSESTree.LabeledStatement>;
Literal?: RuleFunction<TSESTree.Literal>;
LogicalExpression?: RuleFunction<TSESTree.LogicalExpression>;
MemberExpression?: RuleFunction<TSESTree.MemberExpression>;
MetaProperty?: RuleFunction<TSESTree.MetaProperty>;
MethodDefinition?: RuleFunction<TSESTree.MethodDefinition>;
NewExpression?: RuleFunction<TSESTree.NewExpression>;
ObjectExpression?: RuleFunction<TSESTree.ObjectExpression>;
ObjectPattern?: RuleFunction<TSESTree.ObjectPattern>;
PrivateIdentifier?: RuleFunction<TSESTree.PrivateIdentifier>;
Program?: RuleFunction<TSESTree.Program>;
Property?: RuleFunction<TSESTree.Property>;
PropertyDefinition?: RuleFunction<TSESTree.PropertyDefinition>;
RestElement?: RuleFunction<TSESTree.RestElement>;
ReturnStatement?: RuleFunction<TSESTree.ReturnStatement>;
SequenceExpression?: RuleFunction<TSESTree.SequenceExpression>;
SpreadElement?: RuleFunction<TSESTree.SpreadElement>;
StaticBlock?: RuleFunction<TSESTree.StaticBlock>;
Super?: RuleFunction<TSESTree.Super>;
SwitchCase?: RuleFunction<TSESTree.SwitchCase>;
SwitchStatement?: RuleFunction<TSESTree.SwitchStatement>;
TaggedTemplateExpression?: RuleFunction<TSESTree.TaggedTemplateExpression>;
TemplateElement?: RuleFunction<TSESTree.TemplateElement>;
TemplateLiteral?: RuleFunction<TSESTree.TemplateLiteral>;
ThisExpression?: RuleFunction<TSESTree.ThisExpression>;
ThrowStatement?: RuleFunction<TSESTree.ThrowStatement>;
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractAccessorProperty?: RuleFunction<TSESTree.TSAbstractAccessorProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
TSAbstractPropertyDefinition?: RuleFunction<TSESTree.TSAbstractPropertyDefinition>;
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
TSEnumBody?: RuleFunction<TSESTree.TSEnumBody>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
TSExportKeyword?: RuleFunction<TSESTree.TSExportKeyword>;
TSExternalModuleReference?: RuleFunction<TSESTree.TSExternalModuleReference>;
TSFunctionType?: RuleFunction<TSESTree.TSFunctionType>;
TSImportEqualsDeclaration?: RuleFunction<TSESTree.TSImportEqualsDeclaration>;
TSImportType?: RuleFunction<TSESTree.TSImportType>;
TSIndexedAccessType?: RuleFunction<TSESTree.TSIndexedAccessType>;
TSIndexSignature?: RuleFunction<TSESTree.TSIndexSignature>;
TSInferType?: RuleFunction<TSESTree.TSInferType>;
TSInstantiationExpression?: RuleFunction<TSESTree.TSInstantiationExpression>;
TSInterfaceBody?: RuleFunction<TSESTree.TSInterfaceBody>;
TSInterfaceDeclaration?: RuleFunction<TSESTree.TSInterfaceDeclaration>;
TSInterfaceHeritage?: RuleFunction<TSESTree.TSInterfaceHeritage>;
TSIntersectionType?: RuleFunction<TSESTree.TSIntersectionType>;
TSIntrinsicKeyword?: RuleFunction<TSESTree.TSIntrinsicKeyword>;
TSLiteralType?: RuleFunction<TSESTree.TSLiteralType>;
TSMappedType?: RuleFunction<TSESTree.TSMappedType>;
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
TSNamedTupleMember?: RuleFunction<TSESTree.TSNamedTupleMember>;
TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
TSNumberKeyword?: RuleFunction<TSESTree.TSNumberKeyword>;
TSObjectKeyword?: RuleFunction<TSESTree.TSObjectKeyword>;
TSOptionalType?: RuleFunction<TSESTree.TSOptionalType>;
TSParameterProperty?: RuleFunction<TSESTree.TSParameterProperty>;
TSPrivateKeyword?: RuleFunction<TSESTree.TSPrivateKeyword>;
TSPropertySignature?: RuleFunction<TSESTree.TSPropertySignature>;
TSProtectedKeyword?: RuleFunction<TSESTree.TSProtectedKeyword>;
TSPublicKeyword?: RuleFunction<TSESTree.TSPublicKeyword>;
TSQualifiedName?: RuleFunction<TSESTree.TSQualifiedName>;
TSReadonlyKeyword?: RuleFunction<TSESTree.TSReadonlyKeyword>;
TSRestType?: RuleFunction<TSESTree.TSRestType>;
TSSatisfiesExpression?: RuleFunction<TSESTree.TSSatisfiesExpression>;
TSStaticKeyword?: RuleFunction<TSESTree.TSStaticKeyword>;
TSStringKeyword?: RuleFunction<TSESTree.TSStringKeyword>;
TSSymbolKeyword?: RuleFunction<TSESTree.TSSymbolKeyword>;
TSTemplateLiteralType?: RuleFunction<TSESTree.TSTemplateLiteralType>;
TSThisType?: RuleFunction<TSESTree.TSThisType>;
TSTupleType?: RuleFunction<TSESTree.TSTupleType>;
TSTypeAliasDeclaration?: RuleFunction<TSESTree.TSTypeAliasDeclaration>;
TSTypeAnnotation?: RuleFunction<TSESTree.TSTypeAnnotation>;
TSTypeAssertion?: RuleFunction<TSESTree.TSTypeAssertion>;
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
TSUndefinedKeyword?: RuleFunction<TSESTree.TSUndefinedKeyword>;
TSUnionType?: RuleFunction<TSESTree.TSUnionType>;
TSUnknownKeyword?: RuleFunction<TSESTree.TSUnknownKeyword>;
TSVoidKeyword?: RuleFunction<TSESTree.TSVoidKeyword>;
UnaryExpression?: RuleFunction<TSESTree.UnaryExpression>;
UpdateExpression?: RuleFunction<TSESTree.UpdateExpression>;
VariableDeclaration?: RuleFunction<TSESTree.VariableDeclaration>;
VariableDeclarator?: RuleFunction<TSESTree.VariableDeclarator>;
WhileStatement?: RuleFunction<TSESTree.WhileStatement>;
WithStatement?: RuleFunction<TSESTree.WithStatement>;
YieldExpression?: RuleFunction<TSESTree.YieldExpression>;
}
type RuleListenerExitSelectors = {
[K in keyof RuleListenerBaseSelectors as `${K}:exit`]: RuleListenerBaseSelectors[K];
};
type RuleListenerCatchAllBaseCase = Record<string, RuleFunction | undefined>;
export interface RuleListenerExtension {
}
export type RuleListener = RuleListenerBaseSelectors & RuleListenerCatchAllBaseCase & RuleListenerExitSelectors;
export interface RuleModule<MessageIds extends string, Options extends readonly unknown[] = [], Docs = unknown, ExtendedRuleListener extends RuleListener = RuleListener> {
/**
* Function which returns an object with methods that ESLint calls to “visit”
* nodes while traversing the abstract syntax tree.
*/
create(context: Readonly<RuleContext<MessageIds, Options>>): ExtendedRuleListener;
/**
* @deprecated Use meta.defaultOptions instead
* Default options the rule will be run with
*/
defaultOptions?: Options;
/**
* Metadata about the rule
*/
meta: RuleMetaData<MessageIds, Docs, Options>;
/**
* Rule name
*/
name?: string;
}
export type AnyRuleModule = RuleModule<string, readonly unknown[]>;
export interface RuleModuleWithMetaDocs<MessageIds extends string, Options extends readonly unknown[] = [], Docs = unknown, ExtendedRuleListener extends RuleListener = RuleListener> extends RuleModule<MessageIds, Options, Docs, ExtendedRuleListener> {
/**
* Metadata about the rule
*/
meta: RuleMetaDataWithDocs<MessageIds, Docs, Options>;
}
export type AnyRuleModuleWithMetaDocs = RuleModuleWithMetaDocs<string, unknown[]>;
/**
* A loose definition of the RuleModule type for use with configs. This type is
* intended to relax validation of types so that we can have basic validation
* without being overly strict about nitty gritty details matching.
*
* For example the plugin might be declared using an old version of our types or
* they might use the DefinitelyTyped eslint types. Ultimately we don't need
* super strict validation in a config - a loose shape match is "good enough" to
* help validate the config is correct.
*
* @see {@link LooseParserModule}, {@link LooseProcessorModule}
*/
export type LooseRuleDefinition = LooseRuleCreateFunction | {
create: LooseRuleCreateFunction;
meta?: object | undefined;
};
export type LooseRuleCreateFunction = (context: any) => Record<string, Function | undefined>;
export type RuleCreateFunction<MessageIds extends string = never, Options extends readonly unknown[] = unknown[]> = (context: Readonly<RuleContext<MessageIds, Options>>) => RuleListener;
export type AnyRuleCreateFunction = RuleCreateFunction<string, readonly unknown[]>;
export {};
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","traverseFast","VISITOR_KEYS","TokenMap","constructor","ast","tokens","source","_tokens","_source","_nodesToTokenIndexes","Map","_nodesOccurrencesCountCache","_tokensCache","node","indexes","_getTokensIndexesOfNode","length","set","clear","has","getIndexes","get","find","condition","k","index","tok","findLastIndex","findMatching","test","occurrenceCount","String","fromCharCode","i","count","cache","matchesOriginal","token","end","start","value","startsWith","startMatches","endMatches","_node$declaration","first","last","_findTokensOfNode","low","children","childrenIterator","type","declaration","next","child","childTok","high","push","cached","_findFirstTokenOfNode","_findLastTokenOfNode","mid","exports","quasis","expressions","keys","key","Array","isArray"],"sources":["../src/token-map.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\nimport type { Token } from \"@babel/parser\";\n\nimport { traverseFast, VISITOR_KEYS } from \"@babel/types\";\n\nexport class TokenMap {\n _tokens: Token[];\n _source: string;\n\n _nodesToTokenIndexes = new Map<t.Node, number[]>();\n _nodesOccurrencesCountCache = new Map<\n t.Node,\n { test: string; count: number; i: number }\n >();\n\n _tokensCache = new Map<t.Node, { first: number; last: number }>();\n\n constructor(ast: t.Node, tokens: Token[], source: string) {\n this._tokens = tokens;\n this._source = source;\n\n traverseFast(ast, node => {\n const indexes = this._getTokensIndexesOfNode(node);\n if (indexes.length > 0) this._nodesToTokenIndexes.set(node, indexes);\n });\n\n this._tokensCache.clear();\n }\n\n has(node: t.Node): boolean {\n return this._nodesToTokenIndexes.has(node);\n }\n\n getIndexes(node: t.Node): readonly number[] | undefined {\n return this._nodesToTokenIndexes.get(node);\n }\n\n find(\n node: t.Node,\n condition: (token: Token, index: number) => boolean,\n ): Token | null {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\n for (let k = 0; k < indexes.length; k++) {\n const index = indexes[k];\n const tok = this._tokens[index];\n if (condition(tok, index)) return tok;\n }\n }\n return null;\n }\n\n findLastIndex(\n node: t.Node,\n condition: (token: Token, index: number) => boolean,\n ): number {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\n for (let k = indexes.length - 1; k >= 0; k--) {\n const index = indexes[k];\n const tok = this._tokens[index];\n if (condition(tok, index)) return index;\n }\n }\n return -1;\n }\n\n findMatching(\n node: t.Node,\n test: string | number,\n occurrenceCount: number = 0,\n ): Token | null {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\n if (typeof test === \"number\") {\n test = String.fromCharCode(test);\n }\n let i = 0;\n const count = occurrenceCount;\n\n // To avoid O(n^2) search when printing lists (such as arrays), we\n // cache the last index of a given token for a given occurrence count.\n // If then we are asked to find the next occurrence of the same token,\n // we start from the index of the previously found token.\n // This cache only kicks in after 2 tokens of the same type, to avoid\n // overhead in the simple case of having unique tokens per node.\n if (count > 1) {\n const cache = this._nodesOccurrencesCountCache.get(node);\n if (cache?.test === test && cache.count < count) {\n i = cache.i + 1;\n occurrenceCount -= cache.count + 1;\n }\n }\n\n for (; i < indexes.length; i++) {\n const tok = this._tokens[indexes[i]];\n if (this.matchesOriginal(tok, test)) {\n if (occurrenceCount === 0) {\n if (count > 0) {\n this._nodesOccurrencesCountCache.set(node, { test, count, i });\n }\n return tok;\n }\n occurrenceCount--;\n }\n }\n }\n return null;\n }\n\n matchesOriginal(token: Token, test: string) {\n if (token.end - token.start !== test.length) return false;\n if (token.value != null) return token.value === test;\n return this._source.startsWith(test, token.start);\n }\n\n startMatches(node: t.Node, test: string): boolean {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (!indexes) return false;\n const tok = this._tokens[indexes[0]];\n if (tok.start !== node.start) return false;\n return this.matchesOriginal(tok, test);\n }\n\n endMatches(node: t.Node, test: string): boolean {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (!indexes) return false;\n const tok = this._tokens[indexes[indexes.length - 1]];\n if (tok.end !== node.end) return false;\n return this.matchesOriginal(tok, test);\n }\n\n _getTokensIndexesOfNode(node: t.NLine truncated
@@ -0,0 +1,96 @@
import { HTTPException } from "../../http-exception.js";
import { timingSafeEqual } from "../../utils/buffer.js";
//#region src/middleware/bearer-auth/index.ts
const TOKEN_STRINGS = "[A-Za-z0-9._~+/-]+=*";
const PREFIX = "Bearer";
const HEADER = "Authorization";
/**
* Bearer Auth Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/bearer-auth}
*
* @template E - The environment type.
* @param {BearerAuthOptions} options - The options for the bearer authentication middleware.
* @param {string | string[]} [options.token] - The string or array of strings to validate the incoming bearer token against.
* @param {Function} [options.verifyToken] - The function to verify the token.
* @param {string} [options.realm=""] - The domain name of the realm, as part of the returned WWW-Authenticate challenge header.
* @param {string} [options.prefix="Bearer"] - The prefix (or known as `schema`) for the Authorization header value. If set to the empty string, no prefix is expected.
* @param {string} [options.headerName=Authorization] - The header name.
* @param {Function} [options.hashFunction] - A function to handle hashing for safe comparison of authentication tokens.
* @param {string | object | MessageFunction} [options.noAuthenticationHeader.message="Unauthorized"] - The no authentication header message.
* @param {string | object | MessageFunction} [options.noAuthenticationHeader.wwwAuthenticateHeader="Bearer realm=\"\""] - The response header value for the WWW-Authenticate header when no authentication header is provided.
* @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.message="Bad Request"] - The invalid authentication header message.
* @param {string | object | MessageFunction} [options.invalidAuthenticationHeader.wwwAuthenticateHeader="Bearer error=\"invalid_request\""] - The response header value for the WWW-Authenticate header when authentication header is invalid.
* @param {string | object | MessageFunction} [options.invalidToken.message="Unauthorized"] - The invalid token message.
* @param {string | object | MessageFunction} [options.invalidToken.wwwAuthenticateHeader="Bearer error=\"invalid_token\""] - The response header value for the WWW-Authenticate header when token is invalid.
* @returns {MiddlewareHandler<E>} The middleware handler function.
* @throws {Error} If neither "token" nor "verifyToken" options are provided.
* @throws {HTTPException} If authentication fails, with 401 status code for missing or invalid token, or 400 status code for invalid request.
*
* @example
* ```ts
* const app = new Hono()
*
* const token = 'honoishot'
*
* app.use('/api/*', bearerAuth({ token }))
*
* app.get('/api/page', (c) => {
* return c.json({ message: 'You are authorized' })
* })
* ```
*/
const bearerAuth = (options) => {
if (!("token" in options || "verifyToken" in options)) throw new Error("bearer auth middleware requires options for \"token\" or \"verifyToken\"");
if (!options.realm) options.realm = "";
if (options.prefix === void 0) options.prefix = PREFIX;
const realm = options.realm?.replace(/"/g, "\\\"");
const prefix = options.prefix;
const tokenRegexp = new RegExp(`^${TOKEN_STRINGS}$`);
const wwwAuthenticatePrefix = prefix === "" ? "" : `${prefix} `;
const throwHTTPException = async (c, status, wwwAuthenticateHeader, messageOption) => {
const wwwAuthenticateHeaderValue = typeof wwwAuthenticateHeader === "function" ? await wwwAuthenticateHeader(c) : wwwAuthenticateHeader;
const headers = { "WWW-Authenticate": typeof wwwAuthenticateHeaderValue === "string" ? wwwAuthenticateHeaderValue : `${wwwAuthenticatePrefix}${Object.entries(wwwAuthenticateHeaderValue).map(([key, value]) => `${key}="${value}"`).join(",")}` };
const responseMessage = typeof messageOption === "function" ? await messageOption(c) : messageOption;
const res = typeof responseMessage === "string" ? new Response(responseMessage, {
status,
headers
}) : new Response(JSON.stringify(responseMessage), {
status,
headers: {
...headers,
"content-type": "application/json"
}
});
throw new HTTPException(status, { res });
};
return async function bearerAuth(c, next) {
const headerToken = c.req.header(options.headerName || HEADER);
if (!headerToken) await throwHTTPException(c, 401, options.noAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}realm="${realm}"`, options.noAuthenticationHeader?.message || options.noAuthenticationHeaderMessage || "Unauthorized");
else {
let tokenValue;
if (prefix === "") tokenValue = headerToken;
else {
const headerLower = headerToken.toLowerCase();
const prefixLower = prefix.toLowerCase();
if (headerLower.startsWith(prefixLower) && headerToken[prefix.length] === " ") tokenValue = headerToken.slice(prefix.length).trimStart();
}
if (!tokenValue || !tokenRegexp.test(tokenValue)) await throwHTTPException(c, 400, options.invalidAuthenticationHeader?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_request"`, options.invalidAuthenticationHeader?.message || options.invalidAuthenticationHeaderMessage || "Bad Request");
else {
let equal = false;
if ("verifyToken" in options) equal = await options.verifyToken(tokenValue, c);
else if (typeof options.token === "string") equal = await timingSafeEqual(options.token, tokenValue, options.hashFunction);
else if (Array.isArray(options.token) && options.token.length > 0) {
for (const token of options.token) if (await timingSafeEqual(token, tokenValue, options.hashFunction)) {
equal = true;
break;
}
}
if (!equal) await throwHTTPException(c, 401, options.invalidToken?.wwwAuthenticateHeader || `${wwwAuthenticatePrefix}error="invalid_token"`, options.invalidToken?.message || options.invalidTokenMessage || "Unauthorized");
}
}
await next();
};
};
//#endregion
export { bearerAuth };
@@ -0,0 +1,8 @@
import { L33tMatch } from '../../../../types';
import { DictionaryMatchOptions } from '../../types';
import MatchDictionary from '../../matching';
declare class MatchL33t extends MatchDictionary {
private isAlreadyIncluded;
match(matchOptions: DictionaryMatchOptions): L33tMatch[];
}
export default MatchL33t;
@@ -0,0 +1 @@
{"version":3,"file":"make-command.js","sourceRoot":"","sources":["../../src/make-command.ts"],"names":[],"mappings":";;;AAgBA,6CAMqB;AA+Hd,MAAM,WAAW,GAAG,CACzB,QAA8D,EAC9D,SAIkB,EAClB,UAAuE,EACvE,WAGe,EACf,QAAwD,EACrB,EAAE;IACrC,OAAO,MAAM,CAAC,MAAM,CAClB,CACE,OAAyC,EAAE,EAC3C,OAAuB,EACvB,EAAO,EACP,EAAE;QACF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,GAAG,IAAI,CAAA;YACd,IAAI,GAAG,EAAE,CAAA;QACX,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAClC,EAAE,GAAG,OAAO,CAAA;YACZ,OAAO,GAAG,SAAS,CAAA;QACrB,CAAC;QAED,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE7C,MAAM,GAAG,GAAG,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAA;QAEzB,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAExB,IAAI,IAAA,uBAAU,EAAC,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,SAAS,CACjB,+CAA+C,CAChD,CAAA;YACH,CAAC;YACD,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAC/B,CAAC;aAAM,IAAI,IAAA,wBAAW,EAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;YACjC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACxC,CAAC;aAAM,IAAI,IAAA,yBAAY,EAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,SAAS,CACjB,+CAA+C,CAChD,CAAA;YACH,CAAC;YACD,OAAO,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACjC,CAAC;aAAM,IAAI,IAAA,0BAAa,EAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAA;YACjE,CAAC;YACD,OAAO,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;YAChC,qBAAqB;QACvB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QAEvC,oBAAoB;IACtB,CAAC,EACD;QACE,QAAQ;QACR,SAAS;QACT,UAAU;QACV,WAAW;QACX,QAAQ;KACT,CACmC,CAAA;AACxC,CAAC,CAAA;AAxEY,QAAA,WAAW,eAwEvB","sourcesContent":["import type {\n TarOptions,\n TarOptionsAsyncFile,\n TarOptionsAsyncNoFile,\n TarOptionsSyncFile,\n TarOptionsSyncNoFile,\n TarOptionsWithAliases,\n TarOptionsWithAliasesAsync,\n TarOptionsWithAliasesAsyncFile,\n TarOptionsWithAliasesAsyncNoFile,\n TarOptionsWithAliasesFile,\n TarOptionsWithAliasesNoFile,\n TarOptionsWithAliasesSync,\n TarOptionsWithAliasesSyncFile,\n TarOptionsWithAliasesSyncNoFile,\n} from './options.js'\nimport {\n dealias,\n isAsyncFile,\n isAsyncNoFile,\n isSyncFile,\n isSyncNoFile,\n} from './options.js'\n\nexport type CB = (er?: Error) => unknown\n\nexport type TarCommand<AsyncClass, SyncClass extends { sync: true }> = {\n // async and no file specified\n (): AsyncClass\n (opt: TarOptionsWithAliasesAsyncNoFile): AsyncClass\n (entries: string[]): AsyncClass\n (opt: TarOptionsWithAliasesAsyncNoFile, entries: string[]): AsyncClass\n} & {\n // sync and no file\n (opt: TarOptionsWithAliasesSyncNoFile): SyncClass\n (opt: TarOptionsWithAliasesSyncNoFile, entries: string[]): SyncClass\n} & {\n // async and file\n (opt: TarOptionsWithAliasesAsyncFile): Promise<void>\n (opt: TarOptionsWithAliasesAsyncFile, entries: string[]): Promise<void>\n (opt: TarOptionsWithAliasesAsyncFile, cb: CB): Promise<void>\n (\n opt: TarOptionsWithAliasesAsyncFile,\n entries: string[],\n cb: CB,\n ): Promise<void>\n} & {\n // sync and file\n (opt: TarOptionsWithAliasesSyncFile): void\n (opt: TarOptionsWithAliasesSyncFile, entries: string[]): void\n} & {\n // sync, maybe file\n (opt: TarOptionsWithAliasesSync): typeof opt extends (\n TarOptionsWithAliasesFile\n ) ?\n void\n : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass\n : void | SyncClass\n (\n opt: TarOptionsWithAliasesSync,\n entries: string[],\n ): typeof opt extends TarOptionsWithAliasesFile ? void\n : typeof opt extends TarOptionsWithAliasesNoFile ? SyncClass\n : void | SyncClass\n} & {\n // async, maybe file\n (opt: TarOptionsWithAliasesAsync): typeof opt extends (\n TarOptionsWithAliasesFile\n ) ?\n Promise<void>\n : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass\n : Promise<void> | AsyncClass\n (\n opt: TarOptionsWithAliasesAsync,\n entries: string[],\n ): typeof opt extends TarOptionsWithAliasesFile ? Promise<void>\n : typeof opt extends TarOptionsWithAliasesNoFile ? AsyncClass\n : Promise<void> | AsyncClass\n (opt: TarOptionsWithAliasesAsync, cb: CB): Promise<void>\n (\n opt: TarOptionsWithAliasesAsync,\n entries: string[],\n cb: CB,\n ): typeof opt extends TarOptionsWithAliasesFile ? Promise<void>\n : typeof opt extends TarOptionsWithAliasesNoFile ? never\n : Promise<void>\n} & {\n // maybe sync, file\n (opt: TarOptionsWithAliasesFile): Promise<void> | void\n (\n opt: TarOptionsWithAliasesFile,\n entries: string[],\n ): typeof opt extends TarOptionsWithAliasesSync ? void\n : typeof opt extends TarOptionsWithAliasesAsync ? Promise<void>\n : Promise<void> | void\n (opt: TarOptionsWithAliasesFile, cb: CB): Promise<void>\n (\n opt: TarOptionsWithAliasesFile,\n entries: string[],\n cb: CB,\n ): typeof opt extends TarOptionsWithAliasesSync ? never\n : typeof opt extends TarOptionsWithAliasesAsync Line truncated
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CornerRightUp = createLucideIcon("CornerRightUp", [
["polyline", { points: "10 9 15 4 20 9", key: "1lr6px" }],
["path", { d: "M4 20h7a4 4 0 0 0 4-4V4", key: "1plgdj" }]
]);
export { CornerRightUp as default };
//# sourceMappingURL=corner-right-up.js.map
@@ -0,0 +1,234 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OAuthTokenRevocationRequestSchema = exports.OAuthClientRegistrationErrorSchema = exports.OAuthClientInformationFullSchema = exports.OAuthClientInformationSchema = exports.OAuthClientMetadataSchema = exports.OptionalSafeUrlSchema = exports.OAuthErrorResponseSchema = exports.OAuthTokensSchema = exports.OpenIdProviderDiscoveryMetadataSchema = exports.OpenIdProviderMetadataSchema = exports.OAuthMetadataSchema = exports.OAuthProtectedResourceMetadataSchema = exports.SafeUrlSchema = void 0;
const z = __importStar(require("zod/v4"));
/**
* Reusable URL validation that disallows javascript: scheme
*/
exports.SafeUrlSchema = z
.url()
.superRefine((val, ctx) => {
if (!URL.canParse(val)) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'URL must be parseable',
fatal: true
});
return z.NEVER;
}
})
.refine(url => {
const u = new URL(url);
return u.protocol !== 'javascript:' && u.protocol !== 'data:' && u.protocol !== 'vbscript:';
}, { message: 'URL cannot use javascript:, data:, or vbscript: scheme' });
/**
* RFC 9728 OAuth Protected Resource Metadata
*/
exports.OAuthProtectedResourceMetadataSchema = z.looseObject({
resource: z.string().url(),
authorization_servers: z.array(exports.SafeUrlSchema).optional(),
jwks_uri: z.string().url().optional(),
scopes_supported: z.array(z.string()).optional(),
bearer_methods_supported: z.array(z.string()).optional(),
resource_signing_alg_values_supported: z.array(z.string()).optional(),
resource_name: z.string().optional(),
resource_documentation: z.string().optional(),
resource_policy_uri: z.string().url().optional(),
resource_tos_uri: z.string().url().optional(),
tls_client_certificate_bound_access_tokens: z.boolean().optional(),
authorization_details_types_supported: z.array(z.string()).optional(),
dpop_signing_alg_values_supported: z.array(z.string()).optional(),
dpop_bound_access_tokens_required: z.boolean().optional()
});
/**
* RFC 8414 OAuth 2.0 Authorization Server Metadata
*/
exports.OAuthMetadataSchema = z.looseObject({
issuer: z.string(),
authorization_endpoint: exports.SafeUrlSchema,
token_endpoint: exports.SafeUrlSchema,
registration_endpoint: exports.SafeUrlSchema.optional(),
scopes_supported: z.array(z.string()).optional(),
response_types_supported: z.array(z.string()),
response_modes_supported: z.array(z.string()).optional(),
grant_types_supported: z.array(z.string()).optional(),
token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
service_documentation: exports.SafeUrlSchema.optional(),
revocation_endpoint: exports.SafeUrlSchema.optional(),
revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),
revocation_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
introspection_endpoint: z.string().optional(),
introspection_endpoint_auth_methods_supported: z.array(z.string()).optional(),
introspection_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
code_challenge_methods_supported: z.array(z.string()).optional(),
client_id_metadata_document_supported: z.boolean().optional()
});
/**
* OpenID Connect Discovery 1.0 Provider Metadata
* see: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
*/
exports.OpenIdProviderMetadataSchema = z.looseObject({
issuer: z.string(),
authorization_endpoint: exports.SafeUrlSchema,
token_endpoint: exports.SafeUrlSchema,
userinfo_endpoint: exports.SafeUrlSchema.optional(),
jwks_uri: exports.SafeUrlSchema,
registration_endpoint: exports.SafeUrlSchema.optional(),
scopes_supported: z.array(z.string()).optional(),
response_types_supported: z.array(z.string()),
response_modes_supported: z.array(z.string()).optional(),
grant_types_supported: z.array(z.string()).optional(),
acr_values_supported: z.array(z.string()).optional(),
subject_types_supported: z.array(z.string()),
id_token_signing_alg_values_supported: z.array(z.string()),
id_token_encryption_alg_values_supported: z.array(z.string()).optional(),
id_token_encryption_enc_values_supported: z.array(z.string()).optional(),
userinfo_signing_alg_values_supported: z.array(z.string()).optional(),
userinfo_encryption_alg_values_supported: z.array(z.string()).optional(),
userinfo_encryption_enc_values_supported: z.array(z.string()).optional(),
request_object_signing_alg_values_supported: z.array(z.string()).optional(),
request_object_encryption_alg_values_supported: z.array(z.string()).optional(),
request_object_encryption_enc_values_supported: z.array(z.string()).optional(),
token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()).optional(),
display_values_supported: z.array(z.string()).optional(),
claim_types_supported: z.array(z.string()).optional(),
claims_supported: z.array(z.string()).optional(),
service_documentation: z.string().optional(),
claims_locales_supported: z.array(z.string()).optional(),
ui_locales_supported: z.array(z.string()).optional(),
claims_parameter_supported: z.boolean().optional(),
request_parameter_supported: z.boolean().optional(),
request_uri_parameter_supported: z.boolean().optional(),
require_request_uri_registration: z.boolean().optional(),
op_policy_uri: exports.SafeUrlSchema.optional(),
op_tos_uri: exports.SafeUrlSchema.optional(),
client_id_metadata_document_supported: z.boolean().optional()
});
/**
* OpenID Connect Discovery metadata that may include OAuth 2.0 fields
* This schema represents the real-world scenario where OIDC providers
* return a mix of OpenID Connect and OAuth 2.0 metadata fields
*/
exports.OpenIdProviderDiscoveryMetadataSchema = z.object({
...exports.OpenIdProviderMetadataSchema.shape,
...exports.OAuthMetadataSchema.pick({
code_challenge_methods_supported: true
}).shape
});
/**
* OAuth 2.1 token response
*/
exports.OAuthTokensSchema = z
.object({
access_token: z.string(),
id_token: z.string().optional(), // Optional for OAuth 2.1, but necessary in OpenID Connect
token_type: z.string(),
expires_in: z.coerce.number().optional(),
scope: z.string().optional(),
refresh_token: z.string().optional(),
/**
* Not part of the wire format: the authorization server this value was obtained from, added by
* the client's `auth()` before it is stored and compared when it is read back.
*/
issuer: z.string().optional().catch(undefined)
})
.strip();
/**
* OAuth 2.1 error response
*/
exports.OAuthErrorResponseSchema = z.object({
error: z.string(),
error_description: z.string().optional(),
error_uri: z.string().optional()
});
/**
* Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri
*/
exports.OptionalSafeUrlSchema = exports.SafeUrlSchema.optional().or(z.literal('').transform(() => undefined));
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
*/
exports.OAuthClientMetadataSchema = z
.object({
redirect_uris: z.array(exports.SafeUrlSchema),
token_endpoint_auth_method: z.string().optional(),
grant_types: z.array(z.string()).optional(),
response_types: z.array(z.string()).optional(),
client_name: z.string().optional(),
client_uri: exports.SafeUrlSchema.optional(),
logo_uri: exports.OptionalSafeUrlSchema,
scope: z.string().optional(),
contacts: z.array(z.string()).optional(),
tos_uri: exports.OptionalSafeUrlSchema,
policy_uri: z.string().optional(),
jwks_uri: exports.SafeUrlSchema.optional(),
jwks: z.any().optional(),
software_id: z.string().optional(),
software_version: z.string().optional(),
software_statement: z.string().optional()
})
.strip();
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration client information
*/
exports.OAuthClientInformationSchema = z
.object({
client_id: z.string(),
client_secret: z.string().optional(),
client_id_issued_at: z.number().optional(),
client_secret_expires_at: z.number().optional(),
/**
* Not part of the wire format: the authorization server this value was obtained from, added by
* the client's `auth()` before it is stored and compared when it is read back.
*/
issuer: z.string().optional().catch(undefined)
})
.strip();
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration full response (client information plus metadata)
*/
exports.OAuthClientInformationFullSchema = exports.OAuthClientMetadataSchema.merge(exports.OAuthClientInformationSchema);
/**
* RFC 7591 OAuth 2.0 Dynamic Client Registration error response
*/
exports.OAuthClientRegistrationErrorSchema = z
.object({
error: z.string(),
error_description: z.string().optional()
})
.strip();
/**
* RFC 7009 OAuth 2.0 Token Revocation request
*/
exports.OAuthTokenRevocationRequestSchema = z
.object({
token: z.string(),
token_type_hint: z.string().optional()
})
.strip();
//# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_uJ","132":"_7L"},C:{"2":"_S"},D:{"2":"_sJ","132":"_BK"},E:{"2":"_R"},F:{"2":"_OP","132":"_JK"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_G","132":"I"},J:{"2":"_B"},K:{"2":"_D","132":"H"},L:{"132":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"132":"KE"},S:{"2":"_C"}},B:7,C:"Document Policy",D:true};
@@ -0,0 +1,127 @@
/**
* 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.
*
*
* @format
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = mutate;
var _SimpleTransform = require("../transform/SimpleTransform");
// https://github.com/prettier/prettier/blob/d962466a828f8ef51435e3e8840178d90b7ec6cd/src/language-js/parse/postprocess/index.js#L161-L182
function transformChainExpression(node, comments) {
if (comments != null) {
var _node$comments;
// $FlowExpectedError[prop-missing]
const joinedComments = comments.concat((_node$comments = node.comments) != null ? _node$comments : []); // $FlowExpectedError[prop-missing]
// $FlowFixMe[cannot-write]
node.comments = joinedComments;
}
switch (node.type) {
case 'CallExpression':
// $FlowExpectedError[cannot-spread-interface]
return { ...node,
type: 'OptionalCallExpression',
callee: transformChainExpression(node.callee)
};
case 'MemberExpression':
// $FlowExpectedError[cannot-spread-interface]
return { ...node,
type: 'OptionalMemberExpression',
object: transformChainExpression(node.object)
};
// No default
}
return node;
}
function mutate(rootNode, visitorKeys) {
// Since we don't return the result of `transform` we need to be careful not to replace the Program root node.
_SimpleTransform.SimpleTransform.transform(rootNode, {
transform(node) {
// prettier fully expects the parent pointers are NOT set and
// certain cases can crash due to prettier infinite-looping
// whilst naively traversing the parent property
// https://github.com/prettier/prettier/issues/11793
// Note: Only needed for prettier V2, this is supported in V3
if (node.parent) {
// $FlowExpectedError[cannot-write]
delete node.parent;
} // prettier currently relies on the AST being in the old-school, deprecated AST format for optional chaining
// so we have to apply their transform to our AST so it can actually format it.
// Note: Only needed for prettier V2, this is supported in V3
if (node.type === 'ChainExpression') {
// $FlowFixMe[prop-missing]
return transformChainExpression(node.expression, node == null ? void 0 : node.comments);
} // Prettier currently relies on comparing the `node` vs `node.value` start positions to know if an
// `ObjectTypeProperty` is a method or not (instead of using the `node.method` boolean). To correctly print
// the node when its not a method we need the start position to be different from the `node.value`s start
// position.
if (node.type === 'ObjectTypeProperty') {
if (node.method === false && node.kind === 'init' && node.range[0] === 1 && node.value.range[0] === 1) {
// $FlowExpectedError[cannot-write]
// $FlowExpectedError[cannot-spread-interface]
node.value = { ...node.value,
range: [2, node.value.range[1]]
};
}
return node;
} // Prettier currently relies on comparing the the start positions to know if the import/export specifier should have a
// rename (eg `Name` vs `Name as Name`) when the name is exactly the same
// So we need to ensure that the range is always the same to avoid the useless code printing
if (node.type === 'ImportSpecifier') {
if (node.local.name === node.imported.name) {
if (node.local.range == null) {
// for our TS-ast printing which has no locs
// $FlowExpectedError[cannot-write]
node.local.range = [0, 0];
} // $FlowExpectedError[cannot-write]
node.imported.range = [...node.local.range];
}
return node;
}
if (node.type === 'ExportSpecifier') {
if (node.local.name === node.exported.name) {
if (node.local.range == null) {
// for our TS-ast printing which has no locs
// $FlowExpectedError[cannot-write]
node.local.range = [0, 0];
} // $FlowExpectedError[cannot-write]
node.exported.range = [...node.local.range];
}
return node;
}
return node;
},
visitorKeys
});
}
@@ -0,0 +1,698 @@
'use strict';
const n = /[^\0-\x7E]/;
const t = /[\x2E\u3002\uFF0E\uFF61]/g;
const o = {
overflow: "Overflow Error",
"not-basic": "Illegal Input",
"invalid-input": "Invalid Input"
};
const e = Math.floor;
const r = String.fromCharCode;
function s(n2) {
throw new RangeError(o[n2]);
}
const c = function(n2, t2) {
return n2 + 22 + 75 * (n2 < 26) - ((t2 != 0) << 5);
};
const u = function(n2, t2, o2) {
let r2 = 0;
for (n2 = o2 ? e(n2 / 700) : n2 >> 1, n2 += e(n2 / t2); n2 > 455; r2 += 36) {
n2 = e(n2 / 35);
}
return e(r2 + 36 * n2 / (n2 + 38));
};
function toASCII(o2) {
return (function(n2, o3) {
const e2 = n2.split("@");
let r2 = "";
e2.length > 1 && (r2 = e2[0] + "@", n2 = e2[1]);
const s2 = (function(n3, t2) {
const o4 = [];
let e3 = n3.length;
for (; e3--; ) {
o4[e3] = t2(n3[e3]);
}
return o4;
})((n2 = n2.replace(t, ".")).split("."), o3).join(".");
return r2 + s2;
})(o2, function(t2) {
return n.test(t2) ? "xn--" + (function(n2) {
const t3 = [];
const o3 = (n2 = (function(n3) {
const t4 = [];
let o4 = 0;
const e2 = n3.length;
for (; o4 < e2; ) {
const r2 = n3.charCodeAt(o4++);
if (r2 >= 55296 && r2 <= 56319 && o4 < e2) {
const e3 = n3.charCodeAt(o4++);
(64512 & e3) == 56320 ? t4.push(((1023 & r2) << 10) + (1023 & e3) + 65536) : (t4.push(r2), o4--);
} else {
t4.push(r2);
}
}
return t4;
})(n2)).length;
let f = 128;
let i = 0;
let l = 72;
for (const o4 of n2) {
o4 < 128 && t3.push(r(o4));
}
const h = t3.length;
let p = h;
for (h && t3.push("-"); p < o3; ) {
let o4 = 2147483647;
for (const t4 of n2) {
t4 >= f && t4 < o4 && (o4 = t4);
}
const a = p + 1;
o4 - f > e((2147483647 - i) / a) && s("overflow"), i += (o4 - f) * a, f = o4;
for (const o5 of n2) {
if (o5 < f && ++i > 2147483647 && s("overflow"), o5 == f) {
let n3 = i;
for (let o6 = 36; ; o6 += 36) {
const s2 = o6 <= l ? 1 : o6 >= l + 26 ? 26 : o6 - l;
if (n3 < s2) {
break;
}
const u2 = n3 - s2;
const f2 = 36 - s2;
t3.push(r(c(s2 + u2 % f2, 0))), n3 = e(u2 / f2);
}
t3.push(r(c(n3, 0))), l = u(i, a, p == h), i = 0, ++p;
}
}
++i, ++f;
}
return t3.join("");
})(t2) : t2;
});
}
const HASH_RE = /#/g;
const AMPERSAND_RE = /&/g;
const SLASH_RE = /\//g;
const EQUAL_RE = /=/g;
const IM_RE = /\?/g;
const PLUS_RE = /\+/g;
const ENC_CARET_RE = /%5e/gi;
const ENC_BACKTICK_RE = /%60/gi;
const ENC_CURLY_OPEN_RE = /%7b/gi;
const ENC_PIPE_RE = /%7c/gi;
const ENC_CURLY_CLOSE_RE = /%7d/gi;
const ENC_SPACE_RE = /%20/gi;
const ENC_SLASH_RE = /%2f/gi;
const ENC_ENC_SLASH_RE = /%252f/gi;
function encode(text) {
return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
}
function encodeHash(text) {
return encode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
function encodeQueryValue(input) {
return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
}
function encodeQueryKey(text) {
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
}
function encodePath(text) {
return encode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F").replace(ENC_ENC_SLASH_RE, "%2F").replace(AMPERSAND_RE, "%26").replace(PLUS_RE, "%2B");
}
function encodeParam(text) {
return encodePath(text).replace(SLASH_RE, "%2F");
}
function decode(text = "") {
try {
return decodeURIComponent("" + text);
} catch {
return "" + text;
}
}
function decodePath(text) {
return decode(text.replace(ENC_SLASH_RE, "%252F"));
}
function decodeQueryKey(text) {
return decode(text.replace(PLUS_RE, " "));
}
function decodeQueryValue(text) {
return decode(text.replace(PLUS_RE, " "));
}
function encodeHost(name = "") {
return toASCII(name);
}
function parseQuery(parametersString = "") {
const object = /* @__PURE__ */ Object.create(null);
if (parametersString[0] === "?") {
parametersString = parametersString.slice(1);
}
for (const parameter of parametersString.split("&")) {
const s = parameter.match(/([^=]+)=?(.*)/) || [];
if (s.length < 2) {
continue;
}
const key = decodeQueryKey(s[1]);
if (key === "__proto__" || key === "constructor") {
continue;
}
const value = decodeQueryValue(s[2] || "");
if (object[key] === void 0) {
object[key] = value;
} else if (Array.isArray(object[key])) {
object[key].push(value);
} else {
object[key] = [object[key], value];
}
}
return object;
}
function encodeQueryItem(key, value) {
if (typeof value === "number" || typeof value === "boolean") {
value = String(value);
}
if (!value) {
return encodeQueryKey(key);
}
if (Array.isArray(value)) {
return value.map(
(_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`
).join("&");
}
return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
}
function stringifyQuery(query) {
return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
}
const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
const PROTOCOL_SCRIPT_RE = /^[\s\0]*(blob|data|javascript|vbscript):$/i;
const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
const JOIN_LEADING_SLASH_RE = /^\.?\//;
function isRelative(inputString) {
return ["./", "../"].some((string_) => inputString.startsWith(string_));
}
function hasProtocol(inputString, opts = {}) {
if (typeof opts === "boolean") {
opts = { acceptRelative: opts };
}
if (opts.strict) {
return PROTOCOL_STRICT_REGEX.test(inputString);
}
return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
}
function isScriptProtocol(protocol) {
return !!protocol && PROTOCOL_SCRIPT_RE.test(protocol);
}
function hasTrailingSlash(input = "", respectQueryAndFragment) {
if (!respectQueryAndFragment) {
return input.endsWith("/");
}
return TRAILING_SLASH_RE.test(input);
}
function withoutTrailingSlash(input = "", respectQueryAndFragment) {
if (!respectQueryAndFragment) {
return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
}
if (!hasTrailingSlash(input, true)) {
return input || "/";
}
let path = input;
let fragment = "";
const fragmentIndex = input.indexOf("#");
if (fragmentIndex !== -1) {
path = input.slice(0, fragmentIndex);
fragment = input.slice(fragmentIndex);
}
const [s0, ...s] = path.split("?");
const cleanPath = s0.endsWith("/") ? s0.slice(0, -1) : s0;
return (cleanPath || "/") + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
}
function withTrailingSlash(input = "", respectQueryAndFragment) {
if (!respectQueryAndFragment) {
return input.endsWith("/") ? input : input + "/";
}
if (hasTrailingSlash(input, true)) {
return input || "/";
}
let path = input;
let fragment = "";
const fragmentIndex = input.indexOf("#");
if (fragmentIndex !== -1) {
path = input.slice(0, fragmentIndex);
fragment = input.slice(fragmentIndex);
if (!path) {
return fragment;
}
}
const [s0, ...s] = path.split("?");
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
}
function hasLeadingSlash(input = "") {
return input.startsWith("/");
}
function withoutLeadingSlash(input = "") {
return (hasLeadingSlash(input) ? input.slice(1) : input) || "/";
}
function withLeadingSlash(input = "") {
return hasLeadingSlash(input) ? input : "/" + input;
}
function cleanDoubleSlashes(input = "") {
return input.split("://").map((string_) => string_.replace(/\/{2,}/g, "/")).join("://");
}
function withBase(input, base) {
if (isEmptyURL(base) || hasProtocol(input)) {
return input;
}
const _base = withoutTrailingSlash(base);
if (input.startsWith(_base)) {
const nextChar = input[_base.length];
if (!nextChar || nextChar === "/" || nextChar === "?") {
return input;
}
}
return joinURL(_base, input);
}
function withoutBase(input, base) {
if (isEmptyURL(base)) {
return input;
}
const _base = withoutTrailingSlash(base);
if (!input.startsWith(_base)) {
return input;
}
const nextChar = input[_base.length];
if (nextChar && nextChar !== "/" && nextChar !== "?") {
return input;
}
const trimmed = input.slice(_base.length).replace(/^\/+/, "");
return "/" + trimmed;
}
function withQuery(input, query) {
const parsed = parseURL(input);
const mergedQuery = { ...parseQuery(parsed.search), ...query };
parsed.search = stringifyQuery(mergedQuery);
return stringifyParsedURL(parsed);
}
function filterQuery(input, predicate) {
if (!input.includes("?")) {
return input;
}
const parsed = parseURL(input);
const query = parseQuery(parsed.search);
const filteredQuery = Object.fromEntries(
Object.entries(query).filter(([key, value]) => predicate(key, value))
);
parsed.search = stringifyQuery(filteredQuery);
return stringifyParsedURL(parsed);
}
function getQuery(input) {
return parseQuery(parseURL(input).search);
}
function isEmptyURL(url) {
return !url || url === "/";
}
function isNonEmptyURL(url) {
return url && url !== "/";
}
function joinURL(base, ...input) {
let url = base || "";
for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
if (url) {
const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
url = withTrailingSlash(url) + _segment;
} else {
url = segment;
}
}
return url;
}
function joinRelativeURL(..._input) {
const JOIN_SEGMENT_SPLIT_RE = /\/(?!\/)/;
const input = _input.filter(Boolean);
const segments = [];
let segmentsDepth = 0;
for (const i of input) {
if (!i || i === "/") {
continue;
}
for (const [sindex, s] of i.split(JOIN_SEGMENT_SPLIT_RE).entries()) {
if (!s || s === ".") {
continue;
}
if (s === "..") {
if (segments.length === 1 && hasProtocol(segments[0])) {
continue;
}
segments.pop();
segmentsDepth--;
continue;
}
if (sindex === 1 && segments[segments.length - 1]?.endsWith(":/")) {
segments[segments.length - 1] += "/" + s;
continue;
}
segments.push(s);
segmentsDepth++;
}
}
let url = segments.join("/");
if (segmentsDepth >= 0) {
if (input[0]?.startsWith("/") && !url.startsWith("/")) {
url = "/" + url;
} else if (input[0]?.startsWith("./") && !url.startsWith("./")) {
url = "./" + url;
}
} else {
url = "../".repeat(-1 * segmentsDepth) + url;
}
if (input[input.length - 1]?.endsWith("/") && !url.endsWith("/")) {
url += "/";
}
return url;
}
function withHttp(input) {
return withProtocol(input, "http://");
}
function withHttps(input) {
return withProtocol(input, "https://");
}
function withoutProtocol(input) {
return withProtocol(input, "");
}
function withProtocol(input, protocol) {
let match = input.match(PROTOCOL_REGEX);
if (!match) {
match = input.match(/^\/{2,}/);
}
if (!match) {
return protocol + input;
}
return protocol + input.slice(match[0].length);
}
function normalizeURL(input) {
const parsed = parseURL(input);
parsed.pathname = encodePath(decodePath(parsed.pathname));
parsed.hash = encodeHash(decode(parsed.hash));
parsed.host = encodeHost(decode(parsed.host));
parsed.search = stringifyQuery(parseQuery(parsed.search));
return stringifyParsedURL(parsed);
}
function resolveURL(base = "", ...inputs) {
if (typeof base !== "string") {
throw new TypeError(
`URL input should be string received ${typeof base} (${base})`
);
}
const filteredInputs = inputs.filter((input) => isNonEmptyURL(input));
if (filteredInputs.length === 0) {
return base;
}
const url = parseURL(base);
for (const inputSegment of filteredInputs) {
const urlSegment = parseURL(inputSegment);
if (urlSegment.pathname) {
url.pathname = withTrailingSlash(url.pathname) + withoutLeadingSlash(urlSegment.pathname);
}
if (urlSegment.hash && urlSegment.hash !== "#") {
url.hash = urlSegment.hash;
}
if (urlSegment.search && urlSegment.search !== "?") {
if (url.search && url.search !== "?") {
const queryString = stringifyQuery({
...parseQuery(url.search),
...parseQuery(urlSegment.search)
});
url.search = queryString.length > 0 ? "?" + queryString : "";
} else {
url.search = urlSegment.search;
}
}
}
return stringifyParsedURL(url);
}
function isSamePath(p1, p2) {
return decode(withoutTrailingSlash(p1)) === decode(withoutTrailingSlash(p2));
}
function isEqual(a, b, options = {}) {
if (!options.trailingSlash) {
a = withTrailingSlash(a);
b = withTrailingSlash(b);
}
if (!options.leadingSlash) {
a = withLeadingSlash(a);
b = withLeadingSlash(b);
}
if (!options.encoding) {
a = decode(a);
b = decode(b);
}
return a === b;
}
function withFragment(input, hash) {
if (!hash || hash === "#") {
return input;
}
const parsed = parseURL(input);
parsed.hash = hash === "" ? "" : "#" + encodeHash(hash);
return stringifyParsedURL(parsed);
}
function withoutFragment(input) {
return stringifyParsedURL({ ...parseURL(input), hash: "" });
}
function withoutHost(input) {
const parsed = parseURL(input);
return (parsed.pathname || "/") + parsed.search + parsed.hash;
}
const protocolRelative = Symbol.for("ufo:protocolRelative");
function parseURL(input = "", defaultProto) {
const _specialProtoMatch = input.match(
/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
);
if (_specialProtoMatch) {
const [, _proto, _pathname = ""] = _specialProtoMatch;
return {
protocol: _proto.toLowerCase(),
pathname: _pathname,
href: _proto + _pathname,
auth: "",
host: "",
search: "",
hash: ""
};
}
if (!hasProtocol(input, { acceptRelative: true })) {
return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
}
const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
if (protocol === "file:") {
path = path.replace(/\/(?=[A-Za-z]:)/, "");
}
const { pathname, search, hash } = parsePath(path);
return {
protocol: protocol.toLowerCase(),
auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
host,
pathname,
search,
hash,
[protocolRelative]: !protocol
};
}
function parsePath(input = "") {
const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
return {
pathname,
search,
hash
};
}
function parseAuth(input = "") {
const [username, password] = input.split(":");
return {
username: decode(username),
password: decode(password)
};
}
function parseHost(input = "") {
const [hostname, port] = (input.match(/([^/:]*):?(\d+)?/) || []).splice(1);
return {
hostname: decode(hostname),
port
};
}
function stringifyParsedURL(parsed) {
const pathname = parsed.pathname || "";
const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
const hash = parsed.hash || "";
const auth = parsed.auth ? parsed.auth + "@" : "";
const host = parsed.host || "";
const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "";
return proto + auth + host + pathname + search + hash;
}
const FILENAME_STRICT_REGEX = /\/([^/]+\.[^/]+)$/;
const FILENAME_REGEX = /\/([^/]+)$/;
function parseFilename(input = "", opts) {
const { pathname } = parseURL(input);
const matches = opts?.strict ? pathname.match(FILENAME_STRICT_REGEX) : pathname.match(FILENAME_REGEX);
return matches ? matches[1] : void 0;
}
class $URL {
protocol;
host;
auth;
pathname;
query = {};
hash;
constructor(input = "") {
if (typeof input !== "string") {
throw new TypeError(
`URL input should be string received ${typeof input} (${input})`
);
}
const parsed = parseURL(input);
this.protocol = decode(parsed.protocol);
this.host = decode(parsed.host);
this.auth = decode(parsed.auth);
this.pathname = decodePath(parsed.pathname);
this.query = parseQuery(parsed.search);
this.hash = decode(parsed.hash);
}
get hostname() {
return parseHost(this.host).hostname;
}
get port() {
return parseHost(this.host).port || "";
}
get username() {
return parseAuth(this.auth).username;
}
get password() {
return parseAuth(this.auth).password || "";
}
get hasProtocol() {
return this.protocol.length;
}
get isAbsolute() {
return this.hasProtocol || this.pathname[0] === "/";
}
get search() {
const q = stringifyQuery(this.query);
return q.length > 0 ? "?" + q : "";
}
get searchParams() {
const p = new URLSearchParams();
for (const name in this.query) {
const value = this.query[name];
if (Array.isArray(value)) {
for (const v of value) {
p.append(name, v);
}
} else {
p.append(
name,
typeof value === "string" ? value : JSON.stringify(value)
);
}
}
return p;
}
get origin() {
return (this.protocol ? this.protocol + "//" : "") + encodeHost(this.host);
}
get fullpath() {
return encodePath(this.pathname) + this.search + encodeHash(this.hash);
}
get encodedAuth() {
if (!this.auth) {
return "";
}
const { username, password } = parseAuth(this.auth);
return encodeURIComponent(username) + (password ? ":" + encodeURIComponent(password) : "");
}
get href() {
const auth = this.encodedAuth;
const originWithAuth = (this.protocol ? this.protocol + "//" : "") + (auth ? auth + "@" : "") + encodeHost(this.host);
return this.hasProtocol && this.isAbsolute ? originWithAuth + this.fullpath : this.fullpath;
}
append(url) {
if (url.hasProtocol) {
throw new Error("Cannot append a URL with protocol");
}
Object.assign(this.query, url.query);
if (url.pathname) {
this.pathname = withTrailingSlash(this.pathname) + withoutLeadingSlash(url.pathname);
}
if (url.hash) {
this.hash = url.hash;
}
}
toJSON() {
return this.href;
}
toString() {
return this.href;
}
}
function createURL(input) {
return new $URL(input);
}
exports.$URL = $URL;
exports.cleanDoubleSlashes = cleanDoubleSlashes;
exports.createURL = createURL;
exports.decode = decode;
exports.decodePath = decodePath;
exports.decodeQueryKey = decodeQueryKey;
exports.decodeQueryValue = decodeQueryValue;
exports.encode = encode;
exports.encodeHash = encodeHash;
exports.encodeHost = encodeHost;
exports.encodeParam = encodeParam;
exports.encodePath = encodePath;
exports.encodeQueryItem = encodeQueryItem;
exports.encodeQueryKey = encodeQueryKey;
exports.encodeQueryValue = encodeQueryValue;
exports.filterQuery = filterQuery;
exports.getQuery = getQuery;
exports.hasLeadingSlash = hasLeadingSlash;
exports.hasProtocol = hasProtocol;
exports.hasTrailingSlash = hasTrailingSlash;
exports.isEmptyURL = isEmptyURL;
exports.isEqual = isEqual;
exports.isNonEmptyURL = isNonEmptyURL;
exports.isRelative = isRelative;
exports.isSamePath = isSamePath;
exports.isScriptProtocol = isScriptProtocol;
exports.joinRelativeURL = joinRelativeURL;
exports.joinURL = joinURL;
exports.normalizeURL = normalizeURL;
exports.parseAuth = parseAuth;
exports.parseFilename = parseFilename;
exports.parseHost = parseHost;
exports.parsePath = parsePath;
exports.parseQuery = parseQuery;
exports.parseURL = parseURL;
exports.resolveURL = resolveURL;
exports.stringifyParsedURL = stringifyParsedURL;
exports.stringifyQuery = stringifyQuery;
exports.withBase = withBase;
exports.withFragment = withFragment;
exports.withHttp = withHttp;
exports.withHttps = withHttps;
exports.withLeadingSlash = withLeadingSlash;
exports.withProtocol = withProtocol;
exports.withQuery = withQuery;
exports.withTrailingSlash = withTrailingSlash;
exports.withoutBase = withoutBase;
exports.withoutFragment = withoutFragment;
exports.withoutHost = withoutHost;
exports.withoutLeadingSlash = withoutLeadingSlash;
exports.withoutProtocol = withoutProtocol;
exports.withoutTrailingSlash = withoutTrailingSlash;
@@ -0,0 +1,112 @@
/*
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
const percent = require('./percent');
const dataProperties = require('./data-properties');
function blankSummary() {
const empty = () => ({
total: 0,
covered: 0,
skipped: 0,
pct: 'Unknown'
});
return {
lines: empty(),
statements: empty(),
functions: empty(),
branches: empty(),
branchesTrue: empty()
};
}
// asserts that a data object "looks like" a summary coverage object
function assertValidSummary(obj) {
const valid =
obj && obj.lines && obj.statements && obj.functions && obj.branches;
if (!valid) {
throw new Error(
'Invalid summary coverage object, missing keys, found:' +
Object.keys(obj).join(',')
);
}
}
/**
* CoverageSummary provides a summary of code coverage . It exposes 4 properties,
* `lines`, `statements`, `branches`, and `functions`. Each of these properties
* is an object that has 4 keys `total`, `covered`, `skipped` and `pct`.
* `pct` is a percentage number (0-100).
*/
class CoverageSummary {
/**
* @constructor
* @param {Object|CoverageSummary} [obj=undefined] an optional data object or
* another coverage summary to initialize this object with.
*/
constructor(obj) {
if (!obj) {
this.data = blankSummary();
} else if (obj instanceof CoverageSummary) {
this.data = obj.data;
} else {
this.data = obj;
}
assertValidSummary(this.data);
}
/**
* merges a second summary coverage object into this one
* @param {CoverageSummary} obj - another coverage summary object
*/
merge(obj) {
const keys = [
'lines',
'statements',
'branches',
'functions',
'branchesTrue'
];
keys.forEach(key => {
if (obj[key]) {
this[key].total += obj[key].total;
this[key].covered += obj[key].covered;
this[key].skipped += obj[key].skipped;
this[key].pct = percent(this[key].covered, this[key].total);
}
});
return this;
}
/**
* returns a POJO that is JSON serializable. May be used to get the raw
* summary object.
*/
toJSON() {
return this.data;
}
/**
* return true if summary has no lines of code
*/
isEmpty() {
return this.lines.total === 0;
}
}
dataProperties(CoverageSummary, [
'lines',
'statements',
'functions',
'branches',
'branchesTrue'
]);
module.exports = {
CoverageSummary
};
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _arrayWithoutHoles;
var _arrayLikeToArray = require("./arrayLikeToArray.js");
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return (0, _arrayLikeToArray.default)(arr);
}
//# sourceMappingURL=arrayWithoutHoles.js.map
@@ -0,0 +1,46 @@
'use strict';
// do not edit .js files directly - edit src/index.jst
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
@@ -0,0 +1,89 @@
/**
* @fileoverview Shared flags for ESLint.
*/
"use strict";
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* @typedef {Object} InactiveFlagData
* @property {string} description Flag description
* @property {string | null} [replacedBy] Can be either:
* - An active flag (string) that enables the same feature.
* - `null` if the feature is now enabled by default.
* - Omitted if the feature has been abandoned.
*/
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* The set of flags that change ESLint behavior with a description.
* @type {Map<string, string>}
*/
const activeFlags = new Map([
["test_only", "Used only for testing."],
["test_only_2", "Used only for testing."],
[
"unstable_native_nodejs_ts_config",
"Use native Node.js to load TypeScript configuration.",
],
]);
/**
* The set of flags that used to be active.
* @type {Map<string, InactiveFlagData>}
*/
const inactiveFlags = new Map([
[
"test_only_replaced",
{
description:
"Used only for testing flags that have been replaced by other flags.",
replacedBy: "test_only",
},
],
[
"test_only_enabled_by_default",
{
description:
"Used only for testing flags whose features have been enabled by default.",
replacedBy: null,
},
],
[
"test_only_abandoned",
{
description:
"Used only for testing flags whose features have been abandoned.",
},
],
]);
/**
* Creates a message that describes the reason the flag is inactive.
* @param {InactiveFlagData} inactiveFlagData Data for the inactive flag.
* @returns {string} Message describing the reason the flag is inactive.
*/
function getInactivityReasonMessage({ replacedBy }) {
if (typeof replacedBy === "undefined") {
return "This feature has been abandoned.";
}
if (typeof replacedBy === "string") {
return `This flag has been renamed '${replacedBy}' to reflect its stabilization. Please use '${replacedBy}' instead.`;
}
// null
return "This feature is now enabled by default.";
}
module.exports = {
activeFlags,
inactiveFlags,
getInactivityReasonMessage,
};
@@ -0,0 +1,5 @@
import { HtmlEscapedString, raw } from "../../utils/html.js";
//#region src/helper/html/index.d.ts
export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => HtmlEscapedString | Promise<HtmlEscapedString>;
//#endregion
export { raw };
@@ -0,0 +1,340 @@
/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
function push(heap, node) {
var index = heap.length;
heap.push(node);
a: for (; 0 < index; ) {
var parentIndex = (index - 1) >>> 1,
parent = heap[parentIndex];
if (0 < compare(parent, node))
(heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);
else break a;
}
}
function peek(heap) {
return 0 === heap.length ? null : heap[0];
}
function pop(heap) {
if (0 === heap.length) return null;
var first = heap[0],
last = heap.pop();
if (last !== first) {
heap[0] = last;
a: for (
var index = 0, length = heap.length, halfLength = length >>> 1;
index < halfLength;
) {
var leftIndex = 2 * (index + 1) - 1,
left = heap[leftIndex],
rightIndex = leftIndex + 1,
right = heap[rightIndex];
if (0 > compare(left, last))
rightIndex < length && 0 > compare(right, left)
? ((heap[index] = right),
(heap[rightIndex] = last),
(index = rightIndex))
: ((heap[index] = left),
(heap[leftIndex] = last),
(index = leftIndex));
else if (rightIndex < length && 0 > compare(right, last))
(heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);
else break a;
}
}
return first;
}
function compare(a, b) {
var diff = a.sortIndex - b.sortIndex;
return 0 !== diff ? diff : a.id - b.id;
}
exports.unstable_now = void 0;
if ("object" === typeof performance && "function" === typeof performance.now) {
var localPerformance = performance;
exports.unstable_now = function () {
return localPerformance.now();
};
} else {
var localDate = Date,
initialTime = localDate.now();
exports.unstable_now = function () {
return localDate.now() - initialTime;
};
}
var taskQueue = [],
timerQueue = [],
taskIdCounter = 1,
currentTask = null,
currentPriorityLevel = 3,
isPerformingWork = !1,
isHostCallbackScheduled = !1,
isHostTimeoutScheduled = !1,
needsPaint = !1,
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null,
localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
function advanceTimers(currentTime) {
for (var timer = peek(timerQueue); null !== timer; ) {
if (null === timer.callback) pop(timerQueue);
else if (timer.startTime <= currentTime)
pop(timerQueue),
(timer.sortIndex = timer.expirationTime),
push(taskQueue, timer);
else break;
timer = peek(timerQueue);
}
}
function handleTimeout(currentTime) {
isHostTimeoutScheduled = !1;
advanceTimers(currentTime);
if (!isHostCallbackScheduled)
if (null !== peek(taskQueue))
(isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
}
}
var isMessageLoopRunning = !1,
taskTimeoutID = -1,
frameInterval = 5,
startTime = -1;
function shouldYieldToHost() {
return needsPaint
? !0
: exports.unstable_now() - startTime < frameInterval
? !1
: !0;
}
function performWorkUntilDeadline() {
needsPaint = !1;
if (isMessageLoopRunning) {
var currentTime = exports.unstable_now();
startTime = currentTime;
var hasMoreWork = !0;
try {
a: {
isHostCallbackScheduled = !1;
isHostTimeoutScheduled &&
((isHostTimeoutScheduled = !1),
localClearTimeout(taskTimeoutID),
(taskTimeoutID = -1));
isPerformingWork = !0;
var previousPriorityLevel = currentPriorityLevel;
try {
b: {
advanceTimers(currentTime);
for (
currentTask = peek(taskQueue);
null !== currentTask &&
!(
currentTask.expirationTime > currentTime && shouldYieldToHost()
);
) {
var callback = currentTask.callback;
if ("function" === typeof callback) {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var continuationCallback = callback(
currentTask.expirationTime <= currentTime
);
currentTime = exports.unstable_now();
if ("function" === typeof continuationCallback) {
currentTask.callback = continuationCallback;
advanceTimers(currentTime);
hasMoreWork = !0;
break b;
}
currentTask === peek(taskQueue) && pop(taskQueue);
advanceTimers(currentTime);
} else pop(taskQueue);
currentTask = peek(taskQueue);
}
if (null !== currentTask) hasMoreWork = !0;
else {
var firstTimer = peek(timerQueue);
null !== firstTimer &&
requestHostTimeout(
handleTimeout,
firstTimer.startTime - currentTime
);
hasMoreWork = !1;
}
}
break a;
} finally {
(currentTask = null),
(currentPriorityLevel = previousPriorityLevel),
(isPerformingWork = !1);
}
hasMoreWork = void 0;
}
} finally {
hasMoreWork
? schedulePerformWorkUntilDeadline()
: (isMessageLoopRunning = !1);
}
}
}
var schedulePerformWorkUntilDeadline;
if ("function" === typeof localSetImmediate)
schedulePerformWorkUntilDeadline = function () {
localSetImmediate(performWorkUntilDeadline);
};
else if ("undefined" !== typeof MessageChannel) {
var channel = new MessageChannel(),
port = channel.port2;
channel.port1.onmessage = performWorkUntilDeadline;
schedulePerformWorkUntilDeadline = function () {
port.postMessage(null);
};
} else
schedulePerformWorkUntilDeadline = function () {
localSetTimeout(performWorkUntilDeadline, 0);
};
function requestHostTimeout(callback, ms) {
taskTimeoutID = localSetTimeout(function () {
callback(exports.unstable_now());
}, ms);
}
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_cancelCallback = function (task) {
task.callback = null;
};
exports.unstable_forceFrameRate = function (fps) {
0 > fps || 125 < fps
? console.error(
"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
)
: (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);
};
exports.unstable_getCurrentPriorityLevel = function () {
return currentPriorityLevel;
};
exports.unstable_next = function (eventHandler) {
switch (currentPriorityLevel) {
case 1:
case 2:
case 3:
var priorityLevel = 3;
break;
default:
priorityLevel = currentPriorityLevel;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
exports.unstable_requestPaint = function () {
needsPaint = !0;
};
exports.unstable_runWithPriority = function (priorityLevel, eventHandler) {
switch (priorityLevel) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
priorityLevel = 3;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
exports.unstable_scheduleCallback = function (
priorityLevel,
callback,
options
) {
var currentTime = exports.unstable_now();
"object" === typeof options && null !== options
? ((options = options.delay),
(options =
"number" === typeof options && 0 < options
? currentTime + options
: currentTime))
: (options = currentTime);
switch (priorityLevel) {
case 1:
var timeout = -1;
break;
case 2:
timeout = 250;
break;
case 5:
timeout = 1073741823;
break;
case 4:
timeout = 1e4;
break;
default:
timeout = 5e3;
}
timeout = options + timeout;
priorityLevel = {
id: taskIdCounter++,
callback: callback,
priorityLevel: priorityLevel,
startTime: options,
expirationTime: timeout,
sortIndex: -1
};
options > currentTime
? ((priorityLevel.sortIndex = options),
push(timerQueue, priorityLevel),
null === peek(taskQueue) &&
priorityLevel === peek(timerQueue) &&
(isHostTimeoutScheduled
? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))
: (isHostTimeoutScheduled = !0),
requestHostTimeout(handleTimeout, options - currentTime)))
: ((priorityLevel.sortIndex = timeout),
push(taskQueue, priorityLevel),
isHostCallbackScheduled ||
isPerformingWork ||
((isHostCallbackScheduled = !0),
isMessageLoopRunning ||
((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline())));
return priorityLevel;
};
exports.unstable_shouldYield = shouldYieldToHost;
exports.unstable_wrapCallback = function (callback) {
var parentPriorityLevel = currentPriorityLevel;
return function () {
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = parentPriorityLevel;
try {
return callback.apply(this, arguments);
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
};
@@ -0,0 +1,138 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_utils_html = require("../../utils/html.js");
const require_jsx_constants = require("../constants.js");
const require_jsx_context = require("../context.js");
const require_jsx_intrinsic_element_common = require("./common.js");
const require_jsx_children = require("../children.js");
const require_jsx_base = require("../base.js");
//#region src/jsx/intrinsic-element/components.ts
var components_exports = /* @__PURE__ */ require_runtime.__exportAll({
button: () => button,
form: () => form,
input: () => input,
link: () => link,
meta: () => meta,
script: () => script,
style: () => style,
title: () => title
});
const metaTagMap = /* @__PURE__ */ new WeakMap();
const insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => {
if (!buffer) return;
const map = metaTagMap.get(context) || {};
metaTagMap.set(context, map);
const tags = map[tagName] ||= [];
let duped = false;
const deDupeKeys = require_jsx_intrinsic_element_common.deDupeKeyMap[tagName];
const deDupeByKey = require_jsx_intrinsic_element_common.shouldDeDupeByKey(tagName, precedence !== void 0);
if (deDupeByKey) LOOP: for (const [, tagProps] of tags) {
if (tagName === "link" && !(tagProps.rel === "stylesheet" && tagProps["data-precedence"] !== void 0)) continue;
for (const key of deDupeKeys) if ((tagProps?.[key] ?? null) === props?.[key]) {
duped = true;
break LOOP;
}
}
if (duped) buffer[0] = buffer[0].replaceAll(tag, "");
else if (deDupeByKey || tagName === "link") tags.push([
tag,
props,
precedence
]);
else tags.unshift([
tag,
props,
precedence
]);
if (buffer[0].indexOf("</head>") !== -1) {
let insertTags;
if (tagName === "link" || precedence !== void 0) {
const precedences = [];
insertTags = tags.map(([tag, , tagPrecedence], index) => {
if (tagPrecedence === void 0) return [
tag,
Number.MAX_SAFE_INTEGER,
index
];
let order = precedences.indexOf(tagPrecedence);
if (order === -1) {
precedences.push(tagPrecedence);
order = precedences.length - 1;
}
return [
tag,
order,
index
];
}).sort((a, b) => a[1] - b[1] || a[2] - b[2]).map(([tag]) => tag);
} else insertTags = tags.map(([tag]) => tag);
insertTags.forEach((tag) => {
buffer[0] = buffer[0].replaceAll(tag, "");
});
buffer[0] = buffer[0].replace(/(?=<\/head>)/, () => insertTags.join(""));
}
};
const returnWithoutSpecialBehavior = (tag, children, props) => require_jsx_base.renderChildren([new require_jsx_base.JSXNode(tag, props, require_jsx_children.toArray(children ?? []))]);
const documentMetadataTag = (tag, children, props, sort) => {
if ("itemProp" in props) return returnWithoutSpecialBehavior(tag, children, props);
let { precedence, blocking, ...restProps } = props;
precedence = sort ? precedence ?? "" : void 0;
if (sort) restProps[require_jsx_intrinsic_element_common.dataPrecedenceAttr] = precedence;
const string = new require_jsx_base.JSXNode(tag, restProps, require_jsx_children.toArray(children || [])).toString();
if (string instanceof Promise) return string.then((resString) => require_utils_html.raw(resString, [...resString.callbacks || [], insertIntoHead(tag, resString, restProps, precedence)]));
else return require_utils_html.raw(string, [insertIntoHead(tag, string, restProps, precedence)]);
};
const title = ({ children, ...props }) => {
const nameSpaceContext = require_jsx_base.getNameSpaceContext();
if (nameSpaceContext) {
const context = require_jsx_context.useContext(nameSpaceContext);
if (context === "svg" || context === "head") return new require_jsx_base.JSXNode("title", props, require_jsx_children.toArray(children ?? []));
}
return documentMetadataTag("title", children, props, false);
};
const script = ({ children, ...props }) => {
const nameSpaceContext = require_jsx_base.getNameSpaceContext();
if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && require_jsx_context.useContext(nameSpaceContext) === "head") return returnWithoutSpecialBehavior("script", children, props);
return documentMetadataTag("script", children, props, false);
};
const style = ({ children, ...props }) => {
if (!["href", "precedence"].every((k) => k in props)) return returnWithoutSpecialBehavior("style", children, props);
props["data-href"] = props.href;
delete props.href;
return documentMetadataTag("style", children, props, true);
};
const link = ({ children, ...props }) => {
if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) return returnWithoutSpecialBehavior("link", children, props);
return documentMetadataTag("link", children, props, require_jsx_intrinsic_element_common.isStylesheetLinkWithPrecedence(props));
};
const meta = ({ children, ...props }) => {
const nameSpaceContext = require_jsx_base.getNameSpaceContext();
if (nameSpaceContext && require_jsx_context.useContext(nameSpaceContext) === "head") return returnWithoutSpecialBehavior("meta", children, props);
return documentMetadataTag("meta", children, props, false);
};
const newJSXNode = (tag, { children, ...props }) => new require_jsx_base.JSXNode(tag, props, require_jsx_children.toArray(children ?? []));
const form = (props) => {
if (typeof props.action === "function") props.action = require_jsx_constants.PERMALINK in props.action ? props.action[require_jsx_constants.PERMALINK] : void 0;
return newJSXNode("form", props);
};
const formActionableElement = (tag, props) => {
if (typeof props.formAction === "function") props.formAction = require_jsx_constants.PERMALINK in props.formAction ? props.formAction[require_jsx_constants.PERMALINK] : void 0;
return newJSXNode(tag, props);
};
const input = (props) => formActionableElement("input", props);
const button = (props) => formActionableElement("button", props);
//#endregion
exports.button = button;
Object.defineProperty(exports, "components_exports", {
enumerable: true,
get: function() {
return components_exports;
}
});
exports.form = form;
exports.input = input;
exports.link = link;
exports.meta = meta;
exports.script = script;
exports.style = style;
exports.title = title;
@@ -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 FileKey = createLucideIcon("FileKey", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["circle", { cx: "10", cy: "16", r: "2", key: "4ckbqe" }],
["path", { d: "m16 10-4.5 4.5", key: "7p3ebg" }],
["path", { d: "m15 11 1 1", key: "1bsyx3" }]
]);
export { FileKey as default };
//# sourceMappingURL=file-key.js.map
@@ -0,0 +1 @@
module.exports={A:{D:{"1":"_4H _l","33":"_v _6F"},L:{"1":"I"},B:{"1":"_4H _i","2":"_I","33":"_FB _6F"},C:{"2":"_S"},M:{"2":"YC"},A:{"2":"_E"},F:{"1":"_pQ _h","2":"_T","33":"_MC _1J"},K:{"1":"H","2":"_D"},E:{"1":"_VU _OE","2":"XD","33":"_LI"},G:{"1":"_cE","33":"_3F"},P:{"1":"_6B","33":"_IL"},I:{"1":"I","2":"_W","33":"_y"}},B:6,C:":autofill CSS pseudo-class",D:undefined};
@@ -0,0 +1 @@
{"version":3,"file":"shield-question.js","sources":["../../../src/icons/shield-question.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShieldQuestion\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTNjMCA1LTMuNSA3LjUtNy42NiA4Ljk1YTEgMSAwIDAgMS0uNjctLjAxQzcuNSAyMC41IDQgMTggNCAxM1Y2YTEgMSAwIDAgMSAxLTFjMiAwIDQuNS0xLjIgNi4yNC0yLjcyYTEuMTcgMS4xNyAwIDAgMSAxLjUyIDBDMTQuNTEgMy44MSAxNyA1IDE5IDVhMSAxIDAgMCAxIDEgMXoiIC8+CiAgPHBhdGggZD0iTTkuMSA5YTMgMyAwIDAgMSA1LjgyIDFjMCAyLTMgMy0zIDMiIC8+CiAgPHBhdGggZD0iTTEyIDE3aC4wMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/shield-question\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 ShieldQuestion = createLucideIcon('ShieldQuestion', [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n key: 'oel41y',\n },\n ],\n ['path', { d: 'M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3', key: 'mhlwft' }],\n ['path', { d: 'M12 17h.01', key: 'p32p05' }],\n]);\n\nexport default ShieldQuestion;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAuC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,38 @@
'use strict';
function checkDCE() {
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// This branch is unreachable because this function is only called
// in production, but the condition is true only in development.
// Therefore if the branch is still here, dead code elimination wasn't
// properly applied.
// Don't change the message. React DevTools relies on it. Also make sure
// this message doesn't occur elsewhere in this function, or it will cause
// a false positive.
throw new Error('^_^');
}
try {
// Verify that the code above has been dead code eliminated (DCE'd).
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
} catch (err) {
// DevTools shouldn't crash React, no matter what.
// We should still report in case we break this code.
console.error(err);
}
}
if (process.env.NODE_ENV === 'production') {
// DCE check should happen before ReactDOM bundle executes so that
// DevTools can report bad minification during injection.
checkDCE();
module.exports = require('./cjs/react-dom-profiling.profiling.js');
} else {
module.exports = require('./cjs/react-dom-profiling.development.js');
}
@@ -0,0 +1 @@
{"version":3,"file":"book-template.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -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 BoomBox = createLucideIcon("BoomBox", [
["path", { d: "M4 9V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4", key: "vvzvr1" }],
["path", { d: "M8 8v1", key: "xcqmfk" }],
["path", { d: "M12 8v1", key: "1rj8u4" }],
["path", { d: "M16 8v1", key: "1q12zr" }],
["rect", { width: "20", height: "12", x: "2", y: "9", rx: "2", key: "igpb89" }],
["circle", { cx: "8", cy: "15", r: "2", key: "fa4a8s" }],
["circle", { cx: "16", cy: "15", r: "2", key: "14c3ya" }]
]);
export { BoomBox as default };
//# sourceMappingURL=boom-box.js.map
@@ -0,0 +1 @@
{"version":3,"file":"elicitationFormExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":";AAAA,kEAAkE;AAClE,EAAE;AACF,yFAAyF;AACzF,0EAA0E;AAC1E,2FAA2F;AAC3F,gCAAgC;AAChC,kFAAkF;AAClF,mDAAmD;;AAEnD,6CAAyC;AAEzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAqD;AACrD,wDAA8D;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,8FAA8F;IAC9F,2FAA2F;IAC3F,MAAM,SAAS,GAAG,IAAI,kBAAS,CAC3B;QACI,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE;KACnB,CACJ,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,YAAY,CAClB,eAAe,EACf;QACI,WAAW,EAAE,6DAA6D;QAC1E,WAAW,EAAE,EAAE;KAClB,EACD,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,oDAAoD;YACpD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;gBAC9C,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,+CAA+C;gBACxD,eAAe,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,QAAQ,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,UAAU;4BACjB,WAAW,EAAE,yCAAyC;4BACtD,SAAS,EAAE,CAAC;4BACZ,SAAS,EAAE,EAAE;yBAChB;wBACD,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,OAAO;4BACd,WAAW,EAAE,oBAAoB;4BACjC,MAAM,EAAE,OAAO;yBAClB;wBACD,QAAQ,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,UAAU;4BACjB,WAAW,EAAE,kCAAkC;4BAC/C,SAAS,EAAE,CAAC;yBACf;wBACD,UAAU,EAAE;4BACR,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,YAAY;4BACnB,WAAW,EAAE,0BAA0B;4BACvC,OAAO,EAAE,KAAK;yBACjB;wBACD,IAAI,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,MAAM;4BACb,WAAW,EAAE,mBAAmB;4BAChC,KAAK,EAAE;gCACH,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;gCAC1C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;gCACxC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;gCACtC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;6BACrC;4BACD,OAAO,EAAE,WAAW;yBACvB;wBACD,SAAS,EAAE;4BACP,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,WAAW;4BAClB,WAAW,EAAE,+BAA+B;4BAC5C,KAAK,EAAE;gCACH,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;6BAC1D;4BACD,QAAQ,EAAE,CAAC;4BACX,QAAQ,EAAE,CAAC;yBACd;qBACJ;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC;iBAC9C;aACJ,CAAC,CAAC;YAEH,wCAAwC;YACxC,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBAC/C,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,OAK9C,CAAC;gBAEF,OAAO;oBACH,OAAO,EAAE;wBACL;4BACI,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,yCAAyC,QAAQ,YAAY,KAAK,iBAAiB,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;yBACvH;qBACJ;iBACJ,CAAC;YACN,CAAC;iBAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACrC,OAAO;oBACH,OAAO,EAAE;wBACL;4BACI,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,iCAAiC;yBAC1C;qBACJ;iBACJ,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,OAAO,EAAE;wBACL;4BACI,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,6BAA6B;yBACtC;qBACJ;iBACJ,CAAC;YACN,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,wBAAwB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACzF;iBACJ;gBACD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,YAAY,CAClB,cAAc,EACd;QACI,WAAW,EAAE,qDAAqD;QAClE,WAAW,EAAE,EAAE;KAClB,EACD,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,0CAA0C;YAC1C,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;gBACjD,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,uCAAuC;gBAChD,eAAe,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,aAAa;4BACpB,WAAW,EAAE,mBAAmB;4BAChC,SAAS,EAAE,CAAC;yBACf;wBACD,WAAW,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,aAAa;4BACpB,WAAW,EAAE,8BAA8B;yBAC9C;qBACJ;oBACD,QAAQ,EAAE,CAAC,OAAO,CAAC;iBACtB;aACJ,CAAC,CAAC;YAEH,IAAI,SAAS,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gBACtD,OAAO;oBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;iBACjE,CAAC;YACN,CAAC;YAED,gCAAgC;YAChC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;gBAChD,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,6BAA6B;gBACtC,eAAe,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,IAAI,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,MAAM;4BACb,WAAW,EAAE,YAAY;4BACzB,MAAM,EAAE,MAAM;yBACjB;wBACD,SAAS,EAAE;4BACP,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,YAAY;4BACnB,WAAW,EAAE,0BAA0B;yBAC1C;wBACD,QAAQ,EAAE;4BACN,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,UAAU;4BACjB,WAAW,EAAE,qBAAqB;4BAClC,OAAO,EAAE,EAAE;4BACX,OAAO,EAAE,GAAG;yBACf;qBACJ;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC;iBAC9C;aACJ,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACpD,OAAO;oBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;iBACjE,CAAC;YACN,CAAC;YAED,oCAAoC;YACpC,MAAM,KAAK,GAAG;gBACV,GAAG,SAAS,CAAC,OAAO;gBACpB,GAAG,QAAQ,CAAC,OAAO;aACtB,CAAC;YAEF,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,kCAAkC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;qBAC3E;iBACJ;aACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC3F;iBACJ;gBACD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,YAAY,CAClB,yBAAyB,EACzB;QACI,WAAW,EAAE,yCAAyC;QACtD,WAAW,EAAE,EAAE;KAClB,EACD,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,MAALine truncated
@@ -0,0 +1 @@
{"version":3,"file":"decode-data-xml.d.ts","sourceRoot":"","sources":["../../../src/generated/decode-data-xml.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAE,WAK3B,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"store.mjs","sources":["../../../src/render/store.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap<any, VisualElement>()\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAG,IAAI,OAAO;;;;"}
@@ -0,0 +1,492 @@
---
name: router-core/type-safety
description: >-
Full type inference philosophy (never cast, never annotate inferred
values), Register module declaration, from narrowing on hooks and
Link, strict:false for shared components, getRouteApi for code-split
typed access, addChildren with object syntax for TS perf, LinkProps
and ValidateLinkOptions type utilities, as const satisfies pattern.
type: sub-skill
library: tanstack-router
library_version: '1.166.2'
requires:
- router-core
sources:
- TanStack/router:docs/router/guide/type-safety.md
- TanStack/router:docs/router/guide/type-utilities.md
- TanStack/router:docs/router/guide/render-optimizations.md
---
# Type Safety
TanStack Router is FULLY type-inferred. Params, search params, context, and loader data all flow through the route tree automatically. The **#1 AI agent mistake** is adding type annotations, casts, or generic parameters to values that are already inferred.
> **CRITICAL**: NEVER use `as Type`, explicit generic params, `satisfies` on hook returns, or type annotations on inferred values. Every cast masks real type errors and breaks the inference chain.
> **CRITICAL**: Do NOT confuse TanStack Router with Next.js or React Router. There is no `getServerSideProps`, no `useSearchParams()`, no `useLoaderData()` from `react-router-dom`.
## The ONE Required Type Annotation: Register
Without this, top-level exports like `Link`, `useNavigate`, `useSearch` have no type safety.
```tsx
// src/router.tsx
import { createRouter } from '@tanstack/react-router'
import { routeTree } from './routeTree.gen'
const router = createRouter({ routeTree })
// THIS IS REQUIRED — the single type registration for the entire app
declare module '@tanstack/react-router' {
interface Register {
router: typeof router
}
}
export default router
```
After registration, every `Link`, `useNavigate`, `useSearch`, `useParams` across the app is fully typed.
## Types Flow Automatically
### Route Hooks — No Annotation Needed
```tsx
// src/routes/posts.$postId.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/posts/$postId')({
validateSearch: (search: Record<string, unknown>) => ({
page: Number(search.page ?? 1),
}),
loader: async ({ params }) => {
// params.postId is already typed as string — do not annotate
const post = await fetchPost(params.postId)
return { post }
},
component: PostComponent,
})
function PostComponent() {
// ALL of these are fully inferred — do NOT add type annotations
const { postId } = Route.useParams()
// ^? string
const { page } = Route.useSearch()
// ^? number
const { post } = Route.useLoaderData()
// ^? { id: string; title: string; body: string }
return (
<div>
<h1>{post.title}</h1>
<p>Page {page}</p>
</div>
)
}
```
### Context Flows Through the Tree
```tsx
// src/routes/__root.tsx
import { createRootRouteWithContext, Outlet } from '@tanstack/react-router'
interface RouterContext {
auth: { userId: string; role: 'admin' | 'user' } | null
}
// Note: createRootRouteWithContext is a FACTORY — call it TWICE: ()()
export const Route = createRootRouteWithContext<RouterContext>()({
component: () => <Outlet />,
})
```
```tsx
// src/routes/dashboard.tsx
import { createFileRoute, redirect } from '@tanstack/react-router'
export const Route = createFileRoute('/dashboard')({
beforeLoad: ({ context }) => {
// context.auth is already typed as { userId: string; role: 'admin' | 'user' } | null
// NO annotation needed
if (!context.auth) throw redirect({ to: '/login' })
return { user: context.auth }
},
loader: ({ context }) => {
// context.user is typed as { userId: string; role: 'admin' | 'user' }
// This was added by beforeLoad above — fully inferred
return fetchDashboard(context.user.userId)
},
component: DashboardComponent,
})
function DashboardComponent() {
const data = Route.useLoaderData()
const { user } = Route.useRouteContext()
return <h1>Welcome {user.userId}</h1>
}
```
## Narrowing with `from`
Without `from`, hooks return a union of ALL routes' types — slow for TypeScript and imprecise.
### On Hooks
```tsx
import { useSearch, useParams, useNavigate } from '@tanstack/react-router'
function PostSidebar() {
// WRONG — search is a union of ALL routes' search params
const search = useSearch()
// CORRECT — search is narrowed to /posts/$postId's search params
const search = useSearch({ from: '/posts/$postId' })
// ^? { page: number }
// CORRECT — params narrowed to this route
const { postId } = useParams({ from: '/posts/$postId' })
// CORRECT — navigate narrowed for relative paths
const navigate = useNavigate({ from: '/posts/$postId' })
}
```
### On `Link`
```tsx
import { Link } from '@tanstack/react-router'
// WRONG — search resolves to union of ALL routes' search params, slow TS check
<Link to=".." search={{ page: 0 }} />
// CORRECT — narrowed, fast TS check
<Link from="/posts/$postId" to=".." search={{ page: 0 }} />
// Also correct — Route.fullPath in route components
<Link from={Route.fullPath} to=".." search={{ page: 0 }} />
```
## Shared Components: `strict: false`
When a component is used across multiple routes, use `strict: false` instead of `from`:
```tsx
import { useSearch } from '@tanstack/react-router'
function GlobalSearch() {
// Returns union of all routes' search params — no runtime error if route doesn't match
const search = useSearch({ strict: false })
return <span>Query: {search.q ?? ''}</span>
}
```
## Code-Split Files: `getRouteApi`
Use `getRouteApi` instead of importing `Route` to avoid pulling route config into the lazy chunk:
```tsx
// src/routes/posts.lazy.tsx
import { createLazyFileRoute, getRouteApi } from '@tanstack/react-router'
const routeApi = getRouteApi('/posts')
export const Route = createLazyFileRoute('/posts')({
component: PostsComponent,
})
function PostsComponent() {
const data = routeApi.useLoaderData()
const { page } = routeApi.useSearch()
return <div>Page {page}</div>
}
```
## TypeScript Performance
### Use Object Syntax for `addChildren` in Large Route Trees
```tsx
// SLOWER — tuple syntax
const routeTree = rootRoute.addChildren([
postsRoute.addChildren([postRoute, postsIndexRoute]),
indexRoute,
])
// FASTER — object syntax (TS checks objects faster than large tuples)
const routeTree = rootRoute.addChildren({
postsRoute: postsRoute.addChildren({ postRoute, postsIndexRoute }),
indexRoute,
})
```
With file-based routing the route tree is generated, so this is handled for you.
### Avoid Returning Unused Inferred Types from Loaders
When using external caches like TanStack Query, don't let the router infer complex return types you never consume:
```tsx
// SLOWER — TS infers the full ensureQueryData return type into the route tree
export const Route = createFileRoute('/posts/$postId')({
loader: ({ context: { queryClient }, params: { postId } }) =>
queryClient.ensureQueryData(postQueryOptions(postId)),
component: PostComponent,
})
// FASTER — void return, inference stays out of the route tree
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ context: { queryClient }, params: { postId } }) => {
await queryClient.ensureQueryData(postQueryOptions(postId))
},
component: PostComponent,
})
```
### `as const satisfies` for Link Option Objects
Never use `LinkProps` as a variable type — it's an enormous union:
```tsx
import type { LinkProps, RegisteredRouter } from '@tanstack/react-router'
// WRONG — LinkProps is a massive union, extremely slow TS check
const wrongProps: LinkProps = { to: '/posts' }
// CORRECT — infer a precise type, validate against LinkProps
const goodProps = { to: '/posts' } as const satisfies LinkProps
// EVEN BETTER — narrow LinkProps with generic params
const narrowedProps = {
to: '/posts',
} as const satisfies LinkProps<RegisteredRouter, string, '/posts'>
```
### Type-Safe Link Option Arrays
```tsx
import type { LinkProps } from '@tanstack/react-router'
export const navLinks = [
{ to: '/posts' },
{ to: '/posts/$postId', params: { postId: '1' } },
] as const satisfies ReadonlyArray<LinkProps>
// Use the precise inferred type, not LinkProps directly
export type NavLink = (typeof navLinks)[number]
```
## Type Utilities for Generic Components
### `ValidateLinkOptions` — Type-Safe Link Props in Custom Components
```tsx
import {
Link,
type RegisteredRouter,
type ValidateLinkOptions,
} from '@tanstack/react-router'
interface NavItemProps<
TRouter extends RegisteredRouter = RegisteredRouter,
TOptions = unknown,
> {
label: string
linkOptions: ValidateLinkOptions<TRouter, TOptions>
}
export function NavItem<TRouter extends RegisteredRouter, TOptions>(
props: NavItemProps<TRouter, TOptions>,
): React.ReactNode
export function NavItem(props: NavItemProps): React.ReactNode {
return (
<li>
<Link {...props.linkOptions}>{props.label}</Link>
</li>
)
}
// Usage — fully type-safe
<NavItem label="Posts" linkOptions={{ to: '/posts' }} />
<NavItem label="Post" linkOptions={{ to: '/posts/$postId', params: { postId: '1' } }} />
```
### `ValidateNavigateOptions` and `ValidateRedirectOptions`
Same pattern as `ValidateLinkOptions` above, for `useNavigate` and `redirect`. Declare a generic public overload plus a non-generic implementation signature so the call site stays narrowed and the body works without casts:
```tsx
import {
useNavigate,
type RegisteredRouter,
type ValidateNavigateOptions,
} from '@tanstack/react-router'
export function useDelayedNavigate<
TRouter extends RegisteredRouter = RegisteredRouter,
TOptions = unknown,
>(
options: ValidateNavigateOptions<TRouter, TOptions>,
delayMs: number,
): () => void
export function useDelayedNavigate(
options: ValidateNavigateOptions,
delayMs: number,
) {
const navigate = useNavigate()
return () => {
setTimeout(() => navigate(options), delayMs)
}
}
```
`ValidateRedirectOptions` works identically — declare a generic overload accepting `ValidateRedirectOptions<TRouter, TOptions>` and an impl signature accepting `ValidateRedirectOptions`, then call `redirect(options)` in the body.
### Render Props for Maximum Performance
Instead of accepting `LinkProps`, invert control so `Link` is narrowed at the call site:
```tsx
function Card(props: { title: string; renderLink: () => React.ReactNode }) {
return (
<div>
<h2>{props.title}</h2>
{props.renderLink()}
</div>
)
}
// Link narrowed to exactly /posts — no union check
;<Card title="All Posts" renderLink={() => <Link to="/posts">View</Link>} />
```
## Render Optimizations
### Fine-Grained Selectors with `select`
```tsx
function PostTitle() {
// Only re-renders when page changes, not when other search params change
const page = Route.useSearch({ select: ({ page }) => page })
return <span>Page {page}</span>
}
```
### Structural Sharing
Preserve referential identity across re-renders for search params:
```tsx
const router = createRouter({
routeTree,
defaultStructuralSharing: true, // Enable globally
})
// Or per-hook
const result = Route.useSearch({
select: (search) => ({ foo: search.foo, label: `Page ${search.foo}` }),
structuralSharing: true,
})
```
Structural sharing only works with JSON-compatible data. TypeScript will error if you return class instances with `structuralSharing: true`.
## Common Mistakes
### 1. CRITICAL: Adding type annotations or casts to inferred values
```tsx
// WRONG — casting masks real type errors
const search = useSearch({ from: '/posts' }) as { page: number }
// WRONG — unnecessary annotation
const params: { postId: string } = useParams({ from: '/posts/$postId' })
// WRONG — generic param on hook
const data = useLoaderData<{ posts: Post[] }>({ from: '/posts' })
// CORRECT — let inference work
const search = useSearch({ from: '/posts' })
const params = useParams({ from: '/posts/$postId' })
const data = useLoaderData({ from: '/posts' })
```
### 2. HIGH: Using un-narrowed `LinkProps` type
```tsx
// WRONG — LinkProps is a massive union, causes severe TS slowdown
const myProps: LinkProps = { to: '/posts' }
// CORRECT — use as const satisfies for precise inference
const myProps = { to: '/posts' } as const satisfies LinkProps
```
### 3. HIGH: Not narrowing `Link`/`useNavigate` with `from`
```tsx
// WRONG — search is a union of ALL routes, TS check grows with route count
<Link to=".." search={{ page: 0 }} />
// CORRECT — narrowed, fast check
<Link from={Route.fullPath} to=".." search={{ page: 0 }} />
```
### 4. CRITICAL (cross-skill): Missing router type registration
```tsx
// WRONG — Link/useNavigate have no autocomplete, all paths are untyped strings
const router = createRouter({ routeTree })
// (no declare module)
// CORRECT — always register
const router = createRouter({ routeTree })
declare module '@tanstack/react-router' {
interface Register {
router: typeof router
}
}
```
### 5. CRITICAL (cross-skill): Wrong-framework imports and file structure
Wrong-framework code looks plausible (it's React) but breaks the build or produces conflicting `/` routes at runtime.
```tsx
// WRONG — react-router-dom and next/* are different libraries
import { Link, useNavigate, useSearchParams } from 'react-router-dom'
import Link from 'next/link'
import { useRouter, useParams } from 'next/navigation'
// CORRECT — all routing exports come from @tanstack/react-router
import {
Link,
Outlet,
useNavigate,
useRouter,
useLocation,
useParams,
redirect,
} from '@tanstack/react-router'
```
```tsx
// WRONG file structures + APIs:
// src/pages/*.tsx with getServerSideProps / getStaticProps (Next.js Pages Router)
// app/layout.tsx + app/page.tsx (Next.js App Router)
// _app/index.tsx, pages/_app.tsx, pages/_document.tsx (Next.js custom App)
// loader/action exports (Remix)
// CORRECT — TanStack file-based routing at src/routes/*.tsx
export const Route = createFileRoute('/posts')({
loader: async () => { ... },
validateSearch: zodValidator(schema),
component: PostsComponent,
})
const search = Route.useSearch()
```
If a build error mentions `react-router-dom`, `next/`, `pages/_app`, or duplicate `/` routes, fix the import — don't paper over with type assertions.
See also: router-core (Register setup), router-core/navigation (from narrowing), router-core/code-splitting (getRouteApi).
@@ -0,0 +1,233 @@
export default `flf2a$ 2 2 8 -1 27 0 0 0
Author : Markus Gebhard markus@jave.de
Date : 2001/9/26 19:57:04
Version: 0.2
-------------------------------------------------
This font is NOT pure ASCII!
It is intended to work with the characters available
for adding comments to german bank statements.
Those characters are: A..Z 0..9 $%&/\`*�+-,.?^
People who contributed to this font (in order of appearance):
Markus Gebhard <markus@jave.de>
Christian Garbs [Master Mitch] <mitch@mitch.h.shuttle.de>
Thomas Schuetzkowski <Thomas.Schuetzkowski@alcatel.de>
Jan Foerster <Jan.Foerster@alcatel.de>:
-------------------------------------------------
This font has been created using Jave's FIGlet font export assistant
(that will be included in Jave 2.0).
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.
-------------------------------------------------
Converted this file from a text encoding of ISO 8859-1 to UTF-8
Done by Patrick Gillespie (patorjk) on 2025/08/31
$ #
$ ##
I #
. ##
II #
##
##
##
$#
##
%#
##
&#
##
'#
##
(#
##
)#
##
*#
##
.I. #
I ##
#
, ##
... #
##
#
. ##
/#
##
0#
##
1#
##
2#
##
3#
##
4#
##
5#
##
6#
##
7#
##
8#
##
9#
##
. #
. ##
. #
, ##
<#
##
-- #
-- ##
>#
##
?#
##
@#
##
.^. #
I^I ##
I´D #
I.D ##
,´´ #
\`.. ##
I\`. #
I./ ##
I.\` #
I.. ##
I´´ #
I´ ##
,´´ #
\`.7 ##
L.J #
I I ##
I #
I ##
7 #
\`.´ ##
I,´ #
I\`. ##
I #
L.. ##
IVI #
I I ##
I\`.I #
I \`I ##
,´\`. #
\`..´ ##
I´´, #
I´´ ##
,´\`. #
\`.\`. ##
I´´, #
I´\`. ##
/´´ #
..7 ##
´´T´´ #
I ##
I I #
\`..I ##
\` / #
V ##
\` ^ / #
V V ##
\`.´ #
.^. ##
\`./ #
/ ##
´´7 #
/´. ##
[#
##
\\#
##
]#
##
^#
##
_#
##
\`#
##
.^. #
I^I ##
I´D #
I.D ##
,´´ #
\`.. ##
I\`. #
I./ ##
I.\` #
I.. ##
I´´ #
I´ ##
,´´ #
\`.7 ##
L.J #
I I ##
I #
I ##
7 #
\`.´ ##
I,´ #
I\`. ##
I #
L.. ##
IVI #
I I ##
I\`.I #
I \`I ##
,´\`. #
\`..' ##
I´´, #
I´´ ##
,´\`. #
\`.\`. ##
I´´, #
I´\`. ##
/´´ #
..7 ##
´´T´´ #
I ##
I I #
\`..I ##
\` / #
V ##
\` ^ / #
V V ##
\`.´ #
.^. ##
\`./ #
/ ##
´´7 #
/´. ##
{#
##
|#
##
}#
##
~#
##
.^. #
I^I ##
,´\`. #
\`..´ ##
I I #
\`..I ##
.^. #
I^I ##
,´\`. #
\`..' ##
I I #
\`..I ##
ß#
##
`
@@ -0,0 +1,15 @@
/**
* @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 Squircle = createLucideIcon("Squircle", [
["path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9-9 9-9-1.8-9-9 1.8-9 9-9", key: "garfkc" }]
]);
export { Squircle as default };
//# sourceMappingURL=squircle.js.map
@@ -0,0 +1,40 @@
import { activeAnimations } from '../../stats/animation-count.mjs';
import { statsBuffer } from '../../stats/buffer.mjs';
import { mapEasingToNativeEasing } from './easing/map-easing.mjs';
function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) {
const keyframeOptions = {
[valueName]: keyframes,
};
if (times)
keyframeOptions.offset = times;
const easing = mapEasingToNativeEasing(ease, duration);
/**
* If this is an easing array, apply to keyframes, not animation as a whole
*/
if (Array.isArray(easing))
keyframeOptions.easing = easing;
if (statsBuffer.value) {
activeAnimations.waapi++;
}
const options = {
delay,
duration,
easing: !Array.isArray(easing) ? easing : "linear",
fill: "both",
iterations: repeat + 1,
direction: repeatType === "reverse" ? "alternate" : "normal",
};
if (pseudoElement)
options.pseudoElement = pseudoElement;
const animation = element.animate(keyframeOptions, options);
if (statsBuffer.value) {
animation.finished.finally(() => {
activeAnimations.waapi--;
});
}
return animation;
}
export { startWaapiAnimation };
//# sourceMappingURL=start-waapi-animation.mjs.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2015_proxy: LibDefinition;
@@ -0,0 +1,33 @@
//#region src/utils/stream.d.ts
/**
* @module
* Stream utility.
*/
export declare class StreamingApi {
private writer;
private encoder;
private writable;
private abortSubscribers;
responseReadable: ReadableStream;
/**
* Whether the stream has been aborted.
*/
aborted: boolean;
/**
* Whether the stream has been closed normally.
*/
closed: boolean;
constructor(writable: WritableStream, _readable: ReadableStream);
write(input: Uint8Array | string): Promise<StreamingApi>;
writeln(input: string): Promise<StreamingApi>;
sleep(ms: number): Promise<unknown>;
close(): Promise<void>;
pipe(body: ReadableStream): Promise<void>;
onAbort(listener: () => void | Promise<void>): void;
/**
* Abort the stream.
* You can call this method when stream is aborted by external event.
*/
abort(): void;
}
//#endregion
@@ -0,0 +1,363 @@
/**
* @fileoverview A rule to disallow using `this`/`super` before `super()`.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether or not a given node is a constructor.
* @param {ASTNode} node A node to check. This node type is one of
* `Program`, `FunctionDeclaration`, `FunctionExpression`, and
* `ArrowFunctionExpression`.
* @returns {boolean} `true` if the node is a constructor.
*/
function isConstructorFunction(node) {
return (
node.type === "FunctionExpression" &&
node.parent.type === "MethodDefinition" &&
node.parent.kind === "constructor"
);
}
/*
* Information for each code path segment.
* - superCalled: The flag which shows `super()` called in all code paths.
* - invalidNodes: The array of invalid ThisExpression and Super nodes.
*/
/**
*
*/
class SegmentInfo {
/**
* Indicates whether `super()` is called in all code paths.
* @type {boolean}
*/
superCalled = false;
/**
* The array of invalid ThisExpression and Super nodes.
* @type {ASTNode[]}
*/
invalidNodes = [];
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description:
"Disallow `this`/`super` before calling `super()` in constructors",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-this-before-super",
},
schema: [],
messages: {
noBeforeSuper: "'{{kind}}' is not allowed before 'super()'.",
},
},
create(context) {
/*
* Information for each constructor.
* - upper: Information of the upper constructor.
* - hasExtends: A flag which shows whether the owner class has a valid
* `extends` part.
* - scope: The scope of the owner class.
* - codePath: The code path of this constructor.
*/
let funcInfo = null;
/** @type {Record<string, SegmentInfo>} */
let segInfoMap = Object.create(null);
/**
* Gets whether or not `super()` is called in a given code path segment.
* @param {CodePathSegment} segment A code path segment to get.
* @returns {boolean} `true` if `super()` is called.
*/
function isCalled(segment) {
return !segment.reachable || segInfoMap[segment.id]?.superCalled;
}
/**
* Checks whether or not this is in a constructor.
* @returns {boolean} `true` if this is in a constructor.
*/
function isInConstructorOfDerivedClass() {
return Boolean(
funcInfo && funcInfo.isConstructor && funcInfo.hasExtends,
);
}
/**
* Determines if every segment in a set has been called.
* @param {Set<CodePathSegment>} segments The segments to search.
* @returns {boolean} True if every segment has been called; false otherwise.
*/
function isEverySegmentCalled(segments) {
for (const segment of segments) {
if (!isCalled(segment)) {
return false;
}
}
return true;
}
/**
* Checks whether or not this is before `super()` is called.
* @returns {boolean} `true` if this is before `super()` is called.
*/
function isBeforeCallOfSuper() {
return (
isInConstructorOfDerivedClass() &&
!isEverySegmentCalled(funcInfo.currentSegments)
);
}
/**
* Sets a given node as invalid.
* @param {ASTNode} node A node to set as invalid. This is one of
* a ThisExpression and a Super.
* @returns {void}
*/
function setInvalid(node) {
const segments = funcInfo.currentSegments;
for (const segment of segments) {
if (segment.reachable) {
segInfoMap[segment.id].invalidNodes.push(node);
}
}
}
/**
* Sets the current segment as `super` was called.
* @returns {void}
*/
function setSuperCalled() {
const segments = funcInfo.currentSegments;
for (const segment of segments) {
if (segment.reachable) {
segInfoMap[segment.id].superCalled = true;
}
}
}
return {
/**
* Adds information of a constructor into the stack.
* @param {CodePath} codePath A code path which was started.
* @param {ASTNode} node The current node.
* @returns {void}
*/
onCodePathStart(codePath, node) {
if (isConstructorFunction(node)) {
// Class > ClassBody > MethodDefinition > FunctionExpression
const classNode = node.parent.parent.parent;
funcInfo = {
upper: funcInfo,
isConstructor: true,
hasExtends: Boolean(
classNode.superClass &&
!astUtils.isNullOrUndefined(classNode.superClass),
),
codePath,
currentSegments: new Set(),
};
} else {
funcInfo = {
upper: funcInfo,
isConstructor: false,
hasExtends: false,
codePath,
currentSegments: new Set(),
};
}
},
/**
* Removes the top of stack item.
*
* And this traverses all segments of this code path then reports every
* invalid node.
* @param {CodePath} codePath A code path which was ended.
* @returns {void}
*/
onCodePathEnd(codePath) {
const isDerivedClass = funcInfo.hasExtends;
funcInfo = funcInfo.upper;
if (!isDerivedClass) {
return;
}
/**
* A collection of nodes to avoid duplicate reports.
* @type {Set<ASTNode>}
*/
const reported = new Set();
codePath.traverseSegments((segment, controller) => {
const info = segInfoMap[segment.id];
const invalidNodes = info.invalidNodes.filter(
/*
* Avoid duplicate reports.
* When there is a `finally`, invalidNodes may contain already reported node.
*/
node => !reported.has(node),
);
for (const invalidNode of invalidNodes) {
reported.add(invalidNode);
context.report({
messageId: "noBeforeSuper",
node: invalidNode,
data: {
kind:
invalidNode.type === "Super"
? "super"
: "this",
},
});
}
if (info.superCalled) {
controller.skip();
}
});
},
/**
* Initialize information of a given code path segment.
* @param {CodePathSegment} segment A code path segment to initialize.
* @returns {void}
*/
onCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
if (!isInConstructorOfDerivedClass()) {
return;
}
// Initialize info.
segInfoMap[segment.id] = {
superCalled:
segment.prevSegments.length > 0 &&
segment.prevSegments.every(isCalled),
invalidNodes: [],
};
},
onUnreachableCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
onCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
/**
* Update information of the code path segment when a code path was
* looped.
* @param {CodePathSegment} fromSegment The code path segment of the
* end of a loop.
* @param {CodePathSegment} toSegment A code path segment of the head
* of a loop.
* @returns {void}
*/
onCodePathSegmentLoop(fromSegment, toSegment) {
if (!isInConstructorOfDerivedClass()) {
return;
}
// Update information inside of the loop.
funcInfo.codePath.traverseSegments(
{ first: toSegment, last: fromSegment },
(segment, controller) => {
const info =
segInfoMap[segment.id] ?? new SegmentInfo();
if (info.superCalled) {
controller.skip();
} else if (
segment.prevSegments.length > 0 &&
segment.prevSegments.every(isCalled)
) {
info.superCalled = true;
}
segInfoMap[segment.id] = info;
},
);
},
/**
* Reports if this is before `super()`.
* @param {ASTNode} node A target node.
* @returns {void}
*/
ThisExpression(node) {
if (isBeforeCallOfSuper()) {
setInvalid(node);
}
},
/**
* Reports if this is before `super()`.
* @param {ASTNode} node A target node.
* @returns {void}
*/
Super(node) {
if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) {
setInvalid(node);
}
},
/**
* Marks `super()` called.
* @param {ASTNode} node A target node.
* @returns {void}
*/
"CallExpression:exit"(node) {
if (node.callee.type === "Super" && isBeforeCallOfSuper()) {
setSuperCalled();
}
},
/**
* Resets state.
* @returns {void}
*/
"Program:exit"() {
segInfoMap = Object.create(null);
},
};
},
};
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _set;
var _superPropBase = require("./superPropBase.js");
var _defineProperty = require("./defineProperty.js");
function set(target, property, value, receiver) {
if (typeof Reflect !== "undefined" && Reflect.set) {
set = Reflect.set;
} else {
set = function set(target, property, value, receiver) {
var base = (0, _superPropBase.default)(target, property);
var desc;
if (base) {
desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.set) {
desc.set.call(receiver, value);
return true;
} else if (!desc.writable) {
return false;
}
}
desc = Object.getOwnPropertyDescriptor(receiver, property);
if (desc) {
if (!desc.writable) {
return false;
}
desc.value = value;
Object.defineProperty(receiver, property, desc);
} else {
(0, _defineProperty.default)(receiver, property, value);
}
return true;
};
}
return set(target, property, value, receiver);
}
function _set(target, property, value, receiver, isStrict) {
var s = set(target, property, value, receiver || target);
if (!s && isStrict) {
throw new TypeError("failed to set property");
}
return value;
}
//# sourceMappingURL=set.js.map
@@ -0,0 +1,2 @@
import { _ as queries, a as and, c as exprInterpreter, d as include, f as interpreter, g as or, h as not, i as filterVitePlugins, l as id, m as moduleType, n as makeIdFiltersToMatchWithQuery, o as code, p as interpreterImpl, r as prefixRegex, s as exclude, t as exactRegex, u as importerId, v as query } from "../filter-B_mD-HGz.mjs";
export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var mini = require('framer-motion/dom/mini');
Object.keys(mini).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function () { return mini[k]; }
});
});
@@ -0,0 +1,87 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Index > createDocumentStream 1`] = `
Document {
"children": [
&This is text,
<!-- and comments -->,
<tags />,
],
"endIndex": null,
"next": null,
"parent": null,
"prev": null,
"startIndex": null,
"type": "root",
}
`;
exports[`Index > createDomStream 1`] = `
[
&This is text,
<!-- and comments -->,
<tags />,
]
`;
exports[`Index > parseDOM 1`] = `
[
<a
foo=""
>
<b>
<c>
ProcessingInstruction {
"data": "?foo",
"endIndex": null,
"name": "?foo",
"next": Yay!,
"parent": <c>
[Circular]
Yay!
</c>,
"prev": null,
"startIndex": null,
"type": "directive",
}
Yay!
</c>
</b>
</a>,
]
`;
exports[`Index > parseDocument 1`] = `
Document {
"children": [
<a
foo=""
>
<b>
<c>
ProcessingInstruction {
"data": "?foo",
"endIndex": null,
"name": "?foo",
"next": Yay!,
"parent": <c>
[Circular]
Yay!
</c>,
"prev": null,
"startIndex": null,
"type": "directive",
}
Yay!
</c>
</b>
</a>,
],
"endIndex": null,
"next": null,
"parent": null,
"prev": null,
"startIndex": null,
"type": "root",
}
`;
@@ -0,0 +1 @@
{"version":3,"file":"ajvProvider-INpkxUi1.d.mts","names":["URIComponent","_CodeOrName","UsedNames","IDENTIFIER","RegExp","Name","_Code","CodeItem","Record","Code","SafeExpr","nil","CodeArg","_","TemplateStringsArray","str","addCodeArg","strConcat","stringify","safeStringify","getProperty","getEsmExportName","regexpCode","Code","Name","NameGroup","NameValue","ValueReference","ScopeOptions","Set","Scope","ValueScopeOptions","ScopeStore","Record","ScopeValues","ValueScopeName","Map","ScopeValueSets","UsedValueState","UsedScopeValues","varKinds","prefixes","parent","ScopePath","property","itemIndex","VSOptions","ValueScope","ScopeValueSets","NameValue","ValueScope","ValueScopeName","_Code","Code","Name","Scope","_","str","strConcat","nil","getProperty","stringify","regexpCode","ScopeStore","varKinds","SafeExpr","Block","operators","CodeGenOptions","CodeGen","not","T","and","or","AddedKeywordDefinition","_jsonTypes","JSONType","isJSONType","ValidationTypes","RuleGroup","ValidationRules","Rule","getRules","AnySchema","EvaluatedProperties","EvaluatedItems","SchemaCxt","SchemaObjCxt","Code","Name","CodeGen","Rule","ValidationRules","toHash","T","alwaysValidSchema","checkUnknownRules","schemaHasRules","schemaHasRulesButRef","schemaRefOrVal","topSchemaRef","schemaPath","unescapeFragment","escapeFragment","escapeJsonPointer","unescapeJsonPointer","eachItem","SomeEvaluated","MergeEvaluatedFunc","Exclude","MergeEvaluated","mergeEvaluated","evaluatedPropsToName","setEvaluated","useFunc","Type","getErrorPath","checkStrictMode","AnySchema","SchemaObjCxt","Code","Name","Type","JSONType","SubschemaContext","SubschemaArgs","Set","Partial","getSubschema","keyword","schemaProp","schema","schemaPath","errSchemaPath","topSchemaRef","extendSubschemaData","dataProp","dpType","data","dataTypes","propertyName","extendSubschemaMode","jtdDiscriminator","jtdMetadata","compositeRule","createErrors","allErrors","KeywordErrorCxt","KeywordErrorDefinition","CodeGen","Code","Name","keywordError","keyword$DataError","ErrorPaths","reportError","reportExtraError","resetErrorsCount","extendErrors","gen","keyword","schemaValue","data","errsCount","it","AddedKeywordDefinition","AnySchemaObject","KeywordErrorCxt","KeywordCxtParams","SchemaCxt","SchemaObjCxt","SubschemaArgs","Code","Name","CodeGen","JSONType","ErrorPaths","validateFunctionCode","KeywordCxt","getData","dataLevel","dataNames","dataPathArr","StrictNullChecksWrapper","Name","Type","UnionToIntersection","U","SomeJSONSchema","Known","UncheckedJSONSchemaType","UncheckedPartialSchema","T","Partial","PartialSchema","JSONType","IsPartial","NumberKeywords","StringKeywords","K","Nullable","Record","UncheckedPropertiesSchema","Omit","UncheckedRequiredMembers","JSONSchemaType","PropertiesSchema","RequiredMembers","NumberType","StringType","SomeJTDSchemaType","Record","RequiredKeys","T","K","OptionalKeys","IsUnion_","U","IsUnion","TypeEquality","E","NullTypeEquality","EnumString","IsEnum","IsElements","IsValues","IsRecord","Union","IsEmptyRecord","JTDSchemaType","D","Exclude","Date","V","M","Omit","JTDDataDef","S","JTDDataType","ErrorObject","ValidationError","Partial","Error","default","UriResolver","MissingRefError","Error","default","Format","FormatDefinition","AsyncFormatDefinition","KeywordDefinition","KeywordErrorDefinition","CodeKeywordDefinition","MacroKeywordDefinition","FuncKeywordDefinition","Vocabulary","Schema","SchemaObject","AnySchemaObject","AsyncSchema","AnySchema","ValidateFunction","AsyncValidateFunction","AnyValidateFunction","ErrorObject","ErrorNoParams","SchemaCxt","SchemaObjCxt","Plugin","Opts","Ajv","KeywordCxt","DefinedError","JSONType","JSONSchemaType","JTDSchemaType","SomeJTDSchemaType","JTDDataType","_","str","stringify","nil","Name","Code","CodeGen","CodeGenOptions","AddedKeywordDefinition","AddedFormat","RegExpEngine","UriResolver","ValidationError","MissingRefError","ValidationRules","SchemaEnv","ValueScope","Options","CurrentOptions","DeprecatedOptions","Logger","Promise","CodeOptions","InstanceCodeOptions","RequiredInstanceOptions","K","NonNullable","InstanceOptions","T","N","Set","RegExp","separator","dataVar","ErrorsTextOptions","default","AnySchema","AnySchemaObject","UriResolver","Ajv","URIComponent","LocalRefs","inlineRef","getFullPath","_getFullPath","normalizeId","resolveUrl","getSchemaRefs","AnySchema","AnySchemaObject","AnyValidateFunction","EvaluatedProperties","EvaluatedItems","Ajv","InstanceOptions","CodeGen","Name","Code","ValueScopeName","LocalRefs","JSONType","SchemaRefs","SchemaEnv","SchemaCxt","Set","SchemaObjCxt","SchemaEnvArgs","compileSchema","resolveRef","getCompilingSchema","resolveSchema","URIComponent","CodeGen","Code","Name","ScopeValueSets","ValueScopeName","SchemaEnv","SchemaCxt","SchemaObjCxt","JSONType","KeywordCxt","Ajv","_SchemaObject","SchemaObject","AsyncSchema","AnySchemaObject","Schema","AnySchema","SchemaMap","SourceCode","DataValidationCxt","T","Record","ValidateFunction","ErrorObject","Evaluated","JTDParser","EvaluatedPropertieLine truncated
@@ -0,0 +1,30 @@
/**
* @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 Sprout = createLucideIcon("Sprout", [
["path", { d: "M7 20h10", key: "e6iznv" }],
["path", { d: "M10 20c5.5-2.5.8-6.4 3-10", key: "161w41" }],
[
"path",
{
d: "M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",
key: "9gtqwd"
}
],
[
"path",
{
d: "M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",
key: "bkxnd2"
}
]
]);
export { Sprout as default };
//# sourceMappingURL=sprout.js.map
@@ -0,0 +1,159 @@
const React = require('react');
function MetricCells({ metrics }) {
const { classForPercent, pct, covered, missed, total } = metrics;
return (
<>
<td className={'pct ' + classForPercent}>{Math.round(pct)}% </td>
<td className={classForPercent}>
<div className="bar">
<div
className={`bar__data ${classForPercent} ${classForPercent}--dark`}
style={{ width: pct + '%' }}
></div>
</div>
</td>
<td className={'abs ' + classForPercent}>{covered}</td>
<td className={'abs ' + classForPercent}>{missed}</td>
<td className={'abs ' + classForPercent}>{total}</td>
</>
);
}
function FileCell({
file,
prefix,
expandedLines,
setExpandedLines,
hasChildren,
setFileFilter
}) {
if (hasChildren) {
const expandedIndex = expandedLines.indexOf(prefix + file);
const isExpanded = expandedIndex >= 0;
const newExpandedLines = isExpanded
? [
...expandedLines.slice(0, expandedIndex),
...expandedLines.slice(expandedIndex + 1)
]
: [...expandedLines, prefix + file];
return (
<>
<button
type="button"
onClick={() => setExpandedLines(newExpandedLines)}
className="expandbutton"
>
{isExpanded ? String.fromCharCode(0x2013) : '+'}
</button>
<a
href="javascript:void(0)"
onClick={() => setFileFilter(prefix + file)}
>
{file}
</a>
</>
);
} else {
return <a href={`./${prefix}${file}.html`}>{file}</a>;
}
}
function getWorstMetricClassForPercent(metricsToShow, metrics) {
let classForPercent = 'none';
for (const metricToShow in metricsToShow) {
if (metricsToShow[metricToShow]) {
const metricClassForPercent = metrics[metricToShow].classForPercent;
// ignore none metrics so they don't change whats shown
if (metricClassForPercent === 'none') {
continue;
}
// if the metric low or lower than whats currently being used, replace it
if (
metricClassForPercent == 'low' ||
(metricClassForPercent === 'medium' &&
classForPercent !== 'low') ||
(metricClassForPercent === 'high' &&
classForPercent !== 'low' &&
classForPercent !== 'medium')
) {
classForPercent = metricClassForPercent;
}
}
}
return classForPercent;
}
module.exports = function SummaryTableLine({
prefix,
metrics,
file,
children,
tabSize,
metricsToShow,
expandedLines,
setExpandedLines,
fileFilter,
setFileFilter
}) {
tabSize = tabSize || 0;
if (children && tabSize > 0) {
tabSize--;
}
prefix = (fileFilter ? fileFilter + '/' : '') + (prefix || '');
return (
<>
<tr>
<td
className={
'file ' +
getWorstMetricClassForPercent(metricsToShow, metrics)
}
>
{/* eslint-disable-line prefer-spread */ Array.apply(null, {
length: tabSize
}).map((nothing, index) => (
<span className="filetab" key={index} />
))}
<FileCell
file={file}
prefix={prefix}
expandedLines={expandedLines}
setExpandedLines={setExpandedLines}
hasChildren={Boolean(children)}
setFileFilter={setFileFilter}
/>
</td>
{metricsToShow.statements && (
<MetricCells metrics={metrics.statements} />
)}
{metricsToShow.branches && (
<MetricCells metrics={metrics.branches} />
)}
{metricsToShow.functions && (
<MetricCells metrics={metrics.functions} />
)}
{metricsToShow.lines && <MetricCells metrics={metrics.lines} />}
</tr>
{children &&
expandedLines.indexOf(prefix + file) >= 0 &&
children.map(child => (
<SummaryTableLine
{...child}
tabSize={tabSize + 2}
key={child.file}
prefix={prefix + file + '/'}
metricsToShow={metricsToShow}
expandedLines={expandedLines}
setExpandedLines={setExpandedLines}
setFileFilter={setFileFilter}
/>
))}
</>
);
};
@@ -0,0 +1 @@
{"version":3,"file":"wordSequences.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"circle-arrow-up.js","sources":["../../../src/icons/circle-arrow-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleArrowUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJtMTYgMTItNC00LTQgNCIgLz4KICA8cGF0aCBkPSJNMTIgMTZWOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle-arrow-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleArrowUp = createLucideIcon('CircleArrowUp', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm16 12-4-4-4 4', key: '177agl' }],\n ['path', { d: 'M12 16V8', key: '1sbj14' }],\n]);\n\nexport default CircleArrowUp;\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,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CACtD,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,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,64 @@
import {input, state} from "../traverser/base";
import {charCodes} from "../util/charcodes";
import {IS_IDENTIFIER_CHAR} from "../util/identifier";
import {finishToken} from "./index";
import {READ_WORD_TREE} from "./readWordTree";
import {TokenType as tt} from "./types";
/**
* Read an identifier, producing either a name token or matching on one of the existing keywords.
* For performance, we pre-generate big decision tree that we traverse. Each node represents a
* prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if
* not), and the other 26 values are the transitions to other nodes, or -1 to stop.
*/
export default function readWord() {
let treePos = 0;
let code = 0;
let pos = state.pos;
while (pos < input.length) {
code = input.charCodeAt(pos);
if (code < charCodes.lowercaseA || code > charCodes.lowercaseZ) {
break;
}
const next = READ_WORD_TREE[treePos + (code - charCodes.lowercaseA) + 1];
if (next === -1) {
break;
} else {
treePos = next;
pos++;
}
}
const keywordValue = READ_WORD_TREE[treePos];
if (keywordValue > -1 && !IS_IDENTIFIER_CHAR[code]) {
state.pos = pos;
if (keywordValue & 1) {
finishToken(keywordValue >>> 1);
} else {
finishToken(tt.name, keywordValue >>> 1);
}
return;
}
while (pos < input.length) {
const ch = input.charCodeAt(pos);
if (IS_IDENTIFIER_CHAR[ch]) {
pos++;
} else if (ch === charCodes.backslash) {
// \u
pos += 2;
if (input.charCodeAt(pos) === charCodes.leftCurlyBrace) {
while (pos < input.length && input.charCodeAt(pos) !== charCodes.rightCurlyBrace) {
pos++;
}
pos++;
}
} else if (ch === charCodes.atSign && input.charCodeAt(pos + 1) === charCodes.atSign) {
pos += 2;
} else {
break;
}
}
state.pos = pos;
finishToken(tt.name);
}
@@ -0,0 +1 @@
{"version":3,"file":"shimsBrowser.cjs","names":[],"sources":["../src/shimsBrowser.ts"],"sourcesContent":["/**\n * Browser runtime shims for client package\n *\n * This file is selected via package.json export conditions when running in a browser.\n */\nexport { CfWorkerJsonSchemaValidator as DefaultJsonSchemaValidator } from '@modelcontextprotocol/core-internal/validators/cfWorker';\n\n/**\n * Whether `fetch()` may throw `TypeError` due to CORS. Only true in browser contexts\n * (including Web Workers / Service Workers). In Node.js and Cloudflare Workers, a\n * `TypeError` from `fetch` is always a real network/configuration error.\n */\nexport const CORS_IS_POSSIBLE = true;\n"],"mappings":";;;;;;;;AAYA,MAAa,mBAAmB"}
@@ -0,0 +1,444 @@
'use strict';
/** Highest positive signed 32-bit float value */
const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
/** Bootstring parameters */
const base = 36;
const tMin = 1;
const tMax = 26;
const skew = 38;
const damp = 700;
const initialBias = 72;
const initialN = 128; // 0x80
const delimiter = '-'; // '\x2D'
/** Regular expressions */
const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
/** Error messages */
const errors = {
'overflow': 'Overflow: input needs wider integers to process',
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
'invalid-input': 'Invalid input'
};
/** Convenience shortcuts */
const baseMinusTMin = base - tMin;
const floor = Math.floor;
const stringFromCharCode = String.fromCharCode;
/*--------------------------------------------------------------------------*/
/**
* A generic error utility function.
* @private
* @param {String} type The error type.
* @returns {Error} Throws a `RangeError` with the applicable error message.
*/
function error(type) {
throw new RangeError(errors[type]);
}
/**
* A generic `Array#map` utility function.
* @private
* @param {Array} array The array to iterate over.
* @param {Function} callback The function that gets called for every array
* item.
* @returns {Array} A new array of values returned by the callback function.
*/
function map(array, callback) {
const result = [];
let length = array.length;
while (length--) {
result[length] = callback(array[length]);
}
return result;
}
/**
* A simple `Array#map`-like wrapper to work with domain name strings or email
* addresses.
* @private
* @param {String} domain The domain name or email address.
* @param {Function} callback The function that gets called for every
* character.
* @returns {String} A new string of characters returned by the callback
* function.
*/
function mapDomain(domain, callback) {
const parts = domain.split('@');
let result = '';
if (parts.length > 1) {
// In email addresses, only the domain name should be punycoded. Leave
// the local part (i.e. everything up to `@`) intact.
result = parts[0] + '@';
domain = parts[1];
}
// Avoid `split(regex)` for IE8 compatibility. See #17.
domain = domain.replace(regexSeparators, '\x2E');
const labels = domain.split('.');
const encoded = map(labels, callback).join('.');
return result + encoded;
}
/**
* Creates an array containing the numeric code points of each Unicode
* character in the string. While JavaScript uses UCS-2 internally,
* this function will convert a pair of surrogate halves (each of which
* UCS-2 exposes as separate characters) into a single code point,
* matching UTF-16.
* @see `punycode.ucs2.encode`
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode.ucs2
* @name decode
* @param {String} string The Unicode input string (UCS-2).
* @returns {Array} The new array of code points.
*/
function ucs2decode(string) {
const output = [];
let counter = 0;
const length = string.length;
while (counter < length) {
const value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// It's a high surrogate, and there is a next character.
const extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
// It's an unmatched surrogate; only append this code unit, in case the
// next code unit is the high surrogate of a surrogate pair.
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
/**
* Creates a string based on an array of numeric code points.
* @see `punycode.ucs2.decode`
* @memberOf punycode.ucs2
* @name encode
* @param {Array} codePoints The array of numeric code points.
* @returns {String} The new Unicode string (UCS-2).
*/
const ucs2encode = codePoints => String.fromCodePoint(...codePoints);
/**
* Converts a basic code point into a digit/integer.
* @see `digitToBasic()`
* @private
* @param {Number} codePoint The basic numeric code point value.
* @returns {Number} The numeric value of a basic code point (for use in
* representing integers) in the range `0` to `base - 1`, or `base` if
* the code point does not represent a value.
*/
const basicToDigit = function(codePoint) {
if (codePoint >= 0x30 && codePoint < 0x3A) {
return 26 + (codePoint - 0x30);
}
if (codePoint >= 0x41 && codePoint < 0x5B) {
return codePoint - 0x41;
}
if (codePoint >= 0x61 && codePoint < 0x7B) {
return codePoint - 0x61;
}
return base;
};
/**
* Converts a digit/integer into a basic code point.
* @see `basicToDigit()`
* @private
* @param {Number} digit The numeric value of a basic code point.
* @returns {Number} The basic code point whose value (when used for
* representing integers) is `digit`, which needs to be in the range
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
* used; else, the lowercase form is used. The behavior is undefined
* if `flag` is non-zero and `digit` has no uppercase form.
*/
const digitToBasic = function(digit, flag) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/
const adapt = function(delta, numPoints, firstTime) {
let k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};
/**
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
* symbols.
* @memberOf punycode
* @param {String} input The Punycode string of ASCII-only symbols.
* @returns {String} The resulting string of Unicode symbols.
*/
const decode = function(input) {
// Don't use UCS-2.
const output = [];
const inputLength = input.length;
let i = 0;
let n = initialN;
let bias = initialBias;
// Handle the basic code points: let `basic` be the number of input code
// points before the last delimiter, or `0` if there is none, then copy
// the first basic code points to the output.
let basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (let j = 0; j < basic; ++j) {
// if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
}
output.push(input.charCodeAt(j));
}
// Main decoding loop: start just after the last delimiter if any basic code
// points were copied; start at the beginning otherwise.
for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
// `index` is the index of the next character to be consumed.
// Decode a generalized variable-length integer into `delta`,
// which gets added to `i`. The overflow checking is easier
// if we increase `i` as we go, then subtract off its starting
// value at the end to obtain `delta`.
const oldi = i;
for (let w = 1, k = base; /* no condition */; k += base) {
if (index >= inputLength) {
error('invalid-input');
}
const digit = basicToDigit(input.charCodeAt(index++));
if (digit >= base) {
error('invalid-input');
}
if (digit > floor((maxInt - i) / w)) {
error('overflow');
}
i += digit * w;
const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (digit < t) {
break;
}
const baseMinusT = base - t;
if (w > floor(maxInt / baseMinusT)) {
error('overflow');
}
w *= baseMinusT;
}
const out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0);
// `i` was supposed to wrap around from `out` to `0`,
// incrementing `n` each time, so we'll fix that now:
if (floor(i / out) > maxInt - n) {
error('overflow');
}
n += floor(i / out);
i %= out;
// Insert `n` at position `i` of the output.
output.splice(i++, 0, n);
}
return String.fromCodePoint(...output);
};
/**
* Converts a string of Unicode symbols (e.g. a domain name label) to a
* Punycode string of ASCII-only symbols.
* @memberOf punycode
* @param {String} input The string of Unicode symbols.
* @returns {String} The resulting Punycode string of ASCII-only symbols.
*/
const encode = function(input) {
const output = [];
// Convert the input in UCS-2 to an array of Unicode code points.
input = ucs2decode(input);
// Cache the length.
const inputLength = input.length;
// Initialize the state.
let n = initialN;
let delta = 0;
let bias = initialBias;
// Handle the basic code points.
for (const currentValue of input) {
if (currentValue < 0x80) {
output.push(stringFromCharCode(currentValue));
}
}
const basicLength = output.length;
let handledCPCount = basicLength;
// `handledCPCount` is the number of code points that have been handled;
// `basicLength` is the number of basic code points.
// Finish the basic string with a delimiter unless it's empty.
if (basicLength) {
output.push(delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handled already. Find the next
// larger one:
let m = maxInt;
for (const currentValue of input) {
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
// but guard against overflow.
const handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
error('overflow');
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (const currentValue of input) {
if (currentValue < n && ++delta > maxInt) {
error('overflow');
}
if (currentValue === n) {
// Represent delta as a generalized variable-length integer.
let q = delta;
for (let k = base; /* no condition */; k += base) {
const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (q < t) {
break;
}
const qMinusT = q - t;
const baseMinusT = base - t;
output.push(
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
);
q = floor(qMinusT / baseMinusT);
}
output.push(stringFromCharCode(digitToBasic(q, 0)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
++handledCPCount;
}
}
++delta;
++n;
}
return output.join('');
};
/**
* Converts a Punycode string representing a domain name or an email address
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
* it doesn't matter if you call it on a string that has already been
* converted to Unicode.
* @memberOf punycode
* @param {String} input The Punycoded domain name or email address to
* convert to Unicode.
* @returns {String} The Unicode representation of the given Punycode
* string.
*/
const toUnicode = function(input) {
return mapDomain(input, function(string) {
return regexPunycode.test(string)
? decode(string.slice(4).toLowerCase())
: string;
});
};
/**
* Converts a Unicode string representing a domain name or an email address to
* Punycode. Only the non-ASCII parts of the domain name will be converted,
* i.e. it doesn't matter if you call it with a domain that's already in
* ASCII.
* @memberOf punycode
* @param {String} input The domain name or email address to convert, as a
* Unicode string.
* @returns {String} The Punycode representation of the given domain name or
* email address.
*/
const toASCII = function(input) {
return mapDomain(input, function(string) {
return regexNonASCII.test(string)
? 'xn--' + encode(string)
: string;
});
};
/*--------------------------------------------------------------------------*/
/** Define the public API */
const punycode = {
/**
* A string representing the current Punycode.js version number.
* @memberOf punycode
* @type String
*/
'version': '2.3.1',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to Unicode code points, and back.
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode
* @type Object
*/
'ucs2': {
'decode': ucs2decode,
'encode': ucs2encode
},
'decode': decode,
'encode': encode,
'toASCII': toASCII,
'toUnicode': toUnicode
};
export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };
export default punycode;
@@ -0,0 +1,3 @@
import { URISchemeHandler } from "../uri";
declare const handler: URISchemeHandler;
export default handler;
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025-PRESENT Joaquín Sánchez <https://github.com/userquin>
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,76 @@
{
"name": "@radix-ui/react-roving-focus",
"version": "1.1.11",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/primitive": "1.1.3",
"@radix-ui/react-collection": "1.1.7",
"@radix-ui/react-compose-refs": "1.1.2",
"@radix-ui/react-context": "1.1.2",
"@radix-ui/react-id": "1.1.1",
"@radix-ui/react-direction": "1.1.1",
"@radix-ui/react-primitive": "2.1.3",
"@radix-ui/react-use-callback-ref": "1.1.1",
"@radix-ui/react-use-controllable-state": "1.2.2"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,69 @@
import htmlTrie from "./generated/encode-html.js";
import { xmlReplacer, getCodePoint } from "./escape.js";
const htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;
/**
* Encodes all characters in the input using HTML entities. This includes
* characters that are valid ASCII characters in HTML documents, such as `#`.
*
* To get a more compact output, consider using the `encodeNonAsciiHTML`
* function, which will only encode characters that are not valid in HTML
* documents, as well as non-ASCII characters.
*
* If a character has no equivalent entity, a numeric hexadecimal reference
* (eg. `&#xfc;`) will be used.
*/
export function encodeHTML(data) {
return encodeHTMLTrieRe(htmlReplacer, data);
}
/**
* Encodes all non-ASCII characters, as well as characters not valid in HTML
* documents using HTML entities. This function will not encode characters that
* are valid in HTML documents, such as `#`.
*
* If a character has no equivalent entity, a numeric hexadecimal reference
* (eg. `&#xfc;`) will be used.
*/
export function encodeNonAsciiHTML(data) {
return encodeHTMLTrieRe(xmlReplacer, data);
}
function encodeHTMLTrieRe(regExp, str) {
let ret = "";
let lastIdx = 0;
let match;
while ((match = regExp.exec(str)) !== null) {
const i = match.index;
ret += str.substring(lastIdx, i);
const char = str.charCodeAt(i);
let next = htmlTrie.get(char);
if (typeof next === "object") {
// We are in a branch. Try to match the next char.
if (i + 1 < str.length) {
const nextChar = str.charCodeAt(i + 1);
const value = typeof next.n === "number"
? next.n === nextChar
? next.o
: undefined
: next.n.get(nextChar);
if (value !== undefined) {
ret += value;
lastIdx = regExp.lastIndex += 1;
continue;
}
}
next = next.v;
}
// We might have a tree node without a value; skip and use a numeric entity.
if (next !== undefined) {
ret += next;
lastIdx = i + 1;
}
else {
const cp = getCodePoint(str, i);
ret += `&#x${cp.toString(16)};`;
// Increase by 1 if we have a surrogate pair
lastIdx = regExp.lastIndex += Number(cp !== char);
}
}
return ret + str.substr(lastIdx);
}
//# sourceMappingURL=encode.js.map
@@ -0,0 +1,200 @@
export { A as AutomockedModule, b as AutospiedModule, a as ManualMockedModule, M as MockerRegistry, R as RedirectedModule } from './chunk-registry.js';
function mockObject(options, object, mockExports = {}) {
const finalizers = new Array();
const refs = new RefTracker();
const define = (container, key, value) => {
try {
container[key] = value;
return true;
} catch {
return false;
}
};
const createMock = (currentValue) => {
if (!options.createMockInstance) {
throw new Error("[@vitest/mocker] `createMockInstance` is not defined. This is a Vitest error. Please open a new issue with reproduction.");
}
const createMockInstance = options.createMockInstance;
const prototypeMembers = currentValue.prototype ? collectFunctionProperties(currentValue.prototype) : [];
return createMockInstance({
name: currentValue.name,
prototypeMembers,
originalImplementation: options.type === "autospy" ? currentValue : undefined,
keepMembersImplementation: options.type === "autospy"
});
};
const mockPropertiesOf = (container, newContainer) => {
const containerType = getType(container);
const isModule = containerType === "Module" || !!container.__esModule;
for (const { key: property, descriptor } of getAllMockableProperties(container, isModule, options.globalConstructors)) {
// Modules define their exports as getters. We want to process those.
if (!isModule && descriptor.get) {
try {
if (options.type === "autospy") {
Object.defineProperty(newContainer, property, descriptor);
} else {
Object.defineProperty(newContainer, property, {
configurable: descriptor.configurable,
enumerable: descriptor.enumerable,
get: () => {},
set: descriptor.set ? () => {} : undefined
});
}
} catch {}
continue;
}
// Skip special read-only props, we don't want to mess with those.
if (isReadonlyProp(container[property], property)) {
continue;
}
const value = container[property];
// Special handling of references we've seen before to prevent infinite
// recursion in circular objects.
const refId = refs.getId(value);
if (refId !== undefined) {
finalizers.push(() => define(newContainer, property, refs.getMockedValue(refId)));
continue;
}
const type = getType(value);
if (Array.isArray(value)) {
if (options.type === "automock") {
define(newContainer, property, []);
} else {
const array = value.map((value) => {
if (value && typeof value === "object") {
const newObject = {};
mockPropertiesOf(value, newObject);
return newObject;
}
if (typeof value === "function") {
return createMock(value);
}
return value;
});
define(newContainer, property, array);
}
continue;
}
const isFunction = type.includes("Function") && typeof value === "function";
if ((!isFunction || value._isMockFunction) && type !== "Object" && type !== "Module") {
define(newContainer, property, value);
continue;
}
if (options.type === "autospy" && type === "Module") {
// Replace with clean object to recursively autospy exported module objects:
// export * as ns from "./ns"
// or
// import * as ns from "./ns"
// export { ns }
const exports$1 = Object.create(null);
Object.defineProperty(exports$1, Symbol.toStringTag, {
value: "Module",
configurable: true,
writable: true
});
try {
newContainer[property] = exports$1;
} catch {
continue;
}
} else if (!define(newContainer, property, isFunction || options.type === "autospy" ? value : {})) {
continue;
}
if (isFunction) {
const mock = createMock(newContainer[property]);
newContainer[property] = mock;
}
refs.track(value, newContainer[property]);
mockPropertiesOf(value, newContainer[property]);
}
};
const mockedObject = mockExports;
mockPropertiesOf(object, mockedObject);
// Plug together refs
for (const finalizer of finalizers) {
finalizer();
}
return mockedObject;
}
class RefTracker {
idMap = new Map();
mockedValueMap = new Map();
getId(value) {
return this.idMap.get(value);
}
getMockedValue(id) {
return this.mockedValueMap.get(id);
}
track(originalValue, mockedValue) {
const newId = this.idMap.size;
this.idMap.set(originalValue, newId);
this.mockedValueMap.set(newId, mockedValue);
return newId;
}
}
function getType(value) {
return Object.prototype.toString.apply(value).slice(8, -1);
}
function isReadonlyProp(object, prop) {
if (prop === "arguments" || prop === "caller" || prop === "callee" || prop === "name" || prop === "length") {
const typeName = getType(object);
return typeName === "Function" || typeName === "AsyncFunction" || typeName === "GeneratorFunction" || typeName === "AsyncGeneratorFunction";
}
if (prop === "source" || prop === "global" || prop === "ignoreCase" || prop === "multiline") {
return getType(object) === "RegExp";
}
return false;
}
function getAllMockableProperties(obj, isModule, constructors) {
const { Map, Object, Function, RegExp, Array } = constructors;
const allProps = new Map();
let curr = obj;
do {
// we don't need properties from these
if (curr === Object.prototype || curr === Function.prototype || curr === RegExp.prototype) {
break;
}
collectOwnProperties(curr, (key) => {
const descriptor = Object.getOwnPropertyDescriptor(curr, key);
if (descriptor) {
allProps.set(key, {
key,
descriptor
});
}
});
} while (curr = Object.getPrototypeOf(curr));
// default is not specified in ownKeys, if module is interoped
if (isModule && !allProps.has("default") && "default" in obj) {
const descriptor = Object.getOwnPropertyDescriptor(obj, "default");
if (descriptor) {
allProps.set("default", {
key: "default",
descriptor
});
}
}
return Array.from(allProps.values());
}
function collectOwnProperties(obj, collector) {
const collect = typeof collector === "function" ? collector : (key) => collector.add(key);
Object.getOwnPropertyNames(obj).forEach(collect);
Object.getOwnPropertySymbols(obj).forEach(collect);
}
function collectFunctionProperties(prototype) {
const properties = new Set();
collectOwnProperties(prototype, (prop) => {
const descriptor = Object.getOwnPropertyDescriptor(prototype, prop);
if (!descriptor || descriptor.get) {
return;
}
const type = getType(descriptor.value);
if (type.includes("Function") && !isReadonlyProp(descriptor.value, prop)) {
properties.add(prop);
}
});
return Array.from(properties);
}
export { mockObject };
@@ -0,0 +1,199 @@
# MockClient
<!--introduced_in=v4.0.0-->
<!--type=module-->
<!-- source_link=lib/mock/mock-client.js -->
> Stability: 2 - Stable
A `MockClient` is a [`Client`][] that intercepts requests matching registered
routes and replies with mocked responses instead of contacting the network.
It is created by a [`MockAgent`][] when the agent is configured with a single
connection, and it exposes the same interception API as [`MockPool`][].
A `MockClient` is not constructed directly in most cases; instead it is obtained
through [`mockAgent.get(origin)`][] once the agent has `connections` set to `1`.
```mjs
import { MockAgent } from 'undici'
// `connections: 1` makes the agent hand out `MockClient` instances.
const mockAgent = new MockAgent({ connections: 1 })
const mockClient = mockAgent.get('http://localhost:3000')
```
```cjs
const { MockAgent } = require('undici')
const mockAgent = new MockAgent({ connections: 1 })
const mockClient = mockAgent.get('http://localhost:3000')
```
## Class: `MockClient`
<!-- YAML
added: v4.0.0
-->
* Extends: {Client}
Extends [`Client`][] and implements the `Interceptable` interface, allowing
requests made through it to be matched against registered mocks.
### `new MockClient(origin[, options])`
<!-- YAML
added: v4.0.0
-->
* `origin` {string} The origin to associate this mock client with. It should
only include the protocol, hostname, and port.
* `options` {MockClientOptions} Extends the [`Client`][] options.
* Returns: {MockClient}
The `agent` option is required and must implement the `Agent` interface;
otherwise an `InvalidArgumentError` is thrown.
#### Parameter: `MockClientOptions`
Extends: `ClientOptions`
* `agent` {MockAgent} The agent to associate this mock client with.
* `ignoreTrailingSlash` {boolean} Whether trailing slashes should be ignored
when matching the path of intercepted requests. **Default:** `false`.
### `mockClient.intercept(options)`
<!-- YAML
added: v4.0.0
-->
* `options` {MockInterceptor.Options} The matching criteria for the requests to
intercept.
* `path` {string|RegExp|Function} The path to match against. A function
receives the request path as a `string` and returns a `boolean`.
* `method` {string|RegExp|Function} The method to match against. A function
receives the request method as a `string` and returns a `boolean`.
**Default:** `'GET'`.
* `body` {string|RegExp|Function} The body to match against. A function
receives the request body as a `string` and returns a `boolean`.
* `headers` {Object|Function} The headers to match against, as a map of header
name to a `string`, `RegExp`, or matching function, or a single function
that receives all headers and returns a `boolean`.
* `query` {Object} The query parameters to match against.
* `ignoreTrailingSlash` {boolean} Whether a trailing slash on `path` is
ignored when matching. Inherited from the mock client's
`ignoreTrailingSlash` option when not set.
* Returns: {MockInterceptor} The interceptor used to define the mocked reply.
Registers a route on the mock client and returns a [`MockInterceptor`][] for any
matching request that uses the same origin as this mock client. The interceptor
is then used to define the reply, for example with `reply()` or
`replyWithError()`.
```mjs
import { MockAgent } from 'undici'
const mockAgent = new MockAgent({ connections: 1 })
const mockClient = mockAgent.get('http://localhost:3000')
mockClient.intercept({ path: '/foo', method: 'GET' }).reply(200, 'foo')
```
### `mockClient.cleanMocks()`
<!-- YAML
added: v7.11.0
-->
Removes all registered interceptors from the mock client. Pending mocks defined
before this call no longer match incoming requests.
```mjs
import { MockAgent } from 'undici'
const mockAgent = new MockAgent({ connections: 1 })
const mockClient = mockAgent.get('http://localhost:3000')
mockClient.intercept({ path: '/foo' }).reply(200, 'foo')
mockClient.cleanMocks()
```
### `mockClient.close()`
<!-- YAML
added: v4.0.0
-->
* Returns: {Promise} Fulfills with `undefined` once the mock client is closed.
Closes the mock client, gracefully waiting for any enqueued requests to
complete, and removes it from the associated [`MockAgent`][].
```mjs
import { MockAgent } from 'undici'
const mockAgent = new MockAgent({ connections: 1 })
const mockClient = mockAgent.get('http://localhost:3000')
await mockClient.close()
```
### `mockClient.dispatch(options, handlers)`
<!-- YAML
added: v4.0.0
-->
* `options` {DispatchOptions} The request options.
* `handlers` {DispatchHandler} The handlers invoked over the request lifecycle.
* Returns: {boolean} `false` if the dispatcher is busy and the caller should
wait before dispatching further requests, otherwise `true`.
Dispatches a request, matching it against the registered mocks. This override of
[`dispatcher.dispatch(options, handlers)`][] is what drives the mocking
behaviour for every higher-level method such as `request`.
### `mockClient.request(options[, callback])`
<!-- YAML
added: v4.0.0
-->
* `options` {DispatchOptions}
* `callback` {Function} (optional) Invoked with the response when no `Promise`
is requested.
* Returns: {Promise} Fulfills with the mocked response when no `callback` is
provided.
Performs a request and resolves it against the registered mocks. Inherited from
[`Client`][]; see [`dispatcher.request(options[, callback])`][] for the full
parameter and return value documentation.
```mjs
import { MockAgent } from 'undici'
const mockAgent = new MockAgent({ connections: 1 })
const mockClient = mockAgent.get('http://localhost:3000')
mockClient.intercept({ path: '/foo' }).reply(200, 'foo')
const { statusCode, body } = await mockClient.request({
origin: 'http://localhost:3000',
path: '/foo',
method: 'GET'
})
console.log('response received', statusCode) // response received 200
for await (const data of body) {
console.log('data', data.toString('utf8')) // data foo
}
```
[`Client`]: Client.md#class-client
[`MockAgent`]: MockAgent.md#class-mockagent
[`MockInterceptor`]: MockPool.md#return-mockinterceptor
[`MockPool`]: MockPool.md#class-mockpool
[`dispatcher.dispatch(options, handlers)`]: Dispatcher.md#dispatcherdispatchoptions-handler
[`dispatcher.request(options[, callback])`]: Dispatcher.md#dispatcherrequestoptions-callback
[`mockAgent.get(origin)`]: MockAgent.md#mockagentgetorigin
@@ -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 NavigationOff = createLucideIcon("NavigationOff", [
["path", { d: "M8.43 8.43 3 11l8 2 2 8 2.57-5.43", key: "1vdtb7" }],
["path", { d: "M17.39 11.73 22 2l-9.73 4.61", key: "tya3r6" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { NavigationOff as default };
//# sourceMappingURL=navigation-off.js.map
@@ -0,0 +1 @@
module.exports={C:{"49":0.00512,"115":0.26598,"120":1.70841,"121":3.39125,"122":0.00512,"123":0.01023,"124":0.01023,"125":0.00512,"127":0.00512,"133":0.00512,"134":0.00512,"135":0.00512,"136":0.00512,"140":0.05627,"142":0.00512,"143":0.00512,"144":0.00512,"145":0.02046,"146":0.00512,"147":0.00512,"148":0.00512,"149":0.00512,"150":0.01023,"151":0.01023,"152":0.01535,"153":0.02558,"154":0.2046,"155":0.75191,"156":0.72633,"157":0.03581,_:"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 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 126 128 129 130 131 132 137 138 139 141 158 159 160 3.5","3.6":0.00512},D:{"60":0.00512,"61":0.00512,"62":0.00512,"63":0.00512,"64":0.00512,"66":0.00512,"67":0.00512,"68":0.00512,"69":0.00512,"70":0.00512,"73":0.01023,"75":0.00512,"78":0.00512,"86":0.00512,"91":0.00512,"92":0.02046,"93":0.00512,"98":0.00512,"101":0.01023,"103":0.35294,"104":0.33759,"105":0.33759,"106":0.33759,"107":0.34271,"108":0.33759,"109":0.84398,"110":0.33759,"111":0.34271,"112":0.33248,"113":0.00512,"114":0.00512,"115":0.00512,"116":0.66495,"117":0.33759,"118":2.02043,"119":3.4424,"120":3.76976,"121":0.01023,"122":0.01535,"123":0.01535,"124":0.36317,"125":0.00512,"126":0.01023,"127":0.00512,"128":0.01023,"129":0.00512,"130":0.01535,"131":0.6803,"132":0.01535,"133":0.70076,"134":0.05115,"135":0.05115,"136":0.05627,"137":0.05115,"138":0.08696,"139":0.05115,"140":0.05627,"141":0.05115,"142":0.15857,"143":0.01023,"144":0.15345,"145":0.0665,"146":0.76214,"147":0.02558,"148":0.14834,"149":0.36317,"150":0.4092,"151":4.19942,"152":6.48071,"153":4.95132,"154":1.18157,"155":0.03069,"156":0.00512,_:"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 65 71 72 74 76 77 79 80 81 83 84 85 87 88 89 90 94 95 96 97 99 100 102 157"},F:{"51":0.00512,"52":0.00512,"53":0.00512,"54":0.00512,"55":0.00512,"56":0.01023,"57":0.00512,"95":0.01023,"101":0.02046,"102":0.00512,"105":0.00512,"106":0.01023,"107":0.00512,"115":0.00512,"116":0.00512,"120":0.00512,"121":0.00512,"122":0.00512,"134":0.02558,"135":0.20972,_:"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 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 108 109 110 111 112 113 114 117 118 119 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:{"92":0.01023,"109":0.01023,"114":0.01535,"119":1.69818,"120":1.70841,"122":0.01023,"123":0.00512,"131":0.00512,"132":0.00512,"135":0.00512,"138":0.00512,"139":0.00512,"140":0.01023,"141":0.01535,"142":0.02046,"143":0.01535,"144":0.01023,"145":0.01535,"146":0.01023,"147":0.01535,"148":0.01535,"149":0.01535,"150":0.04092,"151":0.02558,"152":0.38363,"153":0.42455,"154":0.12276,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 124 125 126 127 128 129 130 133 134 136 137"},E:{"4":0.00512,"5":0.00512,"27":0.02046,_:"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 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.5 18.0 18.1 18.2 18.3 18.4 18.5-18.7 26.1 27.1 27.2 TP","15.6":0.00512,"16.6":0.00512,"17.1":0.00512,"17.3":0.00512,"17.4":0.00512,"17.6":0.00512,"26.0":0.00512,"26.2":0.00512,"26.3":0.01023,"26.4":0.00512,"26.5":0.02046,"26.6":0.08696},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00022,"5.0-5.1":0.00022,"6.0-6.1":0,"7.0-7.1":0.00044,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00218,"11.0-11.2":0.00022,"11.3-11.4":0.00044,"12.0-12.1":0,"12.2-12.5":0.00566,"13.0-13.1":0,"13.2":0.00109,"13.3":0,"13.4-13.7":0.00022,"14.0-14.4":0.00087,"14.5-14.8":0.00131,"15.0-15.1":0.00131,"15.2-15.3":0.00087,"15.4":0.00109,"15.5":0.00131,"15.6-15.8":0.02832,"16.0":0.00218,"16.1":0.00392,"16.2":0.00218,"16.3":0.00479,"16.4":0.00109,"16.5":0.00174,"16.6-16.7":0.03943,"17.0":0.00153,"17.1":0.00218,"17.2":0.00218,"17.3":0.00327,"17.4":0.00458,"17.5":0.00893,"17.6-17.7":0.02309,"18.0":0.00479,"18.1":0.00959,"18.2":0.01307,"18.3":0.02266,"18.4":0.01416,"18.5-18.7":0.2926,"26.0":0.01416,"26.1":0.01438,"26.2":0.03747,"26.3":0.04052,"26.4":0.02963,"26.5":0.19848,"26.6":1.22465,"27.0":0.0939,"27.1":0,"27.2":0.0024},P:{"22":0.02025,"23":0.02025,"24":0.02025,"25":0.03038,"26":0.05063,"27":0.03038,"28":0.07088,"29":0.07088,"30":0.60757,_:"4 20 21 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.05063},I:{"0":0.00976,"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":1.35315,_:"10 11 12 11.1 11.Line truncated
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
PEAKS by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
/^^@
/^^@
/^^@
/^ @
/^ @
@
/^^@
@@
/^ /^@
/^ /^@
@
@
@
@
@
@@
@
/^^ /^^ @
/^^^^^^ /^^^^@
/^^ /^^ @
/^^ /^^ @
/^^^^^^ /^^^^@
/^^ /^^ @
@@
/^^ @
/^ /^^ @
/^^ @
/^^ @
/^^@
/^^ /^^ @
/^^ @
@@
@
/^^ /^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ /^^ @
@@
/^ @
/^^ /^^@
/^^ @
/^^^ @
/^^ @
/^^ /^^@
/^ @
@@
/^^@
/^@
@
@
@
@
@
@@
/^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^@
@@
/^^ @
/^^ @
/^^@
/^^@
/^^@
/^^ @
/^^ @
@@
/^^ @
/^^ /^^ /^^@
/^ /^ /^^ @
/^^^^ /^^^^^^^@
/^ /^ /^^ @
/^^ /^^ /^^@
/^^ @
@@
@
/^^ @
/^^ @
/^^^ /^^^^^@
/^^ @
/^^ @
@
@@
@
@
@
@
@
@
/^^@
/^@@
@
@
@
/^^^^^@
@
@
@
@@
@
@
@
@
@
@
/^^@
@@
/^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
@@
@
/^^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^@
/^^ /^^ @
/^^^ @
@@
@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^^^@
@@
@
/^ /^^ @
/^ /^^@
/^^ @
/^^ @
/^^ @
/^^^^^^^^ @
@@
@
/^^ /^^ @
/^^ @
/^^ @
/^^ @
/^^@
/^^^^^ @
@@
@
/^^ @
/ /^^ @
/^ /^^ @
/^^ /^^ @
/^^^^ /^ /^^@
/^^ @
@@
@
/^^ /^^^ @
/^^ @
/^^^ @
/^^ @
/^^@
/^^^ /^^ @
@@
@
/^^ @
/^^ @
/^^ @
/^ /^^ @
/^^ /^^@
/^^ /^^ @
@@
@
/^^^^^ /^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
@@
@
/^ @
/^^ /^^ @
/^^ /^ @
/^^ /^ @
/^^ /^^@
/^^^^ @
@@
@
/^ /^^ @
/^^ /^^@
/^ /^^ @
/^ /^^ @
/^^ @
/^^ @
@@
@
@
@
@
/^^@
@
/^^@
@@
@
@
@
@
/^^@
@
/^^@
/^@@
/^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^@
@@
@
@
/^^^^^^@
@
/^^^^^^@
@
@
@@
/^^ @
/^^ @
/^^ @
/^^@
/^^ @
/^^ @
/^^ @
@@
/^^^ @
/^^ @
/^^@
/^^ @
/^^ @
@
/^^ @
@@
@
/^^^ @
/^ /^^ @
/^ /^^ /^^@
/^^ /^^/ /^^@
/^^ ``` @
/^^ @
@@
/^ @
/^ ^^ @
/^ /^^ @
/^^ /^^ @
/^^^^^^ /^^ @
/^^ /^^ @
/^^ /^^@
@@
/^^ /^^ @
/^ /^^ @
/^ /^^@
/^^^ /^ @
/^ /^^@
/^ /^@
/^^^^ /^^ @
@@
/^^ @
/^^ /^^@
/^^ @
/^^ @
/^^ @
/^^ /^^@
/^^^^ @
@@
/^^^^^ @
/^^ /^^ @
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^ @
/^^^^^ @
@@
/^^^^^^^^@
/^^ @
/^^ @
/^^^^^^ @
/^^ @
/^^ @
/^^^^^^^^@
@@
/^^^^^^^^@
/^^ @
/^^ @
/^^^^^^ @
/^^ @
/^^ @
/^^ @
@@
/^^^^ @
/^ /^^ @
/^^ @
/^^ @
/^^ /^^^^@
/^^ /^ @
/^^^^^ @
@@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^^^^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^@
@@
/^^@
/^^@
/^^@
/^^@
/^^@
/^^@
/^^@
@@
/^^@
/^^@
/^^@
/^^@
/^^@
/^ /^^@
/^^^^ @
@@
/^^ /^^ @
/^^ /^^ @
/^^ /^^ @
/^ /^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^@
@@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^^^^^^^@
@@
/^^ /^^@
/^ /^^ /^^^@
/^^ /^^ / /^^@
/^^ /^^ /^^@
/^^ /^ /^^@
/^^ /^^@
/^^ /^^@
@@
/^^^ /^^@
/^ /^^ /^^@
/^^ /^^ /^^@
/^^ /^^ /^^@
/^^ /^ /^^@
/^^ /^ ^^@
/^^ /^^@
@@
/^^^^ @
/^^ /^^ @
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^ @
/^^^^ @
@@
/^^^^^^^ @
/^^ /^^@
/^^ /^^@
/^^^^^^^ @
/^^ @
/^^ @
/^^ @
@@
/^^^^ @
/^^ /^^ @
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^ /^^ @
/^^ ^^ @
/^ @@
/^^^^^^^ @
/^^ /^^ @
/^^ /^^ @
/^ /^^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^@
@@
/^^ ^^ @
/^^ /^^@
/^^ @
/^^ @
/^^ @
/^^ /^^@
/^^ ^^ @
@@
/^^^ /^^^^^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
@@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^^^^ @
@@
/^^ /^^@
/^^ /^^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^ @
/^^^^ @
/^^ @
@@
/^^ /^^@
/^^ /^^@
/^^ /^ /^^@
/^^ /^^ /^^@
/^^ /^ /^^ /^^@
/^ /^ /^^^^@
/^^ /^^@
@@
/^^ /^^@
/^^ /^^ @
/^^ /^^ @
/^^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^@
@@
/^^ /^^@
/^^ /^^ @
/^^ /^^ @
/^^ @
/^^ @
/^^ @
/^^ @
@@
/^^^^^^^ /^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^^^^^^^^^^@
@@
/^^^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^^^@
@@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^@
@@
/^^^^@
/^^@
/^^@
/^^@
/^^@
/^^@
/^^^^@
@@
/^^ @
/^^ /^^ @
/^^ /^^@
@
@
@
@
@@
@
@
@
@
@
@
@
/^^^^^@@
/^^@
/^ @
@
@
@
@
@
@@
@
@
/^^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^ @
/^^ /^^^@
@@
/^^ @
/^^ @
/^^ @
/^^ /^^ @
/^^ /^^@
/^^ /^^@
/^^ /^^ @
@@
@
@
/^^^@
/^^ @
/^^ @
/^^ @
/^^^@
@@
/^^@
/^^@
/^^@
/^^ /^^@
/^ /^^@
/^ /^^@
/^^ /^^@
@@
@
@
/^^ @
/^ /^^ @
/^^^^^ /^^@
/^ @
/^^^^ @
@@
/^^@
/^ @
/^/^ /^@
/^^ @
/^^ @
/^^ @
/^^ @
@@
@
@
/^^ @
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ @
/^^ @@
@
/^^ @
/^^ @
/^ /^ @
/^^ /^^@
/^ /^^@
/^^ /^^@
@@
@
/^@
@
/^^@
/^^@
/^^@
/^^@
@@
@
/^^@
@
/^^@
/^^@
/^^@
/^^@
/^^^ @@
/^^ @
/^^ @
/^^ /^^@
/^^ /^^ @
/^/^^ @
/^^ /^^ @
/^^ /^^@
@@
/^^@
/^^@
/^^@
/^^@
/^^@
/^^@
/^^^@
@@
@
@
/^^^ /^^ /^^ @
/^^ /^ /^^@
/^^ /^ /^^@
/^^ /^ /^^@
/^^^ /^ /^^@
@@
@
@
/^^ /^^ @
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^^ /^^@
@@
@
@
/^^ @
/^^ /^^ @
/^^ /^^@
/^^ /^^ @
/^^ @
@@
@
@
/^ /^^ @
/^ /^^ @
/^ /^^@
/^^ /^^ @
/^^ @
/^^ @@
@
@
/^^ @
/^ /^^ @
/^ /^^ @
/^^/^^ @
/^^ @
/^^^@@
@
@
/^ /^^^@
/^^ @
/^^ @
/^^ @
/^^^ @
@@
@
@
/^^^^ @
/^^ @
/^^^ @
/^^@
/^^ /^^@
@@
/^^ @
/^^ @
/^/^ /^@
/^^ @
/^^ @
/^^ @
/^^ @
@@
@
@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^ /^^@
/^^/^^@
@@
@
@
/^^ /^^@
/^^ /^^ @
/^^ /^^ @
/^/^^ @
/^^ @
@@
@
@
/^^ /^^^@
/^^ ^ /^^@
/^^ /^ /^^@
/^ /^ /^/^^@
/^^^ /^^^@
@@
@
@
/^^ /^^@
/^ /^^ @
/^ @
/^ /^^ @
/^^ /^^@
@@
@
@
/^^ /^^@
/^^ /^^ @
/^^^ @
/^^ @
/^^ @
/^^ @@
@
@
/^^^^ /^^@
/^^ @
/^^ @
/^^ @
/^^^^^^^^@
@@
/^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^@
@@
/^@
/^@
/^@
@
/^@
/^@
/^@
@@
/^^ @
/^^ @
/^^ @
/^^@
/^^ @
/^^ @
/^^ @
@@
/^^ /^ @
/^ /^^@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1 @@
{"version":3,"file":"ratio.js","sources":["../../../src/icons/ratio.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Ratio\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTIiIGhlaWdodD0iMjAiIHg9IjYiIHk9IjIiIHJ4PSIyIiAvPgogIDxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIxMiIgeD0iMiIgeT0iNiIgcng9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/ratio\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 Ratio = createLucideIcon('Ratio', [\n ['rect', { width: '12', height: '20', x: '6', y: '2', rx: '2', key: '1oxtiu' }],\n ['rect', { width: '20', height: '12', x: '2', y: '6', rx: '2', key: '9lu3g6' }],\n]);\n\nexport default Ratio;\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,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,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,308 @@
[![CI](https://github.com/beaugunderson/ip-address/actions/workflows/ci.yml/badge.svg)](https://github.com/beaugunderson/ip-address/actions/workflows/ci.yml)
[![codecov]](https://codecov.io/github/beaugunderson/ip-address?branch=main)
[![downloads]](https://www.npmjs.com/package/ip-address)
[![npm]](https://www.npmjs.com/package/ip-address)
[codecov]: https://codecov.io/github/beaugunderson/ip-address/coverage.svg?branch=main
[downloads]: https://img.shields.io/npm/dm/ip-address.svg
[npm]: https://img.shields.io/npm/v/ip-address.svg
## ip-address
`ip-address` is a library for validating and manipulating IPv4 and IPv6 addresses in JavaScript and TypeScript.
### Install
```sh
npm install ip-address
```
### Examples
<!-- prettier-ignore -->
```ts
import { Address4, Address6 } from 'ip-address';
// Validation
Address4.isValid('192.168.1.1'); // true
Address6.isValid('2001:db8::1'); // true
Address6.isValid('not an address'); // false
// Parsing (throws AddressError on invalid input)
const v4 = new Address4('192.168.1.1/24');
const v6 = new Address6('2001:db8::1/64');
// Subnet membership
const host = new Address4('192.168.1.42');
const network = new Address4('192.168.1.0/24');
host.isInSubnet(network); // true
// Subnet range
network.startAddress().correctForm(); // '192.168.1.0'
network.endAddress().correctForm(); // '192.168.1.255'
// Strict network-address check (host bits must be zero).
// isValid() accepts CIDRs with host bits set — '192.168.1.5/24' is a valid
// host-with-subnet, but it isn't a network address.
const cidr = new Address4('192.168.1.5/24');
Address4.isValid('192.168.1.5/24'); // true
cidr.correctForm() === cidr.startAddress().correctForm(); // false
// Address properties
const link = new Address6('fe80::1');
link.isLinkLocal(); // true
link.isMulticast(); // false
link.isLoopback(); // false
new Address4('192.168.1.1').isPrivate(); // true (RFC 1918)
new Address6('fc00::1').isULA(); // true (RFC 4193)
// Numeric and byte representations
v4.bigInt(); // 3232235777n
v4.toArray(); // [192, 168, 1, 1]
v6.canonicalForm(); // '2001:0db8:0000:0000:0000:0000:0000:0001'
// Embedded IPv4 + Teredo
const teredo = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe');
teredo.inspectTeredo().client4; // '157.60.0.1'
// Parse host + port from a URL
Address6.fromURL('http://[2001:db8::1]:8080/').port; // 8080
```
### Features
- Written in TypeScript with full type definitions; usable from CommonJS and ESM
- Zero runtime dependencies
- Parses dotted-quad IPv4 and [RFC 4291](https://datatracker.ietf.org/doc/html/rfc4291) IPv6 notation, including subnets and zones. The `inet_aton` forms (`2130706433`, `0x7f000001`, `127.1`) and leading-zero octets are rejected by design — see [SECURITY.md](./SECURITY.md#classifiers-are-not-an-ssrf-defense)
- Parses IPv6 hosts (and ports) from URLs via `Address6.fromURL(url)`
- Subnet membership checks (`isInSubnet`) and range queries (`startAddress` / `endAddress`)
- Special-property checks: private (RFC 1918) / ULA (RFC 4193), loopback, link-local, multicast, broadcast, unspecified, CGNAT, documentation, Teredo, 6to4, v4-in-v6
- Decodes [Teredo](http://en.wikipedia.org/wiki/Teredo_tunneling#IPv6_addressing) and 6to4 tunneling information
- Conversions: canonical/correct form, hex, binary, decimal, byte arrays, BigInt, `in-addr.arpa` / `ip6.arpa`
- Runs in Node.js and the browser
- Thousands of test cases
### Terminology
A few terms used throughout the API can be confusing if you haven't worked deeply with IPv6 before:
- **Correct form** — the shortest valid representation, per [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros stripped, the longest run of zero groups collapsed to `::`, and hex digits lowercased (e.g. `2001:db8::1`). This is what most software displays.
- **Canonical form** — the fully expanded representation: all 8 groups, each padded to 4 hex digits, no `::` collapsing (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and byte-exact comparison.
- **Subnet** — the network portion of an address expressed as a CIDR prefix length (e.g. `/24` for IPv4, `/64` for IPv6). `startAddress()` / `endAddress()` return the bounds of the subnet's range.
- **Zone** — the IPv6 scope identifier appended after `%`, used to disambiguate link-local addresses across interfaces (e.g. `fe80::1%eth0`).
- **v4-in-v6** — mixed notation that embeds an IPv4 address as the last 32 bits of an IPv6 address, e.g. `::ffff:192.168.0.1`. Used for IPv4-mapped IPv6 addresses.
- **Teredo** — a tunneling protocol that encodes an IPv4 endpoint, port, and flags inside a `2001::/32` IPv6 address. `inspectTeredo()` decodes those fields.
- **6to4** — a tunneling protocol that embeds a full 32-bit IPv4 address in bits 16–47 of a `2002::/16` IPv6 address, i.e. the second and third groups (`192.0.2.4` becomes `2002:c000:204::`). `inspect6to4()` decodes the embedded v4 address.
### API
<!-- API:START -->
<details>
<summary><a id="address4"></a><strong>Address4</strong> — Represents an IPv4 address</summary>
**Constructor**
- `new Address4(address: string): Address4`
**Static methods**
- `static isValid(address: string): boolean` — Returns true if the given string is a valid IPv4 address (with optional CIDR subnet), false otherwise. Host bits in the subnet portion are allowed (e.g. `192.168.1.5/24` is valid); for strict network-address validation compare `correctForm()` to `startAddress().correctForm()`, or use `networkForm()`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L62)
- `static fromAddressAndMask(address: string, mask: string): Address4` — Construct an `Address4` from an address and a dotted-decimal subnet mask given as separate strings (e.g. as returned by Node's `os.networkInterfaces()`). Throws `AddressError` if the mask is non-contiguous (e.g. `255.0.255.0`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L119)
- `static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4` — Construct an `Address4` from an address and a Cisco-style wildcard mask given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard mask is the bitwise inverse of the subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g. `0.255.0.255`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L133)
- `static fromWildcard(input: string): Address4` — Construct an `Address4` from a wildcard pattern with trailing `*` octets. The number of trailing wildcards determines the prefix length: each `*` represents 8 bits. Only trailing whole-octet wildcards are supported. Partial-octet wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g. `192.*.0.1`) throw `AddressError`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L154)
- `static fromHex(hex: string): Address4` — Converts a hex string to an IPv4 address object. Accepts 8 hex digits with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`). Throws `AddressError` for any other length or for non-hex characters. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L189)
- `static fromInteger(integer: number): Address4` — Converts an integer into a IPv4 address object. The integer must be a non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L212)
- `static fromArpa(arpaFormAddress: string): Address4` — Return an address from in-addr.arpa form: the four octets reversed, with or without the `.in-addr.arpa` suffix and root dot, in any case. Throws `AddressError` unless the reversed labels form a valid IPv4 address, so `fromArpa(x.reverseForm())` round-trips reverseForm. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L231)
- `static fromBigInt(bigInt: bigint): Address4` — Converts a BigInt to a v4 address object. The value must be in the range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L422)
- `static fromByteArray(bytes: number[]): Address4` — Convert a byte array to an Address4 object. Throws `AddressError` unless given exactly 4 integers from 0 to 255. Signed bytes are rejected, so this differs from `Address6.fromByteArray`, which folds them; the two contracts converge on this stricter form in the next major version. To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L440)
- `static fromUnsignedByteArray(bytes: number[]): Address4` — Convert an unsigned byte array to an Address4 object. Throws `AddressError` unless given exactly 4 bytes, and rejects values outside 0 to 255 when parsing the resulting address. To convert from a Node.js `Buffer`, spread it: `Address4.fromUnsignedByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L456)
**Instance methods**
- `parse(address: string): string[]` — Parses an IPv4 address string into its four octet groups and stores the result on `this.parsedAddress`. Called automatically by the constructor; you typically don't need to call it directly. Throws `AddressError` if the input is not a valid IPv4 address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L79)
- `correctForm(): string` — Returns the address in correct form: octets joined with `.` and any leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the canonical dotted-decimal representation. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L100)
- `toHex(): string` — Converts an IPv4 address object to a hex string [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L254)
- `toArray(): number[]` — Converts an IPv4 address object to an array of bytes. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L264)
- `toGroup6(): string` — Converts an IPv4 address object to an IPv6 address group [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L272)
- `bigInt(): bigint` — Returns the address as a `bigint` [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L291)
- `startAddress(): Address4` — The first address in the range given by this address' subnet. Often referred to as the Network Address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L308)
- `startAddressExclusive(): Address4` — The first host address in the range given by this address's subnet ie the first address after the Network Address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L317)
- `offset(n: number | bigint): Address4` — Returns the address `n` addresses after this one (or before, when `n` is negative), keeping this address's subnet mask. Throws `AddressError` when the result would fall outside the IPv4 address space or `n` is not an integer. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L332)
- `nextNetwork(): Address4` — Returns the network that follows this address's network: the address after endAddress, with the same subnet mask. Throws `AddressError` when this network is the last one in the address space. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L346)
- `endAddress(): Address4` — The last address in the range given by this address' subnet Often referred to as the Broadcast [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L369)
- `endAddressExclusive(): Address4` — The last host address in the range given by this address's subnet ie the last address prior to the Broadcast Address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L378)
- `subnetMaskAddress(): Address4` — The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for a `/20`. Returns an `Address4`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L388)
- `wildcardMask(): Address4` — The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L400)
- `networkForm(): string` — The network address in CIDR string form, e.g. `192.168.1.0/24` for `192.168.1.5/24`. For an address with no explicit subnet the prefix is `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L412)
- `mask(mask?: number): string` — Returns the first n bits of the address, defaulting to the subnet mask [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L470)
- `getBitsBase2(start: number, end: number): string` — Returns the bits in the given range as a base-2 string [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L482)
- `reverseForm(options?: ReverseFormOptions): string` — Return the reversed in-addr.arpa form of the address, e.g. `42.2.0.192.in-addr.arpa.` for `192.0.2.42`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L493)
- `isMulticast(): boolean` — Returns true if the given address is a multicast address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L531)
- `isPrivate(): boolean` — Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L539)
- `isLoopback(): boolean` — Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L547)
- `isLinkLocal(): boolean` — Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L555)
- `isUnspecified(): boolean` — Returns true if the address is the unspecified address `0.0.0.0`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L563)
- `isBroadcast(): boolean` — Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L571)
- `isCGNAT(): boolean` — Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L579)
- `isDocumentation(): boolean` — Returns true if the address is in one of the documentation ranges `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24` ([RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L588)
- `isBenchmarking(): boolean` — Returns true if the address is in the benchmarking range `198.18.0.0/15` ([RFC 2544](https://datatracker.ietf.org/doc/html/rfc2544)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L596)
- `isReserved(): boolean` — Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)), which includes the limited broadcast address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L605)
- `isGlobal(): boolean` — Returns true if the address is globally reachable: not multicast, and not in any block the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/) marks as not globally reachable. That covers everything the individual classifiers name (private, loopback, link-local, CGNAT, unspecified, broadcast, documentation, benchmarking, reserved) and the blocks they do not, such as `0.0.0.0/8` and the IETF protocol assignments in `192.0.0.0/24`. This is the single predicate to use where a request must not reach an internal or special-purpose destination; see SECURITY.md. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L620)
- `binaryZeroPad(): string` — Returns a zero-padded base-2 string representation of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L628)
- `groupForV6(): string` — Groups an IPv4 address for inclusion at the end of an IPv6 address. Returns an HTML fragment: each half of the address is wrapped in a `<span>` carrying the group classes an address-inspector UI hovers on. The address content is HTML-escaped; anything you concatenate around it is your responsibility. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L644)
**Properties**
- `address: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L14)
- `addressMinusSuffix: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L15)
- `groups: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L16)
- `parsedAddress: string[]` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L17)
- `parsedSubnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L18)
- `subnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L19)
- `subnetMask: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L20)
- `v4: boolean` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L21)
- `isCorrect: () => boolean` — Returns true if the address is correct, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L108)
- `isInSubnet: (address: Address4 | Address6) => boolean` — Returns true if the given address is in the subnet of the current address. An `Address6` is never in the subnet of an `Address4`; convert with `to4()` or `Address6.fromAddress4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L513)
- `isHostInSubnet: (address: Address4 | Address6) => boolean` — Returns true if this address's host bits fall inside the given subnet, ignoring this address's own subnet mask. Prefer this over `isInSubnet` when classifying a single address, so the answer doesn't change with the CIDR suffix the caller happened to write — notably when the address came from untrusted input and the result backs a trust-boundary decision. An `Address6` is never in the subnet of an `Address4`; convert with `to4()` or `Address6.fromAddress4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv4.ts#L525)
</details>
<details>
<summary><a id="address6"></a><strong>Address6</strong> — Represents an IPv6 address</summary>
**Constructor**
- `new Address6(address: string, optionalGroups?: number): Address6`
**Static methods**
- `static isValid(address: string): boolean` — Returns true if the given string is a valid IPv6 address (with optional CIDR subnet and zone identifier), false otherwise. Host bits in the subnet portion are allowed (e.g. `2001:db8::1/32` is valid); for strict network-address validation compare `correctForm()` to `startAddress().correctForm()`, or use `networkForm()`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L182)
- `static fromBigInt(bigInt: bigint): Address6` — Convert a BigInt to a v6 address object. The value must be in the range `[0, 2**128 - 1]`; otherwise `AddressError` is thrown. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L203)
- `static fromURL(url: string): { error: string; address: null; port: null } | { error?: undefined; address: Address6; port: number | null }` — Parse a URL (with optional bracketed host and port) into an address and port. Returns either `{ address, port }` on success or `{ error, address: null, port: null }` if the URL could not be parsed. Ports are returned as numbers (or `null` if absent or out of range). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L228)
- `static fromAddressAndMask(address: string, mask: string): Address6` — Construct an `Address6` from an address and a hex subnet mask given as separate strings (e.g. as returned by Node's `os.networkInterfaces()`). Throws `AddressError` if the mask is non-contiguous (e.g. `ffff::ffff`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L295)
- `static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address6` — Construct an `Address6` from an address and a Cisco-style wildcard mask given as separate strings (e.g. `::ffff:ffff:ffff:ffff` for a `/64`). The wildcard mask is the bitwise inverse of the subnet mask. Throws `AddressError` if the mask is non-contiguous. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L309)
- `static fromWildcard(input: string): Address6` — Construct an `Address6` from a wildcard pattern with trailing `*` groups. The number of trailing wildcards determines the prefix length: each `*` represents 16 bits. `::` is expanded to zero groups (not wildcards) before evaluating trailing wildcards. Only trailing whole-group wildcards are supported. Partial-group wildcards (e.g. `2001:db8::0*`) and interior wildcards (e.g. `*::1`) throw `AddressError`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L331)
- `static fromAddress4(address: string): Address6` — Create an IPv6-mapped address given an IPv4 address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L392)
- `static fromArpa(arpaFormAddress: string): Address6` — Return an address from ip6.arpa form. A full 32-nibble name gives a /128 address; a shorter name, as used for a delegated reverse zone, gives the network it covers, with a subnet mask of four bits per nibble, so `fromArpa(x.reverseForm())` round-trips reverseForm for any prefix. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L412)
- `static fromAddress4Nat64(address: string, prefix?: string): Address6` — Embed an IPv4 address into a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. The prefix length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter than /64 the IPv4 octets are split around the reserved bits 64–71. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1119)
- `static fromByteArray(bytes: number[]): Address6` — Convert a byte array to an Address6 object. Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an `Int8Array` or a Java `byte[]` holds them), folding signed values to their unsigned equivalent. Throws `AddressError` unless given exactly 16 integers from -128 to 255. To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1234)
- `static fromUnsignedByteArray(bytes: number[]): Address6` — Convert an unsigned byte array to an Address6 object. Throws `AddressError` unless given exactly 16 integers from 0 to 255. To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1251)
**Instance methods**
- `microsoftTranscription(): string` — Return the Microsoft UNC transcription of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L437)
- `mask(mask?: number): string` — Return the first n bits of the address, defaulting to the subnet mask [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L446)
- `possibleSubnets(subnetSize?: number): string` — Return the number of possible subnets of a given size in the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L456)
- `startAddress(): Address6` — The first address in the range given by this address' subnet Often referred to as the Network Address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L481)
- `startAddressExclusive(): Address6` — The first host address in the range given by this address's subnet ie the first address after the Network Address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L490)
- `endAddress(): Address6` — The last address in the range given by this address's subnet. IPv6 has no broadcast address, so this is an ordinary assignable address (in a 64-bit-interface-identifier subnet it falls inside the reserved subnet-anycast block of [RFC 2526](https://datatracker.ietf.org/doc/html/rfc2526)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L510)
- `endAddressExclusive(): Address6` — The address one before endAddress. This is the IPv6 counterpart of the IPv4 method that skips the broadcast address; IPv6 has no broadcast, so it drops exactly one address and does not model the 128 reserved subnet-anycast identifiers of [RFC 2526](https://datatracker.ietf.org/doc/html/rfc2526). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L521)
- `offset(n: number | bigint): Address6` — Returns the address `n` addresses after this one (or before, when `n` is negative), keeping this address's subnet mask. Throws `AddressError` when the result would fall outside the IPv6 address space or `n` is not an integer. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L536)
- `nextNetwork(): Address6` — Returns the network that follows this address's network: the address after endAddress, with the same subnet mask. Throws `AddressError` when this network is the last one in the address space. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L550)
- `subnetMaskAddress(): Address6` — The hex form of the subnet mask, e.g. `ffff:ffff:ffff:ffff::` for a `/64`. Returns an `Address6`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L565)
- `wildcardMask(): Address6` — The Cisco-style wildcard mask, e.g. `::ffff:ffff:ffff:ffff` for a `/64`. This is the bitwise inverse of `subnetMaskAddress()`. Returns an `Address6`; call `.correctForm()` for the string. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L577)
- `networkForm(): string` — The network address in CIDR string form, e.g. `2001:db8::/32` for `2001:db8::1/32`. For an address with no explicit subnet the prefix is `/128`, e.g. `networkForm()` on `2001:db8::1` returns `2001:db8::1/128`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L590)
- `getScope(): string` — Return the scope of the address. The 4-bit scope field ([RFC 4291 §2.7](https://datatracker.ietf.org/doc/html/rfc4291#section-2.7)) is only defined for multicast addresses; for unicast addresses the scope is derived from the address type per [RFC 4007 §6](https://datatracker.ietf.org/doc/html/rfc4007#section-6). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L602)
- `getType(): string` — Return the type of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L629)
- `getBits(start: number, end: number): bigint` — Return the bits in the given range as a BigInt [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L644)
- `getBitsBase2(start: number, end: number): string` — Return the bits in the given range as a base-2 string [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L652)
- `getBitsBase16(start: number, end: number): string` — Return the bits in the given range as a base-16 string [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L660)
- `getBitsPastSubnet(): string` — Return the bits that are set past the subnet mask length [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L676)
- `reverseForm(options?: ReverseFormOptions): string` — Return the reversed ip6.arpa form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L686)
- `correctForm(): string` — Returns the address in correct form, per [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros stripped, the longest run of zero groups collapsed to `::`, and hex digits lowercased (e.g. `2001:db8::1`). This is the recommended form for display. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L721)
- `binaryZeroPad(): string` — Return a zero-padded base-2 string representation of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L783)
- `parse4in6(address: string): string` — Parses a v4-in-v6 string (e.g. `::ffff:192.168.0.1`) by extracting the trailing IPv4 address into `this.address4` / `this.parsedAddress4` and returning the address with the v4 portion converted to two v6 groups. Used internally by `parse()`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L797)
- `parse(address: string): string[]` — Parses an IPv6 address string into its 8 hexadecimal groups (expanding any `::` elision and any trailing v4-in-v6 portion) and stores the result on `this.parsedAddress`. Called automatically by the constructor; you typically don't need to call it directly. Throws `AddressError` if the input is malformed. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L854)
- `canonicalForm(): string` — Returns the canonical (fully expanded) form of the address: all 8 groups, each padded to 4 hex digits, with no `::` collapsing (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and byte-exact comparison. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L934)
- `decimal(): string` — Return the decimal form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L942)
- `bigInt(): bigint` — Return the address as a BigInt [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L950)
- `to4(): Address4` — Return the last two groups of this address as an IPv4 address string. If this address carries a CIDR prefix that covers the trailing 32 bits (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to `/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L965)
- `to4in6(): string` — Return the v4-in-v6 form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L989)
- `inspectTeredo(): TeredoProperties` — Decodes the Teredo tunneling fields embedded in this address. Returns the Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag, UDP port, and Microsoft-format flag breakdown (reserved, universal/local, group/individual, nonce). Only meaningful for addresses in `2001::/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1010)
- `inspect6to4(): SixToFourProperties` — Decodes the 6to4 tunneling fields embedded in this address. Returns the 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for addresses in `2002::/16`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1073)
- `to6to4(): Address6 | null` — Return a v6 6to4 address from a v6 v4inv6 address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1093)
- `toAddress4Nat64(prefix?: string): Address4 | null` — Extract the embedded IPv4 address from a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. Returns `null` if this address is not contained within the given prefix. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1162)
- `toByteArray(): number[]` — Return a byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1197)
- `toUnsignedByteArray(): number[]` — Return an unsigned byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1216)
- `isCanonical(): boolean` — Returns true if the address is in the canonical form, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1298)
- `isLinkLocal(): boolean` — Returns true if the address is a link-local unicast address in `fe80::/10` ([RFC 4291 §2.4](https://datatracker.ietf.org/doc/html/rfc4291#section-2.4)) or an IPv4-mapped / NAT64 address whose embedded IPv4 address is link-local (`169.254.0.0/16`, e.g. `::ffff:169.254.169.254`), false otherwise. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1309)
- `isMulticast(): boolean` — Returns true if the address is a multicast address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1322)
- `is4(): boolean` — Returns true if the address was written in v4-in-v6 dotted-quad notation (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag and does not reflect whether the address bits lie in the IPv4-mapped (`::ffff:0:0/96`) subnet — for that, see isMapped4. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1339)
- `isMapped4(): boolean` — Returns true if the address is an IPv4-mapped IPv6 address in `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)), false otherwise. Unlike is4, this checks the underlying address bits rather than the textual notation, so `::ffff:127.0.0.1` and `::ffff:7f00:1` both return true. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1351)
- `embeddedIPv4(): Address4 | null` — If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96`, [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052)) — return that embedded address as an Address4; otherwise return null. The special-property checks (`isLoopback`, `isLinkLocal`, `isMulticast`, `isUnspecified`, `isPrivate`, `isCGNAT`, `isBroadcast`) call this first and delegate to the embedded Address4 when present, so a literal such as `::ffff:127.0.0.1` is classified by what it actually reaches (loopback) rather than by its IPv6 wrapper (which `getType()` reports as IPv4-mapped). This matters wherever the checks back a trust-boundary decision (e.g. an SSRF allow/deny filter): without normalization, `::ffff:10.0.0.1`, `::ffff:169.254.169.254`, `64:ff9b::7f00:1`, etc. would all read as non-internal. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1372)
- `isTeredo(): boolean` — Returns true if the address is a Teredo address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1384)
- `is6to4(): boolean` — Returns true if the address is a 6to4 address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1392)
- `isLoopback(): boolean` — Returns true if the address is a loopback address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1400)
- `isULA(): boolean` — Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1413)
- `isPrivate(): boolean` — Returns true if the address is private, i.e. a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)), an address in the NAT64 local-use range `64:ff9b:1::/48` ([RFC 8215](https://datatracker.ietf.org/doc/html/rfc8215)), or an IPv4-mapped / NAT64 well-known address whose embedded IPv4 address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private ranges (e.g. `::ffff:10.0.0.1`). This is the IPv6 counterpart to Address4.isPrivate; use it instead of isULA when you need to catch mapped RFC 1918 addresses as well as native ULAs. The local-use NAT64 range is reported private as a whole rather than by its embedded IPv4 address: an operator may carve a prefix of any RFC 6052 length out of `64:ff9b:1::/48`, so the same bits decode to different IPv4 addresses under different deployments and no single decoding is correct. Use toAddress4Nat64 with the deployment's prefix to decode one. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1435)
- `isCGNAT(): boolean` — Returns true if the address is an IPv4-mapped / NAT64 address whose embedded IPv4 address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)), false otherwise. There is no native IPv6 CGNAT range, so this only ever returns true for an embedded IPv4 address (e.g. `::ffff:100.64.0.1`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1452)
- `isBroadcast(): boolean` — Returns true if the address is an IPv4-mapped / NAT64 address whose embedded IPv4 address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)), false otherwise. There is no IPv6 broadcast, so this only ever returns true for an embedded IPv4 address (e.g. `::ffff:255.255.255.255`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1469)
- `isUnspecified(): boolean` — Returns true if the address is the unspecified address `::`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1482)
- `isDocumentation(): boolean` — Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1495)
- `isBenchmarking(): boolean` — Returns true if the address is in the benchmarking range `2001:2::/48` ([RFC 5180](https://datatracker.ietf.org/doc/html/rfc5180)) or is an IPv4-mapped / NAT64 address whose embedded IPv4 address is in `198.18.0.0/15`, false otherwise. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1506)
- `isGlobal(): boolean` — Returns true if the address is globally reachable: inside the global unicast allocation `2000::/3` (the only range the [IANA IPv6 Address Space Registry](https://www.iana.org/assignments/ipv6-address-space/) assigns for global unicast; everything else is reserved, ULA, link-local, or multicast) and not in any block the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/) marks as not globally reachable. An IPv4-mapped or NAT64 well-known address answers for its embedded IPv4 address, so `::ffff:10.0.0.1` and `64:ff9b::7f00:1` are not global. Teredo (`2001::/32`) and 6to4 (`2002::/16`) are not global either: the registry lists them as N/A and a packet to one needs a relay. This covers everything the individual classifiers name and the blocks they do not: the discard-only prefix `100::/64`, the IETF protocol assignments in `2001::/23`, the deprecated site-local `fec0::/10` and IPv4-compatible `::/96` ranges, and unallocated space such as `4000::/3`. It is the single predicate to use where a request must not reach an internal or special-purpose destination; see SECURITY.md. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1535)
- `href(optionalPort?: string | number): string` — Returns the address as an HTTP URL with the host bracketed, e.g. `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, e.g. `http://[2001:db8::1]:8080/`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1554)
- `link(options?: { className?: string; prefix?: string; v4?: boolean }): string` — Returns an HTML `<a>` element whose `href` encodes the address in a URL hash fragment (default prefix `/#address=`). Useful for linking between pages of an address-inspector UI. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1572)
- `group(): string` — Groups an address. Returns an HTML fragment: each group is wrapped in a `<span>` carrying the group classes an address-inspector UI hovers on. The address content is HTML-escaped; anything you concatenate around it is your responsibility. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1617)
- `regularExpressionString(substringSearch?: boolean): string` — Generate a regular expression string that can be used to find or validate all variations of this address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1669)
- `regularExpression(substringSearch?: boolean): RegExp` — Generate a regular expression that can be used to find or validate all variations of this address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1723)
**Properties**
- `address4: Address4` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L97)
- `address: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L98)
- `addressMinusSuffix: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L99)
- `elidedGroups: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L100)
- `elisionBegin: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L101)
- `elisionEnd: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L102)
- `groups: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L103)
- `parsedAddress4: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L104)
- `parsedAddress: string[]` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L105)
- `parsedSubnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L106)
- `subnet: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L107)
- `subnetMask: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L108)
- `v4: boolean` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L109)
- `zone: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L110)
- `isInSubnet: (address: Address4 | Address6) => boolean` — Returns true if the given address is in the subnet of the current address. An `Address4` is never in the subnet of an `Address6`; convert with `Address6.fromAddress4()` or `to4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1274)
- `isHostInSubnet: (address: Address4 | Address6) => boolean` — Returns true if this address's host bits fall inside the given subnet, ignoring this address's own subnet mask. Prefer this over `isInSubnet` when classifying a single address, so the answer doesn't change with the CIDR suffix the caller happened to write — notably when the address came from untrusted input and the result backs a trust-boundary decision. An `Address4` is never in the subnet of an `Address6`; convert with `Address6.fromAddress4()` or `to4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1286)
- `isCorrect: () => boolean` — Returns true if the address is correct, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1292)
</details>
<details>
<summary><a id="addresserror"></a><strong>AddressError</strong></summary>
**Constructor**
- `new AddressError(message: string, parseMessage?: string): AddressError`
**Properties**
- `parseMessage: string` — The offending address with the portion that failed to parse wrapped in `<span class="parse-error">`, e.g. `2001:db8<span class="parse-error">:::</span>1`. Present only on errors thrown from a parse path that can point at a specific substring. This is an HTML fragment intended for an address-inspector UI. The address content is HTML-escaped, so it is safe to insert as-is; treat it as markup rather than as a plain-text message, and use `message` for anything that renders as text. [src](https://github.com/beaugunderson/ip-address/blob/main/src/address-error.ts#L13)
</details>
<!-- API:END -->
### Security
Vulnerabilities go through [GitHub's private vulnerability reporting](https://github.com/beaugunderson/ip-address/security/advisories/new); [SECURITY.md](./SECURITY.md) has the scope and what to expect. Confirmed issues get a fix, a release, and a public [advisory](https://github.com/beaugunderson/ip-address/security/advisories) with a CVE, rather than a quiet patch.
Releases are built and published by CI through npm trusted publishing. Every version from 10.2.1 onward carries a provenance attestation tying the tarball to the commit and workflow that built it. Check it with `npm audit signatures`.
If you are using the address-property checks as a security control, read [that section of SECURITY.md](./SECURITY.md#classifiers-are-not-an-ssrf-defense) first. `isPrivate()`, `isLoopback()`, `isInSubnet()` and their siblings classify an address that has already been parsed, which makes them one layer of an SSRF guard rather than the whole of it. A hostname that resolves to an internal address, a DNS record that changes after your check, or a redirect will all sail past a guard built only on them. Within that layer, use `isGlobal()` rather than an OR of the named classifiers: it is false for every block the IANA special-purpose registries mark as not globally reachable, including the ones with no classifier of their own.
### Used by
`ip-address` is downloaded ~86 million times per week, mostly via the Node proxy/agent ecosystem. The dependency chain runs through a handful of widely-used packages:
- [**socks**](https://github.com/JoshGlazebrook/socks) (~53M weekly) — SOCKS4/5 client for Node; depends on `ip-address` directly. The single biggest source of downloads.
- [**socks-proxy-agent**](https://github.com/TooTallNate/proxy-agents/tree/main/packages/socks-proxy-agent) (~55M weekly) — `http.Agent` for SOCKS proxies; depends on `socks`. Bundled by virtually every CLI that respects `HTTPS_PROXY`.
- [**npm**](https://github.com/npm/cli) and [**pnpm**](https://github.com/pnpm/pnpm) — both bundle `socks-proxy-agent` through their HTTP fetch stack (`make-fetch-happen` → `@npmcli/agent`), so every Node install on the planet pulls in `ip-address` as a transitive dependency.
- [**Puppeteer**](https://github.com/puppeteer/puppeteer) — `@puppeteer/browsers` uses `proxy-agent` for browser-binary downloads, which routes through `socks-proxy-agent` → `socks` → `ip-address`.
- [**proxy-agent**](https://github.com/TooTallNate/proxy-agents/tree/main/packages/proxy-agent) (~28M weekly) and [**pac-proxy-agent**](https://github.com/TooTallNate/proxy-agents/tree/main/packages/pac-proxy-agent) (~27M weekly) — auto-detecting proxy agents (HTTP/HTTPS/SOCKS/PAC) used widely in scraping, headless-browser, and CI tooling.
- [**cacache**](https://github.com/npm/cacache) (~40M weekly) — npm's content-addressable cache; pulls in the same fetch stack.
Beyond the proxy chain, `ip-address` has been used by Juniper Networks' Contrail, Ably's proxy-protocol implementation, Rackspace's serialization framework, IPFS, and the [SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega) Chrome extension, among many others.
@@ -0,0 +1,403 @@
'use strict';
const utils = require('./utils');
const {
CHAR_ASTERISK, /* * */
CHAR_AT, /* @ */
CHAR_BACKWARD_SLASH, /* \ */
CHAR_COMMA, /* , */
CHAR_DOT, /* . */
CHAR_EXCLAMATION_MARK, /* ! */
CHAR_FORWARD_SLASH, /* / */
CHAR_LEFT_CURLY_BRACE, /* { */
CHAR_LEFT_PARENTHESES, /* ( */
CHAR_LEFT_SQUARE_BRACKET, /* [ */
CHAR_PLUS, /* + */
CHAR_QUESTION_MARK, /* ? */
CHAR_RIGHT_CURLY_BRACE, /* } */
CHAR_RIGHT_PARENTHESES, /* ) */
CHAR_RIGHT_SQUARE_BRACKET /* ] */
} = require('./constants');
const isPathSeparator = code => {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
};
const depth = token => {
if (token.isPrefix !== true) {
token.depth = token.isGlobstar ? Infinity : 1;
}
};
/**
* Quickly scans a glob pattern and returns an object with a handful of
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
*
* ```js
* const pm = require('picomatch');
* console.log(pm.scan('foo/bar/*.js'));
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
* ```
* @param {String} `str`
* @param {Object} `options`
* @return {Object} Returns an object with tokens and regex source string.
* @api public
*/
const scan = (input, options) => {
const opts = options || {};
const length = input.length - 1;
const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
const slashes = [];
const tokens = [];
const parts = [];
let str = input;
let index = -1;
let start = 0;
let lastIndex = 0;
let isBrace = false;
let isBracket = false;
let isGlob = false;
let isExtglob = false;
let isGlobstar = false;
let braceEscaped = false;
let backslashes = false;
let negated = false;
let negatedExtglob = false;
let finished = false;
let braces = 0;
let prev;
let code;
let token = { value: '', depth: 0, isGlob: false };
const eos = () => index >= length;
const peek = () => str.charCodeAt(index + 1);
const advance = () => {
prev = code;
return str.charCodeAt(++index);
};
while (index < length) {
code = advance();
let next;
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
code = advance();
if (code === CHAR_LEFT_CURLY_BRACE) {
braceEscaped = true;
}
continue;
}
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
braces++;
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (code === CHAR_LEFT_CURLY_BRACE) {
braces++;
continue;
}
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (braceEscaped !== true && code === CHAR_COMMA) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_RIGHT_CURLY_BRACE) {
braces--;
if (braces === 0) {
braceEscaped = false;
isBrace = token.isBrace = true;
finished = true;
break;
}
}
}
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_FORWARD_SLASH) {
slashes.push(index);
tokens.push(token);
token = { value: '', depth: 0, isGlob: false };
if (finished === true) continue;
if (prev === CHAR_DOT && index === (start + 1)) {
start += 2;
continue;
}
lastIndex = index + 1;
continue;
}
if (opts.noext !== true) {
const isExtglobChar = code === CHAR_PLUS
|| code === CHAR_AT
|| code === CHAR_ASTERISK
|| code === CHAR_QUESTION_MARK
|| code === CHAR_EXCLAMATION_MARK;
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
isExtglob = token.isExtglob = true;
finished = true;
if (code === CHAR_EXCLAMATION_MARK && index === start) {
negatedExtglob = true;
}
if (scanToEnd === true) {
let parens = 0;
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (code === CHAR_LEFT_PARENTHESES) {
parens++;
continue;
}
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
finished = true;
break;
}
}
continue;
}
break;
}
}
if (code === CHAR_ASTERISK) {
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_QUESTION_MARK) {
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_LEFT_SQUARE_BRACKET) {
while (eos() !== true && (next = advance())) {
if (next === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
isBracket = token.isBracket = true;
isGlob = token.isGlob = true;
finished = true;
break;
}
}
if (scanToEnd === true) {
continue;
}
break;
}
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
negated = token.negated = true;
start++;
continue;
}
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
if (scanToEnd === true) {
let parens = 1;
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (code === CHAR_LEFT_PARENTHESES) {
parens++;
continue;
}
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
finished = true;
break;
}
}
continue;
}
break;
}
if (isGlob === true) {
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
}
if (opts.noext === true) {
isExtglob = false;
isGlob = false;
}
let base = str;
let prefix = '';
let glob = '';
if (start > 0) {
prefix = str.slice(0, start);
str = str.slice(start);
lastIndex -= start;
}
if (base && isGlob === true && lastIndex > 0) {
base = str.slice(0, lastIndex);
glob = str.slice(lastIndex);
} else if (isGlob === true) {
base = '';
glob = str;
} else {
base = str;
}
if (base && base !== '' && base !== '/' && base !== str) {
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
base = base.slice(0, -1);
}
}
if (opts.unescape === true) {
if (glob) glob = utils.removeBackslashes(glob);
if (base && backslashes === true) {
base = utils.removeBackslashes(base);
}
}
const state = {
prefix,
input,
start,
base,
glob,
isBrace,
isBracket,
isGlob,
isExtglob,
isGlobstar,
negated,
negatedExtglob
};
if (opts.tokens === true) {
state.maxDepth = 0;
if (!isPathSeparator(code)) {
tokens.push(token);
}
state.tokens = tokens;
}
if (opts.parts === true || opts.tokens === true) {
let prevIndex;
for (let idx = 0; idx < slashes.length; idx++) {
const n = prevIndex !== undefined ? prevIndex + 1 : start;
const i = slashes[idx];
const value = input.slice(n, i);
if (opts.tokens) {
if (idx === 0 && start !== 0) {
tokens[idx].isPrefix = true;
tokens[idx].value = prefix;
} else {
tokens[idx].value = value;
}
depth(tokens[idx]);
state.maxDepth += tokens[idx].depth;
}
if (i >= start) {
parts.push(value);
prevIndex = i;
}
}
const n = prevIndex !== undefined ? prevIndex + 1 : start;
const value = input.slice(n);
parts.push(value);
if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
tokens[tokens.length - 1].value = value;
depth(tokens[tokens.length - 1]);
state.maxDepth += tokens[tokens.length - 1].depth;
}
state.slashes = slashes;
state.parts = parts;
}
return state;
};
module.exports = scan;
@@ -0,0 +1,10 @@
'use strict';
var bind = require('function-bind');
var $apply = require('./functionApply');
var $call = require('./functionCall');
var $reflectApply = require('./reflectApply');
/** @type {import('./actualApply')} */
module.exports = $reflectApply || bind.call($call, $apply);
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_z"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_nB","2":"_k"},F:{"1":"_a","2":"_T"},G:{"1":"_t","16":"_d"},H:{"2":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"B","2":"A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"PageTransitionEvent",D:true};
@@ -0,0 +1,18 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2021_weakref = void 0;
const base_config_1 = require("./base-config");
const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown");
exports.es2021_weakref = {
libs: [es2015_symbol_wellknown_1.es2015_symbol_wellknown],
variables: [
['WeakRef', base_config_1.TYPE_VALUE],
['WeakRefConstructor', base_config_1.TYPE],
['FinalizationRegistry', base_config_1.TYPE_VALUE],
['FinalizationRegistryConstructor', base_config_1.TYPE],
],
};