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

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

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"divide-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,100 @@
import * as ts from 'typescript';
import type { TypeOrValueSpecifier } from './TypeOrValueSpecifier';
export interface ReadonlynessOptions {
readonly allow?: TypeOrValueSpecifier[];
readonly treatMethodsAsReadonly?: boolean;
}
export declare const readonlynessOptionsSchema: {
additionalProperties: false;
properties: {
allow: {
readonly items: {
readonly oneOf: [{
readonly type: "string";
}, {
readonly additionalProperties: false;
readonly properties: {
readonly from: {
readonly enum: ["file"];
readonly type: "string";
};
readonly name: {
readonly oneOf: [{
readonly type: "string";
}, {
readonly items: {
readonly type: "string";
};
readonly minItems: 1;
readonly type: "array";
readonly uniqueItems: true;
}];
};
readonly path: {
readonly type: "string";
};
};
readonly required: ["from", "name"];
readonly type: "object";
}, {
readonly additionalProperties: false;
readonly properties: {
readonly from: {
readonly enum: ["lib"];
readonly type: "string";
};
readonly name: {
readonly oneOf: [{
readonly type: "string";
}, {
readonly items: {
readonly type: "string";
};
readonly minItems: 1;
readonly type: "array";
readonly uniqueItems: true;
}];
};
};
readonly required: ["from", "name"];
readonly type: "object";
}, {
readonly additionalProperties: false;
readonly properties: {
readonly from: {
readonly enum: ["package"];
readonly type: "string";
};
readonly name: {
readonly oneOf: [{
readonly type: "string";
}, {
readonly items: {
readonly type: "string";
};
readonly minItems: 1;
readonly type: "array";
readonly uniqueItems: true;
}];
};
readonly package: {
readonly type: "string";
};
};
readonly required: ["from", "name", "package"];
readonly type: "object";
}];
};
readonly type: "array";
};
treatMethodsAsReadonly: {
type: "boolean";
};
};
type: "object";
};
export declare const readonlynessOptionsDefaults: ReadonlynessOptions;
/**
* Checks if the given type is readonly
*/
export declare function isTypeReadonly(program: ts.Program, type: ts.Type, options?: ReadonlynessOptions): boolean;
@@ -0,0 +1,3 @@
import { n as AjvJsonSchemaValidator, r as addFormats, t as Ajv } from "../ajvProvider-CEoC__sr.mjs";
export { Ajv, AjvJsonSchemaValidator, addFormats };
@@ -0,0 +1 @@
{"version":3,"names":["_setPrototypeOf","require","_inherits","_wrapRegExp","exports","default","re","groups","BabelRegExp","undefined","_super","RegExp","prototype","_groups","WeakMap","flags","_this","set","get","setPrototypeOf","inherits","exec","str","result","call","buildGroups","indices","Symbol","replace","substitution","match","name","end","group","Array","isArray","join","args","arguments","length","slice","push","apply","g","Object","keys","reduce","i","k","create"],"sources":["../../src/helpers/wrapRegExp.ts"],"sourcesContent":["/* @minVersion 7.19.0 */\n\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\nimport inherits from \"./inherits.ts\";\n\n// Define interfaces for clarity and type safety\ntype GroupMap = Record<string, number | [number, number]>;\n\ndeclare class BabelRegExp extends RegExp {\n exec(str: string): RegExpExecArray | null;\n [Symbol.replace](str: string, substitution: string | Function): string;\n}\n\ninterface BabelRegExpConstructor {\n new (re: RegExp, flags?: string, groups?: GroupMap): BabelRegExp;\n readonly prototype: BabelRegExp;\n}\n\nexport default function _wrapRegExp(this: any): RegExp {\n // @ts-expect-error -- deliberately re-assign\n _wrapRegExp = function (re: RegExp, groups?: GroupMap): RegExp {\n return new (BabelRegExp as any as BabelRegExpConstructor)(\n re,\n undefined,\n groups,\n );\n };\n\n var _super = RegExp.prototype;\n var _groups = new WeakMap<RegExp, GroupMap>();\n\n function BabelRegExp(\n this: BabelRegExp,\n re: RegExp,\n flags?: string,\n groups?: GroupMap,\n ) {\n var _this = new RegExp(re, flags);\n // if the regex is re-created with 'g' flag\n _groups.set(_this, groups || _groups.get(re)!);\n return setPrototypeOf(_this, BabelRegExp.prototype) as BabelRegExp;\n }\n inherits(BabelRegExp, RegExp);\n\n BabelRegExp.prototype.exec = function (\n this: BabelRegExp,\n str: string,\n ): RegExpExecArray | null {\n var result = _super.exec.call(this, str);\n if (result) {\n result.groups = buildGroups(result, this);\n var indices = result.indices;\n if (indices) indices.groups = buildGroups(indices, this);\n }\n return result;\n };\n\n BabelRegExp.prototype[Symbol.replace] = function (\n this: BabelRegExp,\n str: string,\n substitution: string | Function,\n ): string {\n if (typeof substitution === \"string\") {\n var groups = _groups.get(this)!;\n return (\n _super[Symbol.replace] as (\n string: string,\n replaceValue: string,\n ) => string\n ).call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)(>|$)/g, function (match, name, end) {\n if (end === \"\") {\n // return unterminated group name as-is\n return match;\n } else {\n var group = groups[name];\n return Array.isArray(group)\n ? \"$\" + group.join(\"$\")\n : typeof group === \"number\"\n ? \"$\" + group\n : \"\";\n }\n }),\n );\n } else if (typeof substitution === \"function\") {\n var _this = this;\n return (\n _super[Symbol.replace] as (\n string: string,\n replacer: (substring: string, ...args: any[]) => string,\n ) => string\n ).call(this, str, function (this: any) {\n var args: IArguments | any[] = arguments;\n // Modern engines already pass result.groups returned by exec() as the last arg.\n if (typeof args[args.length - 1] !== \"object\") {\n args = [].slice.call(args) as any[];\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n });\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n };\n\n function buildGroups(\n result: RegExpExecArray,\n re: RegExp,\n ): Record<string, string>;\n function buildGroups(\n result: RegExpIndicesArray,\n re: RegExp,\n ): Record<string, [number, number]>;\n function buildGroups(\n result: RegExpExecArray | RegExpIndicesArray,\n re: RegExp,\n ): Record<string, string> | Record<string, [number, number]> {\n var g = _groups.get(re)!;\n return Object.keys(g).reduce(function (groups, name) {\n var i = g[name];\n if (typeof i === \"number\") groups[name] = result[i];\n else {\n var k = 0;\n while (result[i[k]] === undefined && k + 1 < i.length) {\n k++;\n }\n groups[name] = result[i[k]];\n }\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments as any);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAee,SAASE,WAAWA,CAAA,EAAoB;EAErDC,OAAA,CAAAC,OAAA,GAAAF,WAAW,GAAG,SAAAA,CAAUG,EAAU,EAAEC,MAAiB,EAAU;IAC7D,OAAO,IAAKC,WAAW,CACrBF,EAAE,EACFG,SAAS,EACTF,MACF,CAAC;EACH,CAAC;EAED,IAAIG,MAAM,GAAGC,MAAM,CAACC,SLine truncated
@@ -0,0 +1,17 @@
import * as core from "../core/index.cjs";
import * as schemas from "./schemas.cjs";
export interface ZodCoercedString<T = unknown> extends schemas._ZodString<core.$ZodStringInternals<T>> {
}
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): ZodCoercedString<T>;
export interface ZodCoercedNumber<T = unknown> extends schemas._ZodNumber<core.$ZodNumberInternals<T>> {
}
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): ZodCoercedNumber<T>;
export interface ZodCoercedBoolean<T = unknown> extends schemas._ZodBoolean<core.$ZodBooleanInternals<T>> {
}
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): ZodCoercedBoolean<T>;
export interface ZodCoercedBigInt<T = unknown> extends schemas._ZodBigInt<core.$ZodBigIntInternals<T>> {
}
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): ZodCoercedBigInt<T>;
export interface ZodCoercedDate<T = unknown> extends schemas._ZodDate<core.$ZodDateInternals<T>> {
}
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): ZodCoercedDate<T>;
@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2017_intl = void 0;
const base_config_1 = require("./base-config");
exports.es2017_intl = {
libs: [],
variables: [['Intl', base_config_1.TYPE_VALUE]],
};
@@ -0,0 +1,462 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _keywords = require('../parser/tokenizer/keywords');
var _types = require('../parser/tokenizer/types');
var _getClassInfo = require('../util/getClassInfo'); var _getClassInfo2 = _interopRequireDefault(_getClassInfo);
var _CJSImportTransformer = require('./CJSImportTransformer'); var _CJSImportTransformer2 = _interopRequireDefault(_CJSImportTransformer);
var _ESMImportTransformer = require('./ESMImportTransformer'); var _ESMImportTransformer2 = _interopRequireDefault(_ESMImportTransformer);
var _FlowTransformer = require('./FlowTransformer'); var _FlowTransformer2 = _interopRequireDefault(_FlowTransformer);
var _JestHoistTransformer = require('./JestHoistTransformer'); var _JestHoistTransformer2 = _interopRequireDefault(_JestHoistTransformer);
var _JSXTransformer = require('./JSXTransformer'); var _JSXTransformer2 = _interopRequireDefault(_JSXTransformer);
var _NumericSeparatorTransformer = require('./NumericSeparatorTransformer'); var _NumericSeparatorTransformer2 = _interopRequireDefault(_NumericSeparatorTransformer);
var _OptionalCatchBindingTransformer = require('./OptionalCatchBindingTransformer'); var _OptionalCatchBindingTransformer2 = _interopRequireDefault(_OptionalCatchBindingTransformer);
var _OptionalChainingNullishTransformer = require('./OptionalChainingNullishTransformer'); var _OptionalChainingNullishTransformer2 = _interopRequireDefault(_OptionalChainingNullishTransformer);
var _ReactDisplayNameTransformer = require('./ReactDisplayNameTransformer'); var _ReactDisplayNameTransformer2 = _interopRequireDefault(_ReactDisplayNameTransformer);
var _ReactHotLoaderTransformer = require('./ReactHotLoaderTransformer'); var _ReactHotLoaderTransformer2 = _interopRequireDefault(_ReactHotLoaderTransformer);
var _TypeScriptTransformer = require('./TypeScriptTransformer'); var _TypeScriptTransformer2 = _interopRequireDefault(_TypeScriptTransformer);
class RootTransformer {
__init() {this.transformers = []}
__init2() {this.generatedVariables = []}
constructor(
sucraseContext,
transforms,
enableLegacyBabel5ModuleInterop,
options,
) {;RootTransformer.prototype.__init.call(this);RootTransformer.prototype.__init2.call(this);
this.nameManager = sucraseContext.nameManager;
this.helperManager = sucraseContext.helperManager;
const {tokenProcessor, importProcessor} = sucraseContext;
this.tokens = tokenProcessor;
this.isImportsTransformEnabled = transforms.includes("imports");
this.isReactHotLoaderTransformEnabled = transforms.includes("react-hot-loader");
this.disableESTransforms = Boolean(options.disableESTransforms);
if (!options.disableESTransforms) {
this.transformers.push(
new (0, _OptionalChainingNullishTransformer2.default)(tokenProcessor, this.nameManager),
);
this.transformers.push(new (0, _NumericSeparatorTransformer2.default)(tokenProcessor));
this.transformers.push(new (0, _OptionalCatchBindingTransformer2.default)(tokenProcessor, this.nameManager));
}
if (transforms.includes("jsx")) {
if (options.jsxRuntime !== "preserve") {
this.transformers.push(
new (0, _JSXTransformer2.default)(this, tokenProcessor, importProcessor, this.nameManager, options),
);
}
this.transformers.push(
new (0, _ReactDisplayNameTransformer2.default)(this, tokenProcessor, importProcessor, options),
);
}
let reactHotLoaderTransformer = null;
if (transforms.includes("react-hot-loader")) {
if (!options.filePath) {
throw new Error("filePath is required when using the react-hot-loader transform.");
}
reactHotLoaderTransformer = new (0, _ReactHotLoaderTransformer2.default)(tokenProcessor, options.filePath);
this.transformers.push(reactHotLoaderTransformer);
}
// Note that we always want to enable the imports transformer, even when the import transform
// itself isn't enabled, since we need to do type-only import pruning for both Flow and
// TypeScript.
if (transforms.includes("imports")) {
if (importProcessor === null) {
throw new Error("Expected non-null importProcessor with imports transform enabled.");
}
this.transformers.push(
new (0, _CJSImportTransformer2.default)(
this,
tokenProcessor,
importProcessor,
this.nameManager,
this.helperManager,
reactHotLoaderTransformer,
enableLegacyBabel5ModuleInterop,
Boolean(options.enableLegacyTypeScriptModuleInterop),
transforms.includes("typescript"),
transforms.includes("flow"),
Boolean(options.preserveDynamicImport),
Boolean(options.keepUnusedImports),
),
);
} else {
this.transformers.push(
new (0, _ESMImportTransformer2.default)(
tokenProcessor,
this.nameManager,
this.helperManager,
reactHotLoaderTransformer,
transforms.includes("typescript"),
transforms.includes("flow"),
Boolean(options.keepUnusedImports),
options,
),
);
}
if (transforms.includes("flow")) {
this.transformers.push(
new (0, _FlowTransformer2.default)(this, tokenProcessor, transforms.includes("imports")),
);
}
if (transforms.includes("typescript")) {
this.transformers.push(
new (0, _TypeScriptTransformer2.default)(this, tokenProcessor, transforms.includes("imports")),
);
}
if (transforms.includes("jest")) {
this.transformers.push(
new (0, _JestHoistTransformer2.default)(this, tokenProcessor, this.nameManager, importProcessor),
);
}
}
transform() {
this.tokens.reset();
this.processBalancedCode();
const shouldAddUseStrict = this.isImportsTransformEnabled;
// "use strict" always needs to be first, so override the normal transformer order.
let prefix = shouldAddUseStrict ? '"use strict";' : "";
for (const transformer of this.transformers) {
prefix += transformer.getPrefixCode();
}
prefix += this.helperManager.emitHelpers();
prefix += this.generatedVariables.map((v) => ` var ${v};`).join("");
for (const transformer of this.transformers) {
prefix += transformer.getHoistedCode();
}
let suffix = "";
for (const transformer of this.transformers) {
suffix += transformer.getSuffixCode();
}
const result = this.tokens.finish();
let {code} = result;
if (code.startsWith("#!")) {
let newlineIndex = code.indexOf("\n");
if (newlineIndex === -1) {
newlineIndex = code.length;
code += "\n";
}
return {
code: code.slice(0, newlineIndex + 1) + prefix + code.slice(newlineIndex + 1) + suffix,
// The hashbang line has no tokens, so shifting the tokens to account
// for prefix can happen normally.
mappings: this.shiftMappings(result.mappings, prefix.length),
};
} else {
return {
code: prefix + code + suffix,
mappings: this.shiftMappings(result.mappings, prefix.length),
};
}
}
processBalancedCode() {
let braceDepth = 0;
let parenDepth = 0;
while (!this.tokens.isAtEnd()) {
if (this.tokens.matches1(_types.TokenType.braceL) || this.tokens.matches1(_types.TokenType.dollarBraceL)) {
braceDepth++;
} else if (this.tokens.matches1(_types.TokenType.braceR)) {
if (braceDepth === 0) {
return;
}
braceDepth--;
}
if (this.tokens.matches1(_types.TokenType.parenL)) {
parenDepth++;
} else if (this.tokens.matches1(_types.TokenType.parenR)) {
if (parenDepth === 0) {
return;
}
parenDepth--;
}
this.processToken();
}
}
processToken() {
if (this.tokens.matches1(_types.TokenType._class)) {
this.processClass();
return;
}
for (const transformer of this.transformers) {
const wasProcessed = transformer.process();
if (wasProcessed) {
return;
}
}
this.tokens.copyToken();
}
/**
* Skip past a class with a name and return that name.
*/
processNamedClass() {
if (!this.tokens.matches2(_types.TokenType._class, _types.TokenType.name)) {
throw new Error("Expected identifier for exported class name.");
}
const name = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
this.processClass();
return name;
}
processClass() {
const classInfo = _getClassInfo2.default.call(void 0, this, this.tokens, this.nameManager, this.disableESTransforms);
// Both static and instance initializers need a class name to use to invoke the initializer, so
// assign to one if necessary.
const needsCommaExpression =
(classInfo.headerInfo.isExpression || !classInfo.headerInfo.className) &&
classInfo.staticInitializerNames.length + classInfo.instanceInitializerNames.length > 0;
let className = classInfo.headerInfo.className;
if (needsCommaExpression) {
className = this.nameManager.claimFreeName("_class");
this.generatedVariables.push(className);
this.tokens.appendCode(` (${className} =`);
}
const classToken = this.tokens.currentToken();
const contextId = classToken.contextId;
if (contextId == null) {
throw new Error("Expected class to have a context ID.");
}
this.tokens.copyExpectedToken(_types.TokenType._class);
while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.braceL, contextId)) {
this.processToken();
}
this.processClassBody(classInfo, className);
const staticInitializerStatements = classInfo.staticInitializerNames.map(
(name) => `${className}.${name}()`,
);
if (needsCommaExpression) {
this.tokens.appendCode(
`, ${staticInitializerStatements.map((s) => `${s}, `).join("")}${className})`,
);
} else if (classInfo.staticInitializerNames.length > 0) {
this.tokens.appendCode(` ${staticInitializerStatements.map((s) => `${s};`).join(" ")}`);
}
}
/**
* We want to just handle class fields in all contexts, since TypeScript supports them. Later,
* when some JS implementations support class fields, this should be made optional.
*/
processClassBody(classInfo, className) {
const {
headerInfo,
constructorInsertPos,
constructorInitializerStatements,
fields,
instanceInitializerNames,
rangesToRemove,
} = classInfo;
let fieldIndex = 0;
let rangeToRemoveIndex = 0;
const classContextId = this.tokens.currentToken().contextId;
if (classContextId == null) {
throw new Error("Expected non-null context ID on class.");
}
this.tokens.copyExpectedToken(_types.TokenType.braceL);
if (this.isReactHotLoaderTransformEnabled) {
this.tokens.appendCode(
"__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}",
);
}
const needsConstructorInit =
constructorInitializerStatements.length + instanceInitializerNames.length > 0;
if (constructorInsertPos === null && needsConstructorInit) {
const constructorInitializersCode = this.makeConstructorInitCode(
constructorInitializerStatements,
instanceInitializerNames,
className,
);
if (headerInfo.hasSuperclass) {
const argsName = this.nameManager.claimFreeName("args");
this.tokens.appendCode(
`constructor(...${argsName}) { super(...${argsName}); ${constructorInitializersCode}; }`,
);
} else {
this.tokens.appendCode(`constructor() { ${constructorInitializersCode}; }`);
}
}
while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.braceR, classContextId)) {
if (fieldIndex < fields.length && this.tokens.currentIndex() === fields[fieldIndex].start) {
let needsCloseBrace = false;
if (this.tokens.matches1(_types.TokenType.bracketL)) {
this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this`);
} else if (this.tokens.matches1(_types.TokenType.string) || this.tokens.matches1(_types.TokenType.num)) {
this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this[`);
needsCloseBrace = true;
} else {
this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this.`);
}
while (this.tokens.currentIndex() < fields[fieldIndex].end) {
if (needsCloseBrace && this.tokens.currentIndex() === fields[fieldIndex].equalsIndex) {
this.tokens.appendCode("]");
}
this.processToken();
}
this.tokens.appendCode("}");
fieldIndex++;
} else if (
rangeToRemoveIndex < rangesToRemove.length &&
this.tokens.currentIndex() >= rangesToRemove[rangeToRemoveIndex].start
) {
if (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) {
this.tokens.removeInitialToken();
}
while (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) {
this.tokens.removeToken();
}
rangeToRemoveIndex++;
} else if (this.tokens.currentIndex() === constructorInsertPos) {
this.tokens.copyToken();
if (needsConstructorInit) {
this.tokens.appendCode(
`;${this.makeConstructorInitCode(
constructorInitializerStatements,
instanceInitializerNames,
className,
)};`,
);
}
this.processToken();
} else {
this.processToken();
}
}
this.tokens.copyExpectedToken(_types.TokenType.braceR);
}
makeConstructorInitCode(
constructorInitializerStatements,
instanceInitializerNames,
className,
) {
return [
...constructorInitializerStatements,
...instanceInitializerNames.map((name) => `${className}.prototype.${name}.call(this)`),
].join(";");
}
/**
* Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with
* arrow function return types since they can confuse the parser. In that case, we want to move
* the close-paren to the same line as the arrow.
*
* See https://github.com/alangpierce/sucrase/issues/391 for more details.
*/
processPossibleArrowParamEnd() {
if (this.tokens.matches2(_types.TokenType.parenR, _types.TokenType.colon) && this.tokens.tokenAtRelativeIndex(1).isType) {
let nextNonTypeIndex = this.tokens.currentIndex() + 1;
// Look ahead to see if this is an arrow function or something else.
while (this.tokens.tokens[nextNonTypeIndex].isType) {
nextNonTypeIndex++;
}
if (this.tokens.matches1AtIndex(nextNonTypeIndex, _types.TokenType.arrow)) {
this.tokens.removeInitialToken();
while (this.tokens.currentIndex() < nextNonTypeIndex) {
this.tokens.removeToken();
}
this.tokens.replaceTokenTrimmingLeftWhitespace(") =>");
return true;
}
}
return false;
}
/**
* An async arrow function might be of the form:
*
* async <
* T
* >() => {}
*
* in which case, removing the type parameters will cause a syntax error. Detect this case and
* move the open-paren earlier.
*/
processPossibleAsyncArrowWithTypeParams() {
if (
!this.tokens.matchesContextual(_keywords.ContextualKeyword._async) &&
!this.tokens.matches1(_types.TokenType._async)
) {
return false;
}
const nextToken = this.tokens.tokenAtRelativeIndex(1);
if (nextToken.type !== _types.TokenType.lessThan || !nextToken.isType) {
return false;
}
let nextNonTypeIndex = this.tokens.currentIndex() + 1;
// Look ahead to see if this is an arrow function or something else.
while (this.tokens.tokens[nextNonTypeIndex].isType) {
nextNonTypeIndex++;
}
if (this.tokens.matches1AtIndex(nextNonTypeIndex, _types.TokenType.parenL)) {
this.tokens.replaceToken("async (");
this.tokens.removeInitialToken();
while (this.tokens.currentIndex() < nextNonTypeIndex) {
this.tokens.removeToken();
}
this.tokens.removeToken();
// We ate a ( token, so we need to process the tokens in between and then the ) token so that
// we remain balanced.
this.processBalancedCode();
this.processToken();
return true;
}
return false;
}
processPossibleTypeRange() {
if (this.tokens.currentToken().isType) {
this.tokens.removeInitialToken();
while (this.tokens.currentToken().isType) {
this.tokens.removeToken();
}
return true;
}
return false;
}
shiftMappings(
mappings,
prefixLength,
) {
for (let i = 0; i < mappings.length; i++) {
const mapping = mappings[i];
if (mapping !== undefined) {
mappings[i] = mapping + prefixLength;
}
}
return mappings;
}
} exports.default = RootTransformer;
@@ -0,0 +1 @@
{"version":3,"names":["_cache","require","_index","_context","_removal","_t","_hoister","arrowFunctionExpression","assertExpression","assignmentExpression","blockStatement","callExpression","cloneNode","expressionStatement","isAssignmentExpression","isCallExpression","isExportNamedDeclaration","isExpression","isIdentifier","isSequenceExpression","isSuper","thisExpression","insertBefore","nodes_","_assertUnremoved","call","nodes","_verifyNodeList","parentPath","parent","isExpressionStatement","isLabeledStatement","isExportDefaultDeclaration","isDeclaration","isNodeType","isJSXElement","isForStatement","key","node","push","replaceExpressionWithStatements","Array","isArray","container","_containerInsertBefore","isStatementOrBlock","shouldInsertCurrentNode","expression","blockPath","replaceWith","unshiftContainer","Error","_containerInsert","from","updateSiblingKeys","length","paths","splice","i","_this$context","to","path","getSibling","context","queue","pushContext","contexts","_getQueueContexts","setScope","debug","maybeQueue","_containerInsertAfter","last","arr","isHiddenInSequenceExpression","expressions","isAlmostConstantAssignment","scope","left","blockScope","getBlockParent","hasOwnBinding","name","getOwnBinding","constantViolations","insertAfter","get","map","self","isPattern","unshift","callee","isPure","isMethod","computed","temp","generateDeclaredUidIdentifier","pushContainer","fromIndex","incrementBy","getCachedPaths","msg","type","NodePath","listKey","verifiedNodes","setContext","replaceWithMultiple","exports","hoist","hoister","PathHoister","run"],"sources":["../../src/path/modification.ts"],"sourcesContent":["// This file contains methods that modify the path/node in some ways.\n\nimport { getCachedPaths } from \"../cache.ts\";\nimport NodePath from \"./index.ts\";\nimport { _getQueueContexts, pushContext, setScope } from \"./context.ts\";\nimport { _assertUnremoved } from \"./removal.ts\";\nimport {\n arrowFunctionExpression,\n assertExpression,\n assignmentExpression,\n blockStatement,\n callExpression,\n cloneNode,\n expressionStatement,\n isAssignmentExpression,\n isCallExpression,\n isExportNamedDeclaration,\n isExpression,\n isIdentifier,\n isSequenceExpression,\n isSuper,\n thisExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type Scope from \"../scope/index.ts\";\nimport type {\n NodeList,\n NodeOrNodeList,\n NodeListType,\n NodePaths,\n} from \"./index.ts\";\n\n/**\n * Insert the provided nodes before the current one.\n */\n\nexport function insertBefore<Nodes extends NodeOrNodeList<t.Node>>(\n this: NodePath,\n nodes_: Nodes,\n): NodePaths<Nodes> {\n _assertUnremoved.call(this);\n\n const nodes = _verifyNodeList.call(this, nodes_);\n\n const { parentPath, parent } = this;\n\n if (\n parentPath.isExpressionStatement() ||\n parentPath.isLabeledStatement() ||\n // https://github.com/babel/babel/issues/15293\n // When Babel transforms `export class String { field }`, the class properties plugin will inject the defineProperty\n // helper, which depends on the builtins e.g. String, Number, Symbol, etc. To prevent them from being shadowed by local\n // exports, the helper injector replaces the named export into `class _String { field }; export { _String as String }`,\n // with `parentPath` here changed to the moved ClassDeclaration, causing rare inconsistency between `parent` and `parentPath`.\n // Here we retrieve the parent type from the `parent` property. This is a temporary fix and we should revisit when\n // helpers should get injected.\n isExportNamedDeclaration(parent) ||\n (parentPath.isExportDefaultDeclaration() && this.isDeclaration())\n ) {\n return parentPath.insertBefore(nodes as Nodes);\n } else if (\n (this.isNodeType(\"Expression\") && !this.isJSXElement()) ||\n (parentPath.isForStatement() && this.key === \"init\")\n ) {\n if (this.node) nodes.push(this.node);\n // @ts-expect-error todo(flow->ts): check that nodes is an array of statements\n return this.replaceExpressionWithStatements(nodes);\n } else if (Array.isArray(this.container)) {\n return _containerInsertBefore.call(this, nodes) as NodePaths<Nodes>;\n } else if (this.isStatementOrBlock()) {\n const node = this.node as t.Statement;\n const shouldInsertCurrentNode =\n node &&\n (!this.isExpressionStatement() ||\n (node as t.ExpressionStatement).expression != null);\n\n const [blockPath] = this.replaceWith(\n blockStatement(shouldInsertCurrentNode ? [node] : []),\n );\n return blockPath.unshiftContainer(\n \"body\",\n nodes as t.Statement[],\n ) as NodePaths<Nodes>;\n } else {\n throw new Error(\n \"We don't know what to do with this node type. \" +\n \"We were previously a Statement but we can't fit in here?\",\n );\n }\n}\n\nexport function _containerInsert<Nodes extends NodeList<t.Node>>(\n this: NodePath,\n from: number,\n Line truncated
@@ -0,0 +1,12 @@
var test = require('tape');
var inspect = require('../');
var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' };
test('interpolate low bytes', function (t) {
t.plan(1);
t.equal(
inspect(obj),
"{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }"
);
});
@@ -0,0 +1 @@
{"version":3,"file":"message-square-warning.js","sources":["../../../src/icons/message-square-warning.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareWarning\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTVhMiAyIDAgMCAxLTIgMkg3bC00IDRWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ6IiAvPgogIDxwYXRoIGQ9Ik0xMiA3djIiIC8+CiAgPHBhdGggZD0iTTEyIDEzaC4wMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/message-square-warning\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 MessageSquareWarning = createLucideIcon('MessageSquareWarning', [\n ['path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', key: '1lielz' }],\n ['path', { d: 'M12 7v2', key: 'stiyo7' }],\n ['path', { d: 'M12 13h.01', key: 'y0uutt' }],\n]);\n\nexport default MessageSquareWarning;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,iBAAiB,sBAAwB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC9F,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,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,89 @@
import {GenMapping, maybeAddSegment, toEncodedMap} from "@jridgewell/gen-mapping";
import {charCodes} from "./parser/util/charcodes";
/**
* Generate a source map indicating that each line maps directly to the original line,
* with the tokens in their new positions.
*/
export default function computeSourceMap(
{code: generatedCode, mappings: rawMappings},
filePath,
options,
source,
tokens,
) {
const sourceColumns = computeSourceColumns(source, tokens);
const map = new GenMapping({file: options.compiledFilename});
let tokenIndex = 0;
// currentMapping is the output source index for the current input token being
// considered.
let currentMapping = rawMappings[0];
while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) {
tokenIndex++;
currentMapping = rawMappings[tokenIndex];
}
let line = 0;
let lineStart = 0;
if (currentMapping !== lineStart) {
maybeAddSegment(map, line, 0, filePath, line, 0);
}
for (let i = 0; i < generatedCode.length; i++) {
if (i === currentMapping) {
const genColumn = currentMapping - lineStart;
const sourceColumn = sourceColumns[tokenIndex];
maybeAddSegment(map, line, genColumn, filePath, line, sourceColumn);
while (
(currentMapping === i || currentMapping === undefined) &&
tokenIndex < rawMappings.length - 1
) {
tokenIndex++;
currentMapping = rawMappings[tokenIndex];
}
}
if (generatedCode.charCodeAt(i) === charCodes.lineFeed) {
line++;
lineStart = i + 1;
if (currentMapping !== lineStart) {
maybeAddSegment(map, line, 0, filePath, line, 0);
}
}
}
const {sourceRoot, sourcesContent, ...sourceMap} = toEncodedMap(map);
return sourceMap ;
}
/**
* Create an array mapping each token index to the 0-based column of the start
* position of the token.
*/
function computeSourceColumns(code, tokens) {
const sourceColumns = new Array(tokens.length);
let tokenIndex = 0;
let currentMapping = tokens[tokenIndex].start;
let lineStart = 0;
for (let i = 0; i < code.length; i++) {
if (i === currentMapping) {
sourceColumns[tokenIndex] = currentMapping - lineStart;
tokenIndex++;
currentMapping = tokens[tokenIndex].start;
}
if (code.charCodeAt(i) === charCodes.lineFeed) {
lineStart = i + 1;
}
}
return sourceColumns;
}
@@ -0,0 +1,50 @@
#ifndef DIR_TREE_H
#define DIR_TREE_H
#include <string>
#include <unordered_map>
#include <memory>
#include "Event.hh"
#ifdef _WIN32
#define DIR_SEP "\\"
#else
#define DIR_SEP "/"
#endif
struct DirEntry {
std::string path;
uint64_t mtime;
bool isDir;
mutable void *state;
DirEntry(std::string p, uint64_t t, bool d);
DirEntry(FILE *f);
void write(FILE *f) const;
bool operator==(const DirEntry &other) const {
return path == other.path;
}
};
class DirTree {
public:
static std::shared_ptr<DirTree> getCached(std::string root);
DirTree(std::string root) : root(root), isComplete(false) {}
DirTree(std::string root, FILE *f);
DirEntry *add(std::string path, uint64_t mtime, bool isDir);
DirEntry *find(std::string path);
DirEntry *update(std::string path, uint64_t mtime);
void remove(std::string path);
void write(FILE *f);
void getChanges(DirTree *snapshot, EventList &events);
std::mutex mMutex;
std::string root;
bool isComplete;
std::unordered_map<std::string, DirEntry> entries;
private:
DirEntry *_find(std::string path);
};
#endif
@@ -0,0 +1,798 @@
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
import { stat as statcb } from 'fs';
import { stat, readdir } from 'fs/promises';
import { EventEmitter } from 'events';
import * as sysPath from 'path';
import { readdirp } from 'readdirp';
import { NodeFsHandler, EVENTS as EV, isWindows, isIBMi, EMPTY_FN, STR_CLOSE, STR_END, } from './handler.js';
const SLASH = '/';
const SLASH_SLASH = '//';
const ONE_DOT = '.';
const TWO_DOTS = '..';
const STRING_TYPE = 'string';
const BACK_SLASH_RE = /\\/g;
const DOUBLE_SLASH_RE = /\/\//;
const DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
const REPLACER_RE = /^\.[/\\]/;
function arrify(item) {
return Array.isArray(item) ? item : [item];
}
const isMatcherObject = (matcher) => typeof matcher === 'object' && matcher !== null && !(matcher instanceof RegExp);
function createPattern(matcher) {
if (typeof matcher === 'function')
return matcher;
if (typeof matcher === 'string')
return (string) => matcher === string;
if (matcher instanceof RegExp)
return (string) => matcher.test(string);
if (typeof matcher === 'object' && matcher !== null) {
return (string) => {
if (matcher.path === string)
return true;
if (matcher.recursive) {
const relative = sysPath.relative(matcher.path, string);
if (!relative) {
return false;
}
return !relative.startsWith('..') && !sysPath.isAbsolute(relative);
}
return false;
};
}
return () => false;
}
function normalizePath(path) {
if (typeof path !== 'string')
throw new Error('string expected');
path = sysPath.normalize(path);
path = path.replace(/\\/g, '/');
let prepend = false;
if (path.startsWith('//'))
prepend = true;
const DOUBLE_SLASH_RE = /\/\//;
while (path.match(DOUBLE_SLASH_RE))
path = path.replace(DOUBLE_SLASH_RE, '/');
if (prepend)
path = '/' + path;
return path;
}
function matchPatterns(patterns, testString, stats) {
const path = normalizePath(testString);
for (let index = 0; index < patterns.length; index++) {
const pattern = patterns[index];
if (pattern(path, stats)) {
return true;
}
}
return false;
}
function anymatch(matchers, testString) {
if (matchers == null) {
throw new TypeError('anymatch: specify first argument');
}
// Early cache for matchers.
const matchersArray = arrify(matchers);
const patterns = matchersArray.map((matcher) => createPattern(matcher));
if (testString == null) {
return (testString, stats) => {
return matchPatterns(patterns, testString, stats);
};
}
return matchPatterns(patterns, testString);
}
const unifyPaths = (paths_) => {
const paths = arrify(paths_).flat();
if (!paths.every((p) => typeof p === STRING_TYPE)) {
throw new TypeError(`Non-string provided as watch path: ${paths}`);
}
return paths.map(normalizePathToUnix);
};
// If SLASH_SLASH occurs at the beginning of path, it is not replaced
// because "//StoragePC/DrivePool/Movies" is a valid network path
const toUnix = (string) => {
let str = string.replace(BACK_SLASH_RE, SLASH);
let prepend = false;
if (str.startsWith(SLASH_SLASH)) {
prepend = true;
}
while (str.match(DOUBLE_SLASH_RE)) {
str = str.replace(DOUBLE_SLASH_RE, SLASH);
}
if (prepend) {
str = SLASH + str;
}
return str;
};
// Our version of upath.normalize
// TODO: this is not equal to path-normalize module - investigate why
const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
// TODO: refactor
const normalizeIgnored = (cwd = '') => (path) => {
if (typeof path === 'string') {
return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));
}
else {
return path;
}
};
const getAbsolutePath = (path, cwd) => {
if (sysPath.isAbsolute(path)) {
return path;
}
return sysPath.join(cwd, path);
};
const EMPTY_SET = Object.freeze(new Set());
/**
* Directory entry.
*/
class DirEntry {
constructor(dir, removeWatcher) {
this.path = dir;
this._removeWatcher = removeWatcher;
this.items = new Set();
}
add(item) {
const { items } = this;
if (!items)
return;
if (item !== ONE_DOT && item !== TWO_DOTS)
items.add(item);
}
async remove(item) {
const { items } = this;
if (!items)
return;
items.delete(item);
if (items.size > 0)
return;
const dir = this.path;
try {
await readdir(dir);
}
catch (err) {
if (this._removeWatcher) {
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
}
}
}
has(item) {
const { items } = this;
if (!items)
return;
return items.has(item);
}
getChildren() {
const { items } = this;
if (!items)
return [];
return [...items.values()];
}
dispose() {
this.items.clear();
this.path = '';
this._removeWatcher = EMPTY_FN;
this.items = EMPTY_SET;
Object.freeze(this);
}
}
const STAT_METHOD_F = 'stat';
const STAT_METHOD_L = 'lstat';
export class WatchHelper {
constructor(path, follow, fsw) {
this.fsw = fsw;
const watchPath = path;
this.path = path = path.replace(REPLACER_RE, '');
this.watchPath = watchPath;
this.fullWatchPath = sysPath.resolve(watchPath);
this.dirParts = [];
this.dirParts.forEach((parts) => {
if (parts.length > 1)
parts.pop();
});
this.followSymlinks = follow;
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
}
entryPath(entry) {
return sysPath.join(this.watchPath, sysPath.relative(this.watchPath, entry.fullPath));
}
filterPath(entry) {
const { stats } = entry;
if (stats && stats.isSymbolicLink())
return this.filterDir(entry);
const resolvedPath = this.entryPath(entry);
// TODO: what if stats is undefined? remove !
return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
}
filterDir(entry) {
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
}
}
/**
* Watches files & directories for changes. Emitted events:
* `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
*
* new FSWatcher()
* .add(directories)
* .on('add', path => log('File', path, 'was added'))
*/
export class FSWatcher extends EventEmitter {
// Not indenting methods for history sake; for now.
constructor(_opts = {}) {
super();
this.closed = false;
this._closers = new Map();
this._ignoredPaths = new Set();
this._throttled = new Map();
this._streams = new Set();
this._symlinkPaths = new Map();
this._watched = new Map();
this._pendingWrites = new Map();
this._pendingUnlinks = new Map();
this._readyCount = 0;
this._readyEmitted = false;
const awf = _opts.awaitWriteFinish;
const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
const opts = {
// Defaults
persistent: true,
ignoreInitial: false,
ignorePermissionErrors: false,
interval: 100,
binaryInterval: 300,
followSymlinks: true,
usePolling: false,
// useAsync: false,
atomic: true, // NOTE: overwritten later (depends on usePolling)
..._opts,
// Change format
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === 'object' ? { ...DEF_AWF, ...awf } : false,
};
// Always default to polling on IBM i because fs.watch() is not available on IBM i.
if (isIBMi)
opts.usePolling = true;
// Editor atomic write normalization enabled by default with fs.watch
if (opts.atomic === undefined)
opts.atomic = !opts.usePolling;
// opts.atomic = typeof _opts.atomic === 'number' ? _opts.atomic : 100;
// Global override. Useful for developers, who need to force polling for all
// instances of chokidar, regardless of usage / dependency depth
const envPoll = process.env.CHOKIDAR_USEPOLLING;
if (envPoll !== undefined) {
const envLower = envPoll.toLowerCase();
if (envLower === 'false' || envLower === '0')
opts.usePolling = false;
else if (envLower === 'true' || envLower === '1')
opts.usePolling = true;
else
opts.usePolling = !!envLower;
}
const envInterval = process.env.CHOKIDAR_INTERVAL;
if (envInterval)
opts.interval = Number.parseInt(envInterval, 10);
// This is done to emit ready only once, but each 'add' will increase that?
let readyCalls = 0;
this._emitReady = () => {
readyCalls++;
if (readyCalls >= this._readyCount) {
this._emitReady = EMPTY_FN;
this._readyEmitted = true;
// use process.nextTick to allow time for listener to be bound
process.nextTick(() => this.emit(EV.READY));
}
};
this._emitRaw = (...args) => this.emit(EV.RAW, ...args);
this._boundRemove = this._remove.bind(this);
this.options = opts;
this._nodeFsHandler = new NodeFsHandler(this);
// You’re frozen when your heart’s not open.
Object.freeze(opts);
}
_addIgnoredPath(matcher) {
if (isMatcherObject(matcher)) {
// return early if we already have a deeply equal matcher object
for (const ignored of this._ignoredPaths) {
if (isMatcherObject(ignored) &&
ignored.path === matcher.path &&
ignored.recursive === matcher.recursive) {
return;
}
}
}
this._ignoredPaths.add(matcher);
}
_removeIgnoredPath(matcher) {
this._ignoredPaths.delete(matcher);
// now find any matcher objects with the matcher as path
if (typeof matcher === 'string') {
for (const ignored of this._ignoredPaths) {
// TODO (43081j): make this more efficient.
// probably just make a `this._ignoredDirectories` or some
// such thing.
if (isMatcherObject(ignored) && ignored.path === matcher) {
this._ignoredPaths.delete(ignored);
}
}
}
}
// Public methods
/**
* Adds paths to be watched on an existing FSWatcher instance.
* @param paths_ file or file list. Other arguments are unused
*/
add(paths_, _origAdd, _internal) {
const { cwd } = this.options;
this.closed = false;
this._closePromise = undefined;
let paths = unifyPaths(paths_);
if (cwd) {
paths = paths.map((path) => {
const absPath = getAbsolutePath(path, cwd);
// Check `path` instead of `absPath` because the cwd portion can't be a glob
return absPath;
});
}
paths.forEach((path) => {
this._removeIgnoredPath(path);
});
this._userIgnored = undefined;
if (!this._readyCount)
this._readyCount = 0;
this._readyCount += paths.length;
Promise.all(paths.map(async (path) => {
const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, undefined, 0, _origAdd);
if (res)
this._emitReady();
return res;
})).then((results) => {
if (this.closed)
return;
results.forEach((item) => {
if (item)
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
});
});
return this;
}
/**
* Close watchers or start ignoring events from specified paths.
*/
unwatch(paths_) {
if (this.closed)
return this;
const paths = unifyPaths(paths_);
const { cwd } = this.options;
paths.forEach((path) => {
// convert to absolute path unless relative path already matches
if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {
if (cwd)
path = sysPath.join(cwd, path);
path = sysPath.resolve(path);
}
this._closePath(path);
this._addIgnoredPath(path);
if (this._watched.has(path)) {
this._addIgnoredPath({
path,
recursive: true,
});
}
// reset the cached userIgnored anymatch fn
// to make ignoredPaths changes effective
this._userIgnored = undefined;
});
return this;
}
/**
* Close watchers and remove all listeners from watched paths.
*/
close() {
if (this._closePromise) {
return this._closePromise;
}
this.closed = true;
// Memory management.
this.removeAllListeners();
const closers = [];
this._closers.forEach((closerList) => closerList.forEach((closer) => {
const promise = closer();
if (promise instanceof Promise)
closers.push(promise);
}));
this._streams.forEach((stream) => stream.destroy());
this._userIgnored = undefined;
this._readyCount = 0;
this._readyEmitted = false;
this._watched.forEach((dirent) => dirent.dispose());
this._closers.clear();
this._watched.clear();
this._streams.clear();
this._symlinkPaths.clear();
this._throttled.clear();
this._closePromise = closers.length
? Promise.all(closers).then(() => undefined)
: Promise.resolve();
return this._closePromise;
}
/**
* Expose list of watched paths
* @returns for chaining
*/
getWatched() {
const watchList = {};
this._watched.forEach((entry, dir) => {
const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
const index = key || ONE_DOT;
watchList[index] = entry.getChildren().sort();
});
return watchList;
}
emitWithAll(event, args) {
this.emit(event, ...args);
if (event !== EV.ERROR)
this.emit(EV.ALL, event, ...args);
}
// Common helpers
// --------------
/**
* Normalize and emit events.
* Calling _emit DOES NOT MEAN emit() would be called!
* @param event Type of event
* @param path File or directory path
* @param stats arguments to be passed with event
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
*/
async _emit(event, path, stats) {
if (this.closed)
return;
const opts = this.options;
if (isWindows)
path = sysPath.normalize(path);
if (opts.cwd)
path = sysPath.relative(opts.cwd, path);
const args = [path];
if (stats != null)
args.push(stats);
const awf = opts.awaitWriteFinish;
let pw;
if (awf && (pw = this._pendingWrites.get(path))) {
pw.lastChange = new Date();
return this;
}
if (opts.atomic) {
if (event === EV.UNLINK) {
this._pendingUnlinks.set(path, [event, ...args]);
setTimeout(() => {
this._pendingUnlinks.forEach((entry, path) => {
this.emit(...entry);
this.emit(EV.ALL, ...entry);
this._pendingUnlinks.delete(path);
});
}, typeof opts.atomic === 'number' ? opts.atomic : 100);
return this;
}
if (event === EV.ADD && this._pendingUnlinks.has(path)) {
event = EV.CHANGE;
this._pendingUnlinks.delete(path);
}
}
if (awf && (event === EV.ADD || event === EV.CHANGE) && this._readyEmitted) {
const awfEmit = (err, stats) => {
if (err) {
event = EV.ERROR;
args[0] = err;
this.emitWithAll(event, args);
}
else if (stats) {
// if stats doesn't exist the file must have been deleted
if (args.length > 1) {
args[1] = stats;
}
else {
args.push(stats);
}
this.emitWithAll(event, args);
}
};
this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);
return this;
}
if (event === EV.CHANGE) {
const isThrottled = !this._throttle(EV.CHANGE, path, 50);
if (isThrottled)
return this;
}
if (opts.alwaysStat &&
stats === undefined &&
(event === EV.ADD || event === EV.ADD_DIR || event === EV.CHANGE)) {
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
let stats;
try {
stats = await stat(fullPath);
}
catch (err) {
// do nothing
}
// Suppress event when fs_stat fails, to avoid sending undefined 'stat'
if (!stats || this.closed)
return;
args.push(stats);
}
this.emitWithAll(event, args);
return this;
}
/**
* Common handler for errors
* @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
*/
_handleError(error) {
const code = error && error.code;
if (error &&
code !== 'ENOENT' &&
code !== 'ENOTDIR' &&
(!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))) {
this.emit(EV.ERROR, error);
}
return error || this.closed;
}
/**
* Helper utility for throttling
* @param actionType type being throttled
* @param path being acted upon
* @param timeout duration of time to suppress duplicate actions
* @returns tracking object or false if action should be suppressed
*/
_throttle(actionType, path, timeout) {
if (!this._throttled.has(actionType)) {
this._throttled.set(actionType, new Map());
}
const action = this._throttled.get(actionType);
if (!action)
throw new Error('invalid throttle');
const actionPath = action.get(path);
if (actionPath) {
actionPath.count++;
return false;
}
// eslint-disable-next-line prefer-const
let timeoutObject;
const clear = () => {
const item = action.get(path);
const count = item ? item.count : 0;
action.delete(path);
clearTimeout(timeoutObject);
if (item)
clearTimeout(item.timeoutObject);
return count;
};
timeoutObject = setTimeout(clear, timeout);
const thr = { timeoutObject, clear, count: 0 };
action.set(path, thr);
return thr;
}
_incrReadyCount() {
return this._readyCount++;
}
/**
* Awaits write operation to finish.
* Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
* @param path being acted upon
* @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
* @param event
* @param awfEmit Callback to be called when ready for event to be emitted.
*/
_awaitWriteFinish(path, threshold, event, awfEmit) {
const awf = this.options.awaitWriteFinish;
if (typeof awf !== 'object')
return;
const pollInterval = awf.pollInterval;
let timeoutHandler;
let fullPath = path;
if (this.options.cwd && !sysPath.isAbsolute(path)) {
fullPath = sysPath.join(this.options.cwd, path);
}
const now = new Date();
const writes = this._pendingWrites;
function awaitWriteFinishFn(prevStat) {
statcb(fullPath, (err, curStat) => {
if (err || !writes.has(path)) {
if (err && err.code !== 'ENOENT')
awfEmit(err);
return;
}
const now = Number(new Date());
if (prevStat && curStat.size !== prevStat.size) {
writes.get(path).lastChange = now;
}
const pw = writes.get(path);
const df = now - pw.lastChange;
if (df >= threshold) {
writes.delete(path);
awfEmit(undefined, curStat);
}
else {
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
}
});
}
if (!writes.has(path)) {
writes.set(path, {
lastChange: now,
cancelWait: () => {
writes.delete(path);
clearTimeout(timeoutHandler);
return event;
},
});
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
}
}
/**
* Determines whether user has asked to ignore this path.
*/
_isIgnored(path, stats) {
if (this.options.atomic && DOT_RE.test(path))
return true;
if (!this._userIgnored) {
const { cwd } = this.options;
const ign = this.options.ignored;
const ignored = (ign || []).map(normalizeIgnored(cwd));
const ignoredPaths = [...this._ignoredPaths];
const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
this._userIgnored = anymatch(list, undefined);
}
return this._userIgnored(path, stats);
}
_isntIgnored(path, stat) {
return !this._isIgnored(path, stat);
}
/**
* Provides a set of common helpers and properties relating to symlink handling.
* @param path file or directory pattern being watched
*/
_getWatchHelpers(path) {
return new WatchHelper(path, this.options.followSymlinks, this);
}
// Directory helpers
// -----------------
/**
* Provides directory tracking objects
* @param directory path of the directory
*/
_getWatchedDir(directory) {
const dir = sysPath.resolve(directory);
if (!this._watched.has(dir))
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
return this._watched.get(dir);
}
// File helpers
// ------------
/**
* Check for read permissions: https://stackoverflow.com/a/11781404/1358405
*/
_hasReadPermissions(stats) {
if (this.options.ignorePermissionErrors)
return true;
return Boolean(Number(stats.mode) & 0o400);
}
/**
* Handles emitting unlink events for
* files and directories, and via recursion, for
* files and directories within directories that are unlinked
* @param directory within which the following item is located
* @param item base path of item/directory
*/
_remove(directory, item, isDirectory) {
// if what is being deleted is a directory, get that directory's paths
// for recursive deleting and cleaning of watched object
// if it is not a directory, nestedDirectoryChildren will be empty array
const path = sysPath.join(directory, item);
const fullPath = sysPath.resolve(path);
isDirectory =
isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
// prevent duplicate handling in case of arriving here nearly simultaneously
// via multiple paths (such as _handleFile and _handleDir)
if (!this._throttle('remove', path, 100))
return;
// if the only watched file is removed, watch for its return
if (!isDirectory && this._watched.size === 1) {
this.add(directory, item, true);
}
// This will create a new entry in the watched object in either case
// so we got to do the directory check beforehand
const wp = this._getWatchedDir(path);
const nestedDirectoryChildren = wp.getChildren();
// Recursively remove children directories / files.
nestedDirectoryChildren.forEach((nested) => this._remove(path, nested));
// Check if item was on the watched list and remove it
const parent = this._getWatchedDir(directory);
const wasTracked = parent.has(item);
parent.remove(item);
// Fixes issue #1042 -> Relative paths were detected and added as symlinks
// (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),
// but never removed from the map in case the path was deleted.
// This leads to an incorrect state if the path was recreated:
// https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553
if (this._symlinkPaths.has(fullPath)) {
this._symlinkPaths.delete(fullPath);
}
// If we wait for this file to be fully written, cancel the wait.
let relPath = path;
if (this.options.cwd)
relPath = sysPath.relative(this.options.cwd, path);
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
const event = this._pendingWrites.get(relPath).cancelWait();
if (event === EV.ADD)
return;
}
// The Entry will either be a directory that just got removed
// or a bogus entry to a file, in either case we have to remove it
this._watched.delete(path);
this._watched.delete(fullPath);
const eventName = isDirectory ? EV.UNLINK_DIR : EV.UNLINK;
if (wasTracked && !this._isIgnored(path))
this._emit(eventName, path);
// Avoid conflicts if we later create another file with the same name
this._closePath(path);
}
/**
* Closes all watchers for a path
*/
_closePath(path) {
this._closeFile(path);
const dir = sysPath.dirname(path);
this._getWatchedDir(dir).remove(sysPath.basename(path));
}
/**
* Closes only file-specific watchers
*/
_closeFile(path) {
const closers = this._closers.get(path);
if (!closers)
return;
closers.forEach((closer) => closer());
this._closers.delete(path);
}
_addPathCloser(path, closer) {
if (!closer)
return;
let list = this._closers.get(path);
if (!list) {
list = [];
this._closers.set(path, list);
}
list.push(closer);
}
_readdirp(root, opts) {
if (this.closed)
return;
const options = { type: EV.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
let stream = readdirp(root, options);
this._streams.add(stream);
stream.once(STR_CLOSE, () => {
stream = undefined;
});
stream.once(STR_END, () => {
if (stream) {
this._streams.delete(stream);
stream = undefined;
}
});
return stream;
}
}
/**
* Instantiates watcher with paths to be tracked.
* @param paths file / directory paths
* @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others
* @returns an instance of FSWatcher for chaining.
* @example
* const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });
* watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })
*/
export function watch(paths, options = {}) {
const watcher = new FSWatcher(options);
watcher.add(paths);
return watcher;
}
export default { watch, FSWatcher };
@@ -0,0 +1 @@
{"version":3,"file":"corner-right-down.js","sources":["../../../src/icons/corner-right-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CornerRightDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxMCAxNSAxNSAyMCAyMCAxNSIgLz4KICA8cGF0aCBkPSJNNCA0aDdhNCA0IDAgMCAxIDQgNHYxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-right-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CornerRightDown = createLucideIcon('CornerRightDown', [\n ['polyline', { points: '10 15 15 20 20 15', key: 'axus6l' }],\n ['path', { d: 'M4 4h7a4 4 0 0 1 4 4v12', key: 'wcbgct' }],\n]);\n\nexport default CornerRightDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAqB,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,CAC3D,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 @@
{"version":3,"file":"velocity-per-second.mjs","sources":["../../src/velocity-per-second.ts"],"sourcesContent":["/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nexport function velocityPerSecond(velocity: number, frameDuration: number) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKE;AACI,SAAU,iBAAiB,CAAC,QAAgB,EAAE,aAAqB,EAAA;AACrE,IAAA,OAAO,aAAa,GAAG,QAAQ,IAAI,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC;AAChE;;;;"}
@@ -0,0 +1,21 @@
// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
// if lib.esnext.iterator is loaded.
// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn.
// Placeholders for TS <5.6
interface IteratorObject<T, TReturn, TNext> {}
interface AsyncIteratorObject<T, TReturn, TNext> {}
declare namespace NodeJS {
// Populate iterator methods for TS <5.6
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
globalThis.Iterator<any, infer TReturn> ? TReturn
: any;
}
@@ -0,0 +1,202 @@
/**
* @fileoverview Traverser to traverse AST trees.
* @author Nicholas C. Zakas
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const vk = require("eslint-visitor-keys");
const debug = require("debug")("eslint:traverser");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Do nothing.
* @returns {void}
*/
function noop() {
// do nothing.
}
/**
* Check whether the given value is an ASTNode or not.
* @param {any} x The value to check.
* @returns {boolean} `true` if the value is an ASTNode.
*/
function isNode(x) {
return x !== null && typeof x === "object" && typeof x.type === "string";
}
/**
* Get the visitor keys of a given node.
* @param {Object} visitorKeys The map of visitor keys.
* @param {ASTNode} node The node to get their visitor keys.
* @returns {string[]} The visitor keys of the node.
*/
function getVisitorKeys(visitorKeys, node) {
let keys = visitorKeys[node.type];
if (!keys) {
keys = vk.getKeys(node);
debug(
'Unknown node type "%s": Estimated visitor keys %j',
node.type,
keys,
);
}
return keys;
}
/**
* The traverser class to traverse AST trees.
*/
class Traverser {
constructor() {
this._current = null;
this._parents = [];
this._skipped = false;
this._broken = false;
this._visitorKeys = null;
this._enter = null;
this._leave = null;
}
/**
* Gives current node.
* @returns {ASTNode} The current node.
*/
current() {
return this._current;
}
/**
* Gives a copy of the ancestor nodes.
* @returns {ASTNode[]} The ancestor nodes.
*/
parents() {
return this._parents.slice(0);
}
/**
* Break the current traversal.
* @returns {void}
*/
break() {
this._broken = true;
}
/**
* Skip child nodes for the current traversal.
* @returns {void}
*/
skip() {
this._skipped = true;
}
/**
* Traverse the given AST tree.
* @param {ASTNode} node The root node to traverse.
* @param {Object} options The option object.
* @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`.
* @param {Function} [options.enter=noop] The callback function which is called on entering each node.
* @param {Function} [options.leave=noop] The callback function which is called on leaving each node.
* @returns {void}
*/
traverse(node, options) {
this._current = null;
this._parents = [];
this._skipped = false;
this._broken = false;
this._visitorKeys = options.visitorKeys || vk.KEYS;
this._enter = options.enter || noop;
this._leave = options.leave || noop;
this._traverse(node, null);
}
/**
* Traverse the given AST tree recursively.
* @param {ASTNode} node The current node.
* @param {ASTNode|null} parent The parent node.
* @returns {void}
* @private
*/
_traverse(node, parent) {
if (!isNode(node)) {
return;
}
this._current = node;
this._skipped = false;
this._enter(node, parent);
if (!this._skipped && !this._broken) {
const keys = getVisitorKeys(this._visitorKeys, node);
if (keys.length >= 1) {
this._parents.push(node);
for (let i = 0; i < keys.length && !this._broken; ++i) {
const child = node[keys[i]];
if (Array.isArray(child)) {
for (
let j = 0;
j < child.length && !this._broken;
++j
) {
this._traverse(child[j], node);
}
} else {
this._traverse(child, node);
}
}
this._parents.pop();
}
}
if (!this._broken) {
this._leave(node, parent);
}
this._current = parent;
}
/**
* Calculates the keys to use for traversal.
* @param {ASTNode} node The node to read keys from.
* @returns {string[]} An array of keys to visit on the node.
* @private
*/
static getKeys(node) {
return vk.getKeys(node);
}
/**
* Traverse the given AST tree.
* @param {ASTNode} node The root node to traverse.
* @param {Object} options The option object.
* @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`.
* @param {Function} [options.enter=noop] The callback function which is called on entering each node.
* @param {Function} [options.leave=noop] The callback function which is called on leaving each node.
* @returns {void}
*/
static traverse(node, options) {
new Traverser().traverse(node, options);
}
/**
* The default visitor keys.
* @type {Object}
*/
static get DEFAULT_VISITOR_KEYS() {
return vk.KEYS;
}
}
module.exports = Traverser;
@@ -0,0 +1,31 @@
import { invalidKeyInput } from './invalid_key_input.js';
import { encode as b64u } from '../util/base64url.js';
import { isCryptoKey, isKeyObject } from './is_key_like.js';
export async function keyToJWK(key) {
if (isKeyObject(key)) {
if (key.type === 'secret') {
key = key.export();
}
else {
return key.export({ format: 'jwk' });
}
}
if (key instanceof Uint8Array) {
return {
kty: 'oct',
k: b64u(key),
};
}
if (!isCryptoKey(key)) {
throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject', 'Uint8Array'));
}
if (!key.extractable) {
throw new TypeError('non-extractable CryptoKey cannot be exported as a JWK');
}
const { ext, key_ops, alg, use, ...jwk } = await crypto.subtle.exportKey('jwk', key);
if (jwk.kty === 'AKP') {
;
jwk.alg = alg;
}
return jwk;
}
@@ -0,0 +1,7 @@
import { RankedDictionary } from '../types';
export interface FindLevenshteinDistanceResult {
levenshteinDistance: number;
levenshteinDistanceEntry: string;
}
declare const findLevenshteinDistance: (password: string, rankedDictionary: RankedDictionary, threshold: number) => Partial<FindLevenshteinDistanceResult>;
export default findLevenshteinDistance;
@@ -0,0 +1,22 @@
import { E as Environment } from './chunks/environment.d.CrsxCzP1.js';
export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.CrsxCzP1.js';
import '@vitest/utils';
declare const environments: {
"node": Environment;
"jsdom": Environment;
"happy-dom": Environment;
"edge-runtime": Environment;
};
interface PopulateOptions {
bindFunctions?: boolean;
additionalKeys?: string[];
}
declare function populateGlobal(global: any, win: any, options?: PopulateOptions): {
keys: Set<string>;
skipKeys: string[];
originals: Map<string | symbol, any>;
};
export { Environment, environments as builtinEnvironments, populateGlobal };
@@ -0,0 +1,26 @@
/**
* @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 ScanEye = createLucideIcon("ScanEye", [
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
[
"path",
{
d: "M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",
key: "11ak4c"
}
]
]);
export { ScanEye as default };
//# sourceMappingURL=scan-eye.js.map
@@ -0,0 +1,246 @@
import utils from './utils'
import estimateGuesses from './estimate'
import { MIN_GUESSES_BEFORE_GROWING_SEQUENCE } from '../data/const'
import {
MatchExtended,
BruteForceMatch,
MatchEstimated,
Optimal,
} from '../types'
import Options from '../Options'
export default class Scoring {
private password = ''
private optimal: Optimal = {} as Optimal
private excludeAdditive = false
constructor(private options: Options) {}
private fillArray(size: number, valueType: 'object' | 'array') {
const result: any[] = []
for (let i = 0; i < size; i += 1) {
let value: any = []
if (valueType === 'object') {
value = {}
}
result.push(value)
}
return result
}
// helper: make bruteforce match objects spanning i to j, inclusive.
private makeBruteforceMatch(i: number, j: number): BruteForceMatch {
return {
pattern: 'bruteforce',
token: this.password.slice(i, j + 1 || 9e9),
i,
j,
}
}
// helper: considers whether a length-sequenceLength
// sequence ending at match bestMatches is better (fewer guesses)
// than previously encountered sequences, updating state if so.
// eslint-disable-next-line max-statements
private update(match: MatchExtended, sequenceLength: number) {
const k = match.j
const estimatedMatch = estimateGuesses(this.options, match, this.password)
let pi = estimatedMatch.guesses
if (sequenceLength > 1) {
// we're considering a length-sequenceLength sequence ending with match bestMatches:
// obtain the product term in the minimization function by multiplying bestMatches's guesses
// by the product of the length-(sequenceLength-1)
// sequence ending just before bestMatches, at bestMatches.i - 1.
pi *=
this.optimal.guessesProduct[estimatedMatch.i - 1][sequenceLength - 1]
}
// calculate the minimization func
let g = utils.factorial(sequenceLength) * pi
if (!this.excludeAdditive) {
g += MIN_GUESSES_BEFORE_GROWING_SEQUENCE ** (sequenceLength - 1)
}
// update state if new best.
// first see if any competing sequences covering this prefix,
// with sequenceLength or fewer matches,
// fare better than this sequence. if so, skip it and return.
let shouldSkip = false
const competingG = this.optimal.totalGuesses[k]
Object.keys(competingG).forEach((competingPatternLengthStr) => {
const competingPatternLength = parseInt(competingPatternLengthStr, 10)
const competingMetricMatch = competingG[competingPatternLength]
if (competingPatternLength <= sequenceLength) {
if (competingMetricMatch <= g) {
shouldSkip = true
}
}
})
if (!shouldSkip) {
// this sequence might be part of the final optimal sequence.
this.optimal.totalGuesses[k][sequenceLength] = g
this.optimal.bestMatches[k][sequenceLength] = estimatedMatch
this.optimal.guessesProduct[k][sequenceLength] = pi
}
}
// helper: evaluate bruteforce matches ending at passwordCharIndex.
private bruteforceUpdate(passwordCharIndex: number) {
// see if a single bruteforce match spanning the passwordCharIndex-prefix is optimal.
let match = this.makeBruteforceMatch(0, passwordCharIndex)
this.update(match, 1)
for (let i = 1; i <= passwordCharIndex; i += 1) {
// generate passwordCharIndex bruteforce matches, spanning from (i=1, j=passwordCharIndex) up to (i=passwordCharIndex, j=passwordCharIndex).
// see if adding these new matches to any of the sequences in optimal[i-1]
// leads to new bests.
match = this.makeBruteforceMatch(i, passwordCharIndex)
const tmp = this.optimal.bestMatches[i - 1]
Object.keys(tmp).forEach((sequenceLengthStr) => {
const sequenceLength = parseInt(sequenceLengthStr, 10)
const lastMatch = tmp[sequenceLength]
// corner: an optimal sequence will never have two adjacent bruteforce matches.
// it is strictly better to have a single bruteforce match spanning the same region:
// same contribution to the guess product with a lower length.
// --> safe to skip those cases.
if (lastMatch.pattern !== 'bruteforce') {
// try adding bestMatches to this length-sequenceLength sequence.
this.update(match, sequenceLength + 1)
}
})
}
}
// helper: step backwards through optimal.bestMatches starting at the end,
// constructing the final optimal match sequence.
private unwind(passwordLength: number) {
const optimalMatchSequence: MatchEstimated[] = []
let k = passwordLength - 1
// find the final best sequence length and score
let sequenceLength = 0
// eslint-disable-next-line no-loss-of-precision
let g = 2e308
const temp = this.optimal.totalGuesses[k]
// safety check for empty passwords
if (temp) {
Object.keys(temp).forEach((candidateSequenceLengthStr) => {
const candidateSequenceLength = parseInt(candidateSequenceLengthStr, 10)
const candidateMetricMatch = temp[candidateSequenceLength]
if (candidateMetricMatch < g) {
sequenceLength = candidateSequenceLength
g = candidateMetricMatch
}
})
}
while (k >= 0) {
const match: MatchEstimated = this.optimal.bestMatches[k][sequenceLength]
optimalMatchSequence.unshift(match)
k = match.i - 1
sequenceLength -= 1
}
return optimalMatchSequence
}
// ------------------------------------------------------------------------------
// search --- most guessable match sequence -------------------------------------
// ------------------------------------------------------------------------------
//
// takes a sequence of overlapping matches, returns the non-overlapping sequence with
// minimum guesses. the following is a O(l_max * (n + m)) dynamic programming algorithm
// for a length-n password with m candidate matches. l_max is the maximum optimal
// sequence length spanning each prefix of the password. In practice it rarely exceeds 5 and the
// search terminates rapidly.
//
// the optimal "minimum guesses" sequence is here defined to be the sequence that
// minimizes the following function:
//
// totalGuesses = sequenceLength! * Product(m.guesses for m in sequence) + D^(sequenceLength - 1)
//
// where sequenceLength is the length of the sequence.
//
// the factorial term is the number of ways to order sequenceLength patterns.
//
// the D^(sequenceLength-1) term is another length penalty, roughly capturing the idea that an
// attacker will try lower-length sequences first before trying length-sequenceLength sequences.
//
// for example, consider a sequence that is date-repeat-dictionary.
// - an attacker would need to try other date-repeat-dictionary combinations,
// hence the product term.
// - an attacker would need to try repeat-date-dictionary, dictionary-repeat-date,
// ..., hence the factorial term.
// - an attacker would also likely try length-1 (dictionary) and length-2 (dictionary-date)
// sequences before length-3. assuming at minimum D guesses per pattern type,
// D^(sequenceLength-1) approximates Sum(D^i for i in [1..sequenceLength-1]
//
// ------------------------------------------------------------------------------
mostGuessableMatchSequence(
password: string,
matches: MatchExtended[],
excludeAdditive = false,
) {
this.password = password
this.excludeAdditive = excludeAdditive
const passwordLength = password.length
// partition matches into sublists according to ending index j
let matchesByCoordinateJ = this.fillArray(passwordLength, 'array')
matches.forEach((match) => {
matchesByCoordinateJ[match.j].push(match)
})
// small detail: for deterministic output, sort each sublist by i.
matchesByCoordinateJ = matchesByCoordinateJ.map((match) =>
match.sort((m1: MatchExtended, m2: MatchExtended) => m1.i - m2.i),
)
this.optimal = {
// optimal.bestMatches[k][sequenceLength] holds final match in the best length-sequenceLength
// match sequence covering the
// password prefix up to k, inclusive.
// if there is no length-sequenceLength sequence that scores better (fewer guesses) than
// a shorter match sequence spanning the same prefix,
// optimal.bestMatches[k][sequenceLength] is undefined.
bestMatches: this.fillArray(passwordLength, 'object'),
// same structure as optimal.bestMatches -- holds the product term Prod(bestMatches.guesses for bestMatches in sequence).
// optimal.guessesProduct allows for fast (non-looping) updates to the minimization function.
guessesProduct: this.fillArray(passwordLength, 'object'),
// same structure as optimal.bestMatches -- holds the overall metric.
totalGuesses: this.fillArray(passwordLength, 'object'),
}
for (let k = 0; k < passwordLength; k += 1) {
matchesByCoordinateJ[k].forEach((match: MatchExtended) => {
if (match.i > 0) {
const prevM = this.optimal.bestMatches[match.i - 1]
Object.keys(prevM).forEach((sequenceLengthStr) => {
const sequenceLength = parseInt(sequenceLengthStr, 10)
this.update(match, sequenceLength + 1)
})
} else {
this.update(match, 1)
}
})
this.bruteforceUpdate(k)
}
const optimalMatchSequence = this.unwind(passwordLength)
const optimalSequenceLength = optimalMatchSequence.length
const guesses = this.getGuesses(password, optimalSequenceLength)
return {
password,
guesses,
guessesLog10: utils.log10(guesses),
sequence: optimalMatchSequence,
}
}
getGuesses(password: string, optimalSequenceLength: number) {
const passwordLength = password.length
if (password.length === 0) {
return 1
} else {
return this.optimal.totalGuesses[passwordLength - 1][
optimalSequenceLength
]
}
}
}
@@ -0,0 +1,145 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_cookie = require("../utils/cookie.js");
const require_client_utils = require("./utils.js");
//#region src/client/client.ts
const createProxy = (callback, path) => {
return new Proxy(() => {}, {
get(_obj, key) {
if (typeof key !== "string" || key === "then") return;
return createProxy(callback, [...path, key]);
},
apply(_1, _2, args) {
return callback({
path,
args
});
}
});
};
const appendQueryParams = (url, searchParams) => {
const queryString = searchParams.toString();
return queryString ? `${url}?${queryString}` : url;
};
var ClientRequestImpl = class {
url;
method;
buildSearchParams;
queryParams = void 0;
pathParams = {};
rBody;
cType = void 0;
constructor(url, method, options) {
this.url = url;
this.method = method;
this.buildSearchParams = options.buildSearchParams;
}
fetch = async (args, opt) => {
if (args) {
if (args.query) this.queryParams = this.buildSearchParams(args.query);
if (args.form) {
const form = new FormData();
for (const [k, v] of Object.entries(args.form)) {
if (v === void 0) continue;
if (Array.isArray(v)) for (const v2 of v) {
if (v2 === void 0) continue;
form.append(k, v2);
}
else form.append(k, v);
}
this.rBody = form;
}
if (args.json !== void 0) {
this.rBody = JSON.stringify(args.json);
this.cType = "application/json";
}
if (args.param) this.pathParams = args.param;
}
let methodUpperCase = this.method.toUpperCase();
const headerValues = {
...args?.header,
...typeof opt?.headers === "function" ? await opt.headers() : opt?.headers
};
if (args?.cookie) {
const cookies = [];
for (const [key, value] of Object.entries(args.cookie)) {
if (value === void 0) continue;
cookies.push(require_utils_cookie.serialize(key, value));
}
if (cookies.length > 0) headerValues["Cookie"] = cookies.join("; ");
}
if (this.cType) headerValues["Content-Type"] = this.cType;
const headers = new Headers();
for (const [key, value] of Object.entries(headerValues)) if (value !== void 0) headers.set(key, value);
let url = this.url;
url = require_client_utils.removeIndexString(url);
url = require_client_utils.replaceUrlParam(url, this.pathParams);
if (this.queryParams) url = appendQueryParams(url, this.queryParams);
methodUpperCase = this.method.toUpperCase();
const setBody = !(methodUpperCase === "GET" || methodUpperCase === "HEAD");
return (opt?.fetch || fetch)(url, {
body: setBody ? this.rBody : void 0,
method: methodUpperCase,
headers,
...opt?.init
});
};
};
const hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
const buildSearchParamsOption = options?.buildSearchParams ?? require_client_utils.buildSearchParams;
const parts = [...opts.path];
const lastParts = parts.slice(-3).reverse();
if (lastParts[0] === "toString") {
if (lastParts[1] === "name") return lastParts[2] || "";
return proxyCallback.toString();
}
if (lastParts[0] === "valueOf") {
if (lastParts[1] === "name") return lastParts[2] || "";
return proxyCallback;
}
let method = "";
if (/^\$/.test(lastParts[0])) {
const last = parts.pop();
if (last) method = last.replace(/^\$/, "");
}
const path = parts.join("/");
const url = require_client_utils.mergePath(baseUrl, path);
if (method === "url" || method === "path") {
let result = require_client_utils.removeIndexString(url);
if (opts.args[0]) {
if (opts.args[0].param) result = require_client_utils.replaceUrlParam(result, opts.args[0].param);
if (opts.args[0].query) result = appendQueryParams(result, buildSearchParamsOption(opts.args[0].query));
}
if (method === "url") return new URL(result);
return result.slice(baseUrl.replace(/\/+$/, "").length).replace(/^\/?/, "/");
}
if (method === "ws") {
const normalizedUrl = require_client_utils.removeIndexString(url);
const webSocketUrl = require_client_utils.replaceUrlProtocol(opts.args[0]?.param ? require_client_utils.replaceUrlParam(normalizedUrl, opts.args[0].param) : normalizedUrl, "ws");
const targetUrl = new URL(webSocketUrl);
const queryParams = opts.args[0]?.query;
if (queryParams) buildSearchParamsOption(queryParams).forEach((value, key) => {
targetUrl.searchParams.append(key, value);
});
const establishWebSocket = (...args) => {
if (options?.webSocket !== void 0 && typeof options.webSocket === "function") return options.webSocket(...args);
return new WebSocket(...args);
};
return establishWebSocket(targetUrl.toString());
}
const req = new ClientRequestImpl(url, method, { buildSearchParams: buildSearchParamsOption });
if (method) {
options ??= {};
const reqOptions = { ...opts.args[1] };
const baseHeaders = options.headers;
const reqHeaders = reqOptions.headers;
if (baseHeaders && reqHeaders) reqOptions.headers = async () => ({
...typeof baseHeaders === "function" ? await baseHeaders() : baseHeaders,
...typeof reqHeaders === "function" ? await reqHeaders() : reqHeaders
});
const args = require_client_utils.deepMerge(options, reqOptions);
return req.fetch(opts.args[0], args);
}
return req;
}, []);
//#endregion
exports.hc = hc;
@@ -0,0 +1,505 @@
"use strict";
// This rule was feature-frozen before we enabled no-property-in-node.
/* eslint-disable eslint-plugin/no-property-in-node */
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const naming_convention_utils_1 = require("./naming-convention-utils");
// This essentially mirrors ESLint's `camelcase` rule
// note that that rule ignores leading and trailing underscores and only checks those in the middle of a variable name
const defaultCamelCaseAllTheThingsConfig = [
{
format: ['camelCase'],
leadingUnderscore: 'allow',
selector: 'default',
trailingUnderscore: 'allow',
},
{
format: ['camelCase', 'PascalCase'],
selector: 'import',
},
{
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
selector: 'variable',
trailingUnderscore: 'allow',
},
{
format: ['PascalCase'],
selector: 'typeLike',
},
];
exports.default = (0, util_1.createRule)({
name: 'naming-convention',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce naming conventions for everything across a codebase',
// technically only requires type checking if the user uses "type" modifiers
frozen: true,
requiresTypeChecking: true,
},
messages: {
doesNotMatchFormat: '{{type}} name `{{name}}` must match one of the following formats: {{formats}}',
doesNotMatchFormatTrimmed: '{{type}} name `{{name}}` trimmed as `{{processedName}}` must match one of the following formats: {{formats}}',
missingAffix: '{{type}} name `{{name}}` must have one of the following {{position}}es: {{affixes}}',
missingUnderscore: '{{type}} name `{{name}}` must have {{count}} {{position}} underscore(s).',
satisfyCustom: '{{type}} name `{{name}}` must {{regexMatch}} the RegExp: {{regex}}',
unexpectedUnderscore: '{{type}} name `{{name}}` must not have a {{position}} underscore.',
},
schema: naming_convention_utils_1.SCHEMA,
},
defaultOptions: defaultCamelCaseAllTheThingsConfig,
create(contextWithoutDefaults) {
const context = contextWithoutDefaults.options.length > 0
? contextWithoutDefaults
: // only apply the defaults when the user provides no config
Object.setPrototypeOf({
options: defaultCamelCaseAllTheThingsConfig,
}, contextWithoutDefaults);
const validators = (0, naming_convention_utils_1.parseOptions)(context);
const compilerOptions = (0, util_1.getParserServices)(context, true).program?.getCompilerOptions() ?? {};
function handleMember(validator, node, modifiers) {
const key = node.key;
if (requiresQuoting(key, compilerOptions.target)) {
modifiers.add(naming_convention_utils_1.Modifiers.requiresQuotes);
}
validator(key, modifiers);
}
function getMemberModifiers(node) {
const modifiers = new Set();
if ('key' in node && node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
modifiers.add(naming_convention_utils_1.Modifiers['#private']);
}
else if (node.accessibility) {
modifiers.add(naming_convention_utils_1.Modifiers[node.accessibility]);
}
else {
modifiers.add(naming_convention_utils_1.Modifiers.public);
}
if (node.static) {
modifiers.add(naming_convention_utils_1.Modifiers.static);
}
if ('readonly' in node && node.readonly) {
modifiers.add(naming_convention_utils_1.Modifiers.readonly);
}
if ('override' in node && node.override) {
modifiers.add(naming_convention_utils_1.Modifiers.override);
}
if (node.type === utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition ||
node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition ||
node.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty) {
modifiers.add(naming_convention_utils_1.Modifiers.abstract);
}
return modifiers;
}
const { unusedVariables } = (0, util_1.collectVariables)(context);
function isUnused(name, initialScope) {
let variable = null;
let scope = initialScope;
while (scope) {
variable = scope.set.get(name) ?? null;
if (variable) {
break;
}
scope = scope.upper;
}
if (!variable) {
return false;
}
return unusedVariables.has(variable);
}
function isDestructured(id) {
return (
// `const { x }`
// does not match `const { x: y }`
(id.parent.type === utils_1.AST_NODE_TYPES.Property && id.parent.shorthand) ||
// `const { x = 2 }`
// does not match const `{ x: y = 2 }`
(id.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern &&
id.parent.parent.type === utils_1.AST_NODE_TYPES.Property &&
id.parent.parent.shorthand));
}
function isAsyncMemberOrProperty(propertyOrMemberNode) {
return Boolean('value' in propertyOrMemberNode &&
propertyOrMemberNode.value &&
'async' in propertyOrMemberNode.value &&
propertyOrMemberNode.value.async);
}
function isAsyncVariableIdentifier(id) {
return Boolean(('async' in id.parent && id.parent.async) ||
('init' in id.parent &&
id.parent.init &&
'async' in id.parent.init &&
id.parent.init.async));
}
const selectors = {
// #region import
'FunctionDeclaration, TSDeclareFunction, FunctionExpression': {
handler: (node, validator) => {
if (node.id == null) {
return;
}
const modifiers = new Set();
// functions create their own nested scope
const scope = context.sourceCode.getScope(node).upper;
if (isGlobal(scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.global);
}
if (isExported(node, node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.exported);
}
if (isUnused(node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
if (node.async) {
modifiers.add(naming_convention_utils_1.Modifiers.async);
}
validator(node.id, modifiers);
},
validator: validators.function,
},
// #endregion
// #region variable
'ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier': {
handler: (node, validator) => {
const modifiers = new Set();
switch (node.type) {
case utils_1.AST_NODE_TYPES.ImportDefaultSpecifier:
modifiers.add(naming_convention_utils_1.Modifiers.default);
break;
case utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier:
modifiers.add(naming_convention_utils_1.Modifiers.namespace);
break;
case utils_1.AST_NODE_TYPES.ImportSpecifier:
// Handle `import { default as Foo }`
if (node.imported.type === utils_1.AST_NODE_TYPES.Identifier &&
node.imported.name !== 'default') {
return;
}
modifiers.add(naming_convention_utils_1.Modifiers.default);
break;
}
validator(node.local, modifiers);
},
validator: validators.import,
},
// #endregion
// #region function
VariableDeclarator: {
handler: (node, validator) => {
const identifiers = getIdentifiersFromPattern(node.id);
const baseModifiers = new Set();
const parent = node.parent;
if (parent.kind === 'const') {
baseModifiers.add(naming_convention_utils_1.Modifiers.const);
}
if (isGlobal(context.sourceCode.getScope(node))) {
baseModifiers.add(naming_convention_utils_1.Modifiers.global);
}
identifiers.forEach(id => {
const modifiers = new Set(baseModifiers);
if (isDestructured(id)) {
modifiers.add(naming_convention_utils_1.Modifiers.destructured);
}
const scope = context.sourceCode.getScope(id);
if (isExported(parent, id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.exported);
}
if (isUnused(id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
if (isAsyncVariableIdentifier(id)) {
modifiers.add(naming_convention_utils_1.Modifiers.async);
}
validator(id, modifiers);
});
},
validator: validators.variable,
},
// #endregion function
// #region parameter
':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]': {
handler: (node, validator) => {
const modifiers = getMemberModifiers(node);
handleMember(validator, node, modifiers);
},
validator: validators.classProperty,
},
// #endregion parameter
// #region parameterProperty
':not(ObjectPattern) > Property[computed = false][kind = "init"][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]': {
handler: (node, validator) => {
const modifiers = new Set([naming_convention_utils_1.Modifiers.public]);
handleMember(validator, node, modifiers);
},
validator: validators.objectLiteralProperty,
},
// #endregion parameterProperty
// #region property
[[
':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "ArrowFunctionExpression"]',
':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "FunctionExpression"]',
':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "TSEmptyBodyFunctionExpression"]',
':matches(MethodDefinition, TSAbstractMethodDefinition)[computed = false][kind = "method"]',
].join(', ')]: {
handler: (node, validator) => {
const modifiers = getMemberModifiers(node);
if (isAsyncMemberOrProperty(node)) {
modifiers.add(naming_convention_utils_1.Modifiers.async);
}
handleMember(validator, node, modifiers);
},
validator: validators.classMethod,
},
[[
'MethodDefinition[computed = false]:matches([kind = "get"], [kind = "set"])',
'TSAbstractMethodDefinition[computed = false]:matches([kind="get"], [kind="set"])',
].join(', ')]: {
handler: (node, validator) => {
const modifiers = getMemberModifiers(node);
handleMember(validator, node, modifiers);
},
validator: validators.classicAccessor,
},
[[
'Property[computed = false][kind = "init"][value.type = "ArrowFunctionExpression"]',
'Property[computed = false][kind = "init"][value.type = "FunctionExpression"]',
'Property[computed = false][kind = "init"][value.type = "TSEmptyBodyFunctionExpression"]',
].join(', ')]: {
handler: (node, validator) => {
const modifiers = new Set([naming_convention_utils_1.Modifiers.public]);
if (isAsyncMemberOrProperty(node)) {
modifiers.add(naming_convention_utils_1.Modifiers.async);
}
handleMember(validator, node, modifiers);
},
validator: validators.objectLiteralMethod,
},
// #endregion property
// #region method
[[
'TSMethodSignature[computed = false]',
'TSPropertySignature[computed = false][typeAnnotation.typeAnnotation.type = "TSFunctionType"]',
].join(', ')]: {
handler: (node, validator) => {
const modifiers = new Set([naming_convention_utils_1.Modifiers.public]);
handleMember(validator, node, modifiers);
},
validator: validators.typeMethod,
},
[[
utils_1.AST_NODE_TYPES.AccessorProperty,
utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty,
].join(', ')]: {
handler: (node, validator) => {
const modifiers = getMemberModifiers(node);
handleMember(validator, node, modifiers);
},
validator: validators.autoAccessor,
},
'FunctionDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, FunctionExpression, ArrowFunctionExpression': {
handler: (node, validator) => {
node.params.forEach(param => {
if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) {
return;
}
const identifiers = getIdentifiersFromPattern(param);
identifiers.forEach(i => {
const modifiers = new Set();
if (isDestructured(i)) {
modifiers.add(naming_convention_utils_1.Modifiers.destructured);
}
if (isUnused(i.name, context.sourceCode.getScope(i))) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
validator(i, modifiers);
});
});
},
validator: validators.parameter,
},
// #endregion method
// #region accessor
'Property[computed = false]:matches([kind = "get"], [kind = "set"])': {
handler: (node, validator) => {
const modifiers = new Set([naming_convention_utils_1.Modifiers.public]);
handleMember(validator, node, modifiers);
},
validator: validators.classicAccessor,
},
TSParameterProperty: {
handler: (node, validator) => {
const modifiers = getMemberModifiers(node);
const identifiers = getIdentifiersFromPattern(node.parameter);
identifiers.forEach(i => {
validator(i, modifiers);
});
},
validator: validators.parameterProperty,
},
// #endregion accessor
// #region autoAccessor
'TSPropertySignature[computed = false][typeAnnotation.typeAnnotation.type != "TSFunctionType"]': {
handler: (node, validator) => {
const modifiers = new Set([naming_convention_utils_1.Modifiers.public]);
if (node.readonly) {
modifiers.add(naming_convention_utils_1.Modifiers.readonly);
}
handleMember(validator, node, modifiers);
},
validator: validators.typeProperty,
},
// #endregion autoAccessor
// #region enumMember
// computed is optional, so can't do [computed = false]
'ClassDeclaration, ClassExpression': {
handler: (node, validator) => {
const id = node.id;
if (id == null) {
return;
}
const modifiers = new Set();
// classes create their own nested scope
const scope = context.sourceCode.getScope(node).upper;
if (node.abstract) {
modifiers.add(naming_convention_utils_1.Modifiers.abstract);
}
if (isExported(node, id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.exported);
}
if (isUnused(id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
validator(id, modifiers);
},
validator: validators.class,
},
// #endregion enumMember
// #region class
TSEnumDeclaration: {
handler: (node, validator) => {
const modifiers = new Set();
// enums create their own nested scope
const scope = context.sourceCode.getScope(node).upper;
if (isExported(node, node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.exported);
}
if (isUnused(node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
validator(node.id, modifiers);
},
validator: validators.enum,
},
// #endregion class
// #region interface
TSEnumMember: {
handler: (node, validator) => {
const id = node.id;
const modifiers = new Set();
if (requiresQuoting(id, compilerOptions.target)) {
modifiers.add(naming_convention_utils_1.Modifiers.requiresQuotes);
}
validator(id, modifiers);
},
validator: validators.enumMember,
},
// #endregion interface
// #region typeAlias
TSInterfaceDeclaration: {
handler: (node, validator) => {
const modifiers = new Set();
const scope = context.sourceCode.getScope(node);
if (isExported(node, node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.exported);
}
if (isUnused(node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
validator(node.id, modifiers);
},
validator: validators.interface,
},
// #endregion typeAlias
// #region enum
TSTypeAliasDeclaration: {
handler: (node, validator) => {
const modifiers = new Set();
const scope = context.sourceCode.getScope(node);
if (isExported(node, node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.exported);
}
if (isUnused(node.id.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
validator(node.id, modifiers);
},
validator: validators.typeAlias,
},
// #endregion enum
// #region typeParameter
'TSTypeParameterDeclaration > TSTypeParameter': {
handler: (node, validator) => {
const modifiers = new Set();
const scope = context.sourceCode.getScope(node);
if (isUnused(node.name.name, scope)) {
modifiers.add(naming_convention_utils_1.Modifiers.unused);
}
validator(node.name, modifiers);
},
validator: validators.typeParameter,
},
// #endregion typeParameter
};
return Object.fromEntries(Object.entries(selectors).map(([selector, { handler, validator }]) => {
return [
selector,
(node) => {
handler(node, validator);
},
];
}));
},
});
function getIdentifiersFromPattern(pattern) {
const identifiers = [];
const visitor = new scope_manager_1.PatternVisitor({}, pattern, id => identifiers.push(id));
visitor.visit(pattern);
return identifiers;
}
function isExported(node, name, scope) {
if (node?.parent?.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration ||
node?.parent?.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) {
return true;
}
if (scope == null) {
return false;
}
const variable = scope.set.get(name);
if (variable) {
for (const ref of variable.references) {
const refParent = ref.identifier.parent;
if (refParent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration ||
refParent.type === utils_1.AST_NODE_TYPES.ExportSpecifier) {
return true;
}
}
}
return false;
}
function isGlobal(scope) {
if (scope == null) {
return false;
}
return (scope.type === utils_1.TSESLint.Scope.ScopeType.global ||
scope.type === utils_1.TSESLint.Scope.ScopeType.module);
}
function requiresQuoting(node, target) {
const name = node.type === utils_1.AST_NODE_TYPES.Identifier ||
node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier
? node.name
: `${node.value}`;
return (0, util_1.requiresQuoting)(name, target);
}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const UserRoundSearch = createLucideIcon("UserRoundSearch", [
["circle", { cx: "10", cy: "8", r: "5", key: "o932ke" }],
["path", { d: "M2 21a8 8 0 0 1 10.434-7.62", key: "1yezr2" }],
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
["path", { d: "m22 22-1.9-1.9", key: "1e5ubv" }]
]);
export { UserRoundSearch as default };
//# sourceMappingURL=user-round-search.js.map
@@ -0,0 +1,27 @@
/**
* @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 Bus = createLucideIcon("Bus", [
["path", { d: "M8 6v6", key: "18i7km" }],
["path", { d: "M15 6v6", key: "1sg6z9" }],
["path", { d: "M2 12h19.6", key: "de5uta" }],
[
"path",
{
d: "M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",
key: "1wwztk"
}
],
["circle", { cx: "7", cy: "18", r: "2", key: "19iecd" }],
["path", { d: "M9 18h5", key: "lrx6i" }],
["circle", { cx: "16", cy: "18", r: "2", key: "1v4tcr" }]
]);
export { Bus as default };
//# sourceMappingURL=bus.js.map
@@ -0,0 +1 @@
{"version":3,"file":"heart-handshake.js","sources":["../../../src/icons/heart-handshake.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HeartHandshake\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgMTRjMS40OS0xLjQ2IDMtMy4yMSAzLTUuNUE1LjUgNS41IDAgMCAwIDE2LjUgM2MtMS43NiAwLTMgLjUtNC41IDItMS41LTEuNS0yLjc0LTItNC41LTJBNS41IDUuNSAwIDAgMCAyIDguNWMwIDIuMyAxLjUgNC4wNSAzIDUuNWw3IDdaIiAvPgogIDxwYXRoIGQ9Ik0xMiA1IDkuMDQgNy45NmEyLjE3IDIuMTcgMCAwIDAgMCAzLjA4Yy44Mi44MiAyLjEzLjg1IDMgLjA3bDIuMDctMS45YTIuODIgMi44MiAwIDAgMSAzLjc5IDBsMi45NiAyLjY2IiAvPgogIDxwYXRoIGQ9Im0xOCAxNS0yLTIiIC8+CiAgPHBhdGggZD0ibTE1IDE4LTItMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/heart-handshake\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 HeartHandshake = createLucideIcon('HeartHandshake', [\n [\n 'path',\n {\n d: 'M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z',\n key: 'c3ymky',\n },\n ],\n [\n 'path',\n {\n d: 'M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66',\n key: '4oyue0',\n },\n ],\n ['path', { d: 'm18 15-2-2', key: '60u0ii' }],\n ['path', { d: 'm15 18-2-2', key: '6p76be' }],\n]);\n\nexport default HeartHandshake;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"file-type.js","sources":["../../../src/icons/file-type.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileType\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0IiAvPgogIDxwYXRoIGQ9Ik05IDEzdi0xaDZ2MSIgLz4KICA8cGF0aCBkPSJNMTIgMTJ2NiIgLz4KICA8cGF0aCBkPSJNMTEgMThoMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-type\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 FileType = createLucideIcon('FileType', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M9 13v-1h6v1', key: '1bb014' }],\n ['path', { d: 'M12 12v6', key: '3ahymv' }],\n ['path', { d: 'M11 18h2', key: '12mj7e' }],\n]);\n\nexport default FileType;\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,CAA8D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3F,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,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,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;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,65 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
import KEYS from "./visitor-keys.js";
/**
* @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
*/
// List to ignore keys.
const KEY_BLACKLIST = new Set([
"parent",
"leadingComments",
"trailingComments"
]);
/**
* Check whether a given key should be used or not.
* @param {string} key The key to check.
* @returns {boolean} `true` if the key should be used.
*/
function filterKey(key) {
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}
/**
* Get visitor keys of a given node.
* @param {object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
export function getKeys(node) {
return Object.keys(node).filter(filterKey);
}
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
// eslint-disable-next-line valid-jsdoc
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
export function unionWith(additionalKeys) {
const retv = /** @type {{
[type: string]: ReadonlyArray<string>
}} */ (Object.assign({}, KEYS));
for (const type of Object.keys(additionalKeys)) {
if (Object.prototype.hasOwnProperty.call(retv, type)) {
const keys = new Set(additionalKeys[type]);
for (const key of retv[type]) {
keys.add(key);
}
retv[type] = Object.freeze(Array.from(keys));
} else {
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
}
}
return Object.freeze(retv);
}
export { KEYS };
@@ -0,0 +1,727 @@
export default `flf2a$ 7 6 11 0 11 0 24447 0
Author : MJP
Date : 2003/11/1 11:11:13
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ #
$ #
$ #
$ #
$ #
$ #
$ ##
.-. #
| ) #
| / #
|/ #
( #
(_) #
##
#
) ) #
(_)(_) #
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
'#
#
#
#
#
#
##
(#
#
#
#
#
#
##
)#
#
#
#
#
#
##
*#
#
#
#
#
#
##
#
_||_ #
[_ _] #
|| #
|| #
#
##
,#
#
#
#
#
#
##
#
#
____.___ #
\`----==='#
#
#
##
.#
#
#
#
#
#
##
/#
#
#
#
#
#
##
0#
#
#
#
#
#
##
1#
#
#
#
#
#
##
2#
#
#
#
#
#
##
3#
#
#
#
#
#
##
4#
#
#
#
#
#
##
5#
#
#
#
#
#
##
6#
#
#
#
#
#
##
7#
#
#
#
#
#
##
8#
#
#
#
#
#
##
9#
#
#
#
#
#
##
#
_ #
(_) #
#
_ #
(_) #
##
#
_ #
(_) #
#
( #
(_) #
##
<#
#
#
#
#
#
##
#
____.___ #
\`----==='#
___.____#
\`===----'#
#
##
>#
#
#
#
#
#
##
?#
#
#
#
#
#
##
@#
#
#
#
#
#
##
.--. #
/ /\\ \\ #
/ /__\\ \\ #
| __ | #
| | |)| #
|_| (_) #
##
,---. #
| .-.\\ #
| |-' \\ #
| |--. \\#
| |\`-' /#
/( \`--' #
(__) ##
,--, #
.' .') #
| |(_) #
\\ \\ #
\\ \`-. #
\\____\\ #
##
,'|"\\ #
| |\\ \\ #
| | \\ \\ #
| | \\ \\#
/(|\`-' /#
(__)\`--' #
##
,---. #
| .-' #
| \`-. #
| .-' #
| \`--. #
/( __.' #
(__) ##
,---. #
| .-' #
| \`-. #
| .-' #
| | #
)\\| #
(__) ##
,--, #
.' .' #
| | __ #
\\ \\ ( _)#
\\ \`-) )#
)\\____/ #
(__) ##
.-. .-. #
| | | | #
| \`-' | #
| .-. | #
| | |)| #
/( (_) #
(__) ##
,-. #
|(| #
(_) #
| | #
| | #
\`-' #
##
.-, #
| | #
| | #
| | #
(\`-' | #
\\_ )| #
(_) ##
,-. .-. #
| |/ / #
| | / #
| | \\ #
| |) \\ #
|((_)-' #
(_) ##
,-. #
| | #
| | #
| | #
| \`--. #
|( __.' #
(_) ##
#
|\\ /| #
|(\\ / | #
(_)\\/ | #
| \\ / | #
| |\\/| | #
'-' '-' ##
.-. .-. #
| \\| | #
| | | #
| |\\ | #
| | |)| #
/( (_) #
(__) ##
.---. #
/ .-. ) #
| | |(_) #
| | | | #
\\ \`-' / #
)---' #
(_) ##
,---. #
| .-.\\ #
| |-' ) #
| |--' #
| | #
/( #
(__) ##
.---. #
( .-. \\ #
(_)| | | #
| ||\\ | #
\\ \`-\\\\/ #
\`---\\| #
##
,---. #
| .-.\\ #
| \`-'/ #
| ( #
| |\\ \\ #
|_| \\)\\ #
(__) ##
.---. #
( .-._)#
(_) \\ #
_ \\ \\ #
( \`-' ) #
\`----' #
##
_______ #
|__ __|#
)| | #
(_) | #
| | #
\`-' #
##
.-. .-. #
| | | | #
| | | | #
| | | | #
| \`-')| #
\`---(_) #
##
.-. .-.#
\\ \\ / / #
\\ V / #
) / #
(_) #
#
##
.-. .-. #
| |/\\| | #
| / \\ | #
| /\\ | #
|(/ \\ | #
(_) \\| #
##
.-. .-.#
) \\_/ / #
(_) / #
/ _ \\ #
/ / ) \\ #
\`-' (_)-'#
##
.-. .-.#
\\ \\_/ )/#
\\ (_)#
) ( #
| | #
/(_| #
(__) ##
_____ #
/___ / #
/ /) #
/ /(_) #
/ /___ #
(_____/ #
##
[#
#
#
#
#
#
##
\\#
#
#
#
#
#
##
]#
#
#
#
#
#
##
^#
#
#
#
#
#
##
_#
#
#
#
#
#
##
\`#
#
#
#
#
#
##
.--. #
/ /\\ \\ #
/ /__\\ \\ #
| __ | #
| | |)| #
|_| (_) #
##
,---. #
| .-.\\ #
| |-' \\ #
| |--. \\#
| |\`-' /#
/( \`--' #
(__) ##
,--, #
.' .') #
| |(_) #
\\ \\ #
\\ \`-. #
\\____\\ #
##
,'|"\\ #
| |\\ \\ #
| | \\ \\ #
| | \\ \\#
/(|\`-' /#
(__)\`--' #
##
,---. #
| .-' #
| \`-. #
| .-' #
| \`--. #
/( __.' #
(__) ##
,---. #
| .-' #
| \`-. #
| .-' #
| | #
)\\| #
(__) ##
,--, #
.' .' #
| | __ #
\\ \\ ( _)#
\\ \`-) )#
)\\____/ #
(__) ##
.-. .-. #
| | | | #
| \`-' | #
| .-. | #
| | |)| #
/( (_) #
(__) ##
,-. #
|(| #
(_) #
| | #
| | #
\`-' #
##
.-, #
| | #
| | #
| | #
(\`-' | #
\\_ )| #
(_) ##
,-. .-. #
| |/ / #
| | / #
| | \\ #
| |) \\ #
|((_)-' #
(_) ##
,-. #
| | #
| | #
| | #
| \`--. #
|( __.' #
(_) ##
#
|\\ /| #
|(\\ / | #
(_)\\/ | #
| \\ / | #
| |\\/| | #
'-' '-' ##
.-. .-. #
| \\| | #
| | | #
| |\\ | #
| | |)| #
/( (_) #
(__) ##
.---. #
/ .-. ) #
| | |(_) #
| | | | #
\\ \`-' / #
)---' #
(_) ##
,---. #
| .-.\\ #
| |-' ) #
| |--' #
| | #
/( #
(__) ##
.---. #
( .-. \\ #
(_)| | | #
| ||\\ | #
\\ \`-\\\\/ #
\`---\\| #
##
,---. #
| .-.\\ #
| \`-'/ #
| ( #
| |\\ \\ #
|_| \\)\\ #
(__) ##
.---. #
( .-._)#
(_) \\ #
_ \\ \\ #
( \`-' ) #
\`----' #
##
_______ #
|__ __|#
)| | #
(_) | #
| | #
\`-' #
##
.-. .-. #
| | | | #
| | | | #
| | | | #
| \`-')| #
\`---(_) #
##
.-. .-.#
\\ \\ / / #
\\ V / #
) / #
(_) #
#
##
.-. .-. #
| |/\\| | #
| / \\ | #
| /\\ | #
|(/ \\ | #
(_) \\| #
##
.-. .-.#
) \\_/ / #
(_) / #
/ _ \\ #
/ / ) \\ #
\`-' (_)-'#
##
.-. .-.#
\\ \\_/ )/#
\\ (_)#
) ( #
| | #
/(_| #
(__) ##
_____ #
/___ / #
/ /) #
/ /(_) #
/ /___ #
(_____/ #
##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
.--. #
/ /\\ \\ #
/ /__\\ \\ #
| __ | #
| | |)| #
|_| (_) #
##
.---. #
/ .-. ) #
| | |(_) #
| | | | #
\\ \`-' / #
)---' #
(_) ##
.-. .-. #
| | | | #
| | | | #
| | | | #
| \`-')| #
\`---(_) #
##
.--. #
/ /\\ \\ #
/ /__\\ \\ #
| __ | #
| | |)| #
|_| (_) #
##
.---. #
/ .-. ) #
| | |(_) #
| | | | #
\\ \`-' / #
)---' #
(_) ##
.-. .-. #
| | | | #
| | | | #
| | | | #
| \`-')| #
\`---(_) #
##
�#
#
#
#
#
#
##
`
@@ -0,0 +1,84 @@
# object-inspect <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
string representations of objects in node and the browser
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
# example
## circular
``` js
var inspect = require('object-inspect');
var obj = { a: 1, b: [3,4] };
obj.c = obj;
console.log(inspect(obj));
```
## dom element
``` js
var inspect = require('object-inspect');
var d = document.createElement('div');
d.setAttribute('id', 'beep');
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ]));
```
output:
```
[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ]
```
# methods
``` js
var inspect = require('object-inspect')
```
## var s = inspect(obj, opts={})
Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`.
Additional options:
- `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements.
- `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`.
- `customInspect`: When `true`, a custom inspect method function will be invoked (either undere the `util.inspect.custom` symbol, or the `inspect` property). When the string `'symbol'`, only the symbol method will be invoked. Default `true`.
- `indent`: must be "\t", `null`, or a positive integer. Default `null`.
- `numericSeparator`: must be a boolean, if present. Default `false`. If `true`, all numbers will be printed with numeric separators (eg, `1234.5678` will be printed as `'1_234.567_8'`)
# install
With [npm](https://npmjs.org) do:
```
npm install object-inspect
```
# license
MIT
[package-url]: https://npmjs.org/package/object-inspect
[npm-version-svg]: https://versionbadg.es/inspect-js/object-inspect.svg
[deps-svg]: https://david-dm.org/inspect-js/object-inspect.svg
[deps-url]: https://david-dm.org/inspect-js/object-inspect
[dev-deps-svg]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/object-inspect.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg
[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect
[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect
[actions-url]: https://github.com/inspect-js/object-inspect/actions
@@ -0,0 +1 @@
{"version":3,"file":"waypoints.js","sources":["../../../src/icons/waypoints.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Waypoints\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjQuNSIgcj0iMi41IiAvPgogIDxwYXRoIGQ9Im0xMC4yIDYuMy0zLjkgMy45IiAvPgogIDxjaXJjbGUgY3g9IjQuNSIgY3k9IjEyIiByPSIyLjUiIC8+CiAgPHBhdGggZD0iTTcgMTJoMTAiIC8+CiAgPGNpcmNsZSBjeD0iMTkuNSIgY3k9IjEyIiByPSIyLjUiIC8+CiAgPHBhdGggZD0ibTEzLjggMTcuNyAzLjktMy45IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTkuNSIgcj0iMi41IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/waypoints\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 Waypoints = createLucideIcon('Waypoints', [\n ['circle', { cx: '12', cy: '4.5', r: '2.5', key: 'r5ysbb' }],\n ['path', { d: 'm10.2 6.3-3.9 3.9', key: '1nzqf6' }],\n ['circle', { cx: '4.5', cy: '12', r: '2.5', key: 'jydg6v' }],\n ['path', { d: 'M7 12h10', key: 'b7w52i' }],\n ['circle', { cx: '19.5', cy: '12', r: '2.5', key: '1piiel' }],\n ['path', { d: 'm13.8 17.7 3.9-3.9', key: '1wyg1y' }],\n ['circle', { cx: '12', cy: '19.5', r: '2.5', key: '13o1pw' }],\n]);\n\nexport default Waypoints;\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,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,KAAA,CAAO,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,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,CAClD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,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,CACnD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,MAAA,CAAQ,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,185 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0;
const rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/;
function parseJson(s, pos) {
let endPos;
parseJson.message = undefined;
let matches;
if (pos)
s = s.slice(pos);
try {
parseJson.position = pos + s.length;
return JSON.parse(s);
}
catch (e) {
matches = rxParseJson.exec(e.message);
if (!matches) {
parseJson.message = "unexpected end";
return undefined;
}
endPos = +matches[1];
const c = s[endPos];
s = s.slice(0, endPos);
parseJson.position = pos + endPos;
try {
return JSON.parse(s);
}
catch (e1) {
parseJson.message = `unexpected token ${c}`;
return undefined;
}
}
}
exports.parseJson = parseJson;
parseJson.message = undefined;
parseJson.position = 0;
parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson';
function parseJsonNumber(s, pos, maxDigits) {
let numStr = "";
let c;
parseJsonNumber.message = undefined;
if (s[pos] === "-") {
numStr += "-";
pos++;
}
if (s[pos] === "0") {
numStr += "0";
pos++;
}
else {
if (!parseDigits(maxDigits)) {
errorMessage();
return undefined;
}
}
if (maxDigits) {
parseJsonNumber.position = pos;
return +numStr;
}
if (s[pos] === ".") {
numStr += ".";
pos++;
if (!parseDigits()) {
errorMessage();
return undefined;
}
}
if (((c = s[pos]), c === "e" || c === "E")) {
numStr += "e";
pos++;
if (((c = s[pos]), c === "+" || c === "-")) {
numStr += c;
pos++;
}
if (!parseDigits()) {
errorMessage();
return undefined;
}
}
parseJsonNumber.position = pos;
return +numStr;
function parseDigits(maxLen) {
let digit = false;
while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) {
digit = true;
numStr += c;
pos++;
}
return digit;
}
function errorMessage() {
parseJsonNumber.position = pos;
parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end";
}
}
exports.parseJsonNumber = parseJsonNumber;
parseJsonNumber.message = undefined;
parseJsonNumber.position = 0;
parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber';
const escapedChars = {
b: "\b",
f: "\f",
n: "\n",
r: "\r",
t: "\t",
'"': '"',
"/": "/",
"\\": "\\",
};
const CODE_A = "a".charCodeAt(0);
const CODE_0 = "0".charCodeAt(0);
function parseJsonString(s, pos) {
let str = "";
let c;
parseJsonString.message = undefined;
// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
while (true) {
c = s[pos++];
if (c === '"')
break;
if (c === "\\") {
c = s[pos];
if (c in escapedChars) {
str += escapedChars[c];
pos++;
}
else if (c === "u") {
pos++;
let count = 4;
let code = 0;
while (count--) {
code <<= 4;
c = s[pos];
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (c === undefined) {
errorMessage("unexpected end");
return undefined;
}
c = c.toLowerCase();
if (c >= "a" && c <= "f") {
code += c.charCodeAt(0) - CODE_A + 10;
}
else if (c >= "0" && c <= "9") {
code += c.charCodeAt(0) - CODE_0;
}
else {
errorMessage(`unexpected token ${c}`);
return undefined;
}
pos++;
}
str += String.fromCharCode(code);
}
else {
errorMessage(`unexpected token ${c}`);
return undefined;
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
}
else if (c === undefined) {
errorMessage("unexpected end");
return undefined;
}
else {
if (c.charCodeAt(0) >= 0x20) {
str += c;
}
else {
errorMessage(`unexpected token ${c}`);
return undefined;
}
}
}
parseJsonString.position = pos;
return str;
function errorMessage(msg) {
parseJsonString.position = pos;
parseJsonString.message = msg;
}
}
exports.parseJsonString = parseJsonString;
parseJsonString.message = undefined;
parseJsonString.position = 0;
parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString';
//# sourceMappingURL=parseJson.js.map
@@ -0,0 +1,32 @@
{
"name": "@babel/helper-globals",
"version": "7.29.7",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"description": "A collection of JavaScript globals for Babel internal usage",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-globals"
},
"publishConfig": {
"access": "public"
},
"exports": {
"./data/browser-upper.json": "./data/browser-upper.json",
"./data/builtin-lower.json": "./data/builtin-lower.json",
"./data/builtin-upper.json": "./data/builtin-upper.json",
"./package.json": "./package.json"
},
"keywords": [
"babel",
"globals"
],
"devDependencies": {
"globals": "^16.1.0"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
@@ -0,0 +1 @@
{"version":3,"file":"airplay.js","sources":["../../../src/icons/airplay.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Airplay\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxN0g0YTIgMiAwIDAgMS0yLTJWNWEyIDIgMCAwIDEgMi0yaDE2YTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxLTIgMmgtMSIgLz4KICA8cGF0aCBkPSJtMTIgMTUgNSA2SDdaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/airplay\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 Airplay = createLucideIcon('Airplay', [\n [\n 'path',\n {\n d: 'M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1',\n key: 'ns4c3b',\n },\n ],\n ['path', { d: 'm12 15 5 6H7Z', key: '14qnn2' }],\n]);\n\nexport default Airplay;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,81 @@
/*! *****************************************************************************
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.
***************************************************************************** */
declare namespace Intl {
// http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories
type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other";
type PluralRuleType = "cardinal" | "ordinal";
interface PluralRulesOptions {
localeMatcher?: "lookup" | "best fit" | undefined;
type?: PluralRuleType | undefined;
minimumIntegerDigits?: number | undefined;
minimumFractionDigits?: number | undefined;
maximumFractionDigits?: number | undefined;
minimumSignificantDigits?: number | undefined;
maximumSignificantDigits?: number | undefined;
}
interface ResolvedPluralRulesOptions {
locale: string;
pluralCategories: LDMLPluralRule[];
type: PluralRuleType;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;
minimumSignificantDigits?: number;
maximumSignificantDigits?: number;
}
interface PluralRules {
resolvedOptions(): ResolvedPluralRulesOptions;
select(n: number): LDMLPluralRule;
}
interface PluralRulesConstructor {
new (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
(locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
supportedLocalesOf(locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
}
const PluralRules: PluralRulesConstructor;
interface NumberFormatPartTypeRegistry {
literal: never;
nan: never;
infinity: never;
percent: never;
integer: never;
group: never;
decimal: never;
fraction: never;
plusSign: never;
minusSign: never;
percentSign: never;
currency: never;
}
type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry;
interface NumberFormatPart {
type: NumberFormatPartTypes;
value: string;
}
interface NumberFormat {
formatToParts(number?: number | bigint): NumberFormatPart[];
}
}
@@ -0,0 +1,233 @@
# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js)
ipaddr.js is a small (1.9K minified and gzipped) library for manipulating
IP addresses in JavaScript environments. It runs on both CommonJS runtimes
(e.g. [nodejs]) and in a web browser.
ipaddr.js allows you to verify and parse string representation of an IP
address, match it against a CIDR range or range list, determine if it falls
into some reserved ranges (examples include loopback and private ranges),
and convert between IPv4 and IPv4-mapped IPv6 addresses.
[nodejs]: http://nodejs.org
## Installation
`npm install ipaddr.js`
or
`bower install ipaddr.js`
## API
ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS,
it is exported from the module:
```js
var ipaddr = require('ipaddr.js');
```
The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4.
### Global methods
There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and
`ipaddr.process`. All of them receive a string as a single parameter.
The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or
IPv6 address, and `false` otherwise. It does not throw any exceptions.
The `ipaddr.parse` method returns an object representing the IP address,
or throws an `Error` if the passed string is not a valid representation of an
IP address.
The `ipaddr.process` method works just like the `ipaddr.parse` one, but it
automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts
before returning. It is useful when you have a Node.js instance listening
on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its
equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4
connections on your IPv6-only socket, but the remote address will be mangled.
Use `ipaddr.process` method to automatically demangle it.
### Object representation
Parsing methods return an object which descends from `ipaddr.IPv6` or
`ipaddr.IPv4`. These objects share some properties, but most of them differ.
#### Shared properties
One can determine the type of address by calling `addr.kind()`. It will return
either `"ipv6"` or `"ipv4"`.
An address can be converted back to its string representation with `addr.toString()`.
Note that this method:
* does not return the original string used to create the object (in fact, there is
no way of getting that string)
* returns a compact representation (when it is applicable)
A `match(range, bits)` method can be used to check if the address falls into a
certain CIDR range.
Note that an address can be (obviously) matched only against an address of the same type.
For example:
```js
var addr = ipaddr.parse("2001:db8:1234::1");
var range = ipaddr.parse("2001:db8::");
addr.match(range, 32); // => true
```
Alternatively, `match` can also be called as `match([range, bits])`. In this way,
it can be used together with the `parseCIDR(string)` method, which parses an IP
address together with a CIDR range.
For example:
```js
var addr = ipaddr.parse("2001:db8:1234::1");
addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true
```
A `range()` method returns one of predefined names for several special ranges defined
by IP protocols. The exact names (and their respective CIDR ranges) can be looked up
in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"`
(the default one) and `"reserved"`.
You can match against your own range list by using
`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with a mix of IPv6 or IPv4 addresses, and accepts a name-to-subnet map as the range list. For example:
```js
var rangeList = {
documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ],
tunnelProviders: [
[ ipaddr.parse('2001:470::'), 32 ], // he.net
[ ipaddr.parse('2001:5c0::'), 32 ] // freenet6
]
};
ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders"
```
The addresses can be converted to their byte representation with `toByteArray()`.
(Actually, JavaScript mostly does not know about byte buffers. They are emulated with
arrays of numbers, each in range of 0..255.)
```js
var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com
bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, <zeroes...>, 0x00, 0x68 ]
```
The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them
have the same interface for both protocols, and are similar to global methods.
`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address
for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser.
`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format.
[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186
[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71
#### IPv6 properties
Sometimes you will want to convert IPv6 not to a compact string representation (with
the `::` substitution); the `toNormalizedString()` method will return an address where
all zeroes are explicit.
For example:
```js
var addr = ipaddr.parse("2001:0db8::0001");
addr.toString(); // => "2001:db8::1"
addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1"
```
The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped
one, and `toIPv4Address()` will return an IPv4 object address.
To access the underlying binary representation of the address, use `addr.parts`.
```js
var addr = ipaddr.parse("2001:db8:10::1234:DEAD");
addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead]
```
A IPv6 zone index can be accessed via `addr.zoneId`:
```js
var addr = ipaddr.parse("2001:db8::%eth0");
addr.zoneId // => 'eth0'
```
#### IPv4 properties
`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address.
To access the underlying representation of the address, use `addr.octets`.
```js
var addr = ipaddr.parse("192.168.1.1");
addr.octets // => [192, 168, 1, 1]
```
`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or
null if the netmask is not valid.
```js
ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28
ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null
```
`subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length.
```js
ipaddr.IPv4.subnetMaskFromPrefixLength(24) == "255.255.255.0"
ipaddr.IPv4.subnetMaskFromPrefixLength(29) == "255.255.255.248"
```
`broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation.
```js
ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255"
```
`networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation.
```js
ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0"
```
#### Conversion
IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays.
The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object
if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values,
while for IPv6 it has to be an array of sixteen 8-bit values.
For example:
```js
var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]);
addr.toString(); // => "127.0.0.1"
```
or
```js
var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
addr.toString(); // => "2001:db8::1"
```
Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB).
For example:
```js
var addr = ipaddr.parse("127.0.0.1");
addr.toByteArray(); // => [0x7f, 0, 0, 1]
```
or
```js
var addr = ipaddr.parse("2001:db8::1");
addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
```
@@ -0,0 +1,494 @@
'use strict'
let CssSyntaxError = require('./css-syntax-error')
let Stringifier = require('./stringifier')
let stringify = require('./stringify')
let { isClean, my } = require('./symbols')
function cloneNode(obj, parent) {
let cloned = new obj.constructor()
// An explicit stack instead of recursive calls to survive deeply
// nested trees. Each entry is [source, its clone, clone's parent].
let stack = [[obj, cloned, parent]]
while (stack.length > 0) {
let [source, target, targetParent] = stack.pop()
for (let i in source) {
if (!Object.prototype.hasOwnProperty.call(source, i)) {
/* c8 ignore next 2 */
continue
}
if (i === 'proxyCache') continue
let value = source[i]
let type = typeof value
if (i === 'parent' && type === 'object') {
if (targetParent) target[i] = targetParent
} else if (i === 'source') {
target[i] = value
} else if (Array.isArray(value)) {
let children = []
target[i] = children
for (let j of value) {
let childClone = new j.constructor()
children.push(childClone)
stack.push([j, childClone, target])
}
} else {
if (type === 'object' && value !== null) {
let valueClone = new value.constructor()
stack.push([value, valueClone, undefined])
value = valueClone
}
target[i] = value
}
}
}
return cloned
}
function sourceOffset(inputCSS, position) {
// Not all custom syntaxes support `offset` in `source.start` and `source.end`
if (position && typeof position.offset !== 'undefined') {
return position.offset
}
let column = 1
let line = 1
let offset = 0
for (let i = 0; i < inputCSS.length; i++) {
if (line === position.line && column === position.column) {
offset = i
break
}
if (inputCSS[i] === '\n') {
column = 1
line += 1
} else {
column += 1
}
}
return offset
}
class Node {
get proxyOf() {
return this
}
constructor(defaults = {}) {
this.raws = {}
this[isClean] = false
this[my] = true
for (let name of Object.keys(defaults)) {
if (name === '__proto__') continue
if (name === 'nodes') {
this.nodes = []
for (let node of defaults[name]) {
// Clone only nodes that already belong to another tree, so passing a
// freshly created (parent-less) node adopts that instance instead of
// a copy and keeps the caller's reference usable. See #1987.
if (typeof node.clone === 'function' && node.parent) {
this.append(node.clone())
} else {
this.append(node)
}
}
} else {
this[name] = defaults[name]
}
}
}
addToError(error) {
error.postcssNode = this
if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) {
let s = this.source
error.stack = error.stack.replace(
/\n\s{4}at /,
`$&${s.input.from}:${s.start.line}:${s.start.column}$&`
)
}
return error
}
after(add) {
this.parent.insertAfter(this, add)
return this
}
assign(overrides = {}) {
for (let name in overrides) {
this[name] = overrides[name]
}
return this
}
before(add) {
this.parent.insertBefore(this, add)
return this
}
cleanRaws(keepBetween) {
delete this.raws.before
delete this.raws.after
if (!keepBetween) delete this.raws.between
}
clone(overrides = {}) {
let cloned = cloneNode(this)
for (let name in overrides) {
cloned[name] = overrides[name]
}
return cloned
}
cloneAfter(overrides = {}) {
let cloned = this.clone(overrides)
this.parent.insertAfter(this, cloned)
return cloned
}
cloneBefore(overrides = {}) {
let cloned = this.clone(overrides)
this.parent.insertBefore(this, cloned)
return cloned
}
error(message, opts = {}) {
if (this.source) {
let { end, start } = this.rangeBy(opts)
return this.source.input.error(
message,
{ column: start.column, line: start.line },
{ column: end.column, line: end.line },
opts
)
}
return new CssSyntaxError(message)
}
getProxyProcessor() {
return {
get(node, prop) {
if (prop === 'proxyOf') {
return node
} else if (prop === 'root') {
return () => node.root().toProxy()
} else {
return node[prop]
}
},
set(node, prop, value) {
if (node[prop] === value) return true
node[prop] = value
if (
prop === 'prop' ||
prop === 'value' ||
prop === 'name' ||
prop === 'params' ||
prop === 'important' ||
/* c8 ignore next */
prop === 'text'
) {
node.markDirty()
}
return true
}
}
}
/* c8 ignore next 3 */
markClean() {
this[isClean] = true
}
markDirty() {
if (this[isClean]) {
this[isClean] = false
let next = this
while ((next = next.parent)) {
next[isClean] = false
}
}
}
next() {
if (!this.parent) return undefined
let index = this.parent.index(this)
return this.parent.nodes[index + 1]
}
positionBy(opts = {}) {
let inputString =
'document' in this.source.input
? this.source.input.document
: this.source.input.css
let pos = {
column: this.source.start.column,
line: this.source.start.line,
offset: sourceOffset(inputString, this.source.start)
}
if (opts.index) {
pos = this.positionInside(opts.index)
} else if (opts.word) {
let stringRepresentation = inputString.slice(
sourceOffset(inputString, this.source.start),
sourceOffset(inputString, this.source.end)
)
let index = stringRepresentation.indexOf(opts.word)
if (index !== -1) pos = this.positionInside(index)
}
return pos
}
positionInside(index) {
let column = this.source.start.column
let line = this.source.start.line
let inputString =
'document' in this.source.input
? this.source.input.document
: this.source.input.css
let offset = sourceOffset(inputString, this.source.start)
let end = offset + index
for (let i = offset; i < end; i++) {
if (inputString[i] === '\n') {
column = 1
line += 1
} else {
column += 1
}
}
return { column, line, offset: end }
}
prev() {
if (!this.parent) return undefined
let index = this.parent.index(this)
return this.parent.nodes[index - 1]
}
rangeBy(opts = {}) {
let inputString =
'document' in this.source.input
? this.source.input.document
: this.source.input.css
let start = {
column: this.source.start.column,
line: this.source.start.line,
offset: sourceOffset(inputString, this.source.start)
}
let end = this.source.end
? {
column: this.source.end.column + 1,
line: this.source.end.line,
offset:
typeof this.source.end.offset === 'number'
? // `source.end.offset` is exclusive, so we don't need to add 1
this.source.end.offset
: // Since line/column in this.source.end is inclusive,
// the `sourceOffset(... , this.source.end)` returns an inclusive offset.
// So, we add 1 to convert it to exclusive.
sourceOffset(inputString, this.source.end) + 1
}
: {
column: start.column + 1,
line: start.line,
offset: start.offset + 1
}
if (opts.word) {
let stringRepresentation = inputString.slice(
sourceOffset(inputString, this.source.start),
sourceOffset(inputString, this.source.end)
)
let index = stringRepresentation.indexOf(opts.word)
if (index !== -1) {
start = this.positionInside(index)
end = this.positionInside(index + opts.word.length)
}
} else {
if (opts.start) {
start = {
column: opts.start.column,
line: opts.start.line,
offset: sourceOffset(inputString, opts.start)
}
} else if (typeof opts.index === 'number') {
start = this.positionInside(opts.index)
}
if (opts.end) {
end = {
column: opts.end.column,
line: opts.end.line,
offset: sourceOffset(inputString, opts.end)
}
} else if (typeof opts.endIndex === 'number') {
end = this.positionInside(opts.endIndex)
} else if (typeof opts.index === 'number') {
end = this.positionInside(opts.index + 1)
}
}
if (
end.line < start.line ||
(end.line === start.line && end.column <= start.column)
) {
end = {
column: start.column + 1,
line: start.line,
offset: start.offset + 1
}
}
return { end, start }
}
raw(prop, defaultType) {
let str = new Stringifier()
return str.raw(this, prop, defaultType)
}
remove() {
if (this.parent) {
this.parent.removeChild(this)
}
this.parent = undefined
return this
}
replaceWith(...nodes) {
if (this.parent) {
let bookmark = this
let foundSelf = false
for (let node of nodes) {
if (node === this) {
foundSelf = true
} else if (foundSelf) {
this.parent.insertAfter(bookmark, node)
bookmark = node
} else {
this.parent.insertBefore(bookmark, node)
}
}
if (!foundSelf) {
this.remove()
}
}
return this
}
root() {
let result = this
while (result.parent && result.parent.type !== 'document') {
result = result.parent
}
return result
}
toJSON(_, inputs) {
let emitInputs = inputs == null
inputs = inputs || new Map()
// A worklist instead of recursive `toJSON()` calls to survive deeply
// nested trees. Each entry converts one node and writes the result
// into the already converted parent by [holder, key].
let holderOfRoot = []
let queue = [[this, holderOfRoot, 0]]
for (let step = 0; step < queue.length; step++) {
let [node, holder, key] = queue[step]
let fixed = {}
holder[key] = fixed
for (let name in node) {
if (!Object.prototype.hasOwnProperty.call(node, name)) {
/* c8 ignore next 2 */
continue
}
if (name === 'parent' || name === 'proxyCache') continue
let value = node[name]
if (Array.isArray(value)) {
let fixedArray = []
fixed[name] = fixedArray
for (let i = 0; i < value.length; i++) {
let item = value[i]
if (typeof item === 'object' && item.toJSON) {
if (item.toJSON === Node.prototype.toJSON) {
queue.push([item, fixedArray, i])
} else {
fixedArray[i] = item.toJSON(null, inputs)
}
} else {
fixedArray[i] = item
}
}
} else if (typeof value === 'object' && value.toJSON) {
if (value.toJSON === Node.prototype.toJSON) {
queue.push([value, fixed, name])
} else {
fixed[name] = value.toJSON(null, inputs)
}
} else if (name === 'source') {
if (value == null) continue
let inputId = inputs.get(value.input)
if (inputId == null) {
inputId = inputs.size
inputs.set(value.input, inputId)
}
fixed[name] = {
end: value.end,
inputId,
start: value.start
}
} else {
fixed[name] = value
}
}
}
let fixed = holderOfRoot[0]
if (emitInputs) {
fixed.inputs = [...inputs.keys()].map(input => input.toJSON())
}
return fixed
}
toProxy() {
if (!this.proxyCache) {
this.proxyCache = new Proxy(this, this.getProxyProcessor())
}
return this.proxyCache
}
toString(stringifier = stringify) {
if (stringifier.stringify) stringifier = stringifier.stringify
let result = ''
stringifier(this, i => {
result += i
})
return result
}
warn(result, text, opts = {}) {
let data = { node: this }
for (let i in opts) data[i] = opts[i]
return result.warn(text, data)
}
}
module.exports = Node
Node.default = Node
@@ -0,0 +1,5 @@
'use strict';
module.exports = {
stdout: false,
stderr: false
};
@@ -0,0 +1,75 @@
{
"name": "@types/chai",
"version": "5.2.3",
"description": "TypeScript definitions for chai",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chai",
"license": "MIT",
"contributors": [
{
"name": "Bart van der Schoor",
"githubUsername": "Bartvds",
"url": "https://github.com/Bartvds"
},
{
"name": "Andrew Brown",
"githubUsername": "AGBrown",
"url": "https://github.com/AGBrown"
},
{
"name": "Olivier Chevet",
"githubUsername": "olivr70",
"url": "https://github.com/olivr70"
},
{
"name": "Matt Wistrand",
"githubUsername": "mwistrand",
"url": "https://github.com/mwistrand"
},
{
"name": "Shaun Luttin",
"githubUsername": "shaunluttin",
"url": "https://github.com/shaunluttin"
},
{
"name": "Satana Charuwichitratana",
"githubUsername": "micksatana",
"url": "https://github.com/micksatana"
},
{
"name": "Erik Schierboom",
"githubUsername": "ErikSchierboom",
"url": "https://github.com/ErikSchierboom"
},
{
"name": "Bogdan Paranytsia",
"githubUsername": "bparan",
"url": "https://github.com/bparan"
},
{
"name": "CXuesong",
"githubUsername": "CXuesong",
"url": "https://github.com/CXuesong"
},
{
"name": "Joey Kilpatrick",
"githubUsername": "joeykilpatrick",
"url": "https://github.com/joeykilpatrick"
}
],
"type": "module",
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/chai"
},
"scripts": {},
"dependencies": {
"@types/deep-eql": "*",
"assertion-error": "^2.0.1"
},
"peerDependencies": {},
"typesPublisherContentHash": "d9d83f1594f42010e624e46e4c8cfeee284bdd04cb05eb0730aec14140f2a833",
"typeScriptVersion": "5.2"
}
@@ -0,0 +1 @@
{"version":3,"file":"matching.cjs","sources":["../../../src/matcher/dictionary/matching.ts"],"sourcesContent":[null],"names":["MatchDictionary","MatcherBaseClass","constructor","options","wordSequenceCheck","getRangedDictionaries","userInputsOptions","rankedDictionaries","rankedDictionariesMaxWordSize","Object","keys","forEach","key","isWordSequence","mergeUserInputDictionary","match","password","useLevenshtein","matches","passwordLength","length","passwordLower","toLowerCase","dictionaryName","rankedDict","longestDictionaryWordSize","searchWidth","Math","min","i","searchEnd","j","usedPassword","slice","isInDictionary","foundLevenshteinDistance","isFullPassword","useLevenshteinDistance","findLevenshteinDistance","levenshteinThreshold","isLevenshteinMatch","usedRankPassword","levenshteinDistanceEntry","rank","push","pattern","token","matchedWord","reversed","l33t"],"mappings":";;;;;;AAcA,MAAMA,eAAgB,SAAQC,sBAAgB,CAAA;AAC5CC,EAAAA,WAAAA,CACEC,OAAgB,EACNC,iBAA2B,EAAA;IAErC,KAAK,CAACD,OAAO,CAAC;IAFJ,IAAA,CAAAC,iBAAiB,GAAjBA,iBAAiB;AAG7B,EAAA;EAEQC,qBAAqBA,CAACC,iBAAqC,EAAA;IACjE,IAAI,IAAI,CAACF,iBAAiB,EAAE;MAC1B,MAAMG,kBAAkB,GAAuB,EAAE;MACjD,MAAMC,6BAA6B,GAA2B,EAAE;AAChEC,MAAAA,MAAM,CAACC,IAAI,CAAC,IAAI,CAACP,OAAO,CAACI,kBAAkB,CAAC,CAACI,OAAO,CAAEC,GAAG,IAAI;QAC3D,IAAI,IAAI,CAACT,OAAO,CAACU,cAAc,CAACD,GAAG,CAAC,EAAE;UACpCL,kBAAkB,CAACK,GAAG,CAAC,GAAG,IAAI,CAACT,OAAO,CAACI,kBAAkB,CAACK,GAAG,CAAC;UAC9DJ,6BAA6B,CAACI,GAAG,CAAC,GAChC,IAAI,CAACT,OAAO,CAACK,6BAA6B,CAACI,GAAG,CAAC;AACnD,QAAA;AACF,MAAA,CAAC,CAAC;MACF,OAAO;QACLL,kBAAkB;AAClBC,QAAAA;OACD;AACH,IAAA;AACA,IAAA,OAAOM,wBAAwB,CAC7B,IAAI,CAACX,OAAO,CAACI,kBAAkB,EAC/B,IAAI,CAACJ,OAAO,CAACK,6BAA6B,EAC1CF,iBAAiB,CAClB;AACH,EAAA;AAEOS,EAAAA,KAAKA,CAAC;IACXC,QAAQ;IACRV,iBAAiB;AACjBW,IAAAA,cAAc,GAAG;AAAI,GACE,EAAA;IACvB,MAAMC,OAAO,GAAsB,EAAE;AACrC,IAAA,MAAMC,cAAc,GAAGH,QAAQ,CAACI,MAAM;AACtC,IAAA,MAAMC,aAAa,GAAGL,QAAQ,CAACM,WAAW,EAAE;IAC5C,MAAM;MAAEf,kBAAkB;AAAEC,MAAAA;AAA6B,KAAE,GACzD,IAAI,CAACH,qBAAqB,CAACC,iBAAiB,CAAC;AAE/C;IACAG,MAAM,CAACC,IAAI,CAACH,kBAAkB,CAAC,CAACI,OAAO,CAAEY,cAAc,IAAI;AACzD,MAAA,MAAMC,UAAU,GAAGjB,kBAAkB,CAACgB,cAAiC,CAAC;AACxE,MAAA,MAAME,yBAAyB,GAC7BjB,6BAA6B,CAACe,cAAc,CAAC;MAC/C,MAAMG,WAAW,GAAGC,IAAI,CAACC,GAAG,CAACH,yBAAyB,EAAEN,cAAc,CAAC;AACvE,MAAA,KAAK,IAAIU,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGV,cAAc,EAAEU,CAAC,IAAI,CAAC,EAAE;QAC1C,MAAMC,SAAS,GAAGH,IAAI,CAACC,GAAG,CAACC,CAAC,GAAGH,WAAW,EAAEP,cAAc,CAAC;AAC3D,QAAA,KAAK,IAAIY,CAAC,GAAGF,CAAC,EAAEE,CAAC,GAAGD,SAAS,EAAEC,CAAC,IAAI,CAAC,EAAE;AACrC,UAAA,MAAMC,YAAY,GAAGX,aAAa,CAACY,KAAK,CAACJ,CAAC,EAAEE,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;AACzD,UAAA,MAAMG,cAAc,GAAGF,YAAY,IAAIR,UAAU;UACjD,IAAIW,wBAAwB,GAC1B,EAAE;AACJ;AACA;UACA,MAAMC,cAAc,GAAGP,CAAC,KAAK,CAAC,IAAIE,CAAC,KAAKZ,cAAc,GAAG,CAAC;AAC1D,UAAA,IACE,IAAI,CAAChB,OAAO,CAACkC,sBAAsB,IACnCD,cAAc,IACd,CAACF,cAAc,IACfjB,cAAc,EACd;AACAkB,YAAAA,wBAAwB,GAAGG,WAAuB,CAChDN,YAAY,EACZR,UAAU,EACV,IAAI,CAACrB,OAAO,CAACoC,oBAAoB,CAClC;AACH,UAAA;UACA,MAAMC,kBAAkB,GACtB/B,MAAM,CAACC,IAAI,CAACyB,wBAAwB,CAAC,CAACf,MAAM,KAAK,CAAC;UAEpD,IAAIc,cAAc,IAAIM,kBAAkB,EAAE;YACxC,MAAMC,gBAAgB,GAAGD,kBAAkB,GACvCL,wBAAwB,CAACO,wBAAyB,GAClDV,YAAY;AAEhB,YAAA,MAAMW,IAAI,GAAGnB,UAAU,CAACiB,gBAAgB,CAAC;YACzCvB,OAAO,CAAC0B,IAAI,CAAC;AACXC,cAAAA,OAAO,EAAE,YAAY;cACrBhB,CAAC;cACDE,CAAC;AACDe,cAAAA,KAAK,EAAE9B,QAAQ,CAACiB,KAAK,CAACJ,CAAC,EAAEE,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;AACtCgB,cAAAA,WAAW,EAAEf,YAAY;cACzBW,IAAI;AACJpB,cAAAA,cAAc,EAAEA,cAAc;AAC9ByB,cAAAA,QAAQ,EAAE,KAAK;AACfC,cAAAA,IAAI,EAAE,KAAK;cACX,GAAGd;AACJ,aAAA,CAAC;AACJ,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA,CAAC,CAAC;AACF,IAAA,OAAOjB,OAAO;AAChB,EAAA;AACD;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"notebook.js","sources":["../../../src/icons/notebook.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Notebook\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA2aDQiIC8+CiAgPHBhdGggZD0iTTIgMTBoNCIgLz4KICA8cGF0aCBkPSJNMiAxNGg0IiAvPgogIDxwYXRoIGQ9Ik0yIDE4aDQiIC8+CiAgPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjIwIiB4PSI0IiB5PSIyIiByeD0iMiIgLz4KICA8cGF0aCBkPSJNMTYgMnYyMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/notebook\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 Notebook = createLucideIcon('Notebook', [\n ['path', { d: 'M2 6h4', key: 'aawbzj' }],\n ['path', { d: 'M2 10h4', key: 'l0bgd4' }],\n ['path', { d: 'M2 14h4', key: '1gsvsf' }],\n ['path', { d: 'M2 18h4', key: '1bu2t1' }],\n ['rect', { width: '16', height: '20', x: '4', y: '2', rx: '2', key: '1nb95v' }],\n ['path', { d: 'M16 2v20', key: 'rotuqe' }],\n]);\n\nexport default Notebook;\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,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"useSearch.js","names":[],"sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> {\n select?: (\n state: ResolveUseSearch<TRouter, TFrom, TStrict>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n TStructuralSharing,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<\n TRouter,\n TFrom,\n TStrict,\n TThrow,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected,\n TStructuralSharing\n > &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n) => UseSearchResult<TRouter, TFrom, true, TSelected>\n\n/**\n * Read and select the current route's search parameters with type-safety.\n *\n * Options:\n * - `from`/`strict`: Control which route's search is read and how strictly it's typed\n * - `select`: Map the search object to a derived value for render optimization\n * - `structuralSharing`: Enable structural sharing for stable references\n * - `shouldThrow`: Throw when the route is not found (strict contexts)\n *\n * @returns The search object (or selected value) for the matched route.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n */\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected,\n TStructuralSharing\n >,\n): ThrowOrOptional<\n UseSearchResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n structuralSharing: opts.structuralSharing,\n select: (match: any) => {\n return opts.select ? opts.select(match.search) : match.search\n },\n }) as any\n}\n"],"mappings":";;;;;;;;;;;;;;AA2EA,SAAgB,UAQd,MAWA;AACA,QAAO,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,aAAa,KAAK;EAClB,mBAAmB,KAAK;EACxB,SAAS,UAAe;AACtB,UAAO,KAAK,SAAS,KAAK,OAAO,MAAM,OAAO,GAAG,MAAM;;EAE1D,CAAC"}
@@ -0,0 +1,17 @@
export type Options = [
{
allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean;
allowDirectConstAssertionInArrowFunctions?: boolean;
allowedNames?: string[];
allowExpressions?: boolean;
allowFunctionsWithoutTypeParameters?: boolean;
allowHigherOrderFunctions?: boolean;
allowIIFEs?: boolean;
allowTypedFunctionExpressions?: boolean;
}
];
export type MessageIds = 'missingReturnType';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingReturnType", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,82 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.input = input;
exports.output = output;
const util_js_1 = require("../core/util.cjs");
const visit_js_1 = require("../core/visit.cjs");
const schemas = __importStar(require("./schemas.cjs"));
/** See `classic/in-out.ts`. */
function withChecks(side, checks) {
if (!checks?.length)
return side;
const def = side._zod.def;
return (0, util_js_1.clone)(side, (0, util_js_1.mergeDefs)(def, { checks: [...(def.checks ?? []), ...checks] }), { parent: true });
}
/** See `classic/in-out.ts`. */
function outSide(def) {
return withChecks(def.out, def.checks);
}
/** See `classic/in-out.ts`. */
function inSide(def) {
return def.in._zod.traits.has("$ZodTransform") ? outSide(def) : def.in;
}
/** See `classic/in-out.ts`. */
function input(schema) {
return (0, visit_js_1.visit)(schema, {
pipe: (s) => inSide(s._zod.def),
// A default value belongs to the output side, so a rewritten inner type leaves it stranded. `.default()` widens the declared input type with `undefined`, and `optional` is what carries that across.
default: (s, rewritten) => (rewritten ? schemas.optional(s._zod.def.innerType) : s),
// A catch value is output-side too, but `.catch()` leaves the declared input type alone, so the inner schema stands on its own.
catch: (s, rewritten) => (rewritten ? s._zod.def.innerType : s),
});
}
/** See `classic/in-out.ts`. */
function output(schema) {
return (0, visit_js_1.visit)(schema, {
pipe: (s) => outSide(s._zod.def),
// A prefault value is fed through the schema, which makes it input-side, so a rewritten inner type leaves it stranded.
prefault: (s, rewritten) => (rewritten ? s._zod.def.innerType : s),
});
}
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1,248 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
// Hebrew labels + grammatical gender
const TypeNames = {
string: { label: "מחרוזת", gender: "f" },
number: { label: "מספר", gender: "m" },
boolean: { label: "ערך בוליאני", gender: "m" },
bigint: { label: "BigInt", gender: "m" },
date: { label: "תאריך", gender: "m" },
array: { label: "מערך", gender: "m" },
object: { label: "אובייקט", gender: "m" },
null: { label: "ערך ריק (null)", gender: "m" },
undefined: { label: "ערך לא מוגדר (undefined)", gender: "m" },
symbol: { label: "סימבול (Symbol)", gender: "m" },
function: { label: "פונקציה", gender: "f" },
map: { label: "מפה (Map)", gender: "f" },
set: { label: "קבוצה (Set)", gender: "f" },
file: { label: "קובץ", gender: "m" },
promise: { label: "Promise", gender: "m" },
NaN: { label: "NaN", gender: "m" },
unknown: { label: "ערך לא ידוע", gender: "m" },
value: { label: "ערך", gender: "m" },
};
// Sizing units for size-related messages + localized origin labels
const Sizable = {
string: { unit: "תווים", shortLabel: "קצר", longLabel: "ארוך" },
file: { unit: "בייטים", shortLabel: "קטן", longLabel: "גדול" },
array: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
number: { unit: "", shortLabel: "קטן", longLabel: "גדול" }, // no unit
};
// Helpers — labels, articles, and verbs
const typeEntry = (t) => (t ? TypeNames[t] : undefined);
const typeLabel = (t) => {
const e = typeEntry(t);
if (e)
return e.label;
// fallback: show raw string if unknown
return t ?? TypeNames.unknown.label;
};
const withDefinite = (t) => `ה${typeLabel(t)}`;
const verbFor = (t) => {
const e = typeEntry(t);
const gender = e?.gender ?? "m";
return gender === "f" ? "צריכה להיות" : "צריך להיות";
};
const getSizing = (origin) => {
if (!origin)
return null;
return Sizable[origin] ?? null;
};
const FormatDictionary = {
regex: { label: "קלט", gender: "m" },
email: { label: "כתובת אימייל", gender: "f" },
url: { label: "כתובת רשת", gender: "f" },
emoji: { label: "אימוג'י", gender: "m" },
uuid: { label: "UUID", gender: "m" },
uuidv4: { label: "UUIDv4", gender: "m" },
uuidv6: { label: "UUIDv6", gender: "m" },
nanoid: { label: "nanoid", gender: "m" },
guid: { label: "GUID", gender: "m" },
cuid: { label: "cuid", gender: "m" },
cuid2: { label: "cuid2", gender: "m" },
ulid: { label: "ULID", gender: "m" },
xid: { label: "XID", gender: "m" },
ksuid: { label: "KSUID", gender: "m" },
datetime: { label: "תאריך וזמן ISO", gender: "m" },
date: { label: "תאריך ISO", gender: "m" },
time: { label: "זמן ISO", gender: "m" },
duration: { label: "משך זמן ISO", gender: "m" },
ipv4: { label: "כתובת IPv4", gender: "f" },
ipv6: { label: "כתובת IPv6", gender: "f" },
mac: { label: "כתובת MAC", gender: "f" },
cidrv4: { label: "טווח IPv4", gender: "m" },
cidrv6: { label: "טווח IPv6", gender: "m" },
base64: { label: "מחרוזת בבסיס 64", gender: "f" },
base64url: { label: "מחרוזת בבסיס 64 לכתובות רשת", gender: "f" },
json_string: { label: "מחרוזת JSON", gender: "f" },
e164: { label: "מספר E.164", gender: "m" },
credit_card: { label: "מספר כרטיס אשראי", gender: "m" },
currency_code: { label: "קוד מטבע", gender: "m" },
iban: { label: "IBAN", gender: "m" },
jwt: { label: "JWT", gender: "m" },
template_literal: { label: "קלט", gender: "m" },
ends_with: { label: "קלט", gender: "m" },
includes: { label: "קלט", gender: "m" },
lowercase: { label: "קלט", gender: "m" },
starts_with: { label: "קלט", gender: "m" },
uppercase: { label: "קלט", gender: "m" },
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
// Expected type: show without definite article for clearer Hebrew
const expectedKey = issue.expected;
const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey);
// Received: show localized label if known, otherwise constructor/raw
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `קלט לא תקין: צריך להיות instanceof ${issue.expected}, התקבל ${received}`;
}
return `קלט לא תקין: צריך להיות ${expected}, התקבל ${received}`;
}
case "invalid_value": {
if (issue.values.length === 1) {
return `ערך לא תקין: הערך חייב להיות ${util.stringifyPrimitive(issue.values[0])}`;
}
// Join values with proper Hebrew formatting
const stringified = issue.values.map((v) => util.stringifyPrimitive(v));
if (issue.values.length === 2) {
return `ערך לא תקין: האפשרויות המתאימות הן ${stringified[0]} או ${stringified[1]}`;
}
// For 3+ values: "a", "b" או "c"
const lastValue = stringified[stringified.length - 1];
const restValues = stringified.slice(0, -1).join(", ");
return `ערך לא תקין: האפשרויות המתאימות הן ${restValues} או ${lastValue}`;
}
case "too_big": {
const sizing = getSizing(issue.origin);
const subject = withDefinite(issue.origin ?? "value");
if (issue.origin === "string") {
// Special handling for strings - more natural Hebrew
return `${sizing?.longLabel ?? "ארוך"} מדי: ${subject} צריכה להכיל ${issue.maximum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או פחות" : "לכל היותר"}`.trim();
}
if (issue.origin === "number") {
// Natural Hebrew for numbers
const comparison = issue.inclusive ? `קטן או שווה ל-${issue.maximum}` : `קטן מ-${issue.maximum}`;
return `גדול מדי: ${subject} צריך להיות ${comparison}`;
}
if (issue.origin === "array" || issue.origin === "set") {
// Natural Hebrew for arrays and sets
const verb = issue.origin === "set" ? "צריכה" : "צריך";
const comparison = issue.inclusive
? `${issue.maximum} ${sizing?.unit ?? ""} או פחות`
: `פחות מ-${issue.maximum} ${sizing?.unit ?? ""}`;
return `גדול מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
}
const adj = issue.inclusive ? "<=" : "<";
const be = verbFor(issue.origin ?? "value");
if (sizing?.unit) {
return `${sizing.longLabel} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()} ${sizing.unit}`;
}
return `${sizing?.longLabel ?? "גדול"} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const sizing = getSizing(issue.origin);
const subject = withDefinite(issue.origin ?? "value");
if (issue.origin === "string") {
// Special handling for strings - more natural Hebrew
return `${sizing?.shortLabel ?? "קצר"} מדי: ${subject} צריכה להכיל ${issue.minimum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או יותר" : "לפחות"}`.trim();
}
if (issue.origin === "number") {
// Natural Hebrew for numbers
const comparison = issue.inclusive ? `גדול או שווה ל-${issue.minimum}` : `גדול מ-${issue.minimum}`;
return `קטן מדי: ${subject} צריך להיות ${comparison}`;
}
if (issue.origin === "array" || issue.origin === "set") {
// Natural Hebrew for arrays and sets
const verb = issue.origin === "set" ? "צריכה" : "צריך";
// Special case for singular (minimum === 1)
if (issue.minimum === 1 && issue.inclusive) {
const singularPhrase = issue.origin === "set" ? "לפחות פריט אחד" : "לפחות פריט אחד";
return `קטן מדי: ${subject} ${verb} להכיל ${singularPhrase}`;
}
const comparison = issue.inclusive
? `${issue.minimum} ${sizing?.unit ?? ""} או יותר`
: `יותר מ-${issue.minimum} ${sizing?.unit ?? ""}`;
return `קטן מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
}
const adj = issue.inclusive ? ">=" : ">";
const be = verbFor(issue.origin ?? "value");
if (sizing?.unit) {
return `${sizing.shortLabel} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `${sizing?.shortLabel ?? "קטן"} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
// These apply to strings — use feminine grammar + ה׳ הידיעה
if (_issue.format === "starts_with")
return `המחרוזת חייבת להתחיל ב "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `המחרוזת חייבת להסתיים ב "${_issue.suffix}"`;
if (_issue.format === "includes")
return `המחרוזת חייבת לכלול "${_issue.includes}"`;
if (_issue.format === "regex")
return `המחרוזת חייבת להתאים לתבנית ${_issue.pattern}`;
// Handle gender agreement for formats
const nounEntry = FormatDictionary[_issue.format];
const noun = nounEntry?.label ?? _issue.format;
const gender = nounEntry?.gender ?? "m";
const adjective = gender === "f" ? "תקינה" : "תקין";
return `${noun} לא ${adjective}`;
}
case "not_multiple_of":
return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
case "unrecognized_keys":
return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key": {
return `שדה לא תקין באובייקט`;
}
case "invalid_union":
return "קלט לא תקין";
case "invalid_element": {
const place = withDefinite(issue.origin ?? "array");
return `ערך לא תקין ב${place}`;
}
default:
return `קלט לא תקין`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -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 ReceiptRussianRuble = createLucideIcon("ReceiptRussianRuble", [
[
"path",
{ d: "M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z", key: "q3az6g" }
],
["path", { d: "M8 15h5", key: "vxg57a" }],
["path", { d: "M8 11h5a2 2 0 1 0 0-4h-3v10", key: "1usi5u" }]
]);
export { ReceiptRussianRuble as default };
//# sourceMappingURL=receipt-russian-ruble.js.map
@@ -0,0 +1 @@
{"version":3,"file":"panel-bottom-close.js","sources":["../../../src/icons/panel-bottom-close.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelBottomClose\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDE1aDE4IiAvPgogIDxwYXRoIGQ9Im0xNSA4LTMgMy0zLTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-bottom-close\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 PanelBottomClose = createLucideIcon('PanelBottomClose', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M3 15h18', key: '5xshup' }],\n ['path', { d: 'm15 8-3 3-3-3', key: '1oxy1z' }],\n]);\n\nexport default PanelBottomClose;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Toilet = createLucideIcon("Toilet", [
[
"path",
{
d: "M7 12h13a1 1 0 0 1 1 1 5 5 0 0 1-5 5h-.598a.5.5 0 0 0-.424.765l1.544 2.47a.5.5 0 0 1-.424.765H5.402a.5.5 0 0 1-.424-.765L7 18",
key: "kc4kqr"
}
],
["path", { d: "M8 18a5 5 0 0 1-5-5V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8", key: "1tqs57" }]
]);
export { Toilet as default };
//# sourceMappingURL=toilet.js.map
@@ -0,0 +1,43 @@
let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes))
let customAlphabet = (alphabet, defaultSize = 21) => {
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
return async (size = defaultSize) => {
if (size <= 0) return ''
let id = ''
while (true) {
let bytes = crypto.getRandomValues(new Uint8Array(step))
let i = step | 0
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length === size) return id
}
}
}
}
let nanoid = async (size = 21) => {
let id = ''
let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)))
while (size--) {
let byte = bytes[size] & 63
if (byte < 36) {
id += byte.toString(36)
} else if (byte < 62) {
id += (byte - 26).toString(36).toUpperCase()
} else if (byte < 63) {
id += '_'
} else {
id += '-'
}
}
return id
}
export { nanoid, customAlphabet, random }
@@ -0,0 +1,187 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mkdirSync = exports.mkdir = void 0;
const chownr_1 = require("chownr");
const node_fs_1 = __importDefault(require("node:fs"));
const promises_1 = __importDefault(require("node:fs/promises"));
const node_path_1 = __importDefault(require("node:path"));
const cwd_error_js_1 = require("./cwd-error.js");
const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
const symlink_error_js_1 = require("./symlink-error.js");
const checkCwd = (dir, cb) => {
node_fs_1.default.stat(dir, (er, st) => {
if (er || !st.isDirectory()) {
er = new cwd_error_js_1.CwdError(dir, er?.code || 'ENOTDIR');
}
cb(er);
});
};
/**
* Wrapper around fs/promises.mkdir for tar's needs.
*
* The main purpose is to avoid creating directories if we know that
* they already exist (and track which ones exist for this purpose),
* and prevent entries from being extracted into symlinked folders,
* if `preservePaths` is not set.
*/
const mkdir = (dir, opt, cb) => {
dir = (0, normalize_windows_path_js_1.normalizeWindowsPath)(dir);
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
/* c8 ignore next */
const umask = opt.umask ?? 0o22;
const mode = opt.mode | 0o0700;
const needChmod = (mode & umask) !== 0;
const uid = opt.uid;
const gid = opt.gid;
const doChown = typeof uid === 'number' &&
typeof gid === 'number' &&
(uid !== opt.processUid || gid !== opt.processGid);
const preserve = opt.preserve;
const unlink = opt.unlink;
const cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd);
const done = (er, created) => {
if (er) {
cb(er);
}
else {
if (created && doChown) {
(0, chownr_1.chownr)(created, uid, gid, er => done(er));
}
else if (needChmod) {
node_fs_1.default.chmod(dir, mode, cb);
}
else {
cb();
}
}
};
if (dir === cwd) {
return checkCwd(dir, done);
}
if (preserve) {
return promises_1.default.mkdir(dir, { mode, recursive: true }).then(made => done(null, made ?? undefined), // oh, ts
done);
}
const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
const parts = sub.split('/');
mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
};
exports.mkdir = mkdir;
const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
if (parts.length === 0) {
return cb(null, created);
}
const p = parts.shift();
const part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(base + '/' + p));
node_fs_1.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
};
const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
if (er) {
node_fs_1.default.lstat(part, (statEr, st) => {
if (statEr) {
statEr.path = statEr.path && (0, normalize_windows_path_js_1.normalizeWindowsPath)(statEr.path);
cb(statEr);
}
else if (st.isDirectory()) {
mkdir_(part, parts, mode, unlink, cwd, created, cb);
}
else if (unlink) {
node_fs_1.default.unlink(part, er => {
if (er) {
return cb(er);
}
node_fs_1.default.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
});
}
else if (st.isSymbolicLink()) {
return cb(new symlink_error_js_1.SymlinkError(part, part + '/' + parts.join('/')));
}
else {
cb(er);
}
});
}
else {
created = created || part;
mkdir_(part, parts, mode, unlink, cwd, created, cb);
}
};
const checkCwdSync = (dir) => {
let ok = false;
let code;
try {
ok = node_fs_1.default.statSync(dir).isDirectory();
}
catch (er) {
code = er?.code;
}
finally {
if (!ok) {
throw new cwd_error_js_1.CwdError(dir, code ?? 'ENOTDIR');
}
}
};
const mkdirSync = (dir, opt) => {
dir = (0, normalize_windows_path_js_1.normalizeWindowsPath)(dir);
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
/* c8 ignore next */
const umask = opt.umask ?? 0o22;
const mode = opt.mode | 0o700;
const needChmod = (mode & umask) !== 0;
const uid = opt.uid;
const gid = opt.gid;
const doChown = typeof uid === 'number' &&
typeof gid === 'number' &&
(uid !== opt.processUid || gid !== opt.processGid);
const preserve = opt.preserve;
const unlink = opt.unlink;
const cwd = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.cwd);
const done = (created) => {
if (created && doChown) {
(0, chownr_1.chownrSync)(created, uid, gid);
}
if (needChmod) {
node_fs_1.default.chmodSync(dir, mode);
}
};
if (dir === cwd) {
checkCwdSync(cwd);
return done();
}
if (preserve) {
return done(node_fs_1.default.mkdirSync(dir, { mode, recursive: true }) ?? undefined);
}
const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
const parts = sub.split('/');
let created;
for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(part));
try {
node_fs_1.default.mkdirSync(part, mode);
created = created || part;
}
catch {
const st = node_fs_1.default.lstatSync(part);
if (st.isDirectory()) {
continue;
}
else if (unlink) {
node_fs_1.default.unlinkSync(part);
node_fs_1.default.mkdirSync(part, mode);
created = created || part;
continue;
}
else if (st.isSymbolicLink()) {
return new symlink_error_js_1.SymlinkError(part, part + '/' + parts.join('/'));
}
}
}
return done(created);
};
exports.mkdirSync = mkdirSync;
//# sourceMappingURL=mkdir.js.map
@@ -0,0 +1,130 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = config;
/**
* Utility function to make it easy to strictly type your "Flat" config file
* @example
* ```js
* // @ts-check
*
* import js from '@eslint/js';
* import tseslint from 'typescript-eslint';
*
* export default tseslint.config(
* js.configs.recommended,
* tseslint.configs.recommended,
* {
* rules: {
* '@typescript-eslint/array-type': 'error',
* },
* },
* );
* ```
*
* @deprecated ESLint core now provides this functionality via `defineConfig()`,
* which we now recommend instead. See {@link https://typescript-eslint.io/packages/typescript-eslint/#config-deprecated}.
*/
function config(...configs) {
return configImpl(...configs);
}
// Implementation of the config function without assuming the runtime type of
// the input.
function configImpl(...configs) {
const flattened = configs.flat(Infinity);
return flattened.flatMap((configWithExtends, configIndex) => {
if (configWithExtends == null ||
typeof configWithExtends !== 'object' ||
!('extends' in configWithExtends)) {
// Unless the object is a config object with extends key, just forward it
// along to eslint.
return configWithExtends;
}
const { extends: extendsArr, ..._config } = configWithExtends;
const config = _config;
if (extendsArr == null) {
// If the extends value is nullish, just forward along the rest of the
// config object to eslint.
return config;
}
const name = (() => {
if ('name' in configWithExtends && configWithExtends.name != null) {
if (typeof configWithExtends.name !== 'string') {
throw new Error(`tseslint.config(): Config at index ${configIndex} has a 'name' property that is not a string.`);
}
return configWithExtends.name;
}
return undefined;
})();
const nameErrorPhrase = name != null ? `, named "${name}",` : ' (anonymous)';
if (!Array.isArray(extendsArr)) {
throw new TypeError(`tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} has an 'extends' property that is not an array.`);
}
const extendsArrFlattened = extendsArr.flat(Infinity);
const nonObjectExtensions = [];
for (const [extensionIndex, extension] of extendsArrFlattened.entries()) {
// special error message to be clear we don't support eslint's stringly typed extends.
// https://eslint.org/docs/latest/use/configure/configuration-files#extending-configurations
if (typeof extension === 'string') {
throw new Error(`tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} has an 'extends' array that contains a string (${JSON.stringify(extension)}) at index ${extensionIndex}.` +
" This is a feature of eslint's `defineConfig()` helper and is not supported by typescript-eslint." +
' Please provide a config object instead.');
}
if (extension == null || typeof extension !== 'object') {
nonObjectExtensions.push(extensionIndex);
continue;
}
// https://github.com/eslint/rewrite/blob/82d07fd0e8e06780b552a41f8bcbe2a4f8741d42/packages/config-helpers/src/define-config.js#L448-L450
if ('basePath' in extension) {
throw new TypeError(`tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} has an 'extends' array that contains a config with a 'basePath' property at index ${extensionIndex}.` +
` 'basePath' in 'extends' is not allowed.`);
}
if ('extends' in extension) {
throw new TypeError(`tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} has an 'extends' array that contains a config with an 'extends' property at index ${extensionIndex}.` +
` Nested 'extends' is not allowed.`);
}
}
if (nonObjectExtensions.length > 0) {
const extensionIndices = nonObjectExtensions.join(', ');
throw new TypeError(`tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} contains non-object` +
` extensions at the following indices: ${extensionIndices}.`);
}
const configArray = [];
for (const _extension of extendsArrFlattened) {
const extension = _extension;
const resolvedConfigName = [name, extension.name]
.filter(Boolean)
.join('__');
if (isPossiblyGlobalIgnores(extension)) {
// If it's a global ignores, then just pass it along
configArray.push({
...extension,
...(resolvedConfigName !== '' ? { name: resolvedConfigName } : {}),
});
}
else {
configArray.push({
...extension,
...(config.files ? { files: config.files } : {}),
...(config.ignores ? { ignores: config.ignores } : {}),
...(config.basePath ? { basePath: config.basePath } : {}),
...(resolvedConfigName !== '' ? { name: resolvedConfigName } : {}),
});
}
}
// If the base config could form a global ignores object, then we mustn't include
// it in the output. Otherwise, we must add it in order for it to have effect.
if (!isPossiblyGlobalIgnores(config)) {
configArray.push(config);
}
return configArray;
});
}
/**
* This utility function returns false if the config objects contains any field
* that would prevent it from being considered a global ignores object and true
* otherwise. Note in particular that the `ignores` field may not be present and
* the return value can still be true.
*/
function isPossiblyGlobalIgnores(config) {
return Object.keys(config).every(key => ['name', 'ignores', 'basePath'].includes(key));
}
@@ -0,0 +1,32 @@
// @flow
opaque type Next = Function | void;
opaque type Yield = mixed;
export type Gensync<Args, Return> = {
(...args: Args): Handler<Return>,
sync(...args: Args): Return,
async(...args: Args): Promise<Return>,
// ...args: [...Args, Callback]
errback(...args: any[]): void,
};
export type Handler<Return> = Generator<Yield, Return, Next>;
export type Options<Args, Return> = {
sync(...args: Args): Return,
arity?: number,
name?: string,
} & (
| { async?: (...args: Args) => Promise<Return> }
// ...args: [...Args, Callback]
| { errback(...args: any[]): void }
);
declare module.exports: {
<Args, Return>(
Options<Args, Return> | ((...args: Args) => Handler<Return>)
): Gensync<Args, Return>,
all<Return>(Array<Handler<Return>>): Handler<Return[]>,
race<Return>(Array<Handler<Return>>): Handler<Return>,
};
@@ -0,0 +1,21 @@
/**
* Internal helpers for blake hash.
* @module
*/
import { type TRet } from './utils.ts';
/**
* Internal blake permutation table.
* Rows `0..9` serve BLAKE2s, rows `0..11` serve BLAKE2b with `10..11 = 0..1`, and Blake1 also
* reuses the later rows shown below. Blake1 expands rounds `10..15` as `SIGMA[i % 10]`, so rows
* `10..15` intentionally repeat rows `0..5` for the 14-round (256) and 16-round (512) variants.
*/
export declare const BSIGMA: TRet<Uint8Array>;
export type Num4 = {
a: number;
b: number;
c: number;
d: number;
};
export declare function G1s(a: number, b: number, c: number, d: number, x: number): Num4;
export declare function G2s(a: number, b: number, c: number, d: number, x: number): Num4;
//# sourceMappingURL=_blake.d.ts.map
@@ -0,0 +1,17 @@
export { createTailwindMerge } from './lib/create-tailwind-merge'
export { getDefaultConfig } from './lib/default-config'
export { extendTailwindMerge } from './lib/extend-tailwind-merge'
export { fromTheme } from './lib/from-theme'
export { mergeConfigs } from './lib/merge-configs'
export { twJoin, type ClassNameValue } from './lib/tw-join'
export { twMerge } from './lib/tw-merge'
export {
type ClassValidator,
type Config,
type ConfigExtension,
type DefaultClassGroupIds,
type DefaultThemeGroupIds,
type ExperimentalParseClassNameParam,
type ParsedClassName as ExperimentalParsedClassName,
} from './lib/types'
export * as validators from './lib/validators'
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_1R","2":"_o _oC _L"},D:{"1":"_H _bK _uH","2":"_7 _TG"},E:{"1":"_KF","2":"_VD"},F:{"1":"_OM","2":"_1F"},G:{"1":"_TE","2":"_IF"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_cJ","2":"_rO"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:5,C:"prefers-color-scheme media query",D:true};
@@ -0,0 +1 @@
{"version":3,"names":["_async","require","_path","data","_url","_semver","_debug","_rewriteStackTrace","_configError","_transformFile","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","debug","buildDebug","import_","_unused","supportsESM","exports","semver","satisfies","process","versions","node","LOADING_CJS_FILES","Set","loadCjsDefault","filepath","has","module","add","endHiddenCallStack","delete","__esModule","Symbol","toStringTag","default","undefined","loadMjsFromPath","_loadMjsFromPath","url","pathToFileURL","toString","ConfigError","_x","tsNotSupportedError","ext","SUPPORTED_EXTENSIONS","asyncModules","loadCodeDefault","loader","esmError","tlaError","async","path","extname","isTS","type","hasOwnProperty","call","pattern","ensureTsSupport","code","isAsync","promise","waitFor","Error","callback","features","typescript","extensions","opts","babelrc","configFile","sourceType","sourceMaps","sourceFileName","basename","presets","getTSPreset","Object","assign","onlyRemoveTypeImports","optimizeConstEnums","allowDeclareFields","handler","m","filename","endsWith","_compile","transformFileSync","error","packageJson","lt","version","console","message","pnp"],"sources":["../../../src/config/files/module-types.ts"],"sourcesContent":["import { isAsync, waitFor } from \"../../gensync-utils/async.ts\";\nimport type { Handler } from \"gensync\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { createRequire } from \"node:module\";\nimport semver from \"semver\";\nimport buildDebug from \"debug\";\n\nimport { endHiddenCallStack } from \"../../errors/rewrite-stack-trace.ts\";\nimport ConfigError from \"../../errors/config-error.ts\";\n\nimport type { InputOptions } from \"../index.ts\";\nimport { transformFileSync } from \"../../transform-file.ts\";\n\nconst debug = buildDebug(\"babel:config:loading:files:module-types\");\n\nconst require = createRequire(import.meta.url);\n\nif (!process.env.BABEL_8_BREAKING) {\n try {\n // Old Node.js versions don't support import() syntax.\n // eslint-disable-next-line no-var\n var import_:\n | ((specifier: string | URL) => any)\n | undefined = require(\"./import.cjs\");\n } catch {}\n}\n\nexport const supportsESM = semver.satisfies(\n process.versions.node,\n // older versions, starting from 10, support the dynamic\n // import syntax but always return a rejected promise.\n \"^12.17 || >=13.2\",\n);\n\nconst LOADING_CJS_FILES = new Set();\n\nfunction loadCjsDefault(filepath: string) {\n // The `require()` call below can make this code reentrant if a require hook\n // like @babel/register has been loaded into the system. That would cause\n // Babel to attempt to compile the `.babelrc.js` file as it loads below. To\n // cover this case, we auto-ignore re-entrant config processing. ESM loaders\n // do not have this problem, because loaders do not apply to themselves.\n if (LOADING_CJS_FILES.has(filepath)) {\n debug(\"Auto-ignoring usage of config %o.\", filepath);\n return {};\n }\n\n let module;\n try {\n LOADING_CJS_FILES.add(filepath);\n module = endHiddenCallStack(require)(filepath);\n } finally {\n LOADING_CJS_FILES.delete(filepath);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default\n : module;\n } else {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default ||\n /* fallbackToTranspiledModule */ (arguments[1] ? module : undefined)\n : module;\n }\n}\n\nconst loadMjsFromPath = endHiddenCallStack(async function loadMjsFromPath(\n filepath: string,\n) {\n // Add ?import as a workaround for https://github.com/nodejs/node/issues/55500\n const url = pathToFileURL(filepath).toString() + \"?import\";\n\n if (process.env.BABEL_8_BREAKING) {\n return await import(url);\n } else {\n if (!import_) {\n throw new ConfigError(\n \"Internal error: Native ECMAScript modules aren't supported by this platform.\\n\",\n filepath,\n );\n }\n\n return await import_(url);\n }\n});\n\nconst tsNotSupportedError = (ext: string) => `\\\nYou are using a ${ext} config file, but Babel only supports transpiling .cts configs. Either:\n- Use a .cts config file\n- Update to Node.js 23.6.0, which has native TypeScript support\n- Install tsx to transpile ${ext} files on the fly\\\n`;\n\nconst SUPPORTED_EXTENSIONS = {\n \".js\": \"unknown\",\n \".mjs\": \"esm\",\n \".cjs\": \"cjs\",\n \".ts\": \"unknown\",\n \".mts\": \"esm\",\n \".cts\": \"cjs\",\n} as const;\n\nconst asyncModules = new Set();\n\nexport default function* loadCodeDefault(\n filepath: string,\n loader: \"require\" | \"auto\",\n esmError: string,\n tlaError: string,\n): Handler<unknown> {\n let asynLine truncated
@@ -0,0 +1,25 @@
/**
* @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 ScanHeart = createLucideIcon("ScanHeart", [
[
"path",
{
d: "M11.246 16.657a1 1 0 0 0 1.508 0l3.57-4.101A2.75 2.75 0 1 0 12 9.168a2.75 2.75 0 1 0-4.324 3.388z",
key: "1algrk"
}
],
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
]);
export { ScanHeart as default };
//# sourceMappingURL=scan-heart.js.map
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./pow')} */
module.exports = Math.pow;
@@ -0,0 +1 @@
{"version":3,"sources":["../src/decompress.ts"],"sourcesContent":["export default function decompress(encodedString: string) {\n const decompressedArray = encodedString.split(/([A-Z])/g)\n const decompressedData = []\n let last = ''\n let i\n for (i = 1; i < decompressedArray.length; i += 2) {\n last =\n last.slice(0, decompressedArray[i].charCodeAt(0) - 65) +\n decompressedArray[i + 1]\n decompressedData.push(last)\n }\n\n return decompressedData\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAe,SAAR,WAA4B,eAAuB;AACxD,QAAM,oBAAoB,cAAc,MAAM,UAAU;AACxD,QAAM,mBAAmB,CAAC;AAC1B,MAAI,OAAO;AACX,MAAI;AACJ,OAAK,IAAI,GAAG,IAAI,kBAAkB,QAAQ,KAAK,GAAG;AAChD,WACE,KAAK,MAAM,GAAG,kBAAkB,CAAC,EAAE,WAAW,CAAC,IAAI,EAAE,IACrD,kBAAkB,IAAI,CAAC;AACzB,qBAAiB,KAAK,IAAI;AAAA,EAC5B;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,40 @@
const isObjectLike = (value) => typeof value === 'object' && value !== null;
export function isObject(input) {
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
return false;
}
if (Object.getPrototypeOf(input) === null) {
return true;
}
let proto = input;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(input) === proto;
}
export function isDisjoint(...headers) {
const sources = headers.filter(Boolean);
if (sources.length === 0 || sources.length === 1) {
return true;
}
let acc;
for (const header of sources) {
const parameters = Object.keys(header);
if (!acc || acc.size === 0) {
acc = new Set(parameters);
continue;
}
for (const parameter of parameters) {
if (acc.has(parameter)) {
return false;
}
acc.add(parameter);
}
}
return true;
}
export const isJWK = (key) => isObject(key) && typeof key.kty === 'string';
export const isPrivateJWK = (key) => key.kty !== 'oct' &&
((key.kty === 'AKP' && typeof key.priv === 'string') || typeof key.d === 'string');
export const isPublicJWK = (key) => key.kty !== 'oct' && key.d === undefined && key.priv === undefined;
export const isSecretJWK = (key) => key.kty === 'oct' && typeof key.k === 'string';
@@ -0,0 +1 @@
{"version":3,"names":["_semver","require","_helperValidatorOption","_targets","versionRegExp","v","OptionValidator","semverMin","first","second","semver","lt","semverify","version","valid","invariant","test","toString","pos","num","indexOf","repeat","isUnreleasedVersion","env","unreleasedLabel","unreleasedLabels","toLowerCase","getLowestUnreleased","a","b","getHighestUnreleased","getLowestImplementedVersion","plugin","environment","result","chrome"],"sources":["../src/utils.ts"],"sourcesContent":["import semver from \"semver\";\nimport { OptionValidator } from \"@babel/helper-validator-option\";\nimport { unreleasedLabels } from \"./targets.ts\";\nimport type { Target, Targets } from \"./types.ts\";\n\nconst versionRegExp =\n /^(?:\\d+|\\d(?:\\d?[^\\d\\n\\r\\u2028\\u2029]\\d+|\\d{2,}(?:[^\\d\\n\\r\\u2028\\u2029]\\d+)?))$/;\n\nconst v = new OptionValidator(PACKAGE_JSON.name);\n\nexport function semverMin(\n first: string | undefined | null,\n second: string,\n): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n v.invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n version = version.toString();\n\n let pos = 0;\n let num = 0;\n while ((pos = version.indexOf(\".\", pos + 1)) > 0) {\n num++;\n }\n return version + \".0\".repeat(2 - num);\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: Target,\n): boolean {\n const unreleasedLabel =\n // @ts-expect-error unreleasedLabel will be guarded later\n unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: Target): string {\n const unreleasedLabel:\n | (typeof unreleasedLabels)[keyof typeof unreleasedLabels]\n | undefined =\n // @ts-expect-error unreleasedLabel is undefined when env is not safari\n unreleasedLabels[env];\n if (a === unreleasedLabel) {\n return b;\n }\n if (b === unreleasedLabel) {\n return a;\n }\n return semverMin(a, b);\n}\n\nexport function getHighestUnreleased(\n a: string,\n b: string,\n env: Target,\n): string {\n return getLowestUnreleased(a, b, env) === a ? b : a;\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAGA,MAAMG,aAAa,GACjB,iFAAiF;AAEnF,MAAMC,CAAC,GAAG,IAAIC,sCAAe,oCAAkB,CAAC;AAEzC,SAASC,SAASA,CACvBC,KAAgC,EAChCC,MAAc,EACN;EACR,OAAOD,KAAK,IAAIE,OAAM,CAACC,EAAE,CAACH,KAAK,EAAEC,MAAM,CAAC,GAAGD,KAAK,GAAGC,MAAM;AAC3D;AAIO,SAASG,SAASA,CAACC,OAAwB,EAAU;EAC1D,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAIH,OAAM,CAACI,KAAK,CAACD,OAAO,CAAC,EAAE;IACxD,OAAOA,OAAO;EAChB;EAEAR,CAAC,CAACU,SAAS,CACT,OAAOF,OAAO,KAAK,QAAQ,IACxB,OAAOA,OAAO,KAAK,QAAQ,IAAIT,aAAa,CAACY,IAAI,CAACH,OAAO,CAAE,EAC9D,IAAIA,OAAO,0BACb,CAAC;EAEDA,OAAO,GAAGA,OAAO,CAACI,QAAQ,CAAC,CAAC;EAE5B,IAAIC,GAAG,GAAG,CAAC;EACX,IAAIC,GAAG,GAAG,CAAC;EACX,OAAO,CAACD,GAAG,GAAGL,OAAO,CAACO,OAAO,CAAC,GAAG,EAAEF,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;IAChDC,GAAG,EAAE;EACP;EACA,OAAON,OAAO,GAAG,IAAI,CAACQ,MAAM,CAAC,CAAC,GAAGF,GAAG,CAAC;AACvC;AAEO,SAASG,mBAAmBA,CACjCT,OAAwB,EACxBU,GAAW,EACF;EACT,MAAMC,eAAe,GAEnBC,yBAAgB,CAACF,GAAG,CAAC;EACvB,OACE,CAAC,CAACC,eAAe,IAAIA,eAAe,KAAKX,OAAO,CAACI,QAAQ,CAAC,CAAC,CAACS,WAAW,CAAC,CAAC;AAE7E;AAEO,SAASC,mBAAmBA,CAACC,CAAS,EAAEC,CAAS,EAAEN,GAAW,EAAU;EAC7E,MAAMC,eAEO,GAEXC,yBAAgB,CAACF,GAAG,CAAC;EACvB,IAAIK,CAAC,KAAKJ,eAAe,EAAE;IACzB,OAAOK,CAAC;EACV;EACA,IAAIA,CAAC,KAAKL,eAAe,EAAE;IACzB,OAAOI,CAAC;EACV;EACA,OAAOrB,SAAS,CAACqB,CAAC,EAAEC,CAAC,CAAC;AACxB;AAEO,SAASC,oBAAoBA,CAClCF,CAAS,EACTC,CAAS,EACTN,GAAW,EACH;EACR,OAAOI,mBAAmB,CAACC,CAAC,EAAEC,CAAC,EAAEN,GAAG,CAAC,KAAKK,CAAC,GAAGC,CAAC,GAAGD,CAAC;AACrD;AAEO,SAASG,2BAA2BA,CACzCC,MAAe,EACfC,WAAmB,EACX;EACR,MAAMC,MAAM,GAAGF,MAAM,CAACC,WAAW,CAAC;EAElC,IAAI,CAACC,MAAM,IAAID,WAAW,KAAK,SAAS,EAAE;IACxC,OAAOD,MAAM,CAACG,MAAM;EACtB;EACA,OAAOD,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2017_typedarrays: LibDefinition;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_I","258":"_mG","322":"_OF","388":"_6R"},C:{"2":"_o _kE _L","258":"_H _WC"},D:{"2":"_eO","258":"_MJ _eC _sD","322":"_OF","388":"_4O"},E:{"2":"_3C","258":"_PC"},F:{"2":"_QS","258":"_TC _oG _xJ","322":"_GS _aF","388":"_mQ _h"},G:{"2":"_0C","258":"_NC"},H:{"2":"1D"},I:{"2":"_G","258":"I"},J:{"2":"_B"},K:{"2":"_D","388":"H"},L:{"388":"I"},M:{"258":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_pC","258":"_yB"},Q:{"258":"JE"},R:{"388":"KE"},S:{"2":"LE","258":"ME"}},B:5,C:"Permissions Policy",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/create.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AA0E1C,eAAO,MAAM,MAAM,wDAUlB,CAAA"}
@@ -0,0 +1,42 @@
#!/usr/bin/env node
let { readFileSync } = require('fs')
let { join } = require('path')
require('./check-npm-version')
let updateDb = require('./')
const ROOT = __dirname
function getPackage() {
return JSON.parse(readFileSync(join(ROOT, 'package.json')))
}
let args = process.argv.slice(2)
let USAGE = 'Usage:\n npx update-browserslist-db\n'
function isArg(arg) {
return args.some(i => i === arg)
}
function error(msg) {
process.stderr.write('update-browserslist-db: ' + msg + '\n')
process.exit(1)
}
if (isArg('--help') || isArg('-h')) {
process.stdout.write(getPackage().description + '.\n\n' + USAGE + '\n')
} else if (isArg('--version') || isArg('-v')) {
process.stdout.write('browserslist-lint ' + getPackage().version + '\n')
} else {
try {
updateDb()
} catch (e) {
if (e.name === 'BrowserslistUpdateError') {
error(e.message)
} else {
throw e
}
}
}