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

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

No files matched your search

@@ -0,0 +1,375 @@
import { readFileSync } from 'node:fs';
import { isBuiltin } from 'node:module';
import { pathToFileURL } from 'node:url';
import { resolve } from 'pathe';
import { ModuleRunner, EvaluatedModules } from 'vite/module-runner';
import { b as VitestTransport } from './startVitestModuleRunner.DB-7oCpn.js';
import { e as environments } from './index.DC7d2Pf8.js';
import { serializeValue } from '@vitest/utils/serialize';
import { serializeError } from '@vitest/utils/error';
import { disableDefaultColors } from 'tinyrainbow';
import { T as Traces } from './traces.DT5aQ62U.js';
import { o as onCancel, a as rpcDone, c as createRuntimeRpc } from './rpc.MzXet3jl.js';
import { createStackString, parseStacktrace } from '@vitest/utils/source-map';
import { s as setupInspect } from './inspector.CvyFGlXm.js';
import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
import { E as EnvironmentTeardownError } from './utils.BX5Fg8C4.js';
function isBuiltinEnvironment(env) {
return env in environments;
}
const isWindows = process.platform === "win32";
const _loaders = /* @__PURE__ */ new Map();
function createEnvironmentLoader(root, rpc) {
const cachedLoader = _loaders.get(root);
if (!cachedLoader || cachedLoader.isClosed()) {
_loaders.delete(root);
const moduleRunner = new ModuleRunner({
hmr: false,
sourcemapInterceptor: "prepareStackTrace",
transport: new VitestTransport({
async fetchModule(id, importer, options) {
const result = await rpc.fetch(id, importer, "__vitest__", options);
if ("cached" in result) return {
code: readFileSync(result.tmp, "utf-8"),
...result
};
if (isWindows && "externalize" in result)
// TODO: vitest returns paths for external modules, but Vite returns file://
// https://github.com/vitejs/vite/pull/20449
result.externalize = isBuiltin(id) || /^(?:node:|data:|http:|https:|file:)/.test(id) ? result.externalize : pathToFileURL(result.externalize).toString();
return result;
},
async resolveId(id, importer) {
return rpc.resolve(id, importer, "__vitest__");
}
}, new EvaluatedModules(), /* @__PURE__ */ new WeakMap())
});
_loaders.set(root, moduleRunner);
}
return _loaders.get(root);
}
async function loadNativeEnvironment(name, root, traces) {
const packageId = name[0] === "." || name[0] === "/" ? pathToFileURL(resolve(root, name)).toString() : import.meta.resolve(`vitest-environment-${name}`, pathToFileURL(root).toString());
return resolveEnvironmentFromModule(name, packageId, await traces.$("vitest.runtime.environment.import", () => import(packageId)));
}
function resolveEnvironmentFromModule(name, packageId, pkg) {
if (!pkg || !pkg.default || typeof pkg.default !== "object") throw new TypeError(`Environment "${name}" is not a valid environment. Path "${packageId}" should export default object with a "setup" or/and "setupVM" method.`);
const environment = pkg.default;
if (environment.transformMode != null && environment.transformMode !== "web" && environment.transformMode !== "ssr") throw new TypeError(`Environment "${name}" is not a valid environment. Path "${packageId}" should export default object with a "transformMode" method equal to "ssr" or "web", received "${environment.transformMode}".`);
if (environment.transformMode) {
console.warn(`The Vitest environment ${environment.name} defines the "transformMode". This options was deprecated in Vitest 4 and will be removed in the next major version. Please, use "viteEnvironment" instead.`);
// keep for backwards compat
environment.viteEnvironment ??= environment.transformMode === "ssr" ? "ssr" : "client";
}
return environment;
}
async function loadEnvironment(name, root, rpc, traces, viteModuleRunner) {
if (isBuiltinEnvironment(name)) return { environment: environments[name] };
if (!viteModuleRunner) return { environment: await loadNativeEnvironment(name, root, traces) };
const loader = createEnvironmentLoader(root, rpc);
const packageId = name[0] === "." || name[0] === "/" ? resolve(root, name) : (await traces.$("vitest.runtime.environment.resolve", () => rpc.resolve(`vitest-environment-${name}`, void 0, "__vitest__")))?.id ?? resolve(root, name);
return {
environment: resolveEnvironmentFromModule(name, packageId, await traces.$("vitest.runtime.environment.import", () => loader.import(packageId))),
loader
};
}
const cleanupListeners = /* @__PURE__ */ new Set();
const moduleRunnerListeners = /* @__PURE__ */ new Set();
function onCleanup(cb) {
cleanupListeners.add(cb);
}
async function cleanup() {
await Promise.all([...cleanupListeners].map((l) => l()));
}
function onModuleRunner(cb) {
moduleRunnerListeners.add(cb);
}
function emitModuleRunner(moduleRunner) {
moduleRunnerListeners.forEach((l) => l(moduleRunner));
}
// Store globals in case tests overwrite them
const processListeners = process.listeners.bind(process);
const processOn = process.on.bind(process);
const processOff = process.off.bind(process);
const dispose = [];
function listenForErrors(state) {
dispose.forEach((fn) => fn());
dispose.length = 0;
function catchError(err, type, event) {
const worker = state();
// if there is another listener, assume that it's handled by user code
// one is Vitest's own listener
if (processListeners(event).length > 1) return;
const error = serializeValue(err);
if (typeof error === "object" && error != null) {
error.VITEST_TEST_NAME = worker.current?.type === "test" ? worker.current.name : void 0;
if (worker.filepath) error.VITEST_TEST_PATH = worker.filepath;
}
state().rpc.onUnhandledError(error, type);
}
const uncaughtException = (e) => catchError(e, "Uncaught Exception", "uncaughtException");
const unhandledRejection = (e) => catchError(e, "Unhandled Rejection", "unhandledRejection");
processOn("uncaughtException", uncaughtException);
processOn("unhandledRejection", unhandledRejection);
dispose.push(() => {
processOff("uncaughtException", uncaughtException);
processOff("unhandledRejection", unhandledRejection);
});
}
const resolvingModules = /* @__PURE__ */ new Set();
async function execute(method, ctx, worker, traces) {
const prepareStart = performance.now();
const cleanups = [setupInspect(ctx)];
// RPC is used to communicate between worker (be it a thread worker or child process or a custom implementation) and the main thread
const rpc = ctx.rpc;
try {
// do not close the RPC channel so that we can get the error messages sent to the main thread
cleanups.push(async () => {
await Promise.all(rpc.$rejectPendingCalls(({ method, reject }) => {
reject(new EnvironmentTeardownError(`[vitest-worker]: Closing rpc while "${method}" was pending`));
}));
});
const state = {
ctx,
evaluatedModules: new VitestEvaluatedModules(),
resolvingModules,
moduleExecutionInfo: /* @__PURE__ */ new Map(),
config: ctx.config,
environment: null,
durations: {
environment: 0,
prepare: prepareStart
},
rpc,
onCancel,
onCleanup: onCleanup,
providedContext: ctx.providedContext,
onFilterStackTrace(stack) {
return createStackString(parseStacktrace(stack));
},
metaEnv: createImportMetaEnvProxy()
};
const methodName = method === "collect" ? "collectTests" : "runTests";
if (!worker[methodName] || typeof worker[methodName] !== "function") throw new TypeError(`Test worker should expose "runTests" method. Received "${typeof worker.runTests}".`);
await worker[methodName](state, traces);
} finally {
await rpcDone().catch(() => {});
await Promise.all(cleanups.map((fn) => fn())).catch(() => {});
}
}
function run(ctx, worker, traces) {
return execute("run", ctx, worker, traces);
}
function collect(ctx, worker, traces) {
return execute("collect", ctx, worker, traces);
}
async function teardown() {
await cleanup();
}
const env = process.env;
function createImportMetaEnvProxy() {
// packages/vitest/src/node/plugins/index.ts:146
const booleanKeys = [
"DEV",
"PROD",
"SSR"
];
return new Proxy(env, {
get(_, key) {
if (typeof key !== "string") return;
if (booleanKeys.includes(key)) return !!process.env[key];
return process.env[key];
},
set(_, key, value) {
if (typeof key !== "string") return true;
if (booleanKeys.includes(key)) process.env[key] = value ? "1" : "";
else process.env[key] = value;
return true;
}
});
}
const __vitest_worker_response__ = true;
const memoryUsage = process.memoryUsage.bind(process);
let reportMemory = false;
let traces;
/** @experimental */
function init(worker) {
worker.on(onMessage);
if (worker.onModuleRunner) onModuleRunner(worker.onModuleRunner);
let runPromise;
let isRunning = false;
let workerTeardown;
let setupContext;
function send(response) {
worker.post(worker.serialize ? worker.serialize(response) : response);
}
async function onMessage(rawMessage) {
const message = worker.deserialize ? worker.deserialize(rawMessage) : rawMessage;
if (message?.__vitest_worker_request__ !== true) return;
switch (message.type) {
case "start": {
process.env.VITEST_POOL_ID = String(message.poolId);
process.env.VITEST_WORKER_ID = String(message.workerId);
reportMemory = message.options.reportMemory;
if (message.context.config.isAgent) disableDefaultColors();
traces ??= await new Traces({
enabled: message.traces.enabled,
sdkPath: message.traces.sdkPath
}).waitInit();
const { environment, config, pool } = message.context;
const context = traces.getContextFromCarrier(message.traces.otelCarrier);
// record telemetry as part of "start"
traces.recordInitSpan(context);
try {
setupContext = {
environment,
config,
pool,
rpc: createRuntimeRpc(worker),
projectName: config.name || "",
traces
};
workerTeardown = await traces.$("vitest.runtime.setup", { context }, () => worker.setup?.(setupContext));
send({
type: "started",
__vitest_worker_response__
});
} catch (error) {
send({
type: "started",
__vitest_worker_response__,
error: serializeError(error)
});
}
break;
}
case "run":
// Prevent concurrent execution if worker is already running
if (isRunning) {
send({
type: "testfileFinished",
__vitest_worker_response__,
error: serializeError(/* @__PURE__ */ new Error("[vitest-worker]: Worker is already running tests"))
});
return;
}
try {
process.env.VITEST_WORKER_ID = String(message.context.workerId);
} catch (error) {
return send({
type: "testfileFinished",
__vitest_worker_response__,
error: serializeError(error),
usedMemory: reportMemory ? memoryUsage().heapUsed : void 0
});
}
isRunning = true;
try {
const tracesContext = traces.getContextFromCarrier(message.otelCarrier);
runPromise = traces.$("vitest.runtime.run", {
context: tracesContext,
attributes: {
"vitest.worker.specifications": traces.isEnabled() ? getFilesWithLocations(message.context.files) : [],
"vitest.worker.id": message.context.workerId
}
}, () => run({
...setupContext,
...message.context
}, worker, traces).catch((error) => serializeError(error)));
send({
type: "testfileFinished",
__vitest_worker_response__,
error: await runPromise,
usedMemory: reportMemory ? memoryUsage().heapUsed : void 0
});
} finally {
runPromise = void 0;
isRunning = false;
}
break;
case "collect":
// Prevent concurrent execution if worker is already running
if (isRunning) {
send({
type: "testfileFinished",
__vitest_worker_response__,
error: serializeError(/* @__PURE__ */ new Error("[vitest-worker]: Worker is already running tests"))
});
return;
}
try {
process.env.VITEST_WORKER_ID = String(message.context.workerId);
} catch (error) {
return send({
type: "testfileFinished",
__vitest_worker_response__,
error: serializeError(error),
usedMemory: reportMemory ? memoryUsage().heapUsed : void 0
});
}
isRunning = true;
try {
const tracesContext = traces.getContextFromCarrier(message.otelCarrier);
runPromise = traces.$("vitest.runtime.collect", {
context: tracesContext,
attributes: {
"vitest.worker.specifications": traces.isEnabled() ? getFilesWithLocations(message.context.files) : [],
"vitest.worker.id": message.context.workerId
}
}, () => collect({
...setupContext,
...message.context
}, worker, traces).catch((error) => serializeError(error)));
send({
type: "testfileFinished",
__vitest_worker_response__,
error: await runPromise,
usedMemory: reportMemory ? memoryUsage().heapUsed : void 0
});
} finally {
runPromise = void 0;
isRunning = false;
}
break;
case "stop":
await runPromise;
try {
const context = traces.getContextFromCarrier(message.otelCarrier);
const error = await traces.$("vitest.runtime.teardown", { context }, async () => {
const error = await teardown().catch((error) => serializeError(error));
await workerTeardown?.();
return error;
});
await traces.finish();
send({
type: "stopped",
error,
__vitest_worker_response__
});
} catch (error) {
send({
type: "stopped",
error: serializeError(error),
__vitest_worker_response__
});
}
worker.teardown?.();
break;
}
}
}
function getFilesWithLocations(files) {
return files.flatMap((file) => {
if (!file.testLocations) return file.filepath;
return file.testLocations.map((location) => {
return `${file}:${location}`;
});
});
}
export { listenForErrors as a, emitModuleRunner as e, init as i, loadEnvironment as l };
@@ -0,0 +1,17 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
import ts = require("./typescript.js");
export = ts;
@@ -0,0 +1,398 @@
// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell
// License: MIT.
var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace, jsTokens;
RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;
NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;
WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;
SingleLineComment = /\/\/.*/y;
HashbangComment = /^#!.*/;
JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;
JSXText = /[^<>{}]+/y;
TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
Newline = RegExp(LineTerminatorSequence.source);
jsTokens = function*(input, {jsx = false} = {}) {
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
({length} = input);
lastIndex = 0;
lastSignificantToken = "";
stack = [
{tag: "JS"}
];
braces = [];
parenNesting = 0;
postfixIncDec = false;
if (match = HashbangComment.exec(input)) {
yield ({
type: "HashbangComment",
value: match[0]
});
lastIndex = match[0].length;
}
while (lastIndex < length) {
mode = stack[stack.length - 1];
switch (mode.tag) {
case "JS":
case "JSNonExpressionParen":
case "InterpolationInTemplate":
case "InterpolationInJSX":
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
RegularExpressionLiteral.lastIndex = lastIndex;
if (match = RegularExpressionLiteral.exec(input)) {
lastIndex = RegularExpressionLiteral.lastIndex;
lastSignificantToken = match[0];
postfixIncDec = true;
yield ({
type: "RegularExpressionLiteral",
value: match[0],
closed: match[1] !== void 0 && match[1] !== "\\"
});
continue;
}
}
Punctuator.lastIndex = lastIndex;
if (match = Punctuator.exec(input)) {
punctuator = match[0];
nextLastIndex = Punctuator.lastIndex;
nextLastSignificantToken = punctuator;
switch (punctuator) {
case "(":
if (lastSignificantToken === "?NonExpressionParenKeyword") {
stack.push({
tag: "JSNonExpressionParen",
nesting: parenNesting
});
}
parenNesting++;
postfixIncDec = false;
break;
case ")":
parenNesting--;
postfixIncDec = true;
if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
stack.pop();
nextLastSignificantToken = "?NonExpressionParenEnd";
postfixIncDec = false;
}
break;
case "{":
Punctuator.lastIndex = 0;
isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
braces.push(isExpression);
postfixIncDec = false;
break;
case "}":
switch (mode.tag) {
case "InterpolationInTemplate":
if (braces.length === mode.nesting) {
Template.lastIndex = lastIndex;
match = Template.exec(input);
lastIndex = Template.lastIndex;
lastSignificantToken = match[0];
if (match[1] === "${") {
lastSignificantToken = "?InterpolationInTemplate";
postfixIncDec = false;
yield ({
type: "TemplateMiddle",
value: match[0]
});
} else {
stack.pop();
postfixIncDec = true;
yield ({
type: "TemplateTail",
value: match[0],
closed: match[1] === "`"
});
}
continue;
}
break;
case "InterpolationInJSX":
if (braces.length === mode.nesting) {
stack.pop();
lastIndex += 1;
lastSignificantToken = "}";
yield ({
type: "JSXPunctuator",
value: "}"
});
continue;
}
}
postfixIncDec = braces.pop();
nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
break;
case "]":
postfixIncDec = true;
break;
case "++":
case "--":
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
break;
case "<":
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
stack.push({tag: "JSXTag"});
lastIndex += 1;
lastSignificantToken = "<";
yield ({
type: "JSXPunctuator",
value: punctuator
});
continue;
}
postfixIncDec = false;
break;
default:
postfixIncDec = false;
}
lastIndex = nextLastIndex;
lastSignificantToken = nextLastSignificantToken;
yield ({
type: "Punctuator",
value: punctuator
});
continue;
}
Identifier.lastIndex = lastIndex;
if (match = Identifier.exec(input)) {
lastIndex = Identifier.lastIndex;
nextLastSignificantToken = match[0];
switch (match[0]) {
case "for":
case "if":
case "while":
case "with":
if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
nextLastSignificantToken = "?NonExpressionParenKeyword";
}
}
lastSignificantToken = nextLastSignificantToken;
postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
yield ({
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
value: match[0]
});
continue;
}
StringLiteral.lastIndex = lastIndex;
if (match = StringLiteral.exec(input)) {
lastIndex = StringLiteral.lastIndex;
lastSignificantToken = match[0];
postfixIncDec = true;
yield ({
type: "StringLiteral",
value: match[0],
closed: match[2] !== void 0
});
continue;
}
NumericLiteral.lastIndex = lastIndex;
if (match = NumericLiteral.exec(input)) {
lastIndex = NumericLiteral.lastIndex;
lastSignificantToken = match[0];
postfixIncDec = true;
yield ({
type: "NumericLiteral",
value: match[0]
});
continue;
}
Template.lastIndex = lastIndex;
if (match = Template.exec(input)) {
lastIndex = Template.lastIndex;
lastSignificantToken = match[0];
if (match[1] === "${") {
lastSignificantToken = "?InterpolationInTemplate";
stack.push({
tag: "InterpolationInTemplate",
nesting: braces.length
});
postfixIncDec = false;
yield ({
type: "TemplateHead",
value: match[0]
});
} else {
postfixIncDec = true;
yield ({
type: "NoSubstitutionTemplate",
value: match[0],
closed: match[1] === "`"
});
}
continue;
}
break;
case "JSXTag":
case "JSXTagEnd":
JSXPunctuator.lastIndex = lastIndex;
if (match = JSXPunctuator.exec(input)) {
lastIndex = JSXPunctuator.lastIndex;
nextLastSignificantToken = match[0];
switch (match[0]) {
case "<":
stack.push({tag: "JSXTag"});
break;
case ">":
stack.pop();
if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
nextLastSignificantToken = "?JSX";
postfixIncDec = true;
} else {
stack.push({tag: "JSXChildren"});
}
break;
case "{":
stack.push({
tag: "InterpolationInJSX",
nesting: braces.length
});
nextLastSignificantToken = "?InterpolationInJSX";
postfixIncDec = false;
break;
case "/":
if (lastSignificantToken === "<") {
stack.pop();
if (stack[stack.length - 1].tag === "JSXChildren") {
stack.pop();
}
stack.push({tag: "JSXTagEnd"});
}
}
lastSignificantToken = nextLastSignificantToken;
yield ({
type: "JSXPunctuator",
value: match[0]
});
continue;
}
JSXIdentifier.lastIndex = lastIndex;
if (match = JSXIdentifier.exec(input)) {
lastIndex = JSXIdentifier.lastIndex;
lastSignificantToken = match[0];
yield ({
type: "JSXIdentifier",
value: match[0]
});
continue;
}
JSXString.lastIndex = lastIndex;
if (match = JSXString.exec(input)) {
lastIndex = JSXString.lastIndex;
lastSignificantToken = match[0];
yield ({
type: "JSXString",
value: match[0],
closed: match[2] !== void 0
});
continue;
}
break;
case "JSXChildren":
JSXText.lastIndex = lastIndex;
if (match = JSXText.exec(input)) {
lastIndex = JSXText.lastIndex;
lastSignificantToken = match[0];
yield ({
type: "JSXText",
value: match[0]
});
continue;
}
switch (input[lastIndex]) {
case "<":
stack.push({tag: "JSXTag"});
lastIndex++;
lastSignificantToken = "<";
yield ({
type: "JSXPunctuator",
value: "<"
});
continue;
case "{":
stack.push({
tag: "InterpolationInJSX",
nesting: braces.length
});
lastIndex++;
lastSignificantToken = "?InterpolationInJSX";
postfixIncDec = false;
yield ({
type: "JSXPunctuator",
value: "{"
});
continue;
}
}
WhiteSpace.lastIndex = lastIndex;
if (match = WhiteSpace.exec(input)) {
lastIndex = WhiteSpace.lastIndex;
yield ({
type: "WhiteSpace",
value: match[0]
});
continue;
}
LineTerminatorSequence.lastIndex = lastIndex;
if (match = LineTerminatorSequence.exec(input)) {
lastIndex = LineTerminatorSequence.lastIndex;
postfixIncDec = false;
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
lastSignificantToken = "?NoLineTerminatorHere";
}
yield ({
type: "LineTerminatorSequence",
value: match[0]
});
continue;
}
MultiLineComment.lastIndex = lastIndex;
if (match = MultiLineComment.exec(input)) {
lastIndex = MultiLineComment.lastIndex;
if (Newline.test(match[0])) {
postfixIncDec = false;
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
lastSignificantToken = "?NoLineTerminatorHere";
}
}
yield ({
type: "MultiLineComment",
value: match[0],
closed: match[1] !== void 0
});
continue;
}
SingleLineComment.lastIndex = lastIndex;
if (match = SingleLineComment.exec(input)) {
lastIndex = SingleLineComment.lastIndex;
postfixIncDec = false;
yield ({
type: "SingleLineComment",
value: match[0]
});
continue;
}
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
lastIndex += firstCodePoint.length;
lastSignificantToken = firstCodePoint;
postfixIncDec = false;
yield ({
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
value: firstCodePoint
});
}
return void 0;
};
export default jsTokens;
export { jsTokens as "module.exports" };
@@ -0,0 +1,68 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class DirectoryExistsPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string | ResolveStepHook} target target
*/
constructor(source, target) {
this.source = source;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync(
"DirectoryExistsPlugin",
(request, resolveContext, callback) => {
const fs = resolver.fileSystem;
const directory = request.path;
if (!directory) return callback();
fs.stat(directory, (err, stat) => {
if (err || !stat) {
if (resolveContext.missingDependencies) {
resolveContext.missingDependencies.add(directory);
}
if (resolveContext.log) {
resolveContext.log(`${directory} doesn't exist`);
}
return callback();
}
if (!stat.isDirectory()) {
if (resolveContext.missingDependencies) {
resolveContext.missingDependencies.add(directory);
}
if (resolveContext.log) {
resolveContext.log(`${directory} is not a directory`);
}
return callback();
}
if (resolveContext.fileDependencies) {
resolveContext.fileDependencies.add(directory);
}
resolver.doResolve(
target,
request,
`existing directory ${directory}`,
resolveContext,
callback,
);
});
},
);
}
};
@@ -0,0 +1,444 @@
/*
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
const percent = require('./percent');
const dataProperties = require('./data-properties');
const { CoverageSummary } = require('./coverage-summary');
// returns a data object that represents empty coverage
function emptyCoverage(filePath, reportLogic) {
const cov = {
path: filePath,
statementMap: {},
fnMap: {},
branchMap: {},
s: {},
f: {},
b: {}
};
if (reportLogic) cov.bT = {};
return cov;
}
// asserts that a data object "looks like" a coverage object
function assertValidObject(obj) {
const valid =
obj &&
obj.path &&
obj.statementMap &&
obj.fnMap &&
obj.branchMap &&
obj.s &&
obj.f &&
obj.b;
if (!valid) {
throw new Error(
'Invalid file coverage object, missing keys, found:' +
Object.keys(obj).join(',')
);
}
}
const keyFromLoc = ({ start, end }) =>
`${start.line}|${start.column}|${end.line}|${end.column}`;
const isObj = o => !!o && typeof o === 'object';
const isLineCol = o =>
isObj(o) && typeof o.line === 'number' && typeof o.column === 'number';
const isLoc = o => isObj(o) && isLineCol(o.start) && isLineCol(o.end);
const getLoc = o => (isLoc(o) ? o : isLoc(o.loc) ? o.loc : null);
// When merging, we can have a case where two ranges cover
// the same block of code with `hits=1`, and each carve out a
// different range with `hits=0` to indicate it's uncovered.
// Find the nearest container so that we can properly indicate
// that both sections are hit.
// Returns null if no containing item is found.
const findNearestContainer = (item, map) => {
const itemLoc = getLoc(item);
if (!itemLoc) return null;
// the B item is not an identified range in the A set, BUT
// it may be contained by an identified A range. If so, then
// any hit of that containing A range counts as a hit of this
// B range as well. We have to find the *narrowest* containing
// range to be accurate, since ranges can be hit and un-hit
// in a nested fashion.
let nearestContainingItem = null;
let containerDistance = null;
let containerKey = null;
for (const [i, mapItem] of Object.entries(map)) {
const mapLoc = getLoc(mapItem);
if (!mapLoc) continue;
// contained if all of line distances are > 0
// or line distance is 0 and col dist is >= 0
const distance = [
itemLoc.start.line - mapLoc.start.line,
itemLoc.start.column - mapLoc.start.column,
mapLoc.end.line - itemLoc.end.line,
mapLoc.end.column - itemLoc.end.column
];
if (
distance[0] < 0 ||
distance[2] < 0 ||
(distance[0] === 0 && distance[1] < 0) ||
(distance[2] === 0 && distance[3] < 0)
) {
continue;
}
if (nearestContainingItem === null) {
containerDistance = distance;
nearestContainingItem = mapItem;
containerKey = i;
continue;
}
// closer line more relevant than closer column
const closerBefore =
distance[0] < containerDistance[0] ||
(distance[0] === 0 && distance[1] < containerDistance[1]);
const closerAfter =
distance[2] < containerDistance[2] ||
(distance[2] === 0 && distance[3] < containerDistance[3]);
if (closerBefore || closerAfter) {
// closer
containerDistance = distance;
nearestContainingItem = mapItem;
containerKey = i;
}
}
return containerKey;
};
// either add two numbers, or all matching entries in a number[]
const addHits = (aHits, bHits) => {
if (typeof aHits === 'number' && typeof bHits === 'number') {
return aHits + bHits;
} else if (Array.isArray(aHits) && Array.isArray(bHits)) {
return aHits.map((a, i) => (a || 0) + (bHits[i] || 0));
}
return null;
};
const addNearestContainerHits = (item, itemHits, map, mapHits) => {
const container = findNearestContainer(item, map);
if (container) {
return addHits(itemHits, mapHits[container]);
} else {
return itemHits;
}
};
const mergeProp = (aHits, aMap, bHits, bMap, itemKey = keyFromLoc) => {
const aItems = {};
for (const [key, itemHits] of Object.entries(aHits)) {
const item = aMap[key];
aItems[itemKey(item)] = [itemHits, item];
}
const bItems = {};
for (const [key, itemHits] of Object.entries(bHits)) {
const item = bMap[key];
bItems[itemKey(item)] = [itemHits, item];
}
const mergedItems = {};
for (const [key, aValue] of Object.entries(aItems)) {
let aItemHits = aValue[0];
const aItem = aValue[1];
const bValue = bItems[key];
if (!bValue) {
// not an identified range in b, but might be contained by one
aItemHits = addNearestContainerHits(aItem, aItemHits, bMap, bHits);
} else {
// is an identified range in b, so add the hits together
aItemHits = addHits(aItemHits, bValue[0]);
}
mergedItems[key] = [aItemHits, aItem];
}
// now find the items in b that are not in a. already added matches.
for (const [key, bValue] of Object.entries(bItems)) {
let bItemHits = bValue[0];
const bItem = bValue[1];
if (mergedItems[key]) continue;
// not an identified range in b, but might be contained by one
bItemHits = addNearestContainerHits(bItem, bItemHits, aMap, aHits);
mergedItems[key] = [bItemHits, bItem];
}
const hits = {};
const map = {};
Object.values(mergedItems).forEach(([itemHits, item], i) => {
hits[i] = itemHits;
map[i] = item;
});
return [hits, map];
};
/**
* provides a read-only view of coverage for a single file.
* The deep structure of this object is documented elsewhere. It has the following
* properties:
*
* * `path` - the file path for which coverage is being tracked
* * `statementMap` - map of statement locations keyed by statement index
* * `fnMap` - map of function metadata keyed by function index
* * `branchMap` - map of branch metadata keyed by branch index
* * `s` - hit counts for statements
* * `f` - hit count for functions
* * `b` - hit count for branches
*/
class FileCoverage {
/**
* @constructor
* @param {Object|FileCoverage|String} pathOrObj is a string that initializes
* and empty coverage object with the specified file path or a data object that
* has all the required properties for a file coverage object.
*/
constructor(pathOrObj, reportLogic = false) {
if (!pathOrObj) {
throw new Error(
'Coverage must be initialized with a path or an object'
);
}
if (typeof pathOrObj === 'string') {
this.data = emptyCoverage(pathOrObj, reportLogic);
} else if (pathOrObj instanceof FileCoverage) {
this.data = pathOrObj.data;
} else if (typeof pathOrObj === 'object') {
this.data = pathOrObj;
} else {
throw new Error('Invalid argument to coverage constructor');
}
assertValidObject(this.data);
}
/**
* returns computed line coverage from statement coverage.
* This is a map of hits keyed by line number in the source.
*/
getLineCoverage() {
const statementMap = this.data.statementMap;
const statements = this.data.s;
const lineMap = Object.create(null);
Object.entries(statements).forEach(([st, count]) => {
/* istanbul ignore if: is this even possible? */
if (!statementMap[st]) {
return;
}
const { line } = statementMap[st].start;
const prevVal = lineMap[line];
if (prevVal === undefined || prevVal < count) {
lineMap[line] = count;
}
});
return lineMap;
}
/**
* returns an array of uncovered line numbers.
* @returns {Array} an array of line numbers for which no hits have been
* collected.
*/
getUncoveredLines() {
const lc = this.getLineCoverage();
const ret = [];
Object.entries(lc).forEach(([l, hits]) => {
if (hits === 0) {
ret.push(l);
}
});
return ret;
}
/**
* returns a map of branch coverage by source line number.
* @returns {Object} an object keyed by line number. Each object
* has a `covered`, `total` and `coverage` (percentage) property.
*/
getBranchCoverageByLine() {
const branchMap = this.branchMap;
const branches = this.b;
const ret = {};
Object.entries(branchMap).forEach(([k, map]) => {
const line = map.line || map.loc.start.line;
const branchData = branches[k];
ret[line] = ret[line] || [];
ret[line].push(...branchData);
});
Object.entries(ret).forEach(([k, dataArray]) => {
const covered = dataArray.filter(item => item > 0);
const coverage = (covered.length / dataArray.length) * 100;
ret[k] = {
covered: covered.length,
total: dataArray.length,
coverage
};
});
return ret;
}
/**
* return a JSON-serializable POJO for this file coverage object
*/
toJSON() {
return this.data;
}
/**
* merges a second coverage object into this one, updating hit counts
* @param {FileCoverage} other - the coverage object to be merged into this one.
* Note that the other object should have the same structure as this one (same file).
*/
merge(other) {
if (other.all === true) {
return;
}
if (this.all === true) {
this.data = other.data;
return;
}
let [hits, map] = mergeProp(
this.s,
this.statementMap,
other.s,
other.statementMap
);
this.data.s = hits;
this.data.statementMap = map;
const keyFromLocProp = x => keyFromLoc(x.loc);
const keyFromLocationsProp = x => keyFromLoc(x.locations[0]);
[hits, map] = mergeProp(
this.f,
this.fnMap,
other.f,
other.fnMap,
keyFromLocProp
);
this.data.f = hits;
this.data.fnMap = map;
[hits, map] = mergeProp(
this.b,
this.branchMap,
other.b,
other.branchMap,
keyFromLocationsProp
);
this.data.b = hits;
this.data.branchMap = map;
// Tracking additional information about branch truthiness
// can be optionally enabled:
if (this.bT && other.bT) {
[hits, map] = mergeProp(
this.bT,
this.branchMap,
other.bT,
other.branchMap,
keyFromLocationsProp
);
this.data.bT = hits;
}
}
computeSimpleTotals(property) {
let stats = this[property];
if (typeof stats === 'function') {
stats = stats.call(this);
}
const ret = {
total: Object.keys(stats).length,
covered: Object.values(stats).filter(v => !!v).length,
skipped: 0
};
ret.pct = percent(ret.covered, ret.total);
return ret;
}
computeBranchTotals(property) {
const stats = this[property];
const ret = { total: 0, covered: 0, skipped: 0 };
Object.values(stats).forEach(branches => {
ret.covered += branches.filter(hits => hits > 0).length;
ret.total += branches.length;
});
ret.pct = percent(ret.covered, ret.total);
return ret;
}
/**
* resets hit counts for all statements, functions and branches
* in this coverage object resulting in zero coverage.
*/
resetHits() {
const statements = this.s;
const functions = this.f;
const branches = this.b;
const branchesTrue = this.bT;
Object.keys(statements).forEach(s => {
statements[s] = 0;
});
Object.keys(functions).forEach(f => {
functions[f] = 0;
});
Object.keys(branches).forEach(b => {
branches[b].fill(0);
});
// Tracking additional information about branch truthiness
// can be optionally enabled:
if (branchesTrue) {
Object.keys(branchesTrue).forEach(bT => {
branchesTrue[bT].fill(0);
});
}
}
/**
* returns a CoverageSummary for this file coverage object
* @returns {CoverageSummary}
*/
toSummary() {
const ret = {};
ret.lines = this.computeSimpleTotals('getLineCoverage');
ret.functions = this.computeSimpleTotals('f', 'fnMap');
ret.statements = this.computeSimpleTotals('s', 'statementMap');
ret.branches = this.computeBranchTotals('b');
// Tracking additional information about branch truthiness
// can be optionally enabled:
if (this.bT) {
ret.branchesTrue = this.computeBranchTotals('bT');
}
return new CoverageSummary(ret);
}
}
// expose coverage data attributes
dataProperties(FileCoverage, [
'path',
'statementMap',
'fnMap',
'branchMap',
's',
'f',
'b',
'bT',
'all'
]);
module.exports = {
FileCoverage,
// exported for testing
findNearestContainer,
addHits,
addNearestContainerHits
};
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("./core");
const validation_1 = require("./validation");
const applicator_1 = require("./applicator");
const format_1 = require("./format");
const metadata_1 = require("./metadata");
const draft7Vocabularies = [
core_1.default,
validation_1.default,
(0, applicator_1.default)(),
format_1.default,
metadata_1.metadataVocabulary,
metadata_1.contentVocabulary,
];
exports.default = draft7Vocabularies;
//# sourceMappingURL=draft7.js.map
@@ -0,0 +1,568 @@
import { EncodedSourceMap } from "@jridgewell/trace-mapping";
import { CoverageMapData } from "istanbul-lib-coverage";
import { Profiler } from "node:inspector";
//#region node_modules/.pnpm/@types+estree@1.0.8/node_modules/@types/estree/index.d.ts
// This definition file follows a somewhat unusual format. ESTree allows
// runtime type checks based on the `type` parameter. In order to explain this
// to typescript we want to use discriminated union types:
// https://github.com/Microsoft/TypeScript/pull/9163
//
// For ESTree this is a bit tricky because the high level interfaces like
// Node or Function are pulling double duty. We want to pass common fields down
// to the interfaces that extend them (like Identifier or
// ArrowFunctionExpression), but you can't extend a type union or enforce
// common fields on them. So we've split the high level interfaces into two
// types, a base type which passes down inherited fields, and a type union of
// all types which extend the base type. Only the type union is exported, and
// the union is how other types refer to the collection of inheriting types.
//
// This makes the definitions file here somewhat more difficult to maintain,
// but it has the notable advantage of making ESTree much easier to use as
// an end user.
interface BaseNodeWithoutComments {
// Every leaf interface that extends BaseNode must specify a type property.
// The type property should be a string literal. For example, Identifier
// has: `type: "Identifier"`
type: string;
loc?: SourceLocation | null | undefined;
range?: [number, number] | undefined;
}
interface BaseNode extends BaseNodeWithoutComments {
leadingComments?: Comment[] | undefined;
trailingComments?: Comment[] | undefined;
}
interface NodeMap {
AssignmentProperty: AssignmentProperty;
CatchClause: CatchClause;
Class: Class;
ClassBody: ClassBody;
Expression: Expression;
Function: Function;
Identifier: Identifier;
Literal: Literal;
MethodDefinition: MethodDefinition;
ModuleDeclaration: ModuleDeclaration;
ModuleSpecifier: ModuleSpecifier;
Pattern: Pattern;
PrivateIdentifier: PrivateIdentifier;
Program: Program;
Property: Property;
PropertyDefinition: PropertyDefinition;
SpreadElement: SpreadElement;
Statement: Statement;
Super: Super;
SwitchCase: SwitchCase;
TemplateElement: TemplateElement;
VariableDeclarator: VariableDeclarator;
}
type Node = NodeMap[keyof NodeMap];
interface Comment extends BaseNodeWithoutComments {
type: "Line" | "Block";
value: string;
}
interface SourceLocation {
source?: string | null | undefined;
start: Position;
end: Position;
}
interface Position {
/** >= 1 */
line: number;
/** >= 0 */
column: number;
}
interface Program extends BaseNode {
type: "Program";
sourceType: "script" | "module";
body: Array<Directive | Statement | ModuleDeclaration>;
comments?: Comment[] | undefined;
}
interface Directive extends BaseNode {
type: "ExpressionStatement";
expression: Literal;
directive: string;
}
interface BaseFunction extends BaseNode {
params: Pattern[];
generator?: boolean | undefined;
async?: boolean | undefined; // The body is either BlockStatement or Expression because arrow functions
// can have a body that's either. FunctionDeclarations and
// FunctionExpressions have only BlockStatement bodies.
body: BlockStatement | Expression;
}
type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
interface BaseStatement extends BaseNode {}
interface EmptyStatement extends BaseStatement {
type: "EmptyStatement";
}
interface BlockStatement extends BaseStatement {
type: "BlockStatement";
body: Statement[];
innerComments?: Comment[] | undefined;
}
interface StaticBlock extends Omit<BlockStatement, "type"> {
type: "StaticBlock";
}
interface ExpressionStatement extends BaseStatement {
type: "ExpressionStatement";
expression: Expression;
}
interface IfStatement extends BaseStatement {
type: "IfStatement";
test: Expression;
consequent: Statement;
alternate?: Statement | null | undefined;
}
interface LabeledStatement extends BaseStatement {
type: "LabeledStatement";
label: Identifier;
body: Statement;
}
interface BreakStatement extends BaseStatement {
type: "BreakStatement";
label?: Identifier | null | undefined;
}
interface ContinueStatement extends BaseStatement {
type: "ContinueStatement";
label?: Identifier | null | undefined;
}
interface WithStatement extends BaseStatement {
type: "WithStatement";
object: Expression;
body: Statement;
}
interface SwitchStatement extends BaseStatement {
type: "SwitchStatement";
discriminant: Expression;
cases: SwitchCase[];
}
interface ReturnStatement extends BaseStatement {
type: "ReturnStatement";
argument?: Expression | null | undefined;
}
interface ThrowStatement extends BaseStatement {
type: "ThrowStatement";
argument: Expression;
}
interface TryStatement extends BaseStatement {
type: "TryStatement";
block: BlockStatement;
handler?: CatchClause | null | undefined;
finalizer?: BlockStatement | null | undefined;
}
interface WhileStatement extends BaseStatement {
type: "WhileStatement";
test: Expression;
body: Statement;
}
interface DoWhileStatement extends BaseStatement {
type: "DoWhileStatement";
body: Statement;
test: Expression;
}
interface ForStatement extends BaseStatement {
type: "ForStatement";
init?: VariableDeclaration | Expression | null | undefined;
test?: Expression | null | undefined;
update?: Expression | null | undefined;
body: Statement;
}
interface BaseForXStatement extends BaseStatement {
left: VariableDeclaration | Pattern;
right: Expression;
body: Statement;
}
interface ForInStatement extends BaseForXStatement {
type: "ForInStatement";
}
interface DebuggerStatement extends BaseStatement {
type: "DebuggerStatement";
}
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
interface BaseDeclaration extends BaseStatement {}
interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
type: "FunctionDeclaration";
/** It is null when a function declaration is a part of the `export default function` statement */
id: Identifier | null;
body: BlockStatement;
}
interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
id: Identifier;
}
interface VariableDeclaration extends BaseDeclaration {
type: "VariableDeclaration";
declarations: VariableDeclarator[];
kind: "var" | "let" | "const" | "using" | "await using";
}
interface VariableDeclarator extends BaseNode {
type: "VariableDeclarator";
id: Pattern;
init?: Expression | null | undefined;
}
interface ExpressionMap {
ArrayExpression: ArrayExpression;
ArrowFunctionExpression: ArrowFunctionExpression;
AssignmentExpression: AssignmentExpression;
AwaitExpression: AwaitExpression;
BinaryExpression: BinaryExpression;
CallExpression: CallExpression;
ChainExpression: ChainExpression;
ClassExpression: ClassExpression;
ConditionalExpression: ConditionalExpression;
FunctionExpression: FunctionExpression;
Identifier: Identifier;
ImportExpression: ImportExpression;
Literal: Literal;
LogicalExpression: LogicalExpression;
MemberExpression: MemberExpression;
MetaProperty: MetaProperty;
NewExpression: NewExpression;
ObjectExpression: ObjectExpression;
SequenceExpression: SequenceExpression;
TaggedTemplateExpression: TaggedTemplateExpression;
TemplateLiteral: TemplateLiteral;
ThisExpression: ThisExpression;
UnaryExpression: UnaryExpression;
UpdateExpression: UpdateExpression;
YieldExpression: YieldExpression;
}
type Expression = ExpressionMap[keyof ExpressionMap];
interface BaseExpression extends BaseNode {}
type ChainElement = SimpleCallExpression | MemberExpression;
interface ChainExpression extends BaseExpression {
type: "ChainExpression";
expression: ChainElement;
}
interface ThisExpression extends BaseExpression {
type: "ThisExpression";
}
interface ArrayExpression extends BaseExpression {
type: "ArrayExpression";
elements: Array<Expression | SpreadElement | null>;
}
interface ObjectExpression extends BaseExpression {
type: "ObjectExpression";
properties: Array<Property | SpreadElement>;
}
interface PrivateIdentifier extends BaseNode {
type: "PrivateIdentifier";
name: string;
}
interface Property extends BaseNode {
type: "Property";
key: Expression | PrivateIdentifier;
value: Expression | Pattern; // Could be an AssignmentProperty
kind: "init" | "get" | "set";
method: boolean;
shorthand: boolean;
computed: boolean;
}
interface PropertyDefinition extends BaseNode {
type: "PropertyDefinition";
key: Expression | PrivateIdentifier;
value?: Expression | null | undefined;
computed: boolean;
static: boolean;
}
interface FunctionExpression extends BaseFunction, BaseExpression {
id?: Identifier | null | undefined;
type: "FunctionExpression";
body: BlockStatement;
}
interface SequenceExpression extends BaseExpression {
type: "SequenceExpression";
expressions: Expression[];
}
interface UnaryExpression extends BaseExpression {
type: "UnaryExpression";
operator: UnaryOperator;
prefix: true;
argument: Expression;
}
interface BinaryExpression extends BaseExpression {
type: "BinaryExpression";
operator: BinaryOperator;
left: Expression | PrivateIdentifier;
right: Expression;
}
interface AssignmentExpression extends BaseExpression {
type: "AssignmentExpression";
operator: AssignmentOperator;
left: Pattern | MemberExpression;
right: Expression;
}
interface UpdateExpression extends BaseExpression {
type: "UpdateExpression";
operator: UpdateOperator;
argument: Expression;
prefix: boolean;
}
interface LogicalExpression extends BaseExpression {
type: "LogicalExpression";
operator: LogicalOperator;
left: Expression;
right: Expression;
}
interface ConditionalExpression extends BaseExpression {
type: "ConditionalExpression";
test: Expression;
alternate: Expression;
consequent: Expression;
}
interface BaseCallExpression extends BaseExpression {
callee: Expression | Super;
arguments: Array<Expression | SpreadElement>;
}
type CallExpression = SimpleCallExpression | NewExpression;
interface SimpleCallExpression extends BaseCallExpression {
type: "CallExpression";
optional: boolean;
}
interface NewExpression extends BaseCallExpression {
type: "NewExpression";
}
interface MemberExpression extends BaseExpression, BasePattern {
type: "MemberExpression";
object: Expression | Super;
property: Expression | PrivateIdentifier;
computed: boolean;
optional: boolean;
}
type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
interface BasePattern extends BaseNode {}
interface SwitchCase extends BaseNode {
type: "SwitchCase";
test?: Expression | null | undefined;
consequent: Statement[];
}
interface CatchClause extends BaseNode {
type: "CatchClause";
param: Pattern | null;
body: BlockStatement;
}
interface Identifier extends BaseNode, BaseExpression, BasePattern {
type: "Identifier";
name: string;
}
type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
interface SimpleLiteral extends BaseNode, BaseExpression {
type: "Literal";
value: string | boolean | number | null;
raw?: string | undefined;
}
interface RegExpLiteral extends BaseNode, BaseExpression {
type: "Literal";
value?: RegExp | null | undefined;
regex: {
pattern: string;
flags: string;
};
raw?: string | undefined;
}
interface BigIntLiteral extends BaseNode, BaseExpression {
type: "Literal";
value?: bigint | null | undefined;
bigint: string;
raw?: string | undefined;
}
type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
type LogicalOperator = "||" | "&&" | "??";
type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
type UpdateOperator = "++" | "--";
interface ForOfStatement extends BaseForXStatement {
type: "ForOfStatement";
await: boolean;
}
interface Super extends BaseNode {
type: "Super";
}
interface SpreadElement extends BaseNode {
type: "SpreadElement";
argument: Expression;
}
interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
type: "ArrowFunctionExpression";
expression: boolean;
body: BlockStatement | Expression;
}
interface YieldExpression extends BaseExpression {
type: "YieldExpression";
argument?: Expression | null | undefined;
delegate: boolean;
}
interface TemplateLiteral extends BaseExpression {
type: "TemplateLiteral";
quasis: TemplateElement[];
expressions: Expression[];
}
interface TaggedTemplateExpression extends BaseExpression {
type: "TaggedTemplateExpression";
tag: Expression;
quasi: TemplateLiteral;
}
interface TemplateElement extends BaseNode {
type: "TemplateElement";
tail: boolean;
value: {
/** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */cooked?: string | null | undefined;
raw: string;
};
}
interface AssignmentProperty extends Property {
value: Pattern;
kind: "init";
method: boolean; // false
}
interface ObjectPattern extends BasePattern {
type: "ObjectPattern";
properties: Array<AssignmentProperty | RestElement>;
}
interface ArrayPattern extends BasePattern {
type: "ArrayPattern";
elements: Array<Pattern | null>;
}
interface RestElement extends BasePattern {
type: "RestElement";
argument: Pattern;
}
interface AssignmentPattern extends BasePattern {
type: "AssignmentPattern";
left: Pattern;
right: Expression;
}
type Class = ClassDeclaration | ClassExpression;
interface BaseClass extends BaseNode {
superClass?: Expression | null | undefined;
body: ClassBody;
}
interface ClassBody extends BaseNode {
type: "ClassBody";
body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
}
interface MethodDefinition extends BaseNode {
type: "MethodDefinition";
key: Expression | PrivateIdentifier;
value: FunctionExpression;
kind: "constructor" | "method" | "get" | "set";
computed: boolean;
static: boolean;
}
interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
type: "ClassDeclaration";
/** It is null when a class declaration is a part of the `export default class` statement */
id: Identifier | null;
}
interface ClassDeclaration extends MaybeNamedClassDeclaration {
id: Identifier;
}
interface ClassExpression extends BaseClass, BaseExpression {
type: "ClassExpression";
id?: Identifier | null | undefined;
}
interface MetaProperty extends BaseExpression {
type: "MetaProperty";
meta: Identifier;
property: Identifier;
}
type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
interface BaseModuleDeclaration extends BaseNode {}
type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
interface BaseModuleSpecifier extends BaseNode {
local: Identifier;
}
interface ImportDeclaration extends BaseModuleDeclaration {
type: "ImportDeclaration";
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
attributes: ImportAttribute[];
source: Literal;
}
interface ImportSpecifier extends BaseModuleSpecifier {
type: "ImportSpecifier";
imported: Identifier | Literal;
}
interface ImportAttribute extends BaseNode {
type: "ImportAttribute";
key: Identifier | Literal;
value: Literal;
}
interface ImportExpression extends BaseExpression {
type: "ImportExpression";
source: Expression;
options?: Expression | null | undefined;
}
interface ImportDefaultSpecifier extends BaseModuleSpecifier {
type: "ImportDefaultSpecifier";
}
interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
type: "ImportNamespaceSpecifier";
}
interface ExportNamedDeclaration extends BaseModuleDeclaration {
type: "ExportNamedDeclaration";
declaration?: Declaration | null | undefined;
specifiers: ExportSpecifier[];
attributes: ImportAttribute[];
source?: Literal | null | undefined;
}
interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
type: "ExportSpecifier";
local: Identifier | Literal;
exported: Identifier | Literal;
}
interface ExportDefaultDeclaration extends BaseModuleDeclaration {
type: "ExportDefaultDeclaration";
declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
}
interface ExportAllDeclaration extends BaseModuleDeclaration {
type: "ExportAllDeclaration";
exported: Identifier | Literal | null;
attributes: ImportAttribute[];
source: Literal;
}
interface AwaitExpression extends BaseExpression {
type: "AwaitExpression";
argument: Expression;
}
//#endregion
//#region src/types.d.ts
interface Options<T = Node, Program = T & {
type: "Program";
}> {
/** Code of the executed runtime file, not the original source file */
code: string;
/** Length of the execution wrapper, e.g. wrapper used in node:vm */
wrapperLength?: number;
/** Source map for the current file */
sourceMap?: Omit<EncodedSourceMap, "version"> & {
version: number;
};
/** ScriptCoverage for the current file */
coverage: Pick<Profiler.ScriptCoverage, "functions" | "url">;
/** AST for the transpiled file that matches the coverage results */
ast: Program | Promise<Program>;
/** Class method names to ignore for coverage, identical to https://github.com/istanbuljs/nyc?tab=readme-ov-file#ignoring-methods */
ignoreClassMethods?: string[];
/** Filter to ignore code based on AST nodes */
ignoreNode?: (node: T, type: "function" | "statement" | "branch") => boolean | "ignore-this-and-nested-nodes" | void;
/**
* Filter to ignore code based on source code
* - Note that this is slower than `ignoreNode` as exclusion happens after remapping
*/
ignoreSourceCode?: (code: string, type: "function" | "statement" | "branch", location: Record<"start" | "end", {
line: number;
column: number;
}>) => boolean | void;
}
//#endregion
//#region src/index.d.ts
/**
* Maps V8 `ScriptCoverage` to Istanbul's `CoverageMap`.
* Results are identical with `istanbul-lib-instrument`.
*/
declare function convert<T = Node, Program = T & {
type: "Program";
}>(options: Options<T, Program>): Promise<CoverageMapData>;
//#endregion
export { Options, convert, convert as default };
@@ -0,0 +1 @@
{"version":3,"file":"file-input.js","sources":["../../../src/icons/file-input.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileInput\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNMiAxNWgxMCIgLz4KICA8cGF0aCBkPSJtOSAxOCAzLTMtMy0zIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-input\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 FileInput = createLucideIcon('FileInput', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M2 15h10', key: 'jfw4w8' }],\n ['path', { d: 'm9 18 3-3-3-3', key: '112psh' }],\n]);\n\nexport default FileInput;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,63 @@
export { default as ar } from "./ar.js";
export { default as az } from "./az.js";
export { default as be } from "./be.js";
export { default as bg } from "./bg.js";
export { default as bn } from "./bn.js";
export { default as ca } from "./ca.js";
export { default as ckb } from "./ckb.js";
export { default as cs } from "./cs.js";
export { default as da } from "./da.js";
export { default as de } from "./de.js";
export { default as el } from "./el.js";
export { default as en } from "./en.js";
export { default as eo } from "./eo.js";
export { default as es } from "./es.js";
export { default as fa } from "./fa.js";
export { default as fi } from "./fi.js";
export { default as fr } from "./fr.js";
export { default as frCA } from "./fr-CA.js";
export { default as gu } from "./gu.js";
export { default as he } from "./he.js";
export { default as hi } from "./hi.js";
export { default as hr } from "./hr.js";
export { default as hu } from "./hu.js";
export { default as hy } from "./hy.js";
export { default as id } from "./id.js";
export { default as is } from "./is.js";
export { default as it } from "./it.js";
export { default as ja } from "./ja.js";
export { default as ka } from "./ka.js";
export { default as kh } from "./kh.js";
export { default as km } from "./km.js";
export { default as kn } from "./kn.js";
export { default as ko } from "./ko.js";
export { default as lt } from "./lt.js";
export { default as mk } from "./mk.js";
export { default as ms } from "./ms.js";
export { default as ne } from "./ne.js";
export { default as nl } from "./nl.js";
export { default as nn } from "./nn.js";
export { default as no } from "./no.js";
export { default as ota } from "./ota.js";
export { default as ps } from "./ps.js";
export { default as pl } from "./pl.js";
export { default as pt } from "./pt.js";
export { default as ptBR } from "./pt-BR.js";
export { default as ro } from "./ro.js";
export { default as ru } from "./ru.js";
export { default as sk } from "./sk.js";
export { default as sl } from "./sl.js";
export { default as sv } from "./sv.js";
export { default as ta } from "./ta.js";
export { default as tg } from "./tg.js";
export { default as th } from "./th.js";
export { default as tk } from "./tk.js";
export { default as tr } from "./tr.js";
export { default as ua } from "./ua.js";
export { default as uk } from "./uk.js";
export { default as ur } from "./ur.js";
export { default as uz } from "./uz.js";
export { default as vi } from "./vi.js";
export { default as zhCN } from "./zh-CN.js";
export { default as zhTW } from "./zh-TW.js";
export { default as yo } from "./yo.js";
@@ -0,0 +1,212 @@
"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.valueMatchesSomeSpecifier = exports.typeMatchesSomeSpecifier = exports.typeOrValueSpecifiersSchema = void 0;
exports.typeMatchesSpecifier = typeMatchesSpecifier;
exports.valueMatchesSpecifier = valueMatchesSpecifier;
const types_1 = require("@typescript-eslint/types");
const tsutils = __importStar(require("ts-api-utils"));
const specifierNameMatches_1 = require("./typeOrValueSpecifiers/specifierNameMatches");
const typeDeclaredInFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInFile");
const typeDeclaredInLib_1 = require("./typeOrValueSpecifiers/typeDeclaredInLib");
const typeDeclaredInPackageDeclarationFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile");
exports.typeOrValueSpecifiersSchema = {
items: {
oneOf: [
{
type: 'string',
},
{
additionalProperties: false,
properties: {
from: {
enum: ['file'],
type: 'string',
},
name: {
oneOf: [
{
type: 'string',
},
{
items: {
type: 'string',
},
minItems: 1,
type: 'array',
uniqueItems: true,
},
],
},
path: {
type: 'string',
},
},
required: ['from', 'name'],
type: 'object',
},
{
additionalProperties: false,
properties: {
from: {
enum: ['lib'],
type: 'string',
},
name: {
oneOf: [
{
type: 'string',
},
{
items: {
type: 'string',
},
minItems: 1,
type: 'array',
uniqueItems: true,
},
],
},
},
required: ['from', 'name'],
type: 'object',
},
{
additionalProperties: false,
properties: {
from: {
enum: ['package'],
type: 'string',
},
name: {
oneOf: [
{
type: 'string',
},
{
items: {
type: 'string',
},
minItems: 1,
type: 'array',
uniqueItems: true,
},
],
},
package: {
type: 'string',
},
},
required: ['from', 'name', 'package'],
type: 'object',
},
],
},
type: 'array',
};
function typeMatchesSpecifier(type, specifier, program) {
if (tsutils.isUnionType(type)) {
return type.types.every(t => typeMatchesSpecifier(t, specifier, program));
}
const wholeTypeMatches = (() => {
if (tsutils.isIntrinsicErrorType(type)) {
return false;
}
if (typeof specifier === 'string') {
return (0, specifierNameMatches_1.specifierNameMatches)(type, specifier);
}
if (!(0, specifierNameMatches_1.specifierNameMatches)(type, specifier.name)) {
return false;
}
const symbol = type.getSymbol() ?? type.aliasSymbol;
const declarations = symbol?.getDeclarations() ?? [];
const declarationFiles = declarations.map(declaration => declaration.getSourceFile());
switch (specifier.from) {
case 'file':
return (0, typeDeclaredInFile_1.typeDeclaredInFile)(specifier.path, declarationFiles, program);
case 'lib':
return (0, typeDeclaredInLib_1.typeDeclaredInLib)(declarationFiles, program);
case 'package':
return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program);
}
})();
if (wholeTypeMatches) {
return true;
}
if (tsutils.isIntersectionType(type) &&
tsutils
.intersectionConstituents(type)
.some(part => typeMatchesSpecifier(part, specifier, program))) {
return true;
}
return false;
}
const typeMatchesSomeSpecifier = (type, specifiers = [], program) => specifiers.some(specifier => typeMatchesSpecifier(type, specifier, program));
exports.typeMatchesSomeSpecifier = typeMatchesSomeSpecifier;
const getSpecifierNames = (specifierName) => {
return typeof specifierName === 'string' ? [specifierName] : specifierName;
};
const getStaticName = (node) => {
if (node.type === types_1.AST_NODE_TYPES.Identifier ||
node.type === types_1.AST_NODE_TYPES.JSXIdentifier ||
node.type === types_1.AST_NODE_TYPES.PrivateIdentifier) {
return node.name;
}
if (node.type === types_1.AST_NODE_TYPES.Literal && typeof node.value === 'string') {
return node.value;
}
return undefined;
};
function valueMatchesSpecifier(node, specifier, program, type) {
const staticName = getStaticName(node);
if (!staticName) {
return false;
}
if (typeof specifier === 'string') {
return specifier === staticName;
}
if (!getSpecifierNames(specifier.name).includes(staticName)) {
return false;
}
if (specifier.from === 'package') {
const symbol = type.getSymbol() ?? type.aliasSymbol;
const declarations = symbol?.getDeclarations() ?? [];
const declarationFiles = declarations.map(declaration => declaration.getSourceFile());
return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program);
}
return true;
}
const valueMatchesSomeSpecifier = (node, specifiers = [], program, type) => specifiers.some(specifier => valueMatchesSpecifier(node, specifier, program, type));
exports.valueMatchesSomeSpecifier = valueMatchesSomeSpecifier;
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-right-from-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,142 @@
"use strict";
exports.__esModule = true;
exports.distance = exports.closest = void 0;
var peq = new Uint32Array(0x10000);
var myers_32 = function (a, b) {
var n = a.length;
var m = b.length;
var lst = 1 << (n - 1);
var pv = -1;
var mv = 0;
var sc = n;
var i = n;
while (i--) {
peq[a.charCodeAt(i)] |= 1 << i;
}
for (i = 0; i < m; i++) {
var eq = peq[b.charCodeAt(i)];
var xv = eq | mv;
eq |= ((eq & pv) + pv) ^ pv;
mv |= ~(eq | pv);
pv &= eq;
if (mv & lst) {
sc++;
}
if (pv & lst) {
sc--;
}
mv = (mv << 1) | 1;
pv = (pv << 1) | ~(xv | mv);
mv &= xv;
}
i = n;
while (i--) {
peq[a.charCodeAt(i)] = 0;
}
return sc;
};
var myers_x = function (b, a) {
var n = a.length;
var m = b.length;
var mhc = [];
var phc = [];
var hsize = Math.ceil(n / 32);
var vsize = Math.ceil(m / 32);
for (var i = 0; i < hsize; i++) {
phc[i] = -1;
mhc[i] = 0;
}
var j = 0;
for (; j < vsize - 1; j++) {
var mv_1 = 0;
var pv_1 = -1;
var start_1 = j * 32;
var vlen_1 = Math.min(32, m) + start_1;
for (var k = start_1; k < vlen_1; k++) {
peq[b.charCodeAt(k)] |= 1 << k;
}
for (var i = 0; i < n; i++) {
var eq = peq[a.charCodeAt(i)];
var pb = (phc[(i / 32) | 0] >>> i) & 1;
var mb = (mhc[(i / 32) | 0] >>> i) & 1;
var xv = eq | mv_1;
var xh = ((((eq | mb) & pv_1) + pv_1) ^ pv_1) | eq | mb;
var ph = mv_1 | ~(xh | pv_1);
var mh = pv_1 & xh;
if ((ph >>> 31) ^ pb) {
phc[(i / 32) | 0] ^= 1 << i;
}
if ((mh >>> 31) ^ mb) {
mhc[(i / 32) | 0] ^= 1 << i;
}
ph = (ph << 1) | pb;
mh = (mh << 1) | mb;
pv_1 = mh | ~(xv | ph);
mv_1 = ph & xv;
}
for (var k = start_1; k < vlen_1; k++) {
peq[b.charCodeAt(k)] = 0;
}
}
var mv = 0;
var pv = -1;
var start = j * 32;
var vlen = Math.min(32, m - start) + start;
for (var k = start; k < vlen; k++) {
peq[b.charCodeAt(k)] |= 1 << k;
}
var score = m;
for (var i = 0; i < n; i++) {
var eq = peq[a.charCodeAt(i)];
var pb = (phc[(i / 32) | 0] >>> i) & 1;
var mb = (mhc[(i / 32) | 0] >>> i) & 1;
var xv = eq | mv;
var xh = ((((eq | mb) & pv) + pv) ^ pv) | eq | mb;
var ph = mv | ~(xh | pv);
var mh = pv & xh;
score += (ph >>> (m - 1)) & 1;
score -= (mh >>> (m - 1)) & 1;
if ((ph >>> 31) ^ pb) {
phc[(i / 32) | 0] ^= 1 << i;
}
if ((mh >>> 31) ^ mb) {
mhc[(i / 32) | 0] ^= 1 << i;
}
ph = (ph << 1) | pb;
mh = (mh << 1) | mb;
pv = mh | ~(xv | ph);
mv = ph & xv;
}
for (var k = start; k < vlen; k++) {
peq[b.charCodeAt(k)] = 0;
}
return score;
};
var distance = function (a, b) {
if (a.length < b.length) {
var tmp = b;
b = a;
a = tmp;
}
if (b.length === 0) {
return a.length;
}
if (a.length <= 32) {
return myers_32(a, b);
}
return myers_x(a, b);
};
exports.distance = distance;
var closest = function (str, arr) {
var min_distance = Infinity;
var min_index = 0;
for (var i = 0; i < arr.length; i++) {
var dist = distance(str, arr[i]);
if (dist < min_distance) {
min_distance = dist;
min_index = i;
}
}
return arr[min_index];
};
exports.closest = closest;
@@ -0,0 +1,3 @@
//#region src/jsx/dom/utils.d.ts
export declare const setInternalTagFlag: (fn: Function) => Function;
//#endregion
@@ -0,0 +1,148 @@
/**
* @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call()
* @author Nitin Kumar
* @author Gautam Arora
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks if the given node is considered to be an access to a property of `Object.prototype`.
* @param {ASTNode} node `MemberExpression` node to evaluate.
* @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node).
*/
function hasLeftHandObject(node) {
/*
* ({}).hasOwnProperty.call(obj, prop) - `true`
* ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty
*/
if (
node.object.type === "ObjectExpression" &&
node.object.properties.length === 0
) {
return true;
}
const objectNodeToCheck =
node.object.type === "MemberExpression" &&
astUtils.getStaticPropertyName(node.object) === "prototype"
? node.object.object
: node.object;
if (
objectNodeToCheck.type === "Identifier" &&
objectNodeToCheck.name === "Object"
) {
return true;
}
return false;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-object-has-own",
},
schema: [],
messages: {
useHasOwn:
"Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'.",
},
fixable: "code",
},
create(context) {
const sourceCode = context.sourceCode;
return {
CallExpression(node) {
if (
!(
node.callee.type === "MemberExpression" &&
node.callee.object.type === "MemberExpression"
)
) {
return;
}
const calleePropertyName = astUtils.getStaticPropertyName(
node.callee,
);
const objectPropertyName = astUtils.getStaticPropertyName(
node.callee.object,
);
const isObject = hasLeftHandObject(node.callee.object);
// check `Object` scope
const scope = sourceCode.getScope(node);
const variable = astUtils.getVariableByName(scope, "Object");
if (
calleePropertyName === "call" &&
objectPropertyName === "hasOwnProperty" &&
isObject &&
variable &&
variable.scope.type === "global"
) {
context.report({
node,
messageId: "useHasOwn",
fix(fixer) {
if (
sourceCode.getCommentsInside(node.callee)
.length > 0
) {
return null;
}
const tokenJustBeforeNode =
sourceCode.getTokenBefore(node.callee, {
includeComments: true,
});
// for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
if (
tokenJustBeforeNode &&
tokenJustBeforeNode.range[1] ===
node.callee.range[0] &&
!astUtils.canTokensBeAdjacent(
tokenJustBeforeNode,
"Object.hasOwn",
)
) {
return fixer.replaceText(
node.callee,
" Object.hasOwn",
);
}
return fixer.replaceText(
node.callee,
"Object.hasOwn",
);
},
});
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"feedback.mjs","sources":["../../../src/matcher/dictionary/feedback.ts"],"sourcesContent":[null],"names":["getDictionaryWarningPassword","options","match","isSoleMatch","warning","l33t","reversed","rank","translations","warnings","topTen","topHundred","common","guessesLog10","similarToCommon","getDictionaryWarningWikipedia","wordByItself","getDictionaryWarningNames","namesByThemselves","commonNames","getDictionaryWarning","dictName","dictionaryName","isAName","toLowerCase","includes","userInputs","suggestions","word","token","START_UPPER","push","capitalization","ALL_UPPER_INVERTED","allUppercase","length","reverseWords"],"mappings":";;AAIA,MAAMA,4BAA4B,GAAGA,CACnCC,OAAgB,EAChBC,KAAqB,EACrBC,WAAqB,KACnB;EACF,IAAIC,OAAO,GAAkB,IAAI;EACjC,IAAID,WAAW,IAAI,CAACD,KAAK,CAACG,IAAI,IAAI,CAACH,KAAK,CAACI,QAAQ,EAAE;AACjD,IAAA,IAAIJ,KAAK,CAACK,IAAI,IAAI,EAAE,EAAE;AACpBH,MAAAA,OAAO,GAAGH,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACC,MAAM;AAChD,IAAA,CAAC,MAAM,IAAIR,KAAK,CAACK,IAAI,IAAI,GAAG,EAAE;AAC5BH,MAAAA,OAAO,GAAGH,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACE,UAAU;AACpD,IAAA,CAAC,MAAM;AACLP,MAAAA,OAAO,GAAGH,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACG,MAAM;AAChD,IAAA;AACF,EAAA,CAAC,MAAM,IAAIV,KAAK,CAACW,YAAY,IAAI,CAAC,EAAE;AAClCT,IAAAA,OAAO,GAAGH,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACK,eAAe;AACzD,EAAA;AACA,EAAA,OAAOV,OAAO;AAChB,CAAC;AAED,MAAMW,6BAA6B,GAAGA,CACpCd,OAAgB,EAChBC,KAAqB,EACrBC,WAAqB,KACnB;EACF,IAAIC,OAAO,GAAkB,IAAI;AACjC,EAAA,IAAID,WAAW,EAAE;AACfC,IAAAA,OAAO,GAAGH,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACO,YAAY;AACtD,EAAA;AACA,EAAA,OAAOZ,OAAO;AAChB,CAAC;AAED,MAAMa,yBAAyB,GAAGA,CAChChB,OAAgB,EAChBC,KAAqB,EACrBC,WAAqB,KACnB;AACF,EAAA,IAAIA,WAAW,EAAE;AACf,IAAA,OAAOF,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACS,iBAAiB;AACxD,EAAA;AACA,EAAA,OAAOjB,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACU,WAAW;AAClD,CAAC;AAED,MAAMC,oBAAoB,GAAGA,CAC3BnB,OAAgB,EAChBC,KAAqB,EACrBC,WAAqB,KACnB;AACF,EAAA,MAAMkB,QAAQ,GAAGnB,KAAK,CAACoB,cAAc;AACrC,EAAA,MAAMC,OAAO,GACXF,QAAQ,CAACG,WAAW,EAAE,CAACC,QAAQ,CAAC,WAAW,CAAC,IAC5CJ,QAAQ,CAACG,WAAW,EAAE,CAACC,QAAQ,CAAC,YAAY,CAAC,IAC7CJ,QAAQ,CAACG,WAAW,EAAE,CAACC,QAAQ,CAAC,OAAO,CAAC;AAE1C,EAAA,IAAIJ,QAAQ,CAACI,QAAQ,CAAC,WAAW,CAAC,EAAE;AAClC,IAAA,OAAOzB,4BAA4B,CAACC,OAAO,EAAEC,KAAK,EAAEC,WAAW,CAAC;AAClE,EAAA;AACA,EAAA,IAAIkB,QAAQ,CAACI,QAAQ,CAAC,WAAW,CAAC,EAAE;AAClC,IAAA,OAAOV,6BAA6B,CAACd,OAAO,EAAEC,KAAK,EAAEC,WAAW,CAAC;AACnE,EAAA;AACA,EAAA,IAAIoB,OAAO,EAAE;AACX,IAAA,OAAON,yBAAyB,CAAChB,OAAO,EAAEC,KAAK,EAAEC,WAAW,CAAC;AAC/D,EAAA;AACA,EAAA,IAAIkB,QAAQ,CAACI,QAAQ,CAAC,YAAY,CAAC,EAAE;AACnC,IAAA,OAAOxB,OAAO,CAACO,YAAY,CAACC,QAAQ,CAACiB,UAAU;AACjD,EAAA;AAEA,EAAA,OAAO,IAAI;AACb,CAAC;AAED,wBAAe,CACbzB,OAAgB,EAChBC,KAAqB,EACrBC,WAAqB,KACnB;EACF,MAAMC,OAAO,GAAGgB,oBAAoB,CAACnB,OAAO,EAAEC,KAAK,EAAEC,WAAW,CAAC;EACjE,MAAMwB,WAAW,GAAa,EAAE;AAChC,EAAA,MAAMC,IAAI,GAAG1B,KAAK,CAAC2B,KAAK;AAExB,EAAA,IAAID,IAAI,CAAC1B,KAAK,CAAC4B,WAAW,CAAC,EAAE;IAC3BH,WAAW,CAACI,IAAI,CAAC9B,OAAO,CAACO,YAAY,CAACmB,WAAW,CAACK,cAAc,CAAC;AACnE,EAAA,CAAC,MAAM,IAAIJ,IAAI,CAAC1B,KAAK,CAAC+B,kBAAkB,CAAC,IAAIL,IAAI,CAACJ,WAAW,EAAE,KAAKI,IAAI,EAAE;IACxED,WAAW,CAACI,IAAI,CAAC9B,OAAO,CAACO,YAAY,CAACmB,WAAW,CAACO,YAAY,CAAC;AACjE,EAAA;EACA,IAAIhC,KAAK,CAACI,QAAQ,IAAIJ,KAAK,CAAC2B,KAAK,CAACM,MAAM,IAAI,CAAC,EAAE;IAC7CR,WAAW,CAACI,IAAI,CAAC9B,OAAO,CAACO,YAAY,CAACmB,WAAW,CAACS,YAAY,CAAC;AACjE,EAAA;EACA,IAAIlC,KAAK,CAACG,IAAI,EAAE;IACdsB,WAAW,CAACI,IAAI,CAAC9B,OAAO,CAACO,YAAY,CAACmB,WAAW,CAACtB,IAAI,CAAC;AACzD,EAAA;EACA,OAAO;IACLD,OAAO;AACPuB,IAAAA;GACD;AACH,CAAC;;;;"}
@@ -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-play.js';
//# sourceMappingURL=play-circle.js.map
@@ -0,0 +1,179 @@
import { Readable, Writable } from 'node:stream'
export default CacheHandler
declare namespace CacheHandler {
export type CacheMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE'
export interface CacheHandlerOptions {
store: CacheStore
cacheByDefault?: number
type?: CacheOptions['type']
}
export interface CacheOptions {
store?: CacheStore
/**
* The methods to cache
* Note we can only cache safe methods. Unsafe methods (i.e. PUT, POST)
* invalidate the cache for a origin.
* @see https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons
* @see https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1
*/
methods?: CacheMethods[]
/**
* RFC9111 allows for caching responses that we aren't explicitly told to
* cache or to not cache.
* @see https://www.rfc-editor.org/rfc/rfc9111.html#section-3-5
* @default undefined
*/
cacheByDefault?: number
/**
* TODO docs
* @default 'shared'
*/
type?: 'shared' | 'private'
/**
* Array of origins to cache. Only requests to these origins will be cached.
* Supports strings (case insensitive) and RegExp patterns.
* @default undefined (cache all origins)
*/
origins?: (string | RegExp)[]
}
export interface CacheControlDirectives {
'max-stale'?: number;
'min-fresh'?: number;
'max-age'?: number;
's-maxage'?: number;
'stale-while-revalidate'?: number;
'stale-if-error'?: number;
public?: true;
private?: true | string[];
'no-store'?: true;
'no-cache'?: true | string[];
'must-revalidate'?: true;
'proxy-revalidate'?: true;
immutable?: true;
'no-transform'?: true;
'must-understand'?: true;
'only-if-cached'?: true;
}
export interface CacheKey {
origin: string
method: string
path: string
headers?: Record<string, string | string[]>
}
export interface CacheValue {
statusCode: number
statusMessage: string
headers: Record<string, string | string[]>
vary?: Record<string, string | string[] | null>
etag?: string
cacheControlDirectives?: CacheControlDirectives
cachedAt: number
staleAt: number
deleteAt: number
}
export interface DeleteByUri {
origin: string
method: string
path: string
}
type GetResult = {
statusCode: number
statusMessage: string
headers: Record<string, string | string[]>
vary?: Record<string, string | string[] | null>
etag?: string
body?: Readable | Iterable<Buffer> | AsyncIterable<Buffer> | Buffer | Iterable<string> | AsyncIterable<string> | string
cacheControlDirectives: CacheControlDirectives,
cachedAt: number
staleAt: number
deleteAt: number
}
/**
* Underlying storage provider for cached responses
*/
export interface CacheStore {
get(key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
createWriteStream(key: CacheKey, val: CacheValue): Writable | undefined
delete(key: CacheKey): void | Promise<void>
}
export interface MemoryCacheStoreOpts {
/**
* @default Infinity
*/
maxCount?: number
/**
* @default Infinity
*/
maxSize?: number
/**
* @default Infinity
*/
maxEntrySize?: number
errorCallback?: (err: Error) => void
}
export class MemoryCacheStore implements CacheStore {
constructor (opts?: MemoryCacheStoreOpts)
get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
delete (key: CacheKey): void | Promise<void>
}
export interface SqliteCacheStoreOpts {
/**
* Location of the database
* @default ':memory:'
*/
location?: string
/**
* @default Infinity
*/
maxCount?: number
/**
* @default Infinity
*/
maxEntrySize?: number
}
export class SqliteCacheStore implements CacheStore {
constructor (opts?: SqliteCacheStoreOpts)
/**
* Closes the connection to the database
*/
close (): void
get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
delete (key: CacheKey): void | Promise<void>
}
}
@@ -0,0 +1,10 @@
export function validateAlgorithms(option, algorithms) {
if (algorithms !== undefined &&
(!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== 'string'))) {
throw new TypeError(`"${option}" option must be an array of strings`);
}
if (!algorithms) {
return undefined;
}
return new Set(algorithms);
}
@@ -0,0 +1,68 @@
{
"name": "eslint-plugin-react-hooks",
"description": "ESLint rules for React Hooks",
"version": "7.0.1",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/eslint-plugin-react-hooks"
},
"files": [
"LICENSE",
"README.md",
"cjs",
"index.js",
"index.d.ts"
],
"keywords": [
"eslint",
"eslint-plugin",
"eslintplugin",
"react"
],
"scripts": {
"build:compiler": "cd ../../compiler && yarn workspace babel-plugin-react-compiler build",
"test": "yarn build:compiler && jest",
"typecheck": "tsc --noEmit"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"main": "./index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=18"
},
"homepage": "https://react.dev/",
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"
},
"dependencies": {
"@babel/core": "^7.24.4",
"@babel/parser": "^7.24.4",
"hermes-parser": "^0.25.1",
"zod": "^3.25.0 || ^4.0.0",
"zod-validation-error": "^3.5.0 || ^4.0.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.11.4",
"@babel/preset-typescript": "^7.26.0",
"@babel/types": "^7.19.0",
"@tsconfig/strictest": "^2.0.5",
"@types/eslint": "^9.6.1",
"@types/estree": "^1.0.6",
"@types/estree-jsx": "^1.0.5",
"@types/node": "^20.2.5",
"@typescript-eslint/parser-v2": "npm:@typescript-eslint/parser@^2.26.0",
"@typescript-eslint/parser-v3": "npm:@typescript-eslint/parser@^3.10.0",
"@typescript-eslint/parser-v4": "npm:@typescript-eslint/parser@^4.1.0",
"@typescript-eslint/parser-v5": "npm:@typescript-eslint/parser@^5.62.0",
"babel-eslint": "^10.0.3",
"eslint-v7": "npm:eslint@^7.7.0",
"eslint-v8": "npm:eslint@^8.57.1",
"eslint-v9": "npm:eslint@^9.0.0",
"jest": "^29.5.0",
"typescript": "^5.4.3"
}
}
@@ -0,0 +1 @@
{"version":3,"names":["_options","require","_parse","_populate","stringTemplate","formatter","code","opts","metadata","arg","replacements","normalizeReplacements","parseAndBuildMetadata","unwrap","populatePlaceholders"],"sources":["../src/string.ts"],"sourcesContent":["import type { Formatter } from \"./formatters.ts\";\nimport type { TemplateOpts } from \"./options.ts\";\nimport type { Metadata } from \"./parse.ts\";\nimport { normalizeReplacements } from \"./options.ts\";\nimport parseAndBuildMetadata from \"./parse.ts\";\nimport populatePlaceholders from \"./populate.ts\";\n\nexport default function stringTemplate<T>(\n formatter: Formatter<T>,\n code: string,\n opts: TemplateOpts,\n): (arg?: unknown) => T {\n code = formatter.code(code);\n\n let metadata: Metadata;\n\n return (arg?: unknown) => {\n const replacements = normalizeReplacements(arg);\n\n if (!metadata) metadata = parseAndBuildMetadata(formatter, code, opts);\n\n return formatter.unwrap(populatePlaceholders(metadata, replacements));\n };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEe,SAASG,cAAcA,CACpCC,SAAuB,EACvBC,IAAY,EACZC,IAAkB,EACI;EACtBD,IAAI,GAAGD,SAAS,CAACC,IAAI,CAACA,IAAI,CAAC;EAE3B,IAAIE,QAAkB;EAEtB,OAAQC,GAAa,IAAK;IACxB,MAAMC,YAAY,GAAG,IAAAC,8BAAqB,EAACF,GAAG,CAAC;IAE/C,IAAI,CAACD,QAAQ,EAAEA,QAAQ,GAAG,IAAAI,cAAqB,EAACP,SAAS,EAAEC,IAAI,EAAEC,IAAI,CAAC;IAEtE,OAAOF,SAAS,CAACQ,MAAM,CAAC,IAAAC,iBAAoB,EAACN,QAAQ,EAAEE,YAAY,CAAC,CAAC;EACvE,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,40 @@
/**
* @license React
* react-jsx-runtime.react-server.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var React = require("react"),
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
function jsxProd(type, config, maybeKey) {
var key = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
config = maybeKey.ref;
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
ref: void 0 !== config ? config : null,
props: maybeKey
};
}
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsxProd;
exports.jsxDEV = void 0;
exports.jsxs = jsxProd;
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _checkPrivateRedeclaration;
function _checkPrivateRedeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError("Cannot initialize the same private elements twice on an object");
}
}
//# sourceMappingURL=checkPrivateRedeclaration.js.map
@@ -0,0 +1,31 @@
// Zod 3 compat layer
import * as core from "../core/index.js";
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
export const ZodIssueCode = {
invalid_type: "invalid_type",
too_big: "too_big",
too_small: "too_small",
invalid_format: "invalid_format",
not_multiple_of: "not_multiple_of",
unrecognized_keys: "unrecognized_keys",
invalid_union: "invalid_union",
invalid_key: "invalid_key",
invalid_element: "invalid_element",
invalid_value: "invalid_value",
custom: "custom",
};
export { $brand, config } from "../core/index.js";
/** @deprecated Use `z.config(params)` instead. */
export function setErrorMap(map) {
core.config({
customError: map,
});
}
/** @deprecated Use `z.config()` instead. */
export function getErrorMap() {
return core.config().customError;
}
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
export var ZodFirstPartyTypeKind;
(function (ZodFirstPartyTypeKind) {
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
@@ -0,0 +1,51 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/compose.ts
/**
* Compose middleware functions into a single function based on `koa-compose` package.
*
* @template E - The environment type.
*
* @param {[[Function, unknown], unknown][] | [[Function]][]} middleware - An array of middleware functions and their corresponding parameters.
* @param {ErrorHandler<E>} [onError] - An optional error handler function.
* @param {NotFoundHandler<E>} [onNotFound] - An optional not-found handler function.
*
* @returns {(context: Context, next?: Next) => Promise<Context>} - A composed middleware function.
*/
const compose = (middleware, onError, onNotFound) => {
return (context, next) => {
let index = -1;
return dispatch(0);
/**
* Dispatch the middleware functions.
*
* @param {number} i - The current index in the middleware array.
*
* @returns {Promise<Context>} - A promise that resolves to the context.
*/
async function dispatch(i) {
if (i <= index) throw new Error("next() called multiple times");
index = i;
let res;
let isError = false;
let handler;
if (middleware[i]) {
handler = middleware[i][0][0];
context.req.routeIndex = i;
} else handler = i === middleware.length && next || void 0;
if (handler) try {
res = await handler(context, () => dispatch(i + 1));
} catch (err) {
if (err instanceof Error && onError) {
context.error = err;
res = await onError(err, context);
isError = true;
} else throw err;
}
else if (context.finalized === false && onNotFound) res = await onNotFound(context);
if (res && (context.finalized === false || isError)) context.res = res;
return context;
}
};
};
//#endregion
exports.compose = compose;
@@ -0,0 +1,4 @@
import type * as ts from 'typescript';
import type { ASTMaps } from './convert';
import type { ParserServices } from './parser-options';
export declare function createParserServices(astMaps: ASTMaps, program: ts.Program | null): ParserServices;
@@ -0,0 +1,425 @@
/*
* ---------------------------------------------------------------------------------------------
* DO NOT EDIT THIS FILE MANUALLY.
* THIS FILE IS AUTOMATICALLY GENERATED.
* TO UPDATE, RUN `npm run typegen` AND COMMIT THE CHANGES.
* ---------------------------------------------------------------------------------------------
*/
/** A union of all supported encoding strings in `iconv-lite`. */
export type Encoding =
| "10000"
| "10006"
| "10007"
| "10029"
| "10079"
| "10081"
| "1046"
| "1124"
| "1125"
| "1129"
| "1133"
| "1161"
| "1162"
| "1163"
| "1250"
| "1251"
| "1252"
| "1253"
| "1254"
| "1255"
| "1256"
| "1257"
| "1258"
| "20866"
| "21866"
| "28591"
| "28592"
| "28593"
| "28594"
| "28595"
| "28596"
| "28597"
| "28598"
| "28599"
| "28600"
| "28601"
| "28603"
| "28604"
| "28605"
| "28606"
| "437"
| "737"
| "775"
| "808"
| "850"
| "852"
| "855"
| "856"
| "857"
| "858"
| "860"
| "861"
| "862"
| "863"
| "864"
| "865"
| "866"
| "869"
| "874"
| "922"
| "932"
| "936"
| "949"
| "950"
| "ansix34"
| "ansix341968"
| "ansix341986"
| "arabic"
| "arabic8"
| "armscii8"
| "ascii"
| "ascii8bit"
| "asmo708"
| "base64"
| "big5"
| "big5hkscs"
| "binary"
| "celtic"
| "celtic8"
| "cesu8"
| "chinese"
| "cn"
| "cnbig5"
| "cp1046"
| "cp1124"
| "cp1125"
| "cp1129"
| "cp1133"
| "cp1161"
| "cp1162"
| "cp1163"
| "cp1250"
| "cp1251"
| "cp1252"
| "cp1253"
| "cp1254"
| "cp1255"
| "cp1256"
| "cp1257"
| "cp1258"
| "cp20866"
| "cp21866"
| "cp28591"
| "cp28592"
| "cp28593"
| "cp28594"
| "cp28595"
| "cp28596"
| "cp28597"
| "cp28598"
| "cp28599"
| "cp28600"
| "cp28601"
| "cp28603"
| "cp28604"
| "cp28605"
| "cp28606"
| "cp367"
| "cp437"
| "cp720"
| "cp737"
| "cp775"
| "cp808"
| "cp819"
| "cp850"
| "cp852"
| "cp855"
| "cp856"
| "cp857"
| "cp858"
| "cp860"
| "cp861"
| "cp862"
| "cp863"
| "cp864"
| "cp865"
| "cp866"
| "cp869"
| "cp874"
| "cp922"
| "cp932"
| "cp936"
| "cp949"
| "cp950"
| "cpgr"
| "csascii"
| "csbig5"
| "cseuckr"
| "csgb2312"
| "cshproman8"
| "csibm1046"
| "csibm1124"
| "csibm1125"
| "csibm1129"
| "csibm1133"
| "csibm1161"
| "csibm1162"
| "csibm1163"
| "csibm437"
| "csibm737"
| "csibm775"
| "csibm850"
| "csibm852"
| "csibm855"
| "csibm856"
| "csibm857"
| "csibm858"
| "csibm860"
| "csibm861"
| "csibm862"
| "csibm863"
| "csibm864"
| "csibm865"
| "csibm866"
| "csibm869"
| "csibm922"
| "csiso14jisc6220ro"
| "csiso58gb231280"
| "csisolatin1"
| "csisolatin2"
| "csisolatin3"
| "csisolatin4"
| "csisolatin5"
| "csisolatin6"
| "csisolatinarabic"
| "csisolatincyrillic"
| "csisolatingreek"
| "csisolatinhebrew"
| "cskoi8r"
| "csksc56011987"
| "csmacintosh"
| "cspc775baltic"
| "cspc850multilingual"
| "cspc862latinhebrew"
| "cspc8codepage437"
| "cspcp852"
| "csshiftjis"
| "cyrillic"
| "ecma114"
| "ecma118"
| "elot928"
| "euccn"
| "eucjp"
| "euckr"
| "gb18030"
| "gb198880"
| "gb2312"
| "gb23121980"
| "gb231280"
| "gbk"
| "georgianacademy"
| "georgianps"
| "greek"
| "greek8"
| "hebrew"
| "hebrew8"
| "hex"
| "hproman8"
| "ibm1046"
| "ibm1051"
| "ibm1124"
| "ibm1125"
| "ibm1129"
| "ibm1133"
| "ibm1161"
| "ibm1162"
| "ibm1163"
| "ibm1168"
| "ibm367"
| "ibm437"
| "ibm737"
| "ibm775"
| "ibm808"
| "ibm819"
| "ibm850"
| "ibm852"
| "ibm855"
| "ibm856"
| "ibm857"
| "ibm858"
| "ibm860"
| "ibm861"
| "ibm862"
| "ibm863"
| "ibm864"
| "ibm865"
| "ibm866"
| "ibm869"
| "ibm878"
| "ibm922"
| "iso646cn"
| "iso646irv"
| "iso646jp"
| "iso646us"
| "iso88591"
| "iso885910"
| "iso885911"
| "iso885913"
| "iso885914"
| "iso885915"
| "iso885916"
| "iso88592"
| "iso88593"
| "iso88594"
| "iso88595"
| "iso88596"
| "iso88597"
| "iso88598"
| "iso88598e"
| "iso88598i"
| "iso88599"
| "isoceltic"
| "isoir100"
| "isoir101"
| "isoir109"
| "isoir110"
| "isoir126"
| "isoir127"
| "isoir138"
| "isoir14"
| "isoir144"
| "isoir148"
| "isoir149"
| "isoir157"
| "isoir166"
| "isoir179"
| "isoir199"
| "isoir203"
| "isoir226"
| "isoir57"
| "isoir58"
| "isoir6"
| "jisc62201969ro"
| "jp"
| "koi8r"
| "koi8ru"
| "koi8t"
| "koi8u"
| "korean"
| "ksc5601"
| "ksc56011987"
| "ksc56011989"
| "l1"
| "l10"
| "l2"
| "l3"
| "l4"
| "l5"
| "l6"
| "l7"
| "l8"
| "l9"
| "latin1"
| "latin10"
| "latin2"
| "latin3"
| "latin4"
| "latin5"
| "latin6"
| "latin7"
| "latin8"
| "latin9"
| "mac"
| "maccenteuro"
| "maccroatian"
| "maccyrillic"
| "macgreek"
| "maciceland"
| "macintosh"
| "macroman"
| "macromania"
| "macthai"
| "macturkish"
| "macukraine"
| "mik"
| "ms31j"
| "ms932"
| "ms936"
| "ms949"
| "ms950"
| "msansi"
| "msarab"
| "mscyrl"
| "msee"
| "msgreek"
| "mshebr"
| "mskanji"
| "msturk"
| "pt154"
| "r8"
| "rk1048"
| "roman8"
| "shiftjis"
| "sjis"
| "strk10482002"
| "tcvn"
| "tcvn5712"
| "tcvn57121"
| "thai"
| "thai8"
| "tis620"
| "tis6200"
| "tis62025291"
| "tis62025330"
| "turkish"
| "turkish8"
| "ucs2"
| "ucs4"
| "ucs4be"
| "ucs4le"
| "unicode11utf7"
| "unicode11utf8"
| "us"
| "usascii"
| "utf16"
| "utf16be"
| "utf16le"
| "utf32"
| "utf32be"
| "utf32le"
| "utf7"
| "utf7imap"
| "utf8"
| "viscii"
| "win1250"
| "win1251"
| "win1252"
| "win1253"
| "win1254"
| "win1255"
| "win1256"
| "win1257"
| "win1258"
| "win874"
| "winbaltrim"
| "windows1250"
| "windows1251"
| "windows1252"
| "windows1253"
| "windows1254"
| "windows1255"
| "windows1256"
| "windows1257"
| "windows1258"
| "windows31j"
| "windows874"
| "windows932"
| "windows936"
| "windows949"
| "windows950"
| "xgbk"
| "xroman8"
| "xsjis"
| "xxbig5"
| (string & {})
@@ -0,0 +1,26 @@
'use strict';
function mergeDescriptors(destination, source, overwrite = true) {
if (!destination) {
throw new TypeError('The `destination` argument is required.');
}
if (!source) {
throw new TypeError('The `source` argument is required.');
}
for (const name of Object.getOwnPropertyNames(source)) {
if (!overwrite && Object.hasOwn(destination, name)) {
// Skip descriptor
continue;
}
// Copy descriptor
const descriptor = Object.getOwnPropertyDescriptor(source, name);
Object.defineProperty(destination, name, descriptor);
}
return destination;
}
module.exports = mergeDescriptors;
@@ -0,0 +1,8 @@
import type * as ts from 'typescript/lib/tsserverlibrary';
/**
* Parses a TSConfig file using the same logic as tsserver.
*
* @param configFile the path to the tsconfig.json file, relative to `projectDirectory`
* @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()`
*/
export declare function getParsedConfigFile(tsserver: typeof ts, configFile: string, projectDirectory?: string): ts.ParsedCommandLine;
@@ -0,0 +1,9 @@
import { i as isLeapYear } from "./isLeapYear-G37NadS-.mjs";
const arr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
const arr2 = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function daysOfYear(year) {
return isLeapYear(year) ? arr2 : arr;
}
export {
daysOfYear as d
};
@@ -0,0 +1 @@
{"version":3,"file":"keyboard.js","sources":["../../../src/icons/keyboard.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Keyboard\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgOGguMDEiIC8+CiAgPHBhdGggZD0iTTEyIDEyaC4wMSIgLz4KICA8cGF0aCBkPSJNMTQgOGguMDEiIC8+CiAgPHBhdGggZD0iTTE2IDEyaC4wMSIgLz4KICA8cGF0aCBkPSJNMTggOGguMDEiIC8+CiAgPHBhdGggZD0iTTYgOGguMDEiIC8+CiAgPHBhdGggZD0iTTcgMTZoMTAiIC8+CiAgPHBhdGggZD0iTTggMTJoLjAxIiAvPgogIDxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIxNiIgeD0iMiIgeT0iNCIgcng9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/keyboard\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 Keyboard = createLucideIcon('Keyboard', [\n ['path', { d: 'M10 8h.01', key: '1r9ogq' }],\n ['path', { d: 'M12 12h.01', key: '1mp3jc' }],\n ['path', { d: 'M14 8h.01', key: '1primd' }],\n ['path', { d: 'M16 12h.01', key: '1l6xoz' }],\n ['path', { d: 'M18 8h.01', key: 'emo2bl' }],\n ['path', { d: 'M6 8h.01', key: 'x9i8wu' }],\n ['path', { d: 'M7 16h10', key: 'wp8him' }],\n ['path', { d: 'M8 12h.01', key: 'czm47f' }],\n ['rect', { width: '20', height: '16', x: '2', y: '4', rx: '2', key: '18n3k1' }],\n]);\n\nexport default Keyboard;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,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,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,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,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,5 @@
/**
* Removes everything after the last "/", but leaves the slash.
*/
export default function stripFilename(path: string | undefined | null): string;
//# sourceMappingURL=strip-filename.d.ts.map
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGapWidth = exports.zeroGap = void 0;
exports.zeroGap = {
left: 0,
top: 0,
right: 0,
gap: 0,
};
var parse = function (x) { return parseInt(x || '', 10) || 0; };
var getOffset = function (gapMode) {
var cs = window.getComputedStyle(document.body);
var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
return [parse(left), parse(top), parse(right)];
};
var getGapWidth = function (gapMode) {
if (gapMode === void 0) { gapMode = 'margin'; }
if (typeof window === 'undefined') {
return exports.zeroGap;
}
var offsets = getOffset(gapMode);
var documentWidth = document.documentElement.clientWidth;
var windowWidth = window.innerWidth;
return {
left: offsets[0],
top: offsets[1],
right: offsets[2],
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
};
};
exports.getGapWidth = getGapWidth;
@@ -0,0 +1 @@
{"version":3,"names":["_classApplyDescriptorGet","receiver","descriptor","get","call","value"],"sources":["../../src/helpers/classApplyDescriptorGet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,wBAAwBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACrE,IAAIA,UAAU,CAACC,GAAG,EAAE;IAClB,OAAOD,UAAU,CAACC,GAAG,CAACC,IAAI,CAACH,QAAQ,CAAC;EACtC;EACA,OAAOC,UAAU,CAACG,KAAK;AACzB","ignoreList":[]}
@@ -0,0 +1,168 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://json-schema.org/draft-07/schema#",
"title": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"nonNegativeInteger": {
"type": "integer",
"minimum": 0
},
"nonNegativeIntegerDefault0": {
"allOf": [
{ "$ref": "#/definitions/nonNegativeInteger" },
{ "default": 0 }
]
},
"simpleTypes": {
"enum": [
"array",
"boolean",
"integer",
"null",
"number",
"object",
"string"
]
},
"stringArray": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
"default": []
}
},
"type": ["object", "boolean"],
"properties": {
"$id": {
"type": "string",
"format": "uri-reference"
},
"$schema": {
"type": "string",
"format": "uri"
},
"$ref": {
"type": "string",
"format": "uri-reference"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"default": true,
"readOnly": {
"type": "boolean",
"default": false
},
"examples": {
"type": "array",
"items": true
},
"multipleOf": {
"type": "number",
"exclusiveMinimum": 0
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "number"
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "number"
},
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
"pattern": {
"type": "string",
"format": "regex"
},
"additionalItems": { "$ref": "#" },
"items": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/schemaArray" }
],
"default": true
},
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
"uniqueItems": {
"type": "boolean",
"default": false
},
"contains": { "$ref": "#" },
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" },
"additionalProperties": { "$ref": "#" },
"definitions": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"properties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"propertyNames": { "format": "regex" },
"default": {}
},
"dependencies": {
"type": "object",
"additionalProperties": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/stringArray" }
]
}
},
"propertyNames": { "$ref": "#" },
"const": true,
"enum": {
"type": "array",
"items": true,
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
{ "$ref": "#/definitions/simpleTypes" },
{
"type": "array",
"items": { "$ref": "#/definitions/simpleTypes" },
"minItems": 1,
"uniqueItems": true
}
]
},
"format": { "type": "string" },
"contentMediaType": { "type": "string" },
"contentEncoding": { "type": "string" },
"if": {"$ref": "#"},
"then": {"$ref": "#"},
"else": {"$ref": "#"},
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" }
},
"default": true
}
@@ -0,0 +1 @@
{"version":3,"file":"variable.js","sources":["../../../src/icons/variable.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Variable\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAyMXMtNC0zLTQtOSA0LTkgNC05IiAvPgogIDxwYXRoIGQ9Ik0xNiAzczQgMyA0IDktNCA5LTQgOSIgLz4KICA8bGluZSB4MT0iMTUiIHgyPSI5IiB5MT0iOSIgeTI9IjE1IiAvPgogIDxsaW5lIHgxPSI5IiB4Mj0iMTUiIHkxPSI5IiB5Mj0iMTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/variable\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 Variable = createLucideIcon('Variable', [\n ['path', { d: 'M8 21s-4-3-4-9 4-9 4-9', key: 'uto9ud' }],\n ['path', { d: 'M16 3s4 3 4 9-4 9-4 9', key: '4w2vsq' }],\n ['line', { x1: '15', x2: '9', y1: '9', y2: '15', key: 'f7djnv' }],\n ['line', { x1: '9', x2: '15', y1: '9', y2: '15', key: '1shsy8' }],\n]);\n\nexport default Variable;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAA;AAAA,CACtD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"corner-right-up.js","sources":["../../../src/icons/corner-right-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CornerRightUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxMCA5IDE1IDQgMjAgOSIgLz4KICA8cGF0aCBkPSJNNCAyMGg3YTQgNCAwIDAgMCA0LTRWNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-right-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CornerRightUp = createLucideIcon('CornerRightUp', [\n ['polyline', { points: '10 9 15 4 20 9', key: '1lr6px' }],\n ['path', { d: 'M4 20h7a4 4 0 0 0 4-4V4', key: '1plgdj' }],\n]);\n\nexport default CornerRightUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,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-arrow-right.js';
//# sourceMappingURL=arrow-right-circle.js.map
@@ -0,0 +1,91 @@
{
"name": "ip-address",
"description": "A library for parsing IPv4 and IPv6 IP addresses in node and the browser.",
"keywords": [
"ip",
"ipv4",
"ipv6",
"address",
"cidr",
"subnet",
"netmask",
"validate",
"validation",
"parse",
"arpa",
"bigint",
"browser"
],
"version": "10.7.4",
"author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)",
"license": "MIT",
"main": "dist/ip-address.js",
"types": "dist/ip-address.d.ts",
"scripts": {
"docs": "tsx scripts/build-readme.ts",
"docs:check": "tsx scripts/build-readme.ts --check",
"build": "rm -rf dist; mkdir dist; tsc",
"prepack": "npm run docs && npm run build",
"prepare": "git config core.hooksPath hooks || true",
"lint": "prettier --check . && eslint . --ext .ts,.js --max-warnings 0",
"lint:fix": "prettier --write . && eslint . --ext .ts,.js --max-warnings 0 --fix",
"test-ci": "c8 --experimental-monocart mocha",
"test": "mocha",
"watch": "mocha --watch"
},
"c8": {
"include": [
"src/**/*.ts"
],
"exclude": [
"**/*.d.ts",
"src/ip-address.ts",
"src/v4/constants.ts",
"src/v6/constants.ts"
],
"reporter": [
"html",
"lcov",
"text"
]
},
"engines": {
"node": ">= 12"
},
"sideEffects": false,
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/beaugunderson/ip-address.git"
},
"overrides": {
"diff": "^8.0.3",
"serialize-javascript": "^7.0.5",
"@eslint/plugin-kit": "^0.7.1"
},
"devDependencies": {
"@types/chai": "^5.2.3",
"@types/mocha": "^10.0.10",
"@typescript-eslint/eslint-plugin": "^8.59.1",
"@typescript-eslint/parser": "^8.59.1",
"c8": "^11.0.0",
"chai": "^6.2.2",
"eslint": "^8.57.1",
"eslint_d": "^14.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
"mocha": "^11.7.5",
"monocart-coverage-reports": "^2.12.11",
"prettier": "^3.8.3",
"source-map-support": "^0.5.21",
"tsx": "^4.21.0",
"typedoc": "^0.28.19",
"typescript": "<5.6.0"
}
}
@@ -0,0 +1,119 @@
import { RouterCore } from '@tanstack/router-core'
import { getStoreFactory } from './routerStores'
import type { RouterHistory } from '@tanstack/history'
import type {
AnyRoute,
CreateRouterFn,
RouterConstructorOptions,
TrailingSlashOption,
} from '@tanstack/router-core'
import type {
ErrorRouteComponent,
NotFoundRouteComponent,
RouteComponent,
} from './route'
declare module '@tanstack/router-core' {
export interface RouterOptionsExtensions {
/**
* The default `component` a route should use if no component is provided.
*
* @default Outlet
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultcomponent-property)
*/
defaultComponent?: RouteComponent
/**
* The default `errorComponent` a route should use if no error component is provided.
*
* @default ErrorComponent
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulterrorcomponent-property)
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)
*/
defaultErrorComponent?: ErrorRouteComponent
/**
* The default `pendingComponent` a route should use if no pending component is provided.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingcomponent-property)
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#showing-a-pending-component)
*/
defaultPendingComponent?: RouteComponent
/**
* The default `notFoundComponent` a route should use if no notFound component is provided.
*
* @default NotFound
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultnotfoundcomponent-property)
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#default-router-wide-not-found-handling)
*/
defaultNotFoundComponent?: NotFoundRouteComponent
/**
* A component that will be used to wrap the entire router.
*
* This is useful for providing a context to the entire router.
*
* Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)
*/
Wrap?: (props: { children: any }) => React.JSX.Element
/**
* A component that will be used to wrap the inner contents of the router.
*
* This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.
*
* Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)
*/
InnerWrap?: (props: { children: any }) => React.JSX.Element
/**
* The default `onCatch` handler for errors caught by the Router ErrorBoundary
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)
*/
defaultOnCatch?: (error: Error, errorInfo: React.ErrorInfo) => void
}
}
/**
* Creates a new Router instance for React.
*
* Pass the returned router to `RouterProvider` to enable routing.
* Notable options: `routeTree` (your route definitions) and `context`
* (required if the root route was created with `createRootRouteWithContext`).
*
* @param options Router options used to configure the router.
* @returns A Router instance to be provided to `RouterProvider`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
export const createRouter: CreateRouterFn = (options) => {
return new Router(options)
}
export class Router<
in out TRouteTree extends AnyRoute,
in out TTrailingSlashOption extends TrailingSlashOption = 'never',
in out TDefaultStructuralSharingOption extends boolean = false,
in out TRouterHistory extends RouterHistory = RouterHistory,
in out TDehydrated extends Record<string, any> = Record<string, any>,
> extends RouterCore<
TRouteTree,
TTrailingSlashOption,
TDefaultStructuralSharingOption,
TRouterHistory,
TDehydrated
> {
constructor(
options: RouterConstructorOptions<
TRouteTree,
TTrailingSlashOption,
TDefaultStructuralSharingOption,
TRouterHistory,
TDehydrated
>,
) {
super(options, getStoreFactory)
}
}
@@ -0,0 +1 @@
{"version":3,"file":"sliders.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,27 @@
import type { TSESTree } from '@typescript-eslint/utils';
import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
/**
* Parses a syntactically possible `Promise.then()` call. Does not check the
* type of the callee.
*/
export declare function parseThenCall(node: TSESTree.CallExpression, context: RuleContext<string, unknown[]>): {
onFulfilled?: TSESTree.Expression | undefined;
onRejected?: TSESTree.Expression | undefined;
object: TSESTree.Expression;
} | undefined;
/**
* Parses a syntactically possible `Promise.catch()` call. Does not check the
* type of the callee.
*/
export declare function parseCatchCall(node: TSESTree.CallExpression, context: RuleContext<string, unknown[]>): {
onRejected?: TSESTree.Expression | undefined;
object: TSESTree.Expression;
} | undefined;
/**
* Parses a syntactically possible `Promise.finally()` call. Does not check the
* type of the callee.
*/
export declare function parseFinallyCall(node: TSESTree.CallExpression, context: RuleContext<string, unknown[]>): {
object: TSESTree.Expression;
onFinally?: TSESTree.Expression | undefined;
} | undefined;
@@ -0,0 +1,20 @@
/**
* @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 ListOrdered = createLucideIcon("ListOrdered", [
["path", { d: "M10 12h11", key: "6m4ad9" }],
["path", { d: "M10 18h11", key: "11hvi2" }],
["path", { d: "M10 6h11", key: "c7qv1k" }],
["path", { d: "M4 10h2", key: "16xx2s" }],
["path", { d: "M4 6h1v4", key: "cnovpq" }],
["path", { d: "M6 18H4c0-1 2-2 2-3s-1-1.5-2-1", key: "m9a95d" }]
]);
export { ListOrdered as default };
//# sourceMappingURL=list-ordered.js.map
@@ -0,0 +1,236 @@
import Options from './Options';
import { PasswordChanges } from './matcher/dictionary/variants/matching/unmunger/getCleanPasswords';
import Matching from './Matching';
import { DictionaryReturn } from './matcher/dictionary/scoring';
import { REGEXEN } from './data/const';
import l33tTableDefault from './data/l33tTable';
import translationKeys from './data/translationKeys';
export type PluralizationFunction = (value: number) => string;
export interface TranslationKeys {
warnings: {
[key in keyof typeof translationKeys.warnings]: string;
};
suggestions: {
[key in keyof typeof translationKeys.suggestions]: string;
};
timeEstimation: {
[key in keyof typeof translationKeys.timeEstimation]: key extends 'ltSecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'centuries' ? string : string | PluralizationFunction;
};
}
export type L33tTableDefault = typeof l33tTableDefault;
export type LooseObject = Record<string, any>;
export type Pattern = 'dictionary' | 'spatial' | 'repeat' | 'sequence' | 'wordSequence' | 'regex' | 'date' | 'bruteforce' | 'separator' | string;
export type DictionaryNames = 'passwords' | 'commonWords' | 'firstnames' | 'lastnames' | 'wikipedia' | 'userInputs';
export interface Match {
/**
* @description The name of the matcher
*/
pattern: Pattern;
/**
* @description The start index of the token found in the password
*/
i: number;
/**
@description The end index of the token found in the password
*/
j: number;
/**
* @description The token found in the password
*/
token: string;
[key: string]: any;
}
export interface DictionaryMatch extends Match {
pattern: 'dictionary';
matchedWord: string;
rank: number;
dictionaryName: DictionaryNames | string;
reversed: boolean;
l33t: boolean;
}
export interface L33tMatch extends DictionaryMatch {
subs: PasswordChanges[];
subDisplay: string;
}
export interface SpatialMatch extends Match {
pattern: 'spatial';
graph: string;
turns: number;
shiftedCount: number;
}
export interface RepeatMatch extends Match {
pattern: 'repeat';
baseToken: string | string[];
baseGuesses: number;
repeatCount: number;
}
export interface SequenceMatch extends Match {
pattern: 'sequence';
sequenceName: string;
sequenceSpace: number;
ascending: boolean;
}
export interface RegexMatch extends Match {
pattern: 'regex';
regexName: keyof typeof REGEXEN;
regexMatch: string[];
}
export interface DateMatch extends Match {
pattern: 'date';
separator: string;
year: number;
month: number;
day: number;
}
export interface BruteForceMatch extends Match {
pattern: 'bruteforce';
}
export interface SeparatorMatch extends Match {
pattern: 'separator';
}
export interface WordSequenceMatch extends Match {
pattern: 'wordSequence';
words: string[];
wordCount: number;
dictionaryName: string;
ascending: boolean;
}
export type MatchExtended = DictionaryMatch | L33tMatch | SpatialMatch | RepeatMatch | SequenceMatch | WordSequenceMatch | RegexMatch | DateMatch | BruteForceMatch | SeparatorMatch | Match;
export interface Estimate {
guesses: number;
guessesLog10: number;
baseGuesses?: number;
uppercaseVariations?: number;
l33tVariations?: number;
}
export type MatchEstimated = MatchExtended & Estimate;
export interface Optimal {
bestMatches: Record<string, MatchEstimated>[];
guessesProduct: Record<string, number>[];
totalGuesses: Record<string, number>[];
}
export interface CrackTime {
base: number | null;
seconds: number;
display: string;
}
export interface CrackTimes {
onlineThrottlingXPerHour: CrackTime;
onlineNoThrottlingXPerSecond: CrackTime;
offlineSlowHashingXPerSecond: CrackTime;
offlineFastHashingXPerSecond: CrackTime;
}
export interface CrackTimesSeconds {
onlineThrottlingXPerHour: number;
onlineNoThrottlingXPerSecond: number;
offlineSlowHashingXPerSecond: number;
offlineFastHashingXPerSecond: number;
}
export interface FeedbackType {
warning: string | null;
suggestions: string[];
}
export type OptionsL33tTable = L33tTableDefault | Record<string, string[]>;
export type OptionsDictionary = Record<string, (string | number)[]>;
export type OptionsGraphEntry = Record<string, (string | null)[]>;
export type OptionsGraph = Record<string, OptionsGraphEntry>;
export interface TimeEstimationValues {
scoring: {
0: number;
1: number;
2: number;
3: number;
};
attackTime: {
onlineThrottlingXPerHour: number;
onlineNoThrottlingXPerSecond: number;
offlineSlowHashingXPerSecond: number;
offlineFastHashingXPerSecond: number;
};
}
export interface OptionsType {
/**
* @description Defines an object with a key value match to translate the feedback given by this library. The default values are plain keys so that you can use your own i18n library. Already implemented language can be found with something like @zxcvbn-ts/language-en.
*/
translations?: TranslationKeys;
/**
* @description Defines keyboard layouts as an object which are used to find sequences. Already implemented layouts can be found in @zxcvbn-ts/language-common
*/
graphs?: OptionsGraph;
/**
* @description Define an object with l33t substitutions. For example that an "a" can be exchanged with a "4" or a "@".
*/
l33tTable?: OptionsL33tTable;
/**
* @description Define dictionary that should be used to check against. The matcher will search the dictionaries for similar password with l33t speak and reversed words. The recommended sets are found in @zxcvbn-ts/language-common and @zxcvbn-ts/language-en.
*/
dictionary?: OptionsDictionary;
/**
* @description Defines if the levenshtein algorithm should be used. This will be only used on the complete password and not on parts of it. This will decrease the calcTime a bit but will significantly improve the password check. The recommended sets are found in @zxcvbn-ts/language-common and @zxcvbn-ts/language-en.
* @default false
*/
useLevenshteinDistance?: boolean;
/**
* @description Defines how many characters can be different to match a dictionary word with the levenshtein algorithm.
* @default 2
*/
levenshteinThreshold?: number;
/**
* @description The l33t matcher will check how many characters can be exchanged with the l33t table. If they are to many it will decrease the calcTime significantly. So we cap it at a reasonable value by default which will probably already seems like a strong password anyway.
* @default 100
*/
l33tMaxSubstitutions?: number;
/**
* @description Defines how many character of the password are checked. A password longer than the default are considered strong anyway, but it can be increased as pleased. Be aware that this could open some attack vectors.
* @default 256
*/
maxLength?: number;
/**
* @description Define the values to calculate the scoring and attack times. DO NOT CHANGE unless you know what you are doing. The default values are just fine as long as you are using a strong, slow hash function. Can be adjusted to account for increasingly powerful attacker hardware.
*/
timeEstimationValues?: TimeEstimationValues;
}
export type RankedDictionary = Record<string, number>;
export type RankedDictionaries = Record<string, RankedDictionary>;
export type DefaultFeedbackFunction = (options: Options, match: MatchEstimated, isSoleMatch?: boolean) => FeedbackType | null;
export type DefaultScoringFunction = (match: MatchExtended | MatchEstimated, options: Options) => number | DictionaryReturn;
export interface UserInputsOptions {
rankedDictionary: RankedDictionary;
rankedDictionaryMaxWordSize: number;
}
export interface MatchOptions {
password: string;
/**
* @description This is the original Matcher so that one can use other matchers to define a baseGuess. An usage example is the repeat matcher
*/
omniMatch: Matching;
userInputsOptions?: UserInputsOptions;
}
export declare abstract class MatcherBaseClass {
protected options: Options;
constructor(options: Options);
abstract match(matchOptions: MatchOptions): MatchExtended[] | Promise<MatchExtended[]>;
}
export type MatcherConstructor<T extends MatcherBaseClass = MatcherBaseClass> = new (options: Options) => T;
export interface Matcher {
feedback: DefaultFeedbackFunction;
scoring: DefaultScoringFunction;
Matching: MatcherConstructor;
}
export type Matchers = Record<string, Matcher>;
export type Score = 0 | 1 | 2 | 3 | 4;
export interface DictionaryScoringExtras {
baseGuesses: number;
uppercaseVariations: number;
l33tVariations: number;
}
export interface ZxcvbnResult {
feedback: FeedbackType;
crackTimes: CrackTimes;
score: Score;
password: string;
guesses: number;
guessesLog10: number;
sequence: MatchExtended[];
calcTime: number;
}
@@ -0,0 +1,123 @@
"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;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomUtils = exports.getFeed = exports.ElementType = exports.QuoteType = exports.Tokenizer = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0;
exports.parseDocument = parseDocument;
exports.parseDOM = parseDOM;
exports.createDocumentStream = createDocumentStream;
exports.createDomStream = createDomStream;
exports.parseFeed = parseFeed;
const Parser_js_1 = require("./Parser.js");
var Parser_js_2 = require("./Parser.js");
Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_js_2.Parser; } });
const domhandler_1 = require("domhandler");
var domhandler_2 = require("domhandler");
Object.defineProperty(exports, "DomHandler", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });
// Old name for DomHandler
Object.defineProperty(exports, "DefaultHandler", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });
// Helper methods
/**
* Parses the data, returns the resulting document.
*
* @param data The data that should be parsed.
* @param options Optional options for the parser and DOM handler.
*/
function parseDocument(data, options) {
const handler = new domhandler_1.DomHandler(undefined, options);
new Parser_js_1.Parser(handler, options).end(data);
return handler.root;
}
/**
* Parses data, returns an array of the root nodes.
*
* Note that the root nodes still have a `Document` node as their parent.
* Use `parseDocument` to get the `Document` node instead.
*
* @param data The data that should be parsed.
* @param options Optional options for the parser and DOM handler.
* @deprecated Use `parseDocument` instead.
*/
function parseDOM(data, options) {
return parseDocument(data, options).children;
}
/**
* Creates a parser instance, with an attached DOM handler.
*
* @param callback A callback that will be called once parsing has been completed, with the resulting document.
* @param options Optional options for the parser and DOM handler.
* @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.
*/
function createDocumentStream(callback, options, elementCallback) {
const handler = new domhandler_1.DomHandler((error) => callback(error, handler.root), options, elementCallback);
return new Parser_js_1.Parser(handler, options);
}
/**
* Creates a parser instance, with an attached DOM handler.
*
* @param callback A callback that will be called once parsing has been completed, with an array of root nodes.
* @param options Optional options for the parser and DOM handler.
* @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.
* @deprecated Use `createDocumentStream` instead.
*/
function createDomStream(callback, options, elementCallback) {
const handler = new domhandler_1.DomHandler(callback, options, elementCallback);
return new Parser_js_1.Parser(handler, options);
}
var Tokenizer_js_1 = require("./Tokenizer.js");
Object.defineProperty(exports, "Tokenizer", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });
Object.defineProperty(exports, "QuoteType", { enumerable: true, get: function () { return Tokenizer_js_1.QuoteType; } });
/*
* All of the following exports exist for backwards-compatibility.
* They should probably be removed eventually.
*/
exports.ElementType = __importStar(require("domelementtype"));
const domutils_1 = require("domutils");
var domutils_2 = require("domutils");
Object.defineProperty(exports, "getFeed", { enumerable: true, get: function () { return domutils_2.getFeed; } });
const parseFeedDefaultOptions = { xmlMode: true };
/**
* Parse a feed.
*
* @param feed The feed that should be parsed, as a string.
* @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.
*/
function parseFeed(feed, options = parseFeedDefaultOptions) {
return (0, domutils_1.getFeed)(parseDOM(feed, options));
}
exports.DomUtils = __importStar(require("domutils"));
//# sourceMappingURL=index.js.map
@@ -0,0 +1,77 @@
{
"name": "side-channel-list",
"version": "1.0.1",
"description": "Store information about any JS value in a side channel, using a linked list",
"main": "index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc -p . && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"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)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/side-channel-list.git"
},
"keywords": [],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/side-channel-list/issues"
},
"homepage": "https://github.com/ljharb/side-channel-list#readme",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.4"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@ljharb/eslint-config": "^22.2.2",
"@ljharb/tsconfig": "^0.3.2",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.8.1",
"auto-changelog": "^2.5.0",
"eclint": "^2.8.1",
"encoding": "^0.1.13",
"eslint": "^8.57.1",
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"npmignore": "^0.3.5",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,3 @@
# `react-collection`
This is an internal utility, not intended for public usage.
@@ -0,0 +1,40 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("passing validations", () => {
const example1 = z.custom<number>((x) => typeof x === "number");
example1.parse(1234);
expect(() => example1.parse({})).toThrow();
});
test("string params", () => {
const example1 = z.custom<number>((x) => typeof x !== "number", "customerr");
const result = example1.safeParse(1234);
expect(result.success).toEqual(false);
expect(JSON.stringify(result.error).includes("customerr")).toEqual(true);
});
test("instanceof", () => {
const fn = (value: string) => Uint8Array.from(Buffer.from(value, "base64"));
// Argument of type 'ZodCustom<Uint8Array<ArrayBuffer>, unknown>' is not assignable to parameter of type '$ZodType<any, Uint8Array<ArrayBuffer>>'.
z.string().transform(fn).pipe(z.instanceof(Uint8Array));
});
test("non-continuable by default", () => {
const A = z
.custom<string>((val) => typeof val === "string")
.transform((_) => {
throw new Error("Invalid input");
});
expect(A.safeParse(123).error!).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"message": "Invalid input"
}
]]
`);
});
@@ -0,0 +1 @@
{"version":3,"file":"umbrella-off.js","sources":["../../../src/icons/umbrella-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UmbrellaOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMnYxIiAvPgogIDxwYXRoIGQ9Ik0xNS41IDIxYTEuODUgMS44NSAwIDAgMS0zLjUtMXYtOEgyYTEwIDEwIDAgMCAxIDMuNDI4LTYuNTc1IiAvPgogIDxwYXRoIGQ9Ik0xNy41IDEySDIyQTEwIDEwIDAgMCAwIDkuMDA0IDMuNDU1IiAvPgogIDxwYXRoIGQ9Im0yIDIgMjAgMjAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/umbrella-off\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 UmbrellaOff = createLucideIcon('UmbrellaOff', [\n ['path', { d: 'M12 2v1', key: '11qlp1' }],\n ['path', { d: 'M15.5 21a1.85 1.85 0 0 1-3.5-1v-8H2a10 10 0 0 1 3.428-6.575', key: 'eki10q' }],\n ['path', { d: 'M17.5 12H22A10 10 0 0 0 9.004 3.455', key: 'n2ayka' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n]);\n\nexport default UmbrellaOff;\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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC5F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,74 @@
/**
* @fileoverview Rule to disallow use of the new operator with the `Symbol` object
* @author Alberto Rodríguez
* @deprecated in ESLint v9.0.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow `new` operators with the `Symbol` object",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-new-symbol",
},
deprecated: {
message: "The rule was replaced with a more general rule.",
url: "https://eslint.org/docs/latest/use/migrate-to-9.0.0#eslint-recommended",
deprecatedSince: "9.0.0",
availableUntil: "11.0.0",
replacedBy: [
{
rule: {
name: "no-new-native-nonconstructor",
url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor",
},
},
],
},
schema: [],
messages: {
noNewSymbol: "`Symbol` cannot be called as a constructor.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
"Program:exit"(node) {
const globalScope = sourceCode.getScope(node);
const variable = globalScope.set.get("Symbol");
if (variable && variable.defs.length === 0) {
variable.references.forEach(ref => {
const idNode = ref.identifier;
const parent = idNode.parent;
if (
parent &&
parent.type === "NewExpression" &&
parent.callee === idNode
) {
context.report({
node: idNode,
messageId: "noNewSymbol",
});
}
});
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/v6/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,GAAG,CAAC;AACX,QAAA,MAAM,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACU,QAAA,MAAM,GAA0C;IAC3D,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,iBAAiB;IACpB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,aAAa;IAChB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,oBAAoB;IACvB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;CACN,CAAC;AAEX;;;;GAIG;AACU,QAAA,KAAK,GAA0C;IAC1D,aAAa,EAAE,yCAAyC;IACxD,aAAa,EAAE,2CAA2C;IAC1D,aAAa,EAAE,oCAAoC;IACnD,aAAa,EAAE,sCAAsC;IACrD,aAAa,EAAE,sCAAsC;IACrD,aAAa,EAAE,mCAAmC;IAClD,aAAa,EAAE,kCAAkC;IACjD,aAAa,EAAE,yBAAyB;IACxC,aAAa,EAAE,2BAA2B;IAC1C,aAAa,EAAE,yBAAyB;IACxC,cAAc,EAAE,2BAA2B;IAC3C,cAAc,EAAE,oBAAoB;IACpC,cAAc,EAAE,oBAAoB;IACpC,cAAc,EAAE,oBAAoB;IACpC,eAAe,EAAE,4DAA4D;IAC7E,eAAe,EAAE,4DAA4D;IAC7E,eAAe,EAAE,2CAA2C;IAC5D,eAAe,EAAE,2CAA2C;IAC5D,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,UAAU;IACrB,eAAe,EAAE,aAAa;IAC9B,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,oBAAoB;IACjC,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,QAAQ;IACrB,aAAa,EAAE,cAAc;IAC7B,WAAW,EAAE,MAAM;IACnB,eAAe,EAAE,eAAe;IAChC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,iCAAiC;IAC9C,OAAO,EAAE,8BAA8B;IACvC,cAAc,EAAE,oBAAoB;IACpC,gBAAgB,EAAE,mBAAmB;CAC7B,CAAC;AAEX;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD;;;;GAIG;AACU,QAAA,cAAc,GAAG,0CAA0C,CAAC;AAEzE;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AAEnD;;;;;;;GAOG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC;AAExB,QAAA,MAAM,GAAG,oDAAoD,CAAC;AAC9D,QAAA,gBAAgB,GAAG,+CAA+C,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACU,QAAA,eAAe,GAA6D;IACvF,CAAC,SAAS,EAAE,kBAAkB,EAAE,KAAK,CAAC;IACtC,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,CAAC;IACxC,CAAC,eAAe,EAAE,qBAAqB,EAAE,KAAK,CAAC;IAC/C,CAAC,cAAc,EAAE,qBAAqB,EAAE,IAAI,CAAC;IAC7C,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,KAAK,CAAC;IAChD,CAAC,UAAU,EAAE,4BAA4B,EAAE,KAAK,CAAC;IACjD,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,KAAK,CAAC;IAC9C,CAAC,WAAW,EAAE,2BAA2B,EAAE,KAAK,CAAC;IACjD,CAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,CAAC;IAC9B,CAAC,eAAe,EAAE,+BAA+B,EAAE,IAAI,CAAC;IACxD,CAAC,eAAe,EAAE,2CAA2C,EAAE,IAAI,CAAC;IACpE,CAAC,eAAe,EAAE,8CAA8C,EAAE,IAAI,CAAC;IACvE,CAAC,aAAa,EAAE,cAAc,EAAE,KAAK,CAAC;IACtC,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC;IAC5B,CAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC;IACrC,CAAC,cAAc,EAAE,gCAAgC,EAAE,IAAI,CAAC;IACxD,CAAC,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC;IAClC,CAAC,cAAc,EAAE,oDAAoD,EAAE,IAAI,CAAC;IAC5E,CAAC,eAAe,EAAE,eAAe,EAAE,KAAK,CAAC;IACzC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC;IAC5B,CAAC,mBAAmB,EAAE,iCAAiC,EAAE,IAAI,CAAC;IAC9D,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,CAAC;IACrC,CAAC,WAAW,EAAE,6BAA6B,EAAE,KAAK,CAAC;IACnD,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC;IACnC,CAAC,WAAW,EAAE,oBAAoB,EAAE,KAAK,CAAC;CAC3C,CAAC","sourcesContent":["export const BITS = 128;\nexport const GROUPS = 8;\n\n/**\n * Represents IPv6 address scopes\n * @memberof Address6\n * @static\n */\nexport const SCOPES: { [key: number]: string | undefined } = {\n 0: 'Reserved',\n 1: 'Interface local',\n 2: 'Link local',\n 4: 'Admin local',\n 5: 'Site local',\n 8: 'Organization local',\n 14: 'Global',\n 15: 'Reserved',\n} as const;\n\n/**\n * Represents IPv6 address types\n * @memberof Address6\n * @static\n */\nexport const TYPES: { [key: string]: string | undefined } = {\n 'ff01::1/128': 'Multicast (All nodes on this interface)',\n 'ff01::2/128': 'Multicast (All routers on this interface)',\n 'ff02::1/128': 'Multicast (All nodes on this link)',\n 'ff02::2/128': 'Multicast (All routers on this link)',\n 'ff05::2/128': 'Multicast (All routers in this site)',\n 'ff02::5/128': 'Multicast (OSPFv3 AllSPF routers)',\n 'ff02::6/128': 'Multicast (OSPFv3 AllDR routers)',\n 'ff02::9/128': 'Multicast (RIP routers)',\n 'ff02::a/128': 'Multicast (EIGRP routers)',\n 'ff02::d/128': 'Multicast (PIM routers)',\n 'ff02::16/128': 'Multicast (MLDv2 reports)',\n 'ff01::fb/128': 'Multicast (mDNSv6)',\n 'ff02::fb/128': 'Multicast (mDNSv6)',\n 'ff05::fb/128': 'Multicast (mDNSv6)',\n 'ff02::1:2/128': 'Multicast (All DHCP servers and relay agents on this link)',\n 'ff05::1:2/128': 'Multicast (All DHCP servers and relay agents in this site)',\n 'ff02::1:3/128': 'Multicast (All DHCP servers on this link)',\n 'ff05::1:3/128': 'Multicast (All DHCP servers in this site)',\n '::/128': 'Unspecified',\n '::1/128': 'Loopback',\n '::ffff:0:0/96': 'IPv4-mapped',\n 'ff00::/8': 'Multicast',\n 'fe80::/10': 'Link-local unicast',\n 'fc00::/7': 'Unique local',\n '2001::/32': 'Teredo',\n '2001:2::/48': 'Benchmarking',\n '2002::/16': '6to4',\n '2001:db8::/32': 'Documentation',\n '3fff::/20': 'Documentation',\n '100::/64': 'Discard-only',\n 'fec0::/10': 'Site-local unicast (deprecated)',\n '::/96': 'IPv4-compatible (deprecated)',\n '64:ff9b::/96': 'NAT64 (well-known)',\n '64:ff9b:1::/48': 'NAT64 (local-use)',\n} as const;\n\n/**\n * A regular expression that matches bad characters in an IPv6 address\n * @memberof Address6\n * @static\n */\nexport const RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi;\n\n/**\n * A regular expression that matches an incorrect IPv6 address\n * @memberof Address6\n * @static\n */\nexport const RE_BAD_ADDRESS = /Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
@@ -0,0 +1,82 @@
{
"name": "@typescript-eslint/type-utils",
"version": "8.58.2",
"description": "Type utilities for working with TypeScript + ESLint together",
"files": [
"dist",
"!**/*.tsbuildinfo",
"package.json",
"README.md",
"LICENSE"
],
"type": "commonjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
"directory": "packages/type-utils"
},
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"keywords": [
"eslint",
"typescript",
"estree"
],
"dependencies": {
"debug": "^4.4.3",
"ts-api-utils": "^2.5.0",
"@typescript-eslint/typescript-estree": "8.58.2",
"@typescript-eslint/utils": "8.58.2",
"@typescript-eslint/types": "8.58.2"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
},
"devDependencies": {
"@types/babel__code-frame": "^7.0.6",
"@vitest/coverage-v8": "^4.0.18",
"ajv": "^6.12.6",
"eslint": "^10.0.0",
"rimraf": "^5.0.10",
"typescript": ">=4.8.4 <6.1.0",
"vitest": "^4.0.18",
"@typescript-eslint/parser": "8.58.2"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"nx": {
"name": "type-utils",
"includedScripts": [
"clean"
],
"targets": {
"lint": {
"command": "eslint"
}
}
},
"scripts": {
"build": "pnpm exec nx build",
"clean": "rimraf dist/ coverage/",
"format": "pnpm -w run format",
"lint": "pnpm -w exec nx lint",
"test": "pnpm -w exec nx test",
"typecheck": "pnpm -w exec nx typecheck"
}
}
@@ -0,0 +1,13 @@
Copyright (c) 2017, Emil Bay <github@tixz.dk>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,27 @@
import { flattenedDecrypt } from '../flattened/decrypt.js';
import { JWEInvalid } from '../../util/errors.js';
import { decoder } from '../../lib/buffer_utils.js';
export async function compactDecrypt(jwe, key, options) {
if (jwe instanceof Uint8Array) {
jwe = decoder.decode(jwe);
}
if (typeof jwe !== 'string') {
throw new JWEInvalid('Compact JWE must be a string or Uint8Array');
}
const { 0: protectedHeader, 1: encryptedKey, 2: iv, 3: ciphertext, 4: tag, length, } = jwe.split('.');
if (length !== 5) {
throw new JWEInvalid('Invalid Compact JWE');
}
const decrypted = await flattenedDecrypt({
ciphertext,
iv: iv || undefined,
protected: protectedHeader,
tag: tag || undefined,
encrypted_key: encryptedKey || undefined,
}, key, options);
const result = { plaintext: decrypted.plaintext, protectedHeader: decrypted.protectedHeader };
if (typeof key === 'function') {
return { ...result, key: decrypted.key };
}
return result;
}
@@ -0,0 +1,14 @@
import { n as normalizeUnit } from "./normalizeUnit-bp5SODxw.mjs";
import parse from "./parse.mjs";
import startOf from "./startOf.mjs";
function isAfter(date, input, unit) {
unit = normalizeUnit(unit);
const inputMs = +parse(input);
if (!unit) {
return +date > inputMs;
}
return +startOf(new Date(date), unit) > inputMs;
}
export {
isAfter as default
};
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FolderOpen = createLucideIcon("FolderOpen", [
[
"path",
{
d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
key: "usdka0"
}
]
]);
export { FolderOpen as default };
//# sourceMappingURL=folder-open.js.map
@@ -0,0 +1,50 @@
//#region src/compose.ts
/**
* Compose middleware functions into a single function based on `koa-compose` package.
*
* @template E - The environment type.
*
* @param {[[Function, unknown], unknown][] | [[Function]][]} middleware - An array of middleware functions and their corresponding parameters.
* @param {ErrorHandler<E>} [onError] - An optional error handler function.
* @param {NotFoundHandler<E>} [onNotFound] - An optional not-found handler function.
*
* @returns {(context: Context, next?: Next) => Promise<Context>} - A composed middleware function.
*/
const compose = (middleware, onError, onNotFound) => {
return (context, next) => {
let index = -1;
return dispatch(0);
/**
* Dispatch the middleware functions.
*
* @param {number} i - The current index in the middleware array.
*
* @returns {Promise<Context>} - A promise that resolves to the context.
*/
async function dispatch(i) {
if (i <= index) throw new Error("next() called multiple times");
index = i;
let res;
let isError = false;
let handler;
if (middleware[i]) {
handler = middleware[i][0][0];
context.req.routeIndex = i;
} else handler = i === middleware.length && next || void 0;
if (handler) try {
res = await handler(context, () => dispatch(i + 1));
} catch (err) {
if (err instanceof Error && onError) {
context.error = err;
res = await onError(err, context);
isError = true;
} else throw err;
}
else if (context.finalized === false && onNotFound) res = await onNotFound(context);
if (res && (context.finalized === false || isError)) context.res = res;
return context;
}
};
};
//#endregion
export { compose };
@@ -0,0 +1,239 @@
import { type Pbkdf2Opt } from './pbkdf2.ts';
import {
abytes,
ahash,
anumber,
checkOpts,
kdfInputToBytes,
type CHash,
type KDFInput,
type TArg,
type TRet,
} from './utils.ts';
function _subtle(): typeof crypto.subtle {
const cr = typeof globalThis === 'object' ? (globalThis as any).crypto : null;
const sb = cr?.subtle;
if (typeof sb === 'object' && sb != null) return sb;
throw new Error('crypto.subtle must be defined');
}
/** Callable WebCrypto hash function descriptor. */
export type WebHash = {
/**
* Hashes one message with the selected WebCrypto digest.
* @param msg - message bytes to hash
* @returns Promise resolving to digest bytes.
*/
(msg: TArg<Uint8Array>): Promise<TRet<Uint8Array>>;
/** WebCrypto algorithm name passed to `crypto.subtle`. */
webCryptoName: string;
/** Digest size in bytes. */
outputLen: number;
/** Input block size in bytes. */
blockLen: number;
};
function createWebHash(name: string, blockLen: number, outputLen: number): TRet<WebHash> {
const hashC: any = async (msg: TArg<Uint8Array>): Promise<TRet<Uint8Array>> => {
abytes(msg);
const crypto = _subtle();
return new Uint8Array(await crypto.digest(name, msg as BufferSource)) as TRet<Uint8Array>;
};
hashC.webCryptoName = name; // make sure it won't interfere with function name
hashC.outputLen = outputLen;
hashC.blockLen = blockLen;
hashC.create = () => {
// Present only so this async wrapper satisfies the shared
// hash-wrapper shape checked by `ahashWeb()`.
throw new Error('not implemented');
};
// Later WebCrypto HMAC/HKDF/PBKDF2 calls read descriptor metadata directly, so freezing prevents
// callers from retargeting a `sha256` wrapper into a different backend digest by mutation.
return Object.freeze(hashC) as TRet<WebHash>;
}
function ahashWeb(hash: TArg<WebHash>) {
ahash(hash as unknown as TArg<CHash>);
if (typeof hash.webCryptoName !== 'string') throw new Error('non-web hash');
}
/** WebCrypto SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */
// export const sha1: WebHash = createHash('SHA-1', 64, 20);
/**
* WebCrypto SHA2-256 hash function from RFC 6234.
* @param msg - message bytes to hash
* @returns Promise resolving to digest bytes.
* @example
* Hash a message with WebCrypto SHA2-256.
* ```ts
* await sha256(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha256: TRet<WebHash> = /* @__PURE__ */ createWebHash('SHA-256', 64, 32);
/**
* WebCrypto SHA2-384 hash function from RFC 6234.
* @param msg - message bytes to hash
* @returns Promise resolving to digest bytes.
* @example
* Hash a message with WebCrypto SHA2-384.
* ```ts
* await sha384(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha384: TRet<WebHash> = /* @__PURE__ */ createWebHash('SHA-384', 128, 48);
/**
* WebCrypto SHA2-512 hash function from RFC 6234.
* @param msg - message bytes to hash
* @returns Promise resolving to digest bytes.
* @example
* Hash a message with WebCrypto SHA2-512.
* ```ts
* await sha512(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha512: TRet<WebHash> = /* @__PURE__ */ createWebHash('SHA-512', 128, 64);
/**
* WebCrypto HMAC: RFC2104 message authentication code.
* @param hash - function that would be used e.g. sha256. Webcrypto version.
* @param key - authentication key bytes
* @param message - message bytes to authenticate
* @returns Promise resolving to authentication tag bytes.
* `.create()` exists only to mirror the synchronous API surface
* and always throws `not implemented`.
* @example
* Compute an RFC 2104 HMAC with WebCrypto.
* ```ts
* import { hmac, sha256 } from '@noble/hashes/webcrypto.js';
* await hmac(sha256, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]));
* ```
*/
type WebHmacFn = {
(
hash: TArg<WebHash>,
key: TArg<Uint8Array>,
message: TArg<Uint8Array>
): Promise<TRet<Uint8Array>>;
create(hash: TArg<WebHash>, key: TArg<Uint8Array>): any;
};
export const hmac: TRet<WebHmacFn> = /* @__PURE__ */ (() => {
const hmac_ = async (
hash: TArg<WebHash>,
key: TArg<Uint8Array>,
message: TArg<Uint8Array>
): Promise<TRet<Uint8Array>> => {
const crypto = _subtle();
abytes(key, undefined, 'key');
abytes(message, undefined, 'message');
ahashWeb(hash);
// WebCrypto keys can't be zeroized
// prettier-ignore
const wkey = await crypto.importKey(
'raw',
key as BufferSource,
{ name: 'HMAC', hash: hash.webCryptoName },
false,
['sign']
);
return new Uint8Array(
await crypto.sign('HMAC', wkey, message as BufferSource)
) as TRet<Uint8Array>;
};
hmac_.create = (_hash: TArg<WebHash>, _key: TArg<Uint8Array>) => {
throw new Error('not implemented');
};
return hmac_ as TRet<WebHmacFn>;
})();
/**
* WebCrypto HKDF (RFC 5869): derive keys from an initial input.
* Combines hkdf_extract + hkdf_expand in one step
* @param hash - hash function that would be used (e.g. sha256). Webcrypto version.
* @param ikm - input keying material, the initial key
* @param salt - optional salt value (a non-secret random value)
* @param info - optional context and application specific information bytes
* @param length - length of output keying material in bytes.
* RFC 5869 §2.3 allows `0..255*HashLen`, so `0` requests an empty OKM.
* @returns Promise resolving to derived key bytes.
* The RFC `L <= 255 * HashLen` bound is currently enforced only by backend
* `deriveBits()` rejection, not by an explicit library-side guard.
* @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
* @example
* WebCrypto HKDF (RFC 5869): derive keys from an initial input.
* ```ts
* import { hkdf, sha256 } from '@noble/hashes/webcrypto.js';
* import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
* const inputKey = randomBytes(32);
* const salt = randomBytes(32);
* const info = utf8ToBytes('application-key');
* const okm = await hkdf(sha256, inputKey, salt, info, 32);
* ```
*/
export async function hkdf(
hash: TArg<WebHash>,
ikm: TArg<Uint8Array>,
salt: TArg<Uint8Array | undefined>,
info: TArg<Uint8Array | undefined>,
length: number
): Promise<TRet<Uint8Array>> {
const crypto = _subtle();
ahashWeb(hash);
abytes(ikm, undefined, 'ikm');
anumber(length, 'length');
if (salt !== undefined) abytes(salt, undefined, 'salt');
if (info !== undefined) abytes(info, undefined, 'info');
const wkey = await crypto.importKey('raw', ikm as BufferSource, 'HKDF', false, ['deriveBits']);
const opts = {
name: 'HKDF',
hash: hash.webCryptoName,
salt: salt === undefined ? new Uint8Array(0) : salt,
info: info === undefined ? new Uint8Array(0) : info,
};
return new Uint8Array(await crypto.deriveBits(opts, wkey, 8 * length)) as TRet<Uint8Array>;
}
/**
* WebCrypto PBKDF2-HMAC: RFC 8018 key derivation function.
* @param hash - hash function that would be used e.g. sha256. Webcrypto version.
* @param password - password from which a derived key is generated; string
* inputs are normalized through `kdfInputToBytes()`, i.e. UTF-8
* @param salt - cryptographic salt; string inputs are normalized through
* `kdfInputToBytes()`, i.e. UTF-8
* @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,
* must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.
* @returns Promise resolving to derived key bytes.
* Positive-iteration enforcement is currently delegated to backend
* `deriveBits()` rejection (for example `c = 0`), not a dedicated
* library-side guard.
* @throws If the current runtime does not provide `crypto.subtle`. {@link Error}
* @example
* WebCrypto PBKDF2-HMAC: RFC 2898 key derivation function.
* ```ts
* import { pbkdf2, sha256 } from '@noble/hashes/webcrypto.js';
* const key = await pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });
* ```
*/
export async function pbkdf2(
hash: TArg<WebHash>,
password: TArg<KDFInput>,
salt: TArg<KDFInput>,
opts: Pbkdf2Opt
): Promise<TRet<Uint8Array>> {
const crypto = _subtle();
ahashWeb(hash);
const _opts = checkOpts({ dkLen: 32 }, opts);
const { c, dkLen } = _opts;
anumber(c, 'c');
anumber(dkLen, 'dkLen');
// RFC 8018 §5.2 defines dkLen as a positive integer.
if (dkLen < 1) throw new Error('"dkLen" must be >= 1');
const _password = kdfInputToBytes(password, 'password');
const _salt = kdfInputToBytes(salt, 'salt');
const key = await crypto.importKey('raw', _password as BufferSource, 'PBKDF2', false, [
'deriveBits',
]);
const deriveOpts = { name: 'PBKDF2', salt: _salt, iterations: c, hash: hash.webCryptoName };
return new Uint8Array(await crypto.deriveBits(deriveOpts, key, 8 * dkLen)) as TRet<Uint8Array>;
}
@@ -0,0 +1,48 @@
import { getNonce } from 'get-nonce';
function makeStyleTag() {
if (!document)
return null;
const tag = document.createElement('style');
tag.type = 'text/css';
const nonce = getNonce();
if (nonce) {
tag.setAttribute('nonce', nonce);
}
return tag;
}
function injectStyles(tag, css) {
// @ts-ignore
if (tag.styleSheet) {
// @ts-ignore
tag.styleSheet.cssText = css;
}
else {
tag.appendChild(document.createTextNode(css));
}
}
function insertStyleTag(tag) {
const head = document.head || document.getElementsByTagName('head')[0];
head.appendChild(tag);
}
export const stylesheetSingleton = () => {
let counter = 0;
let stylesheet = null;
return {
add: (style) => {
if (counter == 0) {
if ((stylesheet = makeStyleTag())) {
injectStyles(stylesheet, style);
insertStyleTag(stylesheet);
}
}
counter++;
},
remove: () => {
counter--;
if (!counter && stylesheet) {
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
stylesheet = null;
}
},
};
};
@@ -0,0 +1 @@
module.exports={C:{"55":0.00425,"67":0.00425,"112":0.00425,"115":0.06374,"118":0.00425,"120":0.58636,"121":1.19822,"122":0.0085,"123":0.03399,"124":0.02549,"125":0.02125,"126":0.00425,"127":0.0085,"128":0.00425,"129":0.00425,"131":0.00425,"132":0.00425,"133":0.00425,"135":0.00425,"136":0.00425,"138":0.00425,"139":0.00425,"140":0.01275,"142":0.0085,"143":0.0085,"144":0.01275,"146":0.0085,"147":0.0085,"148":0.0085,"149":0.00425,"150":0.0085,"152":0.0085,"153":0.01275,"154":0.22945,"155":0.48014,"156":0.35267,"157":0.0085,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64 65 66 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 119 130 134 137 141 145 151 158 159 160 3.5","3.6":0.00425},D:{"63":0.00425,"66":0.00425,"68":0.00425,"69":0.00425,"70":0.00425,"79":0.00425,"80":0.00425,"86":0.02125,"87":0.00425,"93":0.01275,"97":0.0085,"99":0.00425,"101":0.02125,"103":0.53113,"104":0.30593,"105":0.29743,"106":0.30593,"107":0.29743,"108":0.30168,"109":0.55237,"110":0.29318,"111":0.30593,"112":0.29743,"114":0.017,"116":0.57786,"117":0.30593,"118":0.90929,"119":1.19822,"120":1.58913,"121":0.017,"122":0.05099,"123":0.03824,"124":0.33992,"125":0.0085,"126":0.01275,"127":0.03399,"128":0.017,"129":0.02549,"130":0.01275,"131":0.61186,"132":0.01275,"133":0.67134,"134":0.11897,"135":0.15721,"136":0.14872,"137":0.12322,"138":0.24219,"139":0.13172,"140":0.14872,"141":0.13597,"142":0.46314,"143":0.04674,"144":0.2082,"145":0.06798,"146":0.13597,"147":0.04249,"148":0.11897,"149":0.27619,"150":0.30168,"151":1.57638,"152":8.71045,"153":5.45997,"154":1.12599,"155":0.02974,"156":0.00425,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 64 65 67 71 72 73 74 75 76 77 78 81 83 84 85 88 89 90 91 92 94 95 96 98 100 102 113 115 157"},F:{"53":0.00425,"54":0.00425,"55":0.00425,"56":0.00425,"89":0.00425,"90":0.00425,"94":0.00425,"95":0.00425,"100":0.00425,"101":0.04249,"105":0.0085,"106":0.017,"107":0.0085,"111":0.00425,"114":0.00425,"116":0.00425,"118":0.00425,"119":0.00425,"120":0.0085,"121":0.0085,"122":0.00425,"133":0.02125,"134":0.06798,"135":0.69259,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 91 92 93 96 97 98 99 102 103 104 108 109 110 112 113 115 117 123 124 125 126 127 131 132 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1","9.5-9.6":0.00425},B:{"17":0.00425,"89":0.00425,"92":0.02125,"109":0.00425,"114":0.0085,"115":0.00425,"119":0.57786,"120":0.56087,"121":0.0085,"122":0.017,"123":0.00425,"124":0.01275,"129":0.00425,"131":0.00425,"132":0.00425,"133":0.00425,"134":0.00425,"135":0.03399,"136":0.00425,"138":0.0085,"139":0.0085,"140":0.017,"141":0.01275,"142":0.02549,"143":0.01275,"144":0.01275,"145":0.01275,"146":0.01275,"147":0.02125,"148":0.02125,"149":0.017,"150":0.08498,"151":0.11472,"152":1.02401,"153":1.12599,"154":0.28893,_:"12 13 14 15 16 18 79 80 81 83 84 85 86 87 88 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 116 117 118 125 126 127 128 130 137"},E:{"4":0.00425,"5":0.00425,"27":0.05524,_:"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 15.1 15.2-15.3 15.4 16.0 16.2 16.4 17.0 17.2 18.0 18.4 27.1 27.2 TP","12.1":0.00425,"13.1":0.00425,"14.1":0.02125,"15.5":0.00425,"15.6":0.07648,"16.1":0.00425,"16.3":0.00425,"16.5":0.00425,"16.6":0.06798,"17.1":0.03824,"17.3":0.0085,"17.4":0.0085,"17.5":0.00425,"17.6":0.05099,"18.1":0.00425,"18.2":0.0085,"18.3":0.01275,"18.5-18.7":0.0085,"26.0":0.01275,"26.1":0.00425,"26.2":0.02549,"26.3":0.08923,"26.4":0.05949,"26.5":0.19121,"26.6":0.4419},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00152,"5.0-5.1":0.00152,"6.0-6.1":0,"7.0-7.1":0.00304,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01519,"11.0-11.2":0.00152,"11.3-11.4":0.00304,"12.0-12.1":0,"12.2-12.5":0.03949,"13.0-13.1":0,"13.2":0.00759,"13.3":0,"13.4-13.7":0.00152,"14.0-14.4":0.00608,"14.5-14.8":0.00911,"15.0-15.1":0.00911,"15.2-15.3":0.00608,"15.4":0.00759,"15.5":0.00911,"15.6-15.8":0.19745,"16.0":0.01519,"16.1":0.02734,"16.2":0.01519,"16.3":0.03341,"16.4":0.00759,"16.5":0.01215,"16.6-16.7":0.27491,"17.0":0.01063,"17.1":0.01519,"17.2":0.01519,"17.3":0.02278,"17.4":0.0319,"17.5":0.06227,"17.6-17.7":0.161,"18.0":0.03341,"18.1":0.06683,"18.2":0.09113,"18.3":0.15796,"18.4":0.09872,"18.5-18.7":2.0398,"26.0":0.09872,"26.1":0.10024,"26.2":0.26124,"26.3":0.2825,"26.4":0.20656,"26.5":1.38366,"26.6":8.53739,"27.0":0.65462,"27.1":0,"27.2":0.01671},P:{"4":0.00888,"21":0.00888,"25":0.00888,"26":0.01776,"27":0.00888,"28":0.0888,"29":0.11543,"30":0.83468,_:"20 22 23 24 5.0-5.4 6.2-6.4 7.Line truncated
@@ -0,0 +1,41 @@
/*
* When this file is linked to a DLL, it sets up a delay-load hook that
* intervenes when the DLL is trying to load the host executable
* dynamically. Instead of trying to locate the .exe file it'll just
* return a handle to the process image.
*
* This allows compiled addons to work when the host executable is renamed.
*/
#ifdef _MSC_VER
#pragma managed(push, off)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <delayimp.h>
#include <string.h>
static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) {
HMODULE m;
if (event != dliNotePreLoadLibrary)
return NULL;
if (_stricmp(info->szDll, HOST_BINARY) != 0)
return NULL;
// try for libnode.dll to compat node.js that using 'vcbuild.bat dll'
m = GetModuleHandle(TEXT("libnode.dll"));
if (m == NULL) m = GetModuleHandle(NULL);
return (FARPROC) m;
}
decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook;
#pragma managed(pop)
#endif