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

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

No files matched your search

@@ -0,0 +1,21 @@
const require_src = require('./src-DpAS0jfg.cjs');
const require_cfWorkerProvider = require('./cfWorkerProvider-B3dvjU3F.cjs');
//#region src/shimsWorkerd.ts
/**
* Cloudflare Workers runtime shims for client package
*
* This file is selected via package.json export conditions when running in workerd.
*/
require_src.preloadSchemas();
/**
* Whether `fetch()` may throw `TypeError` due to CORS. CORS is a browser-only concept —
* in Cloudflare Workers, a `TypeError` from `fetch` is always a real network/configuration
* error, never a CORS error.
*/
const CORS_IS_POSSIBLE = false;
//#endregion
exports.CORS_IS_POSSIBLE = CORS_IS_POSSIBLE;
exports.DefaultJsonSchemaValidator = require_cfWorkerProvider.CfWorkerJsonSchemaValidator;
//# sourceMappingURL=shimsWorkerd.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"use-reduced-motion.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion.ts"],"sourcesContent":["\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * <motion.div animate={{\n * opacity: isOpen ? 1 : 0,\n * x: isOpen ? 0 : closedX\n * }} />\n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;;AAEC;;AAEG;AACH;;;;;AAYA;;AAEG;AAEH;AACJ;;"}
@@ -0,0 +1,848 @@
/**
* Utilities for hex, bytes, CSPRNG.
* @module
*/
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
/**
* Bytes API type helpers for old + new TypeScript.
*
* TS 5.6 has `Uint8Array`, while TS 5.9+ made it generic `Uint8Array<ArrayBuffer>`.
* We can't use specific return type, because TS 5.6 will error.
* We can't use generic return type, because most TS 5.9 software will expect specific type.
*
* Maps typed-array input leaves to broad forms.
* These are compatibility adapters, not ownership guarantees.
*
* - `TArg` keeps byte inputs broad.
* - `TRet` marks byte outputs for TS 5.6 and TS 5.9+ compatibility.
*/
export type TypedArg<T> = T extends BigInt64Array
? BigInt64Array
: T extends BigUint64Array
? BigUint64Array
: T extends Float32Array
? Float32Array
: T extends Float64Array
? Float64Array
: T extends Int16Array
? Int16Array
: T extends Int32Array
? Int32Array
: T extends Int8Array
? Int8Array
: T extends Uint16Array
? Uint16Array
: T extends Uint32Array
? Uint32Array
: T extends Uint8ClampedArray
? Uint8ClampedArray
: T extends Uint8Array
? Uint8Array
: never;
/** Maps typed-array output leaves to narrow TS-compatible forms. */
export type TypedRet<T> = T extends BigInt64Array
? ReturnType<typeof BigInt64Array.of>
: T extends BigUint64Array
? ReturnType<typeof BigUint64Array.of>
: T extends Float32Array
? ReturnType<typeof Float32Array.of>
: T extends Float64Array
? ReturnType<typeof Float64Array.of>
: T extends Int16Array
? ReturnType<typeof Int16Array.of>
: T extends Int32Array
? ReturnType<typeof Int32Array.of>
: T extends Int8Array
? ReturnType<typeof Int8Array.of>
: T extends Uint16Array
? ReturnType<typeof Uint16Array.of>
: T extends Uint32Array
? ReturnType<typeof Uint32Array.of>
: T extends Uint8ClampedArray
? ReturnType<typeof Uint8ClampedArray.of>
: T extends Uint8Array
? ReturnType<typeof Uint8Array.of>
: never;
/** Recursively adapts byte-carrying API input types. See {@link TypedArg}. */
export type TArg<T> =
| T
| ([TypedArg<T>] extends [never]
? T extends (...args: infer A) => infer R
? ((...args: { [K in keyof A]: TRet<A[K]> }) => TArg<R>) & {
[K in keyof T]: T[K] extends (...args: any) => any ? T[K] : TArg<T[K]>;
}
: T extends [infer A, ...infer R]
? [TArg<A>, ...{ [K in keyof R]: TArg<R[K]> }]
: T extends readonly [infer A, ...infer R]
? readonly [TArg<A>, ...{ [K in keyof R]: TArg<R[K]> }]
: T extends (infer A)[]
? TArg<A>[]
: T extends readonly (infer A)[]
? readonly TArg<A>[]
: T extends Promise<infer A>
? Promise<TArg<A>>
: T extends object
? { [K in keyof T]: TArg<T[K]> }
: T
: TypedArg<T>);
/** Recursively adapts byte-carrying API output types. See {@link TypedArg}. */
export type TRet<T> = T extends unknown
? T &
([TypedRet<T>] extends [never]
? T extends (...args: infer A) => infer R
? ((...args: { [K in keyof A]: TArg<A[K]> }) => TRet<R>) & {
[K in keyof T]: T[K] extends (...args: any) => any ? T[K] : TRet<T[K]>;
}
: T extends [infer A, ...infer R]
? [TRet<A>, ...{ [K in keyof R]: TRet<R[K]> }]
: T extends readonly [infer A, ...infer R]
? readonly [TRet<A>, ...{ [K in keyof R]: TRet<R[K]> }]
: T extends (infer A)[]
? TRet<A>[]
: T extends readonly (infer A)[]
? readonly TRet<A>[]
: T extends Promise<infer A>
? Promise<TRet<A>>
: T extends object
? { [K in keyof T]: TRet<T[K]> }
: T
: TypedRet<T>)
: never;
/**
* Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.
* @param a - value to test
* @returns `true` when the value is a Uint8Array-compatible view.
* @example
* Check whether a value is a Uint8Array-compatible view.
* ```ts
* isBytes(new Uint8Array([1, 2, 3]));
* ```
*/
export function isBytes(a: unknown): a is Uint8Array {
// Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.
// The fallback still requires a real ArrayBuffer view, so plain
// JSON-deserialized `{ constructor: ... }` spoofing is rejected, and
// `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.
return (
a instanceof Uint8Array ||
(ArrayBuffer.isView(a) &&
a.constructor.name === 'Uint8Array' &&
'BYTES_PER_ELEMENT' in a &&
a.BYTES_PER_ELEMENT === 1)
);
}
/**
* Asserts something is a non-negative integer.
* @param n - number to validate
* @param title - label included in thrown errors
* @throws On wrong argument types. {@link TypeError}
* @throws On wrong argument ranges or values. {@link RangeError}
* @example
* Validate a non-negative integer option.
* ```ts
* anumber(32, 'length');
* ```
*/
export function anumber(n: number, title: string = ''): void {
if (typeof n !== 'number') {
const prefix = title && `"${title}" `;
throw new TypeError(`${prefix}expected number, got ${typeof n}`);
}
if (!Number.isSafeInteger(n) || n < 0) {
const prefix = title && `"${title}" `;
throw new RangeError(`${prefix}expected integer >= 0, got ${n}`);
}
}
/**
* Asserts something is Uint8Array.
* @param value - value to validate
* @param length - optional exact length constraint
* @param title - label included in thrown errors
* @returns The validated byte array.
* @throws On wrong argument types. {@link TypeError}
* @throws On wrong argument ranges or values. {@link RangeError}
* @example
* Validate that a value is a byte array.
* ```ts
* abytes(new Uint8Array([1, 2, 3]));
* ```
*/
export function abytes(
value: TArg<Uint8Array>,
length?: number,
title: string = ''
): TRet<Uint8Array> {
const bytes = isBytes(value);
const len = value?.length;
const needsLen = length !== undefined;
if (!bytes || (needsLen && len !== length)) {
const prefix = title && `"${title}" `;
const ofLen = needsLen ? ` of length ${length}` : '';
const got = bytes ? `length=${len}` : `type=${typeof value}`;
const message = prefix + 'expected Uint8Array' + ofLen + ', got ' + got;
if (!bytes) throw new TypeError(message);
throw new RangeError(message);
}
return value as TRet<Uint8Array>;
}
/**
* Copies bytes into a fresh Uint8Array.
* Buffer-style slices can alias the same backing store, so callers that need ownership should copy.
* @param bytes - source bytes to clone
* @returns Freshly allocated copy of `bytes`.
* @throws On wrong argument types. {@link TypeError}
* @example
* Clone a byte array before mutating it.
* ```ts
* const copy = copyBytes(new Uint8Array([1, 2, 3]));
* ```
*/
export function copyBytes(bytes: TArg<Uint8Array>): TRet<Uint8Array> {
// `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict
// because callers use it at byte-validation boundaries before mutating the detached copy.
return Uint8Array.from(abytes(bytes)) as TRet<Uint8Array>;
}
/**
* Asserts something is a wrapped hash constructor.
* @param h - hash constructor to validate
* @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}
* @throws On invalid hash metadata ranges or values. {@link RangeError}
* @throws If the hash metadata allows empty outputs or block sizes. {@link Error}
* @example
* Validate a callable hash wrapper.
* ```ts
* import { ahash } from '@noble/hashes/utils.js';
* import { sha256 } from '@noble/hashes/sha2.js';
* ahash(sha256);
* ```
*/
export function ahash(h: TArg<CHash>): void {
if (typeof h !== 'function' || typeof h.create !== 'function')
throw new TypeError('Hash must wrapped by utils.createHasher');
anumber(h.outputLen);
anumber(h.blockLen);
// HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass
// validation and can produce empty outputs instead of failing fast.
if (h.outputLen < 1) throw new Error('"outputLen" must be >= 1');
if (h.blockLen < 1) throw new Error('"blockLen" must be >= 1');
}
/**
* Asserts a hash instance has not been destroyed or finished.
* @param instance - hash instance to validate
* @param checkFinished - whether to reject finalized instances
* @throws If the hash instance has already been destroyed or finalized. {@link Error}
* @example
* Validate that a hash instance is still usable.
* ```ts
* import { aexists } from '@noble/hashes/utils.js';
* import { sha256 } from '@noble/hashes/sha2.js';
* const hash = sha256.create();
* aexists(hash);
* ```
*/
export function aexists(instance: any, checkFinished = true): void {
if (instance.destroyed) throw new Error('Hash instance has been destroyed');
if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');
}
/**
* Asserts output is a sufficiently-sized byte array.
* @param out - destination buffer
* @param instance - hash instance providing output length
* Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.
* @throws On wrong argument types. {@link TypeError}
* @throws On wrong argument ranges or values. {@link RangeError}
* @example
* Validate a caller-provided digest buffer.
* ```ts
* import { aoutput } from '@noble/hashes/utils.js';
* import { sha256 } from '@noble/hashes/sha2.js';
* const hash = sha256.create();
* aoutput(new Uint8Array(hash.outputLen), hash);
* ```
*/
export function aoutput(out: any, instance: any): void {
abytes(out, undefined, 'digestInto() output');
const min = instance.outputLen;
if (out.length < min) {
throw new RangeError('"digestInto() output" expected to be of length >=' + min);
}
}
/** Generic type encompassing 8/16/32-byte array views, but not 64-bit variants. */
// prettier-ignore
export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |
Uint16Array | Int16Array | Uint32Array | Int32Array;
/**
* Casts a typed array view to Uint8Array.
* @param arr - source typed array
* @returns Uint8Array view over the same buffer.
* @example
* Reinterpret a typed array as bytes.
* ```ts
* u8(new Uint32Array([1, 2]));
* ```
*/
export function u8(arr: TArg<TypedArray>): TRet<Uint8Array> {
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength) as TRet<Uint8Array>;
}
/**
* Casts a typed array view to Uint32Array.
* `arr.byteOffset` must already be 4-byte aligned or the platform
* Uint32Array constructor will throw.
* @param arr - source typed array
* @returns Uint32Array view over the same buffer.
* @example
* Reinterpret a byte array as 32-bit words.
* ```ts
* u32(new Uint8Array(8));
* ```
*/
export function u32(arr: TArg<TypedArray>): TRet<Uint32Array> {
return new Uint32Array(
arr.buffer,
arr.byteOffset,
Math.floor(arr.byteLength / 4)
) as TRet<Uint32Array>;
}
/**
* Zeroizes typed arrays in place. Warning: JS provides no guarantees.
* @param arrays - arrays to overwrite with zeros
* @example
* Zeroize sensitive buffers in place.
* ```ts
* clean(new Uint8Array([1, 2, 3]));
* ```
*/
export function clean(...arrays: TArg<TypedArray[]>): void {
for (let i = 0; i < arrays.length; i++) {
arrays[i].fill(0);
}
}
/**
* Creates a DataView for byte-level manipulation.
* @param arr - source typed array
* @returns DataView over the same buffer region.
* @example
* Create a DataView over an existing buffer.
* ```ts
* createView(new Uint8Array(4));
* ```
*/
export function createView(arr: TArg<TypedArray>): DataView {
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
}
/**
* Rotate-right operation for uint32 values.
* @param word - source word
* @param shift - shift amount in bits
* @returns Rotated word.
* @example
* Rotate a 32-bit word to the right.
* ```ts
* rotr(0x12345678, 8);
* ```
*/
export function rotr(word: number, shift: number): number {
return (word << (32 - shift)) | (word >>> shift);
}
/**
* Rotate-left operation for uint32 values.
* @param word - source word
* @param shift - shift amount in bits
* @returns Rotated word.
* @example
* Rotate a 32-bit word to the left.
* ```ts
* rotl(0x12345678, 8);
* ```
*/
export function rotl(word: number, shift: number): number {
return (word << shift) | ((word >>> (32 - shift)) >>> 0);
}
/** Whether the current platform is little-endian. */
export const isLE: boolean = /* @__PURE__ */ (() =>
new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();
/**
* Byte-swap operation for uint32 values.
* @param word - source word
* @returns Word with reversed byte order.
* @example
* Reverse the byte order of a 32-bit word.
* ```ts
* byteSwap(0x11223344);
* ```
*/
export function byteSwap(word: number): number {
return (
((word << 24) & 0xff000000) |
((word << 8) & 0xff0000) |
((word >>> 8) & 0xff00) |
((word >>> 24) & 0xff)
);
}
/**
* Conditionally byte-swaps one 32-bit word on big-endian platforms.
* @param n - source word
* @returns Original or byte-swapped word depending on platform endianness.
* @example
* Normalize a 32-bit word for host endianness.
* ```ts
* swap8IfBE(0x11223344);
* ```
*/
export const swap8IfBE: (n: number) => number = isLE
? (n: number) => n
: (n: number) => byteSwap(n) >>> 0;
/**
* Byte-swaps every word of a Uint32Array in place.
* @param arr - array to mutate
* @returns The same array after mutation; callers pass live state arrays here.
* @example
* Reverse the byte order of every word in place.
* ```ts
* byteSwap32(new Uint32Array([0x11223344]));
* ```
*/
export function byteSwap32(arr: TArg<Uint32Array>): TRet<Uint32Array> {
for (let i = 0; i < arr.length; i++) {
arr[i] = byteSwap(arr[i]);
}
return arr as TRet<Uint32Array>;
}
/**
* Conditionally byte-swaps a Uint32Array on big-endian platforms.
* @param u - array to normalize for host endianness
* @returns Original or byte-swapped array depending on platform endianness.
* On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.
* @example
* Normalize a word array for host endianness.
* ```ts
* swap32IfBE(new Uint32Array([0x11223344]));
* ```
*/
export const swap32IfBE: (u: TArg<Uint32Array>) => TRet<Uint32Array> = isLE
? (u: TArg<Uint32Array>) => u as TRet<Uint32Array>
: byteSwap32;
// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex
const hasHexBuiltin: boolean = /* @__PURE__ */ (() =>
// @ts-ignore
typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();
// Array where index 0xf0 (240) is mapped to string 'f0'
const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>
i.toString(16).padStart(2, '0')
);
/**
* Convert byte array to hex string.
* Uses the built-in function when available and assumes it matches the tested
* fallback semantics.
* @param bytes - bytes to encode
* @returns Lowercase hexadecimal string.
* @throws On wrong argument types. {@link TypeError}
* @example
* Convert bytes to lowercase hexadecimal.
* ```ts
* bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'
* ```
*/
export function bytesToHex(bytes: TArg<Uint8Array>): string {
abytes(bytes);
// @ts-ignore
if (hasHexBuiltin) return bytes.toHex();
// pre-caching improves the speed 6x
let hex = '';
for (let i = 0; i < bytes.length; i++) {
hex += hexes[bytes[i]];
}
return hex;
}
// We use optimized technique to convert hex string to byte array
const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;
function asciiToBase16(ch: number): number | undefined {
if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48
if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)
if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)
return;
}
/**
* Convert hex string to byte array. Uses built-in function, when available.
* @param hex - hexadecimal string to decode
* @returns Decoded bytes.
* @throws On wrong argument types. {@link TypeError}
* @throws On wrong argument ranges or values. {@link RangeError}
* @example
* Decode lowercase hexadecimal into bytes.
* ```ts
* hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
* ```
*/
export function hexToBytes(hex: string): TRet<Uint8Array> {
if (typeof hex !== 'string') throw new TypeError('hex string expected, got ' + typeof hex);
if (hasHexBuiltin) {
try {
return (Uint8Array as any).fromHex(hex);
} catch (error) {
if (error instanceof SyntaxError) throw new RangeError(error.message);
throw error;
}
}
const hl = hex.length;
const al = hl / 2;
if (hl % 2) throw new RangeError('hex string expected, got unpadded hex of length ' + hl);
const array = new Uint8Array(al);
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
const n1 = asciiToBase16(hex.charCodeAt(hi));
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
if (n1 === undefined || n2 === undefined) {
const char = hex[hi] + hex[hi + 1];
throw new RangeError(
'hex string expected, got non-hex character "' + char + '" at index ' + hi
);
}
array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163
}
return array;
}
/**
* There is no setImmediate in browser and setTimeout is slow.
* This yields to the Promise/microtask scheduler queue, not to timers or the
* full macrotask event loop.
* @example
* Yield to the next scheduler tick.
* ```ts
* await nextTick();
* ```
*/
export const nextTick = async (): Promise<void> => {};
/**
* Returns control to the Promise/microtask scheduler every `tick`
* milliseconds to avoid blocking long loops.
* @param iters - number of loop iterations to run
* @param tick - maximum time slice in milliseconds
* @param cb - callback executed on each iteration
* @example
* Run a loop that periodically yields back to the event loop.
* ```ts
* await asyncLoop(2, 0, () => {});
* ```
*/
export async function asyncLoop(
iters: number,
tick: number,
cb: (i: number) => void
): Promise<void> {
let ts = Date.now();
for (let i = 0; i < iters; i++) {
cb(i);
// Date.now() is not monotonic, so in case if clock goes backwards we return return control too
const diff = Date.now() - ts;
if (diff >= 0 && diff < tick) continue;
await nextTick();
ts += diff;
}
}
// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535
declare const TextEncoder: any;
/**
* Converts string to bytes using UTF8 encoding.
* Built-in doesn't validate input to be string: we do the check.
* Non-ASCII details are delegated to the platform `TextEncoder`.
* @param str - string to encode
* @returns UTF-8 encoded bytes.
* @throws On wrong argument types. {@link TypeError}
* @example
* Encode a string as UTF-8 bytes.
* ```ts
* utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])
* ```
*/
export function utf8ToBytes(str: string): TRet<Uint8Array> {
if (typeof str !== 'string') throw new TypeError('string expected');
return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809
}
/** KDFs can accept string or Uint8Array for user convenience. */
export type KDFInput = string | Uint8Array;
/**
* Helper for KDFs: consumes Uint8Array or string.
* String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.
* @param data - user-provided KDF input
* @param errorTitle - label included in thrown errors
* @returns Byte representation of the input.
* @throws On wrong argument types. {@link TypeError}
* @example
* Normalize KDF input to bytes.
* ```ts
* kdfInputToBytes('password');
* ```
*/
export function kdfInputToBytes(data: TArg<KDFInput>, errorTitle = ''): TRet<Uint8Array> {
if (typeof data === 'string') return utf8ToBytes(data);
return abytes(data, undefined, errorTitle);
}
/**
* Copies several Uint8Arrays into one.
* @param arrays - arrays to concatenate
* @returns Concatenated byte array.
* @throws On wrong argument types. {@link TypeError}
* @example
* Concatenate multiple byte arrays.
* ```ts
* concatBytes(new Uint8Array([1]), new Uint8Array([2]));
* ```
*/
export function concatBytes(...arrays: TArg<Uint8Array[]>): TRet<Uint8Array> {
let sum = 0;
for (let i = 0; i < arrays.length; i++) {
const a = arrays[i];
abytes(a);
sum += a.length;
}
const res = new Uint8Array(sum);
for (let i = 0, pad = 0; i < arrays.length; i++) {
const a = arrays[i];
res.set(a, pad);
pad += a.length;
}
return res;
}
type EmptyObj = {};
/**
* Merges default options and passed options.
* @param defaults - base option object
* @param opts - user overrides
* @returns Merged option object. The merge mutates `defaults` in place.
* @throws On wrong argument types. {@link TypeError}
* @example
* Merge user overrides onto default options.
* ```ts
* checkOpts({ dkLen: 32 }, { asyncTick: 10 });
* ```
*/
export function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(
defaults: T1,
opts?: T2
): T1 & T2 {
if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')
throw new TypeError('options must be object or undefined');
const merged = Object.assign(defaults, opts);
return merged as T1 & T2;
}
/** Common interface for all hash instances. */
export interface Hash<T> {
/** Bytes processed per compression block. */
blockLen: number;
/** Bytes produced by `digest()`. */
outputLen: number;
/** Whether the instance supports XOF-style variable-length output via `xof()` / `xofInto()`. */
canXOF: boolean;
/**
* Absorbs more message bytes into the running hash state.
* @param buf - message chunk to absorb
* @returns The same hash instance for chaining.
*/
update(buf: TArg<Uint8Array>): this;
/**
* Finalizes the hash into a caller-provided buffer.
* @param buf - destination buffer
* @returns Nothing. Implementations write into `buf` in place.
*/
digestInto(buf: TArg<Uint8Array>): void;
/**
* Finalizes the hash and returns a freshly allocated digest.
* @returns Digest bytes.
*/
digest(): TRet<Uint8Array>;
/** Wipes internal state and makes the instance unusable. */
destroy(): void;
/**
* Copies the current hash state into an existing or new instance.
* @param to - Optional destination instance to reuse.
* @returns Cloned hash state.
*/
_cloneInto(to?: T): T;
/**
* Creates an independent copy of the current hash state.
* @returns Cloned hash instance.
*/
clone(): T;
}
/** Pseudorandom generator interface. */
export interface PRG {
/**
* Mixes more entropy into the generator state.
* @param seed - fresh entropy bytes
* @returns Nothing. Implementations update internal state in place.
*/
addEntropy(seed: TArg<Uint8Array>): void;
/**
* Generates pseudorandom output bytes.
* @param length - number of bytes to generate
* @returns Generated pseudorandom bytes.
*/
randomBytes(length: number): TRet<Uint8Array>;
/** Wipes generator state and makes the instance unusable. */
clean(): void;
}
/**
* XOF: streaming API to read digest in chunks.
* Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.
* When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot
* destroy state, next call can require more bytes.
*/
export type HashXOF<T extends Hash<T>> = Hash<T> & {
/**
* Reads more bytes from the XOF stream.
* @param bytes - number of bytes to read
* @returns Requested digest bytes.
*/
xof(bytes: number): TRet<Uint8Array>;
/**
* Reads more bytes from the XOF stream into a caller-provided buffer.
* @param buf - destination buffer
* @returns Filled output buffer.
*/
xofInto(buf: TArg<Uint8Array>): TRet<Uint8Array>;
};
/** Hash constructor or factory type. */
export type HasherCons<T, Opts = undefined> = Opts extends undefined ? () => T : (opts?: Opts) => T;
/** Optional hash metadata. */
export type HashInfo = {
/** DER-encoded object identifier bytes for the hash algorithm. */
oid?: TRet<Uint8Array>;
};
/** Callable hash function type. */
export type CHash<T extends Hash<T> = Hash<any>, Opts = undefined> = {
/** Digest size in bytes. */
outputLen: number;
/** Input block size in bytes. */
blockLen: number;
/** Whether `.create()` returns a hash instance that can be used as an XOF stream. */
canXOF: boolean;
} & HashInfo &
(Opts extends undefined
? {
(msg: TArg<Uint8Array>): TRet<Uint8Array>;
create(): T;
}
: {
(msg: TArg<Uint8Array>, opts?: TArg<Opts>): TRet<Uint8Array>;
create(opts?: Opts): T;
});
/** Callable extendable-output hash function type. */
export type CHashXOF<T extends HashXOF<T> = HashXOF<any>, Opts = undefined> = CHash<T, Opts>;
/**
* Creates a callable hash function from a stateful class constructor.
* @param hashCons - hash constructor or factory
* @param info - optional metadata such as DER OID
* @returns Frozen callable hash wrapper with `.create()`.
* Wrapper construction eagerly calls `hashCons(undefined)` once to read
* `outputLen` / `blockLen`, so constructor side effects happen at module
* init time.
* @example
* Wrap a stateful hash constructor into a callable helper.
* ```ts
* import { createHasher } from '@noble/hashes/utils.js';
* import { sha256 } from '@noble/hashes/sha2.js';
* const wrapped = createHasher(sha256.create, { oid: sha256.oid });
* wrapped(new Uint8Array([1]));
* ```
*/
export function createHasher<T extends Hash<T>, Opts = undefined>(
hashCons: HasherCons<T, Opts>,
info: TArg<HashInfo> = {}
): TRet<CHash<T, Opts>> {
const hashC: any = (msg: TArg<Uint8Array>, opts?: TArg<Opts>) =>
hashCons(opts as Opts)
.update(msg)
.digest();
const tmp = hashCons(undefined);
hashC.outputLen = tmp.outputLen;
hashC.blockLen = tmp.blockLen;
hashC.canXOF = tmp.canXOF;
hashC.create = (opts?: Opts) => hashCons(opts);
Object.assign(hashC, info);
return Object.freeze(hashC) as TRet<CHash<T, Opts>>;
}
/**
* Cryptographically secure PRNG backed by `crypto.getRandomValues`.
* @param bytesLength - number of random bytes to generate
* @returns Random bytes.
* The platform `getRandomValues()` implementation still defines any
* single-call length cap, and this helper rejects oversize requests
* with a stable library `RangeError` instead of host-specific errors.
* @throws On wrong argument types. {@link TypeError}
* @throws On wrong argument ranges or values. {@link RangeError}
* @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}
* @example
* Generate a fresh random key or nonce.
* ```ts
* const key = randomBytes(16);
* ```
*/
export function randomBytes(bytesLength = 32): TRet<Uint8Array> {
// Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.
anumber(bytesLength, 'bytesLength');
const cr = typeof globalThis === 'object' ? (globalThis as any).crypto : null;
if (typeof cr?.getRandomValues !== 'function')
throw new Error('crypto.getRandomValues must be defined');
// Web Cryptography API Level 2 §10.1.1:
// if `byteLength > 65536`, throw `QuotaExceededError`.
// Keep the guard explicit so callers can see the quota in code
// instead of discovering it by reading the spec or host errors.
// This wrapper surfaces the same quota as a stable library RangeError.
if (bytesLength > 65536)
throw new RangeError(`"bytesLength" expected <= 65536, got ${bytesLength}`);
return cr.getRandomValues(new Uint8Array(bytesLength));
}
/**
* Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.
* @param suffix - final OID byte for the selected hash.
* The helper accepts any byte even though only the documented NIST hash
* suffixes are meaningful downstream.
* @returns Object containing the DER-encoded OID.
* @example
* Build OID metadata for a NIST hash.
* ```ts
* oidNist(0x01);
* ```
*/
export const oidNist = (suffix: number): TRet<Required<HashInfo>> => ({
// Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.
// Larger suffix values would need base-128 OID encoding and a different length byte.
oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),
});
@@ -0,0 +1 @@
{"version":3,"names":["_arrayWithHoles","require","_iterableToArray","_unsupportedIterableToArray","_nonIterableRest","_toArray","arr","arrayWithHoles","iterableToArray","unsupportedIterableToArray","nonIterableRest"],"sources":["../../src/helpers/toArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithHoles from \"./arrayWithHoles.ts\";\nimport iterableToArray from \"./iterableToArray.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableRest is still being converted to TS.\nimport nonIterableRest from \"./nonIterableRest.ts\";\n\nexport default function _toArray<T>(arr: any): T[] {\n return (\n arrayWithHoles<T>(arr) ||\n iterableToArray<T>(arr) ||\n unsupportedIterableToArray<T>(arr) ||\n nonIterableRest()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEe,SAASI,QAAQA,CAAIC,GAAQ,EAAO;EACjD,OACE,IAAAC,uBAAc,EAAID,GAAG,CAAC,IACtB,IAAAE,wBAAe,EAAIF,GAAG,CAAC,IACvB,IAAAG,mCAA0B,EAAIH,GAAG,CAAC,IAClC,IAAAI,wBAAe,EAAC,CAAC;AAErB","ignoreList":[]}
@@ -0,0 +1,17 @@
import { SCHEMES } from "./uri";
import http from "./schemes/http";
SCHEMES[http.scheme] = http;
import https from "./schemes/https";
SCHEMES[https.scheme] = https;
import ws from "./schemes/ws";
SCHEMES[ws.scheme] = ws;
import wss from "./schemes/wss";
SCHEMES[wss.scheme] = wss;
import mailto from "./schemes/mailto";
SCHEMES[mailto.scheme] = mailto;
import urn from "./schemes/urn";
SCHEMES[urn.scheme] = urn;
import uuid from "./schemes/urn-uuid";
SCHEMES[uuid.scheme] = uuid;
export * from "./uri";
//# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PictureInPicture = createLucideIcon("PictureInPicture", [
["path", { d: "M2 10h6V4", key: "zwrco" }],
["path", { d: "m2 4 6 6", key: "ug085t" }],
["path", { d: "M21 10V7a2 2 0 0 0-2-2h-7", key: "git5jr" }],
["path", { d: "M3 14v2a2 2 0 0 0 2 2h3", key: "1f7fh3" }],
["rect", { x: "12", y: "14", width: "10", height: "7", rx: "1", key: "1wjs3o" }]
]);
export { PictureInPicture as default };
//# sourceMappingURL=picture-in-picture.js.map
@@ -0,0 +1 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAkBA,gCAMC;AAmBD,wCAUC;AAiBD,kDAmBC;AAMD,oCAqBC;AAED,8BAYC;AAOD,oDAkBC;AAOD,0CAeC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AAtMD,mDAA+C;AAM/C;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,cAAc,CAA4B,OAA4B;IACpF,0EAA0E;IAC1E,qEAAqE;IACrE,yEAAyE;IACzE,wBAAwB;IACxB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;AAC1D,CAAC;AAYD;;;;GAIG;AACH,SAAgB,mBAAmB,CAEjC,OAA8C;IAE9C,IAAI,IAAI,GAAkC,IAAI,CAAC;IAE/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAEzB,IACE,KAAK,CAAC,SAAS,KAAK,IAAI;YACxB,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACvC,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EACnE,CAAC;YACD,IAAI,GAAG,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,SAAqB,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAC1B,KAAa,EACb,CAAkB,EAClB,IAAY,EACZ,MAAc;IAEd,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,4BAA4B,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,4BAA4B,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAEjC,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,kCAAkC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO,SAAS,aAAa;QAC3B,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,KAAa,EAAE,SAAiB;IACnE,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAE1D,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAC7B,KAAe,EACf,SAAiB,EACjB,MAAuB,EACvB,OAAe;IAEf,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,4BAAY,CAAC,GAAG,MAAM,8BAA8B,SAAS,QAAQ,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC;YACxE,MAAM,IAAI,4BAAY,CAAC,sCAAsC,OAAO,UAAU,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\n/**\n * Returns whether this address's *network* is contained within `address`,\n * i.e. whether every address this one can represent also falls inside\n * `address`. A network wider than `address` is not contained in it, so\n * `10.0.0.0/8` is not in `10.0.0.0/16`.\n *\n * To ask whether the address itself falls inside a range, ignoring any CIDR\n * suffix it was written with, use {@link isHostInSubnet} instead. That is the\n * question the special-use classifiers ask.\n */\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n return isHostInSubnet.call(this, address);\n}\n\n/**\n * Returns whether this address's host bits fall inside `address`, ignoring\n * this address's own subnet mask.\n *\n * This is the primitive the special-use classifiers (`isLoopback`,\n * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a\n * question abLine truncated
@@ -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 Scroll = createLucideIcon("Scroll", [
["path", { d: "M19 17V5a2 2 0 0 0-2-2H4", key: "zz82l3" }],
[
"path",
{
d: "M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",
key: "1ph1d7"
}
]
]);
export { Scroll as default };
//# sourceMappingURL=scroll.js.map
@@ -0,0 +1,13 @@
"use strict";
const normalizeUnit = require("./normalizeUnit-Cn0hUyBC.js");
const parse = require("./parse.js");
const startOf = require("./startOf.js");
function isAfter(date, input, unit) {
unit = normalizeUnit.normalizeUnit(unit);
const inputMs = +parse(input);
if (!unit) {
return +date > inputMs;
}
return +startOf(new Date(date), unit) > inputMs;
}
module.exports = isAfter;
@@ -0,0 +1,9 @@
import { resizeElement } from './handle-element.mjs';
import { resizeWindow } from './handle-window.mjs';
function resize(a, b) {
return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b);
}
export { resize };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,22 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2022" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
@@ -0,0 +1,734 @@
flf2a$ 7 7 20 1 19
os2.flf (FIGlet font)
By Kent Nassen, knassen@umich.edu, 4/30/95.
Looks like some sigs are still good for a few figlet font ideas.
This one's rather simplistic, I guess, but interesting nonetheless.
Thought I'd make a figlet font out of it. Along the "lines" of bright,
relief, and contrast...
--Kent
Font design based on:
____oooo______ooooo________oo____ooooo_____________________________________
__oo____oo___oo___oo______oo___oo____oo___ Peter Kay, IT Institute, _
_oo______oo___oo_________oo__________oo___ Salford University, Salford. _
_oo______oo_____oo______oo__________oo____ Beginner OS/2 WPS programmer _
__oo____oo___oo___oo___oo_________oo______ P.J.Kay@iti.salford.ac.uk _
____oooo______ooooo___oo________oooooo_____________________________________
____@
____@
____@
____@
____@
____@
____@@
oo_@
oo_@
oo_@
oo_@
___@
oo_@
oo_@@
o_o_@
o_o_@
o_o_@
____@
____@
____@
____@@
__o_o___@
__o_o___@
ooo_ooo_@
__o_o___@
ooo_ooo_@
__o_o___@
__o_o___@@
_ooooo__@
oo_o_oo_@
_ooo____@
___oo___@
oo_o_oo_@
_ooooo__@
___o____@@
_o____oo_@
o_o__oo__@
_o__oo___@
___oo____@
__oo__o__@
_oo__o_o_@
oo____o__@@
___oo_____@
__oo_o____@
___oo_____@
_oo_oo____@
oo___oo_o_@
oo___ooo__@
_oooo__oo_@@
_oo_@
_oo_@
oo__@
____@
____@
____@
____@@
___oo_@
_oo___@
oo____@
oo____@
_oo___@
___oo_@
______@@
oo____@
__oo__@
___oo_@
___oo_@
__oo__@
oo____@
______@@
________@
o__o__o_@
_o_o_o__@
__ooo___@
_o_o_o__@
o__o__o_@
________@@
______@
__o___@
__o___@
ooooo_@
__o___@
__o___@
______@@
____@
____@
____@
____@
_oo_@
_oo_@
oo__@@
______@
______@
______@
ooooo_@
______@
______@
______@@
___@
___@
___@
___@
oo_@
oo_@
___@@
______oo_@
_____oo__@
____oo___@
___oo____@
__oo_____@
_oo______@
oo_______@@
___ooo_o__@
_oo___oo__@
oo___o_oo_@
oo__o__oo_@
_ooo__oo__@
__oooo____@
_o________@@
___oo__@
_oooo__@
___oo__@
___oo__@
___oo__@
_ooooo_@
_______@@
__ooooo__@
oo____oo_@
______oo_@
____ooo__@
__ooo____@
oooooooo_@
_________@@
__ooooo__@
oo____oo_@
______oo_@
____ooo__@
oo____oo_@
_oooooo__@
_________@@
_____ooo_@
___oo_oo_@
_oo___oo_@
oooooooo_@
______oo_@
______oo_@
_________@@
ooooooo__@
oo_______@
ooooooo__@
______oo_@
oo____oo_@
_oooooo__@
_________@@
_oooooo__@
oo_______@
ooooooo__@
oo____oo_@
oo____oo_@
_oooooo__@
_________@@
ooooooo_@
_____oo_@
____oo__@
___oo___@
__oo____@
_oo_____@
________@@
_oooooo__@
oo____oo_@
_oooooo__@
oo____oo_@
oo____oo_@
_oooooo__@
_________@@
_oooooo__@
oo____oo_@
oo____oo_@
_ooooooo_@
o_____oo_@
_oooooo__@
_________@@
___@
oo_@
oo_@
___@
oo_@
oo_@
___@@
____@
_oo_@
_oo_@
____@
_oo_@
_oo_@
oo__@@
___oo_@
__oo__@
_oo___@
oo____@
_oo___@
__oo__@
___oo_@@
_______@
_______@
oooooo_@
_______@
oooooo_@
_______@
_______@@
oo____@
_oo___@
__oo__@
___oo_@
__oo__@
_oo___@
oo____@@
_oooo__@
oo__oo_@
____oo_@
__ooo__@
__oo___@
_______@
__oo___@@
____ooooo__@
__oo_oo_oo_@
_oo_o__o_o_@
oo_o__oo_o_@
oo__oo_ooo_@
_oo________@
__oooooo___@@
___ooo____@
_oo___oo__@
oo_____oo_@
ooooooooo_@
oo_____oo_@
oo_____oo_@
__________@@
ooooooo__@
oo____oo_@
oooooooo_@
oo____oo_@
oo____oo_@
ooooooo__@
_________@@
___oooo___@
_oo____oo_@
oo________@
oo________@
_oo____oo_@
___oooo___@
__________@@
oooooo____@
oo____oo__@
oo_____oo_@
oo_____oo_@
oo____oo__@
oooooo____@
__________@@
ooooooo_@
oo______@
oooo____@
oo______@
oo______@
ooooooo_@
________@@
ooooooo_@
oo______@
oooo____@
oo______@
oo______@
oo______@
________@@
___oooo___@
_oo____oo_@
oo________@
oo____ooo_@
_oo____oo_@
___oooo___@
__________@@
oo____oo_@
oo____oo_@
oo____oo_@
oooooooo_@
oo____oo_@
oo____oo_@
_________@@
oooo_@
_oo__@
_oo__@
_oo__@
_oo__@
oooo_@
_____@@
_____ooo_@
______oo_@
______oo_@
oo____oo_@
oo____oo_@
_ooooo___@
_________@@
oo____oo_@
oo___oo__@
oo__oo___@
oooooo___@
oo___oo__@
oo____oo_@
_________@@
oo______@
oo______@
oo______@
oo______@
oo______@
ooooooo_@
________@@
ooo_____ooo_@
oooo___oooo_@
oo_oo_oo_oo_@
oo__ooo__oo_@
oo_______oo_@
oo_______oo_@
____________@@
ooo____oo_@
oooo___oo_@
oo_oo__oo_@
oo__oo_oo_@
oo___oooo_@
oo____ooo_@
__________@@
___oooo____@
_oo____oo__@
oo______oo_@
oo______oo_@
_oo____oo__@
___oooo____@
___________@@
ooooooo__@
oo____oo_@
oo____oo_@
oooooo___@
oo_______@
oo_______@
_________@@
___oooo____@
_oo____oo__@
oo______oo_@
oo___o__oo_@
_oo___ooo__@
___oooo_o__@
_________oo@@
ooooooo___@
oo____oo__@
oo____oo__@
ooooooo___@
oo____oo__@
oo_____oo_@
__________@@
_ooooo__@
oo___oo_@
_oo_____@
___oo___@
oo___oo_@
_ooooo__@
________@@
oooooooo_@
___oo____@
___oo____@
___oo____@
___oo____@
___oo____@
_________@@
oo______oo_@
oo______oo_@
oo______oo_@
oo______oo_@
_oo____oo__@
___oooo____@
___________@@
oo____oo_@
oo____oo_@
oo____oo_@
_oo__oo__@
__oooo___@
___oo____@
_________@@
oo____oo____oo_@
oo____oo____oo_@
oo____oo____oo_@
_oo__oooo__oo__@
__oooo__oooo___@
___oo____oo____@
_______________@@
oo_____oo_@
_oo___oo__@
__oo_oo___@
___ooo____@
__oo_oo___@
_oo___oo__@
__________@@
oo____oo_@
oo____oo_@
_oo__oo__@
___oo____@
___oo____@
___oo____@
_________@@
ooooooo_@
_____oo_@
____oo__@
___o____@
_oo_____@
ooooooo_@
________@@
ooo_@
oo__@
oo__@
oo__@
oo__@
oo__@
ooo_@@
oo______@
_oo_____@
__oo____@
___oo___@
____oo__@
_____oo_@
______oo@@
ooo_@
_oo_@
_oo_@
_oo_@
_oo_@
_oo_@
ooo_@@
__ooo___@
_oo_oo__@
oo___oo_@
________@
________@
________@
________@@
________@
________@
________@
________@
________@
oooooooo@
________@@
oo__@
oo__@
_oo_@
____@
____@
____@
____@@
________@
_ooooo__@
oo___oo_@
oo___oo_@
oo___oo_@
_oooo_o_@
________@@
oo______@
oooooo__@
oo___oo_@
oo___oo_@
oo___oo_@
oooooo__@
________@@
________@
_ooooo__@
oo___oo_@
oo______@
oo______@
_ooooo__@
________@@
_____oo_@
_oooooo_@
oo___oo_@
oo___oo_@
oo___oo_@
_oooooo_@
________@@
________@
_ooooo__@
oo____o_@
ooooooo_@
oo______@
_ooooo__@
________@@
__oooo_@
_oo____@
ooooo__@
oo_____@
oo_____@
oo_____@
_______@@
________@
_oooo___@
oo__oo__@
oo___o__@
_oooooo_@
o____oo_@
_ooooo__@@
oo______@
oo_ooo__@
ooo___o_@
oo____o_@
oo____o_@
oo____o_@
________@@
_oo__@
_____@
_oo__@
_oo__@
_oo__@
oooo_@
_____@@
_____oo_@
________@
_____oo_@
_____oo_@
oo___oo_@
_oo__oo_@
__oooo__@@
oo_____@
oo___o_@
oo__o__@
oooo___@
oo__o__@
oo___o_@
_______@@
ooo___@
_oo___@
_oo___@
_oo___@
_oo___@
ooooo_@
______@@
__________@
oo_oo_oo__@
ooo_oo__o_@
oo__oo__o_@
oo__oo__o_@
oo______o_@
__________@@
________@
oo_ooo__@
ooo___o_@
oo____o_@
oo____o_@
oo____o_@
________@@
________@
_ooooo__@
oo___oo_@
oo___oo_@
oo___oo_@
_ooooo__@
________@@
__________@
___ooooo__@
___o___oo_@
__oo___oo_@
__oo___oo_@
o_ooooo___@
oooo______@@
__________@
_ooooo____@
oo___o____@
oo___oo___@
oo___oo___@
__ooooo_o_@
_____oooo_@@
________@
oo_ooo__@
ooo___o_@
oo______@
oo______@
oo______@
________@@
_______@
_oooo__@
oo___o_@
__oo___@
o___oo_@
_oooo__@
_______@@
_oo____@
_oo____@
oooo___@
_oo____@
_oo__o_@
__ooo__@
_______@@
________@
oo____o_@
oo____o_@
oo____o_@
ooo___o_@
oo_ooo__@
________@@
________@
oo____o_@
oo____o_@
oo___o__@
_oo_o___@
__oo____@
________@@
___________@
oo_______o_@
oo__oo___o_@
oo__oo___o_@
_oo_oo__o__@
__oo__oo___@
___________@@
_______@
o____o_@
_oo_o__@
__oo___@
_o_oo__@
o___oo_@
_______@@
________@
_o___oo_@
_o___oo_@
_o___oo_@
__ooooo_@
o____oo_@
_ooooo__@@
_______@
oooooo_@
_____o_@
___oo__@
_oo____@
oooooo_@
_______@@
___oo_@
_oo___@
_o____@
oo____@
_o____@
_oo___@
___oo_@@
oo_@
oo_@
oo_@
oo_@
oo_@
oo_@
oo_@@
oo____@
__oo__@
___o__@
___oo_@
___o__@
__oo__@
oo____@@
___ooo____@
_oo__oo_o_@
oo____oo__@
__________@
__________@
__________@
__________@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1,4 @@
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"errorMessageClass" | "errorMessageInterface", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,671 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Generated file, do not edit! Run "yarn generate" to re-generate this file.
var _keywords = require('./keywords');
var _types = require('./types');
// prettier-ignore
const READ_WORD_TREE = new Int32Array([
// ""
-1, 27, 783, 918, 1755, 2376, 2862, 3483, -1, 3699, -1, 4617, 4752, 4833, 5130, 5508, 5940, -1, 6480, 6939, 7749, 8181, 8451, 8613, -1, 8829, -1,
// "a"
-1, -1, 54, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, -1, -1, -1, 675, -1, -1, -1,
// "ab"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1,
// "abs"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1,
// "abst"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, -1, -1,
// "abstr"
-1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "abstra"
-1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "abstrac"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1,
// "abstract"
_keywords.ContextualKeyword._abstract << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ac"
-1, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "acc"
-1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "acce"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1,
// "acces"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1,
// "access"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "accesso"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1,
// "accessor"
_keywords.ContextualKeyword._accessor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "as"
_keywords.ContextualKeyword._as << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, 594, -1,
// "ass"
-1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "asse"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1,
// "asser"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, -1,
// "assert"
_keywords.ContextualKeyword._assert << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, -1, -1, -1, -1, -1, -1, -1,
// "asserts"
_keywords.ContextualKeyword._asserts << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "asy"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "asyn"
-1, -1, -1, 648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "async"
_keywords.ContextualKeyword._async << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "aw"
-1, 702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "awa"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "awai"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1,
// "await"
_keywords.ContextualKeyword._await << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "b"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, -1, -1,
// "br"
-1, -1, -1, -1, -1, 837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "bre"
-1, 864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "brea"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "break"
(_types.TokenType._break << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "c"
-1, 945, -1, -1, -1, -1, -1, -1, 1107, -1, -1, -1, 1242, -1, -1, 1350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ca"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 972, 1026, -1, -1, -1, -1, -1, -1,
// "cas"
-1, -1, -1, -1, -1, 999, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "case"
(_types.TokenType._case << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "cat"
-1, -1, -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "catc"
-1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "catch"
(_types.TokenType._catch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ch"
-1, -1, -1, -1, -1, 1134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "che"
-1, -1, -1, 1161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "chec"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "check"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1215, -1, -1, -1, -1, -1, -1, -1,
// "checks"
_keywords.ContextualKeyword._checks << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "cl"
-1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "cla"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1296, -1, -1, -1, -1, -1, -1, -1,
// "clas"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1323, -1, -1, -1, -1, -1, -1, -1,
// "class"
(_types.TokenType._class << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "co"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "con"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, 1620, -1, -1, -1, -1, -1, -1,
// "cons"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1431, -1, -1, -1, -1, -1, -1,
// "const"
(_types.TokenType._const << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1458, -1, -1, -1, -1, -1, -1, -1, -1,
// "constr"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, -1, -1, -1, -1,
// "constru"
-1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "construc"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1539, -1, -1, -1, -1, -1, -1,
// "construct"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "constructo"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, -1, -1, -1, -1, -1, -1, -1, -1,
// "constructor"
_keywords.ContextualKeyword._constructor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "cont"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "conti"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1674, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "contin"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1701, -1, -1, -1, -1, -1,
// "continu"
-1, -1, -1, -1, -1, 1728, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "continue"
(_types.TokenType._continue << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "d"
-1, -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "de"
-1, -1, 1809, 1971, -1, -1, 2106, -1, -1, -1, -1, -1, 2241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "deb"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, -1, -1,
// "debu"
-1, -1, -1, -1, -1, -1, -1, 1863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "debug"
-1, -1, -1, -1, -1, -1, -1, 1890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "debugg"
-1, -1, -1, -1, -1, 1917, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "debugge"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, -1, -1,
// "debugger"
(_types.TokenType._debugger << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "dec"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "decl"
-1, 2025, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "decla"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2052, -1, -1, -1, -1, -1, -1, -1, -1,
// "declar"
-1, -1, -1, -1, -1, 2079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "declare"
_keywords.ContextualKeyword._declare << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "def"
-1, 2133, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "defa"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2160, -1, -1, -1, -1, -1,
// "defau"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "defaul"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, -1, -1, -1, -1,
// "default"
(_types.TokenType._default << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "del"
-1, -1, -1, -1, -1, 2268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "dele"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1,
// "delet"
-1, -1, -1, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "delete"
(_types.TokenType._delete << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "do"
(_types.TokenType._do << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "e"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2403, -1, 2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2565, -1, -1,
// "el"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2430, -1, -1, -1, -1, -1, -1, -1,
// "els"
-1, -1, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "else"
(_types.TokenType._else << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "en"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2511, -1, -1, -1, -1, -1,
// "enu"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "enum"
_keywords.ContextualKeyword._enum << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ex"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, 2727, -1, -1, -1, -1, -1, -1,
// "exp"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2619, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "expo"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2646, -1, -1, -1, -1, -1, -1, -1, -1,
// "expor"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2673, -1, -1, -1, -1, -1, -1,
// "export"
(_types.TokenType._export << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2700, -1, -1, -1, -1, -1, -1, -1,
// "exports"
_keywords.ContextualKeyword._exports << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ext"
-1, -1, -1, -1, -1, 2754, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "exte"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "exten"
-1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "extend"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2835, -1, -1, -1, -1, -1, -1, -1,
// "extends"
(_types.TokenType._extends << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "f"
-1, 2889, -1, -1, -1, -1, -1, -1, -1, 2997, -1, -1, -1, -1, -1, 3159, -1, -1, 3213, -1, -1, 3294, -1, -1, -1, -1, -1,
// "fa"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fal"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2943, -1, -1, -1, -1, -1, -1, -1,
// "fals"
-1, -1, -1, -1, -1, 2970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "false"
(_types.TokenType._false << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fin"
-1, 3051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fina"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "final"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "finall"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1,
// "finally"
(_types.TokenType._finally << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fo"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3186, -1, -1, -1, -1, -1, -1, -1, -1,
// "for"
(_types.TokenType._for << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fr"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fro"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "from"
_keywords.ContextualKeyword._from << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fu"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "fun"
-1, -1, -1, 3348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "func"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3375, -1, -1, -1, -1, -1, -1,
// "funct"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 3402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "functi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "functio"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "function"
(_types.TokenType._function << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "g"
-1, -1, -1, -1, -1, 3510, -1, -1, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ge"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3537, -1, -1, -1, -1, -1, -1,
// "get"
_keywords.ContextualKeyword._get << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "gl"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "glo"
-1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "glob"
-1, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "globa"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "global"
_keywords.ContextualKeyword._global << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "i"
-1, -1, -1, -1, -1, -1, 3726, -1, -1, -1, -1, -1, -1, 3753, 4077, -1, -1, -1, -1, 4590, -1, -1, -1, -1, -1, -1, -1,
// "if"
(_types.TokenType._if << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "im"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "imp"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3807, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "impl"
-1, -1, -1, -1, -1, 3834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "imple"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "implem"
-1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "impleme"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "implemen"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, -1, -1,
// "implement"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3969, -1, -1, -1, -1, -1, -1, -1,
// "implements"
_keywords.ContextualKeyword._implements << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "impo"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, -1, -1, -1, -1, -1,
// "impor"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4050, -1, -1, -1, -1, -1, -1,
// "import"
(_types.TokenType._import << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "in"
(_types.TokenType._in << 1) + 1, -1, -1, -1, -1, -1, 4104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, 4401, -1, -1, -1, -1, -1, -1,
// "inf"
-1, -1, -1, -1, -1, 4131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "infe"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1,
// "infer"
_keywords.ContextualKeyword._infer << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ins"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, -1,
// "inst"
-1, 4239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "insta"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "instan"
-1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "instanc"
-1, -1, -1, -1, -1, 4320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "instance"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "instanceo"
-1, -1, -1, -1, -1, -1, 4374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "instanceof"
(_types.TokenType._instanceof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "int"
-1, -1, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "inte"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4455, -1, -1, -1, -1, -1, -1, -1, -1,
// "inter"
-1, -1, -1, -1, -1, -1, 4482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "interf"
-1, 4509, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "interfa"
-1, -1, -1, 4536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "interfac"
-1, -1, -1, -1, -1, 4563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "interface"
_keywords.ContextualKeyword._interface << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "is"
_keywords.ContextualKeyword._is << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "k"
-1, -1, -1, -1, -1, 4644, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ke"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4671, -1,
// "key"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "keyo"
-1, -1, -1, -1, -1, -1, 4725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "keyof"
_keywords.ContextualKeyword._keyof << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "l"
-1, -1, -1, -1, -1, 4779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "le"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4806, -1, -1, -1, -1, -1, -1,
// "let"
(_types.TokenType._let << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "m"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 4860, -1, -1, -1, -1, -1, 4995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "mi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4887, -1, -1,
// "mix"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 4914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "mixi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "mixin"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1,
// "mixins"
_keywords.ContextualKeyword._mixins << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "mo"
-1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "mod"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, -1, -1, -1,
// "modu"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "modul"
-1, -1, -1, -1, -1, 5103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "module"
_keywords.ContextualKeyword._module << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "n"
-1, 5157, -1, -1, -1, 5373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1,
// "na"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "nam"
-1, -1, -1, -1, -1, 5211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "name"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1,
// "names"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "namesp"
-1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "namespa"
-1, -1, -1, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "namespac"
-1, -1, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "namespace"
_keywords.ContextualKeyword._namespace << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ne"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5400, -1, -1, -1,
// "new"
(_types.TokenType._new << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "nu"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "nul"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "null"
(_types.TokenType._null << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "o"
-1, -1, -1, -1, -1, -1, 5535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5562, -1, -1, -1, -1, 5697, 5751, -1, -1, -1, -1,
// "of"
_keywords.ContextualKeyword._of << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "op"
-1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "opa"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5616, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "opaq"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5643, -1, -1, -1, -1, -1,
// "opaqu"
-1, -1, -1, -1, -1, 5670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "opaque"
_keywords.ContextualKeyword._opaque << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ou"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5724, -1, -1, -1, -1, -1, -1,
// "out"
_keywords.ContextualKeyword._out << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ov"
-1, -1, -1, -1, -1, 5778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ove"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5805, -1, -1, -1, -1, -1, -1, -1, -1,
// "over"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1,
// "overr"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 5859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "overri"
-1, -1, -1, -1, 5886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "overrid"
-1, -1, -1, -1, -1, 5913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "override"
_keywords.ContextualKeyword._override << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "p"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5967, -1, -1, 6345, -1, -1, -1, -1, -1,
// "pr"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, -1, -1, -1, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "pri"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6021, -1, -1, -1, -1,
// "priv"
-1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "priva"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, -1, -1, -1, -1, -1, -1,
// "privat"
-1, -1, -1, -1, -1, 6102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "private"
_keywords.ContextualKeyword._private << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "pro"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6156, -1, -1, -1, -1, -1, -1,
// "prot"
-1, -1, -1, -1, -1, 6183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "prote"
-1, -1, -1, 6210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "protec"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, -1, -1, -1, -1,
// "protect"
-1, -1, -1, -1, -1, 6264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "protecte"
-1, -1, -1, -1, 6291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "protected"
_keywords.ContextualKeyword._protected << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "proto"
_keywords.ContextualKeyword._proto << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "pu"
-1, -1, 6372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "pub"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "publ"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 6426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "publi"
-1, -1, -1, 6453, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "public"
_keywords.ContextualKeyword._public << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "r"
-1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "re"
-1, 6534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6696, -1, -1, 6831, -1, -1, -1, -1, -1, -1,
// "rea"
-1, -1, -1, -1, 6561, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "read"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "reado"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "readon"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "readonl"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6669, -1,
// "readonly"
_keywords.ContextualKeyword._readonly << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "req"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6723, -1, -1, -1, -1, -1,
// "requ"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 6750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "requi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6777, -1, -1, -1, -1, -1, -1, -1, -1,
// "requir"
-1, -1, -1, -1, -1, 6804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "require"
_keywords.ContextualKeyword._require << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ret"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6858, -1, -1, -1, -1, -1,
// "retu"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6885, -1, -1, -1, -1, -1, -1, -1, -1,
// "retur"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "return"
(_types.TokenType._return << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "s"
-1, 6966, -1, -1, -1, 7182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7236, 7371, -1, 7479, -1, 7614, -1,
// "sa"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6993, -1, -1, -1, -1, -1, -1,
// "sat"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "sati"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7047, -1, -1, -1, -1, -1, -1, -1,
// "satis"
-1, -1, -1, -1, -1, -1, 7074, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "satisf"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "satisfi"
-1, -1, -1, -1, -1, 7128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "satisfie"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7155, -1, -1, -1, -1, -1, -1, -1,
// "satisfies"
_keywords.ContextualKeyword._satisfies << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "se"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7209, -1, -1, -1, -1, -1, -1,
// "set"
_keywords.ContextualKeyword._set << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "st"
-1, 7263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "sta"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7290, -1, -1, -1, -1, -1, -1,
// "stat"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "stati"
-1, -1, -1, 7344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "static"
_keywords.ContextualKeyword._static << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "su"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7398, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "sup"
-1, -1, -1, -1, -1, 7425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "supe"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7452, -1, -1, -1, -1, -1, -1, -1, -1,
// "super"
(_types.TokenType._super << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "sw"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7506, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "swi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7533, -1, -1, -1, -1, -1, -1,
// "swit"
-1, -1, -1, 7560, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "switc"
-1, -1, -1, -1, -1, -1, -1, -1, 7587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "switch"
(_types.TokenType._switch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "sy"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "sym"
-1, -1, 7668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "symb"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "symbo"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "symbol"
_keywords.ContextualKeyword._symbol << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "t"
-1, -1, -1, -1, -1, -1, -1, -1, 7776, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7938, -1, -1, -1, -1, -1, -1, 8046, -1,
// "th"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7803, -1, -1, -1, -1, -1, -1, -1, -1, 7857, -1, -1, -1, -1, -1, -1, -1, -1,
// "thi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7830, -1, -1, -1, -1, -1, -1, -1,
// "this"
(_types.TokenType._this << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "thr"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "thro"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7911, -1, -1, -1,
// "throw"
(_types.TokenType._throw << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "tr"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7965, -1, -1, -1, 8019, -1,
// "tru"
-1, -1, -1, -1, -1, 7992, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "true"
(_types.TokenType._true << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "try"
(_types.TokenType._try << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "ty"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "typ"
-1, -1, -1, -1, -1, 8100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "type"
_keywords.ContextualKeyword._type << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "typeo"
-1, -1, -1, -1, -1, -1, 8154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "typeof"
(_types.TokenType._typeof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "u"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8208, -1, -1, -1, -1, 8343, -1, -1, -1, -1, -1, -1, -1,
// "un"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "uni"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8262, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "uniq"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8289, -1, -1, -1, -1, -1,
// "uniqu"
-1, -1, -1, -1, -1, 8316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "unique"
_keywords.ContextualKeyword._unique << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "us"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "usi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "usin"
-1, -1, -1, -1, -1, -1, -1, 8424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "using"
_keywords.ContextualKeyword._using << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "v"
-1, 8478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "va"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8505, -1, -1, -1, -1, -1, -1, -1, -1,
// "var"
(_types.TokenType._var << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "vo"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "voi"
-1, -1, -1, -1, 8586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "void"
(_types.TokenType._void << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "w"
-1, -1, -1, -1, -1, -1, -1, -1, 8640, 8748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "wh"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "whi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "whil"
-1, -1, -1, -1, -1, 8721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "while"
(_types.TokenType._while << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "wi"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8775, -1, -1, -1, -1, -1, -1,
// "wit"
-1, -1, -1, -1, -1, -1, -1, -1, 8802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "with"
(_types.TokenType._with << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "y"
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "yi"
-1, -1, -1, -1, -1, 8883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "yie"
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "yiel"
-1, -1, -1, -1, 8937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
// "yield"
(_types.TokenType._yield << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
]); exports.READ_WORD_TREE = READ_WORD_TREE;
@@ -0,0 +1 @@
{"version":3,"file":"satellite-dish.js","sources":["../../../src/icons/satellite-dish.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SatelliteDish\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAxMGE3LjMxIDcuMzEgMCAwIDAgMTAgMTBaIiAvPgogIDxwYXRoIGQ9Im05IDE1IDMtMyIgLz4KICA8cGF0aCBkPSJNMTcgMTNhNiA2IDAgMCAwLTYtNiIgLz4KICA8cGF0aCBkPSJNMjEgMTNBMTAgMTAgMCAwIDAgMTEgMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/satellite-dish\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 SatelliteDish = createLucideIcon('SatelliteDish', [\n ['path', { d: 'M4 10a7.31 7.31 0 0 0 10 10Z', key: '1fzpp3' }],\n ['path', { d: 'm9 15 3-3', key: '88sc13' }],\n ['path', { d: 'M17 13a6 6 0 0 0-6-6', key: '15cc6u' }],\n ['path', { d: 'M21 13A10 10 0 0 0 11 3', key: '11nf8s' }],\n]);\n\nexport default SatelliteDish;\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,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,214 @@
"use strict";
// Traversal pattern adapted from Jaen's v3 `mapOnSchema` (Apache-2.0): https://gist.github.com/jaens/7e15ae1984bb338c86eb5e452dee3010
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.visit = visit;
const schemas = __importStar(require("./schemas.cjs"));
const util_js_1 = require("./util.cjs");
const RESOLVING = Symbol("z.visit/resolving");
function visit(schema, fnOrHandlers) {
const fn = typeof fnOrHandlers === "function"
? fnOrHandlers
: (node, rewritten) => {
// A union of handlers isn't callable with one argument; handler `K` only ever sees kind `K`.
const h = fnOrHandlers[node._zod.def.type];
return h ? h(node, rewritten) : node;
};
const cache = new Map();
function run(s) {
const cached = cache.get(s);
if (cached === RESOLVING) {
// Non-lazy cycle. Defer to parse time, when the cache holds the finished node.
return new schemas.$ZodLazy({
type: "lazy",
getter: () => cache.get(s),
});
}
if (cached !== undefined)
return cached;
cache.set(s, RESOLVING);
const inner = mapInner(s);
const mapped = fn(inner, inner !== s);
cache.set(s, mapped);
return mapped;
}
function mapInner(s) {
const def = s._zod.def;
const kind = def.type;
switch (kind) {
case "object": {
const oldShape = def.shape;
const keys = Object.keys(oldShape);
let changed = false;
const newShape = {};
for (const k of keys) {
const mapped = run(oldShape[k]);
if (mapped !== oldShape[k])
changed = true;
newShape[k] = mapped;
}
let newCatchall = def.catchall;
if (def.catchall) {
newCatchall = run(def.catchall);
if (newCatchall !== def.catchall)
changed = true;
}
return changed ? (0, util_js_1.clone)(s, { ...def, shape: newShape, catchall: newCatchall }) : s;
}
case "array": {
const mapped = run(def.element);
return mapped === def.element ? s : (0, util_js_1.clone)(s, { ...def, element: mapped });
}
case "tuple": {
const oldItems = def.items;
let changed = false;
const newItems = [];
for (const item of oldItems) {
const mapped = run(item);
if (mapped !== item)
changed = true;
newItems.push(mapped);
}
let newRest = def.rest;
if (def.rest) {
newRest = run(def.rest);
if (newRest !== def.rest)
changed = true;
}
return changed ? (0, util_js_1.clone)(s, { ...def, items: newItems, rest: newRest }) : s;
}
case "record":
case "map": {
const newKey = run(def.keyType);
const newVal = run(def.valueType);
return newKey === def.keyType && newVal === def.valueType
? s
: (0, util_js_1.clone)(s, { ...def, keyType: newKey, valueType: newVal });
}
case "set": {
const newVal = run(def.valueType);
return newVal === def.valueType ? s : (0, util_js_1.clone)(s, { ...def, valueType: newVal });
}
case "union": {
const oldOptions = def.options;
let changed = false;
const newOptions = [];
for (const opt of oldOptions) {
const mapped = run(opt);
if (mapped !== opt)
changed = true;
newOptions.push(mapped);
}
return changed ? (0, util_js_1.clone)(s, { ...def, options: newOptions }) : s;
}
case "intersection": {
const newLeft = run(def.left);
const newRight = run(def.right);
return newLeft === def.left && newRight === def.right
? s
: (0, util_js_1.clone)(s, { ...def, left: newLeft, right: newRight });
}
case "optional":
case "nullable":
case "default":
case "prefault":
case "catch":
case "readonly":
case "nonoptional":
case "promise":
case "success": {
const newInner = run(def.innerType);
return newInner === def.innerType ? s : (0, util_js_1.clone)(s, { ...def, innerType: newInner });
}
case "pipe": {
const newIn = run(def.in);
const newOut = run(def.out);
return newIn === def.in && newOut === def.out ? s : (0, util_js_1.clone)(s, { ...def, in: newIn, out: newOut });
}
case "function": {
const newInput = run(def.input);
const newOutput = run(def.output);
return newInput === def.input && newOutput === def.output
? s
: (0, util_js_1.clone)(s, { ...def, input: newInput, output: newOutput });
}
case "lazy": {
// Invoking the getter here would trip the cycle check, so lazy nodes always re-clone.
const original = def.getter;
// Drop the memo, or it shadows the new getter forever.
const { _cachedInner, ...rest } = def;
return (0, util_js_1.clone)(s, { ...rest, getter: () => run(original()) });
}
// A leaf by choice: `parts` are regex fragments, not data positions.
case "template_literal":
// Leaves.
case "string":
case "number":
case "int":
case "boolean":
case "bigint":
case "symbol":
case "undefined":
case "null":
case "void":
case "never":
case "any":
case "unknown":
case "date":
case "nan":
case "enum":
case "literal":
case "file":
case "transform":
case "custom":
return s;
default: {
// A new built-in kind becomes a compile error here; unknown user kinds fall through.
kind;
return s;
}
}
}
return run(schema);
}
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1,450 @@
// @ts-check
/** @typedef {import('./index').Visitor} Visitor */
/** @typedef {import('./index').VisitorFunction} VisitorFunction */
/**
* Composes multiple visitor objects into a single one.
* @param {(Visitor | VisitorFunction)[]} visitors
* @return {Visitor | VisitorFunction}
*/
function composeVisitors(visitors) {
if (visitors.length === 1) {
return visitors[0];
}
if (visitors.some(v => typeof v === 'function')) {
return (opts) => {
let v = visitors.map(v => typeof v === 'function' ? v(opts) : v);
return composeVisitors(v);
};
}
/** @type Visitor */
let res = {};
composeSimpleVisitors(res, visitors, 'StyleSheet');
composeSimpleVisitors(res, visitors, 'StyleSheetExit');
composeObjectVisitors(res, visitors, 'Rule', ruleVisitor, wrapCustomAndUnknownAtRule);
composeObjectVisitors(res, visitors, 'RuleExit', ruleVisitor, wrapCustomAndUnknownAtRule);
composeObjectVisitors(res, visitors, 'Declaration', declarationVisitor, wrapCustomProperty);
composeObjectVisitors(res, visitors, 'DeclarationExit', declarationVisitor, wrapCustomProperty);
composeSimpleVisitors(res, visitors, 'Url');
composeSimpleVisitors(res, visitors, 'Color');
composeSimpleVisitors(res, visitors, 'Image');
composeSimpleVisitors(res, visitors, 'ImageExit');
composeSimpleVisitors(res, visitors, 'Length');
composeSimpleVisitors(res, visitors, 'Angle');
composeSimpleVisitors(res, visitors, 'Ratio');
composeSimpleVisitors(res, visitors, 'Resolution');
composeSimpleVisitors(res, visitors, 'Time');
composeSimpleVisitors(res, visitors, 'CustomIdent');
composeSimpleVisitors(res, visitors, 'DashedIdent');
composeArrayFunctions(res, visitors, 'MediaQuery');
composeArrayFunctions(res, visitors, 'MediaQueryExit');
composeSimpleVisitors(res, visitors, 'SupportsCondition');
composeSimpleVisitors(res, visitors, 'SupportsConditionExit');
composeArrayFunctions(res, visitors, 'Selector');
composeTokenVisitors(res, visitors, 'Token', 'token', false);
composeTokenVisitors(res, visitors, 'Function', 'function', false);
composeTokenVisitors(res, visitors, 'FunctionExit', 'function', true);
composeTokenVisitors(res, visitors, 'Variable', 'var', false);
composeTokenVisitors(res, visitors, 'VariableExit', 'var', true);
composeTokenVisitors(res, visitors, 'EnvironmentVariable', 'env', false);
composeTokenVisitors(res, visitors, 'EnvironmentVariableExit', 'env', true);
return res;
}
module.exports = composeVisitors;
function wrapCustomAndUnknownAtRule(k, f) {
if (k === 'unknown') {
return (value => f({ type: 'unknown', value }));
}
if (k === 'custom') {
return (value => f({ type: 'custom', value }));
}
return f;
}
function wrapCustomProperty(k, f) {
return k === 'custom' ? (value => f({ property: 'custom', value })) : f;
}
/**
* @param {import('./index').Visitor['Rule']} f
* @param {import('./ast').Rule} item
*/
function ruleVisitor(f, item) {
if (typeof f === 'object') {
if (item.type === 'unknown') {
let v = f.unknown;
if (typeof v === 'object') {
v = v[item.value.name];
}
return v?.(item.value);
}
if (item.type === 'custom') {
let v = f.custom;
if (typeof v === 'object') {
v = v[item.value.name];
}
return v?.(item.value);
}
return f[item.type]?.(item);
}
return f?.(item);
}
/**
* @param {import('./index').Visitor['Declaration']} f
* @param {import('./ast').Declaration} item
*/
function declarationVisitor(f, item) {
if (typeof f === 'object') {
/** @type {string} */
let name = item.property;
if (item.property === 'unparsed') {
name = item.value.propertyId.property;
} else if (item.property === 'custom') {
let v = f.custom;
if (typeof v === 'object') {
v = v[item.value.name];
}
return v?.(item.value);
}
return f[name]?.(item);
}
return f?.(item);
}
/**
*
* @param {Visitor[]} visitors
* @param {string} key
* @returns {[any[], boolean, Set<string>]}
*/
function extractObjectsOrFunctions(visitors, key) {
let values = [];
let hasFunction = false;
let allKeys = new Set();
for (let visitor of visitors) {
let v = visitor[key];
if (v) {
if (typeof v === 'function') {
hasFunction = true;
} else {
for (let key in v) {
allKeys.add(key);
}
}
values.push(v);
}
}
return [values, hasFunction, allKeys];
}
/**
* @template {keyof Visitor} K
* @param {Visitor} res
* @param {Visitor[]} visitors
* @param {K} key
* @param {(visitor: Visitor[K], item: any) => any | any[] | void} apply
* @param {(k: string, f: any) => any} wrapKey
*/
function composeObjectVisitors(res, visitors, key, apply, wrapKey) {
let [values, hasFunction, allKeys] = extractObjectsOrFunctions(visitors, key);
if (values.length === 0) {
return;
}
if (values.length === 1) {
res[key] = values[0];
return;
}
let f = createArrayVisitor(visitors, (visitor, item) => apply(visitor[key], item));
if (hasFunction) {
res[key] = f;
} else {
/** @type {any} */
let v = {};
for (let k of allKeys) {
v[k] = wrapKey(k, f);
}
res[key] = v;
}
}
/**
* @param {Visitor} res
* @param {Visitor[]} visitors
* @param {string} key
* @param {import('./ast').TokenOrValue['type']} type
* @param {boolean} isExit
*/
function composeTokenVisitors(res, visitors, key, type, isExit) {
let [values, hasFunction, allKeys] = extractObjectsOrFunctions(visitors, key);
if (values.length === 0) {
return;
}
if (values.length === 1) {
res[key] = values[0];
return;
}
let f = createTokenVisitor(visitors, type, isExit);
if (hasFunction) {
res[key] = f;
} else {
let v = {};
for (let key of allKeys) {
v[key] = f;
}
res[key] = v;
}
}
/**
* @param {Visitor[]} visitors
* @param {import('./ast').TokenOrValue['type']} type
*/
function createTokenVisitor(visitors, type, isExit) {
let v = createArrayVisitor(visitors, (visitor, /** @type {import('./ast').TokenOrValue} */ item) => {
let f;
switch (item.type) {
case 'token':
f = visitor.Token;
if (typeof f === 'object') {
f = f[item.value.type];
}
break;
case 'function':
f = isExit ? visitor.FunctionExit : visitor.Function;
if (typeof f === 'object') {
f = f[item.value.name];
}
break;
case 'var':
f = isExit ? visitor.VariableExit : visitor.Variable;
break;
case 'env':
f = isExit ? visitor.EnvironmentVariableExit : visitor.EnvironmentVariable;
if (typeof f === 'object') {
let name;
switch (item.value.name.type) {
case 'ua':
case 'unknown':
name = item.value.name.value;
break;
case 'custom':
name = item.value.name.ident;
break;
}
f = f[name];
}
break;
case 'color':
f = visitor.Color;
break;
case 'url':
f = visitor.Url;
break;
case 'length':
f = visitor.Length;
break;
case 'angle':
f = visitor.Angle;
break;
case 'time':
f = visitor.Time;
break;
case 'resolution':
f = visitor.Resolution;
break;
case 'dashed-ident':
f = visitor.DashedIdent;
break;
}
if (!f) {
return;
}
let res = f(item.value);
switch (item.type) {
case 'color':
case 'url':
case 'length':
case 'angle':
case 'time':
case 'resolution':
case 'dashed-ident':
if (Array.isArray(res)) {
res = res.map(value => ({ type: item.type, value }))
} else if (res) {
res = { type: item.type, value: res };
}
break;
}
return res;
});
return value => v({ type, value });
}
/**
* @param {Visitor[]} visitors
* @param {string} key
*/
function extractFunctions(visitors, key) {
let functions = [];
for (let visitor of visitors) {
let f = visitor[key];
if (f) {
functions.push(f);
}
}
return functions;
}
/**
* @param {Visitor} res
* @param {Visitor[]} visitors
* @param {string} key
*/
function composeSimpleVisitors(res, visitors, key) {
let functions = extractFunctions(visitors, key);
if (functions.length === 0) {
return;
}
if (functions.length === 1) {
res[key] = functions[0];
return;
}
res[key] = arg => {
let mutated = false;
for (let f of functions) {
let res = f(arg);
if (res) {
arg = res;
mutated = true;
}
}
return mutated ? arg : undefined;
};
}
/**
* @param {Visitor} res
* @param {Visitor[]} visitors
* @param {string} key
*/
function composeArrayFunctions(res, visitors, key) {
let functions = extractFunctions(visitors, key);
if (functions.length === 0) {
return;
}
if (functions.length === 1) {
res[key] = functions[0];
return;
}
res[key] = createArrayVisitor(functions, (f, item) => f(item));
}
/**
* @template T
* @template V
* @param {T[]} visitors
* @param {(visitor: T, item: V) => V | V[] | void} apply
* @returns {(item: V) => V | V[] | void}
*/
function createArrayVisitor(visitors, apply) {
let seen = new Bitset(visitors.length);
return arg => {
let arr = [arg];
let mutated = false;
seen.clear();
for (let i = 0; i < arr.length; i++) {
// For each value, call all visitors. If a visitor returns a new value,
// we start over, but skip the visitor that generated the value or saw
// it before (to avoid cycles). This way, visitors can be composed in any order.
for (let v = 0; v < visitors.length && i < arr.length;) {
if (seen.get(v)) {
v++;
continue;
}
let item = arr[i];
let visitor = visitors[v];
let res = apply(visitor, item);
if (Array.isArray(res)) {
if (res.length === 0) {
arr.splice(i, 1);
} else if (res.length === 1) {
arr[i] = res[0];
} else {
arr.splice(i, 1, ...res);
}
mutated = true;
seen.set(v);
v = 0;
} else if (res) {
arr[i] = res;
mutated = true;
seen.set(v);
v = 0;
} else {
v++;
}
}
}
if (!mutated) {
return;
}
return arr.length === 1 ? arr[0] : arr;
};
}
class Bitset {
constructor(maxBits = 32) {
this.bits = 0;
this.more = maxBits > 32 ? new Uint32Array(Math.ceil((maxBits - 32) / 32)) : null;
}
/** @param {number} bit */
get(bit) {
if (bit >= 32 && this.more) {
let i = Math.floor((bit - 32) / 32);
let b = bit % 32;
return Boolean(this.more[i] & (1 << b));
} else {
return Boolean(this.bits & (1 << bit));
}
}
/** @param {number} bit */
set(bit) {
if (bit >= 32 && this.more) {
let i = Math.floor((bit - 32) / 32);
let b = bit % 32;
this.more[i] |= 1 << b;
} else {
this.bits |= 1 << bit;
}
}
clear() {
this.bits = 0;
if (this.more) {
this.more.fill(0);
}
}
}
@@ -0,0 +1,450 @@
# Node.js Adapter for Hono
This adapter `@hono/node-server` allows you to run your Hono application on Node.js.
Initially, Hono wasn't designed for Node.js, but with this adapter, you can now use Hono on Node.js. It utilizes web standard APIs implemented in Node.js.
## Benchmarks
Hono is 3.1 times faster than Express.
Express v5:
```txt
$ bombardier -d 10s --fasthttp http://localhost:3000/
Statistics Avg Stdev Max
Reqs/sec 24380.41 1409.74 26604.88
Latency 5.12ms 2.95ms 305.21ms
HTTP codes:
1xx - 0, 2xx - 243915, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput: 6.98MB/s
```
Hono + `@hono/node-server`:
```txt
$ bombardier -d 10s --fasthttp http://localhost:3000/
Statistics Avg Stdev Max
Reqs/sec 74428.96 3815.27 88228.32
Latency 1.68ms 621.25us 106.20ms
HTTP codes:
1xx - 0, 2xx - 744378, 3xx - 0, 4xx - 0, 5xx - 0
others - 0
Throughput: 16.82MB/s
```
## Requirements
It works on Node.js versions greater than 20.x.
## Installation
You can install it from the npm registry:
```sh
npm install @hono/node-server
pnpm add @hono/node-server
```
## Usage
Just import `@hono/node-server` at the top and write the code as usual.
The same code that runs on Cloudflare Workers, Deno, and Bun will work.
```ts
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hono meets Node.js'))
serve(app, (info) => {
console.log(`Listening on http://localhost:${info.port}`) // Listening on http://localhost:3000
})
```
## WebSocket
You can upgrade WebSocket connections with `upgradeWebSocket` from `@hono/node-server`.
To enable this, install `ws` (and `@types/ws`) in your project, then create and provide a `WebSocketServer` as shown in the example below.
```ts
import { serve, upgradeWebSocket } from '@hono/node-server'
import { WebSocketServer } from 'ws'
import { Hono } from 'hono'
const app = new Hono()
app.get(
'/ws',
upgradeWebSocket(() => ({
onMessage(event, ws) {
ws.send(event.data)
},
}))
)
const wss = new WebSocketServer({ noServer: true })
serve({
fetch: app.fetch,
websocket: { server: wss },
})
```
For example, run it using `ts-node`. Then an HTTP server will be launched. The default port is `3000`.
```sh
ts-node ./index.ts
```
Open `http://localhost:3000` with your browser.
## Options
### `port`
```ts
serve({
fetch: app.fetch,
port: 8787, // Port number, default is 3000
})
```
### `createServer`
```ts
import { createServer } from 'node:https'
import fs from 'node:fs'
//...
serve({
fetch: app.fetch,
createServer: createServer,
serverOptions: {
key: fs.readFileSync('test/fixtures/keys/agent1-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent1-cert.pem'),
},
})
```
### `overrideGlobalObjects`
The default value is `true`. The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. If you don't want to do that, set `false`.
```ts
serve({
fetch: app.fetch,
overrideGlobalObjects: false,
})
```
### `autoCleanupIncoming`
The default value is `true`. The Node.js Adapter automatically cleans up (explicitly call `destroy()` method) if application is not finished to consume the incoming request. If you don't want to do that, set `false`.
If the application accepts connections from arbitrary clients, this cleanup must be done otherwise incomplete requests from clients may cause the application to stop responding. If your application only accepts connections from trusted clients, such as in a reverse proxy environment and there is no process that returns a response without reading the body of the POST request all the way through, you can improve performance by setting it to `false`.
```ts
serve({
fetch: app.fetch,
autoCleanupIncoming: false,
})
```
### `websocket`
provide a websocket server to enable websocket support.
```ts
import { serve, upgradeWebSocket } from '@hono/node-server'
import { WebSocketServer } from 'ws'
// ...
const wss = new WebSocketServer({ noServer: true })
serve({
fetch: app.fetch,
websocket: { server: wss },
})
```
## Middleware
Most built-in middleware also works with Node.js.
Read [the documentation](https://hono.dev/middleware/builtin/basic-auth) and use the Middleware of your liking.
```ts
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
import { prettyJSON } from 'hono/pretty-json'
const app = new Hono()
app.get('*', prettyJSON())
app.get('/', (c) => c.json({ 'Hono meets': 'Node.js' }))
serve(app)
```
## Serve Static Middleware
Use Serve Static Middleware that has been created for Node.js.
```ts
import { serveStatic } from '@hono/node-server/serve-static'
//...
app.use('/static/*', serveStatic({ root: './' }))
```
If using a relative path, `root` will be relative to the current working directory from which the app was started.
This can cause confusion when running your application locally.
Imagine your project structure is:
```
my-hono-project/
src/
index.ts
static/
index.html
```
Typically, you would run your app from the project's root directory (`my-hono-project`),
so you would need the following code to serve the `static` folder:
```ts
app.use('/static/*', serveStatic({ root: './static' }))
```
Notice that `root` here is not relative to `src/index.ts`, rather to `my-hono-project`.
Only `GET` and `HEAD` requests are served. Requests with other methods are passed to the next middleware.
### Options
#### `allowPercentInPath`
By default, `serveStatic` skips request paths that still contain `%` after routing. This prevents a second decoding step from serving a file under a different path than the one checked by route middleware. Set `allowPercentInPath: true` to keep the previous behavior when serving files whose names contain percent signs.
If you restrict access to only some paths under `root` (for example, `/static/admin/*`), enabling this option may let requests bypass those restrictions. Apply access control to the same route pattern as `serveStatic` (for example, `/static/*`), before the static middleware:
```ts
app.use('/static/*', authMiddleware)
app.use('/static/*', serveStatic({ root: './static', allowPercentInPath: true }))
```
#### `rewriteRequestPath`
If you want to serve files in `./.foojs` with the request path `/__foo/*`, you can write like the following.
```ts
app.use(
'/__foo/*',
serveStatic({
root: './.foojs/',
rewriteRequestPath: (path: string) => path.replace(/^\/__foo/, ''),
})
)
```
#### `onFound`
You can specify handling when the requested file is found with `onFound`.
```ts
app.use(
'/static/*',
serveStatic({
// ...
onFound: (_path, c) => {
c.header('Cache-Control', `public, immutable, max-age=31536000`)
},
})
)
```
#### `onNotFound`
The `onNotFound` is useful for debugging. You can write a handle for when a file is not found.
```ts
app.use(
'/static/*',
serveStatic({
root: './non-existent-dir',
onNotFound: (path, c) => {
console.log(`${path} is not found, request to ${c.req.path}`)
},
})
)
```
#### `precompressed`
The `precompressed` option checks if files with extensions like `.br` or `.gz` are available and serves them based on the `Accept-Encoding` header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file.
```ts
app.use(
'/static/*',
serveStatic({
precompressed: true,
})
)
```
## ConnInfo Helper
You can use the [ConnInfo Helper](https://hono.dev/docs/helpers/conninfo) by importing `getConnInfo` from `@hono/node-server/conninfo`.
```ts
import { getConnInfo } from '@hono/node-server/conninfo'
app.get('/', (c) => {
const info = getConnInfo(c) // info is `ConnInfo`
return c.text(`Your remote address is ${info.remote.address}`)
})
```
## Accessing Node.js API
You can access the Node.js API from `c.env` in Node.js. For example, if you want to specify a type, you can write the following.
```ts
import { serve } from '@hono/node-server'
import type { HttpBindings } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono<{ Bindings: HttpBindings }>()
app.get('/', (c) => {
return c.json({
remoteAddress: c.env.incoming.socket.remoteAddress,
})
})
serve(app)
```
The APIs that you can get from `c.env` are as follows.
```ts
type HttpBindings = {
incoming: IncomingMessage
outgoing: ServerResponse
}
type Http2Bindings = {
incoming: Http2ServerRequest
outgoing: Http2ServerResponse
}
```
## Early Hints Middleware
You can send HTTP 103 Early Hints to instruct browsers to preload or preconnect resources before the final response is prepared. The middleware is supported under Node.js bindings (HTTP/1.1 and HTTP/2).
### Usage
Import `earlyHints` from `@hono/node-server/early-hints`:
#### Static links
```ts
import { serve } from '@hono/node-server'
import { earlyHints } from '@hono/node-server/early-hints'
import { Hono } from 'hono'
const app = new Hono()
app.use(
earlyHints({
link: '</styles.css>; rel=preload; as=style',
})
)
app.get('/', (c) => {
return c.html('<!DOCTYPE html><html><body><h1>Hello Hono!</h1></body></html>')
})
serve(app)
```
#### Dynamic links
```ts
app.use(
earlyHints({
link: (c) =>
c.req.query('theme') === 'dark'
? '</dark.css>; rel=preload; as=style'
: '</light.css>; rel=preload; as=style',
})
)
```
> [!NOTE]
> Early Hints are sent only for requests that look like document navigations. If `Sec-Fetch-Mode` or `Sec-Fetch-Dest` is present with a value other than `navigate` or `document`, for example a `fetch()` or XHR call from a browser, a subresource request, or an iframe navigation, the middleware skips the hints and continues to the handler. Requests without these headers, such as `curl` or `fetch()` from a JavaScript runtime, are treated as navigations and do receive Early Hints.
## Direct response from Node.js API
You can directly respond to the client from the Node.js API.
In that case, the response from Hono should be ignored, so return `RESPONSE_ALREADY_SENT`.
> [!NOTE]
> This feature can be used when migrating existing Node.js applications to Hono, but we recommend using Hono's API for new applications.
```ts
import { serve } from '@hono/node-server'
import type { HttpBindings } from '@hono/node-server'
import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response'
import { Hono } from 'hono'
const app = new Hono<{ Bindings: HttpBindings }>()
app.get('/', (c) => {
const { outgoing } = c.env
outgoing.writeHead(200, { 'Content-Type': 'text/plain' })
outgoing.end('Hello World\n')
return RESPONSE_ALREADY_SENT
})
serve(app)
```
## Listen to a UNIX domain socket
You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port.
```ts
import { createAdaptorServer } from '@hono/node-server'
// ...
const socketPath = '/tmp/example.sock'
const server = createAdaptorServer(app)
server.listen(socketPath, () => {
console.log(`Listening on ${socketPath}`)
})
```
## Related projects
- Hono - <https://hono.dev>
- Hono GitHub repository - <https://github.com/honojs/hono>
## Authors
- Yusuke Wada <https://github.com/yusukebe>
- Taku Amano <https://github.com/usualoma>
## License
MIT
@@ -0,0 +1,15 @@
import { useCallback } from 'react';
import { rootProjectionNode } from 'motion-dom';
function useResetProjection() {
const reset = useCallback(() => {
const root = rootProjectionNode.current;
if (!root)
return;
root.resetTree();
}, []);
return reset;
}
export { useResetProjection };
//# sourceMappingURL=use-reset-projection.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,18 @@
export declare function parseJson(s: string, pos: number): unknown;
export declare namespace parseJson {
var message: string | undefined;
var position: number;
var code: string;
}
export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined;
export declare namespace parseJsonNumber {
var message: string | undefined;
var position: number;
var code: string;
}
export declare function parseJsonString(s: string, pos: number): string | undefined;
export declare namespace parseJsonString {
var message: string | undefined;
var position: number;
var code: string;
}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Gavel = createLucideIcon("Gavel", [
["path", { d: "m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8", key: "15492f" }],
["path", { d: "m16 16 6-6", key: "vzrcl6" }],
["path", { d: "m8 8 6-6", key: "18bi4p" }],
["path", { d: "m9 7 8 8", key: "5jnvq1" }],
["path", { d: "m21 11-8-8", key: "z4y7zo" }]
]);
export { Gavel as default };
//# sourceMappingURL=gavel.js.map
@@ -0,0 +1 @@
{"version":3,"file":"file-plus-2.js","sources":["../../../src/icons/file-plus-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FilePlus2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNMyAxNWg2IiAvPgogIDxwYXRoIGQ9Ik02IDEydjYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-plus-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FilePlus2 = createLucideIcon('FilePlus2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M3 15h6', key: '4e2qda' }],\n ['path', { d: 'M6 12v6', key: '1u72j0' }],\n]);\n\nexport default FilePlus2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"user-minus-2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/shared/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EACH,2BAA2B,EAE3B,sBAAsB,EACtB,SAAS,EAET,oBAAoB,EACpB,mBAAmB,EAEnB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EAKrB,QAAQ,EACR,iBAAiB,EAGjB,0BAA0B,EAC1B,qBAAqB,EAarB,4BAA4B,EAI5B,4BAA4B,EAC/B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,UAAU,EAAiE,MAAM,qCAAqC,CAAC;AAChI,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAoDxF;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAkNlD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IA8C1B,YAAoB,QAA0B;QAA1B,aAAQ,GAAR,QAAQ,CAAkB;QA5CtC,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAGpB,IAAI,GAAG,EAAE,CAAC;QACN,oCAA+B,GAAoC,IAAI,GAAG,EAAE,CAAC;QAC7E,0BAAqB,GAAsE,IAAI,GAAG,EAAE,CAAC;QACrG,sBAAiB,GAAmE,IAAI,GAAG,EAAE,CAAC;QAC9F,sBAAiB,GAAkC,IAAI,GAAG,EAAE,CAAC;QAC7D,iBAAY,GAA6B,IAAI,GAAG,EAAE,CAAC;QACnD,mCAA8B,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3D,iFAAiF;QACzE,wBAAmB,GAAwB,IAAI,GAAG,EAAE,CAAC;QAKrD,sBAAiB,GAAsE,IAAI,GAAG,EAAE,CAAC;QA2BrG,IAAI,CAAC,sBAAsB,CAAC,2BAA2B,EAAE,YAAY,CAAC,EAAE;YACpE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,sBAAsB,CAAC,0BAA0B,EAAE,YAAY,CAAC,EAAE;YACnE,IAAI,CAAC,WAAW,CAAC,YAA+C,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAClB,iBAAiB;QACjB,6BAA6B;QAC7B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAgB,CAClC,CAAC;QAEF,iDAAiD;QACjD,IAAI,CAAC,UAAU,GAAG,QAAQ,EAAE,SAAS,CAAC;QACtC,IAAI,CAAC,iBAAiB,GAAG,QAAQ,EAAE,gBAAgB,CAAC;QACpD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;gBAClE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;gBACpF,IAAI,CAAC,IAAI,EAAE,CAAC;oBACR,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,yCAAyC,CAAC,CAAC;gBAC3F,CAAC;gBAED,wEAAwE;gBACxE,iDAAiD;gBACjD,oHAAoH;gBACpH,OAAO;oBACH,GAAG,IAAI;iBACK,CAAC;YACrB,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,iBAAiB,CAAC,2BAA2B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;gBACzE,MAAM,gBAAgB,GAAG,KAAK,IAA0B,EAAE;oBACtD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;oBAErC,qGAAqG;oBACrG,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,UAAW,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;wBAC7D,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,mBAAmB,MAAM,EAAE,CAAC,CAAC;oBAC7E,CAAC;oBAED,0BAA0B;oBAC1B,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBACzB,IAAI,aAAwC,CAAC;wBAC7C,OAAO,CAAC,aAAa,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;4BACrF,iFAAiF;4BACjF,IAAI,aAAa,CAAC,IAAI,KAAK,UAAU,IAAI,aAAa,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gCACtE,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;gCACtC,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;gCAE7B,2CAA2C;gCAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAsB,CAAC,CAAC;gCAEpE,IAAI,QAAQ,EAAE,CAAC;oCACX,4CAA4C;oCAC5C,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAsB,CAAC,CAAC;oCAEtD,yCAAyC;oCACzC,IAAI,aAAa,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;wCACpC,QAAQ,CAAC,OAAgC,CAAC,CAAC;oCAC/C,CAAC;yCAAM,CAAC;wCACJ,mCAAmC;wCACnC,MAAM,YAAY,GAAG,OAA+B,CAAC;wCACrD,MAAM,KAAK,GAAG,IAAI,QAAQ,CACtB,YAAY,CAAC,KAAK,CAAC,IAAI,EACvB,YAAY,CAAC,KAAK,CAAC,OAAO,EAC1B,YAAY,CAAC,KAAK,CAAC,IAAI,CAC1B,CAAC;wCACF,QAAQ,CAAC,KAAK,CAAC,CAAC;oCACpB,CAAC;gCACL,CAAC;qCAAM,CAAC;oCACJ,wDAAwD;oCACxD,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;oCAC7E,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,GAAG,WAAW,gCAAgC,SAAS,EAAE,CAAC,CAAC,CAAC;gCACxF,CAAC;gCAED,2BAA2B;gCAC3B,SAAS;4BACb,CAAC;4BAED,0EAA0E;4BAC1E,oFAAoF;4BACpF,MAAM,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,gBAAgB,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;wBAC9F,CAAC;oBACL,CAAC;oBAED,wBAAwB;oBACxB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAW,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;oBACrE,IAAI,CAAC,IAAI,EAAE,CAAC;wBACR,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,mBAAmB,MAAM,EAAE,CAAC,CAAC;oBAC7E,CAAC;oBAED,oFAAoF;oBACpF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;wBAC3B,yCAAyC;wBACzC,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;wBAErE,0EAA0E;wBAC1E,OAAO,MAAM,gBAAgB,EAAE,CAAC;oBACpC,CAAC;oBAED,yCAAyC;oBACzC,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;wBAC1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;wBAE7E,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;wBAE9C,OAAO;4BACH,GAAG,MAAM;4BACT,KAAK,EAAE;gCACH,GAAG,MAAM,CAAC,KAAK;gCACf,CAAC,qBAAqB,CAAC,EAAE;oCACrB,MAAM,EAAE,MAAM;iCACjB;6BACJ;yBACW,CAAC;oBACrB,CAAC;oBAED,OAAO,MAAM,gBAAgB,EAAE,CAAC;gBACpC,CAAC,CAAC;gBAEF,OAAO,MAAM,gBAAgB,EAAE,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;gBACpE,IAAI,CAAC;oBACD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,CAAC,UAAW,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;oBACxG,sHAAsH;oBACtH,OAAO;wBACH,KAAK;wBACL,UAAU;wBACV,KAAK,EAAE,EAAE;qBACG,CAAC;gBACrB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACb,MAAM,IAAI,QAAQ,CACd,SAAS,CAAC,aAAa,EACvB,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAALine truncated
@@ -0,0 +1 @@
{"version":3,"names":["helpers","data","require","_generator","_template","_t","arrayExpression","assignmentExpression","binaryExpression","blockStatement","callExpression","cloneNode","conditionalExpression","exportNamedDeclaration","exportSpecifier","expressionStatement","functionExpression","identifier","memberExpression","objectExpression","program","stringLiteral","unaryExpression","variableDeclaration","variableDeclarator","buildUmdWrapper","replacements","template","statement","buildGlobal","allowlist","namespace","body","container","tree","push","buildHelpers","buildModule","refs","unshift","Object","keys","map","name","buildUmd","FACTORY_PARAMETERS","BROWSER_ARGUMENTS","COMMON_ARGUMENTS","AMD_ARGUMENTS","FACTORY_BODY","UMD_ROOT","buildVar","getHelperReference","list","forEach","includes","ref","nodes","get","ast","exportName","mapExportBindingAssignments","node","_default","outputType","build","global","module","umd","var","Error","generator","code"],"sources":["../../src/tools/build-external-helpers.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport generator from \"@babel/generator\";\nimport template from \"@babel/template\";\nimport {\n arrayExpression,\n assignmentExpression,\n binaryExpression,\n blockStatement,\n callExpression,\n cloneNode,\n conditionalExpression,\n exportNamedDeclaration,\n exportSpecifier,\n expressionStatement,\n functionExpression,\n identifier,\n memberExpression,\n objectExpression,\n program,\n stringLiteral,\n unaryExpression,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Replacements } from \"@babel/template\";\n\n// Wrapped to avoid wasting time parsing this when almost no-one uses\n// build-external-helpers.\nconst buildUmdWrapper = (replacements: Replacements) =>\n template.statement`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(allowlist?: string[]) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n const container = functionExpression(\n null,\n [identifier(\"global\")],\n blockStatement(body),\n );\n const tree = program([\n expressionStatement(\n callExpression(container, [\n // typeof global === \"undefined\" ? self : global\n conditionalExpression(\n binaryExpression(\n \"===\",\n unaryExpression(\"typeof\", identifier(\"global\")),\n stringLiteral(\"undefined\"),\n ),\n identifier(\"self\"),\n identifier(\"global\"),\n ),\n ]),\n ),\n ]);\n\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(\n namespace,\n assignmentExpression(\n \"=\",\n memberExpression(identifier(\"global\"), namespace),\n objectExpression([]),\n ),\n ),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return tree;\n}\n\nfunction buildModule(allowlist?: string[]) {\n const body: t.Statement[] = [];\n const refs = buildHelpers(body, null, allowlist);\n\n body.unshift(\n exportNamedDeclaration(\n null,\n Object.keys(refs).map(name => {\n return exportSpecifier(cloneNode(refs[name]), identifier(name));\n }),\n ),\n );\n\n return program(body, [], \"module\");\n}\n\nfunction buildUmd(allowlist?: string[]) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, identifier(\"global\")),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return program([\n buildUmdWrapper({\n FACTORY_PARAMETERS: identifier(\"global\"),\n BROWSER_ARGUMENTS: assignmentExpression(\n \"=\",\n memberExpression(identifier(\"root\"), namespace),\n objectExpression([]),\n ),\n COMMON_ARGUMENTS: identifier(\"exports\"),\n AMD_ARGUMENTS: arrayExpression([stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: identifier(\"this\"),\n }),\n ]);\n}\n\nfunction buildVar(allowlist?: string[]) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, objectExpression([])),\n ]),\n );\n const tree = program(body);\n buildHelpers(body, namespace, allowlist);\n body.push(expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(\n body: t.Statement[],\n namespace: t.Expression,\n allowlist?: string[],\n): Record<sLine truncated
@@ -0,0 +1,8 @@
//#region src/invariant.ts
function invariant() {
throw new Error("Invariant failed");
}
//#endregion
export { invariant };
//# sourceMappingURL=invariant.js.map
@@ -0,0 +1,10 @@
import { memo } from 'motion-utils';
import { supportsFlags } from './flags.mjs';
function memoSupports(callback, supportsFlag) {
const memoized = memo(callback);
return () => supportsFlags[supportsFlag] ?? memoized();
}
export { memoSupports };
//# sourceMappingURL=memo.mjs.map
@@ -0,0 +1,538 @@
# Client
<!--introduced_in=v1.0.0-->
<!--type=module-->
<!-- source_link=lib/dispatcher/client.js -->
> Stability: 2 - Stable
A basic HTTP/1.1 client mapped on top of a single TCP/TLS connection. When the
server supports HTTP/2 and selects it during ALPN negotiation, the same
connection is used for HTTP/2. Pipelining is disabled by default.
`Client` extends [`Dispatcher`][] and is the lowest-level dispatcher in undici:
it manages exactly one origin over one connection. For pooling across multiple
connections use [`Pool`][], and for routing across multiple origins use
[`Agent`][]. Requests are not guaranteed to be dispatched in the order in which
they are invoked.
```mjs
import { Client } from 'undici'
const client = new Client('http://localhost:3000')
const { statusCode, body } = await client.request({ path: '/', method: 'GET' })
```
## Class: `Client`
<!-- YAML
added: v1.0.0
-->
* Extends: {Dispatcher}
### `new Client(url[, options])`
<!-- YAML
added: v1.0.0
-->
* `url` {URL|string} The origin to connect to. Only the protocol, hostname, and
port are used.
* `options` {Object} (optional)
* `bodyTimeout` {number|null} The timeout, in milliseconds, after which a
request times out while receiving body data. Monitors the time between
consecutive body chunks. Use `0` to disable it entirely. **Default:**
`300e3`.
* `headersTimeout` {number|null} The timeout, in milliseconds, the parser
waits to receive the complete HTTP headers before the request times out. Use
`0` to disable it entirely. **Default:** `300e3`.
HTTP/1.1 headers/body parser timeouts are not guaranteed to fire with exact
millisecond precision: delays up to 1000ms use native timers, while larger
delays use undici's lower-overhead fast timers with a target resolution
around 500ms.
* `connectTimeout` {number|null} The timeout, in milliseconds, for
establishing a socket connection. Use `0` to disable it entirely.
**Default:** `10e3`.
* `keepAliveTimeout` {number|null} The timeout, in milliseconds, after which a
socket with no active requests times out. Monitors the time between activity
on a connected socket. This value may be overridden by *keep-alive* hints
from the server. **Default:** `4e3`.
* `keepAliveMaxTimeout` {number|null} The maximum allowed `keepAliveTimeout`,
in milliseconds, when overridden by *keep-alive* hints from the server.
**Default:** `600e3`.
* `keepAliveTimeoutThreshold` {number|null} A number of milliseconds
subtracted from server *keep-alive* hints when overriding `keepAliveTimeout`,
to account for timing inaccuracies caused by e.g. transport latency.
**Default:** `2e3`.
* `maxHeaderSize` {number|null} The maximum length of request headers, in
bytes. **Default:** the value of Node.js' `--max-http-header-size` or
`16384` (16 KiB).
* `maxResponseSize` {number|null} The maximum length of a response body, in
bytes. Set to `-1` to disable it. **Default:** `-1`.
* `maxRequestsPerClient` {number|null} The maximum number of requests to send
over a single connection before the socket is reset. Use `0` to disable this
limit. **Default:** `null`.
* `localAddress` {string|null} The local IP address the socket should connect
from. **Default:** `null`.
* `pipelining` {number|null} The number of concurrent requests sent over the
single connection, per [RFC 7230, section 6.3.2][]. Only enable values
greater than `1` when the remote server is trusted. Set to `0` to disable
keep-alive connections. Has no effect once HTTP/2 is negotiated; see
`maxConcurrentStreams` for the HTTP/2 dispatch ceiling. **Default:** `1`.
* `connect` {Object|Function|null} Configures how connections are established.
Either a `ConnectOptions` object passed to the built-in
[`buildConnector`][] (every [`tls.connect()`][] option is accepted, plus the
fields below), or a custom connector function with the signature
`(options, callback)`. **Default:** `null`.
* `socketPath` {string|null} An IPC endpoint, either a Unix domain socket or
a Windows named pipe. **Default:** `null`.
* `maxCachedSessions` {number|null} The maximum number of cached TLS
sessions. Use `0` to disable TLS session caching. **Default:** `100`.
* `timeout` {number|null} The connection timeout, in milliseconds.
**Default:** `10e3`.
* `servername` {string|null} The TLS server name used for SNI.
* `keepAlive` {boolean|null} Whether TCP keep-alive is enabled on the socket.
**Default:** `true`.
* `keepAliveInitialDelay` {number|null} The TCP keep-alive interval for the
socket, in milliseconds. **Default:** `60000`.
* `strictContentLength` {boolean} Whether to throw when the request
`content-length` header does not match the length of the request body.
Disabling this exposes the application to HTTP request smuggling; only do so
in controlled environments where the request source is fully trusted.
**Default:** `true`.
* `autoSelectFamily` {boolean} Enables a family autodetection algorithm that
loosely implements section 5 of [RFC 8305][]. Ignored if unsupported by the
current Node.js version. **Default:** `false`.
* `autoSelectFamilyAttemptTimeout` {number} The time, in milliseconds, to wait
for a connection attempt to finish before trying the next address when
`autoSelectFamily` is enabled. **Default:** `250`.
* `allowH2` {boolean} Enables HTTP/2 support when the server assigns it a
higher priority through ALPN negotiation. **Default:** `true`.
* `useH2c` {boolean} _Deprecated: use h2Options.useH2c instead_ Enforces h2c (HTTP/2 cleartext) for non-HTTPS
connections. **Default:** `false`.
* `maxConcurrentStreams` {number} _Deprecated: use h2Options.useH2c instead_ The maximum number of concurrent HTTP/2
streams for a single session. Once h2 is negotiated this — not `pipelining`,
which is HTTP/1.1 only — is the ceiling used to dispatch in-flight requests.
The server's `SETTINGS_MAX_CONCURRENT_STREAMS` can lower this limit, but
not raise it. **Default:** `100`.
* `connectionWindowSize` {number} _Deprecated: use h2Options.connectionWindowSize instead_ The HTTP/2 connection-level flow-control
window size set via `ClientHttp2Session.setLocalWindowSize()`. Must be a
positive integer. **Default:** `524288`.
* `pingInterval` {number} _Deprecated: use h2Options.pingInterval instead_ The time interval, in milliseconds, between HTTP/2
PING frames. Set to `0` to disable PING frames. Applies only to HTTP/2
connections and emits a `ping` event on the client. **Default:** `60e3`.
* `h2Options` {object} Set of options for HTTP/2 sessions
* `useH2c` {boolean} Enforces h2c (HTTP/2 cleartext) for non-HTTPS
connections. **Default:** `false`.
* `maxConcurrentStreams` {number} The maximum number of concurrent HTTP/2
streams for a single session. Once h2 is negotiated this — not `pipelining`,
which is HTTP/1.1 only — is the ceiling used to dispatch in-flight requests.
The server's `SETTINGS_MAX_CONCURRENT_STREAMS` can lower this limit, but
not raise it. **Default:** `100`.
* `connectionWindowSize` {number} The HTTP/2 connection-level flow-control
window size set via `ClientHttp2Session.setLocalWindowSize()`. Must be a
positive integer. **Default:** `524288`.
* `pingInterval` {number} The time interval, in milliseconds, between HTTP/2
PING frames. Set to `0` to disable PING frames. Applies only to HTTP/2
connections and emits a `ping` event on the client. **Default:** `60e3`.
* `settings` {object} `SETTINGS` frame options. For full reference, take a
look to [HTTP/2#Settings Object](https://nodejs.org/api/http2.html#settings-object)
* `webSocket` {Object} (optional) WebSocket-specific configuration.
* `maxFragments` {number} The maximum number of fragments in a message. Set
to `0` to disable the limit. **Default:** `131072`.
* `maxPayloadSize` {number} The maximum allowed payload size, in bytes, for
WebSocket messages. Applied to uncompressed messages, compressed frame
payloads, and decompressed (`permessage-deflate`) messages. Set to `0` to
disable the limit. **Default:** `134217728`.
* `eventSource` {Object} (optional) EventSource-specific configuration.
* `maxEventSize` {number} The maximum total bytes of data and metadata
field values retained for a pending EventSource event. Each unfinished
line is separately limited to this value plus seven syntax bytes, before
its line ending arrives. The number of `data:` lines per event and input
chunks buffered for an unfinished line are each limited to
`min(131072, max(1024, floor(maxEventSize / 128)))` to bound object overhead.
Set to `0` to disable these limits.
**Default:** `buffer.kStringMaxLength`.
* Returns: {Client}
Instantiating a `Client` does not open a connection; the connection is
established lazily once a request is queued. Call `client.connect()` to connect
eagerly.
> Notes about HTTP/2:
>
> * Pseudo headers (`:path`, `:method`, `:scheme`, `:authority`) are attached
> automatically and overwrite any user-provided values.
> * The server must support HTTP/2 and select it during ALPN negotiation, and
> must not give HTTP/1.1 a higher priority than HTTP/2.
> * `PUSH` frames are not supported.
```mjs displayName="Basic instantiation"
import { Client } from 'undici'
const client = new Client('http://localhost:3000')
```
```mjs displayName="TLS options (object connector)"
import { Client } from 'undici'
import { readFileSync } from 'node:fs'
const client = new Client('https://localhost:3000', {
connect: {
rejectUnauthorized: false,
ca: readFileSync('./ca-cert.pem')
}
})
```
```mjs displayName="Unix domain socket"
import { Client } from 'undici'
const client = new Client('http://localhost:3000', {
connect: {
socketPath: '/var/run/docker.sock'
}
})
```
```mjs displayName="Custom DNS lookup"
import { Client } from 'undici'
import dns from 'node:dns'
const client = new Client('https://example.com', {
connect: {
lookup (hostname, options, callback) {
dns.lookup(hostname, { ...options, family: 4 }, callback)
}
}
})
```
```mjs displayName="Custom connector (function)"
import { Client, buildConnector } from 'undici'
const connector = buildConnector({ rejectUnauthorized: false })
const client = new Client('https://localhost:3000', {
connect (opts, cb) {
connector(opts, (err, socket) => {
if (err) {
cb(err)
} else {
cb(null, socket)
}
})
}
})
```
When a connector function is provided, undici wraps it to automatically inject
`socketPath` and `allowH2` into the `options` argument when those values are set
on the client. See [`Connector`][] for details on building custom connectors.
### `client.close([callback])`
<!-- YAML
added: v1.0.0
-->
Implements [`dispatcher.close([callback])`][]. Closes the client gracefully,
waiting for enqueued requests to complete before resolving.
### `client.destroy([error[, callback]])`
<!-- YAML
added: v1.0.0
-->
Implements [`dispatcher.destroy([error[, callback]])`][]. Destroys the client
abruptly, aborting all pending and running requests, and waits until the socket
is closed before invoking `callback` (or resolving the returned promise).
### `client.connect(options[, callback])`
<!-- YAML
added: v1.0.0
-->
* `options` {Object} The connect options, identical to
[`dispatcher.connect()`][] except that `origin` is omitted because the client
is bound to a single origin.
* `callback` {Function} (optional)
* Returns: {Promise|void} A promise when `callback` is not provided.
Starts a connection to the client's origin and tunnels a connection through it,
as defined by [`dispatcher.connect()`][].
### `client.dispatch(options, handlers)`
<!-- YAML
added: v1.0.0
-->
Implements [`dispatcher.dispatch(options, handler)`][]. This is the lowest-level
API used by all other request methods; prefer `client.request()` for most use
cases.
### `client.pipeline(options, handler)`
<!-- YAML
added: v1.0.0
-->
See [`dispatcher.pipeline(options, handler)`][]. Sends a request and returns a
{Duplex} stream that the request body is written to and the response body is
read from.
### `client.request(options[, callback])`
<!-- YAML
added: v1.0.0
-->
* `options` {Object}
* `callback` {Function} (optional)
* Returns: {Promise|void} A promise resolving to the response data when
`callback` is not provided.
See [`dispatcher.request(options[, callback])`][]. Performs an HTTP request and
returns its status code, headers, trailers, and a readable body stream.
```mjs
import { Client } from 'undici'
const client = new Client('http://localhost:3000')
const { statusCode, headers, body } = await client.request({
path: '/',
method: 'GET'
})
console.log(statusCode)
for await (const chunk of body) {
console.log(chunk.toString())
}
```
### `client.stream(options, factory[, callback])`
<!-- YAML
added: v1.0.0
-->
* `options` {Object}
* `factory` {Function} Returns a {Writable} the response body is piped into.
* `callback` {Function} (optional)
* Returns: {Promise|void} A promise when `callback` is not provided.
See [`dispatcher.stream(options, factory[, callback])`][]. A faster alternative
to `client.request()` when the destination of the response body is known in
advance.
### `client.upgrade(options[, callback])`
<!-- YAML
added: v1.0.0
-->
* `options` {Object}
* `callback` {Function} (optional)
* Returns: {Promise|void} A promise when `callback` is not provided.
See [`dispatcher.upgrade(options[, callback])`][]. Upgrades a connection to a
different protocol, such as for WebSocket or HTTP `CONNECT`.
### `client.closed`
<!-- YAML
added: v1.0.0
-->
* Type: {boolean}
`true` after `client.close()` has been called.
### `client.destroyed`
<!-- YAML
added: v1.0.0
-->
* Type: {boolean}
`true` after `client.destroy()` has been called, or after `client.close()` has
been called and the client shutdown has completed.
### `client.pipelining`
<!-- YAML
added: v1.0.0
-->
* Type: {number}
The pipelining factor. This property can be read and written to adjust the
number of concurrent requests sent over the connection. Only enable pipelining
with trusted remote servers.
### `client.stats`
<!-- YAML
added: v7.9.0
-->
* Type: {ClientStats}
Aggregate statistics for the client. See [`ClientStats`][].
### Event: `'connect'`
<!-- YAML
added: v1.0.0
-->
* `origin` {URL}
* `targets` {Array<Dispatcher>}
Emitted when a socket has been created and connected. The client connects once
`client.size > 0`. See [`Dispatcher` Event: `'connect'`][].
```mjs
import { createServer } from 'node:http'
import { Client } from 'undici'
import { once } from 'node:events'
const server = createServer((request, response) => {
response.end('Hello, World!')
}).listen()
await once(server, 'listening')
const client = new Client(`http://localhost:${server.address().port}`)
client.on('connect', (origin) => {
console.log(`Connected to ${origin}`)
})
const { body } = await client.request({ path: '/', method: 'GET' })
body.setEncoding('utf8')
body.on('data', console.log)
client.close()
server.close()
```
### Event: `'disconnect'`
<!-- YAML
added: v1.0.0
changes:
- version: v4.0.0
pr-url: https://github.com/nodejs/undici/pull/771
description: The event is only emitted if the client had previously
connected.
-->
* `origin` {URL}
* `targets` {Array<Dispatcher>}
* `error` {Error}
Emitted when a socket has disconnected. The `error` argument is the error that
caused the disconnection. The client reconnects if or once `client.size > 0`.
See [`Dispatcher` Event: `'disconnect'`][].
```mjs
import { createServer } from 'node:http'
import { Client } from 'undici'
import { once } from 'node:events'
const server = createServer((request, response) => {
response.destroy()
}).listen()
await once(server, 'listening')
const client = new Client(`http://localhost:${server.address().port}`)
client.on('disconnect', (origin) => {
console.log(`Disconnected from ${origin}`)
})
try {
await client.request({ path: '/', method: 'GET' })
} catch (error) {
console.error(error.message)
} finally {
client.close()
server.close()
}
```
### Event: `'drain'`
<!-- YAML
added: v1.0.0
-->
* `origin` {URL}
Emitted when the pipeline is no longer busy. See
[`Dispatcher` Event: `'drain'`][].
```mjs
import { createServer } from 'node:http'
import { Client } from 'undici'
import { once } from 'node:events'
const server = createServer((request, response) => {
response.end('Hello, World!')
}).listen()
await once(server, 'listening')
const client = new Client(`http://localhost:${server.address().port}`)
client.on('drain', () => {
console.log('drain event')
client.close()
server.close()
})
await Promise.all([
client.request({ path: '/', method: 'GET' }),
client.request({ path: '/', method: 'GET' }),
client.request({ path: '/', method: 'GET' })
])
```
### Event: `'error'`
<!-- YAML
added: v1.0.0
-->
* `error` {Error}
Emitted for user errors, such as throwing inside an `onResponseError` handler.
[RFC 7230, section 6.3.2]: https://tools.ietf.org/html/rfc7230#section-6.3.2
[RFC 8305]: https://tools.ietf.org/html/rfc8305#section-5
[`Agent`]: Agent.md#class-agent
[`ClientStats`]: ClientStats.md
[`Connector`]: Connector.md
[`Dispatcher` Event: `'connect'`]: Dispatcher.md#event-connect
[`Dispatcher` Event: `'disconnect'`]: Dispatcher.md#event-disconnect
[`Dispatcher` Event: `'drain'`]: Dispatcher.md#event-drain
[`Dispatcher`]: Dispatcher.md#class-dispatcher
[`Pool`]: Pool.md#class-pool
[`buildConnector`]: Connector.md
[`dispatcher.close([callback])`]: Dispatcher.md#dispatcherclosecallback
[`dispatcher.connect()`]: Dispatcher.md#dispatcherconnectoptions-callback
[`dispatcher.destroy([error[, callback]])`]: Dispatcher.md#dispatcherdestroyerror-callback
[`dispatcher.dispatch(options, handler)`]: Dispatcher.md#dispatcherdispatchoptions-handler
[`dispatcher.pipeline(options, handler)`]: Dispatcher.md#dispatcherpipelineoptions-handler
[`dispatcher.request(options[, callback])`]: Dispatcher.md#dispatcherrequestoptions-callback
[`dispatcher.stream(options, factory[, callback])`]: Dispatcher.md#dispatcherstreamoptions-factory-callback
[`dispatcher.upgrade(options[, callback])`]: Dispatcher.md#dispatcherupgradeoptions-callback
[`tls.connect()`]: https://nodejs.org/api/tls.html#tlsconnectoptions-callback
@@ -0,0 +1,9 @@
/**
* @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.
*/
export { default } from './folder-cog.js';
//# sourceMappingURL=folder-cog-2.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../src/motion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType<React.PropsWithChildren<unknown>>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps<Props> = {\n [K in Exclude<keyof Props, keyof MotionProps>]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent<T, P> = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit<MotionComponentProps<P>, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps<P>[\"children\"]\n : MotionComponentProps<P>[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType<Props>,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement<Props, TagName>\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps<Props>,\n externalRef?: React.Ref<HTMLElement | SVGElement>\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType<MotionProps>\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic } = configAndProps\n\n const context = useCreateMotionContext<HTMLElement | SVGElement>(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n Line truncated
@@ -0,0 +1,82 @@
'use strict'
// We include a version number for the Dispatcher API. In case of breaking changes,
// this version number must be increased to avoid conflicts.
const globalDispatcher = Symbol.for('undici.globalDispatcher.2')
const legacyGlobalDispatcher = Symbol.for('undici.globalDispatcher.1')
const { InvalidArgumentError } = require('./core/errors')
const Agent = require('./dispatcher/agent')
const Dispatcher1Wrapper = require('./dispatcher/dispatcher1-wrapper')
// Fallback storage for when globalThis is not extensible (e.g. frozen)
let fallbackDispatcher
if (getGlobalDispatcher() === undefined) {
setGlobalDispatcher(new Agent())
}
function setGlobalDispatcher (agent) {
if (!agent || typeof agent.dispatch !== 'function') {
throw new InvalidArgumentError('Argument agent must implement Agent')
}
try {
Object.defineProperty(globalThis, globalDispatcher, {
value: agent,
writable: true,
enumerable: false,
configurable: false
})
} catch (err) {
// globalThis is not extensible (e.g. Object.freeze(globalThis))
// Use fallback storage instead
if (err instanceof TypeError) {
fallbackDispatcher = agent
return
}
throw err
}
try {
const legacyAgent = agent instanceof Dispatcher1Wrapper ? agent : new Dispatcher1Wrapper(agent)
Object.defineProperty(globalThis, legacyGlobalDispatcher, {
value: legacyAgent,
writable: true,
enumerable: false,
configurable: false
})
} catch (err) {
// globalThis is not extensible; fallback storage is already set
if (!(err instanceof TypeError)) {
throw err
}
}
}
function getGlobalDispatcher () {
return globalThis[globalDispatcher] ?? fallbackDispatcher
}
// These are the globals that can be installed by undici.install().
// Not exported by index.js to avoid use outside of this module.
const installedExports = /** @type {const} */ (
[
'fetch',
'Headers',
'Response',
'Request',
'FormData',
'WebSocket',
'CloseEvent',
'ErrorEvent',
'MessageEvent',
'EventSource'
]
)
module.exports = {
setGlobalDispatcher,
getGlobalDispatcher,
installedExports
}
@@ -0,0 +1,563 @@
'use strict'
const util = require('../../core/util')
const {
readableStreamClose,
fullyReadBody,
extractMimeType
} = require('./util')
const { FormData, setFormDataState, getFormDataBoundary } = require('./formdata')
const { webidl } = require('../webidl')
const assert = require('node:assert')
const { isErrored, isDisturbed } = require('node:stream')
const { isUint8Array } = require('node:util/types')
const { serializeAMimeType } = require('./data-url')
const { multipartFormDataParser } = require('./formdata-parser')
const { parseJSONFromBytes } = require('../infra')
const { utf8DecodeBytes } = require('../../encoding')
const { ReadableStreamTee } = require('node:stream/web')
const textEncoder = new TextEncoder()
function noop () {}
const streamRegistry = new FinalizationRegistry((weakRef) => {
const stream = weakRef.deref()
if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
stream.cancel('Response object has been garbage collected').catch(noop)
}
})
/**
* Extract a body with type from a byte sequence or BodyInit object
*
* @param {import('../../../types').BodyInit} object - The BodyInit object to extract from
* @param {boolean} [keepalive=false] - If true, indicates that the body
* @returns {[{stream: ReadableStream, source: any, length: number | null}, string | null]} - Returns a tuple containing the body and its type
*
* @see https://fetch.spec.whatwg.org/#concept-bodyinit-extract
*/
function extractBody (object, keepalive = false) {
// 1. Let stream be null.
let stream = null
// 2. If object is a ReadableStream object, then set stream to object.
if (webidl.is.ReadableStream(object)) {
stream = object
} else if (webidl.is.Blob(object)) {
// 3. Otherwise, if object is a Blob object, set stream to the
// result of running object’s get stream.
stream = object.stream()
} else {
// 4. Otherwise, set stream to a new ReadableStream object, and set
// up stream with byte reading support.
stream = new ReadableStream({
start () {},
async pull (controller) {
// 19.1. Run action.
const result = action()
const iterator = result?.[Symbol.asyncIterator]?.()
if (iterator == null) {
// 19.2. Whenever one or more bytes are available and stream is not errored,
// enqueue the result of creating a Uint8Array from the available bytes into stream.
if (result?.length && !isErrored(stream)) {
controller.enqueue(typeof result === 'string' ? textEncoder.encode(result) : new Uint8Array(result))
}
// 19.3. When running action is done, close stream.
queueMicrotask(() => readableStreamClose(controller))
return
}
while (true) {
const { value, done } = await iterator.next()
// 19.3. When running action is done, close stream.
if (done) {
queueMicrotask(() => readableStreamClose(controller))
return
}
// 19.2. Whenever one or more bytes are available and stream is not errored,
// enqueue the result of creating a Uint8Array from the available bytes into stream.
if (value.length && !isErrored(stream)) {
controller.enqueue(new Uint8Array(value))
return
}
}
},
cancel (reason) {
return action()[Symbol.asyncIterator]?.().return(reason)
},
type: 'bytes'
})
}
// 5. Assert: stream is a ReadableStream object.
assert(webidl.is.ReadableStream(stream))
// 6. Let action be null.
let action = null
// 7. Let source be null.
let source = null
// 8. Let length be null.
let length = null
// 9. Let type be null.
let type = null
// 10. Switch on object:
if (typeof object === 'string') {
// Set source to the UTF-8 encoding of object.
// Note: setting source to a Uint8Array here breaks some mocking assumptions.
source = object
// Set type to `text/plain;charset=UTF-8`.
type = 'text/plain;charset=UTF-8'
} else if (webidl.is.URLSearchParams(object)) {
// URLSearchParams
// spec says to run application/x-www-form-urlencoded on body.list
// this is implemented in Node.js as apart of an URLSearchParams instance toString method
// See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
// and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
// Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
source = object.toString()
// Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
type = 'application/x-www-form-urlencoded;charset=UTF-8'
} else if (webidl.is.BufferSource(object)) {
// Set source to a copy of the bytes held by object.
source = webidl.util.getCopyOfBytesHeldByBufferSource(object)
} else if (webidl.is.FormData(object)) {
const boundary = getFormDataBoundary(object)
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
const formdataEscape = (str) =>
str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
// Set action to this step: run the multipart/form-data
// encoding algorithm, with object’s entry list and UTF-8.
// - This ensures that the body is immutable and can't be changed afterwords
// - That the content-length is calculated in advance.
// - And that all parts are pre-encoded and ready to be sent.
const blobParts = []
const rn = new Uint8Array([13, 10]) // '\r\n'
length = 0
let hasUnknownSizeValue = false
for (const [name, value] of object) {
if (typeof value === 'string') {
const chunk = textEncoder.encode(prefix +
`; name="${formdataEscape(normalizeLinefeeds(name))}"` +
`\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
blobParts.push(chunk)
length += chunk.byteLength
} else {
const chunk = textEncoder.encode(`${prefix}; name="${formdataEscape(normalizeLinefeeds(name))}"` +
(value.name ? `; filename="${formdataEscape(value.name)}"` : '') + '\r\n' +
`Content-Type: ${
value.type || 'application/octet-stream'
}\r\n\r\n`)
blobParts.push(chunk, value, rn)
if (typeof value.size === 'number') {
length += chunk.byteLength + value.size + rn.byteLength
} else {
hasUnknownSizeValue = true
}
}
}
// CRLF is appended to the body to function with legacy servers and match other implementations.
// https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030
// https://github.com/form-data/form-data/issues/63
const chunk = textEncoder.encode(`--${boundary}--\r\n`)
blobParts.push(chunk)
length += chunk.byteLength
if (hasUnknownSizeValue) {
length = null
}
// Set source to object.
source = object
const parts = (async function * () {
for (const part of blobParts) {
if (part.stream) {
yield * part.stream()
} else {
yield part
}
}
})()
action = () => parts
// Set type to `multipart/form-data; boundary=`,
// followed by the multipart/form-data boundary string generated
// by the multipart/form-data encoding algorithm.
type = `multipart/form-data; boundary=${boundary}`
} else if (webidl.is.Blob(object)) {
// Blob
// Set source to object.
source = object
// Set length to object’s size.
length = object.size
// If object’s type attribute is not the empty byte sequence, set
// type to its value.
if (object.type) {
type = object.type
}
} else if (typeof object[Symbol.asyncIterator] === 'function') {
// If keepalive is true, then throw a TypeError.
if (keepalive) {
throw new TypeError('keepalive')
}
// If object is disturbed or locked, then throw a TypeError.
if (util.isDisturbed(object) || object.locked) {
throw new TypeError(
'Response body object should not be disturbed or locked'
)
}
stream = webidl.is.ReadableStream(object)
? object
: ReadableStream.from(object).pipeThrough(new TransformStream({
transform (chunk, controller) {
const bytes = isUint8Array(chunk) ? chunk : Buffer.from(chunk)
if (bytes.byteLength) {
controller.enqueue(bytes)
}
}
}))
}
// 18. If source is a byte sequence, then set action to a
// step that returns source and length to source’s length.
if (typeof source === 'string' || isUint8Array(source)) {
action = () => source
length = typeof source === 'string' ? Buffer.byteLength(source) : source.length
}
// 19. If action is non-null, then run these steps in parallel:
// Note: this is done in the pull method of the stream created above
// 20. Let body be a body whose stream is stream, source is source,
// and length is length.
const body = { stream, source, length }
// 21. Return (body, type).
return [body, type]
}
/**
* @typedef {object} ExtractBodyResult
* @property {ReadableStream<Uint8Array<ArrayBuffer>>} stream - The ReadableStream containing the body data
* @property {any} source - The original source of the body data
* @property {number | null} length - The length of the body data, or null
*/
/**
* Safely extract a body with type from a byte sequence or BodyInit object.
*
* @param {import('../../../types').BodyInit} object - The BodyInit object to extract from
* @param {boolean} [keepalive=false] - If true, indicates that the body
* @returns {[ExtractBodyResult, string | null]} - Returns a tuple containing the body and its type
*
* @see https://fetch.spec.whatwg.org/#bodyinit-safely-extract
*/
function safelyExtractBody (object, keepalive = false) {
// To safely extract a body and a `Content-Type` value from
// a byte sequence or BodyInit object object, run these steps:
// 1. If object is a ReadableStream object, then:
if (webidl.is.ReadableStream(object)) {
// Assert: object is neither disturbed nor locked.
assert(!util.isDisturbed(object), 'The body has already been consumed.')
assert(!object.locked, 'The stream is locked.')
}
// 2. Return the results of extracting object.
return extractBody(object, keepalive)
}
function cloneBody (body) {
// To clone a body body, run these steps:
// https://fetch.spec.whatwg.org/#concept-body-clone
// 1. Let « out1, out2 » be the result of teeing body’s stream.
const { 0: out1, 1: out2 } = ReadableStreamTee?.(body.stream, true) ?? body.stream.tee()
// 2. Set body’s stream to out1.
body.stream = out1
// 3. Return a body whose stream is out2 and other members are copied from body.
return {
stream: out2,
length: body.length,
source: body.source
}
}
function bodyMixinMethods (brandCheck, getInternalState) {
const methods = {
blob () {
// The blob() method steps are to return the result of
// running consume body with this and the following step
// given a byte sequence bytes: return a Blob whose
// contents are bytes and whose type attribute is this’s
// MIME type.
return consumeBody(this, (bytes) => {
let mimeType = bodyMimeType(getInternalState(this))
if (mimeType === null) {
mimeType = ''
} else if (mimeType) {
mimeType = serializeAMimeType(mimeType)
}
// Return a Blob whose contents are bytes and type attribute
// is mimeType.
return new Blob([bytes], { type: mimeType })
}, brandCheck, getInternalState)
},
arrayBuffer () {
// The arrayBuffer() method steps are to return the result
// of running consume body with this and the following step
// given a byte sequence bytes: return a new ArrayBuffer
// whose contents are bytes.
return consumeBody(this, (bytes) => {
return new Uint8Array(bytes).buffer
}, brandCheck, getInternalState)
},
text () {
// The text() method steps are to return the result of running
// consume body with this and UTF-8 decode.
return consumeBody(this, utf8DecodeBytes, brandCheck, getInternalState)
},
json () {
// The json() method steps are to return the result of running
// consume body with this and parse JSON from bytes.
return consumeBody(this, parseJSONFromBytes, brandCheck, getInternalState)
},
formData () {
// The formData() method steps are to return the result of running
// consume body with this and the following step given a byte sequence bytes:
return consumeBody(this, (value) => {
// 1. Let mimeType be the result of get the MIME type with this.
const mimeType = bodyMimeType(getInternalState(this))
// 2. If mimeType is non-null, then switch on mimeType’s essence and run
// the corresponding steps:
if (mimeType !== null) {
switch (mimeType.essence) {
case 'multipart/form-data': {
// 1. ... [long step]
// 2. If that fails for some reason, then throw a TypeError.
const parsed = multipartFormDataParser(value, mimeType)
// 3. Return a new FormData object, appending each entry,
// resulting from the parsing operation, to its entry list.
const fd = new FormData()
setFormDataState(fd, parsed)
return fd
}
case 'application/x-www-form-urlencoded': {
// 1. Let entries be the result of parsing bytes.
const entries = new URLSearchParams(value.toString())
// 2. If entries is failure, then throw a TypeError.
// 3. Return a new FormData object whose entry list is entries.
const fd = new FormData()
for (const [name, value] of entries) {
fd.append(name, value)
}
return fd
}
}
}
// 3. Throw a TypeError.
throw new TypeError(
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
)
}, brandCheck, getInternalState)
},
bytes () {
// The bytes() method steps are to return the result of running consume body
// with this and the following step given a byte sequence bytes: return the
// result of creating a Uint8Array from bytes in this’s relevant realm.
return consumeBody(this, (bytes) => {
return new Uint8Array(bytes)
}, brandCheck, getInternalState)
},
textStream () {
const this_ = getInternalState(this)
// 1. If this is unusable, then throw a TypeError.
if (bodyUnusable(this_)) {
throw new TypeError('Body is unusable: Body has already been read')
}
// 2. If this’s body is null:
if (this_.body == null) {
// 2.1. Let emptyStream be a new ReadableStream in this’s relevant realm.
// 2.2. Set up emptyStream.
/** @type {ReadableStreamDefaultController<any>} */
let controller
const emptyStream = new ReadableStream({
start: (c) => {
controller = c
},
pull: () => Promise.resolve(),
cancel: () => Promise.resolve()
}, {
size: () => 1
})
// 2.3. Close emptyStream.
controller.close()
// 2.4. Return emptyStream.
return emptyStream
}
// 3. Let stream be this’s body’s stream.
/** @type {ReadableStream} */
const stream = this_.body.stream
// 4. Let decoder be a new TextDecoderStream object in this’s relevant realm.
// 5. Set up decoder with UTF-8.
const decoder = new TextDecoderStream('UTF-8')
// 6. Return the result of stream, piped through decoder.
return stream.pipeThrough(decoder)
}
}
return methods
}
function mixinBody (prototype, getInternalState, brandCheck) {
Object.assign(prototype.prototype, bodyMixinMethods(brandCheck, getInternalState))
}
/**
* @see https://fetch.spec.whatwg.org/#concept-body-consume-body
* @param {any} object internal state
* @param {(value: unknown) => unknown} convertBytesToJSValue
* @param {import('../../../types/webidl').WebidlIsFunction} brandCheck
* @param {(target: any) => any} getInternalState
*/
function consumeBody (object, convertBytesToJSValue, brandCheck, getInternalState) {
try {
webidl.brandCheck(object, brandCheck)
} catch (e) {
return Promise.reject(e)
}
object = getInternalState(object)
// 1. If object is unusable, then return a promise rejected
// with a TypeError.
if (bodyUnusable(object)) {
return Promise.reject(new TypeError('Body is unusable: Body has already been read'))
}
// 2. Let promise be a new promise.
const promise = Promise.withResolvers()
// 3. Let errorSteps given error be to reject promise with error.
const errorSteps = promise.reject
// 4. Let successSteps given a byte sequence data be to resolve
// promise with the result of running convertBytesToJSValue
// with data. If that threw an exception, then run errorSteps
// with that exception.
const successSteps = (data) => {
try {
promise.resolve(convertBytesToJSValue(data))
} catch (e) {
errorSteps(e)
}
}
// 5. If object’s body is null, then run successSteps with an
// empty byte sequence.
if (object.body == null) {
successSteps(Buffer.allocUnsafe(0))
return promise.promise
}
// 6. Otherwise, fully read object’s body given successSteps,
// errorSteps, and object’s relevant global object.
fullyReadBody(object.body, successSteps, errorSteps)
// 7. Return promise.
return promise.promise
}
/**
* @see https://fetch.spec.whatwg.org/#body-unusable
* @param {any} object internal state
*/
function bodyUnusable (object) {
const body = object.body
// An object including the Body interface mixin is
// said to be unusable if its body is non-null and
// its body’s stream is disturbed or locked.
return body != null && (body.stream.locked || util.isDisturbed(body.stream))
}
/**
* @see https://fetch.spec.whatwg.org/#concept-body-mime-type
* @param {any} requestOrResponse internal state
*/
function bodyMimeType (requestOrResponse) {
// 1. Let headers be null.
// 2. If requestOrResponse is a Request object, then set headers to requestOrResponse’s request’s header list.
// 3. Otherwise, set headers to requestOrResponse’s response’s header list.
/** @type {import('./headers').HeadersList} */
const headers = requestOrResponse.headersList
// 4. Let mimeType be the result of extracting a MIME type from headers.
const mimeType = extractMimeType(headers)
// 5. If mimeType is failure, then return null.
if (mimeType === 'failure') {
return null
}
// 6. Return mimeType.
return mimeType
}
module.exports = {
extractBody,
safelyExtractBody,
cloneBody,
mixinBody,
streamRegistry,
bodyUnusable
}
@@ -0,0 +1 @@
{"version":3,"file":"menu.js","sources":["../../../src/icons/menu.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Menu\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNCIgeDI9IjIwIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iNCIgeDI9IjIwIiB5MT0iNiIgeTI9IjYiIC8+CiAgPGxpbmUgeDE9IjQiIHgyPSIyMCIgeTE9IjE4IiB5Mj0iMTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/menu\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 Menu = createLucideIcon('Menu', [\n ['line', { x1: '4', x2: '20', y1: '12', y2: '12', key: '1e0a9i' }],\n ['line', { x1: '4', x2: '20', y1: '6', y2: '6', key: '1owob3' }],\n ['line', { x1: '4', x2: '20', y1: '18', y2: '18', key: 'yk5zj1' }],\n]);\n\nexport default Menu;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CACpC,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,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,CAC/D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"layout-template.js","sources":["../../../src/icons/layout-template.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LayoutTemplate\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iNyIgeD0iMyIgeT0iMyIgcng9IjEiIC8+CiAgPHJlY3Qgd2lkdGg9IjkiIGhlaWdodD0iNyIgeD0iMyIgeT0iMTQiIHJ4PSIxIiAvPgogIDxyZWN0IHdpZHRoPSI1IiBoZWlnaHQ9IjciIHg9IjE2IiB5PSIxNCIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/layout-template\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 LayoutTemplate = createLucideIcon('LayoutTemplate', [\n ['rect', { width: '18', height: '7', x: '3', y: '3', rx: '1', key: 'f1a2em' }],\n ['rect', { width: '9', height: '7', x: '3', y: '14', rx: '1', key: 'jqznyg' }],\n ['rect', { width: '5', height: '7', x: '16', y: '14', rx: '1', key: 'q5h2i8' }],\n]);\n\nexport default LayoutTemplate;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAM,CAAA,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,51 @@
import { Bench } from 'tinybench'
import { fastUri } from '../index.js'
const {
equal: fastUriEqual,
parse: fastUriParse,
} = fastUri
const stringA = 'example://a/b/c/%7Bfoo%7D'
const stringB = 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'
const componentA = fastUriParse(stringA)
const componentB = fastUriParse(stringB)
const benchFastUri = new Bench({ name: 'fast-uri equal' })
benchFastUri.add('equal string with string', function () {
fastUriEqual(stringA, stringA)
})
benchFastUri.add('equal component with component', function () {
fastUriEqual(componentA, componentA)
})
benchFastUri.add('equal component with string', function () {
fastUriEqual(componentA, stringA)
})
benchFastUri.add('equal string with component', function () {
fastUriEqual(stringA, componentA)
})
benchFastUri.add('not equal string with string', function () {
fastUriEqual(stringA, stringB)
})
benchFastUri.add('not equal component with component', function () {
fastUriEqual(componentA, componentB)
})
benchFastUri.add('not equal component with string', function () {
fastUriEqual(componentA, stringB)
})
benchFastUri.add('not equal string with component', function () {
fastUriEqual(stringA, componentB)
})
await benchFastUri.run()
console.log(benchFastUri.name)
console.table(benchFastUri.table())
@@ -0,0 +1 @@
{"version":3,"file":"pi-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,630 @@
export default `flf2a$ 6 5 32 15 10
Font name is graffiti.flf
This figlet font designed by Leigh Purdie (purdie@zeus.usq.edu.au)
'fig-fonted' by Leigh Purdie and Tim Maggio (tim@claremont.com)
Date: 5 Mar 1994
---
Font modified May 20, 2012 by patorjk
- Changed the hardblanks around certain punctuation characters (., and -) to improve smushing.
- Added the 0xCA0 character
$@
$@
$@
$@
$@
$@@
._.@
| |@
| |@
\\|@
__@
\\/@@
/\\/\\@
)/)/@
@
@
@
@@
_ _ @
__| || |__@
\\ __ /@
| || | @
/_ ~~ _\\@
|_||_| @@
____/\\__@
/ / /_/@
\\__/ / \\ @
/ / / \\@
/_/ /__ /@
\\/ \\/ @@
_ /\\ @
/ \\ / / @
\\_// /_ @
/ // \\@
/ / \\_/@
\\/ @@
____ @
/ _ \\ @
> _ </\\@
/ <_\\ \\/@
\\_____\\ \\@
\\/@@
/\\@
)/@
@
@
@
@@
$ ___$@
$ / /$@
$ / / $@
$( ( $@
$ \\ \\ $@
$ \\__\\$@@
$___ $@
$\\ \\ $@
$ \\ \\ $@
$ ) )$@
$ / / $@
$/__/ $@@
$ $@
$ /\\|\\/\\ $@
$_) (__$@
$\\_ _/$@
$ ) \\ $@
$ \\/\\|\\/ $@@
$ $@
$ .__ $@
$ __| |___$@
$/__ __/$@
$ |__| $@
$ $@@
@
@
@
@
$/\\$@
$)/$@@
@
@
$ ______$@
$/_____/$@
$ $@
@@
@
@
@
@
$/\\$@
$\\/$@@
$ /\\$@
$ / /$@
$ / / $@
$ / / $@
$/ / $@
$\\/ $@@
_______ @
\\ _ \\ @
/ /_\\ \\ @
\\ \\_/ \\@
\\_____ /@
\\/ @@
____ @
/_ |@
| |@
| |@
|___|@
@@
________ @
\\_____ \\ @
/ ____/ @
/ \\ @
\\_______ \\@
\\/@@
________ @
\\_____ \\ @
_(__ < @
/ \\@
/______ /@
\\/ @@
_____ @
/ | | @
/ | |_@
/ ^ /@
\\____ | @
|__| @@
.________@
| ____/@
|____ \\ @
/ \\@
/______ /@
\\/ @@
________@
/ _____/@
/ __ \\ @
\\ |__\\ \\@
\\_____ /@
\\/ @@
_________ @
\\______ \\@
/ /@
/ / @
/____/ @
@@
______ @
/ __ \\ @
> < @
/ -- \\@
\\______ /@
\\/ @@
________ @
/ __ \\@
\\____ /@
/ / @
/____/ @
@@
$ $@
$/\\$@
$\\/$@
$/\\$@
$\\/$@
$ $@@
$ $@
$/\\$@
$\\/$@
$/\\$@
$)/$@
$ $@@
$ __$@
$ / /$@
$/ / $@
$\\ \\ $@
$ \\_\\$@
$ $@@
$ $@
$ ______$@
$/_____/$@
$/_____/$@
$ $@
$ $@@
$__ $@
$\\ \\ $@
$ \\ \\$@
$ / /$@
$/_/ $@
$ $@@
_________ @
\\_____ \\@
/ __/@
| | @
|___| @
<___> @@
_____ @
/ ___ \\ @
/ / ._\\ \\@
< \\_____/@
\\_____\\ @
@@
_____ @
/ _ \\ @
/ /_\\ \\ @
/ | \\@
\\____|__ /@
\\/ @@
__________ @
\\______ \\@
| | _/@
| | \\@
|______ /@
\\/ @@
_________ @
\\_ ___ \\ @
/ \\ \\/ @
\\ \\____@
\\______ /@
\\/ @@
________ @
\\______ \\ @
| | \\ @
| \` \\@
/_______ /@
\\/ @@
___________@
\\_ _____/@
| __)_ @
| \\@
/_______ /@
\\/ @@
___________@
\\_ _____/@
| __) @
| \\ @
\\___ / @
\\/ @@
________ @
/ _____/ @
/ \\ ___ @
\\ \\_\\ \\@
\\______ /@
\\/ @@
___ ___ @
/ | \\ @
/ ~ \\@
\\ Y /@
\\___|_ / @
\\/ @@
.___ @
| |@
| |@
| |@
|___|@
@@
____.@
| |@
| |@
/\\__| |@
\\________|@
@@
____ __.@
| |/ _|@
| < @
| | \\ @
|____|__ \\@
\\/@@
.____ @
| | @
| | @
| |___ @
|_______ \\@
\\/@@
_____ @
/ \\ @
/ \\ / \\ @
/ Y \\@
\\____|__ /@
\\/ @@
_______ @
\\ \\ @
/ | \\ @
/ | \\@
\\____|__ /@
\\/ @@
________ @
\\_____ \\ @
/ | \\ @
/ | \\@
\\_______ /@
\\/ @@
__________ @
\\______ \\@
| ___/@
| | @
|____| @
@@
________ @
\\_____ \\ @
/ / \\ \\ @
/ \\_/. \\@
\\_____\\ \\_/@
\\__>@@
__________ @
\\______ \\@
| _/@
| | \\@
|____|_ /@
\\/ @@
_________@
/ _____/@
\\_____ \\ @
/ \\@
/_______ /@
\\/ @@
___________@
\\__ ___/@
| | @
| | @
|____| @
@@
____ ___ @
| | \\@
| | /@
| | / @
|______/ @
@@
____ ____@
\\ \\ / /@
\\ Y / @
\\ / @
\\___/ @
@@
__ __ @
/ \\ / \\@
\\ \\/\\/ /@
\\ / @
\\__/\\ / @
\\/ @@
____ ___@
\\ \\/ /@
\\ / @
/ \\ @
/___/\\ \\@
\\_/@@
_____.___.@
\\__ | |@
/ | |@
\\____ |@
/ ______|@
\\/ @@
__________@
\\____ /@
/ / @
/ /_ @
/_______ \\@
\\/@@
$.____ $@
$| _|$@
$| | $@
$| | $@
$| |_ $@
$|____|$@@
/\\ @
\\ \\ @
\\ \\ @
\\ \\ @
\\ \\@
\\/@@
$ ____.$@
$|_ |$@
$ | |$@
$ | |$@
$ _| |$@
$|____|$@@
$ /\\ $@
$/ \\$@
$\\/\\/$@
$ $@
$ $@
$ $@@
@
@
@
@
______@
/_____/@@
/\\@
\\(@
@
@
@
@@
@
_____ @
\\__ \\ @
/ __ \\_@
(____ /@
\\/ @@
___. @
\\_ |__ @
| __ \\ @
| \\_\\ \\@
|___ /@
\\/ @@
@
____ @
_/ ___\\ @
\\ \\___ @
\\___ >@
\\/ @@
.___@
__| _/@
/ __ | @
/ /_/ | @
\\____ | @
\\/ @@
@
____ @
_/ __ \\ @
\\ ___/ @
\\___ >@
\\/ @@
_____ @
_/ ____\\@
\\ __\\ @
| | @
|__| @
@@
@
____ @
/ ___\\ @
/ /_/ >@
\\___ / @
/_____/ @@
.__ @
| |__ @
| | \\ @
| Y \\@
|___| /@
\\/ @@
.__ @
|__|@
| |@
| |@
|__|@
@@
__ @
|__|@
| |@
| |@
/\\__| |@
\\______|@@
__ @
| | __@
| |/ /@
| < @
|__|_ \\@
\\/@@
.__ @
| | @
| | @
| |__@
|____/@
@@
@
_____ @
/ \\ @
| Y Y \\@
|__|_| /@
\\/ @@
@
____ @
/ \\ @
| | \\@
|___| /@
\\/ @@
@
____ @
/ _ \\ @
( <_> )@
\\____/ @
@@
@
______ @
\\____ \\ @
| |_> >@
| __/ @
|__| @@
@
______@
/ ____/@
< <_| |@
\\__ |@
|__|@@
@
_______ @
\\_ __ \\@
| | \\/@
|__| @
@@
@
______@
/ ___/@
\\___ \\ @
/____ >@
\\/ @@
__ @
_/ |_ @
\\ __\\@
| | @
|__| @
@@
@
__ __ @
| | \\@
| | /@
|____/ @
@@
@
___ __@
\\ \\/ /@
\\ / @
\\_/ @
@@
@
__ _ __@
\\ \\/ \\/ /@
\\ / @
\\/\\_/ @
@@
@
___ ___@
\\ \\/ /@
> < @
/__/\\_ \\@
\\/@@
@
___.__.@
< | |@
\\___ |@
/ ____|@
\\/ @@
@
________@
\\___ /@
/ / @
/_____ \\@
\\/@@
$ ___$@
$/ / $@
$\\ \\ $@
$< < $@
$/ / $@
$\\_\\_$@@
$._.$@
$| |$@
$|_|$@
$|-|$@
$| |$@
$|_|$@@
$___ $@
$ \\ \\$@
$ / /$@
$ > >$@
$ \\ \\$@
$_/_/$@@
$ ___ $@
$/ _ \\_/\\$@
$\\/ \\___/$@
$ $@
$ $@
$ $@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
0xCA0 KANNADA LETTER TTHA
_____)@
/_____/@
/ \\ @
( () )@
$\\____/$@
@@`
@@ -0,0 +1,783 @@
/**
* SHA3 (keccak) addons.
*
* * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants from
* {@link https://csrc.nist.gov/pubs/sp/800/185/final | NIST SP 800-185}
* * KangarooTwelve 🦘 and TurboSHAKE - reduced-round keccak from
* {@link https://datatracker.ietf.org/doc/rfc9861/ | RFC 9861}
* * KeccakPRG: Pseudo-random generator based on Keccak
* ({@link https://keccak.team/files/CSF-0.1.pdf | pdf})
* @module
*/
import { Keccak } from "./sha3.js";
import { abytes, aexists, anumber, clean, copyBytes, createHasher, kdfInputToBytes, u32, } from "./utils.js";
// cSHAKE && KMAC (NIST SP800-185)
const _8n = /* @__PURE__ */ BigInt(8);
const _ffn = /* @__PURE__ */ BigInt(0xff);
// It is safe to use bigints here, since they used only for length encoding (not actual data).
// We use bigints in sha256 for lengths too.
// Callers are still expected to supply SP 800-185-valid lengths
// (`0 <= x < 2^2040`); this helper does not enforce that bound.
function leftEncode(n) {
n = BigInt(n);
const res = [Number(n & _ffn)];
n >>= _8n;
for (; n > 0; n >>= _8n)
res.unshift(Number(n & _ffn));
res.unshift(res.length);
return new Uint8Array(res);
}
// Same caller contract as `leftEncode(...)`: lengths must already satisfy SP 800-185 §2.3.1.
function rightEncode(n) {
n = BigInt(n);
const res = [Number(n & _ffn)];
n >>= _8n;
for (; n > 0; n >>= _8n)
res.unshift(Number(n & _ffn));
res.push(res.length);
return new Uint8Array(res);
}
// `dkLen` validation is deferred to the downstream Keccak constructor.
function chooseLen(opts, outputLen) {
return opts.dkLen === undefined ? outputLen : opts.dkLen;
}
const abytesOrZero = (buf, title = '') => {
if (buf === undefined)
return EMPTY_BUFFER;
abytes(buf, undefined, title);
return buf;
};
// NOTE: second modulo is necessary since we don't need to add padding if the
// current element takes a whole block.
// Callers only pass the fixed positive Keccak rates here (`168` or `136`);
// `block <= 0` is not validated locally.
const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block);
// Personalization
function cshakePers(hash, opts = {}) {
const h = hash;
if (!opts || (opts.personalization === undefined && opts.NISTfn === undefined))
return h;
// Encode and pad inplace to avoid unneccesary memory copies/slices so we
// don't need to zero them later.
// bytepad(encode_string(N) || encode_string(S), rate), where `rate` is the
// current cSHAKE/KMAC/TupleHash/ParallelHash block length.
const blockLenBytes = leftEncode(h.blockLen);
const fn = opts.NISTfn === undefined ? EMPTY_BUFFER : kdfInputToBytes(opts.NISTfn);
const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits
const pers = abytesOrZero(opts.personalization, 'personalization');
const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits
if (!fn.length && !pers.length)
return h;
// SP 800-185 cSHAKE appends `00` instead of SHAKE's `1111`; in this Keccak implementation
// that changes the delimited suffix byte from `0x1f` to `0x04` once N or S is non-empty.
h.suffix = 0x04;
h.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers);
let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length;
h.update(getPadding(totalLen, h.blockLen));
return h;
}
const gencShake = (suffix, blockLen, outputLen) => createHasher((opts = {}) => cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts));
/**
* 128-bit NIST cSHAKE XOF.
* @param msg - message bytes to hash
* @param opts - Optional output, personalization, and NIST function-name
* settings. When both `NISTfn` and `personalization` are empty,
* SP 800-185 defines this as plain SHAKE128. Defaults to 16 output bytes
* when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with cSHAKE128.
* ```ts
* cshake128(new Uint8Array([1, 2, 3]), { dkLen: 32 });
* ```
*/
export const cshake128 = /* @__PURE__ */ gencShake(0x1f, 168, 16);
/**
* 256-bit NIST cSHAKE XOF.
* @param msg - message bytes to hash
* @param opts - Optional output, personalization, and NIST function-name
* settings. When both `NISTfn` and `personalization` are empty,
* SP 800-185 defines this as plain SHAKE256. Defaults to 32 output bytes
* when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with cSHAKE256.
* ```ts
* cshake256(new Uint8Array([1, 2, 3]), { dkLen: 64 });
* ```
*/
export const cshake256 = /* @__PURE__ */ gencShake(0x1f, 136, 32);
/**
* Internal KMAC class.
* SP 800-185 §8.4.1 still recommends keys at least as long as the target
* security strength.
*/
export class _KMAC extends Keccak {
constructor(blockLen, outputLen, enableXOF, key, opts = {}) {
super(blockLen, 0x1f, outputLen, enableXOF);
// Preload T = bytepad(encode_string("KMAC") || encode_string(S), rate); later updates append
// newX = bytepad(encode_string(K), rate) || X and `finish()` appends right_encode(L or 0).
cshakePers(this, {
NISTfn: 'KMAC',
personalization: opts.personalization,
});
abytes(key, undefined, 'key');
// 1. newX = bytepad(encode_string(K), rate) || X || right_encode(L),
// with `rate = this.blockLen`.
const blockLenBytes = leftEncode(this.blockLen);
const keyLen = leftEncode(_8n * BigInt(key.length));
this.update(blockLenBytes).update(keyLen).update(key);
const totalLen = blockLenBytes.length + keyLen.length + key.length;
this.update(getPadding(totalLen, this.blockLen));
}
finish() {
// SP 800-185 uses right_encode(L) for fixed-length KMAC and right_encode(0) for KMACXOF.
// outputLen in bits
if (!this.finished)
this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen)));
super.finish();
}
_cloneInto(to) {
// Create new instance without calling constructor since the key
// is already in state and we don't know it.
// Force "to" to be instance of KMAC instead of Sha3.
if (!to) {
to = Object.create(Object.getPrototypeOf(this), {});
to.state = this.state.slice();
to.blockLen = this.blockLen;
to.state32 = u32(to.state);
}
return super._cloneInto(to);
}
clone() {
return this._cloneInto();
}
}
function genKmac(blockLen, outputLen, xof = false) {
// One-shot XOF wrappers still finalize via `.digest()` because `_KMAC`
// already bakes the requested output length into the state.
const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest();
kmac.create = (key, opts = {}) => new _KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts);
return kmac;
}
/**
* 128-bit Keccak MAC.
* @param key - MAC key bytes
* @param message - message bytes to authenticate
* @param opts - Optional output and personalization settings. Defaults to
* 16 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Authentication tag bytes.
* @example
* Authenticate a message with KMAC128.
* ```ts
* kmac128(new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));
* ```
*/
export const kmac128 = /* @__PURE__ */ genKmac(168, 16);
/**
* 256-bit Keccak MAC.
* @param key - MAC key bytes
* @param message - message bytes to authenticate
* @param opts - Optional output and personalization settings. Defaults to
* 32 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Authentication tag bytes.
* @example
* Authenticate a message with KMAC256.
* ```ts
* kmac256(new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));
* ```
*/
export const kmac256 = /* @__PURE__ */ genKmac(136, 32);
/**
* 128-bit Keccak-MAC XOF.
* @param key - MAC key bytes
* @param message - message bytes to authenticate
* @param opts - Optional output and personalization settings. Defaults to
* 16 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Authentication tag bytes.
* @example
* Authenticate a message with KMAC128 XOF output.
* ```ts
* kmac128xof(new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]), { dkLen: 32 });
* ```
*/
export const kmac128xof = /* @__PURE__ */ genKmac(168, 16, true);
/**
* 256-bit Keccak-MAC XOF.
* @param key - MAC key bytes
* @param message - message bytes to authenticate
* @param opts - Optional output and personalization settings. Defaults to
* 32 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Authentication tag bytes.
* @example
* Authenticate a message with KMAC256 XOF output.
* ```ts
* kmac256xof(new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]), { dkLen: 64 });
* ```
*/
export const kmac256xof = /* @__PURE__ */ genKmac(136, 32, true);
/**
* Internal TupleHash class for byte-array tuple elements.
* This implementation relies on SP 800-185's byte-oriented encoding form
* rather than arbitrary bit strings.
*/
export class _TupleHash extends Keccak {
constructor(blockLen, outputLen, enableXOF, opts = {}) {
super(blockLen, 0x1f, outputLen, enableXOF);
cshakePers(this, {
NISTfn: 'TupleHash',
personalization: opts.personalization,
});
// Change update after cshake processed
this.update = (data) => {
abytes(data);
// SP 800-185 encodes each tuple element as
// encode_string(X[i]) = left_encode(len(X[i])) || X[i].
super.update(leftEncode(_8n * BigInt(data.length)));
super.update(data);
return this;
};
}
finish() {
// SP 800-185 uses right_encode(L) for fixed-length TupleHash
// and right_encode(0) for TupleHashXOF.
if (!this.finished)
// outputLen in bits
super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen)));
super.finish();
}
_cloneInto(to) {
to ||= new _TupleHash(this.blockLen, this.outputLen, this.enableXOF);
return super._cloneInto(to);
}
clone() {
return this._cloneInto();
}
}
function genTuple(blockLen, outputLen, xof = false) {
// One-shot XOF wrappers still use `.digest()` because `_TupleHash` stores
// the requested output length in the state itself.
const tuple = (messages, opts) => {
const h = tuple.create(opts);
if (!Array.isArray(messages))
throw new Error('expected array of messages');
for (const msg of messages)
h.update(msg);
return h.digest();
};
tuple.create = (opts = {}) => new _TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts);
return tuple;
}
/**
* 128-bit TupleHASH. `tuple(['ab', 'cd']) != tuple(['a', 'bcd'])`.
* @param messages - ordered byte-array tuple
* @param opts - Optional output and personalization settings. Defaults to
* 16 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a tuple of byte arrays with TupleHash128.
* ```ts
* tuplehash128([new Uint8Array([1]), new Uint8Array([2])]);
* ```
*/
export const tuplehash128 = /* @__PURE__ */ genTuple(168, 16);
/**
* 256-bit TupleHASH. `tuple(['ab', 'cd']) != tuple(['a', 'bcd'])`.
* @param messages - ordered byte-array tuple
* @param opts - Optional output and personalization settings. Defaults to
* 32 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a tuple of byte arrays with TupleHash256.
* ```ts
* tuplehash256([new Uint8Array([1]), new Uint8Array([2])]);
* ```
*/
export const tuplehash256 = /* @__PURE__ */ genTuple(136, 32);
/**
* 128-bit TupleHASH XOF.
* @param messages - ordered byte-array tuple
* @param opts - Optional output and personalization settings. Defaults to
* 16 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a tuple of byte arrays with TupleHash128 XOF output.
* ```ts
* tuplehash128xof([new Uint8Array([1]), new Uint8Array([2])], { dkLen: 32 });
* ```
*/
export const tuplehash128xof = /* @__PURE__ */ genTuple(168, 16, true);
/**
* 256-bit TupleHASH XOF.
* @param messages - ordered byte-array tuple
* @param opts - Optional output and personalization settings. Defaults to
* 32 output bytes when `dkLen` is omitted. See {@link cShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a tuple of byte arrays with TupleHash256 XOF output.
* ```ts
* tuplehash256xof([new Uint8Array([1]), new Uint8Array([2])], { dkLen: 64 });
* ```
*/
export const tuplehash256xof = /* @__PURE__ */ genTuple(136, 32, true);
/** Internal Parallel Keccak Hash class. */
export class _ParallelHash extends Keccak {
leafHash;
leafCons;
chunkPos = 0; // Position of current block in chunk
chunksDone = 0; // How many chunks we already have
chunkLen;
constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) {
super(blockLen, 0x1f, outputLen, enableXOF);
cshakePers(this, {
NISTfn: 'ParallelHash',
personalization: opts.personalization,
});
this.leafCons = leafCons;
let { blockLen: B = 8 } = opts;
anumber(B);
// blockLen=0 makes take=0 in update(), so pos never advances and the hash hangs.
if (B < 1)
throw new Error('"blockLen" must be >= 1, got ' + B);
this.chunkLen = B;
// SP 800-185 initializes z = left_encode(B); each completed chunk appends
// one fixed-size cSHAKE leaf digest before finish() adds right_encode(n)
// and right_encode(L or 0).
super.update(leftEncode(B));
// Change update after cshake processed
this.update = (data) => {
abytes(data);
const { chunkLen, leafCons } = this;
for (let pos = 0, len = data.length; pos < len;) {
if (this.chunkPos == chunkLen || !this.leafHash) {
if (this.leafHash) {
super.update(this.leafHash.digest());
this.chunksDone++;
}
this.leafHash = leafCons();
this.chunkPos = 0;
}
const take = Math.min(chunkLen - this.chunkPos, len - pos);
this.leafHash.update(data.subarray(pos, pos + take));
this.chunkPos += take;
pos += take;
}
return this;
};
}
finish() {
if (this.finished)
return;
if (this.leafHash) {
super.update(this.leafHash.digest());
this.chunksDone++;
}
// SP 800-185 finishes ParallelHash as
// z || right_encode(n) || right_encode(L); XOF mode replaces
// right_encode(L) with right_encode(0).
super.update(rightEncode(this.chunksDone));
// outputLen in bits
super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen)));
super.finish();
}
_cloneInto(to) {
to ||= new _ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF);
to.leafCons = this.leafCons;
// Reused destinations can carry a stale partial leaf
// when the source is still on the root sponge.
if (this.leafHash)
to.leafHash = this.leafHash._cloneInto(to.leafHash);
else if (to.leafHash) {
to.leafHash.destroy();
to.leafHash = undefined;
}
to.chunkPos = this.chunkPos;
to.chunkLen = this.chunkLen;
to.chunksDone = this.chunksDone;
return super._cloneInto(to);
}
destroy() {
super.destroy.call(this);
if (this.leafHash)
this.leafHash.destroy();
}
clone() {
return this._cloneInto();
}
}
function genPrl(blockLen, outputLen, leaf, xof = false) {
const parallel = (message, opts) => parallel.create(opts).update(message).digest();
parallel.create = (opts = {}) => new _ParallelHash(blockLen, chooseLen(opts, outputLen),
// SP 800-185 fixes leaf digests at 256 bits for ParallelHash128 and
// 512 bits for ParallelHash256; only the final cSHAKE output uses the
// caller-selected dkLen.
() => leaf.create({ dkLen: 2 * outputLen }), xof, opts);
parallel.outputLen = outputLen;
parallel.blockLen = blockLen;
parallel.canXOF = xof;
return parallel;
}
/**
* 128-bit ParallelHash. In JS, it is not parallel.
* @param msg - message bytes to hash
* @param opts - Optional output, personalization, and chunking settings.
* Defaults to 16 output bytes when `dkLen` is omitted.
* See {@link ParallelOpts}.
* @returns Digest bytes.
* @example
* Hash a message with ParallelHash128.
* ```ts
* parallelhash128(new Uint8Array([1, 2, 3]));
* ```
*/
export const parallelhash128 = /* @__PURE__ */ genPrl(168, 16, cshake128);
/**
* 256-bit ParallelHash. In JS, it is not parallel.
* @param msg - message bytes to hash
* @param opts - Optional output, personalization, and chunking settings.
* Defaults to 32 output bytes when `dkLen` is omitted.
* See {@link ParallelOpts}.
* @returns Digest bytes.
* @example
* Hash a message with ParallelHash256.
* ```ts
* parallelhash256(new Uint8Array([1, 2, 3]));
* ```
*/
export const parallelhash256 = /* @__PURE__ */ genPrl(136, 32, cshake256);
/**
* 128-bit ParallelHash XOF. In JS, it is not parallel.
* @param msg - message bytes to hash
* @param opts - Optional output, personalization, and chunking settings.
* Defaults to 16 output bytes when `dkLen` is omitted.
* See {@link ParallelOpts}.
* @returns Digest bytes.
* @example
* Hash a message with ParallelHash128 XOF output.
* ```ts
* parallelhash128xof(new Uint8Array([1, 2, 3]), { dkLen: 32 });
* ```
*/
export const parallelhash128xof = /* @__PURE__ */ genPrl(168, 16, cshake128, true);
/**
* 256-bit ParallelHash XOF. In JS, it is not parallel.
* @param msg - message bytes to hash
* @param opts - Optional output, personalization, and chunking settings.
* Defaults to 32 output bytes when `dkLen` is omitted.
* See {@link ParallelOpts}.
* @returns Digest bytes.
* @example
* Hash a message with ParallelHash256 XOF output.
* ```ts
* parallelhash256xof(new Uint8Array([1, 2, 3]), { dkLen: 64 });
* ```
*/
export const parallelhash256xof = /* @__PURE__ */ genPrl(136, 32, cshake256, true);
const genTurbo = (blockLen, outputLen) => createHasher((opts = {}) => {
const D = opts.D === undefined ? 0x1f : opts.D;
// RFC 9861 §2.1 fixes the default `D = 0x1f`; §2.2 defines the 12-round
// TurboSHAKE family selected here.
if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f)
throw new Error('"D" (domain separation byte) must be 0x01..0x7f, got: ' + D);
const dkLen = opts.dkLen === undefined ? outputLen : opts.dkLen;
// RFC 9861 §§2.1-2.2 define output length L as a positive integer.
if (dkLen < 1)
throw new Error('"dkLen" must be >= 1');
return new Keccak(blockLen, D, dkLen, true, 12);
});
/**
* TurboSHAKE 128-bit: reduced 12-round keccak.
* Should've been a simple "shake with 12 rounds", but we got a whole new
* spec about Turbo SHAKE Pro MAX.
* @param msg - message bytes to hash
* @param opts - Optional output-length and domain-separation settings.
* RFC 9861 §2.1 defaults `D` to `0x1f`. Defaults to 32 output bytes when
* `dkLen` is omitted. See {@link TurboshakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with TurboSHAKE128.
* ```ts
* turboshake128(new Uint8Array([1, 2, 3]), { dkLen: 32 });
* ```
*/
export const turboshake128 = /* @__PURE__ */ genTurbo(168, 32);
/**
* TurboSHAKE 256-bit: reduced 12-round keccak.
* @param msg - message bytes to hash
* @param opts - Optional output-length and domain-separation settings.
* RFC 9861 §2.1 defaults `D` to `0x1f`. Defaults to 64 output bytes when
* `dkLen` is omitted. See {@link TurboshakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with TurboSHAKE256.
* ```ts
* turboshake256(new Uint8Array([1, 2, 3]), { dkLen: 64 });
* ```
*/
export const turboshake256 = /* @__PURE__ */ genTurbo(136, 64);
// Same as NIST rightEncode, but returns `[0]` for the zero string.
// Callers still need to keep `x < 256^255` per RFC 9861 §3.3.
function rightEncodeK12(n) {
n = BigInt(n);
const res = [];
for (; n > 0; n >>= _8n)
res.unshift(Number(n & _ffn));
res.push(res.length);
return Uint8Array.from(res);
}
const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
/** Internal K12 hash class. */
export class _KangarooTwelve extends Keccak {
chunkLen = 8192;
leafHash;
leafLen;
personalization;
chunkPos = 0; // Position of current block in chunk
chunksDone = 0; // How many chunks we already have
constructor(blockLen, leafLen, outputLen, rounds, opts) {
super(blockLen, 0x07, outputLen, true, rounds);
// RFC 9861 §3 defines output length L as a positive integer.
if (outputLen < 1)
throw new Error('"dkLen" must be >= 1');
this.leafLen = leafLen;
this.personalization =
opts.personalization === undefined
? EMPTY_BUFFER
: copyBytes(abytes(opts.personalization, undefined, 'personalization'));
}
update(data) {
abytes(data);
const { chunkLen, blockLen, leafLen, rounds } = this;
for (let pos = 0, len = data.length; pos < len;) {
if (this.chunkPos == chunkLen) {
if (this.leafHash)
super.update(this.leafHash.digest());
else {
// RFC 9861 §3.2 switches from SingleNode (`07`) to FinalNode (`06`)
// once S exceeds 8192 bytes and prefixes S_0 with
// `03 00 00 00 00 00 00 00`.
this.suffix = 0x06; // Its safe to change suffix here since its used only in digest()
super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0]));
}
// Secondary chunks S_1..S_(n-1) become fixed-length
// CV_i = TurboSHAKE*(S_i, `0B`, 32|64) chaining values.
this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds);
this.chunksDone++;
this.chunkPos = 0;
}
const take = Math.min(chunkLen - this.chunkPos, len - pos);
const chunk = data.subarray(pos, pos + take);
if (this.leafHash)
this.leafHash.update(chunk);
else
super.update(chunk);
this.chunkPos += take;
pos += take;
}
return this;
}
finish() {
if (this.finished)
return;
const { personalization } = this;
// RFC 9861 §3.2 forms S = M || C || length_encode(|C|) before any tree hashing logic.
this.update(personalization).update(rightEncodeK12(personalization.length));
// Leaf hash
if (this.leafHash) {
// Multi-chunk K12 appends
// CV_1..CV_(n-1) || length_encode(n-1) || `FF FF`
// before the final TurboSHAKE call.
super.update(this.leafHash.digest());
super.update(rightEncodeK12(this.chunksDone));
super.update(Uint8Array.from([0xff, 0xff]));
}
super.finish.call(this);
}
destroy() {
super.destroy.call(this);
if (this.leafHash)
this.leafHash.destroy();
// Personalization is copied on create/clone, so destroy can wipe it
// without touching caller input.
if (this.personalization !== EMPTY_BUFFER)
clean(this.personalization);
this.personalization = EMPTY_BUFFER;
}
_cloneInto(to) {
const { blockLen, leafLen, leafHash, outputLen, rounds } = this;
const personalization = this.personalization === EMPTY_BUFFER ? EMPTY_BUFFER : copyBytes(this.personalization);
// Personalization is absorbed only during finish(), so clones need the same pending value.
to ||= new _KangarooTwelve(blockLen, leafLen, outputLen, rounds, {
personalization,
});
super._cloneInto(to);
// Reused destinations can carry a stale leaf from an older multi-chunk state.
if (leafHash)
to.leafHash = leafHash._cloneInto(to.leafHash);
else if (to.leafHash) {
to.leafHash.destroy();
to.leafHash = undefined;
}
// Snapshot the pending personalization so clone state does not alias caller-owned input.
to.personalization = personalization;
to.leafLen = this.leafLen;
to.chunkPos = this.chunkPos;
to.chunksDone = this.chunksDone;
return to;
}
clone() {
return this._cloneInto();
}
}
/**
* 128-bit KangarooTwelve (k12): reduced 12-round keccak.
* @param msg - message bytes to hash
* @param opts - Optional output and personalization settings. Defaults to
* 32 output bytes when `dkLen` is omitted. See {@link KangarooOpts}.
* @returns Digest bytes.
* @example
* Hash a message with KangarooTwelve-128.
* ```ts
* kt128(new Uint8Array([1, 2, 3]));
* ```
*/
export const kt128 = /* @__PURE__ */ createHasher((opts = {}) => new _KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts));
/**
* 256-bit KangarooTwelve (k12): reduced 12-round keccak.
* @param msg - message bytes to hash
* @param opts - Optional output and personalization settings. Defaults to
* 64 output bytes when `dkLen` is omitted. See {@link KangarooOpts}.
* @returns Digest bytes.
* @example
* Hash a message with KangarooTwelve-256.
* ```ts
* kt256(new Uint8Array([1, 2, 3]));
* ```
*/
export const kt256 = /* @__PURE__ */ createHasher((opts = {}) => new _KangarooTwelve(136, 64, chooseLen(opts, 64), 12, opts));
const genHopMAC = (hash) => (key, message, personalization, dkLen) => {
const h = hash;
return h(key, { personalization: h(message, { personalization }), dkLen });
};
/**
* 128-bit KangarooTwelve-based MAC.
*
* These untested (there is no test vectors or implementation available). Use at your own risk.
* HopMAC128(Key, M, C, L) = KT128(Key, KT128(M, C, 32), L)
* HopMAC256(Key, M, C, L) = KT256(Key, KT256(M, C, 64), L)
* The inner KangarooTwelve call always uses a fixed 32-byte digest here,
* regardless of the outer `dkLen`.
* @param key - MAC key bytes
* @param message - message bytes to authenticate
* @param personalization - personalization bytes mixed into the inner hash
* @param dkLen - optional output length in bytes
* @returns Authentication tag bytes.
* @example
* Authenticate a message with HopMAC128.
* ```ts
* HopMAC128(new Uint8Array([1]), new Uint8Array([2]), new Uint8Array([3]), 32);
* ```
*/
export const HopMAC128 = /* @__PURE__ */ genHopMAC(kt128);
/**
* 256-bit KangarooTwelve-based MAC.
* Like `HopMAC128`, there are no test vectors or known independent
* implementations available for cross-checking.
* @param key - MAC key bytes
* @param message - message bytes to authenticate
* @param personalization - personalization bytes mixed into the inner hash
* @param dkLen - optional output length in bytes. The inner KangarooTwelve
* call still uses a fixed 64-byte digest here, regardless of the outer
* `dkLen`.
* @returns Authentication tag bytes.
* @example
* Authenticate a message with HopMAC256.
* ```ts
* HopMAC256(new Uint8Array([1]), new Uint8Array([2]), new Uint8Array([3]), 64);
* ```
*/
export const HopMAC256 = /* @__PURE__ */ genHopMAC(kt256);
/**
* More at
* {@link https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG}.
* Accepted capacities must keep `rho = 1598 - capacity` byte-aligned, and
* `.clean()` later also requires `rate > 801`.
*/
export class _KeccakPRG extends Keccak {
rate;
constructor(capacity) {
anumber(capacity);
const rate = 1600 - capacity;
const rho = rate - 2;
// Rho must be full bytes
if (capacity < 0 || capacity > 1600 - 10 || rho % 8)
throw new Error('invalid capacity');
// blockLen = rho in bytes
super(rho / 8, 0, 0, true);
this.rate = rate;
this.posOut = Math.floor((rate + 7) / 8);
}
keccak() {
// Duplex padding
this.state[this.pos] ^= 0x01;
this.state[this.blockLen] ^= 0x02; // Rho is full bytes
super.keccak();
this.pos = 0;
this.posOut = 0;
}
update(data) {
super.update(data);
this.posOut = this.blockLen;
return this;
}
finish() { }
digestInto(_out) {
throw new Error('digest is not allowed, use .randomBytes() instead');
}
addEntropy(seed) {
this.update(seed);
}
randomBytes(length) {
return this.xof(length);
}
clean() {
// clean() mutates live sponge state just like randomBytes(),
// so destroyed instances must reject it.
aexists(this, false);
if (this.rate < 1600 / 2 + 1)
throw new Error('rate is too low to use .forget()');
this.keccak();
for (let i = 0; i < this.blockLen; i++)
this.state[i] = 0;
this.pos = this.blockLen;
this.keccak();
this.posOut = this.blockLen;
}
_cloneInto(to) {
const { rate } = this;
to ||= new _KeccakPRG(1600 - rate);
super._cloneInto(to);
to.rate = rate;
return to;
}
clone() {
return this._cloneInto();
}
}
/**
* KeccakPRG: pseudo-random generator based on Keccak.
* See {@link https://keccak.team/files/CSF-0.1.pdf}.
* @param capacity - sponge capacity in bits. Accepted values are those that
* keep `rho = 1598 - capacity` byte-aligned; the default `254` is chosen
* because it satisfies that duplex layout while leaving a wide byte-aligned
* rate.
* @returns PRG instance backed by a Keccak sponge.
* @example
* Create a Keccak-based pseudorandom generator and read bytes from it.
* ```ts
* const prg = keccakprg(254);
* prg.randomBytes(8);
* ```
*/
export const keccakprg = (capacity = 254) => new _KeccakPRG(capacity);
//# sourceMappingURL=sha3-addons.js.map
@@ -0,0 +1 @@
{"version":3,"file":"matching.cjs","sources":["../../../src/matcher/separator/matching.ts"],"sourcesContent":[null],"names":["separatorRegex","RegExp","SEPERATOR_CHARS","join","MatchSeparator","MatcherBaseClass","getMostUsedSeparatorChar","password","mostUsedSeperators","split","filter","c","test","reduce","memo","m","get","set","parseInt","Map","entries","sort","_a","a","_b","b","length","undefined","match","getSeparatorRegex","separator","result","mostUsedSpecial","isSeparator","matchAll","index","i","push","pattern","token","j"],"mappings":";;;;;AAKA,MAAMA,cAAc,GAAG,IAAIC,MAAM,CAAC,CAAA,CAAA,EAAIC,sBAAe,CAACC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC;AAElE;;;;AAIG;AACH,MAAMC,cAAe,SAAQC,sBAAgB,CAAA;EAC3C,OAAOC,wBAAwBA,CAACC,QAAgB,EAAA;AAC9C,IAAA,MAAMC,kBAAkB,GAAG,CACzB,GAAGD,QAAQ,CACRE,KAAK,CAAC,EAAE,CAAC,CACTC,MAAM,CAAEC,CAAC,IAAKX,cAAc,CAACY,IAAI,CAACD,CAAC,CAAC,CAAC,CACrCE,MAAM,CAAC,CAACC,IAAI,EAAEH,CAAC,KAAI;AAClB,MAAA,MAAMI,CAAC,GAAGD,IAAI,CAACE,GAAG,CAACL,CAAC,CAAC;AACrB,MAAA,IAAII,CAAC,EAAE;AACLD,QAAAA,IAAI,CAACG,GAAG,CAACN,CAAC,EAAEO,QAAQ,CAACH,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAClC,MAAA,CAAC,MAAM;AACLD,QAAAA,IAAI,CAACG,GAAG,CAACN,CAAC,EAAE,CAAC,CAAC;AAChB,MAAA;AACA,MAAA,OAAOG,IAAI;AACb,IAAA,CAAC,EAAE,IAAIK,GAAG,EAAE,CAAC,CACZC,OAAO,EAAE,CACb,CAACC,IAAI,CAAC,CAAC,CAACC,EAAE,EAAEC,CAAC,CAAC,EAAE,CAACC,EAAE,EAAEC,CAAC,CAAC,KAAKA,CAAC,GAAGF,CAAC,CAAC;AACnC,IAAA,IAAI,CAACf,kBAAkB,CAACkB,MAAM,EAAE,OAAOC,SAAS;AAChD,IAAA,MAAMC,KAAK,GAAGpB,kBAAkB,CAAC,CAAC,CAAC;AACnC;IACA,IAAIoB,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,OAAOD,SAAS;IAClC,OAAOC,KAAK,CAAC,CAAC,CAAC;AACjB,EAAA;EAEA,OAAOC,iBAAiBA,CAACC,SAAiB,EAAA;AACxC,IAAA,OAAO,IAAI7B,MAAM,CAAC,CAAA,GAAA,EAAM6B,SAAS,CAAA,KAAA,EAAQA,SAAS,CAAA,IAAA,EAAOA,SAAS,CAAA,CAAA,CAAG,EAAE,GAAG,CAAC;AAC3E;AACA;AACA;AACF,EAAA;AAEAF,EAAAA,KAAKA,CAAC;AAAErB,IAAAA;AAAQ,GAAyB,EAAA;IACvC,MAAMwB,MAAM,GAAqB,EAAE;AAEnC,IAAA,IAAIxB,QAAQ,CAACmB,MAAM,KAAK,CAAC,EAAE,OAAOK,MAAM;AAExC,IAAA,MAAMC,eAAe,GAAG5B,cAAc,CAACE,wBAAwB,CAACC,QAAQ,CAAC;AACzE,IAAA,IAAIyB,eAAe,KAAKL,SAAS,EAAE,OAAOI,MAAM;AAEhD,IAAA,MAAME,WAAW,GAAG7B,cAAc,CAACyB,iBAAiB,CAACG,eAAe,CAAC;IAErE,KAAK,MAAMJ,KAAK,IAAIrB,QAAQ,CAAC2B,QAAQ,CAACD,WAAW,CAAC,EAAE;AAClD,MAAA,IAAIL,KAAK,CAACO,KAAK,KAAKR,SAAS,EAAE;AAE/B;AACA;AACA;AACA,MAAA,MAAMS,CAAC,GAAGR,KAAK,CAACO,KAAK,GAAG,CAAC;MACzBJ,MAAM,CAACM,IAAI,CAAC;AACVC,QAAAA,OAAO,EAAE,WAAW;AACpBC,QAAAA,KAAK,EAAEP,eAAe;QACtBI,CAAC;AACDI,QAAAA,CAAC,EAAEJ;AACJ,OAAA,CAAC;AACJ,IAAA;AACA,IAAA,OAAOL,MAAM;AACf,EAAA;AACD;;;;"}
@@ -0,0 +1,414 @@
flf2a$ 4 4 3 -1 5 0 1 0
▘ ▘ ▘ miniwi font
▛▛▌▌▛▌▌▌▌▌▌ after the miniwi bitmap font
▌▌▌▌▌▌▌▚▚▘▌ http://github.com/sshbio/miniwi
$@
$@
$@
$@@
▌@
▌@
▖@
@@
▌▌@
@
@
@@
▗▗ @
▜▜▘@
▜▜▘@
@@
▗ @
█▘@
▟▌@
▝ @@
▖▖@
▗▘@
▌▖@
@@
▗ @
▚▘@
▚▌@
@@
▌@
@
@
@@
▝▖@
▌@
▌@
▗▘@@
▗▘@
▐ @
▐ @
▝▖@@
▖▖@
▟▖@
▞▖@
@@
@
▟▖@
▝ @
@@
@
@
▗ @
▘ @@
@
▄▖@
@
@@
@
@
▗ @
@@
▌@
▐ @
▞ @
▘ @@
▄▖@
▛▌@
█▌@
@@
▗ @
▜ @
▟▖@
@@
▄▖@
▄▌@
▙▖@
@@
▄▖@
▄▌@
▄▌@
@@
▖▖@
▙▌@
▌@
@@
▄▖@
▙▖@
▄▌@
@@
▄▖@
▙▖@
▙▌@
@@
▄▖@
▌@
▌@
@@
▄▖@
▙▌@
▙▌@
@@
▄▖@
▙▌@
▄▌@
@@
@
▖@
▖@
@@
@
▖@
▖@
▘@@
▖@
▞ @
▝▖@
@@
@
▀▘@
▀▘@
@@
▖ @
▝▖@
▞ @
@@
▄▖@
▗▘@
▗ @
@@
▗▄▖@
▌▄▐@
▌▀▀@
▀ @@
▄▖@
▌▌@
▛▌@
@@
▄ @
▙▘@
▙▘@
@@
▄▖@
▌ @
▙▖@
@@
▄ @
▌▌@
▙▘@
@@
▄▖@
▙▖@
▙▖@
@@
▄▖@
▙▖@
▌ @
@@
▄▖@
▌ @
▙▌@
@@
▖▖@
▙▌@
▌▌@
@@
▄▖@
▐ @
▟▖@
@@
▖@
▌@
▙▌@
@@
▖▖@
▙▘@
▌▌@
@@
▖ @
▌ @
▙▖@
@@
▖ ▖@
▛▖▞▌@
▌▝ ▌@
@@
▖ ▖@
▛▖▌@
▌▝▌@
@@
▄▖@
▌▌@
▙▌@
@@
▄▖@
▙▌@
▌ @
@@
▄▖@
▌▌@
█▌@
▘@@
▄▖@
▙▘@
▌▌@
@@
▄▖@
▚ @
▄▌@
@@
▄▖@
▐ @
▐ @
@@
▖▖@
▌▌@
▙▌@
@@
▖▖@
▌▌@
▚▘@
@@
▖ ▖@
▌▞▖▌@
▛ ▝▌@
@@
▖▖@
▚▘@
▌▌@
@@
▖▖@
▌▌@
▐ @
@@
▄▖@
▗▘@
▙▖@
@@
▐▘@
▐ @
▐ @
▝▘@@
▌ @
▐ @
▝▖@
▘@@
▜ @
▐ @
▐ @
▀ @@
▗ @
▘▘@
@
@@
@
@
▄▖@
@@
▚ @
▘@
@
@@
@
▀▌@
█▌@
@@
▌ @
▛▌@
▙▌@
@@
@
▛▘@
▙▖@
@@
▌@
▛▌@
▙▌@
@@
@
█▌@
▙▖@
@@
▐▘@
▜▘@
▐ @
@@
@
▛▌@
▙▌@
▄▌@@
▌ @
▛▌@
▌▌@
@@
▘@
▌@
▌@
@@
▘@
▌@
▌@
▙▌@@
▌ @
▙▘@
▛▖@
@@
▜ @
▐ @
▐▖@
@@
@
▛▛▌@
▌▌▌@
@@
@
▛▌@
▌▌@
@@
@
▛▌@
▙▌@
@@
@
▛▌@
▙▌@
▌ @@
@
▛▌@
▙▌@
▌@@
@
▛▘@
▌ @
@@
@
▛▘@
▄▌@
@@
▗ @
▜▘@
▐▖@
@@
@
▌▌@
▙▌@
@@
@
▌▌@
▚▘@
@@
@
▌▌▌@
▚▚▘@
@@
@
▚▘@
▞▖@
@@
@
▌▌@
▙▌@
▄▌@@
@
▀▌@
▙▖@
@@
▐▘@
▐ @
▐ @
▐▖@@
▌@
▌@
▌@
▘@@
▜ @
▐▖@
▐ @
▀ @@
@
▖▄ @
▝▘▘@
@@
▚▞@
▌▌@
▛▌@
@@
▚▞@
▌▌@
▙▌@
@@
▘▘@
▌▌@
▙▌@
@@
▘▘@
▀▌@
█▌@
@@
▘▘@
▛▌@
▙▌@
@@
▘▘@
▌▌@
▙▌@
@@
▄▃@
▙▘@
▙▘@
@@
@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error = {
message: "must be equal to one of the allowed values",
params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
};
const def = {
keyword: "enum",
schemaType: "array",
error,
code(cxt) {
(0, metadata_1.checkMetadata)(cxt);
const { gen, data, schema, schemaValue, parentSchema, it } = cxt;
if (schema.length === 0)
throw new Error("enum must have non-empty array");
if (schema.length !== new Set(schema).size)
throw new Error("enum items must be unique");
let valid;
const isString = (0, codegen_1._) `typeof ${data} == "string"`;
if (schema.length >= it.opts.loopEnum) {
let cond;
[valid, cond] = (0, nullable_1.checkNullable)(cxt, isString);
gen.if(cond, loopEnum);
}
else {
/* istanbul ignore if */
if (!Array.isArray(schema))
throw new Error("ajv implementation error");
valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`)));
if (parentSchema.nullable)
valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid);
}
cxt.pass(valid);
function loopEnum() {
gen.forOf("v", schemaValue, (v) => gen.if((0, codegen_1._) `${valid} = ${data} === ${v}`, () => gen.break()));
}
},
};
exports.default = def;
//# sourceMappingURL=enum.js.map
@@ -0,0 +1,28 @@
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_not_found = require("./not-found.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/renderRouteNotFound.tsx
/**
* Renders a not found component for a route when no matching route is found.
*
* @param router - The router instance containing the route configuration
* @param route - The route that triggered the not found state
* @param data - Additional data to pass to the not found component
* @returns The rendered not found component or a default fallback component
*/
function renderRouteNotFound(router, route, data) {
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(router.options.defaultNotFoundComponent, { ...data });
if (process.env.NODE_ENV !== "production") {
if (!route.options.notFoundComponent) console.warn(`Warning: A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`);
}
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_not_found.DefaultGlobalNotFound, {});
}
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(route.options.notFoundComponent, { ...data });
}
//#endregion
exports.renderRouteNotFound = renderRouteNotFound;
//# sourceMappingURL=renderRouteNotFound.cjs.map
@@ -0,0 +1,298 @@
{
"author": "Isaac Z. Schlueter",
"name": "tar",
"description": "tar for node",
"version": "7.5.22",
"repository": {
"type": "git",
"url": "https://github.com/isaacs/node-tar.git"
},
"scripts": {
"genparse": "node scripts/generate-parse-fixtures.js",
"snap": "tap",
"test": "tap",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"prepare": "tshy && bash scripts/build.sh",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"format": "prettier --write . --log-level warn",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
"lint": "oxlint --fix src test",
"postsnap": "npm run lint",
"postlint": "npm run format"
},
"dependencies": {
"@isaacs/fs-minipass": "^4.0.0",
"chownr": "^3.0.0",
"minipass": "^7.1.2",
"minizlib": "^3.1.0",
"yallist": "^5.0.0"
},
"devDependencies": {
"@types/node": "^25.9.1",
"chmodr": "^2.0.2",
"end-of-stream": "^1.4.3",
"esbuild": "^0.28.0",
"events-to-array": "^2.0.3",
"mutate-fs": "^2.1.1",
"nock": "^13.5.4",
"oxlint": "^1.67.0",
"oxlint-tsgolint": "^0.23.0",
"prettier": "^3.8.3",
"rimraf": "^6.1.2",
"tap": "^21.7.4",
"tshy": "^4.1.2",
"typedoc": "^0.28.19"
},
"license": "BlueOak-1.0.0",
"engines": {
"node": ">=18"
},
"files": [
"dist"
],
"tshy": {
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.min.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.min.js"
}
},
"./raw": "./src/index.ts",
"./c": "./src/create.ts",
"./create": "./src/create.ts",
"./replace": "./src/create.ts",
"./r": "./src/create.ts",
"./list": "./src/list.ts",
"./t": "./src/list.ts",
"./update": "./src/update.ts",
"./u": "./src/update.ts",
"./extract": "./src/extract.ts",
"./x": "./src/extract.ts",
"./pack": "./src/pack.ts",
"./unpack": "./src/unpack.ts",
"./parse": "./src/parse.ts",
"./read-entry": "./src/read-entry.ts",
"./write-entry": "./src/write-entry.ts",
"./header": "./src/header.ts",
"./pax": "./src/pax.ts",
"./types": "./src/types.ts"
},
"selfLink": false
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.min.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.min.js"
}
},
"./raw": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./c": {
"import": {
"types": "./dist/esm/create.d.ts",
"default": "./dist/esm/create.js"
},
"require": {
"types": "./dist/commonjs/create.d.ts",
"default": "./dist/commonjs/create.js"
}
},
"./create": {
"import": {
"types": "./dist/esm/create.d.ts",
"default": "./dist/esm/create.js"
},
"require": {
"types": "./dist/commonjs/create.d.ts",
"default": "./dist/commonjs/create.js"
}
},
"./replace": {
"import": {
"types": "./dist/esm/create.d.ts",
"default": "./dist/esm/create.js"
},
"require": {
"types": "./dist/commonjs/create.d.ts",
"default": "./dist/commonjs/create.js"
}
},
"./r": {
"import": {
"types": "./dist/esm/create.d.ts",
"default": "./dist/esm/create.js"
},
"require": {
"types": "./dist/commonjs/create.d.ts",
"default": "./dist/commonjs/create.js"
}
},
"./list": {
"import": {
"types": "./dist/esm/list.d.ts",
"default": "./dist/esm/list.js"
},
"require": {
"types": "./dist/commonjs/list.d.ts",
"default": "./dist/commonjs/list.js"
}
},
"./t": {
"import": {
"types": "./dist/esm/list.d.ts",
"default": "./dist/esm/list.js"
},
"require": {
"types": "./dist/commonjs/list.d.ts",
"default": "./dist/commonjs/list.js"
}
},
"./update": {
"import": {
"types": "./dist/esm/update.d.ts",
"default": "./dist/esm/update.js"
},
"require": {
"types": "./dist/commonjs/update.d.ts",
"default": "./dist/commonjs/update.js"
}
},
"./u": {
"import": {
"types": "./dist/esm/update.d.ts",
"default": "./dist/esm/update.js"
},
"require": {
"types": "./dist/commonjs/update.d.ts",
"default": "./dist/commonjs/update.js"
}
},
"./extract": {
"import": {
"types": "./dist/esm/extract.d.ts",
"default": "./dist/esm/extract.js"
},
"require": {
"types": "./dist/commonjs/extract.d.ts",
"default": "./dist/commonjs/extract.js"
}
},
"./x": {
"import": {
"types": "./dist/esm/extract.d.ts",
"default": "./dist/esm/extract.js"
},
"require": {
"types": "./dist/commonjs/extract.d.ts",
"default": "./dist/commonjs/extract.js"
}
},
"./pack": {
"import": {
"types": "./dist/esm/pack.d.ts",
"default": "./dist/esm/pack.js"
},
"require": {
"types": "./dist/commonjs/pack.d.ts",
"default": "./dist/commonjs/pack.js"
}
},
"./unpack": {
"import": {
"types": "./dist/esm/unpack.d.ts",
"default": "./dist/esm/unpack.js"
},
"require": {
"types": "./dist/commonjs/unpack.d.ts",
"default": "./dist/commonjs/unpack.js"
}
},
"./parse": {
"import": {
"types": "./dist/esm/parse.d.ts",
"default": "./dist/esm/parse.js"
},
"require": {
"types": "./dist/commonjs/parse.d.ts",
"default": "./dist/commonjs/parse.js"
}
},
"./read-entry": {
"import": {
"types": "./dist/esm/read-entry.d.ts",
"default": "./dist/esm/read-entry.js"
},
"require": {
"types": "./dist/commonjs/read-entry.d.ts",
"default": "./dist/commonjs/read-entry.js"
}
},
"./write-entry": {
"import": {
"types": "./dist/esm/write-entry.d.ts",
"default": "./dist/esm/write-entry.js"
},
"require": {
"types": "./dist/commonjs/write-entry.d.ts",
"default": "./dist/commonjs/write-entry.js"
}
},
"./header": {
"import": {
"types": "./dist/esm/header.d.ts",
"default": "./dist/esm/header.js"
},
"require": {
"types": "./dist/commonjs/header.d.ts",
"default": "./dist/commonjs/header.js"
}
},
"./pax": {
"import": {
"types": "./dist/esm/pax.d.ts",
"default": "./dist/esm/pax.js"
},
"require": {
"types": "./dist/commonjs/pax.d.ts",
"default": "./dist/commonjs/pax.js"
}
},
"./types": {
"import": {
"types": "./dist/esm/types.d.ts",
"default": "./dist/esm/types.js"
},
"require": {
"types": "./dist/commonjs/types.d.ts",
"default": "./dist/commonjs/types.js"
}
}
},
"type": "module",
"main": "./dist/commonjs/index.min.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.min.js"
}
@@ -0,0 +1,61 @@
# Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structure that small copy overhead ends up
taking seconds in a project the size of Chromium."""
class Error(Exception):
pass
__all__ = ["Error", "deepcopy"]
def deepcopy(x):
"""Deep copy operation on gyp objects such as strings, ints, dicts
and lists. More than twice as fast as copy.deepcopy but much less
generic."""
try:
return _deepcopy_dispatch[type(x)](x)
except KeyError:
raise Error(
f"Unsupported type {type(x)} for deepcopy. Use copy.deepcopy "
+ "or expand simple_copy support."
)
_deepcopy_dispatch = d = {}
def _deepcopy_atomic(x):
return x
types = bool, float, int, str, type, type(None)
for x in types:
d[x] = _deepcopy_atomic
def _deepcopy_list(x):
return [deepcopy(a) for a in x]
d[list] = _deepcopy_list
def _deepcopy_dict(x):
y = {}
for key, value in x.items():
y[deepcopy(key)] = deepcopy(value)
return y
d[dict] = _deepcopy_dict
del d
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
TILES 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,319 @@
/**
* @fileoverview Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead
* @author Sharmila Jesupaul
*/
"use strict";
const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils");
const {
isCommaToken,
isOpeningParenToken,
isClosingParenToken,
isParenthesised,
} = require("./utils/ast-utils");
const ANY_SPACE = /\s/u;
/**
* Helper that checks if the Object.assign call has array spread
* @param {ASTNode} node The node that the rule warns on
* @returns {boolean} - Returns true if the Object.assign call has array spread
*/
function hasArraySpread(node) {
return node.arguments.some(arg => arg.type === "SpreadElement");
}
/**
* Determines whether the given node is an accessor property (getter/setter).
* @param {ASTNode} node Node to check.
* @returns {boolean} `true` if the node is a getter or a setter.
*/
function isAccessorProperty(node) {
return (
node.type === "Property" && (node.kind === "get" || node.kind === "set")
);
}
/**
* Determines whether the given object expression node has accessor properties (getters/setters).
* @param {ASTNode} node `ObjectExpression` node to check.
* @returns {boolean} `true` if the node has at least one getter/setter.
*/
function hasAccessors(node) {
return node.properties.some(isAccessorProperty);
}
/**
* Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters).
* @param {ASTNode} node `CallExpression` node to check.
* @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter.
*/
function hasArgumentsWithAccessors(node) {
return node.arguments
.filter(arg => arg.type === "ObjectExpression")
.some(hasAccessors);
}
/**
* Helper that checks if the node needs parentheses to be valid JS.
* The default is to wrap the node in parentheses to avoid parsing errors.
* @param {ASTNode} node The node that the rule warns on
* @param {Object} sourceCode in context sourcecode object
* @returns {boolean} - Returns true if the node needs parentheses
*/
function needsParens(node, sourceCode) {
const parent = node.parent;
switch (parent.type) {
case "VariableDeclarator":
case "ArrayExpression":
case "ReturnStatement":
case "CallExpression":
case "Property":
return false;
case "AssignmentExpression":
return parent.left === node && !isParenthesised(sourceCode, node);
default:
return !isParenthesised(sourceCode, node);
}
}
/**
* Determines if an argument needs parentheses. The default is to not add parens.
* @param {ASTNode} node The node to be checked.
* @param {Object} sourceCode in context sourcecode object
* @returns {boolean} True if the node needs parentheses
*/
function argNeedsParens(node, sourceCode) {
switch (node.type) {
case "AssignmentExpression":
case "ArrowFunctionExpression":
case "ConditionalExpression":
return !isParenthesised(sourceCode, node);
default:
return false;
}
}
/**
* Get the parenthesis tokens of a given ObjectExpression node.
* This includes the braces of the object literal and enclosing parentheses.
* @param {ASTNode} node The node to get.
* @param {Token} leftArgumentListParen The opening paren token of the argument list.
* @param {SourceCode} sourceCode The source code object to get tokens.
* @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location.
*/
function getParenTokens(node, leftArgumentListParen, sourceCode) {
const parens = [
sourceCode.getFirstToken(node),
sourceCode.getLastToken(node),
];
let leftNext = sourceCode.getTokenBefore(node);
let rightNext = sourceCode.getTokenAfter(node);
// Note: don't include the parens of the argument list.
while (
leftNext &&
rightNext &&
leftNext.range[0] > leftArgumentListParen.range[0] &&
isOpeningParenToken(leftNext) &&
isClosingParenToken(rightNext)
) {
parens.push(leftNext, rightNext);
leftNext = sourceCode.getTokenBefore(leftNext);
rightNext = sourceCode.getTokenAfter(rightNext);
}
return parens.sort((a, b) => a.range[0] - b.range[0]);
}
/**
* Get the range of a given token and around whitespaces.
* @param {Token} token The token to get range.
* @param {SourceCode} sourceCode The source code object to get tokens.
* @returns {number} The end of the range of the token and around whitespaces.
*/
function getStartWithSpaces(token, sourceCode) {
const text = sourceCode.text;
let start = token.range[0];
// If the previous token is a line comment then skip this step to avoid commenting this token out.
{
const prevToken = sourceCode.getTokenBefore(token, {
includeComments: true,
});
if (prevToken && prevToken.type === "Line") {
return start;
}
}
// Detect spaces before the token.
while (ANY_SPACE.test(text[start - 1] || "")) {
start -= 1;
}
return start;
}
/**
* Get the range of a given token and around whitespaces.
* @param {Token} token The token to get range.
* @param {SourceCode} sourceCode The source code object to get tokens.
* @returns {number} The start of the range of the token and around whitespaces.
*/
function getEndWithSpaces(token, sourceCode) {
const text = sourceCode.text;
let end = token.range[1];
// Detect spaces after the token.
while (ANY_SPACE.test(text[end] || "")) {
end += 1;
}
return end;
}
/**
* Autofixes the Object.assign call to use an object spread instead.
* @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call
* @param {string} sourceCode sourceCode of the Object.assign call
* @returns {Function} autofixer - replaces the Object.assign with a spread object.
*/
function defineFixer(node, sourceCode) {
return function* (fixer) {
const leftParen = sourceCode.getTokenAfter(
node.callee,
isOpeningParenToken,
);
const rightParen = sourceCode.getLastToken(node);
// Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren.
yield fixer.removeRange([node.range[0], leftParen.range[0]]);
// Replace the parens of argument list to braces.
if (needsParens(node, sourceCode)) {
yield fixer.replaceText(leftParen, "({");
yield fixer.replaceText(rightParen, "})");
} else {
yield fixer.replaceText(leftParen, "{");
yield fixer.replaceText(rightParen, "}");
}
// Process arguments.
for (const argNode of node.arguments) {
const innerParens = getParenTokens(argNode, leftParen, sourceCode);
const left = innerParens.shift();
const right = innerParens.pop();
if (argNode.type === "ObjectExpression") {
const maybeTrailingComma = sourceCode.getLastToken(argNode, 1);
const maybeArgumentComma = sourceCode.getTokenAfter(right);
/*
* Make bare this object literal.
* And remove spaces inside of the braces for better formatting.
*/
for (const innerParen of innerParens) {
yield fixer.remove(innerParen);
}
const leftRange = [
left.range[0],
getEndWithSpaces(left, sourceCode),
];
const rightRange = [
Math.max(
getStartWithSpaces(right, sourceCode),
leftRange[1],
), // Ensure ranges don't overlap
right.range[1],
];
yield fixer.removeRange(leftRange);
yield fixer.removeRange(rightRange);
// Remove the comma of this argument if it's duplication.
if (
(argNode.properties.length === 0 ||
isCommaToken(maybeTrailingComma)) &&
isCommaToken(maybeArgumentComma)
) {
yield fixer.remove(maybeArgumentComma);
}
} else {
// Make spread.
if (argNeedsParens(argNode, sourceCode)) {
yield fixer.insertTextBefore(left, "...(");
yield fixer.insertTextAfter(right, ")");
} else {
yield fixer.insertTextBefore(left, "...");
}
}
}
};
}
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/prefer-object-spread",
},
schema: [],
fixable: "code",
messages: {
useSpreadMessage:
"Use an object spread instead of `Object.assign` eg: `{ ...foo }`.",
useLiteralMessage:
"Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
Program(node) {
const scope = sourceCode.getScope(node);
const tracker = new ReferenceTracker(scope);
const trackMap = {
Object: {
assign: { [CALL]: true },
},
};
// Iterate all calls of `Object.assign` (only of the global variable `Object`).
for (const { node: refNode } of tracker.iterateGlobalReferences(
trackMap,
)) {
if (
refNode.arguments.length >= 1 &&
refNode.arguments[0].type === "ObjectExpression" &&
!hasArraySpread(refNode) &&
!(
refNode.arguments.length > 1 &&
hasArgumentsWithAccessors(refNode)
)
) {
const messageId =
refNode.arguments.length === 1
? "useLiteralMessage"
: "useSpreadMessage";
const fix = defineFixer(refNode, sourceCode);
context.report({ node: refNode, messageId, fix });
}
}
},
};
},
};
@@ -0,0 +1,2 @@
'use strict';
require('../register')('es6-promise', {Promise: require('es6-promise').Promise})
@@ -0,0 +1,47 @@
import * as React from 'react';
export declare type removeCb = () => void;
export declare type MediumCallback<T> = (data: T) => any;
export declare type MiddlewareCallback<T> = (data: T, assigned: boolean) => T;
export declare type SidePush<T> = {
length?: number;
push(data: T): void;
filter(cb: (x: T) => boolean): SidePush<T>;
};
/**
* An object describing side medium
*/
export interface SideMedium<T> {
/**
* Pushes effect to the medium
* @param effect any information for real handler
*/
useMedium(effect: T): removeCb;
/**
* Assigns effect handler to the medium
* @param {Function(effect: T)} handler effect handler
*/
assignMedium(handler: MediumCallback<T>): void;
/**
* Assigns a synchronous effect handler to the medium, which would be executed right on call
* @param {Function(effect: T)} handler effect handler
*/
assignSyncMedium(handler: MediumCallback<T>): void;
/**
* reads the data stored in the medium
*/
read(): T | undefined;
options?: Record<string, any>;
}
export declare type DefaultOrNot<T> = {
default: T;
} | T;
export declare type Importer<T> = () => Promise<DefaultOrNot<React.ComponentType<T>>>;
export declare type SideCarMedium<T = {}> = SideMedium<React.ComponentType<T>>;
export declare type SideCarHOC<T = {}> = {
readonly sideCar: SideCarMedium<T>;
};
export declare type SideCarComponent<T> = React.FunctionComponent<T & SideCarHOC<T>>;
export declare type SideCarMediumOptions = {
async?: boolean;
ssr?: boolean;
};
@@ -0,0 +1,37 @@
# zxcvbn-ts
**zxcvbn** is a password strength estimator inspired by password crackers.
It recognizes and analyzes over 40 thousand common passwords using pattern matching and conservative estimation and
filters out common first names, last names, popular words from Wikipedia and common words in many cultures,
and recognizes common patterns like dates, repetitions (e.g. 'aaa'), sequences (e.g. 'abcd'), keyboard smashes (e.g. 'qwertyuiop'), and l33t speak.
## Installation
#### npm:
`npm install @zxcvbn-ts/core @zxcvbn-ts/language-common --save`
#### yarn:
`yarn add @zxcvbn-ts/core @zxcvbn-ts/language-common`
## Setup
```js
import { ZxcvbnFactory } from '@zxcvbn-ts/core'
import * as zxcvbnCommonPackage from '@zxcvbn-ts/language-common'
import * as zxcvbnEnPackage from '@zxcvbn-ts/language-en'
const options = {
dictionary: {
...zxcvbnCommonPackage.dictionary,
...zxcvbnEnPackage.dictionary,
},
graphs: zxcvbnCommonPackage.adjacencyGraphs,
translations: zxcvbnEnPackage.translations,
}
const zxcvbn = new ZxcvbnFactory(options)
const password = 'somePassword'
zxcvbn.check(password)
```
@@ -0,0 +1,78 @@
{
"name": "@radix-ui/react-use-escape-keydown",
"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"
},
"dependencies": {
"@radix-ui/react-use-callback-ref": "1.1.1"
},
"devDependencies": {
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"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"
},
"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,27 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_adapter_service_worker_handler = require("./handler.js");
//#region src/adapter/service-worker/index.ts
/**
* Registers a Hono app to handle fetch events in a service worker.
* This sets up `addEventListener('fetch', handle(app, options))` for the provided app.
*
* @param app - The Hono application instance
* @param options - Options for handling requests (fetch defaults to undefined)
* @example
* ```ts
* import { Hono } from 'hono'
* import { fire } from 'hono/service-worker'
*
* const app = new Hono()
*
* app.get('/', (c) => c.text('Hi'))
*
* fire(app)
* ```
*/
const fire = (app, options) => {
addEventListener("fetch", require_adapter_service_worker_handler.handle(app, options));
};
//#endregion
exports.fire = fire;
exports.handle = require_adapter_service_worker_handler.handle;
@@ -0,0 +1,57 @@
{
"name": "eslint-visitor-keys",
"version": "5.0.1",
"description": "Constants and utilities about visitor keys to traverse AST.",
"type": "module",
"main": "dist/eslint-visitor-keys.cjs",
"types": "./dist/index.d.ts",
"exports": {
".": [
{
"import": "./lib/index.js",
"require": "./dist/eslint-visitor-keys.cjs"
},
"./dist/eslint-visitor-keys.cjs"
],
"./package.json": "./package.json"
},
"files": [
"dist/index.d.ts",
"dist/visitor-keys.d.ts",
"dist/eslint-visitor-keys.cjs",
"dist/eslint-visitor-keys.d.cts",
"lib"
],
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24"
},
"devDependencies": {
"rollup-plugin-dts": "^6.2.3",
"tsd": "^0.33.0"
},
"scripts": {
"build": "npm run build:cjs && npm run build:types",
"build:cjs": "rollup -c",
"build:debug": "npm run build:cjs -- -m && npm run build:types",
"build:types": "tsc -v && tsc",
"test": "mocha \"tests/**/*.test.cjs\" && mocha \"tests/**/*.test.js\" && npm run test:types",
"test:coverage": "c8 npm test",
"test:types": "tsd"
},
"repository": {
"type": "git",
"url": "https://github.com/eslint/js.git",
"directory": "packages/eslint-visitor-keys"
},
"funding": "https://opencollective.com/eslint",
"keywords": [
"eslint"
],
"author": "Toru Nagashima (https://github.com/mysticatea)",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/eslint/js/issues"
},
"homepage": "https://github.com/eslint/js/blob/main/packages/eslint-visitor-keys/README.md",
"sideEffects": false
}
@@ -0,0 +1,417 @@
flf2a$ 4 3 10 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.0 -- 30 aug 1995
____________________________________________________________ /`____
| Michel Eftimakis "Ascii-Artist" | '\/ |
| Michel.Eftimakis@sophia.europe.vlsi.com | Boo)- (00) ||
| | (_`'_) ||
|___________________________________________|____ FRANCE ___ _!!_ ____||
|_____________________________________________________________________|
$$@
$$@
$$@
$$@@
_ @
))@
(($@
o @@
@
UU@
$$@
@@
_ _ @
-))-))-@
-((-((-$@
@@
_n_@
)(_@
._)/@
U @@
@
o/7@
//o@
@@
@
()@
(_7@
@@
_@
/'@
$$@
@@
_ @
//$@
(( $@
\\ @@
_ @
$\\ @
$ ))@
// @@
@
><@
$$@
@@
@
$@
-|-$@
@@
@
@
$_@
/'@@
@
$@
--$@
@@
@
$ $@
$o$@
@@
@
/7@
//$@
@@
___ @
)) )@
((_($@
@@
_ @
'))@
(($@
@@
__ @
_))@
((_$@
@@
__ @
_))@
_(($@
@@
_ @
/'| @
((_($@
@@
___ @
))_ @
$_))@
@@
_ @
)L @
((_)@
@@
___@
/'@
(($@
@@
__ @
)L)@
((_)@
@@
__ @
((_)@
_($@
@@
@
$o$@
$o$@
@@
@
$o$@
$_$@
/' @@
//@
<<$@
\\@
@@
@
__$@
--$@
@@
\\ @
$>>@
// @
@@
__ @
'_))@
(( $@
o @@
__ @
))c)@
((__,@
@@
__ @
/_`)@
(( ($@
@@
___ @
))_)@
((__)@
@@
___$@
)) @
((__ @
@@
__ @
))\@
((_/@
@@
___$@
)L @
((_$ @
@@
___$@
)L @
(( $ @
@@
___@
))_@
((_(@
@@
_ _ @
)L`)@
(( ($@
@@
_ @
))@
(($@
@@
_ @
))@
(($@
._))@@
_ @
)L7@
((`\@
@@
_ @
)) @
((__@
@@
_ _ @
)\/,)@
((`(($@
@@
_ _ @
)\`)@
((`($@
@@
___ @
)) )@
((_($@
@@
___ @
))_)@
(( $ @
@@
___ @
)) )@
((_($@
`) @@
___ @
))_)@
((`\$@
@@
___ @
))_ @
_(($@
@@
____$@
)) @
(($ @
@@
_ _ @
))`)@
((_($@
@@
_ _ @
))`)@
((,'$@
@@
_ _ _ @
))`)`)@
((,(,'$@
@@
_ _$@
))/' @
// \$ @
@@
_ _ @
`\`)@
(($@
@@
____$@
/,' @
((__ @
@@
_ @
|_|@
||$@
|_|@@
_ @
\\ @
\\ @
@@
_ @
|_|@
$||@
|_|@@
@
'`@
$ @
@@
@
@
@
===@@
_ @
`\@
$@
@@
@
___ @
((_($@
@@
_ @
)) @
((_)@
@@
@
__ @
((_$@
@@
_ @
__))@
((_($@
@@
@
__@
(('@
@@
__ @
)L`@
(($ @
@@
@
___ @
((_($@
_))@@
_ @
))_ @
((`($@
@@
o @
_ @
(($@
@@
o @
_ @
(($@
_))@@
_ @
)L,@
((\$@
@@
_ @
))@
(($@
@@
@
_ _ @
((`1($@
@@
@
_ _ @
((\($@
@@
@
__ @
((_)@
@@
@
__ @
((_)@
)) @@
@
__ @
((_)@
))@@
@
__ @
(|$$@
@@
@
__@
_))@
@@
_ @
)L@
(($@
@@
@
_ @
((_($@
@@
@
__ _@
\(/'@
@@
@
__ _ _@
\(((/'@
@@
@
_ _ @
)(($@
@@
@
__ _@
\(/'@
)) @@
@
__ @
((_@
@@
_@
//@
<($@
\\@@
_ @
))@
(($@
))@@
_ @
\\ @
$)>@
// @@
@
7\7@
$ @
@@
oo @
/_`)@
(( ($@
@@
o_o @
)) )@
((_($@
@@
o o @
))`)@
((_($@
@@
oo @
___ @
((_($@
@@
oo @
__ @
((_)@
@@
oo @
_ @
((_($@
@@
___ @
))_)@
((__)@
)) @@
@@ -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 Rss = createLucideIcon("Rss", [
["path", { d: "M4 11a9 9 0 0 1 9 9", key: "pv89mb" }],
["path", { d: "M4 4a16 16 0 0 1 16 16", key: "k0647b" }],
["circle", { cx: "5", cy: "19", r: "1", key: "bfqh0e" }]
]);
export { Rss as default };
//# sourceMappingURL=rss.js.map
@@ -0,0 +1,5 @@
import { AllLoaderData, RouteById } from './routeInfo.cjs';
import { AnyRouter } from './router.cjs';
import { Expand } from './utils.cjs';
export type ResolveUseLoaderData<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? AllLoaderData<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['loaderData']>;
export type UseLoaderDataResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseLoaderData<TRouter, TFrom, TStrict> : TSelected;
@@ -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 HandHelping = createLucideIcon("HandHelping", [
["path", { d: "M11 12h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 14", key: "1j4xps" }],
[
"path",
{
d: "m7 18 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",
key: "uospg8"
}
],
["path", { d: "m2 13 6 6", key: "16e5sb" }]
]);
export { HandHelping as default };
//# sourceMappingURL=hand-helping.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_pR","2":"_q _2B _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_c"},G:{"1":"_t","2":"_d"},H:{"2":"1D"},I:{"1":"I _mN","4":"_BO 5D"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"Range input type",D:true};
@@ -0,0 +1,9 @@
export type Callback = (
directory: string,
files: string[],
) => string | false | void;
export default function (
directory: string,
callback: Callback,
): string | void;
@@ -0,0 +1,233 @@
/**
* @fileoverview Rule to disallow certain object properties
* @author Will Klein & Eli White
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow certain properties on certain objects",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-restricted-properties",
},
schema: {
type: "array",
items: {
type: "object",
properties: {
object: {
type: "string",
},
property: {
type: "string",
},
allowObjects: {
type: "array",
items: {
type: "string",
},
uniqueItems: true,
},
allowProperties: {
type: "array",
items: {
type: "string",
},
uniqueItems: true,
},
message: {
type: "string",
},
},
anyOf: [
{
required: ["object"],
},
{
required: ["property"],
},
],
not: {
anyOf: [
{ required: ["allowObjects", "object"] },
{ required: ["allowProperties", "property"] },
],
},
additionalProperties: false,
},
uniqueItems: true,
},
messages: {
restrictedObjectProperty:
// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
"'{{objectName}}.{{propertyName}}' is restricted from being used.{{allowedPropertiesMessage}}{{message}}",
restrictedProperty:
// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
"'{{propertyName}}' is restricted from being used.{{allowedObjectsMessage}}{{message}}",
},
},
create(context) {
const restrictedCalls = context.options;
if (restrictedCalls.length === 0) {
return {};
}
const restrictedProperties = new Map();
const globallyRestrictedObjects = new Map();
const globallyRestrictedProperties = new Map();
restrictedCalls.forEach(option => {
const objectName = option.object;
const propertyName = option.property;
if (typeof objectName === "undefined") {
globallyRestrictedProperties.set(propertyName, {
allowObjects: option.allowObjects,
message: option.message,
});
} else if (typeof propertyName === "undefined") {
globallyRestrictedObjects.set(objectName, {
allowProperties: option.allowProperties,
message: option.message,
});
} else {
if (!restrictedProperties.has(objectName)) {
restrictedProperties.set(objectName, new Map());
}
restrictedProperties.get(objectName).set(propertyName, {
message: option.message,
});
}
});
/**
* Checks if a name is in the allowed list.
* @param {string} name The name to check
* @param {string[]} [allowedList] The list of allowed names
* @returns {boolean} True if the name is allowed, false otherwise
*/
function isAllowed(name, allowedList) {
if (!allowedList) {
return false;
}
return allowedList.includes(name);
}
/**
* Checks to see whether a property access is restricted, and reports it if so.
* @param {ASTNode} node The node to report
* @param {string} objectName The name of the object
* @param {string} propertyName The name of the property
* @returns {undefined}
*/
function checkPropertyAccess(node, objectName, propertyName) {
if (propertyName === null) {
return;
}
const matchedObject = restrictedProperties.get(objectName);
const matchedObjectProperty = matchedObject
? matchedObject.get(propertyName)
: globallyRestrictedObjects.get(objectName);
const globalMatchedProperty =
globallyRestrictedProperties.get(propertyName);
if (
matchedObjectProperty &&
!isAllowed(propertyName, matchedObjectProperty.allowProperties)
) {
const message = matchedObjectProperty.message
? ` ${matchedObjectProperty.message}`
: "";
const allowedPropertiesMessage =
matchedObjectProperty.allowProperties
? ` Only these properties are allowed: ${matchedObjectProperty.allowProperties.join(", ")}.`
: "";
context.report({
node,
messageId: "restrictedObjectProperty",
data: {
objectName,
propertyName,
message,
allowedPropertiesMessage,
},
});
} else if (
globalMatchedProperty &&
!isAllowed(objectName, globalMatchedProperty.allowObjects)
) {
const message = globalMatchedProperty.message
? ` ${globalMatchedProperty.message}`
: "";
const allowedObjectsMessage = globalMatchedProperty.allowObjects
? ` Property '${propertyName}' is only allowed on these objects: ${globalMatchedProperty.allowObjects.join(", ")}.`
: "";
context.report({
node,
messageId: "restrictedProperty",
data: {
propertyName,
message,
allowedObjectsMessage,
},
});
}
}
return {
MemberExpression(node) {
checkPropertyAccess(
node,
node.object && node.object.name,
astUtils.getStaticPropertyName(node),
);
},
ObjectPattern(node) {
let objectName = null;
if (node.parent.type === "VariableDeclarator") {
if (
node.parent.init &&
node.parent.init.type === "Identifier"
) {
objectName = node.parent.init.name;
}
} else if (
node.parent.type === "AssignmentExpression" ||
node.parent.type === "AssignmentPattern"
) {
if (node.parent.right.type === "Identifier") {
objectName = node.parent.right.name;
}
}
node.properties.forEach(property => {
checkPropertyAccess(
node,
objectName,
astUtils.getStaticPropertyName(property),
);
});
},
};
},
};
@@ -0,0 +1,9 @@
'use strict'
const Range = require('../classes/range')
const intersects = (r1, r2, options) => {
r1 = new Range(r1, options)
r2 = new Range(r2, options)
return r1.intersects(r2, options)
}
module.exports = intersects
@@ -0,0 +1,3 @@
import { Delay } from "../delay.base";
export declare class AlwaysDelay extends Delay {
}
@@ -0,0 +1,51 @@
import { sha256 } from "./crypto.js";
//#region src/utils/buffer.ts
/**
* @module
* Buffer utility.
*/
const equal = (a, b) => {
if (a === b) return true;
if (a.byteLength !== b.byteLength) return false;
const va = new DataView(a);
const vb = new DataView(b);
let i = va.byteLength;
while (i--) if (va.getUint8(i) !== vb.getUint8(i)) return false;
return true;
};
const constantTimeEqualString = (a, b) => {
const aLen = a.length;
const bLen = b.length;
const maxLen = Math.max(aLen, bLen);
let out = aLen ^ bLen;
for (let i = 0; i < maxLen; i++) {
const aChar = i < aLen ? a.charCodeAt(i) : 0;
const bChar = i < bLen ? b.charCodeAt(i) : 0;
out |= aChar ^ bChar;
}
return out === 0;
};
const timingSafeEqualString = async (a, b, hashFunction) => {
if (!hashFunction) hashFunction = sha256;
const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]);
if (sa == null || sb == null || typeof sa !== "string" || typeof sb !== "string") return false;
const hashEqual = constantTimeEqualString(sa, sb);
const originalEqual = constantTimeEqualString(a, b);
return hashEqual && originalEqual;
};
const timingSafeEqual = async (a, b, hashFunction) => {
if (typeof a === "string" && typeof b === "string") return timingSafeEqualString(a, b, hashFunction);
if (!hashFunction) hashFunction = sha256;
const [sa, sb] = await Promise.all([hashFunction(a), hashFunction(b)]);
if (!sa || !sb || typeof sa !== "string" || typeof sb !== "string") return false;
return timingSafeEqualString(sa, sb);
};
const bufferToString = (buffer) => {
if (buffer instanceof ArrayBuffer) return new TextDecoder("utf-8").decode(buffer);
return buffer;
};
const bufferToFormData = (arrayBuffer, contentType) => {
return new Response(arrayBuffer, { headers: { "Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase()) } }).formData();
};
//#endregion
export { bufferToFormData, bufferToString, equal, timingSafeEqual };