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,127 @@
/// <reference types="../types/index.d.ts" />
// (c) 2020-present Andrea Giammarchi
const {parse: $parse, stringify: $stringify} = JSON;
const {keys} = Object;
const Primitive = String; // it could be Number
const primitive = 'string'; // it could be 'number'
const ignore = {};
const object = 'object';
const noop = (_, value) => value;
const primitives = value => (
value instanceof Primitive ? Primitive(value) : value
);
const Primitives = (_, value) => (
typeof value === primitive ? new Primitive(value) : value
);
const resolver = (input, lazy, parsed, $) => output => {
for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
const k = ke[y];
const value = output[k];
if (value instanceof Primitive) {
const tmp = input[+value];
if (typeof tmp === object && !parsed.has(tmp)) {
parsed.add(tmp);
output[k] = ignore;
lazy.push({ o: output, k, r: tmp });
}
else
output[k] = $.call(output, k, tmp);
}
else if (output[k] !== ignore)
output[k] = $.call(output, k, value);
}
return output;
};
const set = (known, input, value) => {
const index = Primitive(input.push(value) - 1);
known.set(value, index);
return index;
};
/**
* Converts a specialized flatted string into a JS value.
* @param {string} text
* @param {(this: any, key: string, value: any) => any} [reviver]
* @returns {any}
*/
export const parse = (text, reviver) => {
const input = $parse(text, Primitives).map(primitives);
const $ = reviver || noop;
let value = input[0];
if (typeof value === object && value) {
const lazy = [];
const revive = resolver(input, lazy, new Set, $);
value = revive(value);
let i = 0;
while (i < lazy.length) {
// it could be a lazy.shift() but that's costly
const {o, k, r} = lazy[i++];
o[k] = $.call(o, k, revive(r));
}
}
return $.call({'': value}, '', value);
};
/**
* Converts a JS value into a specialized flatted string.
* @param {any} value
* @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]
* @param {string | number | undefined} [space]
* @returns {string}
*/
export const stringify = (value, replacer, space) => {
const $ = replacer && typeof replacer === object ?
(k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
(replacer || noop);
const known = new Map;
const input = [];
const output = [];
let i = +set(known, input, $.call({'': value}, '', value));
let firstRun = !i;
while (i < input.length) {
firstRun = true;
output[i] = $stringify(input[i++], replace, space);
}
return '[' + output.join(',') + ']';
function replace(key, value) {
if (firstRun) {
firstRun = !firstRun;
return value;
}
const after = $.call(this, key, value);
switch (typeof after) {
case object:
if (after === null) return after;
case primitive:
return known.get(after) || set(known, input, after);
}
return after;
}
};
/**
* Converts a generic value into a JSON serializable object without losing recursion.
* @param {any} value
* @returns {any}
*/
export const toJSON = value => $parse(stringify(value));
/**
* Converts a previously serialized object with recursion into a recursive one.
* @param {any} value
* @returns {any}
*/
export const fromJSON = value => parse($stringify(value));
@@ -0,0 +1,37 @@
import { ZodSchema, ZodTypeDef } from "zod/v3";
import { Refs, Seen } from "./Refs";
import { JsonSchema7Type } from "./parseTypes";
export type Targets = "jsonSchema7" | "jsonSchema2019-09" | "openApi3" | "openAi";
export type DateStrategy = "format:date-time" | "format:date" | "string" | "integer";
export declare const ignoreOverride: unique symbol;
export type OverrideCallback = (def: ZodTypeDef, refs: Refs, seen: Seen | undefined, forceResolution?: boolean) => JsonSchema7Type | undefined | typeof ignoreOverride;
export type PostProcessCallback = (jsonSchema: JsonSchema7Type | undefined, def: ZodTypeDef, refs: Refs) => JsonSchema7Type | undefined;
export declare const jsonDescription: PostProcessCallback;
export type Options<Target extends Targets = "jsonSchema7"> = {
name: string | undefined;
$refStrategy: "root" | "relative" | "none" | "seen";
basePath: string[];
effectStrategy: "input" | "any";
pipeStrategy: "input" | "output" | "all";
dateStrategy: DateStrategy | DateStrategy[];
mapStrategy: "entries" | "record";
removeAdditionalStrategy: "passthrough" | "strict";
allowedAdditionalProperties: true | undefined;
rejectedAdditionalProperties: false | undefined;
target: Target;
strictUnions: boolean;
definitionPath: string;
definitions: Record<string, ZodSchema>;
errorMessages: boolean;
markdownDescription: boolean;
patternStrategy: "escape" | "preserve";
applyRegexFlags: boolean;
emailStrategy: "format:email" | "format:idn-email" | "pattern:zod";
base64Strategy: "format:binary" | "contentEncoding:base64" | "pattern:zod";
nameStrategy: "ref" | "title";
override?: OverrideCallback;
postProcess?: PostProcessCallback;
openAiAnyTypeName: string;
};
export declare const defaultOptions: Options;
export declare const getDefaultOptions: <Target extends Targets>(options: string | Partial<Options<Target>> | undefined) => Options<Target>;
@@ -0,0 +1,145 @@
const { compareRangeCovs } = require("./compare");
function emitForest(trees) {
return emitForestLines(trees).join("\n");
}
function emitForestLines(trees) {
const colMap = getColMap(trees);
const header = emitOffsets(colMap);
return [header, ...trees.map((tree) => emitTree(tree, colMap).join("\n"))];
}
function getColMap(trees) {
const eventSet = new Set();
for (const tree of trees) {
const stack = [tree];
while (stack.length > 0) {
const cur = stack.pop();
eventSet.add(cur.start);
eventSet.add(cur.end);
for (const child of cur.children) {
stack.push(child);
}
}
}
const events = [...eventSet];
events.sort((a, b) => a - b);
let maxDigits = 1;
for (const event of events) {
maxDigits = Math.max(maxDigits, event.toString(10).length);
}
const colWidth = maxDigits + 3;
const colMap = new Map();
for (const [i, event] of events.entries()) {
colMap.set(event, i * colWidth);
}
return colMap;
}
function emitTree(tree, colMap) {
const layers = [];
let nextLayer = [tree];
while (nextLayer.length > 0) {
const layer = nextLayer;
layers.push(layer);
nextLayer = [];
for (const node of layer) {
for (const child of node.children) {
nextLayer.push(child);
}
}
}
return layers.map((layer) => emitTreeLayer(layer, colMap));
}
function parseFunctionRanges(text, offsetMap) {
const result = [];
for (const line of text.split("\n")) {
for (const range of parseTreeLayer(line, offsetMap)) {
result.push(range);
}
}
result.sort(compareRangeCovs);
return result;
}
/**
*
* @param layer Sorted list of disjoint trees.
* @param colMap
*/
function emitTreeLayer(layer, colMap) {
const line = [];
let curIdx = 0;
for (const { start, end, count } of layer) {
const startIdx = colMap.get(start);
const endIdx = colMap.get(end);
if (startIdx > curIdx) {
line.push(" ".repeat(startIdx - curIdx));
}
line.push(emitRange(count, endIdx - startIdx));
curIdx = endIdx;
}
return line.join("");
}
function parseTreeLayer(text, offsetMap) {
const result = [];
const regex = /\[(\d+)-*\)/gs;
while (true) {
const match = regex.exec(text);
if (match === null) {
break;
}
const startIdx = match.index;
const endIdx = startIdx + match[0].length;
const count = parseInt(match[1], 10);
const startOffset = offsetMap.get(startIdx);
const endOffset = offsetMap.get(endIdx);
if (startOffset === undefined || endOffset === undefined) {
throw new Error(`Invalid offsets for: ${JSON.stringify(text)}`);
}
result.push({ startOffset, endOffset, count });
}
return result;
}
function emitRange(count, len) {
const rangeStart = `[${count.toString(10)}`;
const rangeEnd = ")";
const hyphensLen = len - (rangeStart.length + rangeEnd.length);
const hyphens = "-".repeat(Math.max(0, hyphensLen));
return `${rangeStart}${hyphens}${rangeEnd}`;
}
function emitOffsets(colMap) {
let line = "";
for (const [event, col] of colMap) {
if (line.length < col) {
line += " ".repeat(col - line.length);
}
line += event.toString(10);
}
return line;
}
function parseOffsets(text) {
const result = new Map();
const regex = /\d+/gs;
while (true) {
const match = regex.exec(text);
if (match === null) {
break;
}
result.set(match.index, parseInt(match[0], 10));
}
return result;
}
module.exports = {
emitForest,
emitForestLines,
parseFunctionRanges,
parseOffsets,
};
@@ -0,0 +1,74 @@
{
"name": "ajv-formats",
"version": "3.0.1",
"description": "Format validation for Ajv v7+",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/",
"dist/"
],
"scripts": {
"build": "tsc",
"prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"",
"prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"",
"eslint": "eslint --ext .ts ./src/**/*",
"test-spec": "jest",
"test-cov": "jest --coverage",
"test": "npm run prettier:check && npm run build && npm run eslint && npm run test-cov",
"ci-test": "npm run test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ajv-validator/ajv-formats.git"
},
"keywords": [
"Ajv",
"JSON-Schema",
"format",
"validation"
],
"author": "Evgeny Poberezkin",
"license": "MIT",
"bugs": {
"url": "https://github.com/ajv-validator/ajv-formats/issues"
},
"homepage": "https://github.com/ajv-validator/ajv-formats#readme",
"dependencies": {
"ajv": "^8.0.0"
},
"peerDependencies": {
"ajv": "^8.0.0"
},
"peerDependenciesMeta": {
"ajv": {
"optional": true
}
},
"devDependencies": {
"@ajv-validator/config": "^0.3.0",
"@types/jest": "^26.0.5",
"@types/node": "^14.10.1",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"ajv": "^8.0.0",
"eslint": "^7.5.0",
"eslint-config-prettier": "^6.11.0",
"husky": "^4.2.5",
"jest": "^26.1.0",
"json-schema-test": "^2.0.0",
"lint-staged": "^10.2.11",
"prettier": "^2.3.2",
"ts-jest": "^26.1.3",
"typescript": "^4.0.0"
},
"prettier": "@ajv-validator/config/prettierrc.json",
"husky": {
"hooks": {
"pre-commit": "lint-staged && npm test"
}
},
"lint-staged": {
"*.{md,json,yaml,js,ts}": "prettier --write"
}
}
@@ -0,0 +1,155 @@
/// <reference types="node" />
import * as nativeFs from "fs";
import picomatch from "picomatch";
//#region src/api/aborter.d.ts
/**
* AbortController is not supported on Node 14 so we use this until we can drop
* support for Node 14.
*/
declare class Aborter {
aborted: boolean;
abort(): void;
}
//#endregion
//#region src/api/queue.d.ts
type OnQueueEmptyCallback = (error: Error | null, output: WalkerState) => void;
/**
* This is a custom stateless queue to track concurrent async fs calls.
* It increments a counter whenever a call is queued and decrements it
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
*/
declare class Queue {
private onQueueEmpty?;
count: number;
constructor(onQueueEmpty?: OnQueueEmptyCallback | undefined);
enqueue(): number;
dequeue(error: Error | null, output: WalkerState): void;
}
//#endregion
//#region src/types.d.ts
type Counts = {
files: number;
directories: number;
/**
* @deprecated use `directories` instead. Will be removed in v7.0.
*/
dirs: number;
};
type Group = {
directory: string;
files: string[];
/**
* @deprecated use `directory` instead. Will be removed in v7.0.
*/
dir: string;
};
type GroupOutput = Group[];
type OnlyCountsOutput = Counts;
type PathsOutput = string[];
type Output = OnlyCountsOutput | PathsOutput | GroupOutput;
type FSLike = {
readdir: typeof nativeFs.readdir;
readdirSync: typeof nativeFs.readdirSync;
realpath: typeof nativeFs.realpath;
realpathSync: typeof nativeFs.realpathSync;
stat: typeof nativeFs.stat;
statSync: typeof nativeFs.statSync;
};
type WalkerState = {
root: string;
paths: string[];
groups: Group[];
counts: Counts;
options: Options;
queue: Queue;
controller: Aborter;
fs: FSLike;
symlinks: Map<string, string>;
visited: string[];
};
type ResultCallback<TOutput extends Output> = (error: Error | null, output: TOutput) => void;
type FilterPredicate = (path: string, isDirectory: boolean) => boolean;
type ExcludePredicate = (dirName: string, dirPath: string) => boolean;
type PathSeparator = "/" | "\\";
type Options<TGlobFunction = unknown> = {
includeBasePath?: boolean;
includeDirs?: boolean;
normalizePath?: boolean;
maxDepth: number;
maxFiles?: number;
resolvePaths?: boolean;
suppressErrors: boolean;
group?: boolean;
onlyCounts?: boolean;
filters: FilterPredicate[];
resolveSymlinks?: boolean;
useRealPaths?: boolean;
excludeFiles?: boolean;
excludeSymlinks?: boolean;
exclude?: ExcludePredicate;
relativePaths?: boolean;
pathSeparator: PathSeparator;
signal?: AbortSignal;
globFunction?: TGlobFunction;
fs?: FSLike;
};
type GlobMatcher = (test: string) => boolean;
type GlobFunction = (glob: string | string[], ...params: unknown[]) => GlobMatcher;
type GlobParams<T> = T extends ((globs: string | string[], ...params: infer TParams extends unknown[]) => GlobMatcher) ? TParams : [];
//#endregion
//#region src/builder/api-builder.d.ts
declare class APIBuilder<TReturnType extends Output> {
private readonly root;
private readonly options;
constructor(root: string, options: Options);
withPromise(): Promise<TReturnType>;
withCallback(cb: ResultCallback<TReturnType>): void;
sync(): TReturnType;
}
//#endregion
//#region src/builder/index.d.ts
declare class Builder<TReturnType extends Output = PathsOutput, TGlobFunction = typeof picomatch> {
private readonly globCache;
private options;
private globFunction?;
constructor(options?: Partial<Options<TGlobFunction>>);
group(): Builder<GroupOutput, TGlobFunction>;
withPathSeparator(separator: "/" | "\\"): this;
withBasePath(): this;
withRelativePaths(): this;
withDirs(): this;
withMaxDepth(depth: number): this;
withMaxFiles(limit: number): this;
withFullPaths(): this;
withErrors(): this;
withSymlinks({
resolvePaths
}?: {
resolvePaths?: boolean | undefined;
}): this;
withAbortSignal(signal: AbortSignal): this;
normalize(): this;
filter(predicate: FilterPredicate): this;
onlyDirs(): this;
exclude(predicate: ExcludePredicate): this;
onlyCounts(): Builder<OnlyCountsOutput, TGlobFunction>;
crawl(root?: string): APIBuilder<TReturnType>;
withGlobFunction<TFunc>(fn: TFunc): Builder<TReturnType, TFunc>;
/**
* @deprecated Pass options using the constructor instead:
* ```ts
* new fdir(options).crawl("/path/to/root");
* ```
* This method will be removed in v7.0
*/
crawlWithOptions(root: string, options: Partial<Options<TGlobFunction>>): APIBuilder<TReturnType>;
glob(...patterns: string[]): Builder<TReturnType, TGlobFunction>;
globWithOptions(patterns: string[]): Builder<TReturnType, TGlobFunction>;
globWithOptions(patterns: string[], ...options: GlobParams<TGlobFunction>): Builder<TReturnType, TGlobFunction>;
}
//#endregion
//#region src/index.d.ts
type Fdir = typeof Builder;
//#endregion
export { Counts, ExcludePredicate, FSLike, Fdir, FilterPredicate, GlobFunction, GlobMatcher, GlobParams, Group, GroupOutput, OnlyCountsOutput, Options, Output, PathSeparator, PathsOutput, ResultCallback, WalkerState, Builder as fdir };
@@ -0,0 +1,36 @@
'use strict';
var fastestLevenshtein = require('fastest-levenshtein');
const getUsedThreshold = (password, entry, threshold) => {
const isPasswordToShort = password.length <= entry.length;
const isThresholdLongerThanPassword = password.length <= threshold;
const shouldUsePasswordLength = isPasswordToShort || isThresholdLongerThanPassword;
// if password is too small use the password length divided by 4 while the threshold needs to be at least 1
return shouldUsePasswordLength ? Math.ceil(password.length / 4) : threshold;
};
const findLevenshteinDistance = (password, rankedDictionary, threshold) => {
let foundDistance = 0;
const found = Object.keys(rankedDictionary).find(entry => {
const usedThreshold = getUsedThreshold(password, entry, threshold);
if (Math.abs(password.length - entry.length) > usedThreshold) {
return false;
}
const foundEntryDistance = fastestLevenshtein.distance(password, entry);
const isInThreshold = foundEntryDistance <= usedThreshold;
if (isInThreshold) {
foundDistance = foundEntryDistance;
}
return isInThreshold;
});
if (found) {
return {
levenshteinDistance: foundDistance,
levenshteinDistanceEntry: found
};
}
return {};
};
module.exports = findLevenshteinDistance;
//# sourceMappingURL=levenshtein.cjs.map
@@ -0,0 +1,10 @@
//#region src/utils/headers.d.ts
/**
* @module
* HTTP Headers utility.
*/
export type RequestHeader = 'A-IM' | 'Accept' | 'Accept-Additions' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Datetime' | 'Accept-Encoding' | 'Accept-Features' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Query' | 'Accept-Ranges' | 'Accept-Signature' | 'Access-Control' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Activate-Storage-Access' | 'Age' | 'Allow' | 'ALPN' | 'Alt-Svc' | 'Alt-Used' | 'Alternates' | 'AMP-Cache-Transform' | 'Apply-To-Redirect-Ref' | 'Authentication-Control' | 'Authentication-Info' | 'Authorization' | 'Available-Dictionary' | 'C-Ext' | 'C-Man' | 'C-Opt' | 'C-PEP' | 'C-PEP-Info' | 'Cache-Control' | 'Cache-Group-Invalidation' | 'Cache-Groups' | 'Cache-Status' | 'Cal-Managed-ID' | 'CalDAV-Timezones' | 'Capsule-Protocol' | 'CDN-Cache-Control' | 'CDN-Loop' | 'Cert-Not-After' | 'Cert-Not-Before' | 'Clear-Site-Data' | 'Client-Cert' | 'Client-Cert-Chain' | 'Close' | 'CMCD-Object' | 'CMCD-Request' | 'CMCD-Session' | 'CMCD-Status' | 'CMSD-Dynamic' | 'CMSD-Static' | 'Concealed-Auth-Export' | 'Configuration-Context' | 'Connection' | 'Content-Base' | 'Content-Digest' | 'Content-Disposition' | 'Content-Encoding' | 'Content-ID' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-MD5' | 'Content-Range' | 'Content-Script-Type' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Style-Type' | 'Content-Type' | 'Content-Version' | 'Cookie' | 'Cookie2' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Embedder-Policy-Report-Only' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Opener-Policy-Report-Only' | 'Cross-Origin-Resource-Policy' | 'CTA-Common-Access-Token' | 'DASL' | 'Date' | 'DAV' | 'Default-Style' | 'Delta-Base' | 'Deprecation' | 'Depth' | 'Derived-From' | 'Destination' | 'Detached-JWS' | 'Differential-ID' | 'Dictionary-ID' | 'Digest' | 'DPoP' | 'DPoP-Nonce' | 'Early-Data' | 'EDIINT-Features' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Ext' | 'Forwarded' | 'From' | 'GetProfile' | 'Hobareg' | 'Host' | 'HTTP2-Settings' | 'If' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Schedule-Tag-Match' | 'If-Unmodified-Since' | 'IM' | 'Include-Referred-Token-Binding-ID' | 'Incremental' | 'Isolation' | 'Keep-Alive' | 'Label' | 'Last-Event-ID' | 'Last-Modified' | 'Link' | 'Link-Template' | 'Location' | 'Lock-Token' | 'Man' | 'Max-Forwards' | 'Memento-Datetime' | 'Meter' | 'Method-Check' | 'Method-Check-Expires' | 'MIME-Version' | 'Negotiate' | 'NEL' | 'OData-EntityId' | 'OData-Isolation' | 'OData-MaxVersion' | 'OData-Version' | 'Opt' | 'Optional-WWW-Authenticate' | 'Ordering-Type' | 'Origin' | 'Origin-Agent-Cluster' | 'OSCORE' | 'OSLC-Core-Version' | 'Overwrite' | 'P3P' | 'PEP' | 'PEP-Info' | 'Permissions-Policy' | 'PICS-Label' | 'Ping-From' | 'Ping-To' | 'Position' | 'Pragma' | 'Prefer' | 'Preference-Applied' | 'Priority' | 'ProfileObject' | 'Protocol' | 'Protocol-Info' | 'Protocol-Query' | 'Protocol-Request' | 'Proxy-Authenticate' | 'Proxy-Authentication-Info' | 'Proxy-Authorization' | 'Proxy-Features' | 'Proxy-Instruction' | 'Proxy-Status' | 'Public' | 'Public-Key-Pins' | 'Public-Key-Pins-Report-Only' | 'Range' | 'Redirect-Ref' | 'Referer' | 'Referer-Root' | 'Referrer-Policy' | 'Refresh' | 'Repeatability-Client-ID' | 'Repeatability-First-Sent' | 'Repeatability-Request-ID' | 'Repeatability-Result' | 'Replay-Nonce' | 'Reporting-Endpoints' | 'Repr-Digest' | 'Retry-After' | 'Safe' | 'Schedule-Reply' | 'Schedule-Tag' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-Storage-Access' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Sec-Purpose' | 'Sec-Token-Binding' | 'Sec-WebSocket-Accept' | 'Sec-WebSocket-Extensions' | 'Sec-WebSocket-Key' | 'Sec-WebSocket-Protocol' | 'Sec-WebSocket-Version' | 'Security-Scheme' | 'Server' | 'Server-Timing' | 'Set-Cookie' | 'Set-Cookie2' | 'Set-Txn' | 'SetProfile' | 'Signature' | 'Signature-Input' | 'SLUG' | 'SoapAction' | 'Status-URI' | 'Strict-Transport-Security' | 'Sunset' | 'Surrogate-Capability' | 'Surrogate-Control' | 'TCN' | 'TE' | 'Timeout' | 'Timing-Allow-Origin' | 'Topic' | 'Traceparent' | 'Tracestate' | 'Trailer' | 'Transfer-Encoding' | 'TTL' | 'Unencoded-Digest' | 'Upgrade' | 'Urgency' | 'URI' | 'Use-As-Dictionary' | 'User-Agent' | 'Variant-Vary' | 'Vary' | 'Via' | 'Want-Content-Digest' | 'Want-Digest' | 'Want-Repr-Digest' | 'Want-Unencoded-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options';
export type ResponseHeader = 'Accept-Query' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Activate-Storage-Access' | 'Age' | 'Allow' | 'Cache-Control' | 'Cache-Group-Invalidation' | 'Cache-Groups' | 'Clear-Site-Data' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'ETag' | 'Expires' | 'Incremental' | 'Last-Modified' | 'Location' | 'Permissions-Policy' | 'Pragma' | 'Retry-After' | 'Save-Data' | 'Sec-CH-Prefers-Color-Scheme' | 'Sec-CH-Prefers-Reduced-Motion' | 'Sec-CH-UA' | 'Sec-CH-UA-Arch' | 'Sec-CH-UA-Bitness' | 'Sec-CH-UA-Form-Factor' | 'Sec-CH-UA-Full-Version' | 'Sec-CH-UA-Full-Version-List' | 'Sec-CH-UA-Mobile' | 'Sec-CH-UA-Model' | 'Sec-CH-UA-Platform' | 'Sec-CH-UA-Platform-Version' | 'Sec-CH-UA-WoW64' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'Set-Txn' | 'Strict-Transport-Security' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Unencoded-Digest' | 'Upgrade' | 'Vary' | 'Want-Unencoded-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-DNS-Prefetch-Control' | 'X-Frame-Options' | 'X-Permitted-Cross-Domain-Policies' | 'X-Powered-By' | 'X-Robots-Tag' | 'X-XSS-Protection';
export type AcceptHeader = 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges';
export type CustomHeader = string & {};
//#endregion
@@ -0,0 +1 @@
{"version":3,"file":"flame-kindling.js","sources":["../../../src/icons/flame-kindling.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FlameKindling\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMmMxIDMgMi41IDMuNSAzLjUgNC41QTUgNSAwIDAgMSAxNyAxMGE1IDUgMCAxIDEtMTAgMGMwLS4zIDAtLjYuMS0uOWEyIDIgMCAxIDAgMy4zLTJDOCA0LjUgMTEgMiAxMiAyWiIgLz4KICA8cGF0aCBkPSJtNSAyMiAxNC00IiAvPgogIDxwYXRoIGQ9Im01IDE4IDE0IDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/flame-kindling\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 FlameKindling = createLucideIcon('FlameKindling', [\n [\n 'path',\n {\n d: 'M12 2c1 3 2.5 3.5 3.5 4.5A5 5 0 0 1 17 10a5 5 0 1 1-10 0c0-.3 0-.6.1-.9a2 2 0 1 0 3.3-2C8 4.5 11 2 12 2Z',\n key: '1ir223',\n },\n ],\n ['path', { d: 'm5 22 14-4', key: '1brv4h' }],\n ['path', { d: 'm5 18 14 4', key: 'lgyyje' }],\n]);\n\nexport default FlameKindling;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CACtD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,503 @@
"use strict";
// Run with: npx tsx src/examples/server/elicitationFormExample.ts
//
// This example demonstrates how to use form elicitation to collect structured user input
// with JSON Schema validation via a local HTTP server with SSE streaming.
// Form elicitation allows servers to request *non-sensitive* user input through the client
// with schema-based validation.
// Note: See also elicitationUrlExample.ts for an example of using URL elicitation
// to collect *sensitive* user input via a browser.
Object.defineProperty(exports, "__esModule", { value: true });
const node_crypto_1 = require("node:crypto");
const mcp_js_1 = require("../../server/mcp.js");
const streamableHttp_js_1 = require("../../server/streamableHttp.js");
const types_js_1 = require("../../types.js");
const express_js_1 = require("../../server/express.js");
// Factory to create a new MCP server per session.
// Each session needs its own server+transport pair to avoid cross-session contamination.
const getServer = () => {
// Create MCP server - it will automatically use AjvJsonSchemaValidator with sensible defaults
// The validator supports format validation (email, date, etc.) if ajv-formats is installed
const mcpServer = new mcp_js_1.McpServer({
name: 'form-elicitation-example-server',
version: '1.0.0'
}, {
capabilities: {}
});
/**
* Example 1: Simple user registration tool
* Collects username, email, and password from the user
*/
mcpServer.registerTool('register_user', {
description: 'Register a new user account by collecting their information',
inputSchema: {}
}, async () => {
try {
// Request user information through form elicitation
const result = await mcpServer.server.elicitInput({
mode: 'form',
message: 'Please provide your registration information:',
requestedSchema: {
type: 'object',
properties: {
username: {
type: 'string',
title: 'Username',
description: 'Your desired username (3-20 characters)',
minLength: 3,
maxLength: 20
},
email: {
type: 'string',
title: 'Email',
description: 'Your email address',
format: 'email'
},
password: {
type: 'string',
title: 'Password',
description: 'Your password (min 8 characters)',
minLength: 8
},
newsletter: {
type: 'boolean',
title: 'Newsletter',
description: 'Subscribe to newsletter?',
default: false
},
role: {
type: 'string',
title: 'Role',
description: 'Your primary role',
oneOf: [
{ const: 'developer', title: 'Developer' },
{ const: 'designer', title: 'Designer' },
{ const: 'manager', title: 'Manager' },
{ const: 'other', title: 'Other' }
],
default: 'developer'
},
interests: {
type: 'array',
title: 'Interests',
description: 'Select your areas of interest',
items: {
type: 'string',
enum: ['frontend', 'backend', 'mobile', 'devops', 'ai']
},
minItems: 1,
maxItems: 3
}
},
required: ['username', 'email', 'password']
}
});
// Handle the different possible actions
if (result.action === 'accept' && result.content) {
const { username, email, newsletter } = result.content;
return {
content: [
{
type: 'text',
text: `Registration successful!\n\nUsername: ${username}\nEmail: ${email}\nNewsletter: ${newsletter ? 'Yes' : 'No'}`
}
]
};
}
else if (result.action === 'decline') {
return {
content: [
{
type: 'text',
text: 'Registration cancelled by user.'
}
]
};
}
else {
return {
content: [
{
type: 'text',
text: 'Registration was cancelled.'
}
]
};
}
}
catch (error) {
return {
content: [
{
type: 'text',
text: `Registration failed: ${error instanceof Error ? error.message : String(error)}`
}
],
isError: true
};
}
});
/**
* Example 2: Multi-step workflow with multiple form elicitation requests
* Demonstrates how to collect information in multiple steps
*/
mcpServer.registerTool('create_event', {
description: 'Create a calendar event by collecting event details',
inputSchema: {}
}, async () => {
try {
// Step 1: Collect basic event information
const basicInfo = await mcpServer.server.elicitInput({
mode: 'form',
message: 'Step 1: Enter basic event information',
requestedSchema: {
type: 'object',
properties: {
title: {
type: 'string',
title: 'Event Title',
description: 'Name of the event',
minLength: 1
},
description: {
type: 'string',
title: 'Description',
description: 'Event description (optional)'
}
},
required: ['title']
}
});
if (basicInfo.action !== 'accept' || !basicInfo.content) {
return {
content: [{ type: 'text', text: 'Event creation cancelled.' }]
};
}
// Step 2: Collect date and time
const dateTime = await mcpServer.server.elicitInput({
mode: 'form',
message: 'Step 2: Enter date and time',
requestedSchema: {
type: 'object',
properties: {
date: {
type: 'string',
title: 'Date',
description: 'Event date',
format: 'date'
},
startTime: {
type: 'string',
title: 'Start Time',
description: 'Event start time (HH:MM)'
},
duration: {
type: 'integer',
title: 'Duration',
description: 'Duration in minutes',
minimum: 15,
maximum: 480
}
},
required: ['date', 'startTime', 'duration']
}
});
if (dateTime.action !== 'accept' || !dateTime.content) {
return {
content: [{ type: 'text', text: 'Event creation cancelled.' }]
};
}
// Combine all collected information
const event = {
...basicInfo.content,
...dateTime.content
};
return {
content: [
{
type: 'text',
text: `Event created successfully!\n\n${JSON.stringify(event, null, 2)}`
}
]
};
}
catch (error) {
return {
content: [
{
type: 'text',
text: `Event creation failed: ${error instanceof Error ? error.message : String(error)}`
}
],
isError: true
};
}
});
/**
* Example 3: Collecting address information
* Demonstrates validation with patterns and optional fields
*/
mcpServer.registerTool('update_shipping_address', {
description: 'Update shipping address with validation',
inputSchema: {}
}, async () => {
try {
const result = await mcpServer.server.elicitInput({
mode: 'form',
message: 'Please provide your shipping address:',
requestedSchema: {
type: 'object',
properties: {
name: {
type: 'string',
title: 'Full Name',
description: 'Recipient name',
minLength: 1
},
street: {
type: 'string',
title: 'Street Address',
minLength: 1
},
city: {
type: 'string',
title: 'City',
minLength: 1
},
state: {
type: 'string',
title: 'State/Province',
minLength: 2,
maxLength: 2
},
zipCode: {
type: 'string',
title: 'ZIP/Postal Code',
description: '5-digit ZIP code'
},
phone: {
type: 'string',
title: 'Phone Number (optional)',
description: 'Contact phone number'
}
},
required: ['name', 'street', 'city', 'state', 'zipCode']
}
});
if (result.action === 'accept' && result.content) {
return {
content: [
{
type: 'text',
text: `Address updated successfully!\n\n${JSON.stringify(result.content, null, 2)}`
}
]
};
}
else if (result.action === 'decline') {
return {
content: [{ type: 'text', text: 'Address update cancelled by user.' }]
};
}
else {
return {
content: [{ type: 'text', text: 'Address update was cancelled.' }]
};
}
}
catch (error) {
return {
content: [
{
type: 'text',
text: `Address update failed: ${error instanceof Error ? error.message : String(error)}`
}
],
isError: true
};
}
});
return mcpServer;
};
async function main() {
const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
const app = (0, express_js_1.createMcpExpressApp)();
// Close sessions that have been idle for IDLE_MS, and keep at most MAX_SESSIONS open
const IDLE_MS = 30 * 60000;
const MAX_SESSIONS = 1000;
const sessions = new Map();
// Count open responses so a long-running request or a listening SSE stream is not treated as idle
const trackResponse = (session, res) => {
if (!res.socket || res.destroyed)
return;
session.open++;
res.on('close', () => {
session.open--;
session.lastActive = Date.now();
});
};
// Close sessions with nothing open and no activity for IDLE_MS
setInterval(() => {
const cutoff = Date.now() - IDLE_MS;
for (const { transport, open, lastActive } of sessions.values()) {
if (open === 0 && lastActive < cutoff)
transport.close().catch(console.error);
}
}, 60000).unref();
// MCP POST endpoint
const mcpPostHandler = async (req, res) => {
const sessionId = req.headers['mcp-session-id'];
if (sessionId) {
console.log(`Received MCP request for session: ${sessionId}`);
}
try {
const session = sessionId ? sessions.get(sessionId) : undefined;
let transport;
if (session) {
// Reuse existing transport for this session
transport = session.transport;
trackResponse(session, res);
}
else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
// New initialization request - create new transport
if (sessions.size >= MAX_SESSIONS) {
res.status(503).json({ jsonrpc: '2.0', error: { code: -32000, message: 'Too many open sessions' }, id: null });
return;
}
transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
onsessioninitialized: sessionId => {
// Store the transport by session ID when session is initialized
console.log(`Session initialized with ID: ${sessionId}`);
sessions.set(sessionId, { transport, open: 0, lastActive: Date.now() });
}
});
// Set up onclose handler to clean up transport when closed
transport.onclose = () => {
const sid = transport.sessionId;
if (sid && sessions.has(sid)) {
console.log(`Transport closed for session ${sid}, removing from sessions map`);
sessions.delete(sid);
}
};
// Create a new server per session and connect it to the transport
const mcpServer = getServer();
await mcpServer.connect(transport);
await transport.handleRequest(req, res, req.body);
return;
}
else if (sessionId) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
else {
// Invalid request - no session ID and not an initialization request
res.status(400).json({
jsonrpc: '2.0',
error: {
code: -32000,
message: 'Bad Request: No valid session ID provided'
},
id: null
});
return;
}
// Handle the request with existing transport
await transport.handleRequest(req, res, req.body);
}
catch (error) {
console.error('Error handling MCP request:', error);
if (!res.headersSent) {
res.status(500).json({
jsonrpc: '2.0',
error: {
code: -32603,
message: 'Internal server error'
},
id: null
});
}
}
};
app.post('/mcp', mcpPostHandler);
// Handle GET requests for SSE streams
const mcpGetHandler = async (req, res) => {
const sessionId = req.headers['mcp-session-id'];
if (!sessionId) {
res.status(400).send('Missing session ID');
return;
}
const session = sessions.get(sessionId);
if (!session) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
console.log(`Establishing SSE stream for session ${sessionId}`);
trackResponse(session, res);
await session.transport.handleRequest(req, res);
};
app.get('/mcp', mcpGetHandler);
// Handle DELETE requests for session termination
const mcpDeleteHandler = async (req, res) => {
const sessionId = req.headers['mcp-session-id'];
if (!sessionId) {
res.status(400).send('Missing session ID');
return;
}
const session = sessions.get(sessionId);
if (!session) {
// Unknown or expired session ID - the client should start a new session
res.status(404).json({ jsonrpc: '2.0', error: { code: -32001, message: 'Session not found' }, id: null });
return;
}
console.log(`Received session termination request for session ${sessionId}`);
try {
trackResponse(session, res);
await session.transport.handleRequest(req, res);
}
catch (error) {
console.error('Error handling session termination:', error);
if (!res.headersSent) {
res.status(500).send('Error processing session termination');
}
}
};
app.delete('/mcp', mcpDeleteHandler);
// Start listening
app.listen(PORT, error => {
if (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
console.log(`Form elicitation example server is running on http://localhost:${PORT}/mcp`);
console.log('Available tools:');
console.log(' - register_user: Collect user registration information');
console.log(' - create_event: Multi-step event creation');
console.log(' - update_shipping_address: Collect and validate address');
console.log('\nConnect your MCP client to this server using the HTTP transport.');
});
// Handle server shutdown
process.on('SIGINT', async () => {
console.log('Shutting down server...');
// Close all active transports to properly clean up resources
for (const [sessionId, { transport }] of sessions) {
try {
console.log(`Closing transport for session ${sessionId}`);
await transport.close();
sessions.delete(sessionId);
}
catch (error) {
console.error(`Error closing transport for session ${sessionId}:`, error);
}
}
console.log('Server shutdown complete');
process.exit(0);
});
}
main().catch(error => {
console.error('Server error:', error);
process.exit(1);
});
//# sourceMappingURL=elicitationFormExample.js.map
@@ -0,0 +1,266 @@
/**
* @fileoverview Restrict usage of specified globals.
* @author Benoît Zugmeyer
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const TYPE_NODES = new Set([
"TSTypeReference",
"TSInterfaceHeritage",
"TSClassImplements",
"TSTypeQuery",
"TSQualifiedName",
]);
const GLOBAL_OBJECTS = new Set(["globalThis", "self", "window"]);
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const arrayOfGlobals = {
type: "array",
items: {
oneOf: [
{
type: "string",
},
{
type: "object",
properties: {
name: { type: "string" },
message: { type: "string" },
},
required: ["name"],
additionalProperties: false,
},
],
},
uniqueItems: true,
minItems: 0,
};
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
dialects: ["javascript", "typescript"],
language: "javascript",
type: "suggestion",
docs: {
description: "Disallow specified global variables",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-restricted-globals",
},
schema: {
anyOf: [
arrayOfGlobals,
{
type: "array",
items: [
{
type: "object",
properties: {
globals: arrayOfGlobals,
checkGlobalObject: {
type: "boolean",
},
globalObjects: {
type: "array",
items: {
type: "string",
},
uniqueItems: true,
},
},
required: ["globals"],
additionalProperties: false,
},
],
additionalItems: false,
},
],
},
messages: {
defaultMessage: "Unexpected use of '{{name}}'.",
// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
customMessage: "Unexpected use of '{{name}}'. {{customMessage}}",
},
},
create(context) {
const { sourceCode, options } = context;
const isGlobalsObject =
typeof options[0] === "object" &&
Object.hasOwn(options[0], "globals");
const restrictedGlobals = isGlobalsObject
? options[0].globals
: options;
const checkGlobalObject = isGlobalsObject
? options[0].checkGlobalObject
: false;
const userGlobalObjects = isGlobalsObject
? options[0].globalObjects || []
: [];
const globalObjects = new Set([
...GLOBAL_OBJECTS,
...userGlobalObjects,
]);
// If no globals are restricted, we don't need to do anything
if (restrictedGlobals.length === 0) {
return {};
}
const restrictedGlobalMessages = restrictedGlobals.reduce(
(memo, option) => {
if (typeof option === "string") {
memo[option] = null;
} else {
memo[option.name] = option.message;
}
return memo;
},
{},
);
/**
* Report a variable to be used as a restricted global.
* @param {Reference} reference the variable reference
* @returns {void}
* @private
*/
function reportReference(reference) {
const name = reference.identifier.name,
customMessage = restrictedGlobalMessages[name],
messageId = customMessage ? "customMessage" : "defaultMessage";
context.report({
node: reference.identifier,
messageId,
data: {
name,
customMessage,
},
});
}
/**
* Check if the given name is a restricted global name.
* @param {string} name name of a variable
* @returns {boolean} whether the variable is a restricted global or not
* @private
*/
function isRestricted(name) {
return Object.hasOwn(restrictedGlobalMessages, name);
}
/**
* Check if the given reference occurs within a TypeScript type context.
* @param {Reference} reference The variable reference to check.
* @returns {boolean} Whether the reference is in a type context.
* @private
*/
function isInTypeContext(reference) {
const parent = reference.identifier.parent;
return TYPE_NODES.has(parent.type);
}
return {
Program(node) {
const scope = sourceCode.getScope(node);
// Report variables declared elsewhere (ex: variables defined as "global" by eslint)
scope.variables.forEach(variable => {
if (!variable.defs.length && isRestricted(variable.name)) {
variable.references.forEach(reference => {
if (!isInTypeContext(reference)) {
reportReference(reference);
}
});
}
});
// Report variables not declared at all
scope.through.forEach(reference => {
if (
isRestricted(reference.identifier.name) &&
!isInTypeContext(reference)
) {
reportReference(reference);
}
});
},
"Program:exit"(node) {
if (!checkGlobalObject) {
return;
}
const globalScope = sourceCode.getScope(node);
globalObjects.forEach(globalObjectName => {
const variable = astUtils.getVariableByName(
globalScope,
globalObjectName,
);
if (!variable) {
return;
}
variable.references.forEach(reference => {
const identifier = reference.identifier;
let parent = identifier.parent;
// To detect code like `window.window.Promise`.
while (
astUtils.isSpecificMemberAccess(
parent,
null,
globalObjectName,
)
) {
parent = parent.parent;
}
const propertyName =
astUtils.getStaticPropertyName(parent);
if (propertyName && isRestricted(propertyName)) {
const customMessage =
restrictedGlobalMessages[propertyName];
const messageId = customMessage
? "customMessage"
: "defaultMessage";
context.report({
node: parent.property,
messageId,
data: {
name: propertyName,
customMessage,
},
});
}
});
});
},
};
},
};
@@ -0,0 +1,255 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.readonlynessOptionsDefaults = exports.readonlynessOptionsSchema = void 0;
exports.isTypeReadonly = isTypeReadonly;
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const propertyTypes_1 = require("./propertyTypes");
const TypeOrValueSpecifier_1 = require("./TypeOrValueSpecifier");
var Readonlyness;
(function (Readonlyness) {
/** the type cannot be handled by the function */
Readonlyness[Readonlyness["UnknownType"] = 1] = "UnknownType";
/** the type is mutable */
Readonlyness[Readonlyness["Mutable"] = 2] = "Mutable";
/** the type is readonly */
Readonlyness[Readonlyness["Readonly"] = 3] = "Readonly";
})(Readonlyness || (Readonlyness = {}));
exports.readonlynessOptionsSchema = {
additionalProperties: false,
properties: {
allow: TypeOrValueSpecifier_1.typeOrValueSpecifiersSchema,
treatMethodsAsReadonly: {
type: 'boolean',
},
},
type: 'object',
};
exports.readonlynessOptionsDefaults = {
allow: [],
treatMethodsAsReadonly: false,
};
function hasSymbol(node) {
return Object.hasOwn(node, 'symbol');
}
function isTypeReadonlyArrayOrTuple(program, type, options, seenTypes) {
const checker = program.getTypeChecker();
function checkTypeArguments(arrayType) {
const typeArguments = checker.getTypeArguments(arrayType);
// this shouldn't happen in reality as:
// - tuples require at least 1 type argument
// - ReadonlyArray requires at least 1 type argument
/* istanbul ignore if */ if (typeArguments.length === 0) {
return Readonlyness.Readonly;
}
// validate the element types are also readonly
if (typeArguments.some(typeArg => isTypeReadonlyRecurser(program, typeArg, options, seenTypes) ===
Readonlyness.Mutable)) {
return Readonlyness.Mutable;
}
return Readonlyness.Readonly;
}
if (checker.isArrayType(type)) {
const symbol = utils_1.ESLintUtils.nullThrows(type.getSymbol(), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('symbol', 'array type'));
const escapedName = symbol.getEscapedName();
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
if (escapedName === 'Array') {
return Readonlyness.Mutable;
}
return checkTypeArguments(type);
}
if (checker.isTupleType(type)) {
if (!type.target.readonly) {
return Readonlyness.Mutable;
}
return checkTypeArguments(type);
}
return Readonlyness.UnknownType;
}
function isTypeReadonlyObject(program, type, options, seenTypes) {
const checker = program.getTypeChecker();
function checkIndexSignature(kind) {
const indexInfo = checker.getIndexInfoOfType(type, kind);
if (indexInfo) {
if (!indexInfo.isReadonly) {
return Readonlyness.Mutable;
}
if (indexInfo.type === type || seenTypes.has(indexInfo.type)) {
return Readonlyness.Readonly;
}
return isTypeReadonlyRecurser(program, indexInfo.type, options, seenTypes);
}
return Readonlyness.UnknownType;
}
const properties = type.getProperties();
if (properties.length) {
// ensure the properties are marked as readonly
for (const property of properties) {
if (options.treatMethodsAsReadonly) {
if (property.valueDeclaration != null &&
hasSymbol(property.valueDeclaration) &&
tsutils.isSymbolFlagSet(property.valueDeclaration.symbol, ts.SymbolFlags.Method)) {
continue;
}
const declarations = property.getDeclarations();
const lastDeclaration = declarations != null && declarations.length > 0
? declarations[declarations.length - 1]
: undefined;
if (lastDeclaration != null &&
hasSymbol(lastDeclaration) &&
tsutils.isSymbolFlagSet(lastDeclaration.symbol, ts.SymbolFlags.Method)) {
continue;
}
}
if (tsutils.isPropertyReadonlyInType(type, property.getEscapedName(), checker)) {
continue;
}
const name = ts.getNameOfDeclaration(property.valueDeclaration);
if (name && ts.isPrivateIdentifier(name)) {
continue;
}
return Readonlyness.Mutable;
}
// all properties were readonly
// now ensure that all of the values are readonly also.
// do this after checking property readonly-ness as a perf optimization,
// as we might be able to bail out early due to a mutable property before
// doing this deep, potentially expensive check.
for (const property of properties) {
const propertyType = utils_1.ESLintUtils.nullThrows((0, propertyTypes_1.getTypeOfPropertyOfType)(checker, type, property), utils_1.ESLintUtils.NullThrowsReasons.MissingToken(`property "${property.name}"`, 'type'));
// handle recursive types.
// we only need this simple check, because a mutable recursive type will break via the above prop readonly check
if (seenTypes.has(propertyType)) {
continue;
}
if (isTypeReadonlyRecurser(program, propertyType, options, seenTypes) ===
Readonlyness.Mutable) {
return Readonlyness.Mutable;
}
}
}
const isStringIndexSigReadonly = checkIndexSignature(ts.IndexKind.String);
if (isStringIndexSigReadonly === Readonlyness.Mutable) {
return isStringIndexSigReadonly;
}
const isNumberIndexSigReadonly = checkIndexSignature(ts.IndexKind.Number);
if (isNumberIndexSigReadonly === Readonlyness.Mutable) {
return isNumberIndexSigReadonly;
}
return Readonlyness.Readonly;
}
// a helper function to ensure the seenTypes map is always passed down, except by the external caller
function isTypeReadonlyRecurser(program, type, options, seenTypes) {
const checker = program.getTypeChecker();
seenTypes.add(type);
// If the type has an alias symbol, check it against the allow list first
if (type.aliasSymbol && options.allow) {
const aliasSymbol = type.aliasSymbol;
const aliasMatches = options.allow.some(specifier => {
const specifierName = typeof specifier === 'string' ? specifier : specifier.name;
const names = Array.isArray(specifierName)
? specifierName
: [specifierName];
return names.includes(aliasSymbol.getName());
});
if (aliasMatches) {
return Readonlyness.Readonly;
}
}
if ((0, TypeOrValueSpecifier_1.typeMatchesSomeSpecifier)(type, options.allow, program)) {
return Readonlyness.Readonly;
}
if (tsutils.isUnionType(type)) {
// all types in the union must be readonly
const result = tsutils
.unionConstituents(type)
.every(t => seenTypes.has(t) ||
isTypeReadonlyRecurser(program, t, options, seenTypes) ===
Readonlyness.Readonly);
const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable;
return readonlyness;
}
if (tsutils.isIntersectionType(type)) {
// Special case for handling arrays/tuples (as readonly arrays/tuples always have mutable methods).
if (type.types.some(t => checker.isArrayType(t) || checker.isTupleType(t))) {
const allReadonlyParts = type.types.every(t => seenTypes.has(t) ||
isTypeReadonlyRecurser(program, t, options, seenTypes) ===
Readonlyness.Readonly);
return allReadonlyParts ? Readonlyness.Readonly : Readonlyness.Mutable;
}
// Normal case.
const isReadonlyObject = isTypeReadonlyObject(program, type, options, seenTypes);
if (isReadonlyObject !== Readonlyness.UnknownType) {
return isReadonlyObject;
}
}
if (tsutils.isConditionalType(type)) {
const result = [type.root.node.trueType, type.root.node.falseType]
.map(checker.getTypeFromTypeNode)
.every(t => seenTypes.has(t) ||
isTypeReadonlyRecurser(program, t, options, seenTypes) ===
Readonlyness.Readonly);
const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable;
return readonlyness;
}
// all non-object, non-intersection types are readonly.
// this should only be primitive types
if (!tsutils.isObjectType(type)) {
return Readonlyness.Readonly;
}
// pure function types are readonly
if (type.getCallSignatures().length > 0 &&
type.getProperties().length === 0) {
return Readonlyness.Readonly;
}
const isReadonlyArray = isTypeReadonlyArrayOrTuple(program, type, options, seenTypes);
if (isReadonlyArray !== Readonlyness.UnknownType) {
return isReadonlyArray;
}
const isReadonlyObject = isTypeReadonlyObject(program, type, options, seenTypes);
/* istanbul ignore else */ if (isReadonlyObject !== Readonlyness.UnknownType) {
return isReadonlyObject;
}
throw new Error('Unhandled type');
}
/**
* Checks if the given type is readonly
*/
function isTypeReadonly(program, type, options = exports.readonlynessOptionsDefaults) {
return (isTypeReadonlyRecurser(program, type, options, new Set()) ===
Readonlyness.Readonly);
}
@@ -0,0 +1 @@
{"version":3,"file":"simpleSseServer.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAgD;AAChD,gDAAyD;AACzD,0CAA4B;AAE5B,wDAA8D;AAE9D;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,OAAO;KACnB,EACD,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CACpC,CAAC;IAEF,MAAM,CAAC,YAAY,CACf,2BAA2B,EAC3B;QACI,WAAW,EAAE,uCAAuC;QACpD,WAAW,EAAE;YACT,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;YAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;SAC5E;KACJ,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAA2B,EAAE;QAC1D,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,gCAAgC;QAChC,MAAM,MAAM,CAAC,kBAAkB,CAC3B;YACI,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,qCAAqC,KAAK,mBAAmB,QAAQ,IAAI;SAClF,EACD,KAAK,CAAC,SAAS,CAClB,CAAC;QAEF,8BAA8B;QAC9B,OAAO,OAAO,GAAG,KAAK,EAAE,CAAC;YACrB,OAAO,EAAE,CAAC;YACV,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;YAEtB,IAAI,CAAC;gBACD,MAAM,MAAM,CAAC,kBAAkB,CAC3B;oBACI,KAAK,EAAE,MAAM;oBACb,IAAI,EAAE,iBAAiB,OAAO,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;iBAClE,EACD,KAAK,CAAC,SAAS,CAClB,CAAC;YACN,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;YACxD,CAAC;QACL,CAAC;QAED,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,qBAAqB,KAAK,wBAAwB,QAAQ,IAAI;iBACvE;aACJ;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;IACF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,IAAA,gCAAmB,GAAE,CAAC;AAElC,iCAAiC;AACjC,MAAM,UAAU,GAAuC,EAAE,CAAC;AAE1D,2CAA2C;AAC3C,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IAClD,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IAEtE,IAAI,CAAC;QACD,4CAA4C;QAC5C,gDAAgD;QAChD,MAAM,SAAS,GAAG,IAAI,2BAAkB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QAE3D,oCAAoC;QACpC,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QACtC,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;QAElC,2DAA2D;QAC3D,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,oCAAoC,SAAS,EAAE,CAAC,CAAC;YAC7D,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC,CAAC;QAEF,0CAA0C;QAC1C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhC,OAAO,CAAC,GAAG,CAAC,2CAA2C,SAAS,EAAE,CAAC,CAAC;IACxE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACnB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,2DAA2D;AAC3D,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAElD,8CAA8C;IAC9C,+EAA+E;IAC/E,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,SAA+B,CAAC;IAE5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACpD,OAAO;IACX,CAAC;IAED,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6CAA6C,SAAS,EAAE,CAAC,CAAC;QACxE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC1C,OAAO;IACX,CAAC;IAED,IAAI,CAAC;QACD,6CAA6C;QAC7C,MAAM,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACnB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gFAAgF,IAAI,EAAE,CAAC,CAAC;AACxG,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
module.exports={C:{"47":0.00561,"52":0.03363,"78":0.00561,"115":0.3363,"120":0.05605,"121":0.11771,"123":0.00561,"124":0.00561,"125":0.00561,"128":0.01121,"131":0.00561,"133":0.01121,"134":0.00561,"135":0.00561,"136":0.01682,"137":0.00561,"139":0.00561,"140":0.12892,"141":0.00561,"142":0.00561,"143":0.00561,"144":0.00561,"145":0.00561,"146":0.01121,"147":0.01121,"148":0.01682,"149":0.01682,"150":0.02242,"151":0.04484,"152":0.06166,"153":0.09529,"154":0.54369,"155":1.5638,"156":2.19716,"157":0.07287,"158":0.00561,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 129 130 132 138 159 160 3.5 3.6"},D:{"49":0.00561,"73":0.00561,"79":0.00561,"87":0.00561,"93":0.00561,"101":0.00561,"103":0.02242,"104":0.01121,"105":0.01121,"106":0.01121,"107":0.01121,"108":0.01682,"109":0.65018,"110":0.01121,"111":0.04484,"112":0.01121,"114":0.01121,"116":0.04484,"117":0.01121,"118":0.12331,"119":0.1121,"120":0.17376,"121":0.01121,"122":0.03363,"123":0.01121,"124":0.01682,"125":0.00561,"126":0.03363,"127":0.01121,"128":0.02803,"129":0.00561,"130":0.08408,"131":0.1065,"132":0.00561,"133":0.09529,"134":0.3307,"135":0.08968,"136":0.09529,"137":0.17376,"138":0.12331,"139":0.08408,"140":0.11771,"141":0.13452,"142":0.30267,"143":0.06166,"144":0.08968,"145":0.1121,"146":0.05045,"147":0.05045,"148":0.11771,"149":0.1065,"150":0.27465,"151":1.3396,"152":7.56675,"153":12.91392,"154":3.30695,"155":0.04484,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 74 75 76 77 78 80 81 83 84 85 86 88 89 90 91 92 94 95 96 97 98 99 100 102 113 115 156 157"},F:{"46":0.00561,"74":0.00561,"95":0.08968,"100":0.01121,"101":0.03363,"102":0.00561,"106":0.00561,"114":0.00561,"117":0.00561,"119":0.00561,"121":0.00561,"122":0.00561,"126":0.00561,"127":0.00561,"131":0.01682,"132":0.01121,"133":0.02803,"134":0.72305,"135":8.55884,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 103 104 105 107 108 109 110 111 112 113 115 116 118 120 123 124 125 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00561,"109":0.07287,"116":0.00561,"119":0.06166,"120":0.05605,"122":0.00561,"128":0.00561,"130":0.00561,"132":0.00561,"135":0.00561,"136":0.00561,"137":0.00561,"138":0.00561,"139":0.00561,"140":0.00561,"141":0.00561,"142":0.00561,"143":0.01682,"144":0.00561,"145":0.01121,"146":0.01121,"147":0.00561,"148":0.01121,"149":0.01682,"150":0.06166,"151":0.14013,"152":1.68711,"153":2.9146,"154":0.94164,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 117 118 121 123 124 125 126 127 129 131 133 134"},E:{"27":0.14573,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.5 16.0 16.1 16.2 16.3 16.4 17.0 18.0 27.1 27.2 TP","13.1":0.00561,"15.4":0.00561,"15.6":0.02242,"16.5":0.00561,"16.6":0.06726,"17.1":0.01682,"17.2":0.00561,"17.3":0.00561,"17.4":0.01121,"17.5":0.01121,"17.6":0.05605,"18.1":0.01121,"18.2":0.00561,"18.3":0.02242,"18.4":0.00561,"18.5-18.7":0.01682,"26.0":0.01682,"26.1":0.01121,"26.2":0.03924,"26.3":0.04484,"26.4":0.03363,"26.5":0.17376,"26.6":0.58853},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00111,"5.0-5.1":0.00111,"6.0-6.1":0,"7.0-7.1":0.00223,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01113,"11.0-11.2":0.00111,"11.3-11.4":0.00223,"12.0-12.1":0,"12.2-12.5":0.02893,"13.0-13.1":0,"13.2":0.00556,"13.3":0,"13.4-13.7":0.00111,"14.0-14.4":0.00445,"14.5-14.8":0.00668,"15.0-15.1":0.00668,"15.2-15.3":0.00445,"15.4":0.00556,"15.5":0.00668,"15.6-15.8":0.14464,"16.0":0.01113,"16.1":0.02003,"16.2":0.01113,"16.3":0.02448,"16.4":0.00556,"16.5":0.0089,"16.6-16.7":0.20139,"17.0":0.00779,"17.1":0.01113,"17.2":0.01113,"17.3":0.01669,"17.4":0.02337,"17.5":0.04562,"17.6-17.7":0.11794,"18.0":0.02448,"18.1":0.04896,"18.2":0.06676,"18.3":0.11571,"18.4":0.07232,"18.5-18.7":1.49426,"26.0":0.07232,"26.1":0.07343,"26.2":0.19137,"26.3":0.20695,"26.4":0.15132,"26.5":1.0136,"26.6":6.25408,"27.0":0.47954,"27.1":0,"27.2":0.01224},P:{"22":0.00954,"23":0.00954,"24":0.00954,"25":0.00954,"26":0.00954,"27":0.01908,"28":0.02862,"29":0.07633,"30":1.48845,_:"4 20 21 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 15.0 16.0 17.0 18.0 19.0","14.0":0.01908},I:{"0":0.02196,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.74732,_:"10 11 12 11.1 11.5 12.1Line truncated
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Dribbble = createLucideIcon("Dribbble", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "M19.13 5.09C15.22 9.14 10 10.44 2.25 10.94", key: "hpej1" }],
["path", { d: "M21.75 12.84c-6.62-1.41-12.14 1-16.38 6.32", key: "1tr44o" }],
["path", { d: "M8.56 2.75c4.37 6 6 9.42 8 17.72", key: "kbh691" }]
]);
export { Dribbble as default };
//# sourceMappingURL=dribbble.js.map
@@ -0,0 +1,3 @@
import * as React from 'react';
export declare const matchContext: React.Context<string | undefined>;
export declare const dummyMatchContext: React.Context<string | undefined>;
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareChevronUp = createLucideIcon("SquareChevronUp", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "m8 14 4-4 4 4", key: "fy2ptz" }]
]);
export { SquareChevronUp as default };
//# sourceMappingURL=square-chevron-up.js.map
@@ -0,0 +1,14 @@
const path = require('path');
const { version } = require('./package.json');
const includeDir = path.relative('.', __dirname);
module.exports = {
include: `"${__dirname}"`, // deprecated, can be removed as part of 4.0.0
include_dir: includeDir,
gyp: path.join(includeDir, 'node_api.gyp:nothing'), // deprecated.
targets: path.join(includeDir, 'node_addon_api.gyp'),
version,
isNodeApiBuiltin: true,
needsFlag: false
};
@@ -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 './square-chevron-right.js';
//# sourceMappingURL=chevron-right-square.js.map
@@ -0,0 +1,6 @@
function isNumber(value) {
return typeof value === "number" && value === value;
}
export {
isNumber
};
@@ -0,0 +1,15 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2015_proxy = void 0;
const base_config_1 = require("./base-config");
exports.es2015_proxy = {
libs: [],
variables: [
['ProxyHandler', base_config_1.TYPE],
['ProxyConstructor', base_config_1.TYPE],
],
};
@@ -0,0 +1,2 @@
declare const _default: "# Code-Based Routing\n\n> [!TIP]\n> Code-based routing is not recommended for most applications. It is recommended to use [File-Based Routing](./file-based-routing.md) instead.\n\n## \u26A0\uFE0F Before You Start\n\n- If you're using [File-Based Routing](./file-based-routing.md), **skip this guide**.\n- If you still insist on using code-based routing, you must read the [Routing Concepts](./routing-concepts.md) guide first, as it also covers core concepts of the router.\n\n## Route Trees\n\nCode-based routing is no different from file-based routing in that it uses the same route tree concept to organize, match and compose matching routes into a component tree. The only difference is that instead of using the filesystem to organize your routes, you use code.\n\nLet's consider the same route tree from the [Route Trees & Nesting](./route-trees.md#route-trees) guide, and convert it to code-based routing:\n\nHere is the file-based version:\n\n```\nroutes/\n\u251C\u2500\u2500 __root.tsx\n\u251C\u2500\u2500 index.tsx\n\u251C\u2500\u2500 about.tsx\n\u251C\u2500\u2500 posts/\n\u2502 \u251C\u2500\u2500 index.tsx\n\u2502 \u251C\u2500\u2500 $postId.tsx\n\u251C\u2500\u2500 posts.$postId.edit.tsx\n\u251C\u2500\u2500 settings/\n\u2502 \u251C\u2500\u2500 profile.tsx\n\u2502 \u251C\u2500\u2500 notifications.tsx\n\u251C\u2500\u2500 _pathlessLayout.tsx\n\u251C\u2500\u2500 _pathlessLayout/\n\u2502 \u251C\u2500\u2500 route-a.tsx\n\u251C\u2500\u2500 \u251C\u2500\u2500 route-b.tsx\n\u251C\u2500\u2500 files/\n\u2502 \u251C\u2500\u2500 $.tsx\n```\n\nAnd here is a summarized code-based version:\n\n<!-- ::start:framework -->\n\n# React\n\n```tsx\nimport { createRootRoute, createRoute } from '@tanstack/react-router'\n\nconst rootRoute = createRootRoute()\n\nconst indexRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: '/',\n})\n\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'about',\n})\n\nconst postsRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'posts',\n})\n\nconst postsIndexRoute = createRoute({\n getParentRoute: () => postsRoute,\n path: '/',\n})\n\nconst postRoute = createRoute({\n getParentRoute: () => postsRoute,\n path: '$postId',\n})\n\nconst postEditorRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'posts/$postId/edit',\n})\n\nconst settingsRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'settings',\n})\n\nconst profileRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'profile',\n})\n\nconst notificationsRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'notifications',\n})\n\nconst pathlessLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n id: 'pathlessLayout',\n})\n\nconst pathlessLayoutARoute = createRoute({\n getParentRoute: () => pathlessLayoutRoute,\n path: 'route-a',\n})\n\nconst pathlessLayoutBRoute = createRoute({\n getParentRoute: () => pathlessLayoutRoute,\n path: 'route-b',\n})\n\nconst filesRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'files/$',\n})\n```\n\n# Solid\n\n```tsx\nimport { createRootRoute, createRoute } from '@tanstack/solid-router'\n\nconst rootRoute = createRootRoute()\n\nconst indexRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: '/',\n})\n\nconst aboutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'about',\n})\n\nconst postsRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'posts',\n})\n\nconst postsIndexRoute = createRoute({\n getParentRoute: () => postsRoute,\n path: '/',\n})\n\nconst postRoute = createRoute({\n getParentRoute: () => postsRoute,\n path: '$postId',\n})\n\nconst postEditorRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'posts/$postId/edit',\n})\n\nconst settingsRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'settings',\n})\n\nconst profileRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'profile',\n})\n\nconst notificationsRoute = createRoute({\n getParentRoute: () => settingsRoute,\n path: 'notifications',\n})\n\nconst pathlessLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n id: 'pathlessLayout',\n})\n\nconst pathlessLayoutARoute = createRoute({\n getParentRoute: () => pathlessLayoutRoute,\n path: 'route-a',\n})\n\nconst pathlessLayoutBRoute = createRoute({\n getParentRoute: () => pathlessLayoutRoute,\n path: 'route-b',\n})\n\nconst filesRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: 'files/$',\n})\n```\n\n<!-- ::end:framework -->\n\n## Anatomy of a Route\n\nAll other routes other than the root route are configured using the `createRoute` function:\n\n```tsx\nconst route = createRoute({\n getParentRoute: () => rootRoute,\n path: '/posts',\n component: PostsComponent,\n})\n```\n\nThe `getParentRoute` option is a function that returns the parent route of the route you're creating.\n\n**\uLine truncated
export default _default;
@@ -0,0 +1,307 @@
/**
* @fileoverview Rule to check empty newline after "var" statement
* @author Gopal Venkatesan
* @deprecated in ESLint v4.0.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
docs: {
description:
"Require or disallow an empty line after variable declarations",
recommended: false,
url: "https://eslint.org/docs/latest/rules/newline-after-var",
},
schema: [
{
enum: ["never", "always"],
},
],
fixable: "whitespace",
messages: {
expected: "Expected blank line after variable declarations.",
unexpected: "Unexpected blank line after variable declarations.",
},
deprecated: {
message: "The rule was replaced with a more general rule.",
url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
deprecatedSince: "4.0.0",
availableUntil: "11.0.0",
replacedBy: [
{
message: "The new rule moved to a plugin.",
url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "padding-line-between-statements",
url: "https://eslint.style/rules/padding-line-between-statements",
},
},
],
},
},
create(context) {
const sourceCode = context.sourceCode;
// Default `mode` to "always".
const mode = context.options[0] === "never" ? "never" : "always";
// Cache starting and ending line numbers of comments for faster lookup
const commentEndLine = sourceCode
.getAllComments()
.reduce((result, token) => {
result[token.loc.start.line] = token.loc.end.line;
return result;
}, {});
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Gets a token from the given node to compare line to the next statement.
*
* In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy.
*
* - The last token is semicolon.
* - The semicolon is on a different line from the previous token of the semicolon.
*
* This behavior would address semicolon-less style code. e.g.:
*
* var foo = 1
*
* ;(a || b).doSomething()
* @param {ASTNode} node The node to get.
* @returns {Token} The token to compare line to the next statement.
*/
function getLastToken(node) {
const lastToken = sourceCode.getLastToken(node);
if (lastToken.type === "Punctuator" && lastToken.value === ";") {
const prevToken = sourceCode.getTokenBefore(lastToken);
if (prevToken.loc.end.line !== lastToken.loc.start.line) {
return prevToken;
}
}
return lastToken;
}
/**
* Determine if provided keyword is a variable declaration
* @private
* @param {string} keyword keyword to test
* @returns {boolean} True if `keyword` is a type of var
*/
function isVar(keyword) {
return (
keyword === "var" || keyword === "let" || keyword === "const"
);
}
/**
* Determine if provided keyword is a variant of for specifiers
* @private
* @param {string} keyword keyword to test
* @returns {boolean} True if `keyword` is a variant of for specifier
*/
function isForTypeSpecifier(keyword) {
return (
keyword === "ForStatement" ||
keyword === "ForInStatement" ||
keyword === "ForOfStatement"
);
}
/**
* Determine if provided keyword is an export specifiers
* @private
* @param {string} nodeType nodeType to test
* @returns {boolean} True if `nodeType` is an export specifier
*/
function isExportSpecifier(nodeType) {
return (
nodeType === "ExportNamedDeclaration" ||
nodeType === "ExportSpecifier" ||
nodeType === "ExportDefaultDeclaration" ||
nodeType === "ExportAllDeclaration"
);
}
/**
* Determine if provided node is the last of their parent block.
* @private
* @param {ASTNode} node node to test
* @returns {boolean} True if `node` is last of their parent block.
*/
function isLastNode(node) {
const token = sourceCode.getTokenAfter(node);
return (
!token || (token.type === "Punctuator" && token.value === "}")
);
}
/**
* Gets the last line of a group of consecutive comments
* @param {number} commentStartLine The starting line of the group
* @returns {number} The number of the last comment line of the group
*/
function getLastCommentLineOfBlock(commentStartLine) {
const currentCommentEnd = commentEndLine[commentStartLine];
return commentEndLine[currentCommentEnd + 1]
? getLastCommentLineOfBlock(currentCommentEnd + 1)
: currentCommentEnd;
}
/**
* Determine if a token starts more than one line after a comment ends
* @param {token} token The token being checked
* @param {integer} commentStartLine The line number on which the comment starts
* @returns {boolean} True if `token` does not start immediately after a comment
*/
function hasBlankLineAfterComment(token, commentStartLine) {
return (
token.loc.start.line >
getLastCommentLineOfBlock(commentStartLine) + 1
);
}
/**
* Checks that a blank line exists after a variable declaration when mode is
* set to "always", or checks that there is no blank line when mode is set
* to "never"
* @private
* @param {ASTNode} node `VariableDeclaration` node to test
* @returns {void}
*/
function checkForBlankLine(node) {
/*
* lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will
* sometimes be second-last if there is a semicolon on a different line.
*/
const lastToken = getLastToken(node),
/*
* If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken
* is the last token of the node.
*/
nextToken =
lastToken === sourceCode.getLastToken(node)
? sourceCode.getTokenAfter(node)
: sourceCode.getLastToken(node),
nextLineNum = lastToken.loc.end.line + 1;
// Ignore if there is no following statement
if (!nextToken) {
return;
}
// Ignore if parent of node is a for variant
if (isForTypeSpecifier(node.parent.type)) {
return;
}
// Ignore if parent of node is an export specifier
if (isExportSpecifier(node.parent.type)) {
return;
}
/*
* Some coding styles use multiple `var` statements, so do nothing if
* the next token is a `var` statement.
*/
if (nextToken.type === "Keyword" && isVar(nextToken.value)) {
return;
}
// Ignore if it is last statement in a block
if (isLastNode(node)) {
return;
}
// Next statement is not a `var`...
const noNextLineToken = nextToken.loc.start.line > nextLineNum;
const hasNextLineComment =
typeof commentEndLine[nextLineNum] !== "undefined";
if (mode === "never" && noNextLineToken && !hasNextLineComment) {
context.report({
node,
messageId: "unexpected",
fix(fixer) {
const linesBetween = sourceCode
.getText()
.slice(lastToken.range[1], nextToken.range[0])
.split(astUtils.LINEBREAK_MATCHER);
return fixer.replaceTextRange(
[lastToken.range[1], nextToken.range[0]],
`${linesBetween.slice(0, -1).join("")}\n${linesBetween.at(-1)}`,
);
},
});
}
// Token on the next line, or comment without blank line
if (
mode === "always" &&
(!noNextLineToken ||
(hasNextLineComment &&
!hasBlankLineAfterComment(nextToken, nextLineNum)))
) {
context.report({
node,
messageId: "expected",
fix(fixer) {
if (
(noNextLineToken
? getLastCommentLineOfBlock(nextLineNum)
: lastToken.loc.end.line) ===
nextToken.loc.start.line
) {
return fixer.insertTextBefore(nextToken, "\n\n");
}
return fixer.insertTextBeforeRange(
[
nextToken.range[0] - nextToken.loc.start.column,
nextToken.range[1],
],
"\n",
);
},
});
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
VariableDeclaration: checkForBlankLine,
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"eclipse.js","sources":["../../../src/icons/eclipse.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Eclipse\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTIgMmE3IDcgMCAxIDAgMTAgMTAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/eclipse\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 Eclipse = createLucideIcon('Eclipse', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M12 2a7 7 0 1 0 10 10', key: '1yuj32' }],\n]);\n\nexport default Eclipse;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyB,CAAA,CAAA,CAAA,CAAA,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;AACxD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"superscript.js","sources":["../../../src/icons/superscript.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Superscript\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNCAxOSA4LTgiIC8+CiAgPHBhdGggZD0ibTEyIDE5LTgtOCIgLz4KICA8cGF0aCBkPSJNMjAgMTJoLTRjMC0xLjUuNDQyLTIgMS41LTIuNVMyMCA4LjMzNCAyMCA3LjAwMmMwLS40NzItLjE3LS45My0uNDg0LTEuMjlhMi4xMDUgMi4xMDUgMCAwIDAtMi42MTctLjQzNmMtLjQyLjIzOS0uNzM4LjYxNC0uODk5IDEuMDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/superscript\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 Superscript = createLucideIcon('Superscript', [\n ['path', { d: 'm4 19 8-8', key: 'hr47gm' }],\n ['path', { d: 'm12 19-8-8', key: '1dhhmo' }],\n [\n 'path',\n {\n d: 'M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06',\n key: '1dfcux',\n },\n ],\n]);\n\nexport default Superscript;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
import Options from '../../Options'
import { MatchEstimated } from '../../types'
export default (options: Options, match: MatchEstimated) => {
if (match.regexName === 'recentYear') {
return {
warning: options.translations.warnings.recentYears,
suggestions: [
options.translations.suggestions.recentYears,
options.translations.suggestions.associatedYears,
],
}
}
return {
warning: null,
suggestions: [],
}
}
@@ -0,0 +1,12 @@
import { IDelay } from "./delay.interface";
import { IBackOffOptions } from "../options";
export declare abstract class Delay implements IDelay {
private options;
protected attempt: number;
constructor(options: IBackOffOptions);
apply(): Promise<unknown>;
setAttemptNumber(attempt: number): void;
private readonly jitteredDelay;
private readonly delay;
protected readonly numOfDelayedAttempts: number;
}
@@ -0,0 +1,547 @@
'use strict'
const { pipeline } = require('node:stream')
const { fetching } = require('../fetch')
const { webidl } = require('../webidl')
const { EventSourceStream } = require('./eventsource-stream')
const { parseMIMEType } = require('../fetch/data-url')
const { createFastMessageEvent } = require('../websocket/events')
const { isNetworkError } = require('../fetch/response')
const { cloneRequest } = require('../fetch/request')
const { isValidHeaderValue, kEnumerableProperty } = require('../../core/util')
const { environmentSettingsObject } = require('../fetch/util')
const { createPotentialCORSRequest } = require('./util')
const { getGlobalDispatcher } = require('../../global')
const { isomorphicDecode } = require('../infra')
const textEncoder = new TextEncoder()
let experimentalWarned = false
/**
* A reconnection time, in milliseconds. This must initially be an implementation-defined value,
* probably in the region of a few seconds.
*
* In Comparison:
* - Chrome uses 3000ms.
* - Deno uses 5000ms.
*
* @type {3000}
*/
const defaultReconnectionTime = 3000
/**
* The largest delay setTimeout supports. Larger values (including Infinity)
* make Node.js fire the timer after 1 ms instead, which would turn a large
* reconnection time into a reconnect storm.
* @type {number}
*/
const maxReconnectionTime = 2 ** 31 - 1
/**
* The readyState attribute represents the state of the connection.
* @typedef ReadyState
* @type {0|1|2}
* @readonly
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev
*/
/**
* The connection has not yet been established, or it was closed and the user
* agent is reconnecting.
* @type {0}
*/
const CONNECTING = 0
/**
* The user agent has an open connection and is dispatching events as it
* receives them.
* @type {1}
*/
const OPEN = 1
/**
* The connection is not open, and the user agent is not trying to reconnect.
* @type {2}
*/
const CLOSED = 2
/**
* Requests for the element will have their mode set to "cors" and their credentials mode set to "same-origin".
* @type {'anonymous'}
*/
const ANONYMOUS = 'anonymous'
/**
* Requests for the element will have their mode set to "cors" and their credentials mode set to "include".
* @type {'use-credentials'}
*/
const USE_CREDENTIALS = 'use-credentials'
/**
* The EventSource interface is used to receive server-sent events. It
* connects to a server over HTTP and receives events in text/event-stream
* format without closing the connection.
* @extends {EventTarget}
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
* @api public
*/
class EventSource extends EventTarget {
#events = {
open: null,
error: null,
message: null
}
#url
#withCredentials = false
/**
* @type {ReadyState}
*/
#readyState = CONNECTING
#request = null
#controller = null
#dispatcher
/**
* @type {import('./eventsource-stream').eventSourceSettings}
*/
#state
/**
* Creates a new EventSource object.
* @param {string} url
* @param {EventSourceInit} [eventSourceInitDict={}]
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface
*/
constructor (url, eventSourceInitDict = {}) {
// 1. Let ev be a new EventSource object.
super()
webidl.util.markAsUncloneable(this)
const prefix = 'EventSource constructor'
webidl.argumentLengthCheck(arguments, 1, prefix)
if (!experimentalWarned) {
experimentalWarned = true
process.emitWarning('EventSource is experimental, expect them to change at any time.', {
code: 'UNDICI-ES'
})
}
url = webidl.converters.USVString(url)
eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')
this.#dispatcher = eventSourceInitDict.node.dispatcher || eventSourceInitDict.dispatcher
this.#state = {
lastEventId: '',
reconnectionTime: eventSourceInitDict.node.reconnectionTime
}
// 2. Let settings be ev's relevant settings object.
// https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
const settings = environmentSettingsObject
let urlRecord
try {
// 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings.
urlRecord = new URL(url, settings.settingsObject.baseUrl)
this.#state.origin = urlRecord.origin
} catch (e) {
// 4. If urlRecord is failure, then throw a "SyntaxError" DOMException.
throw new DOMException(e, 'SyntaxError')
}
// 5. Set ev's url to urlRecord.
this.#url = urlRecord.href
// 6. Let corsAttributeState be Anonymous.
let corsAttributeState = ANONYMOUS
// 7. If the value of eventSourceInitDict's withCredentials member is true,
// then set corsAttributeState to Use Credentials and set ev's
// withCredentials attribute to true.
if (eventSourceInitDict.withCredentials === true) {
corsAttributeState = USE_CREDENTIALS
this.#withCredentials = true
}
// 8. Let request be the result of creating a potential-CORS request given
// urlRecord, the empty string, and corsAttributeState.
const request = createPotentialCORSRequest(urlRecord, '', corsAttributeState)
// 9. Set request's client to settings.
request.client = environmentSettingsObject.settingsObject
// 10. User agents may set (`Accept`, `text/event-stream`) in request's header list.
request.headersList.set('Accept', 'text/event-stream')
// 11. Set request's cache mode to "no-store".
request.cache = 'no-store'
// 12. Set request's initiator type to "other".
request.initiator = 'other'
// 13. Set ev's request to request.
this.#request = request
this.#connect()
}
/**
* Returns the state of this EventSource object's connection. It can have the
* values described below.
* @returns {ReadyState}
* @readonly
*/
get readyState () {
webidl.brandCheck(this, webidl.is.EventSource)
return this.#readyState
}
/**
* Returns the URL providing the event stream.
* @readonly
* @returns {string}
*/
get url () {
webidl.brandCheck(this, webidl.is.EventSource)
return this.#url
}
/**
* Returns a boolean indicating whether the EventSource object was
* instantiated with CORS credentials set (true), or not (false, the default).
*/
get withCredentials () {
webidl.brandCheck(this, webidl.is.EventSource)
return this.#withCredentials
}
#connect () {
if (this.#readyState === CLOSED) return
this.#readyState = CONNECTING
// Fetch a copy of the request so that every connection starts from the
// original request. Fetch mutates the request it is given (URL list,
// redirect count, response tainting and, on cross-origin redirects,
// headers), so reusing it makes reconnects go to the last redirect
// target and, after 20 redirects in total, fail forever.
// cloneRequest() shares the URL list, so copy it as well.
// 301/308 permanent redirects are handled the same as 302/307 temporary
// redirects. While the original EventSource spec required that permanent
// redirects be handled, WHATWG removed that requirement and has not
// yet opted to restore it... therefore all redirects gets handled the
// same.
const request = cloneRequest(this.#request)
request.urlList = [...this.#request.urlList]
const fetchParams = {
request,
dispatcher: this.#dispatcher
}
// 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection.
const processEventSourceEndOfBody = (response) => {
if (!isNetworkError(response)) {
return this.#reconnect()
}
}
// 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody...
fetchParams.processResponseEndOfBody = processEventSourceEndOfBody
// and processResponse set to the following steps given response res:
fetchParams.processResponse = (response) => {
// 1. If res is an aborted network error, then fail the connection.
if (isNetworkError(response)) {
// 1. When a user agent is to fail the connection, the user agent
// must queue a task which, if the readyState attribute is set to a
// value other than CLOSED, sets the readyState attribute to CLOSED
// and fires an event named error at the EventSource object. Once the
// user agent has failed the connection, it does not attempt to
// reconnect.
if (response.aborted) {
this.close()
this.dispatchEvent(new Event('error'))
return
// 2. Otherwise, if res is a network error, then reestablish the
// connection, unless the user agent knows that to be futile, in
// which case the user agent may fail the connection.
} else {
this.#reconnect()
return
}
}
// 3. Otherwise, if res's status is not 200, or if res's `Content-Type`
// is not `text/event-stream`, then fail the connection.
const contentType = response.headersList.get('content-type', true)
const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure'
const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream'
if (
response.status !== 200 ||
contentTypeValid === false
) {
this.close()
this.dispatchEvent(new Event('error'))
return
}
// 4. Otherwise, announce the connection and interpret res's body
// line by line.
// When a user agent is to announce the connection, the user agent
// must queue a task which, if the readyState attribute is set to a
// value other than CLOSED, sets the readyState attribute to OPEN
// and fires an event named open at the EventSource object.
// @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
this.#readyState = OPEN
this.dispatchEvent(new Event('open'))
// If redirected to a different origin, set the origin to the new origin.
this.#state.origin = response.urlList[response.urlList.length - 1].origin
const eventSourceStream = new EventSourceStream({
eventSourceSettings: this.#state,
maxEventSize: this.#dispatcher.eventSourceOptions?.maxEventSize,
push: (event) => {
this.dispatchEvent(createFastMessageEvent(
event.type,
event.options
))
}
})
pipeline(response.body.stream,
eventSourceStream,
(error) => {
if (
error?.aborted === false
) {
this.close()
this.dispatchEvent(new Event('error'))
}
})
}
this.#controller = fetching(fetchParams)
}
/**
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model
* @returns {void}
*/
#reconnect () {
// When a user agent is to reestablish the connection, the user agent must
// run the following steps. These steps are run in parallel, not as part of
// a task. (The tasks that it queues, of course, are run like normal tasks
// and not themselves in parallel.)
// 1. Queue a task to run the following steps:
// 1. If the readyState attribute is set to CLOSED, abort the task.
if (this.#readyState === CLOSED) return
// 2. Set the readyState attribute to CONNECTING.
this.#readyState = CONNECTING
// 3. Fire an event named error at the EventSource object.
this.dispatchEvent(new Event('error'))
// 2. Wait a delay equal to the reconnection time of the event source.
setTimeout(() => {
// 5. Queue a task to run the following steps:
// 1. If the EventSource object's readyState attribute is not set to
// CONNECTING, then return.
if (this.#readyState !== CONNECTING) return
// 2. Let request be the EventSource object's request.
// 3. If the EventSource object's last event ID string is not the empty
// string, then:
// 1. Let lastEventIDValue be the EventSource object's last event ID
// string, encoded as UTF-8.
// 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header
// list.
this.#request.headersList.delete('last-event-id', true)
if (this.#state.lastEventId.length) {
const lastEventId = isomorphicDecode(textEncoder.encode(this.#state.lastEventId))
if (isValidHeaderValue(lastEventId)) {
this.#request.headersList.set('last-event-id', lastEventId, true)
}
}
// 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section.
this.#connect()
}, Math.min(this.#state.reconnectionTime, maxReconnectionTime))?.unref()
}
/**
* Closes the connection, if any, and sets the readyState attribute to
* CLOSED.
*/
close () {
webidl.brandCheck(this, webidl.is.EventSource)
if (this.#readyState === CLOSED) return
this.#readyState = CLOSED
this.#controller.abort()
this.#request = null
}
get onopen () {
webidl.brandCheck(this, webidl.is.EventSource)
return this.#events.open
}
set onopen (fn) {
webidl.brandCheck(this, webidl.is.EventSource)
if (this.#events.open) {
this.removeEventListener('open', this.#events.open)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('open', listener)
this.#events.open = fn
} else {
this.#events.open = null
}
}
get onmessage () {
webidl.brandCheck(this, webidl.is.EventSource)
return this.#events.message
}
set onmessage (fn) {
webidl.brandCheck(this, webidl.is.EventSource)
if (this.#events.message) {
this.removeEventListener('message', this.#events.message)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('message', listener)
this.#events.message = fn
} else {
this.#events.message = null
}
}
get onerror () {
webidl.brandCheck(this, webidl.is.EventSource)
return this.#events.error
}
set onerror (fn) {
webidl.brandCheck(this, webidl.is.EventSource)
if (this.#events.error) {
this.removeEventListener('error', this.#events.error)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('error', listener)
this.#events.error = fn
} else {
this.#events.error = null
}
}
static {
webidl.is.EventSource = (arg) => {
return arg != null && typeof arg === 'object' && #events in arg
}
}
}
const constantsPropertyDescriptors = {
CONNECTING: {
__proto__: null,
configurable: false,
enumerable: true,
value: CONNECTING,
writable: false
},
OPEN: {
__proto__: null,
configurable: false,
enumerable: true,
value: OPEN,
writable: false
},
CLOSED: {
__proto__: null,
configurable: false,
enumerable: true,
value: CLOSED,
writable: false
}
}
Object.defineProperties(EventSource, constantsPropertyDescriptors)
Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors)
Object.defineProperties(EventSource.prototype, {
close: kEnumerableProperty,
onerror: kEnumerableProperty,
onmessage: kEnumerableProperty,
onopen: kEnumerableProperty,
readyState: kEnumerableProperty,
url: kEnumerableProperty,
withCredentials: kEnumerableProperty
})
webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
{
key: 'withCredentials',
converter: webidl.converters.boolean,
defaultValue: () => false
},
{
key: 'dispatcher', // undici only
converter: webidl.converters.any,
defaultValue: () => getGlobalDispatcher()
},
{
key: 'node', // undici only
converter: webidl.dictionaryConverter([
{
key: 'reconnectionTime',
converter: webidl.converters['unsigned long'],
defaultValue: () => defaultReconnectionTime
},
{
key: 'dispatcher',
converter: webidl.converters.any
}
]),
defaultValue: () => ({})
}
])
module.exports = {
EventSource,
defaultReconnectionTime
}
@@ -0,0 +1,33 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type Options = [
{
/**
* If `true`, allow `default` cases on switch statements with exhaustive
* cases.
*
* @default true
*/
allowDefaultCaseForExhaustiveSwitch?: boolean;
/**
* If `true`, require a `default` clause for switches on non-union types.
*
* @default false
*/
requireDefaultForNonUnion?: boolean;
/**
* Regular expression for a comment that can indicate an intentionally omitted default case.
*/
defaultCaseCommentPattern?: string;
/**
* If `true`, the `default` clause is used to determine whether the switch statement is exhaustive for union types.
*
* @default false
*/
considerDefaultExhaustiveForUnions?: boolean;
}
];
export type MessageIds = 'addMissingCases' | 'dangerousDefaultCase' | 'switchIsNotExhaustive';
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,105 @@
{
"name": "object-inspect",
"version": "1.13.4",
"description": "string representations of objects in node and the browser",
"main": "index.js",
"sideEffects": false,
"devDependencies": {
"@ljharb/eslint-config": "^21.1.1",
"@pkgjs/support": "^0.0.6",
"auto-changelog": "^2.5.0",
"core-js": "^2.6.12",
"error-cause": "^1.0.8",
"es-value-fixtures": "^1.7.1",
"eslint": "=8.8.0",
"for-each": "^0.3.4",
"functions-have-names": "^1.2.3",
"glob": "=10.3.7",
"globalthis": "^1.0.4",
"has-symbols": "^1.1.0",
"has-tostringtag": "^1.0.2",
"in-publish": "^2.0.1",
"jackspeak": "=2.1.1",
"make-arrow-function": "^1.2.0",
"mock-property": "^1.1.0",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"safer-buffer": "^2.1.2",
"semver": "^6.3.1",
"string.prototype.repeat": "^1.0.0",
"tape": "^5.9.0"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"pretest": "npm run lint",
"lint": "eslint --ext=js,mjs .",
"postlint": "npx @pkgjs/support validate",
"test": "npm run tests-only && npm run test:corejs",
"tests-only": "nyc tape 'test/*.js'",
"test:corejs": "nyc tape test-core-js.js 'test/*.js'",
"posttest": "npx npm@'>=10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"testling": {
"files": [
"test/*.js",
"test/browser/*.js"
],
"browsers": [
"ie/6..latest",
"chrome/latest",
"firefox/latest",
"safari/latest",
"opera/latest",
"iphone/latest",
"ipad/latest",
"android/latest"
]
},
"repository": {
"type": "git",
"url": "git://github.com/inspect-js/object-inspect.git"
},
"homepage": "https://github.com/inspect-js/object-inspect",
"keywords": [
"inspect",
"util.inspect",
"object",
"stringify",
"pretty"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"browser": {
"./util.inspect.js": false
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows",
"./test-core-js.js"
]
},
"support": true,
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,828 @@
flf2a$ 8 7 17 0 11 0 24447 0
Author : bpg
Date : 2004/6/17 9:16:55
Version: 1.0
-------------------------------------------------
made for fun (ty myflix and LGB for help)
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ #
$ #
$ #
$ #
$ #
$ #
$ #
$ ##
__ #
/__/\ #
\.:\ \ #
\::\ \ #
\__\/_ #
/__/\ #
\__\/ #
##
___ ___ #
/__/\/__/\ #
\::\ \::\ \ #
\:_\/\:_\/ #
#
#
#
##
##
#
#
#
#
#
#
##
$#
#
#
#
#
#
#
##
%#
#
#
#
#
#
#
##
&#
#
#
#
#
#
#
##
___ #
/__/\ #
\::\ \ #
\:_\/ #
#
#
#
##
(#
#
#
#
#
#
#
##
)#
#
#
#
#
#
#
##
*#
#
#
#
#
#
#
##
+#
#
#
#
#
#
#
##
#
#
#
____ #
/___/\ #
\:::\ \ #
\::\/ #
##
#
#
_______ #
/______/\ #
\__::::\/ #
#
#
##
#
#
#
___ #
/__/\ #
\::\ \ #
\:_\/ #
##
/#
#
#
#
#
#
#
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\_\ \ \ #
\_____\/ #
##
____ #
/___/\ #
\_::\ \ #
\::\ \ #
_\: \ \__ #
/__\: \__/\ #
\________\/ #
##
_____ #
/_____/\ #
\:::_:\ \ #
_\:\| #
/::_/__ #
\:\____/\ #
\_____\/ #
##
______ #
/_____/\ #
\:::_:\ \ #
/_\:\ \ #
\::_:\ \ #
/___\:\ ' #
\______/ #
##
__ __ #
/__/\/__/\ #
\ \ \: \ \__ #
\::\_\::\/_/\ #
\_::: __\/ #
\::\ \ #
\__\/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\_::._\:\ #
/_____\/ #
\_____/ #
##
______ #
/_____/\ #
\:::__\/ #
\:\ \____ #
\::__::/\ #
\:\_\:\ \ #
\_____\/ #
##
_______ #
/______/\ #
\__::::\ \ #
\::\ \ #
\::\ \ #
\: \ \ #
\:_\/ #
##
______ #
/_____/\ #
\:::_:\ \ #
\:\_\:\ \ #
\::__:\ \ #
\:\_\:\ \ #
\_____\/ #
##
______ #
/_____/\ #
\:::_:\ \ #
\:\_\:\ \ #
\::__:\ \ #
\ \ \ #
\_\/ #
##
___ #
/__/\ #
\::\/ #
___ #
/__/\ #
\::\/ #
#
##
;#
#
#
#
#
#
#
##
<#
#
#
#
#
#
#
##
=#
#
#
#
#
#
#
##
>#
#
#
#
#
#
#
##
______ #
/_____/\ #
\__:::\ \ #
/::/ / #
\::\/_ #
/__/\ #
\__\/ #
##
@#
#
#
#
#
#
#
##
________ #
/_______/\ #
\::: _ \ \ #
\::(_) \ \ #
\:: __ \ \ #
\:.\ \ \ \ #
\__\/\__\/ #
##
_______ #
/_______/\ #
\::: _ \ \ #
\::(_) \/_ #
\:: _ \ \ #
\::(_) \ \ #
\_______\/ #
##
______ #
/_____/\ #
\:::__\/ #
\:\ \ __ #
\:\ \/_/\ #
\:\_\ \ \ #
\_____\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\/.:| | #
\____/_/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\::___\/_ #
\:\____/\ #
\_____\/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\:::._\/ #
\:\ \ #
\_\/ #
##
_______ #
/______/\ #
\::::__\/__ #
\:\ /____/\ #
\:\\_ _\/ #
\:\_\ \ \ #
\_____\/ #
##
___ ___ #
/__/\ /__/\ #
\::\ \\ \ \ #
\::\/_\ .\ \ #
\:: ___::\ \ #
\: \ \\::\ \#
\__\/ \::\/#
##
________ #
/_______/\ #
\__.::._\/ #
\::\ \ #
_\::\ \__ #
/__\::\__/\ #
\________\/ #
##
_________ #
/________/\ #
\__.::.__\/ #
/_\::\ \ #
\:.\::\ \ #
\: \ \ \ #
\_____\/ #
##
___ ___ #
/___/\/__/\ #
\::.\ \\ \ \ #
\:: \/_) \ \ #
\:. __ ( ( #
\: \ ) \ \ #
\__\/\__\/ #
##
__ #
/_/\ #
\:\ \ #
\:\ \ #
\:\ \____ #
\:\/___/\ #
\_____\/ #
##
___ __ __ #
/__//_//_/\ #
\::\| \| \ \ #
\:. \ \ #
\:.\-/\ \ \ #
\. \ \ \ \#
\__\/ \__\/#
##
___ __ #
/__/\ /__/\ #
\::\_\\ \ \ #
\:. `-\ \ \ #
\:. _ \ \ #
\. \`-\ \ \#
\__\/ \__\/#
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\_\ \ \ #
\_____\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:(_) \ \ #
\: ___\/ #
\ \ \ #
\_\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \_ #
\:\ \ /_ \ #
\:\_- \ \ #
\___|\_\_/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:(_) ) )_ #
\: __ `\ \ #
\ \ `\ \ \ #
\_\/ \_\/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\_::._\:\ #
/____\:\ #
\_____\/ #
##
_________ #
/________/\ #
\__.::.__\/ #
\::\ \ #
\::\ \ #
\::\ \ #
\__\/ #
##
__ __ #
/_/\/_/\ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\_\:\ \ #
\_____\/ #
##
__ __ #
/_/\ /_/\ #
\:\ \\ \ \ #
\:\ \\ \ \ #
\:\_/.:\ \ #
\ ..::/ / #
\___/_( #
##
__ __ __ #
/_//_//_/\ #
\:\\:\\:\ \ #
\:\\:\\:\ \ #
\:\\:\\:\ \ #
\:\\:\\:\ \ #
\_______\/ #
##
__ __ #
/__/\ /__/\ #
\ \::\\:.\ \ #
\_\::_\:_\/ #
_\/__\_\_/\ #
\ \ \ \::\ \#
\_\/ \__\/#
##
__ __ #
/_/\/_/\ #
\ \ \ \ \ #
\:\_\ \ \ #
\::::_\/ #
\::\ \ #
\__\/ #
##
______ #
/_____/\ #
\:::__\/ #
/: / #
/::/___ #
/_:/____/\ #
\_______\/ #
##
[#
#
#
#
#
#
#
##
\#
#
#
#
#
#
#
##
]#
#
#
#
#
#
#
##
__ #
/\ \ #
/::\ \ #
/:/\_\/ #
#
#
#
##
#
#
#
#
_______ #
/______/\ #
\__::::\/ #
##
_____ #
/____/\ #
\_:::\ \ #
\ :\ \ #
\__\/ #
#
#
##
________ #
/_______/\ #
\::: _ \ \ #
\::(_) \ \ #
\:: __ \ \ #
\:.\ \ \ \ #
\__\/\__\/ #
##
_______ #
/_______/\ #
\::: _ \ \ #
\::(_) \/_ #
\:: _ \ \ #
\::(_) \ \ #
\_______\/ #
##
______ #
/_____/\ #
\:::__\/ #
\:\ \ __ #
\:\ \/_/\ #
\:\_\ \ \ #
\_____\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\/.:| | #
\____/_/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\::___\/_ #
\:\____/\ #
\_____\/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\:::._\/ #
\:\ \ #
\_\/ #
##
_______ #
/______/\ #
\::::__\/__ #
\:\ /____/\ #
\:\\_ _\/ #
\:\_\ \ \ #
\_____\/ #
##
___ ___ #
/__/\ /__/\ #
\::\ \\ \ \ #
\::\/_\ .\ \ #
\:: ___::\ \ #
\: \ \\::\ \#
\__\/ \::\/#
##
________ #
/_______/\ #
\__.::._\/ #
\::\ \ #
_\::\ \__ #
/__\::\__/\ #
\________\/ #
##
_________ #
/________/\ #
\__.::.__\/ #
/_\::\ \ #
\:.\::\ \ #
\: \ \ \ #
\_____\/ #
##
___ ___ #
/___/\/__/\ #
\::.\ \\ \ \ #
\:: \/_) \ \ #
\:. __ ( ( #
\: \ ) \ \ #
\__\/\__\/ #
##
__ #
/_/\ #
\:\ \ #
\:\ \ #
\:\ \____ #
\:\/___/\ #
\_____\/ #
##
___ __ __ #
/__//_//_/\ #
\::\| \| \ \ #
\:. \ \ #
\:.\-/\ \ \ #
\. \ \ \ \#
\__\/ \__\/#
##
___ __ #
/__/\ /__/\ #
\::\_\\ \ \ #
\:. `-\ \ \ #
\:. _ \ \ #
\. \`-\ \ \#
\__\/ \__\/#
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\_\ \ \ #
\_____\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:(_) \ \ #
\: ___\/ #
\ \ \ #
\_\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \_ #
\:\ \ /_ \ #
\:\_- \ \ #
\___|\_\_/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:(_) ) )_ #
\: __ `\ \ #
\ \ `\ \ \ #
\_\/ \_\/ #
##
______ #
/_____/\ #
\::::_\/_ #
\:\/___/\ #
\_::._\:\ #
/____\:\ #
\_____\/ #
##
_________ #
/________/\ #
\__.::.__\/ #
\::\ \ #
\::\ \ #
\::\ \ #
\__\/ #
##
__ __ #
/_/\/_/\ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\_\:\ \ #
\_____\/ #
##
__ __ #
/_/\ /_/\ #
\:\ \\ \ \ #
\:\ \\ \ \ #
\:\_/.:\ \ #
\ ..::/ / #
\___/_( #
##
__ __ __ #
/_//_//_/\ #
\:\\:\\:\ \ #
\:\\:\\:\ \ #
\:\\:\\:\ \ #
\:\\:\\:\ \ #
\_______\/ #
##
__ __ #
/__/\ /__/\ #
\ \::\\:.\ \ #
\_\::_\:_\/ #
_\/__\_\_/\ #
\ \ \ \::\ \#
\_\/ \__\/#
##
__ __ #
/_/\/_/\ #
\ \ \ \ \ #
\:\_\ \ \ #
\::::_\/ #
\::\ \ #
\__\/ #
##
______ #
/_____/\ #
\:::__\/ #
/: / #
/::/___ #
/_:/____/\ #
\_______\/ #
##
_____ #
/____/\ #
_\:::_\/ #
/____/\ #
\::__\/_ #
| ___/\ #
\::_\/ #
##
|#
#
#
#
#
#
#
##
_____ #
/____/\ #
\_:::\ \__ #
/____/\ #
_\__::\/ #
/___/ | #
\_::\/ #
##
/""--__ #
\"::-__/\ #
\ ::: \ \ #
""-::_\/ #
#
#
#
##
________ #
/_______/\ #
\::: _ \ \ #
\::(_) \ \ #
\:: __ \ \ #
\:.\ \ \ \ #
\__\/\__\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\_\ \ \ #
\_____\/ #
##
__ __ #
/_/\/_/\ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\_\:\ \ #
\_____\/ #
##
________ #
/_______/\ #
\::: _ \ \ #
\::(_) \ \ #
\:: __ \ \ #
\:.\ \ \ \ #
\__\/\__\/ #
##
______ #
/_____/\ #
\:::_ \ \ #
\:\ \ \ \ #
\:\ \ \ \ #
\:\_\ \ \ #
\_____\/ #
##
__ __ #
/_/\/_/\ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\ \:\ \ #
\:\_\:\ \ #
\_____\/ #
##
ß#
#
#
#
#
#
#
##
@@ -0,0 +1,819 @@
flf2a$ 8 6 20 -1 2
Tanja was written for -=Tanja Lynnx Jackson=- by
Christopher J. Pirillo "The Locker Gnome" <pirill44@iscssun.uni.edu>
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
!) @
!)11 @
!)11 @
!) @
@
!) @
@
@@
*** *** @
## ## @
## ## @
@
@
@
@
@@
#) 33 @
#)3333333 @
#) 33 @
#) 33 @
#)3333333 @
#) 33 @
@
@@
S) @
S)4444 @
S) 44 @
S)4444 @
S) 44 @
S)44444 @
S) @
@@
%) 555 @
%) 555 @
%)5 @
%)5 @
%)5 55 @
%)5 55 @
@
@@
&)77 @
&) 77 @
&)77 @
&) 77 @
&) 77 @
&)77777 @
@
@@
*** @
## @
## @
@
@
@
@
@@
() @
() @
() @
() @
() @
() @
@
@@
)) @
)) @
)) @
)) @
)) @
)) @
@
@@
*) @
*) 8 88 @
*)8 8 @
*)8888888 @
*)8 8 @
*) 8 88 @
*) @
@@
@
@
## @
###### @
## @
@
@
@@
@
@
@
@
*** @
## @
## @
@@
@
@
@
####### @
@
@
@
@@
@
@
@
@
** @
## @
@
@@
/)? @
/)? @
/)? @
/)? @
/)? @
/)? @
@
@@
0)))) @
0) ))) @
0) ) )) @
0) ) )) @
0)) )) @
0)))) @
@
@@
1)! @
1)!! @
1) @
1) @
1) @
1)!!!!! @
@
@@
2)AAA @
2) AA @
2) @
2) @
2) @
2)AAAAA @
@
@@
3)### @
3) ## @
3)# @
3) @
3) ## @
3)### @
@
@@
4) SS @
4) SS @
4)SSSSS @
4) @
4) @
4) @
@
@@
5)%%%% @
5) @
5)%%%% @
5) @
5) @
5)%%%% @
@
@@
6)NNN @
6) @
6)NNNN @
6) NN @
6) NN @
6)NNN @
@
@@
7)&&&&& @
7) @
7) @
7) @
7) @
7) @
@
@@
8)*** @
8) ** @
8)*** @
8) ** @
8) ** @
8)*** @
@
@@
9)((( @
9) (( @
9)(((( @
9) @
9) (( @
9)((( @
@
@@
@
@
## @
@
## @
@
@
@@
@
@
## @
@
*** @
## @
## @
@@
<) @
<) @
<) @
<) @
<) @
<) @
<) @
@@
@
@
####### @
@
####### @
@
@
@@
>) @
>) @
>) @
>) @
>) @
>) @
>) @
@@
?)//// @
?) // @
?) @
?) @
@
?) @
@
@@
A)222 @
A) 2 @
A) 2222 @
A) 2 2 @
A) 222 @
A) @
@
@@
A)aa @
A) aa @
A) aa @
A)aaaaaa @
A) aa @
A) aa @
@
@@
B)bbbb @
B) bb @
B)bbbb @
B) bb @
B) bb @
B)bbbbb @
@
@@
C)ccc @
C) cc @
C) @
C) @
C) cc @
C)ccc @
@
@@
D)dddd @
D) dd @
D) dd @
D) dd @
D) dd @
D)ddddd @
@
@@
E)eeeeee @
E) @
E)eeeee @
E) @
E) @
E)eeeeee @
@
@@
F)ffffff @
F) @
F)fffff @
F) @
F) @
F) @
@
@@
G)gggg @
G) @
G) ggg @
G) gg @
G) gg @
G)ggg @
@
@@
H) hh @
H) hh @
H)hhhhhh @
H) hh @
H) hh @
H) hh @
@
@@
I)iiii @
I) @
I) @
I) @
I) @
I)iiii @
@
@@
J)jjjjjj @
J) @
J) @
J) jj @
J) jj @
J)jj @
@
@@
K) kk @
K) kk @
K)kkk @
K) kk @
K) kk @
K) kk @
@
@@
L) @
L) @
L) @
L) @
L) @
L)llllll @
@
@@
M)mm mmm @
M) mm mm @
M) mm mm @
M) mm mm @
M) mm @
M) mm @
@
@@
N)n nn @
N)nn nn @
N) nn nn @
N) nnnn @
N) nnn @
N) nn @
@
@@
O)oooo @
O) oo @
O) oo @
O) oo @
O) oo @
O)oooo @
@
@@
P)ppppp @
P) pp @
P)ppppp @
P) @
P) @
P) @
@
@@
Q)qqqq @
Q) qq @
Q) qq @
Q) qq q @
Q) qq @
Q)qqq q @
@
@@
R)rrrrr @
R) rr @
R) rrr @
R) rr @
R) rr @
R) rr @
@
@@
S)ssss @
S) ss @
S)ss @
S) @
S) ss @
S)ssss @
@
@@
T)tttttt @
T) @
T) @
T) @
T) @
T) @
@
@@
U) uu @
U) uu @
U) uu @
U) uu @
U) uu @
U)uuuu @
@
@@
V) vv @
V) vv @
V) vv @
V) vv @
V)vv @
V) @
@
@@
W) ww @
W) ww @
W) ww ww @
W) ww ww @
W) ww ww @
W)ww www @
@
@@
X) xx @
X) xx @
X)xx @
X)xx @
X) xx @
X) xx @
@
@@
Y) yy @
Y) yy @
Y)yy @
Y) @
Y) @
Y) @
@
@@
Z)zzzzzz @
Z) @
Z) @
Z) @
Z) @
Z)zzzzzz @
@
@@
[){{ @
[) @
[) @
[) @
[) @
[){{ @
@
@@
\)| @
\)| @
\)| @
\)| @
\)| @
\)| @
@
@@
])}} @
]) @
]) @
]) @
]) @
])}} @
@
@@
** @
## ## @
@
@
@
@
@
@@
@
@
@
@
@
####### @
@
@@
*** @
## @
## @
@
@
@
@
@@
@
@
a)AAAA @
a)AAA @
a) A @
a)AAAA @
@
@@
b) @
b) @
b)BBBB @
b) BB @
b) BB @
b)BBBB @
@
@@
@
@
c)CCCC @
c) @
c) @
c)CCCC @
@
@@
d) @
d) @
d)DDDD @
d) DD @
d) DD @
d)DDDD @
@
@@
@
@
e)EEEEE @
e)EEEE @
e) @
e)EEEE @
@
@@
f)FFF @
f) @
f)FFF @
f) @
f) @
f) @
@
@@
@
@
g)GGG @
g) GG @
g) GG @
g)GGGG @
GG @
g)GGGG @@
h) @
h) @
h)HHHH @
h) HH @
h) HH @
h) HH @
@
@@
## @
@
i) @
i) @
i) @
i) @
@
@@
## @
@
j) @
j) @
j) @
j) @
j) JJ @
j)JJJ @@
k) @
k) @
k) KK @
k)KK @
k) KK @
k) KK @
@
@@
l)L @
l) @
l) @
l) @
l) @
l)LL @
@
@@
@
@
m)MM MMM @
m) MM MM @
m) MM MM @
m) MM @
@
@@
@
@
n)NNNN @
n) NN @
n) NN @
n) NN @
@
@@
@
@
o)OOO @
o) OO @
o) OO @
o)OOO @
@
@@
@
@
p)PPPP @
p) PP @
p) PP @
p)PPPP @
p) @
p) @@
@
@
q)QQQ @
q) QQ @
q) QQ @
q)QQQQ @
q) @
q) @@
@
@
r)RRR @
r) RR @
r) @
r) @
@
@@
@
@
s)SSSS @
s)SSSS @
s) @
s)SSSS @
@
@@
t) @
t)tTTT @
t) @
t) @
t) @
t)T @
@
@@
@
@
u) UU @
u) UU @
u) UU @
u)UUU @
@
@@
@
@
v) VV @
v) VV @
v)VV @
v) @
@
@@
@
@
w) WW @
w) WW WW @
w) WW WW @
w)WW WWW @
@
@@
@
@
x) XX @
x)X @
x)X @
x) XX @
@
@@
@
@
y) YY @
y) YY @
y) YY @
y)YYYY @
y) @
y)YYYY @@
@
@
z)ZZZZZ @
z) @
z) @
z)ZZZZZ @
@
@@
{)[[[ @
{) @
[{) @
{) @
{) @
{)[[[ @
@
@@
|)\ @
|)\ @
|)\ @
|)\ @
|)\ @
|)\ @
@
@@
})]]] @
}) @
})] @
}) @
}) @
})]]] @
@
@@
@
_-`-_-` @
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
\ / @
, . ><>< . , @
\\ /..\ // @
, \\ \__/ // , @
\\ \\ // // @
\\ \\__// // @
\\__\__/__// @
~~~~~~~~ @@
@
@
@
@
@
@
@
@@
#### #### @
##...##...## @
#T........C# @
#A......H# @
#N....R# @
#J..I# @
#AS# @
## @@
@@ -0,0 +1,14 @@
import { MIN_YEAR_SPACE, REFERENCE_YEAR } from '../../data/const'
import { MatchEstimated, MatchExtended } from '../../types'
export default ({ year, separator }: MatchExtended | MatchEstimated) => {
// base guesses: (year distance from REFERENCE_YEAR) * num_days * num_years
const yearSpace = Math.max(Math.abs(year - REFERENCE_YEAR), MIN_YEAR_SPACE)
let guesses = yearSpace * 365
// add factor of 4 for separator selection (one of ~4 choices)
if (separator) {
guesses *= 4
}
return guesses
}
@@ -0,0 +1,34 @@
# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command)
> Get the command from a shebang
## Install
```
$ npm install shebang-command
```
## Usage
```js
const shebangCommand = require('shebang-command');
shebangCommand('#!/usr/bin/env node');
//=> 'node'
shebangCommand('#!/bin/bash');
//=> 'bash'
```
## API
### shebangCommand(string)
#### string
Type: `string`
String containing a shebang.
@@ -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 './square-dot.js';
//# sourceMappingURL=dot-square.js.map
@@ -0,0 +1,60 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPossiblyTruthy = exports.isPossiblyFalsy = void 0;
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const getValueOfLiteralType_1 = require("./getValueOfLiteralType");
// Truthiness utilities
const isTruthyLiteral = (type) => tsutils.isTrueLiteralType(type) ||
(type.isLiteral() && !!(0, getValueOfLiteralType_1.getValueOfLiteralType)(type));
const isPossiblyFalsy = (type) => tsutils
.unionConstituents(type)
// Intersections like `string & {}` can also be possibly falsy,
// requiring us to look into the intersection.
.flatMap(type => tsutils.intersectionConstituents(type))
// PossiblyFalsy flag includes literal values, so exclude ones that
// are definitely truthy
.filter(t => !isTruthyLiteral(t))
.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.PossiblyFalsy));
exports.isPossiblyFalsy = isPossiblyFalsy;
const isPossiblyTruthy = (type) => tsutils
.unionConstituents(type)
.map(type => tsutils.intersectionConstituents(type))
.some(intersectionParts =>
// It is possible to define intersections that are always falsy,
// like `"" & { __brand: string }`.
intersectionParts.every(type => !tsutils.isFalsyType(type)));
exports.isPossiblyTruthy = isPossiblyTruthy;
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classNameTDZError;
function _classNameTDZError(name) {
throw new ReferenceError('Class "' + name + '" cannot be referenced in computed property keys.');
}
//# sourceMappingURL=classNameTDZError.js.map
@@ -0,0 +1 @@
{"version":3,"file":"indent-decrease.js","sources":["../../../src/icons/indent-decrease.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name IndentDecrease\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTJIMTEiIC8+CiAgPHBhdGggZD0iTTIxIDE4SDExIiAvPgogIDxwYXRoIGQ9Ik0yMSA2SDExIiAvPgogIDxwYXRoIGQ9Im03IDgtNCA0IDQgNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/indent-decrease\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 IndentDecrease = createLucideIcon('IndentDecrease', [\n ['path', { d: 'M21 12H11', key: 'wd7e0v' }],\n ['path', { d: 'M21 18H11', key: '4wu86t' }],\n ['path', { d: 'M21 6H11', key: '6dy1d6' }],\n ['path', { d: 'm7 8-4 4 4 4', key: 'o5hrat' }],\n]);\n\nexport default IndentDecrease;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/C,CAAC,CAAA,CAAA;;"}
@@ -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 WashingMachine = createLucideIcon("WashingMachine", [
["path", { d: "M3 6h3", key: "155dbl" }],
["path", { d: "M17 6h.01", key: "e2y6kg" }],
["rect", { width: "18", height: "20", x: "3", y: "2", rx: "2", key: "od3kk9" }],
["circle", { cx: "12", cy: "13", r: "5", key: "nlbqau" }],
["path", { d: "M12 18a2.5 2.5 0 0 0 0-5 2.5 2.5 0 0 1 0-5", key: "17lach" }]
]);
export { WashingMachine as default };
//# sourceMappingURL=washing-machine.js.map
@@ -0,0 +1,252 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.environmentVisitor = environmentVisitor;
exports.explode = explode$1;
exports.isExplodedVisitor = isExplodedVisitor;
exports.merge = merge;
exports.verify = verify$1;
var virtualTypes = require("./path/lib/virtual-types.js");
var virtualTypesValidators = require("./path/lib/virtual-types-validator.js");
var _t = require("@babel/types");
var _context = require("./path/context.js");
const {
DEPRECATED_KEYS,
DEPRECATED_ALIASES,
FLIPPED_ALIAS_KEYS,
TYPES,
__internal__deprecationWarning: deprecationWarning
} = _t;
function isVirtualType(type) {
return type in virtualTypes;
}
function isExplodedVisitor(visitor) {
return visitor == null ? void 0 : visitor._exploded;
}
function explode$1(visitor) {
if (isExplodedVisitor(visitor)) return visitor;
visitor._exploded = true;
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
const parts = nodeType.split("|");
if (parts.length === 1) continue;
const fns = visitor[nodeType];
delete visitor[nodeType];
for (const part of parts) {
visitor[part] = fns;
}
}
verify$1(visitor);
delete visitor.__esModule;
ensureEntranceObjects(visitor);
ensureCallbackArrays(visitor);
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
if (!isVirtualType(nodeType)) continue;
const fns = visitor[nodeType];
for (const type of Object.keys(fns)) {
fns[type] = wrapCheck(nodeType, fns[type]);
}
delete visitor[nodeType];
const types = virtualTypes[nodeType];
if (types !== null) {
for (const type of types) {
var _visitor$type;
(_visitor$type = visitor[type]) != null ? _visitor$type : visitor[type] = {};
mergePair(visitor[type], fns);
}
} else {
mergePair(visitor, fns);
}
}
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
let aliases = FLIPPED_ALIAS_KEYS[nodeType];
if (nodeType in DEPRECATED_KEYS) {
const deprecatedKey = DEPRECATED_KEYS[nodeType];
deprecationWarning(nodeType, deprecatedKey, "Visitor ");
aliases = [deprecatedKey];
} else if (nodeType in DEPRECATED_ALIASES) {
const deprecatedAlias = DEPRECATED_ALIASES[nodeType];
deprecationWarning(nodeType, deprecatedAlias, "Visitor ");
aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias];
}
if (!aliases) continue;
const fns = visitor[nodeType];
delete visitor[nodeType];
for (const alias of aliases) {
const existing = visitor[alias];
if (existing) {
mergePair(existing, fns);
} else {
visitor[alias] = Object.assign({}, fns);
}
}
}
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
ensureCallbackArrays(visitor[nodeType]);
}
return visitor;
}
function verify$1(visitor) {
if (visitor._verified) return;
if (typeof visitor === "function") {
throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?");
}
for (const nodeType of Object.keys(visitor)) {
if (nodeType === "enter" || nodeType === "exit") {
validateVisitorMethods(nodeType, visitor[nodeType]);
}
if (shouldIgnoreKey(nodeType)) continue;
if (!TYPES.includes(nodeType)) {
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"7.29.7"}`);
}
const visitors = visitor[nodeType];
if (typeof visitors === "object") {
for (const visitorKey of Object.keys(visitors)) {
if (visitorKey === "enter" || visitorKey === "exit") {
validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
} else {
throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`);
}
}
}
}
visitor._verified = true;
}
function validateVisitorMethods(path, val) {
const fns = [].concat(val);
for (const fn of fns) {
if (typeof fn !== "function") {
throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);
}
}
}
function merge(visitors, states = [], wrapper) {
const mergedVisitor = {
_verified: true,
_exploded: true
};
Object.defineProperty(mergedVisitor, "_exploded", {
enumerable: false
});
Object.defineProperty(mergedVisitor, "_verified", {
enumerable: false
});
for (let i = 0; i < visitors.length; i++) {
const visitor = explode$1(visitors[i]);
const state = states[i];
let topVisitor = visitor;
if (state || wrapper) {
topVisitor = wrapWithStateOrWrapper(topVisitor, state, wrapper);
}
mergePair(mergedVisitor, topVisitor);
for (const key of Object.keys(visitor)) {
if (shouldIgnoreKey(key)) continue;
let typeVisitor = visitor[key];
if (state || wrapper) {
typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper);
}
const nodeVisitor = mergedVisitor[key] || (mergedVisitor[key] = {});
mergePair(nodeVisitor, typeVisitor);
}
}
return mergedVisitor;
}
function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
const newVisitor = {};
for (const phase of ["enter", "exit"]) {
let fns = oldVisitor[phase];
if (!Array.isArray(fns)) continue;
fns = fns.map(function (fn) {
let newFn = fn;
if (state) {
newFn = function (path) {
fn.call(state, path, state);
};
}
if (wrapper) {
newFn = wrapper(state == null ? void 0 : state.key, phase, newFn);
}
if (newFn !== fn) {
newFn.toString = () => fn.toString();
}
return newFn;
});
newVisitor[phase] = fns;
}
return newVisitor;
}
function ensureEntranceObjects(obj) {
for (const key of Object.keys(obj)) {
if (shouldIgnoreKey(key)) continue;
const fns = obj[key];
if (typeof fns === "function") {
obj[key] = {
enter: fns
};
}
}
}
function ensureCallbackArrays(obj) {
if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
}
function wrapCheck(nodeType, fn) {
const fnKey = `is${nodeType}`;
const validator = virtualTypesValidators[fnKey];
const newFn = function (path) {
if (validator.call(path)) {
return fn.apply(this, arguments);
}
};
newFn.toString = () => fn.toString();
return newFn;
}
function shouldIgnoreKey(key) {
if (key.startsWith("_")) return true;
if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
if (key === "denylist" || key === "noScope" || key === "skipKeys") {
return true;
}
if (key === "blacklist") {
return true;
}
return false;
}
function mergePair(dest, src) {
for (const phase of ["enter", "exit"]) {
if (!src[phase]) continue;
dest[phase] = [].concat(dest[phase] || [], src[phase]);
}
}
const _environmentVisitor = {
FunctionParent(path) {
if (path.isArrowFunctionExpression()) return;
path.skip();
if (path.isMethod()) {
if (!path.requeueComputedKeyAndDecorators) {
_context.requeueComputedKeyAndDecorators.call(path);
} else {
path.requeueComputedKeyAndDecorators();
}
}
},
Property(path) {
if (path.isObjectProperty()) return;
path.skip();
if (!path.requeueComputedKeyAndDecorators) {
_context.requeueComputedKeyAndDecorators.call(path);
} else {
path.requeueComputedKeyAndDecorators();
}
}
};
function environmentVisitor(visitor) {
return merge([_environmentVisitor, visitor]);
}
//# sourceMappingURL=visitors.js.map
@@ -0,0 +1,48 @@
# estree-walker
Simple utility for walking an [ESTree](https://github.com/estree/estree)-compliant AST, such as one generated by [acorn](https://github.com/marijnh/acorn).
## Installation
```bash
npm i estree-walker
```
## Usage
```js
var walk = require('estree-walker').walk;
var acorn = require('acorn');
ast = acorn.parse(sourceCode, options); // https://github.com/acornjs/acorn
walk(ast, {
enter(node, parent, prop, index) {
// some code happens
},
leave(node, parent, prop, index) {
// some code happens
}
});
```
Inside the `enter` function, calling `this.skip()` will prevent the node's children being walked, or the `leave` function (which is optional) being called.
Call `this.replace(new_node)` in either `enter` or `leave` to replace the current node with a new one.
Call `this.remove()` in either `enter` or `leave` to remove the current node.
## Why not use estraverse?
The ESTree spec is evolving to accommodate ES6/7. I've had a couple of experiences where [estraverse](https://github.com/estools/estraverse) was unable to handle an AST generated by recent versions of acorn, because it hard-codes visitor keys.
estree-walker, by contrast, simply enumerates a node's properties to find child nodes (and child lists of nodes), and is therefore resistant to spec changes. It's also much smaller. (The performance, if you're wondering, is basically identical.)
None of which should be taken as criticism of estraverse, which has more features and has been battle-tested in many more situations, and for which I'm very grateful.
## License
MIT
@@ -0,0 +1,247 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.lib = void 0;
const decorators_1 = require("./decorators");
const decorators_legacy_1 = require("./decorators.legacy");
const dom_1 = require("./dom");
const dom_asynciterable_1 = require("./dom.asynciterable");
const dom_iterable_1 = require("./dom.iterable");
const es5_1 = require("./es5");
const es6_1 = require("./es6");
const es7_1 = require("./es7");
const es2015_1 = require("./es2015");
const es2015_collection_1 = require("./es2015.collection");
const es2015_core_1 = require("./es2015.core");
const es2015_generator_1 = require("./es2015.generator");
const es2015_iterable_1 = require("./es2015.iterable");
const es2015_promise_1 = require("./es2015.promise");
const es2015_proxy_1 = require("./es2015.proxy");
const es2015_reflect_1 = require("./es2015.reflect");
const es2015_symbol_1 = require("./es2015.symbol");
const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown");
const es2016_1 = require("./es2016");
const es2016_array_include_1 = require("./es2016.array.include");
const es2016_full_1 = require("./es2016.full");
const es2016_intl_1 = require("./es2016.intl");
const es2017_1 = require("./es2017");
const es2017_arraybuffer_1 = require("./es2017.arraybuffer");
const es2017_date_1 = require("./es2017.date");
const es2017_full_1 = require("./es2017.full");
const es2017_intl_1 = require("./es2017.intl");
const es2017_object_1 = require("./es2017.object");
const es2017_sharedmemory_1 = require("./es2017.sharedmemory");
const es2017_string_1 = require("./es2017.string");
const es2017_typedarrays_1 = require("./es2017.typedarrays");
const es2018_1 = require("./es2018");
const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator");
const es2018_asynciterable_1 = require("./es2018.asynciterable");
const es2018_full_1 = require("./es2018.full");
const es2018_intl_1 = require("./es2018.intl");
const es2018_promise_1 = require("./es2018.promise");
const es2018_regexp_1 = require("./es2018.regexp");
const es2019_1 = require("./es2019");
const es2019_array_1 = require("./es2019.array");
const es2019_full_1 = require("./es2019.full");
const es2019_intl_1 = require("./es2019.intl");
const es2019_object_1 = require("./es2019.object");
const es2019_string_1 = require("./es2019.string");
const es2019_symbol_1 = require("./es2019.symbol");
const es2020_1 = require("./es2020");
const es2020_bigint_1 = require("./es2020.bigint");
const es2020_date_1 = require("./es2020.date");
const es2020_full_1 = require("./es2020.full");
const es2020_intl_1 = require("./es2020.intl");
const es2020_number_1 = require("./es2020.number");
const es2020_promise_1 = require("./es2020.promise");
const es2020_sharedmemory_1 = require("./es2020.sharedmemory");
const es2020_string_1 = require("./es2020.string");
const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown");
const es2021_1 = require("./es2021");
const es2021_full_1 = require("./es2021.full");
const es2021_intl_1 = require("./es2021.intl");
const es2021_promise_1 = require("./es2021.promise");
const es2021_string_1 = require("./es2021.string");
const es2021_weakref_1 = require("./es2021.weakref");
const es2022_1 = require("./es2022");
const es2022_array_1 = require("./es2022.array");
const es2022_error_1 = require("./es2022.error");
const es2022_full_1 = require("./es2022.full");
const es2022_intl_1 = require("./es2022.intl");
const es2022_object_1 = require("./es2022.object");
const es2022_regexp_1 = require("./es2022.regexp");
const es2022_string_1 = require("./es2022.string");
const es2023_1 = require("./es2023");
const es2023_array_1 = require("./es2023.array");
const es2023_collection_1 = require("./es2023.collection");
const es2023_full_1 = require("./es2023.full");
const es2023_intl_1 = require("./es2023.intl");
const es2024_1 = require("./es2024");
const es2024_arraybuffer_1 = require("./es2024.arraybuffer");
const es2024_collection_1 = require("./es2024.collection");
const es2024_full_1 = require("./es2024.full");
const es2024_object_1 = require("./es2024.object");
const es2024_promise_1 = require("./es2024.promise");
const es2024_regexp_1 = require("./es2024.regexp");
const es2024_sharedmemory_1 = require("./es2024.sharedmemory");
const es2024_string_1 = require("./es2024.string");
const es2025_1 = require("./es2025");
const es2025_collection_1 = require("./es2025.collection");
const es2025_float16_1 = require("./es2025.float16");
const es2025_full_1 = require("./es2025.full");
const es2025_intl_1 = require("./es2025.intl");
const es2025_iterator_1 = require("./es2025.iterator");
const es2025_promise_1 = require("./es2025.promise");
const es2025_regexp_1 = require("./es2025.regexp");
const esnext_1 = require("./esnext");
const esnext_array_1 = require("./esnext.array");
const esnext_asynciterable_1 = require("./esnext.asynciterable");
const esnext_bigint_1 = require("./esnext.bigint");
const esnext_collection_1 = require("./esnext.collection");
const esnext_date_1 = require("./esnext.date");
const esnext_decorators_1 = require("./esnext.decorators");
const esnext_disposable_1 = require("./esnext.disposable");
const esnext_error_1 = require("./esnext.error");
const esnext_float16_1 = require("./esnext.float16");
const esnext_full_1 = require("./esnext.full");
const esnext_intl_1 = require("./esnext.intl");
const esnext_iterator_1 = require("./esnext.iterator");
const esnext_object_1 = require("./esnext.object");
const esnext_promise_1 = require("./esnext.promise");
const esnext_regexp_1 = require("./esnext.regexp");
const esnext_sharedmemory_1 = require("./esnext.sharedmemory");
const esnext_string_1 = require("./esnext.string");
const esnext_symbol_1 = require("./esnext.symbol");
const esnext_temporal_1 = require("./esnext.temporal");
const esnext_typedarrays_1 = require("./esnext.typedarrays");
const esnext_weakref_1 = require("./esnext.weakref");
const lib_1 = require("./lib");
const scripthost_1 = require("./scripthost");
const webworker_1 = require("./webworker");
const webworker_asynciterable_1 = require("./webworker.asynciterable");
const webworker_importscripts_1 = require("./webworker.importscripts");
const webworker_iterable_1 = require("./webworker.iterable");
exports.lib = new Map([
['es5', es5_1.es5],
['es6', es6_1.es6],
['es2015', es2015_1.es2015],
['es7', es7_1.es7],
['es2016', es2016_1.es2016],
['es2017', es2017_1.es2017],
['es2018', es2018_1.es2018],
['es2019', es2019_1.es2019],
['es2020', es2020_1.es2020],
['es2021', es2021_1.es2021],
['es2022', es2022_1.es2022],
['es2023', es2023_1.es2023],
['es2024', es2024_1.es2024],
['es2025', es2025_1.es2025],
['esnext', esnext_1.esnext],
['dom', dom_1.dom],
['dom.iterable', dom_iterable_1.dom_iterable],
['dom.asynciterable', dom_asynciterable_1.dom_asynciterable],
['webworker', webworker_1.webworker],
['webworker.importscripts', webworker_importscripts_1.webworker_importscripts],
['webworker.iterable', webworker_iterable_1.webworker_iterable],
['webworker.asynciterable', webworker_asynciterable_1.webworker_asynciterable],
['scripthost', scripthost_1.scripthost],
['es2015.core', es2015_core_1.es2015_core],
['es2015.collection', es2015_collection_1.es2015_collection],
['es2015.generator', es2015_generator_1.es2015_generator],
['es2015.iterable', es2015_iterable_1.es2015_iterable],
['es2015.promise', es2015_promise_1.es2015_promise],
['es2015.proxy', es2015_proxy_1.es2015_proxy],
['es2015.reflect', es2015_reflect_1.es2015_reflect],
['es2015.symbol', es2015_symbol_1.es2015_symbol],
['es2015.symbol.wellknown', es2015_symbol_wellknown_1.es2015_symbol_wellknown],
['es2016.array.include', es2016_array_include_1.es2016_array_include],
['es2016.intl', es2016_intl_1.es2016_intl],
['es2017.arraybuffer', es2017_arraybuffer_1.es2017_arraybuffer],
['es2017.date', es2017_date_1.es2017_date],
['es2017.object', es2017_object_1.es2017_object],
['es2017.sharedmemory', es2017_sharedmemory_1.es2017_sharedmemory],
['es2017.string', es2017_string_1.es2017_string],
['es2017.intl', es2017_intl_1.es2017_intl],
['es2017.typedarrays', es2017_typedarrays_1.es2017_typedarrays],
['es2018.asyncgenerator', es2018_asyncgenerator_1.es2018_asyncgenerator],
['es2018.asynciterable', es2018_asynciterable_1.es2018_asynciterable],
['es2018.intl', es2018_intl_1.es2018_intl],
['es2018.promise', es2018_promise_1.es2018_promise],
['es2018.regexp', es2018_regexp_1.es2018_regexp],
['es2019.array', es2019_array_1.es2019_array],
['es2019.object', es2019_object_1.es2019_object],
['es2019.string', es2019_string_1.es2019_string],
['es2019.symbol', es2019_symbol_1.es2019_symbol],
['es2019.intl', es2019_intl_1.es2019_intl],
['es2020.bigint', es2020_bigint_1.es2020_bigint],
['es2020.date', es2020_date_1.es2020_date],
['es2020.promise', es2020_promise_1.es2020_promise],
['es2020.sharedmemory', es2020_sharedmemory_1.es2020_sharedmemory],
['es2020.string', es2020_string_1.es2020_string],
['es2020.symbol.wellknown', es2020_symbol_wellknown_1.es2020_symbol_wellknown],
['es2020.intl', es2020_intl_1.es2020_intl],
['es2020.number', es2020_number_1.es2020_number],
['es2021.promise', es2021_promise_1.es2021_promise],
['es2021.string', es2021_string_1.es2021_string],
['es2021.weakref', es2021_weakref_1.es2021_weakref],
['es2021.intl', es2021_intl_1.es2021_intl],
['es2022.array', es2022_array_1.es2022_array],
['es2022.error', es2022_error_1.es2022_error],
['es2022.intl', es2022_intl_1.es2022_intl],
['es2022.object', es2022_object_1.es2022_object],
['es2022.string', es2022_string_1.es2022_string],
['es2022.regexp', es2022_regexp_1.es2022_regexp],
['es2023.array', es2023_array_1.es2023_array],
['es2023.collection', es2023_collection_1.es2023_collection],
['es2023.intl', es2023_intl_1.es2023_intl],
['es2024.arraybuffer', es2024_arraybuffer_1.es2024_arraybuffer],
['es2024.collection', es2024_collection_1.es2024_collection],
['es2024.object', es2024_object_1.es2024_object],
['es2024.promise', es2024_promise_1.es2024_promise],
['es2024.regexp', es2024_regexp_1.es2024_regexp],
['es2024.sharedmemory', es2024_sharedmemory_1.es2024_sharedmemory],
['es2024.string', es2024_string_1.es2024_string],
['es2025.collection', es2025_collection_1.es2025_collection],
['es2025.float16', es2025_float16_1.es2025_float16],
['es2025.intl', es2025_intl_1.es2025_intl],
['es2025.iterator', es2025_iterator_1.es2025_iterator],
['es2025.promise', es2025_promise_1.es2025_promise],
['es2025.regexp', es2025_regexp_1.es2025_regexp],
['esnext.asynciterable', esnext_asynciterable_1.esnext_asynciterable],
['esnext.symbol', esnext_symbol_1.esnext_symbol],
['esnext.bigint', esnext_bigint_1.esnext_bigint],
['esnext.weakref', esnext_weakref_1.esnext_weakref],
['esnext.object', esnext_object_1.esnext_object],
['esnext.regexp', esnext_regexp_1.esnext_regexp],
['esnext.string', esnext_string_1.esnext_string],
['esnext.float16', esnext_float16_1.esnext_float16],
['esnext.iterator', esnext_iterator_1.esnext_iterator],
['esnext.promise', esnext_promise_1.esnext_promise],
['esnext.array', esnext_array_1.esnext_array],
['esnext.collection', esnext_collection_1.esnext_collection],
['esnext.date', esnext_date_1.esnext_date],
['esnext.decorators', esnext_decorators_1.esnext_decorators],
['esnext.disposable', esnext_disposable_1.esnext_disposable],
['esnext.error', esnext_error_1.esnext_error],
['esnext.intl', esnext_intl_1.esnext_intl],
['esnext.sharedmemory', esnext_sharedmemory_1.esnext_sharedmemory],
['esnext.temporal', esnext_temporal_1.esnext_temporal],
['esnext.typedarrays', esnext_typedarrays_1.esnext_typedarrays],
['decorators', decorators_1.decorators],
['decorators.legacy', decorators_legacy_1.decorators_legacy],
['es2016.full', es2016_full_1.es2016_full],
['es2017.full', es2017_full_1.es2017_full],
['es2018.full', es2018_full_1.es2018_full],
['es2019.full', es2019_full_1.es2019_full],
['es2020.full', es2020_full_1.es2020_full],
['es2021.full', es2021_full_1.es2021_full],
['es2022.full', es2022_full_1.es2022_full],
['es2023.full', es2023_full_1.es2023_full],
['es2024.full', es2024_full_1.es2024_full],
['es2025.full', es2025_full_1.es2025_full],
['esnext.full', esnext_full_1.esnext_full],
['lib', lib_1.lib],
]);
@@ -0,0 +1,176 @@
/**
* @fileoverview A collection of methods for processing Espree's options.
* @author Kai Cataldo
*/
/**
* @import { EcmaVersion, Options } from "../espree.js";
*/
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SUPPORTED_VERSIONS = /** @type {const} */ ([
3,
5,
6, // 2015
7, // 2016
8, // 2017
9, // 2018
10, // 2019
11, // 2020
12, // 2021
13, // 2022
14, // 2023
15, // 2024
16, // 2025
17, // 2026
]);
/**
* @typedef {typeof SUPPORTED_VERSIONS[number]} NormalizedEcmaVersion
*/
const LATEST_ECMA_VERSION =
/* eslint-disable jsdoc/valid-types -- Bug */
/** @type {typeof SUPPORTED_VERSIONS extends readonly [...unknown[], infer L] ? L : never} */ (
SUPPORTED_VERSIONS.at(-1)
/* eslint-enable jsdoc/valid-types -- Bug */
);
/**
* Get the latest ECMAScript version supported by Espree.
* @returns {typeof LATEST_ECMA_VERSION} The latest ECMAScript version.
*/
export function getLatestEcmaVersion() {
return LATEST_ECMA_VERSION;
}
/**
* Get the list of ECMAScript versions supported by Espree.
* @returns {[...typeof SUPPORTED_VERSIONS]} An array containing the supported ECMAScript versions.
*/
export function getSupportedEcmaVersions() {
return [...SUPPORTED_VERSIONS];
}
/**
* Normalize ECMAScript version from the initial config
* @param {EcmaVersion} ecmaVersion ECMAScript version from the initial config
* @throws {Error} throws an error if the ecmaVersion is invalid.
* @returns {NormalizedEcmaVersion} normalized ECMAScript version
*/
function normalizeEcmaVersion(ecmaVersion = 5) {
let version =
ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;
if (typeof version !== "number") {
throw new Error(
`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`,
);
}
// Calculate ECMAScript edition number from official year version starting with
// ES2015, which corresponds with ES6 (or a difference of 2009).
if (version >= 2015) {
version -= 2009;
}
if (
!SUPPORTED_VERSIONS.includes(
/** @type {NormalizedEcmaVersion} */
(version),
)
) {
throw new Error("Invalid ecmaVersion.");
}
return /** @type {NormalizedEcmaVersion} */ (version);
}
/**
* Normalize sourceType from the initial config
* @param {string} sourceType to normalize
* @throws {Error} throw an error if sourceType is invalid
* @returns {"script"|"module"|"commonjs"} normalized sourceType
*/
function normalizeSourceType(sourceType = "script") {
if (
sourceType === "script" ||
sourceType === "module" ||
sourceType === "commonjs"
) {
return sourceType;
}
throw new Error("Invalid sourceType.");
}
/**
* @typedef {{
* ecmaVersion: NormalizedEcmaVersion,
* sourceType: "script"|"module"|"commonjs",
* range?: boolean,
* loc?: boolean,
* allowReserved: boolean | "never",
* ecmaFeatures?: {
* jsx?: boolean,
* globalReturn?: boolean,
* impliedStrict?: boolean
* },
* ranges: boolean,
* locations: boolean,
* allowReturnOutsideFunction: boolean,
* tokens?: boolean,
* comment?: boolean
* }} NormalizedParserOptions
*/
/**
* Normalize parserOptions
* @param {Options} options the parser options to normalize
* @throws {Error} throw an error if found invalid option.
* @returns {NormalizedParserOptions} normalized options
*/
export function normalizeOptions(options) {
const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
const sourceType = normalizeSourceType(options.sourceType);
const ranges = options.range === true;
const locations = options.loc === true;
if (ecmaVersion !== 3 && options.allowReserved) {
// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
throw new Error(
"`allowReserved` is only supported when ecmaVersion is 3",
);
}
if (
typeof options.allowReserved !== "undefined" &&
typeof options.allowReserved !== "boolean"
) {
throw new Error(
"`allowReserved`, when present, must be `true` or `false`",
);
}
const allowReserved =
ecmaVersion === 3 ? options.allowReserved || "never" : false;
const ecmaFeatures = options.ecmaFeatures || {};
const allowReturnOutsideFunction =
options.sourceType === "commonjs" || Boolean(ecmaFeatures.globalReturn);
if (sourceType === "module" && ecmaVersion < 6) {
throw new Error(
"sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.",
);
}
return Object.assign({}, options, {
ecmaVersion,
sourceType,
ranges,
locations,
allowReserved,
allowReturnOutsideFunction,
});
}
@@ -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 Radio = createLucideIcon("Radio", [
["path", { d: "M4.9 19.1C1 15.2 1 8.8 4.9 4.9", key: "1vaf9d" }],
["path", { d: "M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5", key: "u1ii0m" }],
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
["path", { d: "M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5", key: "1j5fej" }],
["path", { d: "M19.1 4.9C23 8.8 23 15.1 19.1 19", key: "10b0cb" }]
]);
export { Radio as default };
//# sourceMappingURL=radio.js.map
@@ -0,0 +1,20 @@
self.$_TSR = {
h() {
this.hydrated = true
this.c()
},
e() {
this.streamEnded = true
this.c()
},
c() {
if (this.hydrated && this.streamEnded) {
delete self.$_TSR
delete self.$R['tsr']
}
},
p(script) {
!this.initialized ? this.buffer.push(script) : script()
},
buffer: [],
}
@@ -0,0 +1,4 @@
import type { SchemaCxt } from "..";
import { Name } from "../codegen";
export declare function topBoolOrEmptySchema(it: SchemaCxt): void;
export declare function boolOrEmptySchema(it: SchemaCxt, valid: Name): void;
@@ -0,0 +1 @@
{"version":3,"file":"use-in-view.mjs","sources":["../../../src/utils/use-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit<InViewOptions, \"root\" | \"amount\"> {\n root?: RefObject<Element | null>\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject<Element | null>,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;AAaM;;;;;;;AAkBM;AACJ;AAEA;;;;;;AAOJ;AAEA;AACJ;;"}
@@ -0,0 +1,13 @@
# `react-use-size`
## Installation
```sh
$ yarn add @radix-ui/react-use-size
# or
$ npm install @radix-ui/react-use-size
```
## Usage
This is an internal utility, not intended for public usage.
@@ -0,0 +1 @@
{"version":3,"file":"cable.js","sources":["../../../src/icons/cable.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Cable\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMjF2LTJhMSAxIDAgMCAxLTEtMXYtMWEyIDIgMCAwIDEgMi0yaDJhMiAyIDAgMCAxIDIgMnYxYTEgMSAwIDAgMS0xIDEiIC8+CiAgPHBhdGggZD0iTTE5IDE1VjYuNWExIDEgMCAwIDAtNyAwdjExYTEgMSAwIDAgMS03IDBWOSIgLz4KICA8cGF0aCBkPSJNMjEgMjF2LTJoLTQiIC8+CiAgPHBhdGggZD0iTTMgNWg0VjMiIC8+CiAgPHBhdGggZD0iTTcgNWExIDEgMCAwIDEgMSAxdjFhMiAyIDAgMCAxLTIgMkg0YTIgMiAwIDAgMS0yLTJWNmExIDEgMCAwIDEgMS0xVjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/cable\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 Cable = createLucideIcon('Cable', [\n [\n 'path',\n {\n d: 'M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1',\n key: '10bnsj',\n },\n ],\n ['path', { d: 'M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9', key: '1eqmu1' }],\n ['path', { d: 'M21 21v-2h-4', key: '14zm7j' }],\n ['path', { d: 'M3 5h4V3', key: 'z442eg' }],\n [\n 'path',\n { d: 'M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3', key: 'ebdjd7' },\n ],\n]);\n\nexport default Cable;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC7F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,22 @@
/**
* Converts a [TOML](https://toml.io/) string into an object.
*
* @NOTE Comments and indentation is not preserved after parsing.
*
* @template T The type of the return value.
* @param text The TOML string to parse.
* @returns The JavaScript value converted from the TOML string.
*/
declare function parseTOML<T = unknown>(text: string): T;
/**
* Converts a JavaScript value to a [TOML](https://toml.io/) string.
*
* @NOTE Comments and indentation is not preserved in the output.
*
* @param value
* @param options
* @returns The YAML string converted from the JavaScript value.
*/
declare function stringifyTOML(value: any): string;
export { parseTOML, stringifyTOML };
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":["dictionary","commonWords","firstnames","lastnames","wikipedia","wordSequences"],"mappings":";;;;;;;AAAA;AAQA,MAAMA,UAAU,GAAG;AACjB,EAAA,gBAAgB,EAAEC,WAAW;AAC7B,EAAA,eAAe,EAAEC,UAAU;AAC3B,EAAA,cAAc,EAAEC,SAAS;AACzB,EAAA,cAAc,EAAEC,SAAS;EACzB,GAAGC;;;;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_8O","2":"_o _BS"},D:{"1":"_H _DC","2":"_7"},E:{"1":"_QE","2":"_cD"},F:{"1":"_AT _RD","2":"_j _sK _O"},G:{"1":"_AD","2":"_YC"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_yB","2":"_pC"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:6,C:"Lookbehind in JS regular expressions",D:true};
@@ -0,0 +1,20 @@
import { millisecondsToSeconds } from 'motion-utils';
import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';
/**
* Create a progress => progress easing function from a generator.
*/
function createGeneratorEasing(options, scale = 100, createGenerator) {
const generator = createGenerator({ ...options, keyframes: [0, scale] });
const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
return {
type: "keyframes",
ease: (progress) => {
return generator.next(duration * progress).value / scale;
},
duration: millisecondsToSeconds(duration),
};
}
export { createGeneratorEasing };
//# sourceMappingURL=create-generator-easing.mjs.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 ListEnd = createLucideIcon("ListEnd", [
["path", { d: "M16 12H3", key: "1a2rj7" }],
["path", { d: "M16 6H3", key: "1wxfjs" }],
["path", { d: "M10 18H3", key: "13769t" }],
["path", { d: "M21 6v10a2 2 0 0 1-2 2h-5", key: "ilrcs8" }],
["path", { d: "m16 16-2 2 2 2", key: "kkc6pm" }]
]);
export { ListEnd as default };
//# sourceMappingURL=list-end.js.map
@@ -0,0 +1,126 @@
/**
* Enum of all token types, with bit fields to signify meaningful properties.
*/
export declare enum TokenType {
PRECEDENCE_MASK = 15,
IS_KEYWORD = 16,
IS_ASSIGN = 32,
IS_RIGHT_ASSOCIATIVE = 64,
IS_PREFIX = 128,
IS_POSTFIX = 256,
IS_EXPRESSION_START = 512,
num = 512,
bigint = 1536,
decimal = 2560,
regexp = 3584,
string = 4608,
name = 5632,
eof = 6144,
bracketL = 7680,
bracketR = 8192,
braceL = 9728,
braceBarL = 10752,
braceR = 11264,
braceBarR = 12288,
parenL = 13824,
parenR = 14336,
comma = 15360,
semi = 16384,
colon = 17408,
doubleColon = 18432,
dot = 19456,
question = 20480,
questionDot = 21504,
arrow = 22528,
template = 23552,
ellipsis = 24576,
backQuote = 25600,
dollarBraceL = 27136,
at = 27648,
hash = 29184,
eq = 29728,
assign = 30752,
preIncDec = 32640,
postIncDec = 33664,
bang = 34432,
tilde = 35456,
pipeline = 35841,
nullishCoalescing = 36866,
logicalOR = 37890,
logicalAND = 38915,
bitwiseOR = 39940,
bitwiseXOR = 40965,
bitwiseAND = 41990,
equality = 43015,
lessThan = 44040,
greaterThan = 45064,
relationalOrEqual = 46088,
bitShiftL = 47113,
bitShiftR = 48137,
plus = 49802,
minus = 50826,
modulo = 51723,
star = 52235,
slash = 53259,
exponent = 54348,
jsxName = 55296,
jsxText = 56320,
jsxEmptyText = 57344,
jsxTagStart = 58880,
jsxTagEnd = 59392,
typeParameterStart = 60928,
nonNullAssertion = 61440,
_break = 62480,
_case = 63504,
_catch = 64528,
_continue = 65552,
_debugger = 66576,
_default = 67600,
_do = 68624,
_else = 69648,
_finally = 70672,
_for = 71696,
_function = 73232,
_if = 73744,
_return = 74768,
_switch = 75792,
_throw = 77456,
_try = 77840,
_var = 78864,
_let = 79888,
_const = 80912,
_while = 81936,
_with = 82960,
_new = 84496,
_this = 85520,
_super = 86544,
_class = 87568,
_extends = 88080,
_export = 89104,
_import = 90640,
_yield = 91664,
_null = 92688,
_true = 93712,
_false = 94736,
_in = 95256,
_instanceof = 96280,
_typeof = 97936,
_void = 98960,
_delete = 99984,
_async = 100880,
_get = 101904,
_set = 102928,
_declare = 103952,
_readonly = 104976,
_abstract = 106000,
_static = 107024,
_public = 107536,
_private = 108560,
_protected = 109584,
_override = 110608,
_as = 112144,
_enum = 113168,
_type = 114192,
_implements = 115216
}
export declare function formatTokenType(tokenType: TokenType): string;
@@ -0,0 +1 @@
{"version":3,"file":"glasses.js","sources":["../../../src/icons/glasses.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Glasses\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI2IiBjeT0iMTUiIHI9IjQiIC8+CiAgPGNpcmNsZSBjeD0iMTgiIGN5PSIxNSIgcj0iNCIgLz4KICA8cGF0aCBkPSJNMTQgMTVhMiAyIDAgMCAwLTItMiAyIDIgMCAwIDAtMiAyIiAvPgogIDxwYXRoIGQ9Ik0yLjUgMTMgNSA3Yy43LTEuMyAxLjQtMiAzLTIiIC8+CiAgPHBhdGggZD0iTTIxLjUgMTMgMTkgN2MtLjctMS4zLTEuNS0yLTMtMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/glasses\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 Glasses = createLucideIcon('Glasses', [\n ['circle', { cx: '6', cy: '15', r: '4', key: 'vux9w4' }],\n ['circle', { cx: '18', cy: '15', r: '4', key: '18o8ve' }],\n ['path', { d: 'M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2', key: '1ag4bs' }],\n ['path', { d: 'M2.5 13 5 7c.7-1.3 1.4-2 3-2', key: '1hm1gs' }],\n ['path', { d: 'M21.5 13 19 7c-.7-1.3-1.5-2-3-2', key: '1r31ai' }],\n]);\n\nexport default Glasses;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACnE,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,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAClE,CAAC,CAAA,CAAA;;"}
@@ -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 './circle-user.js';
//# sourceMappingURL=user-circle.js.map
@@ -0,0 +1,115 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util = __importStar(require("../util"));
exports.default = util.createRule({
name: 'no-require-imports',
meta: {
type: 'problem',
docs: {
description: 'Disallow invocation of `require()`',
recommended: 'recommended',
},
messages: {
noRequireImports: 'A `require()` style import is forbidden.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allow: {
type: 'array',
description: 'Patterns of import paths to allow requiring from.',
items: { type: 'string' },
},
allowAsImport: {
type: 'boolean',
description: 'Allows `require` statements in import declarations.',
},
},
},
],
},
defaultOptions: [{ allow: [], allowAsImport: false }],
create(context, options) {
const allowAsImport = options[0].allowAsImport;
const allowPatterns = options[0].allow?.map(pattern => new RegExp(pattern, 'u'));
function isImportPathAllowed(importPath) {
return allowPatterns?.some(pattern => importPath.match(pattern));
}
function isStringOrTemplateLiteral(node) {
return ((node.type === utils_1.AST_NODE_TYPES.Literal &&
typeof node.value === 'string') ||
node.type === utils_1.AST_NODE_TYPES.TemplateLiteral);
}
return {
'CallExpression[callee.name="require"]'(node) {
if (node.arguments[0] && isStringOrTemplateLiteral(node.arguments[0])) {
const argValue = util.getStaticStringValue(node.arguments[0]);
if (typeof argValue === 'string' && isImportPathAllowed(argValue)) {
return;
}
}
const variable = utils_1.ASTUtils.findVariable(context.sourceCode.getScope(node), 'require');
// ignore non-global require usage as it's something user-land custom instead
// of the commonjs standard
if (!variable?.identifiers.length) {
context.report({
node,
messageId: 'noRequireImports',
});
}
},
TSExternalModuleReference(node) {
if (isStringOrTemplateLiteral(node.expression)) {
const argValue = util.getStaticStringValue(node.expression);
if (typeof argValue === 'string' && isImportPathAllowed(argValue)) {
return;
}
}
if (allowAsImport &&
node.parent.type === utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration) {
return;
}
context.report({
node,
messageId: 'noRequireImports',
});
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"default-transitions.mjs","sources":["../../../../src/animation/utils/default-transitions.ts"],"sourcesContent":["import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial<ValueAnimationOptions> = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial<ValueAnimationOptions> => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial<ValueAnimationOptions> = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial<ValueAnimationOptions> = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial<ValueAnimationOptions> => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n"],"names":[],"mappings":";;AAGA,MAAM,iBAAiB,GAAmC;AACtD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE,EAAE;CAChB;AAED,MAAM,sBAAsB,GAAG,CAC3B,MAAe,MACmB;AAClC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;AAC/C,IAAA,SAAS,EAAE,EAAE;AAChB,CAAA,CAAC;AAEF,MAAM,mBAAmB,GAAmC;AACxD,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,QAAQ,EAAE,GAAG;CAChB;AAED;;;AAGG;AACH,MAAM,IAAI,GAAmC;AACzC,IAAA,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1B,IAAA,QAAQ,EAAE,GAAG;CAChB;AAEM,MAAM,oBAAoB,GAAG,CAChC,QAAgB,EAChB,EAAE,SAAS,EAAyB,KACJ;AAChC,IAAA,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,OAAO,mBAAmB;IAC9B;AAAO,SAAA,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AACrC,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO;AAC9B,cAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;cACnC,iBAAiB;IAC3B;AAEA,IAAA,OAAO,IAAI;AACf;;;;"}
@@ -0,0 +1,23 @@
/**
* Utilities for handling OAuth resource URIs.
*/
/**
* Converts a server URL to a resource URL by removing the fragment.
* RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component".
* Keeps everything else unchanged (scheme, domain, port, path, query).
*/
export declare function resourceUrlFromServerUrl(url: URL | string): URL;
/**
* Checks if a requested resource URL matches a configured resource URL.
* A requested resource matches if it has the same scheme, domain, port,
* and its path starts with the configured resource's path.
*
* @param requestedResource The resource URL being requested
* @param configuredResource The resource URL that has been configured
* @returns true if the requested resource matches the configured resource, false otherwise
*/
export declare function checkResourceAllowed({ requestedResource, configuredResource }: {
requestedResource: URL | string;
configuredResource: URL | string;
}): boolean;
//# sourceMappingURL=auth-utils.d.ts.map
@@ -0,0 +1,61 @@
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
class InfinityType:
def __repr__(self) -> str:
return "Infinity"
def __hash__(self) -> int:
return hash(repr(self))
def __lt__(self, other: object) -> bool:
return False
def __le__(self, other: object) -> bool:
return False
def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__)
def __gt__(self, other: object) -> bool:
return True
def __ge__(self, other: object) -> bool:
return True
def __neg__(self: object) -> "NegativeInfinityType":
return NegativeInfinity
Infinity = InfinityType()
class NegativeInfinityType:
def __repr__(self) -> str:
return "-Infinity"
def __hash__(self) -> int:
return hash(repr(self))
def __lt__(self, other: object) -> bool:
return True
def __le__(self, other: object) -> bool:
return True
def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__)
def __gt__(self, other: object) -> bool:
return False
def __ge__(self, other: object) -> bool:
return False
def __neg__(self: object) -> InfinityType:
return Infinity
NegativeInfinity = NegativeInfinityType()
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_z"},B:{"1":"_J"},C:{"1":"_lU _XC","2":"_PK"},D:{"1":"_Q"},E:{"1":"_DB","2":"_e"},F:{"1":"_aR","2":"_qC","16":"B"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"H","16":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"B","2":"A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"console.time and console.timeEnd",D:true};
@@ -0,0 +1,172 @@
import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from '@jridgewell/gen-mapping';
import { traceSegment, decodedMappings } from '@jridgewell/trace-mapping';
import type { TraceMap } from '@jridgewell/trace-mapping';
export type SourceMapSegmentObject = {
column: number;
line: number;
name: string;
source: string;
content: string | null;
ignore: boolean;
};
export type OriginalSource = {
map: null;
sources: Sources[];
source: string;
content: string | null;
ignore: boolean;
};
export type MapSource = {
map: TraceMap;
sources: Sources[];
source: string;
content: null;
ignore: false;
};
export type Sources = OriginalSource | MapSource;
const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);
const EMPTY_SOURCES: Sources[] = [];
function SegmentObject(
source: string,
line: number,
column: number,
name: string,
content: string | null,
ignore: boolean,
): SourceMapSegmentObject {
return { source, line, column, name, content, ignore };
}
function Source(
map: TraceMap,
sources: Sources[],
source: '',
content: null,
ignore: false,
): MapSource;
function Source(
map: null,
sources: Sources[],
source: string,
content: string | null,
ignore: boolean,
): OriginalSource;
function Source(
map: TraceMap | null,
sources: Sources[],
source: string | '',
content: string | null,
ignore: boolean,
): Sources {
return {
map,
sources,
source,
content,
ignore,
} as any;
}
/**
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
* (which may themselves be SourceMapTrees).
*/
export function MapSource(map: TraceMap, sources: Sources[]): MapSource {
return Source(map, sources, '', null, false);
}
/**
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
* segment tracing ends at the `OriginalSource`.
*/
export function OriginalSource(
source: string,
content: string | null,
ignore: boolean,
): OriginalSource {
return Source(null, EMPTY_SOURCES, source, content, ignore);
}
/**
* traceMappings is only called on the root level SourceMapTree, and begins the process of
* resolving each mapping in terms of the original source files.
*/
export function traceMappings(tree: MapSource): GenMapping {
// TODO: Eventually support sourceRoot, which has to be removed because the sources are already
// fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
const gen = new GenMapping({ file: tree.map.file });
const { sources: rootSources, map } = tree;
const rootNames = map.names;
const rootMappings = decodedMappings(map);
for (let i = 0; i < rootMappings.length; i++) {
const segments = rootMappings[i];
for (let j = 0; j < segments.length; j++) {
const segment = segments[j];
const genCol = segment[0];
let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING;
// 1-length segments only move the current generated column, there's no source information
// to gather from it.
if (segment.length !== 1) {
const source = rootSources[segment[1]];
traced = originalPositionFor(
source,
segment[2],
segment[3],
segment.length === 5 ? rootNames[segment[4]] : '',
);
// If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
// respective segment into an original source.
if (traced == null) continue;
}
const { column, line, name, content, source, ignore } = traced;
maybeAddSegment(gen, i, genCol, source, line, column, name);
if (source && content != null) setSourceContent(gen, source, content);
if (ignore) setIgnore(gen, source, true);
}
}
return gen;
}
/**
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
* child SourceMapTrees, until we find the original source map.
*/
export function originalPositionFor(
source: Sources,
line: number,
column: number,
name: string,
): SourceMapSegmentObject | null {
if (!source.map) {
return SegmentObject(source.source, line, column, name, source.content, source.ignore);
}
const segment = traceSegment(source.map, line, column);
// If we couldn't find a segment, then this doesn't exist in the sourcemap.
if (segment == null) return null;
// 1-length segments only move the current generated column, there's no source information
// to gather from it.
if (segment.length === 1) return SOURCELESS_MAPPING;
return originalPositionFor(
source.sources[segment[1]],
segment[2],
segment[3],
segment.length === 5 ? source.map.names[segment[4]] : name,
);
}
@@ -0,0 +1 @@
{"version":3,"file":"start-waapi-animation.mjs","sources":["../../../../src/animation/waapi/start-waapi-animation.ts"],"sourcesContent":["import { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n if (statsBuffer.value) {\n activeAnimations.waapi++\n }\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n const animation = element.animate(keyframeOptions, options)\n\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--\n })\n }\n\n return animation\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,mBAAmB,CAC/B,OAAgB,EAChB,SAAiB,EACjB,SAAmC,EACnC,EACI,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,MAAM,GAAG,CAAC,EACV,UAAU,GAAG,MAAM,EACnB,IAAI,GAAG,SAAS,EAChB,KAAK,GAAA,GACY,EAAE,EACvB,gBAAoC,SAAS,EAAA;AAE7C,IAAA,MAAM,eAAe,GAA6B;QAC9C,CAAC,SAAS,GAAG,SAAqB;KACrC;AACD,IAAA,IAAI,KAAK;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,KAAK;IAEzC,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC;AAEtD;;AAEG;AACH,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,MAAM;AAE1D,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;QACnB,gBAAgB,CAAC,KAAK,EAAE;IAC5B;AAEA,IAAA,MAAM,OAAO,GAA6B;QACtC,KAAK;QACL,QAAQ;AACR,QAAA,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,QAAQ;AAClD,QAAA,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM,GAAG,CAAC;QACtB,SAAS,EAAE,UAAU,KAAK,SAAS,GAAG,WAAW,GAAG,QAAQ;KAC/D;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,CAAC,aAAa,GAAG,aAAa;IAExD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC;AAE3D,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;AACnB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAK;YAC5B,gBAAgB,CAAC,KAAK,EAAE;AAC5B,QAAA,CAAC,CAAC;IACN;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"}