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

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

No files matched your search

@@ -0,0 +1,7 @@
import type { ErrorObject } from "../types";
export default class ValidationError extends Error {
readonly errors: Partial<ErrorObject>[];
readonly ajv: true;
readonly validation: true;
constructor(errors: Partial<ErrorObject>[]);
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_oH _p","2":"_yJ","194":"_hE _nD _3D","1218":"_8D iC _1E"},D:{"1":"_TI","2":"_bL","322":"_6I tB"},E:{"1":"_uC","2":"_BH"},F:{"1":"_6G","2":"_HR","578":"_VQ KB"},G:{"1":"_7B","2":"_XE"},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":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:1,C:"Dialog element",D:true};
@@ -0,0 +1,187 @@
'use strict';
/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
*/
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */
/**
* @type {VisitorKeys}
*/
const KEYS = {
ArrayExpression: ["elements"],
ArrayPattern: ["elements"],
ArrowFunctionExpression: ["params", "body"],
AssignmentExpression: ["left", "right"],
AssignmentPattern: ["left", "right"],
AwaitExpression: ["argument"],
BinaryExpression: ["left", "right"],
BlockStatement: ["body"],
BreakStatement: ["label"],
CallExpression: ["callee", "arguments"],
CatchClause: ["param", "body"],
ChainExpression: ["expression"],
ClassBody: ["body"],
ClassDeclaration: ["id", "superClass", "body"],
ClassExpression: ["id", "superClass", "body"],
ConditionalExpression: ["test", "consequent", "alternate"],
ContinueStatement: ["label"],
DebuggerStatement: [],
DoWhileStatement: ["body", "test"],
EmptyStatement: [],
ExperimentalRestProperty: ["argument"],
ExperimentalSpreadProperty: ["argument"],
ExportAllDeclaration: ["exported", "source", "attributes"],
ExportDefaultDeclaration: ["declaration"],
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source",
"attributes",
],
ExportSpecifier: ["local", "exported"],
ExpressionStatement: ["expression"],
ForInStatement: ["left", "right", "body"],
ForOfStatement: ["left", "right", "body"],
ForStatement: ["init", "test", "update", "body"],
FunctionDeclaration: ["id", "params", "body"],
FunctionExpression: ["id", "params", "body"],
Identifier: [],
IfStatement: ["test", "consequent", "alternate"],
ImportAttribute: ["key", "value"],
ImportDeclaration: ["specifiers", "source", "attributes"],
ImportDefaultSpecifier: ["local"],
ImportExpression: ["source", "options"],
ImportNamespaceSpecifier: ["local"],
ImportSpecifier: ["imported", "local"],
JSXAttribute: ["name", "value"],
JSXClosingElement: ["name"],
JSXClosingFragment: [],
JSXElement: ["openingElement", "children", "closingElement"],
JSXEmptyExpression: [],
JSXExpressionContainer: ["expression"],
JSXFragment: ["openingFragment", "children", "closingFragment"],
JSXIdentifier: [],
JSXMemberExpression: ["object", "property"],
JSXNamespacedName: ["namespace", "name"],
JSXOpeningElement: ["name", "attributes"],
JSXOpeningFragment: [],
JSXSpreadAttribute: ["argument"],
JSXSpreadChild: ["expression"],
JSXText: [],
LabeledStatement: ["label", "body"],
Literal: [],
LogicalExpression: ["left", "right"],
MemberExpression: ["object", "property"],
MetaProperty: ["meta", "property"],
MethodDefinition: ["key", "value"],
NewExpression: ["callee", "arguments"],
ObjectExpression: ["properties"],
ObjectPattern: ["properties"],
PrivateIdentifier: [],
Program: ["body"],
Property: ["key", "value"],
PropertyDefinition: ["key", "value"],
RestElement: ["argument"],
ReturnStatement: ["argument"],
SequenceExpression: ["expressions"],
SpreadElement: ["argument"],
StaticBlock: ["body"],
Super: [],
SwitchCase: ["test", "consequent"],
SwitchStatement: ["discriminant", "cases"],
TaggedTemplateExpression: ["tag", "quasi"],
TemplateElement: [],
TemplateLiteral: ["quasis", "expressions"],
ThisExpression: [],
ThrowStatement: ["argument"],
TryStatement: ["block", "handler", "finalizer"],
UnaryExpression: ["argument"],
UpdateExpression: ["argument"],
VariableDeclaration: ["declarations"],
VariableDeclarator: ["id", "init"],
WhileStatement: ["test", "body"],
WithStatement: ["object", "body"],
YieldExpression: ["argument"],
};
// Types.
const NODE_TYPES = Object.keys(KEYS);
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
/**
* @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] !== "_";
}
/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
* Get visitor keys of a given node.
* @param {Object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
function getKeys(node) {
return Object.keys(node).filter(filterKey);
}
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
function unionWith(additionalKeys) {
const retv =
/** @type {{ [type: string]: ReadonlyArray<string> }} */
(Object.assign({}, KEYS));
for (const type of Object.keys(additionalKeys)) {
if (Object.hasOwn(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);
}
exports.KEYS = KEYS;
exports.getKeys = getKeys;
exports.unionWith = unionWith;
@@ -0,0 +1 @@
{"version":3,"names":["_arrayLikeToArray","require","_arrayWithoutHoles","arr","Array","isArray","arrayLikeToArray"],"sources":["../../src/helpers/arrayWithoutHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\nexport default function _arrayWithoutHoles<T>(arr: T[]) {\n if (Array.isArray(arr)) return arrayLikeToArray<T>(arr);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,kBAAkBA,CAAIC,GAAQ,EAAE;EACtD,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAO,IAAAG,yBAAgB,EAAIH,GAAG,CAAC;AACzD","ignoreList":[]}
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Snail = createLucideIcon("Snail", [
["path", { d: "M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0", key: "hneq2s" }],
["circle", { cx: "10", cy: "13", r: "8", key: "194lz3" }],
["path", { d: "M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6", key: "ixqyt7" }],
["path", { d: "M18 3 19.1 5.2", key: "9tjm43" }],
["path", { d: "M22 3 20.9 5.2", key: "j3odrs" }]
]);
export { Snail as default };
//# sourceMappingURL=snail.js.map
@@ -0,0 +1 @@
{"version":3,"file":"estimate.mjs","sources":["../../src/scoring/estimate.ts"],"sourcesContent":[null],"names":["getMinGuesses","match","password","minGuesses","token","length","MIN_SUBMATCH_GUESSES_SINGLE_CHAR","MIN_SUBMATCH_GUESSES_MULTI_CHAR","matchers","bruteforce","bruteforceMatcher","date","dateMatcher","dictionary","dictionaryMatcher","regex","regexMatcher","repeat","repeatMatcher","sequence","sequenceMatcher","spatial","spatialMatcher","separator","separatorMatcher","wordSequence","wordSequenceMatcher","getScoring","options","name","scoring","extraData","guesses","estimationResult","pattern","calculation","baseGuesses","uppercaseVariations","l33tVariations","matchGuesses","Math","max","guessesLog10","utils","log10"],"mappings":";;;;;;;;;;;;AAsBA,MAAMA,aAAa,GAAGA,CACpBC,KAAqC,EACrCC,QAAgB,KACd;EACF,IAAIC,UAAU,GAAG,CAAC;EAClB,IAAIF,KAAK,CAACG,KAAK,CAACC,MAAM,GAAGH,QAAQ,CAACG,MAAM,EAAE;AACxC,IAAA,IAAIJ,KAAK,CAACG,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;AAC5BF,MAAAA,UAAU,GAAGG,gCAAgC;AAC/C,IAAA,CAAC,MAAM;AACLH,MAAAA,UAAU,GAAGI,+BAA+B;AAC9C,IAAA;AACF,EAAA;AACA,EAAA,OAAOJ,UAAU;AACnB,CAAC;AAID,MAAMK,QAAQ,GAAa;AACzBC,EAAAA,UAAU,EAAEC,iBAAiB;AAC7BC,EAAAA,IAAI,EAAEC,WAAW;AACjBC,EAAAA,UAAU,EAAEC,iBAAiB;AAC7BC,EAAAA,KAAK,EAAEC,YAAY;AACnBC,EAAAA,MAAM,EAAEC,aAAa;AACrBC,EAAAA,QAAQ,EAAEC,eAAe;AACzBC,EAAAA,OAAO,EAAEC,cAAc;AACvBC,EAAAA,SAAS,EAAEC,gBAAgB;AAC3BC,EAAAA,YAAY,EAAEC;CACf;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CAACI,mBAAmB;AACpEN,IAAAA,SAAS,CAACO,cAAc,GAAGL,gBAAgB,CAACK,cAAc;AAC5D,EAAA;EAEA,MAAMC,YAAY,GAAGC,IAAI,CAACC,GAAG,CAACT,OAAO,EAAE7B,UAAU,CAAC;EAClD,OAAO;AACL,IAAA,GAAGF,KAAK;AACR,IAAA,GAAG8B,SAAS;AACZC,IAAAA,OAAO,EAAEO,YAAY;AACrBG,IAAAA,YAAY,EAAEC,KAAK,CAACC,KAAK,CAACL,YAAY;GACvC;AACH,CAAC;;;;"}
@@ -0,0 +1,7 @@
"use client";
import { createContext } from 'react';
const LayoutGroupContext = createContext({});
export { LayoutGroupContext };
//# sourceMappingURL=LayoutGroupContext.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"sseKeepAlive.js","sourceRoot":"","sources":["../../../src/server/sseKeepAlive.ts"],"names":[],"mappings":";;;AAMA,0CAQC;AAdD,8DAA8D;AACjD,QAAA,yBAAyB,GAAG,KAAM,CAAC;AAEhD,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAEvC,wEAAwE;AACxE,SAAgB,eAAe,CAAC,UAAkB,EAAE,MAAkB;IAClE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC3E,KAAgC,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5C,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_IB","132":"_vC","260":"_A"},B:{"1":"_J"},C:{"1":"_fD","2":"GD"},D:{"1":"_Q"},E:{"1":"_DB","2":"_e"},F:{"1":"_oB","2":"F"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"4":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"Cross-document messaging",D:true};
@@ -0,0 +1,477 @@
// @ts-self-types="./retrier.d.ts"
/**
* @fileoverview A utility for retrying failed async method calls.
*/
/* global setTimeout, clearTimeout */
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
const MAX_TASK_TIMEOUT = 60000;
const MAX_TASK_DELAY = 100;
const MAX_CONCURRENCY = 1000;
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
* Logs a message to the console if the DEBUG environment variable is set.
* @param {string} message The message to log.
* @returns {void}
*/
function debug(message) {
if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
console.debug(message);
}
}
/*
* The following logic has been extracted from graceful-fs.
*
* The ISC License
*
* Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* Checks if it is time to retry a task based on the timestamp and last attempt time.
* @param {RetryTask} task The task to check.
* @param {number} maxDelay The maximum delay for the queue.
* @returns {boolean} true if it is time to retry, false otherwise.
*/
function isTimeToRetry(task, maxDelay) {
const timeSinceLastAttempt = Date.now() - task.lastAttempt;
const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1);
const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay);
return timeSinceLastAttempt >= desiredDelay;
}
/**
* Checks if it is time to bail out based on the given timestamp.
* @param {RetryTask} task The task to check.
* @param {number} timeout The timeout for the queue.
* @returns {boolean} true if it is time to bail, false otherwise.
*/
function isTimeToBail(task, timeout) {
return task.age > timeout;
}
/**
* Creates a new promise with resolve and reject functions.
* @returns {{promise:Promise<any>, resolve:(value:any) => any, reject: (value:any) => any}} A new promise.
*/
function createPromise() {
if (Promise.withResolvers) {
return Promise.withResolvers();
}
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
if (resolve === undefined || reject === undefined) {
throw new Error("Promise executor did not initialize resolve or reject.");
}
return { promise, resolve, reject };
}
/**
* A class to represent a task in the retry queue.
*/
class RetryTask {
/**
* The unique ID for the task.
* @type {string}
*/
id = Math.random().toString(36).slice(2);
/**
* The function to call.
* @type {Function}
*/
fn;
/**
* The error that was thrown.
* @type {Error}
*/
error;
/**
* The timestamp of the task.
* @type {number}
*/
timestamp = Date.now();
/**
* The timestamp of the last attempt.
* @type {number}
*/
lastAttempt = this.timestamp;
/**
* The resolve function for the promise.
* @type {Function}
*/
resolve;
/**
* The reject function for the promise.
* @type {Function}
*/
reject;
/**
* The AbortSignal to monitor for cancellation.
* @type {AbortSignal|undefined}
*/
signal;
/**
* Creates a new instance.
* @param {Function} fn The function to call.
* @param {Error} error The error that was thrown.
* @param {Function} resolve The resolve function for the promise.
* @param {Function} reject The reject function for the promise.
* @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation.
*/
constructor(fn, error, resolve, reject, signal) {
this.fn = fn;
this.error = error;
this.timestamp = Date.now();
this.lastAttempt = Date.now();
this.resolve = resolve;
this.reject = reject;
this.signal = signal;
}
/**
* Gets the age of the task.
* @returns {number} The age of the task in milliseconds.
* @readonly
*/
get age() {
return Date.now() - this.timestamp;
}
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* A class that manages a queue of retry jobs.
*/
class Retrier {
/**
* Represents the queue for processing tasks.
* @type {Array<RetryTask>}
*/
#retrying = [];
/**
* Represents the queue for pending tasks.
* @type {Array<Function>}
*/
#pending = [];
/**
* The number of tasks currently being processed.
* @type {number}
*/
#working = 0;
/**
* The timeout for the queue.
* @type {number}
*/
#timeout;
/**
* The maximum delay for the queue.
* @type {number}
*/
#maxDelay;
/**
* The setTimeout() timer ID.
* @type {NodeJS.Timeout|undefined}
*/
#timerId;
/**
* The function to call.
* @type {Function}
*/
#check;
/**
* The maximum number of concurrent tasks.
* @type {number}
*/
#concurrency;
/**
* Creates a new instance.
* @param {Function} check The function to call.
* @param {object} [options] The options for the instance.
* @param {number} [options.timeout] The timeout for the queue.
* @param {number} [options.maxDelay] The maximum delay for the queue.
* @param {number} [options.concurrency] The maximum number of concurrent tasks.
*/
constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) {
if (typeof check !== "function") {
throw new Error("Missing function to check errors");
}
this.#check = check;
this.#timeout = timeout;
this.#maxDelay = maxDelay;
this.#concurrency = concurrency;
}
/**
* Gets the number of tasks waiting to be retried.
* @returns {number} The number of tasks in the retry queue.
*/
get retrying() {
return this.#retrying.length;
}
/**
* Gets the number of tasks waiting to be processed in the pending queue.
* @returns {number} The number of tasks in the pending queue.
*/
get pending() {
return this.#pending.length;
}
/**
* Gets the number of tasks currently being processed.
* @returns {number} The number of tasks currently being processed.
*/
get working() {
return this.#working;
}
/**
* Calls the function and retries if it fails.
* @param {Function} fn The function to call.
* @param {Object} options The options for the job.
* @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
* @param {Promise<any>} options.promise The promise to return when the function settles.
* @param {Function} options.resolve The resolve function for the promise.
* @param {Function} options.reject The reject function for the promise.
* @returns {Promise<any>} A promise that resolves when the function is
* called successfully.
*/
#call(fn, { signal, promise, resolve, reject }) {
let result;
try {
result = fn();
} catch (/** @type {any} */ error) {
reject(new Error(`Synchronous error: ${error.message}`, { cause: error }));
return promise;
}
// if the result is not a promise then reject an error
if (!result || typeof result.then !== "function") {
reject(new Error("Result is not a promise."));
return promise;
}
this.#working++;
promise.finally(() => {
this.#working--;
this.#processPending();
})
// `promise.finally` creates a new promise that may be rejected, so it must be handled.
.catch(() => { });
// call the original function and catch any ENFILE or EMFILE errors
Promise.resolve(result)
.then(value => {
debug("Function called successfully without retry.");
resolve(value);
})
.catch(error => {
if (!this.#check(error)) {
reject(error);
return;
}
const task = new RetryTask(fn, error, resolve, reject, signal);
debug(`Function failed, queuing for retry with task ${task.id}.`);
this.#retrying.push(task);
signal?.addEventListener("abort", () => {
debug(`Task ${task.id} was aborted due to AbortSignal.`);
reject(signal.reason);
});
this.#processQueue();
});
return promise;
}
/**
* Adds a new retry job to the queue.
* @template {(...args: unknown[]) => Promise<unknown>} Func
* @template {Awaited<ReturnType<Func>>} RetVal
* @param {Func} fn The function to call.
* @param {object} [options] The options for the job.
* @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
* @returns {Promise<RetVal>} A promise that resolves when the queue is processed.
*/
retry(fn, { signal } = {}) {
signal?.throwIfAborted();
const { promise, resolve, reject } = createPromise();
this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject }));
this.#processPending();
return promise;
}
/**
* Processes the pending queue and the retry queue.
* @returns {void}
*/
#processAll() {
if (this.pending) {
this.#processPending();
}
if (this.retrying) {
this.#processQueue();
}
}
/**
* Processes the pending queue to see which tasks can be started.
* @returns {void}
*/
#processPending() {
debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);
const available = this.#concurrency - this.working;
if (available <= 0) {
return;
}
const count = Math.min(this.pending, available);
for (let i = 0; i < count; i++) {
const task = this.#pending.shift();
task?.();
}
debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`);
}
/**
* Processes the queue.
* @returns {void}
*/
#processQueue() {
// clear any timer because we're going to check right now
clearTimeout(this.#timerId);
this.#timerId = undefined;
debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);
const processAgain = () => {
this.#timerId = setTimeout(() => this.#processAll(), 0);
};
// if there's nothing in the queue, we're done
const task = this.#retrying.shift();
if (!task) {
debug("Queue is empty, exiting.");
if (this.pending) {
processAgain();
}
return;
}
// if it's time to bail, then bail
if (isTimeToBail(task, this.#timeout)) {
debug(`Task ${task.id} was abandoned due to timeout.`);
task.reject(task.error);
processAgain();
return;
}
// if it's not time to retry, then wait and try again
if (!isTimeToRetry(task, this.#maxDelay)) {
debug(`Task ${task.id} is not ready to retry, skipping.`);
this.#retrying.push(task);
processAgain();
return;
}
// otherwise, try again
task.lastAttempt = Date.now();
// Promise.resolve needed in case it's a thenable but not a Promise
Promise.resolve(task.fn())
// @ts-ignore because we know it's any
.then(result => {
debug(`Task ${task.id} succeeded after ${task.age}ms.`);
task.resolve(result);
})
// @ts-ignore because we know it's any
.catch(error => {
if (!this.#check(error)) {
debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`);
task.reject(error);
return;
}
// update the task timestamp and push to back of queue to try again
task.lastAttempt = Date.now();
this.#retrying.push(task);
debug(`Task ${task.id} failed, requeueing to try again.`);
})
.finally(() => {
this.#processAll();
});
}
}
export { Retrier };
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// https://github.com/ajv-validator/ajv/issues/889
const equal = require("fast-deep-equal");
equal.code = 'require("ajv/dist/runtime/equal").default';
exports.default = equal;
//# sourceMappingURL=equal.js.map
@@ -0,0 +1 @@
{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AA+BA,8BA0BC;AAzDY,QAAA,WAAW,GAAW,wBAAwB,CAAC;AAE5D,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;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AO,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACU,QAAA,UAAU,GAA6C,UAAU,CAC1E,UAAU,EACV,UAAU,CACb,CAAC;AAEF;;;;;GAKG;AACU,QAAA,eAAe;AACxB,eAAe,CAAC,UAAU,CACtB,aAAa,EACb,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC;AAEN;;;;;GAKG;AACU,QAAA,UAAU,GAA6C,UAAU,CAC1E,cAAc,EACd,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC"}
@@ -0,0 +1,528 @@
"use strict";
var _utils = require("./utils.js");
var _core = require("./core.js");
var _is = require("../validators/is.js");
const defineType = (0, _utils.defineAliasedType)("TypeScript");
const bool = (0, _utils.assertValueType)("boolean");
const tSFunctionTypeAnnotationCommon = () => ({
returnType: {
validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
optional: true
},
typeParameters: {
validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
optional: true
}
});
defineType("TSParameterProperty", {
aliases: ["LVal"],
visitor: ["parameter"],
fields: {
accessibility: {
validate: (0, _utils.assertOneOf)("public", "private", "protected"),
optional: true
},
readonly: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
parameter: {
validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
},
override: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
decorators: {
validate: (0, _utils.arrayOfType)("Decorator"),
optional: true
}
}
});
defineType("TSDeclareFunction", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "typeParameters", "params", "returnType"],
fields: Object.assign({}, (0, _core.functionDeclarationCommon)(), tSFunctionTypeAnnotationCommon())
});
defineType("TSDeclareMethod", Object.assign({
visitor: ["decorators", "key", "typeParameters", "params", "returnType"]
}, (0, _core.classMethodOrPropertyUnionShapeCommon)(), {
fields: Object.assign({}, (0, _core.classMethodOrDeclareMethodCommon)(), tSFunctionTypeAnnotationCommon())
}));
defineType("TSQualifiedName", {
aliases: ["TSEntityName"],
visitor: ["left", "right"],
fields: {
left: (0, _utils.validateType)("TSEntityName"),
right: (0, _utils.validateType)("Identifier")
}
});
const signatureDeclarationCommon = () => ({
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
["parameters"]: (0, _utils.validateArrayOfType)("ArrayPattern", "Identifier", "ObjectPattern", "RestElement"),
["typeAnnotation"]: (0, _utils.validateOptionalType)("TSTypeAnnotation")
});
const callConstructSignatureDeclaration = {
aliases: ["TSTypeElement"],
visitor: ["typeParameters", "parameters", "typeAnnotation"],
fields: signatureDeclarationCommon()
};
defineType("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
defineType("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
const namedTypeElementCommon = () => ({
key: (0, _utils.validateType)("Expression"),
computed: {
default: false
},
optional: (0, _utils.validateOptional)(bool)
});
defineType("TSPropertySignature", {
aliases: ["TSTypeElement"],
visitor: ["key", "typeAnnotation"],
fields: Object.assign({}, namedTypeElementCommon(), {
readonly: (0, _utils.validateOptional)(bool),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
kind: {
optional: true,
validate: (0, _utils.assertOneOf)("get", "set")
}
})
});
defineType("TSMethodSignature", {
aliases: ["TSTypeElement"],
visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
fields: Object.assign({}, signatureDeclarationCommon(), namedTypeElementCommon(), {
kind: {
validate: (0, _utils.assertOneOf)("method", "get", "set")
}
})
});
defineType("TSIndexSignature", {
aliases: ["TSTypeElement"],
visitor: ["parameters", "typeAnnotation"],
fields: {
readonly: (0, _utils.validateOptional)(bool),
static: (0, _utils.validateOptional)(bool),
parameters: (0, _utils.validateArrayOfType)("Identifier"),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
}
});
const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
for (const type of tsKeywordTypes) {
defineType(type, {
aliases: ["TSType", "TSBaseType"],
visitor: [],
fields: {}
});
}
defineType("TSThisType", {
aliases: ["TSType", "TSBaseType"],
visitor: [],
fields: {}
});
const fnOrCtrBase = {
aliases: ["TSType"],
visitor: ["typeParameters", "parameters", "typeAnnotation"]
};
defineType("TSFunctionType", Object.assign({}, fnOrCtrBase, {
fields: signatureDeclarationCommon()
}));
defineType("TSConstructorType", Object.assign({}, fnOrCtrBase, {
fields: Object.assign({}, signatureDeclarationCommon(), {
abstract: (0, _utils.validateOptional)(bool)
})
}));
defineType("TSTypeReference", {
aliases: ["TSType"],
visitor: ["typeName", "typeParameters"],
fields: {
typeName: (0, _utils.validateType)("TSEntityName"),
["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
defineType("TSTypePredicate", {
aliases: ["TSType"],
visitor: ["parameterName", "typeAnnotation"],
builder: ["parameterName", "typeAnnotation", "asserts"],
fields: {
parameterName: (0, _utils.validateType)("Identifier", "TSThisType"),
typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
asserts: (0, _utils.validateOptional)(bool)
}
});
defineType("TSTypeQuery", {
aliases: ["TSType"],
visitor: ["exprName", "typeParameters"],
fields: {
exprName: (0, _utils.validateType)("TSEntityName", "TSImportType"),
["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
defineType("TSTypeLiteral", {
aliases: ["TSType"],
visitor: ["members"],
fields: {
members: (0, _utils.validateArrayOfType)("TSTypeElement")
}
});
defineType("TSArrayType", {
aliases: ["TSType"],
visitor: ["elementType"],
fields: {
elementType: (0, _utils.validateType)("TSType")
}
});
defineType("TSTupleType", {
aliases: ["TSType"],
visitor: ["elementTypes"],
fields: {
elementTypes: (0, _utils.validateArrayOfType)("TSType", "TSNamedTupleMember")
}
});
defineType("TSOptionalType", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
defineType("TSRestType", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
defineType("TSNamedTupleMember", {
visitor: ["label", "elementType"],
builder: ["label", "elementType", "optional"],
fields: {
label: (0, _utils.validateType)("Identifier"),
optional: {
validate: bool,
default: false
},
elementType: (0, _utils.validateType)("TSType")
}
});
const unionOrIntersection = {
aliases: ["TSType"],
visitor: ["types"],
fields: {
types: (0, _utils.validateArrayOfType)("TSType")
}
};
defineType("TSUnionType", unionOrIntersection);
defineType("TSIntersectionType", unionOrIntersection);
defineType("TSConditionalType", {
aliases: ["TSType"],
visitor: ["checkType", "extendsType", "trueType", "falseType"],
fields: {
checkType: (0, _utils.validateType)("TSType"),
extendsType: (0, _utils.validateType)("TSType"),
trueType: (0, _utils.validateType)("TSType"),
falseType: (0, _utils.validateType)("TSType")
}
});
defineType("TSInferType", {
aliases: ["TSType"],
visitor: ["typeParameter"],
fields: {
typeParameter: (0, _utils.validateType)("TSTypeParameter")
}
});
defineType("TSParenthesizedType", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
defineType("TSTypeOperator", {
aliases: ["TSType"],
visitor: ["typeAnnotation"],
builder: ["typeAnnotation", "operator"],
fields: {
operator: {
validate: (0, _utils.assertValueType)("string"),
default: "keyof"
},
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
defineType("TSIndexedAccessType", {
aliases: ["TSType"],
visitor: ["objectType", "indexType"],
fields: {
objectType: (0, _utils.validateType)("TSType"),
indexType: (0, _utils.validateType)("TSType")
}
});
defineType("TSMappedType", {
aliases: ["TSType"],
visitor: ["typeParameter", "nameType", "typeAnnotation"],
builder: ["typeParameter", "typeAnnotation", "nameType"],
fields: Object.assign({}, {
typeParameter: (0, _utils.validateType)("TSTypeParameter")
}, {
readonly: (0, _utils.validateOptional)((0, _utils.assertOneOf)(true, false, "+", "-")),
optional: (0, _utils.validateOptional)((0, _utils.assertOneOf)(true, false, "+", "-")),
typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
nameType: (0, _utils.validateOptionalType)("TSType")
})
});
defineType("TSTemplateLiteralType", {
aliases: ["TSType", "TSBaseType"],
visitor: ["quasis", "types"],
fields: {
quasis: (0, _utils.validateArrayOfType)("TemplateElement"),
types: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")), function (node, key, val) {
if (node.quasis.length !== val.length + 1) {
throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of types.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
}
})
}
}
});
defineType("TSLiteralType", {
aliases: ["TSType", "TSBaseType"],
visitor: ["literal"],
fields: {
literal: {
validate: function () {
const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
const unaryOperator = (0, _utils.assertOneOf)("-");
const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral");
const validator = function validator(parent, key, node) {
if ((0, _is.default)("UnaryExpression", node)) {
unaryOperator(node, "operator", node.operator);
unaryExpression(node, "argument", node.argument);
} else {
literal(parent, key, node);
}
};
validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral", "UnaryExpression"];
return validator;
}()
}
}
});
defineType("TSExpressionWithTypeArguments", {
aliases: ["TSType"],
visitor: ["expression", "typeParameters"],
fields: {
expression: (0, _utils.validateType)("TSEntityName"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
defineType("TSInterfaceDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "typeParameters", "extends", "body"],
fields: {
declare: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)("Identifier"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
body: (0, _utils.validateType)("TSInterfaceBody")
}
});
defineType("TSInterfaceBody", {
visitor: ["body"],
fields: {
body: (0, _utils.validateArrayOfType)("TSTypeElement")
}
});
defineType("TSTypeAliasDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "typeParameters", "typeAnnotation"],
fields: {
declare: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)("Identifier"),
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
typeAnnotation: (0, _utils.validateType)("TSType")
}
});
defineType("TSInstantiationExpression", {
aliases: ["Expression"],
visitor: ["expression", "typeParameters"],
fields: {
expression: (0, _utils.validateType)("Expression"),
["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}
});
const TSTypeExpression = {
aliases: ["Expression", "LVal", "PatternLike"],
visitor: ["expression", "typeAnnotation"],
fields: {
expression: (0, _utils.validateType)("Expression"),
typeAnnotation: (0, _utils.validateType)("TSType")
}
};
defineType("TSAsExpression", TSTypeExpression);
defineType("TSSatisfiesExpression", TSTypeExpression);
defineType("TSTypeAssertion", {
aliases: ["Expression", "LVal", "PatternLike"],
visitor: ["typeAnnotation", "expression"],
fields: {
typeAnnotation: (0, _utils.validateType)("TSType"),
expression: (0, _utils.validateType)("Expression")
}
});
defineType("TSEnumBody", {
visitor: ["members"],
fields: {
members: (0, _utils.validateArrayOfType)("TSEnumMember")
}
});
defineType("TSEnumDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "members"],
fields: {
declare: (0, _utils.validateOptional)(bool),
const: (0, _utils.validateOptional)(bool),
id: (0, _utils.validateType)("Identifier"),
members: (0, _utils.validateArrayOfType)("TSEnumMember"),
initializer: (0, _utils.validateOptionalType)("Expression"),
body: (0, _utils.validateOptionalType)("TSEnumBody")
}
});
defineType("TSEnumMember", {
visitor: ["id", "initializer"],
fields: {
id: (0, _utils.validateType)("Identifier", "StringLiteral"),
initializer: (0, _utils.validateOptionalType)("Expression")
}
});
defineType("TSModuleDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "body"],
fields: Object.assign({
kind: {
validate: (0, _utils.assertOneOf)("global", "module", "namespace")
},
declare: (0, _utils.validateOptional)(bool)
}, {
global: (0, _utils.validateOptional)(bool)
}, {
id: (0, _utils.validateType)("Identifier", "StringLiteral"),
body: (0, _utils.validateType)("TSModuleBlock", "TSModuleDeclaration")
})
});
defineType("TSModuleBlock", {
aliases: ["Scopable", "Block", "BlockParent", "FunctionParent"],
visitor: ["body"],
fields: {
body: (0, _utils.validateArrayOfType)("Statement")
}
});
defineType("TSImportType", {
aliases: ["TSType"],
builder: ["argument", "qualifier", "typeParameters"],
visitor: ["argument", "options", "qualifier", "typeParameters"],
fields: Object.assign({}, {
argument: (0, _utils.validateType)("StringLiteral")
}, {
qualifier: (0, _utils.validateOptionalType)("TSEntityName")
}, {
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
}, {
options: {
validate: (0, _utils.assertNodeType)("ObjectExpression"),
optional: true
}
})
});
defineType("TSImportEqualsDeclaration", {
aliases: ["Statement", "Declaration"],
visitor: ["id", "moduleReference"],
fields: Object.assign({}, {
isExport: (0, _utils.validate)(bool)
}, {
id: (0, _utils.validateType)("Identifier"),
moduleReference: (0, _utils.validateType)("TSEntityName", "TSExternalModuleReference"),
importKind: {
validate: (0, _utils.assertOneOf)("type", "value"),
optional: true
}
})
});
defineType("TSExternalModuleReference", {
visitor: ["expression"],
fields: {
expression: (0, _utils.validateType)("StringLiteral")
}
});
defineType("TSNonNullExpression", {
aliases: ["Expression", "LVal", "PatternLike"],
visitor: ["expression"],
fields: {
expression: (0, _utils.validateType)("Expression")
}
});
defineType("TSExportAssignment", {
aliases: ["Statement"],
visitor: ["expression"],
fields: {
expression: (0, _utils.validateType)("Expression")
}
});
defineType("TSNamespaceExportDeclaration", {
aliases: ["Statement"],
visitor: ["id"],
fields: {
id: (0, _utils.validateType)("Identifier")
}
});
defineType("TSTypeAnnotation", {
visitor: ["typeAnnotation"],
fields: {
typeAnnotation: {
validate: (0, _utils.assertNodeType)("TSType")
}
}
});
defineType("TSTypeParameterInstantiation", {
visitor: ["params"],
fields: {
params: (0, _utils.validateArrayOfType)("TSType")
}
});
defineType("TSTypeParameterDeclaration", {
visitor: ["params"],
fields: {
params: (0, _utils.validateArrayOfType)("TSTypeParameter")
}
});
defineType("TSTypeParameter", {
builder: ["constraint", "default", "name"],
visitor: ["constraint", "default"],
fields: {
name: {
validate: (0, _utils.assertValueType)("string")
},
in: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
out: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
const: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
constraint: {
validate: (0, _utils.assertNodeType)("TSType"),
optional: true
},
default: {
validate: (0, _utils.assertNodeType)("TSType"),
optional: true
}
}
});
//# sourceMappingURL=typescript.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './chart-area.js';
//# sourceMappingURL=area-chart.js.map
@@ -0,0 +1,15 @@
import Range = require("../classes/range");
import SemVer = require("../classes/semver");
import semver = require("../index");
/**
* Return true if the version is outside the bounds of the range in either the high or low direction.
* The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.)
*/
declare function outside(
version: string | SemVer,
range: string | Range,
hilo: ">" | "<",
optionsOrLoose?: boolean | semver.RangeOptions,
): boolean;
export = outside;
@@ -0,0 +1 @@
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items.ts"],"names":[],"mappings":";;;AAEA,mDAAuC;AACvC,6CAAqF;AACrF,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;IAC1C,MAAM,EAAE,aAAa;IACrB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,aAAa,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAA;QAC/E,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAC3B,GAAe,EACf,UAAkB,EAClB,SAAsB,GAAG,CAAC,MAAM;IAEhC,MAAM,EAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAClD,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9D,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,E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e,GAAG,CAAA"}
@@ -0,0 +1,617 @@
import { EventEmitter } from 'events';
function toArr(any) {
return any == null ? [] : Array.isArray(any) ? any : [any];
}
function toVal(out, key, val, opts) {
var x, old=out[key], nxt=(
!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))
: typeof val === 'boolean' ? val
: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))
: (x = +val,x * 0 === 0) ? x : val
);
out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);
}
function mri2 (args, opts) {
args = args || [];
opts = opts || {};
var k, arr, arg, name, val, out={ _:[] };
var i=0, j=0, idx=0, len=args.length;
const alibi = opts.alias !== void 0;
const strict = opts.unknown !== void 0;
const defaults = opts.default !== void 0;
opts.alias = opts.alias || {};
opts.string = toArr(opts.string);
opts.boolean = toArr(opts.boolean);
if (alibi) {
for (k in opts.alias) {
arr = opts.alias[k] = toArr(opts.alias[k]);
for (i=0; i < arr.length; i++) {
(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
}
}
}
for (i=opts.boolean.length; i-- > 0;) {
arr = opts.alias[opts.boolean[i]] || [];
for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);
}
for (i=opts.string.length; i-- > 0;) {
arr = opts.alias[opts.string[i]] || [];
for (j=arr.length; j-- > 0;) opts.string.push(arr[j]);
}
if (defaults) {
for (k in opts.default) {
name = typeof opts.default[k];
arr = opts.alias[k] = opts.alias[k] || [];
if (opts[name] !== void 0) {
opts[name].push(k);
for (i=0; i < arr.length; i++) {
opts[name].push(arr[i]);
}
}
}
}
const keys = strict ? Object.keys(opts.alias) : [];
for (i=0; i < len; i++) {
arg = args[i];
if (arg === '--') {
out._ = out._.concat(args.slice(++i));
break;
}
for (j=0; j < arg.length; j++) {
if (arg.charCodeAt(j) !== 45) break; // "-"
}
if (j === 0) {
out._.push(arg);
} else if (arg.substring(j, j + 3) === 'no-') {
name = arg.substring(j + 3);
if (strict && !~keys.indexOf(name)) {
return opts.unknown(arg);
}
out[name] = false;
} else {
for (idx=j+1; idx < arg.length; idx++) {
if (arg.charCodeAt(idx) === 61) break; // "="
}
name = arg.substring(j, idx);
val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);
arr = (j === 2 ? [name] : name);
for (idx=0; idx < arr.length; idx++) {
name = arr[idx];
if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);
toVal(out, name, (idx + 1 < arr.length) || val, opts);
}
}
}
if (defaults) {
for (k in opts.default) {
if (out[k] === void 0) {
out[k] = opts.default[k];
}
}
}
if (alibi) {
for (k in out) {
arr = opts.alias[k] || [];
while (arr.length > 0) {
out[arr.shift()] = out[k];
}
}
}
return out;
}
const removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
const findAllBrackets = (v) => {
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
const res = [];
const parse = (match) => {
let variadic = false;
let value = match[1];
if (value.startsWith("...")) {
value = value.slice(3);
variadic = true;
}
return {
required: match[0].startsWith("<"),
value,
variadic
};
};
let angledMatch;
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) {
res.push(parse(angledMatch));
}
let squareMatch;
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) {
res.push(parse(squareMatch));
}
return res;
};
const getMriOptions = (options) => {
const result = {alias: {}, boolean: []};
for (const [index, option] of options.entries()) {
if (option.names.length > 1) {
result.alias[option.names[0]] = option.names.slice(1);
}
if (option.isBoolean) {
if (option.negated) {
const hasStringTypeOption = options.some((o, i) => {
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
});
if (!hasStringTypeOption) {
result.boolean.push(option.names[0]);
}
} else {
result.boolean.push(option.names[0]);
}
}
}
return result;
};
const findLongest = (arr) => {
return arr.sort((a, b) => {
return a.length > b.length ? -1 : 1;
})[0];
};
const padRight = (str, length) => {
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
};
const camelcase = (input) => {
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
return p1 + p2.toUpperCase();
});
};
const setDotProp = (obj, keys, val) => {
let i = 0;
let length = keys.length;
let t = obj;
let x;
for (; i < length; ++i) {
x = t[keys[i]];
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
}
};
const setByType = (obj, transforms) => {
for (const key of Object.keys(transforms)) {
const transform = transforms[key];
if (transform.shouldTransform) {
obj[key] = Array.prototype.concat.call([], obj[key]);
if (typeof transform.transformFunction === "function") {
obj[key] = obj[key].map(transform.transformFunction);
}
}
}
};
const getFileName = (input) => {
const m = /([^\\\/]+)$/.exec(input);
return m ? m[1] : "";
};
const camelcaseOptionName = (name) => {
return name.split(".").map((v, i) => {
return i === 0 ? camelcase(v) : v;
}).join(".");
};
class CACError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error(message).stack;
}
}
}
class Option {
constructor(rawName, description, config) {
this.rawName = rawName;
this.description = description;
this.config = Object.assign({}, config);
rawName = rawName.replace(/\.\*/g, "");
this.negated = false;
this.names = removeBrackets(rawName).split(",").map((v) => {
let name = v.trim().replace(/^-{1,2}/, "");
if (name.startsWith("no-")) {
this.negated = true;
name = name.replace(/^no-/, "");
}
return camelcaseOptionName(name);
}).sort((a, b) => a.length > b.length ? 1 : -1);
this.name = this.names[this.names.length - 1];
if (this.negated && this.config.default == null) {
this.config.default = true;
}
if (rawName.includes("<")) {
this.required = true;
} else if (rawName.includes("[")) {
this.required = false;
} else {
this.isBoolean = true;
}
}
}
const processArgs = process.argv;
const platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
class Command {
constructor(rawName, description, config = {}, cli) {
this.rawName = rawName;
this.description = description;
this.config = config;
this.cli = cli;
this.options = [];
this.aliasNames = [];
this.name = removeBrackets(rawName);
this.args = findAllBrackets(rawName);
this.examples = [];
}
usage(text) {
this.usageText = text;
return this;
}
allowUnknownOptions() {
this.config.allowUnknownOptions = true;
return this;
}
ignoreOptionDefaultValue() {
this.config.ignoreOptionDefaultValue = true;
return this;
}
version(version, customFlags = "-v, --version") {
this.versionNumber = version;
this.option(customFlags, "Display version number");
return this;
}
example(example) {
this.examples.push(example);
return this;
}
option(rawName, description, config) {
const option = new Option(rawName, description, config);
this.options.push(option);
return this;
}
alias(name) {
this.aliasNames.push(name);
return this;
}
action(callback) {
this.commandAction = callback;
return this;
}
isMatched(name) {
return this.name === name || this.aliasNames.includes(name);
}
get isDefaultCommand() {
return this.name === "" || this.aliasNames.includes("!");
}
get isGlobalCommand() {
return this instanceof GlobalCommand;
}
hasOption(name) {
name = name.split(".")[0];
return this.options.find((option) => {
return option.names.includes(name);
});
}
outputHelp() {
const {name, commands} = this.cli;
const {
versionNumber,
options: globalOptions,
helpCallback
} = this.cli.globalCommand;
let sections = [
{
body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
}
];
sections.push({
title: "Usage",
body: ` $ ${name} ${this.usageText || this.rawName}`
});
const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0;
if (showCommands) {
const longestCommandName = findLongest(commands.map((command) => command.rawName));
sections.push({
title: "Commands",
body: commands.map((command) => {
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
}).join("\n")
});
sections.push({
title: `For more info, run any command with the \`--help\` flag`,
body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
});
}
let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
if (!this.isGlobalCommand && !this.isDefaultCommand) {
options = options.filter((option) => option.name !== "version");
}
if (options.length > 0) {
const longestOptionName = findLongest(options.map((option) => option.rawName));
sections.push({
title: "Options",
body: options.map((option) => {
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
}).join("\n")
});
}
if (this.examples.length > 0) {
sections.push({
title: "Examples",
body: this.examples.map((example) => {
if (typeof example === "function") {
return example(name);
}
return example;
}).join("\n")
});
}
if (helpCallback) {
sections = helpCallback(sections) || sections;
}
console.log(sections.map((section) => {
return section.title ? `${section.title}:
${section.body}` : section.body;
}).join("\n\n"));
}
outputVersion() {
const {name} = this.cli;
const {versionNumber} = this.cli.globalCommand;
if (versionNumber) {
console.log(`${name}/${versionNumber} ${platformInfo}`);
}
}
checkRequiredArgs() {
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
if (this.cli.args.length < minimalArgsCount) {
throw new CACError(`missing required args for command \`${this.rawName}\``);
}
}
checkUnknownOptions() {
const {options, globalCommand} = this.cli;
if (!this.config.allowUnknownOptions) {
for (const name of Object.keys(options)) {
if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) {
throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
}
}
}
}
checkOptionValue() {
const {options: parsedOptions, globalCommand} = this.cli;
const options = [...globalCommand.options, ...this.options];
for (const option of options) {
const value = parsedOptions[option.name.split(".")[0]];
if (option.required) {
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
if (value === true || value === false && !hasNegated) {
throw new CACError(`option \`${option.rawName}\` value is missing`);
}
}
}
}
}
class GlobalCommand extends Command {
constructor(cli) {
super("@@global@@", "", {}, cli);
}
}
var __assign = Object.assign;
class CAC extends EventEmitter {
constructor(name = "") {
super();
this.name = name;
this.commands = [];
this.rawArgs = [];
this.args = [];
this.options = {};
this.globalCommand = new GlobalCommand(this);
this.globalCommand.usage("<command> [options]");
}
usage(text) {
this.globalCommand.usage(text);
return this;
}
command(rawName, description, config) {
const command = new Command(rawName, description || "", config, this);
command.globalCommand = this.globalCommand;
this.commands.push(command);
return command;
}
option(rawName, description, config) {
this.globalCommand.option(rawName, description, config);
return this;
}
help(callback) {
this.globalCommand.option("-h, --help", "Display this message");
this.globalCommand.helpCallback = callback;
this.showHelpOnExit = true;
return this;
}
version(version, customFlags = "-v, --version") {
this.globalCommand.version(version, customFlags);
this.showVersionOnExit = true;
return this;
}
example(example) {
this.globalCommand.example(example);
return this;
}
outputHelp() {
if (this.matchedCommand) {
this.matchedCommand.outputHelp();
} else {
this.globalCommand.outputHelp();
}
}
outputVersion() {
this.globalCommand.outputVersion();
}
setParsedInfo({args, options}, matchedCommand, matchedCommandName) {
this.args = args;
this.options = options;
if (matchedCommand) {
this.matchedCommand = matchedCommand;
}
if (matchedCommandName) {
this.matchedCommandName = matchedCommandName;
}
return this;
}
unsetMatchedCommand() {
this.matchedCommand = void 0;
this.matchedCommandName = void 0;
}
parse(argv = processArgs, {
run = true
} = {}) {
this.rawArgs = argv;
if (!this.name) {
this.name = argv[1] ? getFileName(argv[1]) : "cli";
}
let shouldParse = true;
for (const command of this.commands) {
const parsed = this.mri(argv.slice(2), command);
const commandName = parsed.args[0];
if (command.isMatched(commandName)) {
shouldParse = false;
const parsedInfo = __assign(__assign({}, parsed), {
args: parsed.args.slice(1)
});
this.setParsedInfo(parsedInfo, command, commandName);
this.emit(`command:${commandName}`, command);
}
}
if (shouldParse) {
for (const command of this.commands) {
if (command.name === "") {
shouldParse = false;
const parsed = this.mri(argv.slice(2), command);
this.setParsedInfo(parsed, command);
this.emit(`command:!`, command);
}
}
}
if (shouldParse) {
const parsed = this.mri(argv.slice(2));
this.setParsedInfo(parsed);
}
if (this.options.help && this.showHelpOnExit) {
this.outputHelp();
run = false;
this.unsetMatchedCommand();
}
if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) {
this.outputVersion();
run = false;
this.unsetMatchedCommand();
}
const parsedArgv = {args: this.args, options: this.options};
if (run) {
this.runMatchedCommand();
}
if (!this.matchedCommand && this.args[0]) {
this.emit("command:*");
}
return parsedArgv;
}
mri(argv, command) {
const cliOptions = [
...this.globalCommand.options,
...command ? command.options : []
];
const mriOptions = getMriOptions(cliOptions);
let argsAfterDoubleDashes = [];
const doubleDashesIndex = argv.indexOf("--");
if (doubleDashesIndex > -1) {
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
argv = argv.slice(0, doubleDashesIndex);
}
let parsed = mri2(argv, mriOptions);
parsed = Object.keys(parsed).reduce((res, name) => {
return __assign(__assign({}, res), {
[camelcaseOptionName(name)]: parsed[name]
});
}, {_: []});
const args = parsed._;
const options = {
"--": argsAfterDoubleDashes
};
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
let transforms = Object.create(null);
for (const cliOption of cliOptions) {
if (!ignoreDefault && cliOption.config.default !== void 0) {
for (const name of cliOption.names) {
options[name] = cliOption.config.default;
}
}
if (Array.isArray(cliOption.config.type)) {
if (transforms[cliOption.name] === void 0) {
transforms[cliOption.name] = Object.create(null);
transforms[cliOption.name]["shouldTransform"] = true;
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
}
}
}
for (const key of Object.keys(parsed)) {
if (key !== "_") {
const keys = key.split(".");
setDotProp(options, keys, parsed[key]);
setByType(options, transforms);
}
}
return {
args,
options
};
}
runMatchedCommand() {
const {args, options, matchedCommand: command} = this;
if (!command || !command.commandAction)
return;
command.checkUnknownOptions();
command.checkOptionValue();
command.checkRequiredArgs();
const actionArgs = [];
command.args.forEach((arg, index) => {
if (arg.variadic) {
actionArgs.push(args.slice(index));
} else {
actionArgs.push(args[index]);
}
});
actionArgs.push(options);
return command.commandAction.apply(this, actionArgs);
}
}
const cac = (name = "") => new CAC(name);
export default cac;
export { CAC, Command, cac };
@@ -0,0 +1,6 @@
import type TokenProcessor from "../TokenProcessor";
/**
* Starting at `export {`, look ahead and return `true` if this is an
* `export {...} from` statement and `false` if this is a plain multi-export.
*/
export default function isExportFrom(tokens: TokenProcessor): boolean;
@@ -0,0 +1 @@
module.exports={C:{"52":0.01217,"78":0.00304,"115":0.21598,"120":0.34983,"121":0.7027,"123":0.00608,"124":0.00608,"127":0.00608,"136":0.00304,"138":0.00304,"140":0.03042,"143":0.00304,"146":0.00608,"147":0.00304,"149":0.00304,"150":0.00913,"151":0.00608,"152":0.0365,"153":0.02434,"154":0.12168,"155":0.32549,"156":0.3042,"157":0.01217,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 125 126 128 129 130 131 132 133 134 135 137 139 141 142 144 145 148 158 159 160 3.5 3.6"},D:{"49":0.00304,"56":0.00304,"62":0.00304,"64":0.00304,"65":0.00304,"66":0.00304,"68":0.00304,"69":0.00608,"70":0.00608,"71":0.00608,"72":0.00304,"73":0.00608,"74":0.00608,"75":0.00304,"79":0.00913,"80":0.00608,"81":0.00608,"83":0.00608,"86":0.00608,"87":0.00913,"88":0.00304,"91":0.00304,"92":0.00304,"93":0.00304,"95":0.00608,"98":0.11864,"101":0.01825,"103":0.12168,"104":0.10951,"105":0.1156,"106":0.11255,"107":0.10951,"108":0.11255,"109":0.85784,"110":0.10951,"111":0.12168,"112":0.10951,"113":0.00608,"114":0.03042,"116":0.23728,"117":0.10951,"118":0.56581,"119":0.70574,"120":0.83047,"121":0.00608,"122":0.02129,"123":0.01217,"124":0.11864,"125":0.00913,"126":0.01217,"127":0.00608,"128":0.01825,"129":0.00608,"130":0.01217,"131":0.24032,"132":0.00913,"133":0.29507,"134":0.08518,"135":0.07909,"136":0.08518,"137":0.08822,"138":0.15818,"139":0.08822,"140":0.09734,"141":0.09734,"142":0.3042,"143":0.03042,"144":0.05171,"145":0.04259,"146":0.28595,"147":0.04563,"148":0.11864,"149":0.21902,"150":0.27074,"151":1.36586,"152":4.88241,"153":3.89072,"154":0.84872,"155":0.01217,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 57 58 59 60 61 63 67 76 77 78 84 85 89 90 94 96 97 99 100 102 115 156 157"},F:{"56":0.00304,"79":0.00304,"95":0.02434,"98":0.00304,"100":0.02434,"101":0.0365,"102":0.00304,"106":0.00608,"131":0.00304,"133":0.01825,"134":0.06388,"135":0.35896,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 99 103 104 105 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00913,"90":0.00304,"92":0.01825,"100":0.00304,"109":0.01521,"114":0.01217,"119":0.34679,"120":0.34983,"122":0.01217,"138":0.00913,"139":0.00304,"140":0.00608,"141":0.00304,"142":0.00608,"143":0.00608,"144":0.00608,"145":0.00913,"146":0.00913,"147":0.01217,"148":0.01825,"149":0.03042,"150":0.05171,"151":0.13689,"152":1.0282,"153":1.09512,"154":0.28291,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137"},E:{"27":0.0365,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.3 18.0 18.4 27.1 27.2 TP","13.1":0.00304,"14.1":0.00304,"15.6":0.02738,"16.6":0.02738,"17.1":0.01825,"17.4":0.00913,"17.5":0.00608,"17.6":0.02738,"18.1":0.00304,"18.2":0.00304,"18.3":0.00608,"18.5-18.7":0.00608,"26.0":0.00608,"26.1":0.00304,"26.2":0.01217,"26.3":0.01217,"26.4":0.01521,"26.5":0.0578,"26.6":0.22815},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00085,"6.0-6.1":0,"7.0-7.1":0.00764,"8.1-8.4":0,"9.0-9.2":0.00085,"9.3":0,"10.0-10.2":0,"10.3":0.00764,"11.0-11.2":0,"11.3-11.4":0,"12.0-12.1":0,"12.2-12.5":0.02886,"13.0-13.1":0,"13.2":0,"13.3":0,"13.4-13.7":0,"14.0-14.4":0.0017,"14.5-14.8":0,"15.0-15.1":0.02886,"15.2-15.3":0.00594,"15.4":0.00509,"15.5":0.00679,"15.6-15.8":0.27334,"16.0":0.01698,"16.1":0.02207,"16.2":0.01104,"16.3":0.01952,"16.4":0.00594,"16.5":0.00934,"16.6-16.7":0.3039,"17.0":0.00934,"17.1":0.01188,"17.2":0.00849,"17.3":0.01358,"17.4":0.01868,"17.5":0.04839,"17.6-17.7":0.08574,"18.0":0.02801,"18.1":0.05772,"18.2":0.04499,"18.3":0.08913,"18.4":0.04075,"18.5-18.7":1.22323,"26.0":0.10441,"26.1":0.09253,"26.2":0.20373,"26.3":0.20543,"26.4":0.16383,"26.5":0.9813,"26.6":3.82079,"27.0":0.39303,"27.1":0,"27.2":0.00849},P:{"23":0.00949,"24":0.02847,"25":0.01898,"26":0.03797,"27":0.02847,"28":0.14237,"29":0.18034,"30":2.98037,_:"4 20 21 22 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.06644},I:{"0":0.02781,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":4.30004,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00913,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0"Line truncated
@@ -0,0 +1,39 @@
import path from 'path';
import { isWindows } from "./is-windows.js";
/**
* Converts an environment variable usage to be appropriate for the current OS
* @param command Command to convert
* @param env Map of the current environment variable names and their values
* @param normalize If the command should be normalized using `path` after converting
* @returns Converted command
*/
export function commandConvert(command, env, normalize = false) {
if (!isWindows()) {
return command;
}
// Handle simple variables: $var or ${var}
const simpleEnvRegex = /\$(\w+)|\${(\w+)}/g;
// Handle bash parameter expansion with default values: ${var:-default}
const defaultValueRegex = /\$\{(\w+):-([^}]+)\}/g;
let convertedCmd = command;
// First, handle bash parameter expansion with default values
convertedCmd = convertedCmd.replace(defaultValueRegex, (match, varName, defaultValue) => {
// If the variable exists, use its value; otherwise use the default
const value = env[varName] || defaultValue;
return value;
});
// Then handle simple variable references
convertedCmd = convertedCmd.replace(simpleEnvRegex, (match, $1, $2) => {
const varName = $1 || $2;
// In Windows, non-existent variables are not replaced by the shell,
// so for example "echo %FOO%" will literally print the string "%FOO%", as
// opposed to printing an empty string in UNIX. See kentcdodds/cross-env#145
// If the env variable isn't defined at runtime, just strip it from the command entirely
return env[varName] ? `%${varName}%` : '';
});
// Normalization is required for commands with relative paths
// For example, `./cmd.bat`. See kentcdodds/cross-env#127
// However, it should not be done for command arguments.
// See https://github.com/kentcdodds/cross-env/pull/130#issuecomment-319887970
return normalize === true ? path.normalize(convertedCmd) : convertedCmd;
}
@@ -0,0 +1 @@
{"version":3,"file":"ip-address.js","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,sDAAwC;AAE3B,QAAA,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC","sourcesContent":["export { Address4 } from './ipv4';\nexport { Address6 } from './ipv6';\nexport { AddressError } from './address-error';\n\nimport * as helpers from './v6/helpers';\n\nexport const v6 = { helpers };\n"]}
@@ -0,0 +1,92 @@
// Generated by LiveScript 1.6.0
var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
split = curry$(function(sep, str){
return str.split(sep);
});
join = curry$(function(sep, xs){
return xs.join(sep);
});
lines = function(str){
if (!str.length) {
return [];
}
return str.split('\n');
};
unlines = function(it){
return it.join('\n');
};
words = function(str){
if (!str.length) {
return [];
}
return str.split(/[ ]+/);
};
unwords = function(it){
return it.join(' ');
};
chars = function(it){
return it.split('');
};
unchars = function(it){
return it.join('');
};
reverse = function(str){
return str.split('').reverse().join('');
};
repeat = curry$(function(n, str){
var result, i$;
result = '';
for (i$ = 0; i$ < n; ++i$) {
result += str;
}
return result;
});
capitalize = function(str){
return str.charAt(0).toUpperCase() + str.slice(1);
};
camelize = function(it){
return it.replace(/[-_]+(.)?/g, function(arg$, c){
return (c != null ? c : '').toUpperCase();
});
};
dasherize = function(str){
return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){
return lower + "-" + (upper.length > 1
? upper
: upper.toLowerCase());
}).replace(/^([A-Z]+)/, function(arg$, upper){
if (upper.length > 1) {
return upper + "-";
} else {
return upper.toLowerCase();
}
});
};
module.exports = {
split: split,
join: join,
lines: lines,
unlines: unlines,
words: words,
unwords: unwords,
chars: chars,
unchars: unchars,
reverse: reverse,
repeat: repeat,
capitalize: capitalize,
camelize: camelize,
dasherize: dasherize
};
function curry$(f, bound){
var context,
_curry = function(args) {
return f.length > 1 ? function(){
var params = args ? args.concat() : [];
context = bound ? context || this : this;
return params.push.apply(params, arguments) <
f.length && arguments.length ?
_curry.call(context, params) : f.apply(context, params);
} : f;
};
return _curry();
}
@@ -0,0 +1 @@
{"version":3,"names":["isReferenced","node","parent","grandparent","type","property","computed","object","init","body","key","superClass","right","source","local","id"],"sources":["../../src/validators/isReferenced.ts"],"sourcesContent":["import type * as t from \"../index.ts\";\n\n/**\n * Check if the input `node` is a reference to a bound variable.\n */\nexport default function isReferenced(\n node: t.Node | null | undefined,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n\n case \"JSXMemberExpression\":\n return parent.object === node;\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n // no: class { foo(NODE) {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return false;\n\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n // parent.value === node\n return grandparent?.type !== \"ObjectPattern\";\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n case \"ClassAccessorProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n case \"ClassPrivateProperty\":\n return parent.key !== node;\n\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n // @ts-expect-error todo(flow->ts): Property 'source' does not exist on type 'AnyTypeAnnotation'.\n if (grandparent?.source) {\n return false;\n }\n return parent.local === node;\n\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n // no: import \"foo\" assert { NODE: \"json\" }\n case \"ImportAttribute\":\n return false;\n\n // no: <div NODE=\"foo\" />\n case \"JSXAttribute\":\n return false;\n\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n\n // yes: type X = { someProperty: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n return true;\n }\n\n rLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/client/middleware.ts"],"names":[],"mappings":";;;AAAA,uCAAuG;AASvG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,MAAM,SAAS,GAClB,CAAC,QAA6B,EAAE,OAAsB,EAAc,EAAE,CACtE,IAAI,CAAC,EAAE;IACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,WAAW,GAAG,KAAK,IAAuB,EAAE;YAC9C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAE3C,mDAAmD;YACnD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC;YACvC,IAAI,MAAM,EAAE,CAAC;gBACT,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAClE,CAAC;YAED,OAAO,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACnD,CAAC,CAAC;QAEF,IAAI,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;QAEnC,uDAAuD;QACvD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACD,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,IAAA,sCAA4B,EAAC,QAAQ,CAAC,CAAC;gBAE9E,mDAAmD;gBACnD,MAAM,SAAS,GAAG,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAEhG,MAAM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AC;YAE/C,4CAA4C;YAC5C,KAAK,CAAC;gBACF,MAAM;gBACN,GAAG;gBACH,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,eAAe;gBAC3B,QAAQ;gBACR,cAAc;gBACd,KAAK,EAAE,KAAc;aACxB,CAAC,CAAC;YAEH,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC,CAAC;AACN,CAAC,CAAC;AA7EW,QAAA,WAAW,eA6EtB;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAwB,EAAc,EAAE;IACxE,OAAO,IAAI,CAAC,EAAE;QACV,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC,CAAC;AAJW,QAAA,gBAAgB,oBAI3B;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAAwF,EAAc,EAAE;IACrI,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAqB,EAAE,IAAI,CAAC,CAAC;AAC/E,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B"}
@@ -0,0 +1,301 @@
# Acorn
A tiny, fast JavaScript parser written in JavaScript.
## Community
Acorn is open source software released under an
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
You are welcome to
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
requests on [github](https://github.com/acornjs/acorn).
## Installation
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
```sh
npm install acorn
```
Alternately, you can download the source and build acorn yourself:
```sh
git clone https://github.com/acornjs/acorn.git
cd acorn
npm install
```
## Importing acorn
ESM as well as CommonJS is supported for all 3: `acorn`, `acorn-walk` and `acorn-loose`.
ESM example for `acorn`:
```js
import * as acorn from "acorn"
```
CommonJS example for `acorn`:
```js
let acorn = require("acorn")
```
ESM is preferred, as it allows better editor auto-completions by offering TypeScript support.
For this reason, following examples will use ESM imports.
## Interface
**parse**`(input, options)` is the main interface to the library. The
`input` parameter is a string, `options` must be an object setting
some of the options listed below. The return value will be an abstract
syntax tree object as specified by the [ESTree
spec](https://github.com/estree/estree).
```javascript
import * as acorn from "acorn"
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))
```
When encountering a syntax error, the parser will raise a
`SyntaxError` object with a meaningful message. The error object will
have a `pos` property that indicates the string offset at which the
error occurred, and a `loc` object that contains a `{line, column}`
object referring to that same position.
Options are provided by in a second argument, which should be an
object containing any of these fields (only `ecmaVersion` is
required):
- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a
number, either in year (`2022`) or plain version number (`6`) form,
or `"latest"` (the latest the library supports). This influences
support for strict mode, the set of reserved words, and support for
new syntax features.
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn. Other proposed new features must be
implemented through plugins.
- **sourceType**: Indicate the mode the code should be parsed in. Can be
either `"script"`, `"module"` or `"commonjs"`. This influences global strict mode
and parsing of `import` and `export` declarations.
**NOTE**: If set to `"module"`, then static `import` / `export` syntax
will be valid, even if `ecmaVersion` is less than 6. If set to `"commonjs"`,
it is the same as `"script"` except that the top-level scope behaves like a function.
- **onInsertedSemicolon**: If given a callback, that callback will be
called whenever a missing semicolon is inserted by the parser. The
callback will be given the character offset of the point where the
semicolon is inserted as argument, and if `locations` is on, also a
`{line, column}` object representing this position.
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
commas.
- **allowReserved**: If `false`, using a reserved word will generate
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
versions. When given the value `"never"`, reserved words and
keywords can also not be used as property names (as in Internet
Explorer's old parser).
- **allowReturnOutsideFunction**: By default, a return statement at
the top level raises an error. Set this to `true` to accept such
code.
- **allowImportExportEverywhere**: By default, `import` and `export`
declarations can only appear at a program's top level. Setting this
option to `true` allows them anywhere where a statement is allowed,
and also allows `import.meta` expressions to appear in scripts
(when `sourceType` is not `"module"`).
- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
only appear inside `async` functions. Defaults to `true` in modules
for `ecmaVersion` 2022 and later, `false` for lower versions.
Setting this option to `true` allows to have top-level `await`
expressions. They are still not allowed in non-`async` functions,
though. Setting this option to `true` is not allowed when `sourceType: "commonjs"`.
- **allowSuperOutsideMethod**: By default, `super` outside a method
raises an error. Set this to `true` to accept such code.
- **allowHashBang**: When this is enabled, if the code starts with the
characters `#!` (as in a shellscript), the first line will be
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.
- **checkPrivateFields**: By default, the parser will verify that
private properties are only used in places where they are valid and
have been declared. Set this to false to turn such checks off.
- **locations**: When `true`, each node has a `loc` object attached
with `start` and `end` subobjects, each of which contains the
one-based line and zero-based column numbers in `{line, column}`
form. Default is `false`.
- **onToken**: If a function is passed for this option, each found
token will be passed in same format as tokens returned from
`tokenizer().getToken()`.
If array is passed, each found token is pushed to it.
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **onComment**: If a function is passed for this option, whenever a
comment is encountered the function will be called with the
following parameters:
- `block`: `true` if the comment is a block comment, false if it
is a line comment.
- `text`: The content of the comment.
- `start`: Character offset of the start of the comment.
- `end`: Character offset of the end of the comment.
When the `locations` options is on, the `{line, column}` locations
of the comment’s start and end are passed as two additional
parameters.
If array is passed for this option, each found comment is pushed
to it as object in Esprima format:
```javascript
{
"type": "Line" | "Block",
"value": "comment text",
"start": Number,
"end": Number,
// If `locations` option is on:
"loc": {
"start": {line: Number, column: Number}
"end": {line: Number, column: Number}
},
// If `ranges` option is on:
"range": [Number, Number]
}
```
Note that you are not allowed to call the parser from the
callback—that will corrupt its internal state.
- **ranges**: Nodes have their start and end characters offsets
recorded in `start` and `end` properties (directly on the node,
rather than the `loc` object, which holds line/column data. To also
add a
[semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
`range` property holding a `[start, end]` array with the same
numbers, set the `ranges` option to `true`.
- **program**: It is possible to parse multiple files into a single
AST by passing the tree produced by parsing the first file as the
`program` option in subsequent parses. This will add the toplevel
forms of the parsed file to the "Program" (top) node of an existing
parse tree.
- **sourceFile**: When the `locations` option is `true`, you can pass
this option to add a `source` attribute in every node’s `loc`
object. Note that the contents of this option are not examined or
processed in any way; you are free to use whatever format you
choose.
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
will be added (regardless of the `location` option) directly to the
nodes, rather than the `loc` object.
- **preserveParens**: If this option is `true`, parenthesized expressions
are represented by (non-standard) `ParenthesizedExpression` nodes
that have a single `expression` property containing the expression
inside parentheses.
**parseExpressionAt**`(input, offset, options)` will parse a single
expression in a string, and return its AST. It will not complain if
there is more of the string left after the expression.
**tokenizer**`(input, options)` returns an object with a `getToken`
method that can be called repeatedly to get the next token, a `{start,
end, type, value}` object (with added `loc` property when the
`locations` option is enabled and `range` property when the `ranges`
option is enabled). When the token's type is `tokTypes.eof`, you
should stop calling the method, since it will keep returning that same
token forever.
Note that tokenizing JavaScript without parsing it is, in modern
versions of the language, not really possible due to the way syntax is
overloaded in ways that can only be disambiguated by the parse
context. This package applies a bunch of heuristics to try and do a
reasonable job, but you are advised to use `parse` with the `onToken`
option instead of this.
In ES6 environment, returned result can be used as any other
protocol-compliant iterable:
```javascript
for (let token of acorn.tokenizer(str)) {
// iterate over the tokens
}
// transform code to array of tokens:
var tokens = [...acorn.tokenizer(str)]
```
**tokTypes** holds an object mapping names to the token type objects
that end up in the `type` properties of tokens.
**getLineInfo**`(input, offset)` can be used to get a `{line,
column}` object for a given program string and offset.
### The `Parser` class
Instances of the **`Parser`** class contain all the state and logic
that drives a parse. It has static methods `parse`,
`parseExpressionAt`, and `tokenizer` that match the top-level
functions by the same name.
When extending the parser with plugins, you need to call these methods
on the extended version of the class. To extend a parser with plugins,
you can use its static `extend` method.
```javascript
var acorn = require("acorn")
var jsx = require("acorn-jsx")
var JSXParser = acorn.Parser.extend(jsx())
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020})
```
The `extend` method takes any number of plugin values, and returns a
new `Parser` class that includes the extra parser logic provided by
the plugins.
## Command line interface
The `bin/acorn` utility can be used to parse a file from the command
line. It accepts as arguments its input file and the following
options:
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
to parse. Default is version 9.
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
- `--locations`: Attaches a "loc" object to each node with "start" and
"end" subobjects, each of which contains the one-based line and
zero-based column numbers in `{line, column}` form.
- `--allow-hash-bang`: If the code starts with the characters #! (as
in a shellscript), the first line will be treated as a comment.
- `--allow-await-outside-function`: Allows top-level `await` expressions.
See the `allowAwaitOutsideFunction` option for more information.
- `--compact`: No whitespace is used in the AST output.
- `--silent`: Do not output the AST, just return the exit status.
- `--help`: Print the usage information and quit.
The utility spits out the syntax tree as JSON data.
## Existing plugins
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
@@ -0,0 +1,8 @@
//#region src/jsx/constants.d.ts
export declare const DOM_RENDERER: unique symbol;
export declare const DOM_ERROR_HANDLER: unique symbol;
export declare const DOM_STASH: unique symbol;
export declare const DOM_INTERNAL_TAG: unique symbol;
export declare const DOM_MEMO: unique symbol;
export declare const PERMALINK: unique symbol;
//#endregion
@@ -0,0 +1,176 @@
const HELPERS = {
require: `
import {createRequire as CREATE_REQUIRE_NAME} from "module";
const require = CREATE_REQUIRE_NAME(import.meta.url);
`,
interopRequireWildcard: `
function interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
return newObj;
}
}
`,
interopRequireDefault: `
function interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
`,
createNamedExportFrom: `
function createNamedExportFrom(obj, localName, importedName) {
Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]});
}
`,
// Note that TypeScript and Babel do this differently; TypeScript does a simple existence
// check in the exports object and does a plain assignment, whereas Babel uses
// defineProperty and builds an object of explicitly-exported names so that star exports can
// always take lower precedence. For now, we do the easier TypeScript thing.
createStarExport: `
function createStarExport(obj) {
Object.keys(obj)
.filter((key) => key !== "default" && key !== "__esModule")
.forEach((key) => {
if (exports.hasOwnProperty(key)) {
return;
}
Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]});
});
}
`,
nullishCoalesce: `
function nullishCoalesce(lhs, rhsFn) {
if (lhs != null) {
return lhs;
} else {
return rhsFn();
}
}
`,
asyncNullishCoalesce: `
async function asyncNullishCoalesce(lhs, rhsFn) {
if (lhs != null) {
return lhs;
} else {
return await rhsFn();
}
}
`,
optionalChain: `
function optionalChain(ops) {
let lastAccessLHS = undefined;
let value = ops[0];
let i = 1;
while (i < ops.length) {
const op = ops[i];
const fn = ops[i + 1];
i += 2;
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
return undefined;
}
if (op === 'access' || op === 'optionalAccess') {
lastAccessLHS = value;
value = fn(value);
} else if (op === 'call' || op === 'optionalCall') {
value = fn((...args) => value.call(lastAccessLHS, ...args));
lastAccessLHS = undefined;
}
}
return value;
}
`,
asyncOptionalChain: `
async function asyncOptionalChain(ops) {
let lastAccessLHS = undefined;
let value = ops[0];
let i = 1;
while (i < ops.length) {
const op = ops[i];
const fn = ops[i + 1];
i += 2;
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
return undefined;
}
if (op === 'access' || op === 'optionalAccess') {
lastAccessLHS = value;
value = await fn(value);
} else if (op === 'call' || op === 'optionalCall') {
value = await fn((...args) => value.call(lastAccessLHS, ...args));
lastAccessLHS = undefined;
}
}
return value;
}
`,
optionalChainDelete: `
function optionalChainDelete(ops) {
const result = OPTIONAL_CHAIN_NAME(ops);
return result == null ? true : result;
}
`,
asyncOptionalChainDelete: `
async function asyncOptionalChainDelete(ops) {
const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
return result == null ? true : result;
}
`,
};
export class HelperManager {
__init() {this.helperNames = {}}
__init2() {this.createRequireName = null}
constructor( nameManager) {;this.nameManager = nameManager;HelperManager.prototype.__init.call(this);HelperManager.prototype.__init2.call(this);}
getHelperName(baseName) {
let helperName = this.helperNames[baseName];
if (helperName) {
return helperName;
}
helperName = this.nameManager.claimFreeName(`_${baseName}`);
this.helperNames[baseName] = helperName;
return helperName;
}
emitHelpers() {
let resultCode = "";
if (this.helperNames.optionalChainDelete) {
this.getHelperName("optionalChain");
}
if (this.helperNames.asyncOptionalChainDelete) {
this.getHelperName("asyncOptionalChain");
}
for (const [baseName, helperCodeTemplate] of Object.entries(HELPERS)) {
const helperName = this.helperNames[baseName];
let helperCode = helperCodeTemplate;
if (baseName === "optionalChainDelete") {
helperCode = helperCode.replace("OPTIONAL_CHAIN_NAME", this.helperNames.optionalChain);
} else if (baseName === "asyncOptionalChainDelete") {
helperCode = helperCode.replace(
"ASYNC_OPTIONAL_CHAIN_NAME",
this.helperNames.asyncOptionalChain,
);
} else if (baseName === "require") {
if (this.createRequireName === null) {
this.createRequireName = this.nameManager.claimFreeName("_createRequire");
}
helperCode = helperCode.replace(/CREATE_REQUIRE_NAME/g, this.createRequireName);
}
if (helperName) {
resultCode += " ";
resultCode += helperCode.replace(baseName, helperName).replace(/\s+/g, " ").trim();
}
}
return resultCode;
}
}
@@ -0,0 +1 @@
{"version":3,"file":"press.mjs","sources":["../../../src/gestures/press.ts"],"sourcesContent":["import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement<Element>,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature<Element> {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGA,SAAS,gBAAgB,CACrB,IAA4B,EAC5B,KAAmB,EACnB,SAAqC,EAAA;AAErC,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI;AAEtB,IAAA,IAAI,IAAI,CAAC,OAAO,YAAY,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACpE;IACJ;IAEA,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,EAAE;QACvC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,KAAK,OAAO,CAAC;IACpE;AAEA,IAAA,MAAM,SAAS,IAAI,OAAO,IAAI,SAAS,KAAK,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC,CAGhD;AAEnB,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,IAAI,QAAQ,EAAE;AACV,QAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE;AACJ;AAEM,MAAO,YAAa,SAAQ,OAAgB,CAAA;IAC9C,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI;AAC7B,QAAA,IAAI,CAAC,OAAO;YAAE;QAEd,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;AAEtD,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAChB,OAAO,EACP,CAAC,QAAQ,EAAE,UAAU,KAAI;YACrB,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;YAEhD,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KACzB,gBAAgB,CACZ,IAAI,CAAC,IAAI,EACT,QAAQ,EACR,OAAO,GAAG,KAAK,GAAG,QAAQ,CAC7B;AACT,QAAA,CAAC,EACD;AACI,YAAA,eAAe,EAAE,eAAe;AAChC,YAAA,eAAe,EAAE,SAAS,EAAE,GAAG,KAAK,KAAK;AAC5C,SAAA,CACJ;IACL;AAEA,IAAA,OAAO,KAAI;AACd;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"folder-tree.js","sources":["../../../src/icons/folder-tree.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderTree\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTBhMSAxIDAgMCAwIDEtMVY2YTEgMSAwIDAgMC0xLTFoLTIuNWExIDEgMCAwIDEtLjgtLjRsLS45LTEuMkExIDEgMCAwIDAgMTUgM2gtMmExIDEgMCAwIDAtMSAxdjVhMSAxIDAgMCAwIDEgMVoiIC8+CiAgPHBhdGggZD0iTTIwIDIxYTEgMSAwIDAgMCAxLTF2LTNhMSAxIDAgMCAwLTEtMWgtMi45YTEgMSAwIDAgMS0uODgtLjU1bC0uNDItLjg1YTEgMSAwIDAgMC0uOTItLjZIMTNhMSAxIDAgMCAwLTEgMXY1YTEgMSAwIDAgMCAxIDFaIiAvPgogIDxwYXRoIGQ9Ik0zIDVhMiAyIDAgMCAwIDIgMmgzIiAvPgogIDxwYXRoIGQ9Ik0zIDN2MTNhMiAyIDAgMCAwIDIgMmgzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/folder-tree\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 FolderTree = createLucideIcon('FolderTree', [\n [\n 'path',\n {\n d: 'M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z',\n key: 'hod4my',\n },\n ],\n [\n 'path',\n {\n d: 'M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z',\n key: 'w4yl2u',\n },\n ],\n ['path', { d: 'M3 5a2 2 0 0 0 2 2h3', key: 'f2jnh7' }],\n ['path', { d: 'M3 3v13a2 2 0 0 0 2 2h3', key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G,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,2 @@
const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set(t))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function r(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=i.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,c.process(t))}};return c}(o),t),{}),{setup:d,read:h,resolveKeyframes:l,preUpdate:p,update:u,preRender:f,render:m,postRender:g}=c,v=()=>{const i=s.useManualTiming,o=i?a.timestamp:performance.now();n=!1,i||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,d.process(a),h.process(a),l.process(a),p.process(a),u.process(a),f.process(a),m.process(a),g.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(v))};return{schedule:i.reduce((e,s)=>{const i=c[s];return e[s]=(e,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||t(v)),i.schedule(e,s,o)),e},{}),cancel:t=>{for(let e=0;e<i.length;e++)c[i[e]].cancel(t)},state:a,steps:c}}const{schedule:a,cancel:o,state:c}=r("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0);let d;function h(){d=void 0}const l={now:()=>(void 0===d&&l.set(c.isProcessing||s.useManualTiming?c.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(h)}};class p{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=l.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=l.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new n);const s=this.events[t].add(e);return"change"===t?()=>{s(),a.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=l.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(n=e)?s*(1e3/n):0;var s,n}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function u(t){return(e,s)=>{const n=function(t){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}(e),i=[];for(const e of n){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}const f={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={..Line truncated
//# sourceMappingURL=size-rollup-style-effect.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_Z","132":"_A"},B:{"1":"_K","132":"_2F","516":"Q"},C:{"1":"_JQ _uB","2":"_nL _L"},D:{"1":"_MM","2":"_DO","260":"IC JC"},E:{"1":"_1C","2":"_iF","1090":"G _EE"},F:{"1":"_RI","2":"_IP","260":"7B 8B"},G:{"1":"_kB","2":"_XF","1090":"_kK"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"132":"_A"},O:{"1":"bC"},P:{"1":"_yB","2":"_pC"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:5,C:"CSS overscroll-behavior",D:true};
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Shirt = createLucideIcon("Shirt", [
[
"path",
{
d: "M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",
key: "1wgbhj"
}
]
]);
export { Shirt as default };
//# sourceMappingURL=shirt.js.map
@@ -0,0 +1,52 @@
import { parseAccept } from "../../utils/accept.js";
//#region src/helper/accepts/accepts.ts
const matchType = (acceptType, supportedType) => {
const accept = acceptType.toLowerCase();
const supported = supportedType.toLowerCase();
if (accept === supported) return true;
if (accept === "*/*" || accept === "*") return false;
if (accept.endsWith("/*")) {
const [acceptMain] = accept.split("/");
const [supportedMain] = supported.split("/");
return acceptMain === supportedMain;
}
return false;
};
const getSpecificity = (type) => {
if (type === "*/*" || type === "*") return 1;
if (type.endsWith("/*")) return 2;
return 3;
};
const defaultMatch = (accepts, config) => {
const { supports, default: defaultSupport } = config;
const sortedAccepts = accepts.filter((accept) => accept.q > 0).sort((a, b) => {
if (b.q !== a.q) return b.q - a.q;
return getSpecificity(b.type) - getSpecificity(a.type);
});
for (const accept of sortedAccepts) {
const matched = supports.find((supported) => matchType(accept.type, supported));
if (matched) return matched;
}
return defaultSupport;
};
/**
* Match the accept header with the given options.
* @example
* ```ts
* app.get('/users', (c) => {
* const lang = accepts(c, {
* header: 'Accept-Language',
* supports: ['en', 'zh'],
* default: 'en',
* })
* })
* ```
*/
const accepts = (c, options) => {
const acceptHeader = c.req.header(options.header);
if (!acceptHeader) return options.default;
const accepts = parseAccept(acceptHeader);
return (options.match || defaultMatch)(accepts, options);
};
//#endregion
export { accepts, defaultMatch };
@@ -0,0 +1,4 @@
type Resolve = (source: string | null) => string;
export default function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve;
export {};
//# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1,26 @@
/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* The content type object contains a type string and optional parameters.
*/
export interface ContentType {
type: string;
parameters: Record<string, string>;
}
/**
* Format an object into a `Content-Type` header.
*/
export declare function format(obj: Partial<ContentType>): string;
/**
* Options for parsing a `Content-Type` header.
*/
export interface ParseOptions {
parameters?: boolean;
}
/**
* Parse a `Content-Type` header.
*/
export declare function parse(header: string, options?: ParseOptions): ContentType;
@@ -0,0 +1,196 @@
# gensync
This module allows for developers to write common code that can share
implementation details, hiding whether an underlying request happens
synchronously or asynchronously. This is in contrast with many current Node
APIs which explicitly implement the same API twice, once with calls to
synchronous functions, and once with asynchronous functions.
Take for example `fs.readFile` and `fs.readFileSync`, if you're writing an API
that loads a file and then performs a synchronous operation on the data, it
can be frustrating to maintain two parallel functions.
## Example
```js
const fs = require("fs");
const gensync = require("gensync");
const readFile = gensync({
sync: fs.readFileSync,
errback: fs.readFile,
});
const myOperation = gensync(function* (filename) {
const code = yield* readFile(filename, "utf8");
return "// some custom prefix\n" + code;
});
// Load and add the prefix synchronously:
const result = myOperation.sync("./some-file.js");
// Load and add the prefix asynchronously with promises:
myOperation.async("./some-file.js").then(result => {
});
// Load and add the prefix asynchronously with promises:
myOperation.errback("./some-file.js", (err, result) => {
});
```
This could even be exposed as your official API by doing
```js
// Using the common 'Sync' suffix for sync functions, and 'Async' suffix for
// promise-returning versions.
exports.myOperationSync = myOperation.sync;
exports.myOperationAsync = myOperation.async;
exports.myOperation = myOperation.errback;
```
or potentially expose one of the async versions as the default, with a
`.sync` property on the function to expose the synchronous version.
```js
module.exports = myOperation.errback;
module.exports.sync = myOperation.sync;
````
## API
### gensync(generatorFnOrOptions)
Returns a function that can be "await"-ed in another `gensync` generator
function, or executed via
* `.sync(...args)` - Returns the computed value, or throws.
* `.async(...args)` - Returns a promise for the computed value.
* `.errback(...args, (err, result) => {})` - Calls the callback with the computed value, or error.
#### Passed a generator
Wraps the generator to populate the `.sync`/`.async`/`.errback` helpers above to
allow for evaluation of the generator for the final value.
##### Example
```js
const readFile = function* () {
return 42;
};
const readFileAndMore = gensync(function* (){
const val = yield* readFile();
return 42 + val;
});
// In general cases
const code = readFileAndMore.sync("./file.js", "utf8");
readFileAndMore.async("./file.js", "utf8").then(code => {})
readFileAndMore.errback("./file.js", "utf8", (err, code) => {});
// In a generator being called indirectly with .sync/.async/.errback
const code = yield* readFileAndMore("./file.js", "utf8");
```
#### Passed an options object
* `opts.sync`
Example: `(...args) => 4`
A function that will be called when `.sync()` is called on the `gensync()`
result, or when the result is passed to `yield*` in another generator that
is being run synchronously.
Also called for `.async()` calls if no async handlers are provided.
* `opts.async`
Example: `async (...args) => 4`
A function that will be called when `.async()` or `.errback()` is called on
the `gensync()` result, or when the result is passed to `yield*` in another
generator that is being run asynchronously.
* `opts.errback`
Example: `(...args, cb) => cb(null, 4)`
A function that will be called when `.async()` or `.errback()` is called on
the `gensync()` result, or when the result is passed to `yield*` in another
generator that is being run asynchronously.
This option allows for simpler compatibility with many existing Node APIs,
and also avoids introducing the extra even loop turns that promises introduce
to access the result value.
* `opts.name`
Example: `"readFile"`
A string name to apply to the returned function. If no value is provided,
the name of `errback`/`async`/`sync` functions will be used, with any
`Sync` or `Async` suffix stripped off. If the callback is simply named
with ES6 inference (same name as the options property), the name is ignored.
* `opts.arity`
Example: `4`
A number for the length to set on the returned function. If no value
is provided, the length will be carried over from the `sync` function's
`length` value.
##### Example
```js
const readFile = gensync({
sync: fs.readFileSync,
errback: fs.readFile,
});
const code = readFile.sync("./file.js", "utf8");
readFile.async("./file.js", "utf8").then(code => {})
readFile.errback("./file.js", "utf8", (err, code) => {});
```
### gensync.all(iterable)
`Promise.all`-like combinator that works with an iterable of generator objects
that could be passed to `yield*` within a gensync generator.
#### Example
```js
const loadFiles = gensync(function* () {
return yield* gensync.all([
readFile("./one.js"),
readFile("./two.js"),
readFile("./three.js"),
]);
});
```
### gensync.race(iterable)
`Promise.race`-like combinator that works with an iterable of generator objects
that could be passed to `yield*` within a gensync generator.
#### Example
```js
const loadFiles = gensync(function* () {
return yield* gensync.race([
readFile("./one.js"),
readFile("./two.js"),
readFile("./three.js"),
]);
});
```
@@ -0,0 +1,488 @@
'use strict';
const XHTMLEntities = require('./xhtml');
const hexNumber = /^[\da-fA-F]+$/;
const decimalNumber = /^\d+$/;
// The map to `acorn-jsx` tokens from `acorn` namespace objects.
const acornJsxMap = new WeakMap();
// Get the original tokens for the given `acorn` namespace object.
function getJsxTokens(acorn) {
acorn = acorn.Parser.acorn || acorn;
let acornJsx = acornJsxMap.get(acorn);
if (!acornJsx) {
const tt = acorn.tokTypes;
const TokContext = acorn.TokContext;
const TokenType = acorn.TokenType;
const tc_oTag = new TokContext('<tag', false);
const tc_cTag = new TokContext('</tag', false);
const tc_expr = new TokContext('<tag>...</tag>', true, true);
const tokContexts = {
tc_oTag: tc_oTag,
tc_cTag: tc_cTag,
tc_expr: tc_expr
};
const tokTypes = {
jsxName: new TokenType('jsxName'),
jsxText: new TokenType('jsxText', {beforeExpr: true}),
jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}),
jsxTagEnd: new TokenType('jsxTagEnd')
};
tokTypes.jsxTagStart.updateContext = function() {
this.context.push(tc_expr); // treat as beginning of JSX expression
this.context.push(tc_oTag); // start opening tag context
this.exprAllowed = false;
};
tokTypes.jsxTagEnd.updateContext = function(prevType) {
let out = this.context.pop();
if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {
this.context.pop();
this.exprAllowed = this.curContext() === tc_expr;
} else {
this.exprAllowed = true;
}
};
acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes };
acornJsxMap.set(acorn, acornJsx);
}
return acornJsx;
}
// Transforms JSX element name to string.
function getQualifiedJSXName(object) {
if (!object)
return object;
if (object.type === 'JSXIdentifier')
return object.name;
if (object.type === 'JSXNamespacedName')
return object.namespace.name + ':' + object.name.name;
if (object.type === 'JSXMemberExpression')
return getQualifiedJSXName(object.object) + '.' +
getQualifiedJSXName(object.property);
}
module.exports = function(options) {
options = options || {};
return function(Parser) {
return plugin({
allowNamespaces: options.allowNamespaces !== false,
allowNamespacedObjects: !!options.allowNamespacedObjects
}, Parser);
};
};
// This is `tokTypes` of the peer dep.
// This can be different instances from the actual `tokTypes` this plugin uses.
Object.defineProperty(module.exports, "tokTypes", {
get: function get_tokTypes() {
return getJsxTokens(require("acorn")).tokTypes;
},
configurable: true,
enumerable: true
});
function plugin(options, Parser) {
const acorn = Parser.acorn || require("acorn");
const acornJsx = getJsxTokens(acorn);
const tt = acorn.tokTypes;
const tok = acornJsx.tokTypes;
const tokContexts = acorn.tokContexts;
const tc_oTag = acornJsx.tokContexts.tc_oTag;
const tc_cTag = acornJsx.tokContexts.tc_cTag;
const tc_expr = acornJsx.tokContexts.tc_expr;
const isNewLine = acorn.isNewLine;
const isIdentifierStart = acorn.isIdentifierStart;
const isIdentifierChar = acorn.isIdentifierChar;
return class extends Parser {
// Expose actual `tokTypes` and `tokContexts` to other plugins.
static get acornJsx() {
return acornJsx;
}
// Reads inline JSX contents token.
jsx_readToken() {
let out = '', chunkStart = this.pos;
for (;;) {
if (this.pos >= this.input.length)
this.raise(this.start, 'Unterminated JSX contents');
let ch = this.input.charCodeAt(this.pos);
switch (ch) {
case 60: // '<'
case 123: // '{'
if (this.pos === this.start) {
if (ch === 60 && this.exprAllowed) {
++this.pos;
return this.finishToken(tok.jsxTagStart);
}
return this.getTokenFromCode(ch);
}
out += this.input.slice(chunkStart, this.pos);
return this.finishToken(tok.jsxText, out);
case 38: // '&'
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readEntity();
chunkStart = this.pos;
break;
case 62: // '>'
case 125: // '}'
this.raise(
this.pos,
"Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
(ch === 62 ? "&gt;" : "&rbrace;") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
);
default:
if (isNewLine(ch)) {
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readNewLine(true);
chunkStart = this.pos;
} else {
++this.pos;
}
}
}
}
jsx_readNewLine(normalizeCRLF) {
let ch = this.input.charCodeAt(this.pos);
let out;
++this.pos;
if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
++this.pos;
out = normalizeCRLF ? '\n' : '\r\n';
} else {
out = String.fromCharCode(ch);
}
if (this.options.locations) {
++this.curLine;
this.lineStart = this.pos;
}
return out;
}
jsx_readString(quote) {
let out = '', chunkStart = ++this.pos;
for (;;) {
if (this.pos >= this.input.length)
this.raise(this.start, 'Unterminated string constant');
let ch = this.input.charCodeAt(this.pos);
if (ch === quote) break;
if (ch === 38) { // '&'
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readEntity();
chunkStart = this.pos;
} else if (isNewLine(ch)) {
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readNewLine(false);
chunkStart = this.pos;
} else {
++this.pos;
}
}
out += this.input.slice(chunkStart, this.pos++);
return this.finishToken(tt.string, out);
}
jsx_readEntity() {
let str = '', count = 0, entity;
let ch = this.input[this.pos];
if (ch !== '&')
this.raise(this.pos, 'Entity must start with an ampersand');
let startPos = ++this.pos;
while (this.pos < this.input.length && count++ < 10) {
ch = this.input[this.pos++];
if (ch === ';') {
if (str[0] === '#') {
if (str[1] === 'x') {
str = str.substr(2);
if (hexNumber.test(str))
entity = String.fromCharCode(parseInt(str, 16));
} else {
str = str.substr(1);
if (decimalNumber.test(str))
entity = String.fromCharCode(parseInt(str, 10));
}
} else {
entity = XHTMLEntities[str];
}
break;
}
str += ch;
}
if (!entity) {
this.pos = startPos;
return '&';
}
return entity;
}
// Read a JSX identifier (valid tag or attribute name).
//
// Optimized version since JSX identifiers can't contain
// escape characters and so can be read as single slice.
// Also assumes that first character was already checked
// by isIdentifierStart in readToken.
jsx_readWord() {
let ch, start = this.pos;
do {
ch = this.input.charCodeAt(++this.pos);
} while (isIdentifierChar(ch) || ch === 45); // '-'
return this.finishToken(tok.jsxName, this.input.slice(start, this.pos));
}
// Parse next token as JSX identifier
jsx_parseIdentifier() {
let node = this.startNode();
if (this.type === tok.jsxName)
node.name = this.value;
else if (this.type.keyword)
node.name = this.type.keyword;
else
this.unexpected();
this.next();
return this.finishNode(node, 'JSXIdentifier');
}
// Parse namespaced identifier.
jsx_parseNamespacedName() {
let startPos = this.start, startLoc = this.startLoc;
let name = this.jsx_parseIdentifier();
if (!options.allowNamespaces || !this.eat(tt.colon)) return name;
var node = this.startNodeAt(startPos, startLoc);
node.namespace = name;
node.name = this.jsx_parseIdentifier();
return this.finishNode(node, 'JSXNamespacedName');
}
// Parses element name in any form - namespaced, member
// or single identifier.
jsx_parseElementName() {
if (this.type === tok.jsxTagEnd) return '';
let startPos = this.start, startLoc = this.startLoc;
let node = this.jsx_parseNamespacedName();
if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) {
this.unexpected();
}
while (this.eat(tt.dot)) {
let newNode = this.startNodeAt(startPos, startLoc);
newNode.object = node;
newNode.property = this.jsx_parseIdentifier();
node = this.finishNode(newNode, 'JSXMemberExpression');
}
return node;
}
// Parses any type of JSX attribute value.
jsx_parseAttributeValue() {
switch (this.type) {
case tt.braceL:
let node = this.jsx_parseExpressionContainer();
if (node.expression.type === 'JSXEmptyExpression')
this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
return node;
case tok.jsxTagStart:
case tt.string:
return this.parseExprAtom();
default:
this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
}
}
// JSXEmptyExpression is unique type since it doesn't actually parse anything,
// and so it should start at the end of last read token (left brace) and finish
// at the beginning of the next one (right brace).
jsx_parseEmptyExpression() {
let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
}
// Parses JSX expression enclosed into curly brackets.
jsx_parseExpressionContainer() {
let node = this.startNode();
this.next();
node.expression = this.type === tt.braceR
? this.jsx_parseEmptyExpression()
: this.parseExpression();
this.expect(tt.braceR);
return this.finishNode(node, 'JSXExpressionContainer');
}
// Parses following JSX attribute name-value pair.
jsx_parseAttribute() {
let node = this.startNode();
if (this.eat(tt.braceL)) {
this.expect(tt.ellipsis);
node.argument = this.parseMaybeAssign();
this.expect(tt.braceR);
return this.finishNode(node, 'JSXSpreadAttribute');
}
node.name = this.jsx_parseNamespacedName();
node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
return this.finishNode(node, 'JSXAttribute');
}
// Parses JSX opening tag starting after '<'.
jsx_parseOpeningElementAt(startPos, startLoc) {
let node = this.startNodeAt(startPos, startLoc);
node.attributes = [];
let nodeName = this.jsx_parseElementName();
if (nodeName) node.name = nodeName;
while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)
node.attributes.push(this.jsx_parseAttribute());
node.selfClosing = this.eat(tt.slash);
this.expect(tok.jsxTagEnd);
return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');
}
// Parses JSX closing tag starting after '</'.
jsx_parseClosingElementAt(startPos, startLoc) {
let node = this.startNodeAt(startPos, startLoc);
let nodeName = this.jsx_parseElementName();
if (nodeName) node.name = nodeName;
this.expect(tok.jsxTagEnd);
return this.finishNode(node, nodeName ? 'JSXClosingElement' : 'JSXClosingFragment');
}
// Parses entire JSX element, including it's opening tag
// (starting after '<'), attributes, contents and closing tag.
jsx_parseElementAt(startPos, startLoc) {
let node = this.startNodeAt(startPos, startLoc);
let children = [];
let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
let closingElement = null;
if (!openingElement.selfClosing) {
contents: for (;;) {
switch (this.type) {
case tok.jsxTagStart:
startPos = this.start; startLoc = this.startLoc;
this.next();
if (this.eat(tt.slash)) {
closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
break contents;
}
children.push(this.jsx_parseElementAt(startPos, startLoc));
break;
case tok.jsxText:
children.push(this.parseExprAtom());
break;
case tt.braceL:
children.push(this.jsx_parseExpressionContainer());
break;
default:
this.unexpected();
}
}
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(
closingElement.start,
'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
}
}
let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment';
node['opening' + fragmentOrElement] = openingElement;
node['closing' + fragmentOrElement] = closingElement;
node.children = children;
if (this.type === tt.relational && this.value === "<") {
this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
}
return this.finishNode(node, 'JSX' + fragmentOrElement);
}
// Parse JSX text
jsx_parseText() {
let node = this.parseLiteral(this.value);
node.type = "JSXText";
return node;
}
// Parses entire JSX element from current position.
jsx_parseElement() {
let startPos = this.start, startLoc = this.startLoc;
this.next();
return this.jsx_parseElementAt(startPos, startLoc);
}
parseExprAtom(refShortHandDefaultPos) {
if (this.type === tok.jsxText)
return this.jsx_parseText();
else if (this.type === tok.jsxTagStart)
return this.jsx_parseElement();
else
return super.parseExprAtom(refShortHandDefaultPos);
}
readToken(code) {
let context = this.curContext();
if (context === tc_expr) return this.jsx_readToken();
if (context === tc_oTag || context === tc_cTag) {
if (isIdentifierStart(code)) return this.jsx_readWord();
if (code == 62) {
++this.pos;
return this.finishToken(tok.jsxTagEnd);
}
if ((code === 34 || code === 39) && context == tc_oTag)
return this.jsx_readString(code);
}
if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
++this.pos;
return this.finishToken(tok.jsxTagStart);
}
return super.readToken(code);
}
updateContext(prevType) {
if (this.type == tt.braceL) {
var curContext = this.curContext();
if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);
else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);
else super.updateContext(prevType);
this.exprAllowed = true;
} else if (this.type === tt.slash && prevType === tok.jsxTagStart) {
this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
this.context.push(tc_cTag); // reconsider as closing tag context
this.exprAllowed = false;
} else {
return super.updateContext(prevType);
}
}
};
}
@@ -0,0 +1 @@
{"version":3,"file":"cigarette-off.js","sources":["../../../src/icons/cigarette-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CigaretteOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTJIM2ExIDEgMCAwIDAtMSAxdjJhMSAxIDAgMCAwIDEgMWgxMyIgLz4KICA8cGF0aCBkPSJNMTggOGMwLTIuNS0yLTIuNS0yLTUiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KICA8cGF0aCBkPSJNMjEgMTJhMSAxIDAgMCAxIDEgMXYyYTEgMSAwIDAgMS0uNS44NjYiIC8+CiAgPHBhdGggZD0iTTIyIDhjMC0yLjUtMi0yLjUtMi01IiAvPgogIDxwYXRoIGQ9Ik03IDEydjQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/cigarette-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CigaretteOff = createLucideIcon('CigaretteOff', [\n ['path', { d: 'M12 12H3a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h13', key: '1gdiyg' }],\n ['path', { d: 'M18 8c0-2.5-2-2.5-2-5', key: '1il607' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M21 12a1 1 0 0 1 1 1v2a1 1 0 0 1-.5.866', key: '166zjj' }],\n ['path', { d: 'M22 8c0-2.5-2-2.5-2-5', key: '1gah44' }],\n ['path', { d: 'M7 12v4', key: 'jqww69' }],\n]);\n\nexport default CigaretteOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,21 @@
import { StructuralSharingOption, ValidateSelected } from './structuralSharing.js';
import { AnyRouter, RegisteredRouter, ResolveUseParams, StrictOrFrom, ThrowConstraint, ThrowOrOptional, UseParamsResult } from '@tanstack/router-core';
export interface UseParamsBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing> {
select?: (params: ResolveUseParams<TRouter, TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
shouldThrow?: TThrow;
}
export type UseParamsOptions<TRouter extends AnyRouter, TFrom extends string | undefined, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing> = StrictOrFrom<TRouter, TFrom, TStrict> & UseParamsBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>;
export type UseParamsRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseParamsBaseOptions<TRouter, TFrom, true, true, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => UseParamsResult<TRouter, TFrom, true, TSelected>;
/**
* Access the current route's path parameters with type-safety.
*
* Options:
* - `from`/`strict`: Specify the matched route and whether to enforce strict typing
* - `select`: Project the params object to a derived value for memoized renders
* - `structuralSharing`: Enable structural sharing for stable references
* - `shouldThrow`: Throw if the route is not found in strict contexts
*
* @returns The params object (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
*/
export declare function useParams<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, TStrict extends boolean = true, TThrow extends boolean = true, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts: UseParamsOptions<TRouter, TFrom, TStrict, ThrowConstraint<TStrict, TThrow>, TSelected, TStructuralSharing>): ThrowOrOptional<UseParamsResult<TRouter, TFrom, TStrict, TSelected>, TThrow>;
@@ -0,0 +1,37 @@
/*
@license
Rollup.js v4.60.4
Thu, 14 May 2026 17:52:21 GMT - commit d311a84b0bb4d4a6f50d19ffd2c29cca28660c88
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
let fsEvents;
let fsEventsImportError;
async function loadFsEvents() {
try {
({ default: fsEvents } = await import('fsevents'));
}
catch (error) {
fsEventsImportError = error;
}
}
// A call to this function will be injected into the chokidar code
function getFsEvents() {
if (fsEventsImportError)
throw fsEventsImportError;
return fsEvents;
}
const fseventsImporter = /*#__PURE__*/Object.defineProperty({
__proto__: null,
getFsEvents,
loadFsEvents
}, Symbol.toStringTag, { value: 'Module' });
exports.fseventsImporter = fseventsImporter;
exports.loadFsEvents = loadFsEvents;
//# sourceMappingURL=fsevents-importer.js.map
@@ -0,0 +1,476 @@
export * from './global'
export { TSR_DEFERRED_PROMISE, defer } from './defer'
export type { DeferredPromiseState, DeferredPromise } from './defer'
export { invariant } from './invariant'
export { preloadWarning } from './link'
export type {
IsRequiredParams,
AddTrailingSlash,
RemoveTrailingSlashes,
AddLeadingSlash,
RemoveLeadingSlashes,
ActiveOptions,
LinkOptionsProps,
ResolveCurrentPath,
ResolveParentPath,
ResolveRelativePath,
FindDescendantToPaths,
InferDescendantToPaths,
RelativeToPath,
RelativeToParentPath,
RelativeToCurrentPath,
AbsoluteToPath,
RelativeToPathAutoComplete,
NavigateOptions,
ToOptions,
ToMaskOptions,
ToSubOptions,
ResolveRoute,
SearchParamOptions,
PathParamOptions,
ToPathOption,
LinkOptions,
MakeOptionalPathParams,
FromPathOption,
MakeOptionalSearchParams,
MaskOptions,
ToSubOptionsProps,
RequiredToOptions,
} from './link'
export type {
RouteToPath,
TrailingSlashOptionByRouter,
ParseRoute,
CodeRouteToPath,
RouteIds,
FullSearchSchema,
FullSearchSchemaInput,
AllParams,
RouteById,
AllContext,
RoutePaths,
RoutesById,
RoutesByPath,
AllLoaderData,
RouteByPath,
} from './routeInfo'
export type {
InferFileRouteTypes,
FileRouteTypes,
FileRoutesByPath,
CreateFileRoute,
LazyRoute,
LazyRouteOptions,
CreateLazyFileRoute,
} from './fileRoute'
export type { ParsedLocation } from './location'
export type {
Manifest,
RouterManagedTag,
AssetCrossOrigin,
AssetCrossOriginConfig,
ManifestAssetLink,
} from './manifest'
export {
createInlineCssStyleAsset,
getAssetCrossOrigin,
getStylesheetHref,
isInlinableStylesheet,
resolveManifestAssetLink,
} from './manifest'
export { isMatch } from './Matches'
export type {
AnyMatchAndValue,
FindValueByIndex,
FindValueByKey,
CreateMatchAndValue,
NextMatchAndValue,
IsMatchKeyOf,
IsMatchPath,
IsMatchResult,
IsMatchParse,
IsMatch,
RouteMatch,
RouteMatchExtensions,
MakeRouteMatchUnion,
MakeRouteMatch,
AnyRouteMatch,
MakeRouteMatchFromRoute,
MatchRouteOptions,
} from './Matches'
export {
joinPaths,
cleanPath,
trimPathLeft,
trimPathRight,
trimPath,
removeTrailingSlash,
exactPathTest,
resolvePath,
interpolatePath,
} from './path'
export { encode, decode } from './qss'
export { rootRouteId } from './root'
export type { RootRouteId } from './root'
export { BaseRoute, BaseRouteApi, BaseRootRoute } from './route'
export type {
AnyPathParams,
SearchSchemaInput,
AnyContext,
RouteContext,
PreloadableObj,
RoutePathOptions,
StaticDataRouteOption,
RoutePathOptionsIntersection,
SearchFilter,
SearchMiddlewareContext,
SearchMiddleware,
ResolveId,
InferFullSearchSchema,
InferFullSearchSchemaInput,
InferAllParams,
InferAllContext,
MetaDescriptor,
RouteLinkEntry,
SearchValidator,
AnySearchValidator,
DefaultSearchValidator,
ErrorRouteProps,
ErrorComponentProps,
NotFoundRouteProps,
ResolveParams,
ParseParamsFn,
StringifyParamsFn,
ParamsOptions,
UpdatableStaticRouteOption,
ContextReturnType,
ContextAsyncReturnType,
ResolveRouteContext,
ResolveLoaderData,
RoutePrefix,
TrimPath,
TrimPathLeft,
TrimPathRight,
ResolveSearchSchemaFnInput,
ResolveSearchSchemaInput,
ResolveSearchSchemaFn,
ResolveSearchSchema,
ResolveFullSearchSchema,
ResolveFullSearchSchemaInput,
ResolveAllContext,
BeforeLoadContextParameter,
RouteContextParameter,
ResolveAllParamsFromParent,
AnyRoute,
Route,
RouteTypes,
FullSearchSchemaOption,
RemountDepsOptions,
MakeRemountDepsOptionsUnion,
ResolveFullPath,
AnyRouteWithContext,
RouteOptions,
FileBaseRouteOptions,
BaseRouteOptions,
UpdatableRouteOptions,
LoaderStaleReloadMode,
RouteLoaderFn,
RouteLoaderEntry,
LoaderFnContext,
RouteContextFn,
ContextOptions,
RouteContextOptions,
BeforeLoadContextOptions,
RootRouteOptions,
RootRouteOptionsExtensions,
UpdatableRouteOptionsExtensions,
RouteConstraints,
RouteTypesById,
RouteMask,
RouteExtensions,
RouteLazyFn,
RouteAddChildrenFn,
RouteAddFileChildrenFn,
RouteAddFileTypesFn,
ResolveOptionalParams,
ResolveRequiredParams,
RootRoute,
FilebaseRouteOptionsInterface,
} from './route'
export {
createNonReactiveMutableStore,
createNonReactiveReadonlyStore,
} from './stores'
export type {
RouterBatchFn,
RouterReadableStore,
GetStoreConfig,
RouterStores,
RouterWritableStore,
} from './stores'
export {
defaultSerializeError,
getLocationChangeInfo,
RouterCore,
lazyFn,
SearchParamError,
PathParamError,
getInitialRouterState,
getMatchedRoutes,
trailingSlashOptions,
} from './router'
export type {
ViewTransitionOptions,
TrailingSlashOption,
Register,
AnyRouter,
AnyRouterWithContext,
RegisteredRouter,
RouterState,
BuildNextOptions,
RouterListener,
RouterEvent,
ListenerFn,
RouterEvents,
MatchRoutesOpts,
RouterOptionsExtensions,
DefaultRemountDepsFn,
PreloadRouteFn,
MatchRouteFn,
RouterContextOptions,
RouterOptions,
RouterConstructorOptions,
UpdateFn,
ParseLocationFn,
InvalidateFn,
ControllablePromise,
InjectedHtmlEntry,
EmitFn,
LoadFn,
GetMatchFn,
SubscribeFn,
UpdateMatchFn,
CommitLocationFn,
GetMatchRoutesFn,
MatchRoutesFn,
StartTransitionFn,
LoadRouteChunkFn,
ClearCacheFn,
CreateRouterFn,
SSROption,
} from './router'
export * from './config'
export type {
MatchLocation,
CommitLocationOptions,
NavigateFn,
BuildLocationFn,
} from './RouterProvider'
export { retainSearchParams, stripSearchParams } from './searchMiddleware'
export {
defaultParseSearch,
defaultStringifySearch,
parseSearchWith,
stringifySearchWith,
} from './searchParams'
export type { SearchSerializer, SearchParser } from './searchParams'
export type { OptionalStructuralSharing } from './structuralSharing'
export {
functionalUpdate,
hasKeys,
replaceEqualDeep,
isPlainObject,
isPlainArray,
deepEqual,
createControlledPromise,
isModuleNotFoundError,
DEFAULT_PROTOCOL_ALLOWLIST,
escapeHtml,
isDangerousProtocol,
buildDevStylesUrl,
} from './utils'
export type {
NoInfer,
IsAny,
PickAsRequired,
PickRequired,
PickOptional,
WithoutEmpty,
Expand,
DeepPartial,
MakeDifferenceOptional,
IsUnion,
IsNonEmptyObject,
Assign,
IntersectAssign,
Timeout,
Updater,
NonNullableUpdater,
StringLiteral,
ThrowOrOptional,
ThrowConstraint,
ControlledPromise,
ExtractObjects,
PartialMergeAllObject,
MergeAllPrimitive,
ExtractPrimitives,
PartialMergeAll,
Constrain,
ConstrainLiteral,
UnionToIntersection,
MergeAllObjects,
MergeAll,
ValidateJSON,
StrictOrFrom,
LooseReturnType,
LooseAsyncReturnType,
Awaitable,
} from './utils'
export type {
StandardSchemaValidatorProps,
StandardSchemaValidator,
AnyStandardSchemaValidator,
StandardSchemaValidatorTypes,
AnyStandardSchemaValidateSuccess,
AnyStandardSchemaValidateFailure,
AnyStandardSchemaValidateIssue,
AnyStandardSchemaValidateInput,
AnyStandardSchemaValidate,
ValidatorObj,
AnyValidatorObj,
ValidatorAdapter,
AnyValidatorAdapter,
AnyValidatorFn,
ValidatorFn,
Validator,
AnyValidator,
AnySchema,
DefaultValidator,
ResolveSearchValidatorInputFn,
ResolveSearchValidatorInput,
ResolveValidatorInputFn,
ResolveValidatorInput,
ResolveValidatorOutputFn,
ResolveValidatorOutput,
} from './validators'
export type {
UseRouteContextBaseOptions,
UseRouteContextOptions,
UseRouteContextResult,
} from './useRouteContext'
export type { UseSearchResult, ResolveUseSearch } from './useSearch'
export type { UseParamsResult, ResolveUseParams } from './useParams'
export type { UseNavigateResult } from './useNavigate'
export type { UseLoaderDepsResult, ResolveUseLoaderDeps } from './useLoaderDeps'
export type { UseLoaderDataResult, ResolveUseLoaderData } from './useLoaderData'
export type {
Redirect,
RedirectOptions,
RedirectOptionsRoute,
RedirectFnRoute,
ResolvedRedirect,
AnyRedirect,
} from './redirect'
export {
redirect,
isRedirect,
isResolvedRedirect,
parseRedirect,
} from './redirect'
export type { NotFoundError } from './not-found'
export { isNotFound, notFound } from './not-found'
export {
defaultGetScrollRestorationKey,
getElementScrollRestorationEntry,
storageKey,
scrollRestorationCache,
setupScrollRestoration,
} from './scroll-restoration'
export { handleHashScroll } from './hash-scroll'
export type {
ScrollRestorationOptions,
ScrollRestorationEntry,
} from './scroll-restoration'
export type {
ValidateFromPath,
ValidateToPath,
ValidateSearch,
ValidateParams,
InferFrom,
InferTo,
InferMaskTo,
InferMaskFrom,
ValidateNavigateOptions,
ValidateNavigateOptionsArray,
ValidateRedirectOptions,
ValidateRedirectOptionsArray,
ValidateId,
InferStrict,
InferShouldThrow,
InferSelected,
ValidateUseSearchResult,
ValidateUseParamsResult,
} from './typePrimitives'
export type {
AnySerializationAdapter,
SerializationAdapter,
ValidateSerializableInput,
SerializerExtensions,
ValidateSerializable,
RegisteredSerializableInput,
SerializableExtensions,
DefaultSerializable,
Serializable,
TSR_SERIALIZABLE,
TsrSerializable,
SerializationError,
} from './ssr/serializer/transformer'
export {
createSerializationAdapter,
makeSerovalPlugin,
makeSsrSerovalPlugin,
} from './ssr/serializer/transformer'
export { defaultSerovalPlugins } from './ssr/serializer/seroval-plugins'
export {
RawStream,
createRawStreamRPCPlugin,
createRawStreamDeserializePlugin,
} from './ssr/serializer/RawStream'
export type {
OnRawStreamCallback,
RawStreamHint,
RawStreamOptions,
} from './ssr/serializer/RawStream'
export { composeRewrites, executeRewriteInput } from './rewrite'
export type { LocationRewrite, LocationRewriteFunction } from './router'
@@ -0,0 +1,34 @@
//#region src/utils/http-status.d.ts
/**
* @module
* HTTP Status utility.
*/
export type InfoStatusCode = 100 | 101 | 102 | 103;
export type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
export type DeprecatedStatusCode = 305 | 306;
export type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
export type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
export type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
/**
* `UnofficialStatusCode` can be used to specify an unofficial status code.
* @example
*
* ```ts
* app.get('/unknown', (c) => {
* return c.text("Unknown Error", 520 as UnofficialStatusCode)
* })
* ```
*/
export type UnofficialStatusCode = -1;
/**
* @deprecated
* Use `UnofficialStatusCode` instead.
*/
export type UnOfficalStatusCode = UnofficialStatusCode;
/**
* If you want to use an unofficial status, use `UnofficialStatusCode`.
*/
export type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
export type ContentlessStatusCode = 101 | 204 | 205 | 304;
export type ContentfulStatusCode = Exclude<StatusCode, ContentlessStatusCode>;
//#endregion
@@ -0,0 +1,335 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
let fs = require("fs");
let path = require("path");
let url = require("url");
let fdir = require("fdir");
let picomatch = require("picomatch");
picomatch = __toESM(picomatch, 1);
//#region src/utils.ts
const isReadonlyArray = Array.isArray;
const BACKSLASHES = /\\/g;
const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
const isWin = process.platform === "win32";
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
function getPartialMatcher(patterns, options = {}) {
const patternsCount = patterns.length;
const patternsParts = Array(patternsCount);
const matchers = Array(patternsCount);
let i, j;
for (i = 0; i < patternsCount; i++) {
const parts = splitPattern(patterns[i]);
patternsParts[i] = parts;
const partsCount = parts.length;
const partMatchers = Array(partsCount);
for (j = 0; j < partsCount; j++) partMatchers[j] = (0, picomatch.default)(parts[j], options);
matchers[i] = partMatchers;
}
return (input) => {
const inputParts = input.split("/");
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
for (i = 0; i < patternsCount; i++) {
const patternParts = patternsParts[i];
const matcher = matchers[i];
const inputPatternCount = inputParts.length;
const minParts = Math.min(inputPatternCount, patternParts.length);
j = 0;
while (j < minParts) {
const part = patternParts[j];
if (part.includes("/")) return true;
if (!matcher[j](inputParts[j])) break;
if (!options.noglobstar && part === "**") return true;
j++;
}
if (j === inputPatternCount) return true;
}
return false;
};
}
/* node:coverage ignore next 2 */
const WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
const isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
function buildFormat(cwd, root, absolute) {
if (cwd === root || root.startsWith(`${cwd}/`)) {
if (absolute) {
const start = cwd.length + +!isRoot(cwd);
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
}
const prefix = root.slice(cwd.length + 1);
if (prefix) return (p, isDir) => {
if (p === ".") return prefix;
const result = `${prefix}/${p}`;
return isDir ? result.slice(0, -1) : result;
};
return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
}
if (absolute) return (p) => path.posix.relative(cwd, p) || ".";
return (p) => path.posix.relative(cwd, `${root}/${p}`) || ".";
}
function buildRelative(cwd, root) {
if (root.startsWith(`${cwd}/`)) {
const prefix = root.slice(cwd.length + 1);
return (p) => `${prefix}/${p}`;
}
return (p) => {
const result = path.posix.relative(cwd, `${root}/${p}`);
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
};
}
function ensureNonDriveRelativePath(path$1) {
return path$1.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
}
const splitPatternOptions = { parts: true };
function splitPattern(path$2) {
var _result$parts;
const result = picomatch.default.scan(path$2, splitPatternOptions);
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$2];
}
const ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
function convertPosixPathToPattern(path$3) {
return escapePosixPath(path$3);
}
function convertWin32PathToPattern(path$4) {
return escapeWin32Path(path$4).replace(ESCAPED_WIN32_BACKSLASHES, "/");
}
/**
* Converts a path to a pattern depending on the platform.
* Identical to {@link escapePath} on POSIX systems.
* @see {@link https://superchupu.dev/tinyglobby/documentation#convertPathToPattern}
*/
/* node:coverage ignore next 3 */
const convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern;
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
const escapePosixPath = (path$5) => path$5.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
const escapeWin32Path = (path$6) => path$6.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
/**
* Escapes a path's special characters depending on the platform.
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
*/
/* node:coverage ignore next */
const escapePath = isWin ? escapeWin32Path : escapePosixPath;
/**
* Checks if a pattern has dynamic parts.
*
* Has a few minor differences with [`fast-glob`](https://github.com/mrmlnc/fast-glob) for better accuracy:
*
* - Doesn't necessarily return `false` on patterns that include `\`.
* - Returns `true` if the pattern includes parentheses, regardless of them representing one single pattern or not.
* - Returns `true` for unfinished glob extensions i.e. `(h`, `+(h`.
* - Returns `true` for unfinished brace expansions as long as they include `,` or `..`.
*
* @see {@link https://superchupu.dev/tinyglobby/documentation#isDynamicPattern}
*/
function isDynamicPattern(pattern, options) {
if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;
const scan = picomatch.default.scan(pattern);
return scan.isGlob || scan.negated;
}
function log(...tasks) {
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
}
function ensureStringArray(value) {
return typeof value === "string" ? [value] : value !== null && value !== void 0 ? value : [];
}
//#endregion
//#region src/patterns.ts
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
function normalizePattern(pattern, opts, props, isIgnore) {
var _PARENT_DIRECTORY$exe;
const cwd = opts.cwd;
let result = pattern;
if (pattern[pattern.length - 1] === "/") result = pattern.slice(0, -1);
if (result[result.length - 1] !== "*" && opts.expandDirectories) result += "/**";
const escapedCwd = escapePath(cwd);
result = (0, path.isAbsolute)(result.replace(ESCAPING_BACKSLASHES, "")) ? path.posix.relative(escapedCwd, result) : path.posix.normalize(result);
const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0];
const parts = splitPattern(result);
if (parentDir) {
const n = (parentDir.length + 1) / 3;
let i = 0;
const cwdParts = escapedCwd.split("/");
while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
i++;
}
const potentialRoot = path.posix.join(cwd, parentDir.slice(i * 3));
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
props.root = ensureNonDriveRelativePath(potentialRoot);
props.depthOffset = -n + i;
}
}
if (!isIgnore && props.depthOffset >= 0) {
var _props$commonPath;
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
const newCommonPath = [];
const length = Math.min(props.commonPath.length, parts.length);
for (let i = 0; i < length; i++) {
const part = parts[i];
if (part === "**" && !parts[i + 1]) {
newCommonPath.pop();
break;
}
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
newCommonPath.push(part);
}
props.depthOffset = newCommonPath.length;
props.commonPath = newCommonPath;
props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd);
}
return result;
}
function processPatterns(options, patterns, props) {
const matchPatterns = [];
const ignorePatterns = [];
for (const pattern of options.ignore) {
if (!pattern) continue;
if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, options, props, true));
}
for (const pattern of patterns) {
if (!pattern) continue;
if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, options, props, false));
else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
}
return {
match: matchPatterns,
ignore: ignorePatterns
};
}
//#endregion
//#region src/crawler.ts
function buildCrawler(options, patterns) {
const cwd = options.cwd;
const props = {
root: cwd,
depthOffset: 0
};
const processed = processPatterns(options, patterns, props);
if (options.debug) log("internal processing patterns:", processed);
const { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options;
const root = props.root.replace(BACKSLASHES, "");
const matchOptions = {
dot,
nobrace: options.braceExpansion === false,
nocase: !caseSensitiveMatch,
noextglob: options.extglob === false,
noglobstar: options.globstar === false,
posix: true
};
const matcher = (0, picomatch.default)(processed.match, matchOptions);
const ignore = (0, picomatch.default)(processed.ignore, matchOptions);
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
const format = buildFormat(cwd, root, absolute);
const excludeFormatter = absolute ? format : buildFormat(cwd, root, true);
const excludePredicate = (_, p) => {
const relativePath = excludeFormatter(p, true);
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
};
let maxDepth;
if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
const crawler = new fdir.fdir({
filters: [debug ? (p, isDirectory) => {
const path = format(p, isDirectory);
const matches = matcher(path) && !ignore(path);
if (matches) log(`matched ${path}`);
return matches;
} : (p, isDirectory) => {
const path = format(p, isDirectory);
return matcher(path) && !ignore(path);
}],
exclude: debug ? (_, p) => {
const skipped = excludePredicate(_, p);
log(`${skipped ? "skipped" : "crawling"} ${p}`);
return skipped;
} : excludePredicate,
fs: options.fs,
pathSeparator: "/",
relativePaths: !absolute,
resolvePaths: absolute,
includeBasePath: absolute,
resolveSymlinks: followSymbolicLinks,
excludeSymlinks: !followSymbolicLinks,
excludeFiles: onlyDirectories,
includeDirs: onlyDirectories || !options.onlyFiles,
maxDepth,
signal: options.signal
}).crawl(root);
if (options.debug) log("internal properties:", {
...props,
root
});
return [crawler, cwd !== root && !absolute && buildRelative(cwd, root)];
}
//#endregion
//#region src/index.ts
function formatPaths(paths, mapper) {
if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]);
return paths;
}
const defaultOptions = {
caseSensitiveMatch: true,
debug: !!process.env.TINYGLOBBY_DEBUG,
expandDirectories: true,
followSymbolicLinks: true,
onlyFiles: true
};
function getOptions(options) {
const opts = Object.assign({}, options);
for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
opts.cwd = (opts.cwd instanceof URL ? (0, url.fileURLToPath)(opts.cwd) : (0, path.resolve)(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
opts.ignore = ensureStringArray(opts.ignore);
opts.fs && (opts.fs = {
readdir: opts.fs.readdir || fs.readdir,
readdirSync: opts.fs.readdirSync || fs.readdirSync,
realpath: opts.fs.realpath || fs.realpath,
realpathSync: opts.fs.realpathSync || fs.realpathSync,
stat: opts.fs.stat || fs.stat,
statSync: opts.fs.statSync || fs.statSync
});
if (opts.debug) log("globbing with options:", opts);
return opts;
}
function getCrawler(globInput, inputOptions = {}) {
var _ref;
if (globInput && (inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
const isModern = isReadonlyArray(globInput) || typeof globInput === "string";
const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*");
const options = getOptions(isModern ? inputOptions : globInput);
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
}
async function glob(globInput, options) {
const [crawler, relative] = getCrawler(globInput, options);
return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
}
function globSync(globInput, options) {
const [crawler, relative] = getCrawler(globInput, options);
return crawler ? formatPaths(crawler.sync(), relative) : [];
}
//#endregion
exports.convertPathToPattern = convertPathToPattern;
exports.escapePath = escapePath;
exports.glob = glob;
exports.globSync = globSync;
exports.isDynamicPattern = isDynamicPattern;
@@ -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 Pointer = createLucideIcon("Pointer", [
["path", { d: "M22 14a8 8 0 0 1-8 8", key: "56vcr3" }],
["path", { d: "M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2", key: "1agjmk" }],
["path", { d: "M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1", key: "wdbh2u" }],
["path", { d: "M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10", key: "1ibuk9" }],
[
"path",
{
d: "M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",
key: "g6ys72"
}
]
]);
export { Pointer as default };
//# sourceMappingURL=pointer.js.map
@@ -0,0 +1,374 @@
import { n as __toESM, t as require_binding } from "./binding-TuFFIE_J.mjs";
import { o as logMultipleWatcherOption } from "./logs-ZGEh6uhb.mjs";
import { v as LOG_LEVEL_WARN } from "./bindingify-input-options-XPJLJOD0.mjs";
import { t as arraify } from "./misc-CoQm4NHO.mjs";
import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-CtPvmZgJ.mjs";
import { t as aggregateBindingErrorsIntoJsError } from "./error-BHRSI0R7.mjs";
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
/**
* This is not the set of all possible signals.
*
* It IS, however, the set of all signals that trigger
* an exit on either Linux or BSD systems. Linux is a
* superset of the signal names supported on BSD, and
* the unknown signals just fail to register, so we can
* catch that easily enough.
*
* Windows signals are a different set, since there are
* signals that terminate Windows processes, but don't
* terminate (or don't even exist) on Posix systems.
*
* Don't bother with SIGKILL. It's uncatchable, which
* means that we can't fire any callbacks anyway.
*
* If a user does happen to register a handler on a non-
* fatal signal like SIGWINCH or something, and then
* exit, it'll end up firing `process.emit('exit')`, so
* the handler will be fired anyway.
*
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
* artificially, inherently leave the process in a
* state from which it is not safe to try and enter JS
* listeners.
*/
const signals = [];
signals.push("SIGHUP", "SIGINT", "SIGTERM");
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
//#endregion
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
const kExitEmitter = Symbol.for("signal-exit emitter");
const global = globalThis;
const ObjectDefineProperty = Object.defineProperty.bind(Object);
var Emitter = class {
emitted = {
afterExit: false,
exit: false
};
listeners = {
afterExit: [],
exit: []
};
count = 0;
id = Math.random();
constructor() {
if (global[kExitEmitter]) return global[kExitEmitter];
ObjectDefineProperty(global, kExitEmitter, {
value: this,
writable: false,
enumerable: false,
configurable: false
});
}
on(ev, fn) {
this.listeners[ev].push(fn);
}
removeListener(ev, fn) {
const list = this.listeners[ev];
const i = list.indexOf(fn);
/* c8 ignore start */
if (i === -1) return;
/* c8 ignore stop */
if (i === 0 && list.length === 1) list.length = 0;
else list.splice(i, 1);
}
emit(ev, code, signal) {
if (this.emitted[ev]) return false;
this.emitted[ev] = true;
let ret = false;
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
return ret;
}
};
var SignalExitBase = class {};
const signalExitWrap = (handler) => {
return {
onExit(cb, opts) {
return handler.onExit(cb, opts);
},
load() {
return handler.load();
},
unload() {
return handler.unload();
}
};
};
var SignalExitFallback = class extends SignalExitBase {
onExit() {
return () => {};
}
load() {}
unload() {}
};
var SignalExit = class extends SignalExitBase {
/* c8 ignore start */
#hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
/* c8 ignore stop */
#emitter = new Emitter();
#process;
#originalProcessEmit;
#originalProcessReallyExit;
#sigListeners = {};
#loaded = false;
constructor(process) {
super();
this.#process = process;
this.#sigListeners = {};
for (const sig of signals) this.#sigListeners[sig] = () => {
const listeners = this.#process.listeners(sig);
let { count } = this.#emitter;
/* c8 ignore start */
const p = process;
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
/* c8 ignore stop */
if (listeners.length === count) {
this.unload();
const ret = this.#emitter.emit("exit", null, sig);
/* c8 ignore start */
const s = sig === "SIGHUP" ? this.#hupSig : sig;
if (!ret) process.kill(process.pid, s);
}
};
this.#originalProcessReallyExit = process.reallyExit;
this.#originalProcessEmit = process.emit;
}
onExit(cb, opts) {
/* c8 ignore start */
if (!processOk(this.#process)) return () => {};
/* c8 ignore stop */
if (this.#loaded === false) this.load();
const ev = opts?.alwaysLast ? "afterExit" : "exit";
this.#emitter.on(ev, cb);
return () => {
this.#emitter.removeListener(ev, cb);
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
};
}
load() {
if (this.#loaded) return;
this.#loaded = true;
this.#emitter.count += 1;
for (const sig of signals) try {
const fn = this.#sigListeners[sig];
if (fn) this.#process.on(sig, fn);
} catch (_) {}
this.#process.emit = (ev, ...a) => {
return this.#processEmit(ev, ...a);
};
this.#process.reallyExit = (code) => {
return this.#processReallyExit(code);
};
}
unload() {
if (!this.#loaded) return;
this.#loaded = false;
signals.forEach((sig) => {
const listener = this.#sigListeners[sig];
/* c8 ignore start */
if (!listener) throw new Error("Listener not defined for signal: " + sig);
/* c8 ignore stop */
try {
this.#process.removeListener(sig, listener);
} catch (_) {}
/* c8 ignore stop */
});
this.#process.emit = this.#originalProcessEmit;
this.#process.reallyExit = this.#originalProcessReallyExit;
this.#emitter.count -= 1;
}
#processReallyExit(code) {
/* c8 ignore start */
if (!processOk(this.#process)) return 0;
this.#process.exitCode = code || 0;
/* c8 ignore stop */
this.#emitter.emit("exit", this.#process.exitCode, null);
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
}
#processEmit(ev, ...args) {
const og = this.#originalProcessEmit;
if (ev === "exit" && processOk(this.#process)) {
if (typeof args[0] === "number") this.#process.exitCode = args[0];
/* c8 ignore start */
const ret = og.call(this.#process, ev, ...args);
/* c8 ignore start */
this.#emitter.emit("exit", this.#process.exitCode, null);
/* c8 ignore stop */
return ret;
} else return og.call(this.#process, ev, ...args);
}
};
const process$1 = globalThis.process;
const { onExit: onExit$1, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
//#endregion
//#region src/utils/signal-exit.ts
function onExit(...args) {
if (typeof process === "object" && process.versions.webcontainer) {
process.on("exit", (code) => {
args[0](code, null);
});
return;
}
onExit$1(...args);
}
//#endregion
//#region src/api/watch/watch-emitter.ts
var WatcherEmitter = class {
listeners = /* @__PURE__ */ new Map();
on(event, listener) {
const listeners = this.listeners.get(event);
if (listeners) listeners.push(listener);
else this.listeners.set(event, [listener]);
return this;
}
off(event, listener) {
const listeners = this.listeners.get(event);
if (listeners) {
const index = listeners.indexOf(listener);
if (index !== -1) listeners.splice(index, 1);
}
return this;
}
clear(event) {
this.listeners.delete(event);
}
/** Async emit — sequential dispatch so side effects from earlier handlers
* (e.g. `event.result.close()` triggering `closeBundle`) are visible to later handlers. */
async emit(event, ...args) {
const handlers = this.listeners.get(event);
if (handlers?.length) for (const h of handlers) await h(...args);
}
async close() {}
};
//#endregion
//#region src/api/watch/watcher.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
function createEventCallback(emitter) {
return async (event) => {
switch (event.eventKind()) {
case "event": {
const code = event.bundleEventKind();
if (code === "BUNDLE_END") {
const { duration, output, result } = event.bundleEndData();
await emitter.emit("event", {
code: "BUNDLE_END",
duration,
output: [output],
result
});
} else if (code === "ERROR") {
const data = event.bundleErrorData();
await emitter.emit("event", {
code: "ERROR",
error: aggregateBindingErrorsIntoJsError(data.error),
result: data.result
});
} else await emitter.emit("event", { code });
break;
}
case "change": {
const { path, kind } = event.watchChangeData();
await emitter.emit("change", path, { event: kind });
break;
}
case "restart":
await emitter.emit("restart");
break;
case "close":
await emitter.emit("close");
break;
}
};
}
var Watcher = class {
closed;
inner;
emitter;
stopWorkers;
constructor(emitter, inner, stopWorkers) {
this.closed = false;
this.inner = inner;
this.emitter = emitter;
const originClose = emitter.close.bind(emitter);
emitter.close = async () => {
await this.close();
originClose();
};
this.stopWorkers = stopWorkers;
process.nextTick(() => this.run());
}
async close() {
if (this.closed) return;
this.closed = true;
for (const stop of this.stopWorkers) await stop?.();
await this.inner.close();
(0, import_binding.shutdownAsyncRuntime)();
}
async run() {
await this.inner.run();
this.inner.waitForClose();
}
};
async function createWatcher(emitter, input) {
const options = arraify(input);
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
})).flat());
warnMultiplePollingOptions(bundlerOptions);
const callback = createEventCallback(emitter);
new Watcher(emitter, new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), callback), bundlerOptions.map((option) => option.stopWorkers));
}
function warnMultiplePollingOptions(bundlerOptions) {
let found = false;
for (const option of bundlerOptions) {
const watch = option.inputOptions.watch;
const watcher = watch && typeof watch === "object" ? watch.watcher ?? watch.notify : void 0;
if (watcher && (watcher.usePolling != null || watcher.pollInterval != null)) {
if (found) {
option.onLog(LOG_LEVEL_WARN, logMultipleWatcherOption());
return;
}
found = true;
}
}
}
//#endregion
//#region src/api/watch/index.ts
/**
* The API compatible with Rollup's `watch` function.
*
* This function will rebuild the bundle when it detects that the individual modules have changed on disk.
*
* Note that when using this function, it is your responsibility to call `event.result.close()` in response to the `BUNDLE_END` event to avoid resource leaks.
*
* @param input The watch options object or the list of them.
* @returns A watcher object.
*
* @example
* ```js
* import { watch } from 'rolldown';
*
* const watcher = watch({ /* ... *\/ });
* watcher.on('event', (event) => {
* if (event.code === 'BUNDLE_END') {
* console.log(event.duration);
* event.result.close();
* }
* });
*
* // Stop watching
* watcher.close();
* ```
*
* @experimental
* @category Programmatic APIs
*/
function watch(input) {
const emitter = new WatcherEmitter();
createWatcher(emitter, input);
return emitter;
}
//#endregion
export { onExit as n, watch as t };
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_SC","2":"FD"},B:{"2":"_J"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_c"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:7,C:"EOT - Embedded OpenType fonts",D:true};
@@ -0,0 +1,32 @@
'use strict';
var _const = require('../../data/const.cjs');
var regexMatcher = ({
regexName,
regexMatch,
token
}) => {
const charClassBases = {
alphaLower: 26,
alphaUpper: 26,
alpha: 52,
alphanumeric: 62,
digits: 10,
symbols: 33
};
if (regexName in charClassBases) {
return charClassBases[regexName] ** token.length;
}
// TODO add more regex types for example special dates like 09.11
switch (regexName) {
case 'recentYear':
// conservative estimate of year space: num years from REFERENCE_YEAR.
// if year is close to REFERENCE_YEAR, estimate a year space of MIN_YEAR_SPACE.
return Math.max(Math.abs(parseInt(regexMatch[0], 10) - _const.REFERENCE_YEAR), _const.MIN_YEAR_SPACE);
}
return 0;
};
module.exports = regexMatcher;
//# sourceMappingURL=scoring.cjs.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_kO","2":"_g","132":"_pG _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_dD","2":"F","4":"_iK"},G:{"260":"_M"},H:{"2":"1D"},I:{"1":"_SB","2":"_m"},J:{"1":"_B"},K:{"1":"_CB","2":"A"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"Audio element",D:true};
@@ -0,0 +1,125 @@
# make-dir [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
> Make a directory and its parents if needed - Think `mkdir -p`
## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
- Promise API *(Async/await ready!)*
- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
- 100% test coverage
- CI-tested on macOS, Linux, and Windows
- Actively maintained
- Doesn't bundle a CLI
- Uses the native `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs)
## Install
```
$ npm install make-dir
```
## Usage
```
$ pwd
/Users/sindresorhus/fun
$ tree
.
```
```js
const makeDir = require('make-dir');
(async () => {
const path = await makeDir('unicorn/rainbow/cake');
console.log(path);
//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
})();
```
```
$ tree
.
└── unicorn
└── rainbow
└── cake
```
Multiple directories:
```js
const makeDir = require('make-dir');
(async () => {
const paths = await Promise.all([
makeDir('unicorn/rainbow'),
makeDir('foo/bar')
]);
console.log(paths);
/*
[
'/Users/sindresorhus/fun/unicorn/rainbow',
'/Users/sindresorhus/fun/foo/bar'
]
*/
})();
```
## API
### makeDir(path, options?)
Returns a `Promise` for the path to the created directory.
### makeDir.sync(path, options?)
Returns the path to the created directory.
#### path
Type: `string`
Directory to create.
#### options
Type: `object`
##### mode
Type: `integer`\
Default: `0o777`
Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
##### fs
Type: `object`\
Default: `require('fs')`
Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
## Related
- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
- [del](https://github.com/sindresorhus/del) - Delete files and directories
- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
- [cpy](https://github.com/sindresorhus/cpy) - Copy files
- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
- [move-file](https://github.com/sindresorhus/move-file) - Move a file
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-make-dir?utm_source=npm-make-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudUpload = createLucideIcon("CloudUpload", [
["path", { d: "M12 13v8", key: "1l5pq0" }],
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
]);
export { CloudUpload as default };
//# sourceMappingURL=cloud-upload.js.map
@@ -0,0 +1,7 @@
/**
* Converts an environment variable value to be appropriate for the current OS.
* @param originalValue Original value of the env variable
* @param originalName Original name of the env variable
* @returns Converted value
*/
export declare function varValueConvert(originalValue: string, originalName: string): string;
@@ -0,0 +1,18 @@
import { JSONRPCMessage } from '../types.js';
export declare const STDIO_DEFAULT_MAX_BUFFER_SIZE: number;
/**
* Buffers a continuous stdio stream into discrete JSON-RPC messages.
*/
export declare class ReadBuffer {
private _buffer?;
private _maxBufferSize;
constructor(options?: {
maxBufferSize?: number;
});
append(chunk: Buffer): void;
readMessage(): JSONRPCMessage | null;
clear(): void;
}
export declare function deserializeMessage(line: string): JSONRPCMessage;
export declare function serializeMessage(message: JSONRPCMessage): string;
//# sourceMappingURL=stdio.d.ts.map
@@ -0,0 +1,152 @@
/**
* @fileoverview Rule to disallow negating the left operand of relational operators
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether the given operator is `in` or `instanceof`
* @param {string} op The operator type to check.
* @returns {boolean} `true` if the operator is `in` or `instanceof`
*/
function isInOrInstanceOfOperator(op) {
return op === "in" || op === "instanceof";
}
/**
* Checks whether the given operator is an ordering relational operator or not.
* @param {string} op The operator type to check.
* @returns {boolean} `true` if the operator is an ordering relational operator.
*/
function isOrderingRelationalOperator(op) {
return op === "<" || op === ">" || op === ">=" || op === "<=";
}
/**
* Checks whether the given node is a logical negation expression or not.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node is a logical negation expression.
*/
function isNegation(node) {
return node.type === "UnaryExpression" && node.operator === "!";
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
enforceForOrderingRelations: false,
},
],
docs: {
description:
"Disallow negating the left operand of relational operators",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-unsafe-negation",
},
hasSuggestions: true,
schema: [
{
type: "object",
properties: {
enforceForOrderingRelations: {
type: "boolean",
},
},
additionalProperties: false,
},
],
fixable: null,
messages: {
unexpected:
"Unexpected negating the left operand of '{{operator}}' operator.",
suggestNegatedExpression:
"Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.",
suggestParenthesisedNegation:
"Wrap negation in '()' to make the intention explicit. This preserves the current behavior.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const [{ enforceForOrderingRelations }] = context.options;
return {
BinaryExpression(node) {
const operator = node.operator;
const orderingRelationRuleApplies =
enforceForOrderingRelations &&
isOrderingRelationalOperator(operator);
if (
(isInOrInstanceOfOperator(operator) ||
orderingRelationRuleApplies) &&
isNegation(node.left) &&
!astUtils.isParenthesised(sourceCode, node.left)
) {
context.report({
node,
loc: node.left.loc,
messageId: "unexpected",
data: { operator },
suggest: [
{
messageId: "suggestNegatedExpression",
data: { operator },
fix(fixer) {
const negationToken =
sourceCode.getFirstToken(node.left);
const fixRange = [
negationToken.range[1],
node.range[1],
];
const text = sourceCode.text.slice(
fixRange[0],
fixRange[1],
);
return fixer.replaceTextRange(
fixRange,
`(${text})`,
);
},
},
{
messageId: "suggestParenthesisedNegation",
fix(fixer) {
return fixer.replaceText(
node.left,
`(${sourceCode.getText(node.left)})`,
);
},
},
],
});
}
},
};
},
};
@@ -0,0 +1 @@
module.exports={C:{"49":0.01119,"115":0.0373,"120":0.05222,"121":0.11563,"127":0.00373,"140":0.00746,"149":0.00373,"150":0.00373,"153":0.02611,"154":0.22753,"155":0.40284,"156":0.45506,"157":0.00746,"158":0.00373,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 128 129 130 131 132 133 134 135 136 137 138 139 141 142 143 144 145 146 147 148 151 152 159 160 3.5","3.6":0.00373},D:{"69":0.00373,"70":0.00373,"74":0.01492,"76":0.00373,"80":0.00746,"87":0.00373,"90":0.00373,"92":0.00746,"97":0.00746,"99":0.00373,"101":0.00746,"102":0.00373,"103":0.02984,"104":0.00746,"105":0.01865,"106":0.01119,"107":0.01492,"108":0.01119,"109":0.38419,"110":0.00746,"111":0.01492,"112":0.01119,"114":0.01119,"115":0.00373,"116":0.01865,"117":0.01119,"118":0.36554,"119":0.10817,"120":0.12309,"121":0.01119,"122":0.00373,"123":0.00746,"124":0.01119,"125":0.02611,"127":0.00746,"128":0.00373,"130":0.04103,"131":0.04476,"132":0.00746,"133":0.05968,"134":0.0746,"135":0.06341,"136":0.05968,"137":0.05595,"138":0.10071,"139":0.05595,"140":0.08206,"141":0.08952,"142":0.2611,"143":0.00746,"144":0.02984,"145":0.01119,"146":0.0746,"147":0.02238,"148":0.10817,"149":0.02984,"150":0.24991,"151":1.23836,"152":8.36266,"153":3.37565,"154":1.10408,"155":0.05595,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 71 72 73 75 77 78 79 81 83 84 85 86 88 89 91 93 94 95 96 98 100 113 126 129 156 157"},F:{"38":0.00373,"62":0.00746,"86":0.00373,"95":0.04103,"99":0.00373,"100":0.22753,"101":0.23126,"102":0.04103,"133":0.01492,"134":0.05968,"135":1.70088,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 87 88 89 90 91 92 93 94 96 97 98 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"16":0.00373,"18":0.00373,"84":0.00373,"90":0.00746,"92":0.03357,"107":0.00373,"109":0.43268,"112":0.00373,"115":0.01492,"119":0.05595,"120":0.06341,"122":0.01119,"126":0.00373,"132":0.00746,"134":0.00373,"138":0.01119,"139":0.00746,"140":0.00373,"141":0.00373,"142":0.00746,"145":0.00746,"146":0.00746,"147":0.01865,"148":0.06341,"149":0.03357,"150":0.02238,"151":0.26856,"152":1.80532,"153":2.39466,"154":0.53712,_:"12 13 14 15 17 79 80 81 83 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 108 110 111 113 114 116 117 118 121 123 124 125 127 128 129 130 131 133 135 136 137 143 144"},E:{_:"4 5 6 7 8 9 10 11 12 13 14 15 27 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.4 17.5 18.0 18.1 18.2 18.3 18.4 26.1 26.4 27.1 27.2 TP","15.6":0.00746,"16.6":0.00746,"17.6":0.02984,"18.5-18.7":0.00746,"26.0":0.02238,"26.2":0.00373,"26.3":0.00373,"26.5":0.01865,"26.6":0.0746},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00083,"5.0-5.1":0.00083,"6.0-6.1":0,"7.0-7.1":0.00167,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00834,"11.0-11.2":0.00083,"11.3-11.4":0.00167,"12.0-12.1":0,"12.2-12.5":0.02168,"13.0-13.1":0,"13.2":0.00417,"13.3":0,"13.4-13.7":0.00083,"14.0-14.4":0.00334,"14.5-14.8":0.005,"15.0-15.1":0.005,"15.2-15.3":0.00334,"15.4":0.00417,"15.5":0.005,"15.6-15.8":0.10841,"16.0":0.00834,"16.1":0.01501,"16.2":0.00834,"16.3":0.01835,"16.4":0.00417,"16.5":0.00667,"16.6-16.7":0.15094,"17.0":0.00584,"17.1":0.00834,"17.2":0.00834,"17.3":0.01251,"17.4":0.01751,"17.5":0.03419,"17.6-17.7":0.08839,"18.0":0.01835,"18.1":0.03669,"18.2":0.05003,"18.3":0.08673,"18.4":0.0542,"18.5-18.7":1.11994,"26.0":0.0542,"26.1":0.05504,"26.2":0.14343,"26.3":0.15511,"26.4":0.11341,"26.5":0.75969,"26.6":4.68741,"27.0":0.35942,"27.1":0,"27.2":0.00917},P:{"4":0.02839,"22":0.03785,"24":0.05678,"25":0.00946,"26":0.00946,"27":0.01893,"28":0.11355,"29":0.23657,"30":1.88311,_:"20 21 23 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0","5.0-5.4":0.03785,"7.2-7.4":0.11355,"17.0":0.00946,"19.0":0.00946},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":2.93436,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":57.29993},R:{_:"0"},M:{"0":0.23199},Q:{_:"14.9"},O:{"0":0.54549},H:{all:0}};
@@ -0,0 +1,193 @@
//#region src/utils/accept.ts
const isWhitespace = (char) => char === 32 || char === 9 || char === 10 || char === 13;
const consumeWhitespace = (acceptHeader, startIndex) => {
while (startIndex < acceptHeader.length) {
if (!isWhitespace(acceptHeader.charCodeAt(startIndex))) break;
startIndex++;
}
return startIndex;
};
const ignoreTrailingWhitespace = (acceptHeader, startIndex) => {
while (startIndex > 0) {
if (!isWhitespace(acceptHeader.charCodeAt(startIndex - 1))) break;
startIndex--;
}
return startIndex;
};
const skipInvalidParam = (acceptHeader, startIndex) => {
while (startIndex < acceptHeader.length) {
const char = acceptHeader.charCodeAt(startIndex);
if (char === 59) return [startIndex + 1, true];
if (char === 44) return [startIndex + 1, false];
startIndex++;
}
return [startIndex, false];
};
const skipInvalidAcceptValue = (acceptHeader, startIndex) => {
let i = startIndex;
let inQuotes = false;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (inQuotes && char === 92) i++;
else if (char === 34) inQuotes = !inQuotes;
else if (!inQuotes && char === 44) return i + 1;
i++;
}
return i;
};
const getNextParam = (acceptHeader, startIndex) => {
startIndex = consumeWhitespace(acceptHeader, startIndex);
let i = startIndex;
let key;
let value;
let hasNext = false;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (char === 61) {
key = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i));
i++;
break;
}
if (char === 59) return [
i + 1,
void 0,
void 0,
true
];
if (char === 44) return [
i + 1,
void 0,
void 0,
false
];
i++;
}
if (key === void 0) return [
i,
void 0,
void 0,
false
];
i = consumeWhitespace(acceptHeader, i);
if (acceptHeader.charCodeAt(i) === 61) {
const skipResult = skipInvalidParam(acceptHeader, i + 1);
return [
skipResult[0],
key,
void 0,
skipResult[1]
];
}
let inQuotes = false;
const paramStartIndex = i;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (inQuotes && char === 92) i++;
else if (char === 34) {
if (inQuotes) {
let nextIndex = consumeWhitespace(acceptHeader, i + 1);
const nextChar = acceptHeader.charCodeAt(nextIndex);
if (nextIndex < acceptHeader.length && !(nextChar === 59 || nextChar === 44)) {
const skipResult = skipInvalidParam(acceptHeader, nextIndex);
return [
skipResult[0],
key,
void 0,
skipResult[1]
];
}
value = acceptHeader.slice(paramStartIndex + 1, i);
if (value.includes("\\")) value = value.replace(/\\(.)/g, "$1");
if (nextChar === 44) return [
nextIndex + 1,
key,
value,
false
];
if (nextChar === 59) {
hasNext = true;
nextIndex++;
}
i = nextIndex;
break;
}
inQuotes = true;
} else if (!inQuotes && (char === 59 || char === 44)) {
value = acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i));
if (char === 59) hasNext = true;
i++;
break;
}
i++;
}
return [
i,
key,
value ?? acceptHeader.slice(paramStartIndex, ignoreTrailingWhitespace(acceptHeader, i)),
hasNext
];
};
const getNextAcceptValue = (acceptHeader, startIndex) => {
const accept = {
type: "",
params: Object.create(null),
q: 1
};
startIndex = consumeWhitespace(acceptHeader, startIndex);
let i = startIndex;
while (i < acceptHeader.length) {
const char = acceptHeader.charCodeAt(i);
if (char === 59 || char === 44) {
accept.type = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, i));
i++;
if (char === 44) return [i, accept.type ? accept : void 0];
if (!accept.type) return [skipInvalidAcceptValue(acceptHeader, i), void 0];
break;
}
i++;
}
if (!accept.type) {
accept.type = acceptHeader.slice(startIndex, ignoreTrailingWhitespace(acceptHeader, acceptHeader.length));
return [acceptHeader.length, accept.type ? accept : void 0];
}
let param;
let value;
let hasNext;
while (i < acceptHeader.length) {
[i, param, value, hasNext] = getNextParam(acceptHeader, i);
if (param && value) accept.params[param] = value;
if (!hasNext) break;
}
return [i, accept];
};
const parseAccept = (acceptHeader) => {
if (!acceptHeader) return [];
const values = [];
let i = 0;
let accept;
let requiresSort = false;
let lastAccept;
while (i < acceptHeader.length) {
[i, accept] = getNextAcceptValue(acceptHeader, i);
if (accept) {
accept.q = parseQuality(accept.params.q ?? accept.params.Q);
values.push(accept);
if (lastAccept && lastAccept.q < accept.q) requiresSort = true;
lastAccept = accept;
}
}
if (requiresSort) values.sort((a, b) => b.q - a.q);
return values;
};
const parseQuality = (qVal) => {
if (qVal === void 0) return 1;
if (qVal === "") return 1;
if (qVal === "NaN") return 0;
const num = Number(qVal);
if (Number.isNaN(num)) return 1;
if (num < 0) return 0;
if (num > 1) return 1;
return num;
};
//#endregion
export { parseAccept };
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KA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addMonths.mjs";
function addYears(date, years) {
return addMonths(date, years * 12);
}
export {
addYears as default
};
@@ -0,0 +1,753 @@
flf2a$ 4 4 8 0 14 0 8256
Graceful-6x4 by Mikhael Goikhman, http://migo.n3.net/, 20/Jan/2002.
Why did I make this font? Most of the figlet fonts are ugly for my taste.
Chars ".", "'" or "|" are not as graceful as "(", ")", "/", "\" and "_".
Also most of the fonts unlike this one are either small or good, not both.
And finally, I wanted to have a strictly sized font, this one is 6x4.
I intended to create this elegant figlet font in 1996, but only in
January 2002 actually had the time to bring it to the working state. :)
Cyrillic letters are supported, maybe somewhen I will add hebrew latters.
To get a monospaced font 6x4, use "figlet -f graceful -m -1". Enjoy!
Permission is hereby given to modify this font, as long as the
modifier's name is added to this comment.
$$ @
$$ @
$$ @
$$ @@
_ @
/ \ @
\_/ @
(_) @@
_ _ @
(/(/ @
@
@@
_ _ @
/ )( \@
) (@
\_)(_/@@
____ @
/ (__)@
\__ \@
(__)_/@@
_ _ @
(// ) @
/ /_ @
(_/(/ @@
___ @
( _ \@
/ _ /@
\__\_)@@
_ @
(/ @
@
@@
_ @
/ ) @
( ( @
\_) @@
_ @
( \ @
) ) @
(_/ @@
@
(\/\/)@
) ( @
(/\/\)@@
_ @
( ) @
(_ _) @
(_) @@
@
_ @
( ) @
(/ @@
@
___ @
(___) @
@@
@
@
_ @
(_) @@
_ @
/ ) @
/ / @
(_/ @@
__ @
/ \ @
( 0 )@
\__/ @@
__ @
/ \ @
(_/ / @
(__) @@
____ @
(___ \@
/ __/@
(____)@@
____ @
( __ \@
(__ (@
(____/@@
___ @
/ _ \@
(__ (@
(__/@@
___ @
/ __)@
(___ \@
(____/@@
___ @
/ __)@
( _ \@
\___/@@
____ @
(__ )@
/ / @
(_/ @@
____ @
/ _ \@
) _ (@
\____/@@
___ @
/ _ \ @
\__ )@
(___/ @@
_ @
(_) @
_ @
(_) @@
_ @
(_) @
( ) @
(/ @@
__ @
/ / @
( ( @
\_\ @@
___ @
(___) @
___ @
(___) @@
__ @
\ \ @
) ) @
/_/ @@
___ @
(__ \ @
(__/ @
(_) @@
___ @
/ \@
( (__/@
\___)@@
__ @
/ _\ @
/ \@
\_/\_/@@
____ @
( _ \@
) _ (@
(____/@@
___ @
/ __)@
( (__ @
\___)@@
____ @
( \@
) D (@
(____/@@
____ @
( __)@
) _) @
(____)@@
____ @
( __)@
) _) @
(__) @@
___ @
/ __)@
( (_ \@
\___/@@
_ _ @
/ )( \@
) __ (@
\_)(_/@@
__ @
( ) @
)( @
(__) @@
__ @
_( )@
/ \) \@
\____/@@
__ _ @
( / )@
) ( @
(__\_)@@
__ @
( ) @
/ (_/\@
\____/@@
_ _ @
( \/ )@
/ \/ \@
\_)(_/@@
__ _ @
( ( \@
/ /@
\_)__)@@
__ @
/ \ @
( O )@
\__/ @@
____ @
( _ \@
) __/@
(__) @@
__ @
/ \ @
( O )@
\__\)@@
____ @
( _ \@
) /@
(__\_)@@
____ @
/ ___)@
\___ \@
(____/@@
____ @
(_ _)@
)( @
(__) @@
_ _ @
/ )( \@
) \/ (@
\____/@@
_ _ @
/ )( \@
\ \/ /@
\__/ @@
_ _ @
/ )( \@
\ /\ /@
(_/\_)@@
_ _ @
( \/ )@
) ( @
(_/\_)@@
_ _ @
( \/ )@
) / @
(__/ @@
____ @
(__ )@
/ _/ @
(____)@@
___ @
/ _) @
) (_ @
\___) @@
_ @
( \ @
\ \ @
\_) @@
___ @
(_ \@
_) (@
(___/@@
__ @
/ \ @
(_/\_)@
@@
@
@
____ @
(____)@@
_ @
\) @
@
@@
__ @
/ _\ @
/ \@
\_/\_/@@
____ @
( _ \@
) _ (@
(____/@@
___ @
/ __)@
( (__ @
\___)@@
____ @
( \@
) D (@
(____/@@
____ @
( __)@
) _) @
(____)@@
____ @
( __)@
) _) @
(__) @@
___ @
/ __)@
( (_ \@
\___/@@
_ _ @
/ )( \@
) __ (@
\_)(_/@@
__ @
( ) @
)( @
(__) @@
__ @
_( )@
/ \) \@
\____/@@
__ _ @
( / )@
) ( @
(__\_)@@
__ @
( ) @
/ (_/\@
\____/@@
_ _ @
( \/ )@
/ \/ \@
\_)(_/@@
__ _ @
( ( \@
/ /@
\_)__)@@
__ @
/ \ @
( O )@
\__/ @@
____ @
( _ \@
) __/@
(__) @@
__ @
/ \ @
( O )@
\__\)@@
____ @
( _ \@
) /@
(__\_)@@
____ @
/ ___)@
\___ \@
(____/@@
____ @
(_ _)@
)( @
(__) @@
_ _ @
/ )( \@
) \/ (@
\____/@@
_ _ @
/ )( \@
\ \/ /@
\__/ @@
_ _ @
/ )( \@
\ /\ /@
(_/\_)@@
_ _ @
( \/ )@
) ( @
(_/\_)@@
_ _ @
( \/ )@
) / @
(__/ @@
____ @
(__ )@
/ _/ @
(____)@@
___ @
( _)@
(_ (_ @
(___)@@
_ @
( \ @
/ / @
\_) @@
___ @
(_ ) @
_) _)@
(___) @@
__ @
(_ \_ @
\__)@
@@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
0x0401 CYRILLIC CAPITAL LETTER IO
_--_ @
( __)@
) _) @
(____)@@
0x0410 CYRILLIC CAPITAL LETTER A
__ @
/ _\ @
/ \@
\_/\_/@@
0x0411 CYRILLIC CAPITAL LETTER BE
____ @
( __)@
) _ \@
(____/@@
0x0412 CYRILLIC CAPITAL LETTER VE
____ @
( _ \@
) _ (@
(____/@@
0x0413 CYRILLIC CAPITAL LETTER GHE
____ @
/ __)@
) ( @
\_/ @@
0x0414 CYRILLIC CAPITAL LETTER DE
____ @
/ __ \@
\_ _/@
(_)(_)@@
0x0415 CYRILLIC CAPITAL LETTER IE
____ @
( __)@
) _) @
(____)@@
0x0416 CYRILLIC CAPITAL LETTER ZHE
_ _ @
/( ( \@
) (@
\_)_)/@@
0x0417 CYRILLIC CAPITAL LETTER ZE
____ @
( __ \@
(__ (@
(____/@@
0x0418 CYRILLIC CAPITAL LETTER I
_ __ @
/ ) )@
\ \@
(__(_/@@
0x0419 CYRILLIC CAPITAL LETTER SHORT I
_ u_ @
/ ) )@
\ \@
(__(_/@@
0x041A CYRILLIC CAPITAL LETTER KA
__ _ @
( / )@
) ( @
(__\_)@@
0x041B CYRILLIC CAPITAL LETTER EL
__ @
/ \ @
/ /\ \@
\_)(_/@@
0x041C CYRILLIC CAPITAL LETTER EM
_ _ @
( \/ )@
/ \/ \@
\_)(_/@@
0x041D CYRILLIC CAPITAL LETTER EN
_ _ @
/ )( \@
) __ (@
\_)(_/@@
0x041E CYRILLIC CAPITAL LETTER O
__ @
/ \ @
( O )@
\__/ @@
0x041F CYRILLIC CAPITAL LETTER PE
____ @
/ \@
) /\ (@
\_)(_/@@
0x0420 CYRILLIC CAPITAL LETTER ER
____ @
( _ \@
) __/@
(__) @@
0x0421 CYRILLIC CAPITAL LETTER ES
___ @
/ __)@
( (__ @
\___)@@
0x0422 CYRILLIC CAPITAL LETTER TE
____ @
(_ _)@
)( @
(__) @@
0x0423 CYRILLIC CAPITAL LETTER U
_ _ @
( \/ )@
) / @
(__/ @@
0x0424 CYRILLIC CAPITAL LETTER EF
____ @
/ __ \@
\_ _/@
(__) @@
0x0425 CYRILLIC CAPITAL LETTER HA
_ _ @
( \/ )@
) ( @
(_/\_)@@
0x0426 CYRILLIC CAPITAL LETTER TSE
_ _ @
/ \( \@
) (/ (@
\___\/@@
0x0427 CYRILLIC CAPITAL LETTER CHE
__ _ @
/ (/ \@
\__ (@
(__/@@
0x0428 CYRILLIC CAPITAL LETTER SHA
_ _ @
( ) ))@
/( ( \@
\____/@@
0x0429 CYRILLIC CAPITAL LETTER SHCHA
_ _ @
( ) ))@
/( ( \@
\___\/@@
0x042A CYRILLIC CAPITAL LETTER HARD SIGN
__ @
(_ )_ @
/ _ \@
\___/@@
0x042B CYRILLIC CAPITAL LETTER YERU
_ _ @
( )( )@
/ _ \\@
\___//@@
0x042C CYRILLIC CAPITAL LETTER SOFT SIGN
__ @
( )_ @
) _ \@
(____/@@
0x042D CYRILLIC CAPITAL LETTER E
___ @
(__ \ @
(_ )@
(___/ @@
0x042E CYRILLIC CAPITAL LETTER YU
_ __ @
/ / \@
) O(@
\_\__/@@
0x042F CYRILLIC CAPITAL LETTER YA
____ @
/ _ )@
\ \@
(_/__/@@
0x0430 CYRILLIC SMALL LETTER A
__ @
/ _\ @
/ \@
\_/\_/@@
0x0431 CYRILLIC SMALL LETTER BE
____ @
( __)@
) _ \@
(____/@@
0x0432 CYRILLIC SMALL LETTER VE
____ @
( _ \@
) _ (@
(____/@@
0x0433 CYRILLIC SMALL LETTER GHE
____ @
/ __)@
) ( @
\_/ @@
0x0434 CYRILLIC SMALL LETTER DE
____ @
/ __ \@
\_ _/@
(_)(_)@@
0x0435 CYRILLIC SMALL LETTER IE
____ @
( __)@
) _) @
(____)@@
0x0436 CYRILLIC SMALL LETTER ZHE
_ _ @
/( ( \@
) (@
\_)_)/@@
0x0437 CYRILLIC SMALL LETTER ZE
____ @
( __ \@
(__ (@
(____/@@
0x0438 CYRILLIC SMALL LETTER I
_ __ @
/ ) )@
\ \@
(__(_/@@
0x0439 CYRILLIC SMALL LETTER SHORT I
_ u_ @
/ ) )@
\ \@
(__(_/@@
0x043A CYRILLIC SMALL LETTER KA
__ _ @
( / )@
) ( @
(__\_)@@
0x043B CYRILLIC SMALL LETTER EL
__ @
/ \ @
/ /\ \@
\_)(_/@@
0x043C CYRILLIC SMALL LETTER EM
_ _ @
( \/ )@
/ \/ \@
\_)(_/@@
0x043D CYRILLIC SMALL LETTER EN
_ _ @
/ )( \@
) __ (@
\_)(_/@@
0x043E CYRILLIC SMALL LETTER O
__ @
/ \ @
( O )@
\__/ @@
0x043F CYRILLIC SMALL LETTER PE
____ @
/ \@
) /\ (@
\_)(_/@@
0x0440 CYRILLIC SMALL LETTER ER
____ @
( _ \@
) __/@
(__) @@
0x0441 CYRILLIC SMALL LETTER ES
___ @
/ __)@
( (__ @
\___)@@
0x0442 CYRILLIC SMALL LETTER TE
____ @
(_ _)@
)( @
(__) @@
0x0443 CYRILLIC SMALL LETTER U
_ _ @
( \/ )@
) / @
(__/ @@
0x0444 CYRILLIC SMALL LETTER EF
____ @
/ __ \@
\_ _/@
(__) @@
0x0445 CYRILLIC SMALL LETTER HA
_ _ @
( \/ )@
) ( @
(_/\_)@@
0x0446 CYRILLIC SMALL LETTER TSE
_ _ @
/ \( \@
) (/ (@
\___\/@@
0x0447 CYRILLIC SMALL LETTER CHE
__ _ @
/ (/ \@
\__ (@
(__/@@
0x0448 CYRILLIC SMALL LETTER SHA
_ _ @
( ) ))@
/( ( \@
\____/@@
0x0449 CYRILLIC SMALL LETTER SHCHA
_ _ @
( ) ))@
/( ( \@
\___\/@@
0x044A CYRILLIC SMALL LETTER HARD SIGN
__ @
(_ )_ @
/ _ \@
\___/@@
0x044B CYRILLIC SMALL LETTER YERU
_ _ @
( )( )@
/ _ \\@
\___//@@
0x044C CYRILLIC SMALL LETTER SOFT SIGN
__ @
( )_ @
) _ \@
(____/@@
0x044D CYRILLIC SMALL LETTER E
___ @
(__ \ @
(_ )@
(___/ @@
0x044E CYRILLIC SMALL LETTER YU
_ __ @
/ / \@
) O(@
\_\__/@@
0x044F CYRILLIC SMALL LETTER YA
____ @
/ _ )@
\ \@
(_/__/@@
0x0451 CYRILLIC SMALL LETTER IO
_--_ @
( __)@
) _) @
(____)@@
@@ -0,0 +1,27 @@
"use strict";
module.exports = function ({ plugins }) {
const isArrayOfStrings = typeof plugins[0] === "string";
return `
A config object has a "plugins" key defined as an array${isArrayOfStrings ? " of strings" : ""}. It looks something like this:
{
"plugins": ${JSON.stringify(plugins)}
}
Flat config requires "plugins" to be an object, like this:
{
plugins: {
${isArrayOfStrings && plugins[0] ? plugins[0] : "namespace"}: pluginObject
}
}
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#import-plugins-and-custom-parsers
If you're using a shareable config that you cannot rewrite in flat config format, then use the compatibility utility:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`;
};
@@ -0,0 +1,103 @@
{
"name": "fdir",
"version": "6.5.0",
"description": "The fastest directory crawler & globbing alternative to glob, fast-glob, & tiny-glob. Crawls 1m files in < 1s",
"main": "./dist/index.cjs",
"types": "./dist/index.d.cts",
"type": "module",
"scripts": {
"prepublishOnly": "npm run test && npm run build",
"build": "tsdown",
"format": "prettier --write src __tests__ benchmarks",
"test": "vitest run __tests__/",
"test:coverage": "vitest run --coverage __tests__/",
"test:watch": "vitest __tests__/",
"bench": "ts-node benchmarks/benchmark.js",
"bench:glob": "ts-node benchmarks/glob-benchmark.ts",
"bench:fdir": "ts-node benchmarks/fdir-benchmark.ts",
"release": "./scripts/release.sh"
},
"engines": {
"node": ">=12.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/thecodrr/fdir.git"
},
"keywords": [
"util",
"os",
"sys",
"fs",
"walk",
"crawler",
"directory",
"files",
"io",
"tiny-glob",
"glob",
"fast-glob",
"speed",
"javascript",
"nodejs"
],
"author": "thecodrr <thecodrr@protonmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/thecodrr/fdir/issues"
},
"homepage": "https://github.com/thecodrr/fdir#readme",
"devDependencies": {
"@types/glob": "^8.1.0",
"@types/mock-fs": "^4.13.4",
"@types/node": "^20.9.4",
"@types/picomatch": "^4.0.0",
"@types/tap": "^15.0.11",
"@vitest/coverage-v8": "^0.34.6",
"all-files-in-tree": "^1.1.2",
"benny": "^3.7.1",
"csv-to-markdown-table": "^1.3.1",
"expect": "^29.7.0",
"fast-glob": "^3.3.2",
"fdir1": "npm:fdir@1.2.0",
"fdir2": "npm:fdir@2.1.0",
"fdir3": "npm:fdir@3.4.2",
"fdir4": "npm:fdir@4.1.0",
"fdir5": "npm:fdir@5.0.0",
"fs-readdir-recursive": "^1.1.0",
"get-all-files": "^4.1.0",
"glob": "^10.3.10",
"klaw-sync": "^6.0.0",
"mock-fs": "^5.2.0",
"picomatch": "^4.0.2",
"prettier": "^3.5.3",
"recur-readdir": "0.0.1",
"recursive-files": "^1.0.2",
"recursive-fs": "^2.1.0",
"recursive-readdir": "^2.2.3",
"rrdir": "^12.1.0",
"systeminformation": "^5.21.17",
"tiny-glob": "^0.2.9",
"ts-node": "^10.9.1",
"tsdown": "^0.12.5",
"typescript": "^5.3.2",
"vitest": "^0.34.6",
"walk-sync": "^3.0.0"
},
"peerDependencies": {
"picomatch": "^3 || ^4"
},
"peerDependenciesMeta": {
"picomatch": {
"optional": true
}
},
"module": "./dist/index.mjs",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
}
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Jesse Feng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,373 @@
"use strict";
// These use the global symbol registry so that multiple copies of this
// library can work together in case they are not deduped.
const GENSYNC_START = Symbol.for("gensync:v1:start");
const GENSYNC_SUSPEND = Symbol.for("gensync:v1:suspend");
const GENSYNC_EXPECTED_START = "GENSYNC_EXPECTED_START";
const GENSYNC_EXPECTED_SUSPEND = "GENSYNC_EXPECTED_SUSPEND";
const GENSYNC_OPTIONS_ERROR = "GENSYNC_OPTIONS_ERROR";
const GENSYNC_RACE_NONEMPTY = "GENSYNC_RACE_NONEMPTY";
const GENSYNC_ERRBACK_NO_CALLBACK = "GENSYNC_ERRBACK_NO_CALLBACK";
module.exports = Object.assign(
function gensync(optsOrFn) {
let genFn = optsOrFn;
if (typeof optsOrFn !== "function") {
genFn = newGenerator(optsOrFn);
} else {
genFn = wrapGenerator(optsOrFn);
}
return Object.assign(genFn, makeFunctionAPI(genFn));
},
{
all: buildOperation({
name: "all",
arity: 1,
sync: function(args) {
const items = Array.from(args[0]);
return items.map(item => evaluateSync(item));
},
async: function(args, resolve, reject) {
const items = Array.from(args[0]);
if (items.length === 0) {
Promise.resolve().then(() => resolve([]));
return;
}
let count = 0;
const results = items.map(() => undefined);
items.forEach((item, i) => {
evaluateAsync(
item,
val => {
results[i] = val;
count += 1;
if (count === results.length) resolve(results);
},
reject
);
});
},
}),
race: buildOperation({
name: "race",
arity: 1,
sync: function(args) {
const items = Array.from(args[0]);
if (items.length === 0) {
throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
}
return evaluateSync(items[0]);
},
async: function(args, resolve, reject) {
const items = Array.from(args[0]);
if (items.length === 0) {
throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
}
for (const item of items) {
evaluateAsync(item, resolve, reject);
}
},
}),
}
);
/**
* Given a generator function, return the standard API object that executes
* the generator and calls the callbacks.
*/
function makeFunctionAPI(genFn) {
const fns = {
sync: function(...args) {
return evaluateSync(genFn.apply(this, args));
},
async: function(...args) {
return new Promise((resolve, reject) => {
evaluateAsync(genFn.apply(this, args), resolve, reject);
});
},
errback: function(...args) {
const cb = args.pop();
if (typeof cb !== "function") {
throw makeError(
"Asynchronous function called without callback",
GENSYNC_ERRBACK_NO_CALLBACK
);
}
let gen;
try {
gen = genFn.apply(this, args);
} catch (err) {
cb(err);
return;
}
evaluateAsync(gen, val => cb(undefined, val), err => cb(err));
},
};
return fns;
}
function assertTypeof(type, name, value, allowUndefined) {
if (
typeof value === type ||
(allowUndefined && typeof value === "undefined")
) {
return;
}
let msg;
if (allowUndefined) {
msg = `Expected opts.${name} to be either a ${type}, or undefined.`;
} else {
msg = `Expected opts.${name} to be a ${type}.`;
}
throw makeError(msg, GENSYNC_OPTIONS_ERROR);
}
function makeError(msg, code) {
return Object.assign(new Error(msg), { code });
}
/**
* Given an options object, return a new generator that dispatches the
* correct handler based on sync or async execution.
*/
function newGenerator({ name, arity, sync, async, errback }) {
assertTypeof("string", "name", name, true /* allowUndefined */);
assertTypeof("number", "arity", arity, true /* allowUndefined */);
assertTypeof("function", "sync", sync);
assertTypeof("function", "async", async, true /* allowUndefined */);
assertTypeof("function", "errback", errback, true /* allowUndefined */);
if (async && errback) {
throw makeError(
"Expected one of either opts.async or opts.errback, but got _both_.",
GENSYNC_OPTIONS_ERROR
);
}
if (typeof name !== "string") {
let fnName;
if (errback && errback.name && errback.name !== "errback") {
fnName = errback.name;
}
if (async && async.name && async.name !== "async") {
fnName = async.name.replace(/Async$/, "");
}
if (sync && sync.name && sync.name !== "sync") {
fnName = sync.name.replace(/Sync$/, "");
}
if (typeof fnName === "string") {
name = fnName;
}
}
if (typeof arity !== "number") {
arity = sync.length;
}
return buildOperation({
name,
arity,
sync: function(args) {
return sync.apply(this, args);
},
async: function(args, resolve, reject) {
if (async) {
async.apply(this, args).then(resolve, reject);
} else if (errback) {
errback.call(this, ...args, (err, value) => {
if (err == null) resolve(value);
else reject(err);
});
} else {
resolve(sync.apply(this, args));
}
},
});
}
function wrapGenerator(genFn) {
return setFunctionMetadata(genFn.name, genFn.length, function(...args) {
return genFn.apply(this, args);
});
}
function buildOperation({ name, arity, sync, async }) {
return setFunctionMetadata(name, arity, function*(...args) {
const resume = yield GENSYNC_START;
if (!resume) {
// Break the tail call to avoid a bug in V8 v6.X with --harmony enabled.
const res = sync.call(this, args);
return res;
}
let result;
try {
async.call(
this,
args,
value => {
if (result) return;
result = { value };
resume();
},
err => {
if (result) return;
result = { err };
resume();
}
);
} catch (err) {
result = { err };
resume();
}
// Suspend until the callbacks run. Will resume synchronously if the
// callback was already called.
yield GENSYNC_SUSPEND;
if (result.hasOwnProperty("err")) {
throw result.err;
}
return result.value;
});
}
function evaluateSync(gen) {
let value;
while (!({ value } = gen.next()).done) {
assertStart(value, gen);
}
return value;
}
function evaluateAsync(gen, resolve, reject) {
(function step() {
try {
let value;
while (!({ value } = gen.next()).done) {
assertStart(value, gen);
// If this throws, it is considered to have broken the contract
// established for async handlers. If these handlers are called
// synchronously, it is also considered bad behavior.
let sync = true;
let didSyncResume = false;
const out = gen.next(() => {
if (sync) {
didSyncResume = true;
} else {
step();
}
});
sync = false;
assertSuspend(out, gen);
if (!didSyncResume) {
// Callback wasn't called synchronously, so break out of the loop
// and let it call 'step' later.
return;
}
}
return resolve(value);
} catch (err) {
return reject(err);
}
})();
}
function assertStart(value, gen) {
if (value === GENSYNC_START) return;
throwError(
gen,
makeError(
`Got unexpected yielded value in gensync generator: ${JSON.stringify(
value
)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,
GENSYNC_EXPECTED_START
)
);
}
function assertSuspend({ value, done }, gen) {
if (!done && value === GENSYNC_SUSPEND) return;
throwError(
gen,
makeError(
done
? "Unexpected generator completion. If you get this, it is probably a gensync bug."
: `Expected GENSYNC_SUSPEND, got ${JSON.stringify(
value
)}. If you get this, it is probably a gensync bug.`,
GENSYNC_EXPECTED_SUSPEND
)
);
}
function throwError(gen, err) {
// Call `.throw` so that users can step in a debugger to easily see which
// 'yield' passed an unexpected value. If the `.throw` call didn't throw
// back to the generator, we explicitly do it to stop the error
// from being swallowed by user code try/catches.
if (gen.throw) gen.throw(err);
throw err;
}
function isIterable(value) {
return (
!!value &&
(typeof value === "object" || typeof value === "function") &&
!value[Symbol.iterator]
);
}
function setFunctionMetadata(name, arity, fn) {
if (typeof name === "string") {
// This should always work on the supported Node versions, but for the
// sake of users that are compiling to older versions, we check for
// configurability so we don't throw.
const nameDesc = Object.getOwnPropertyDescriptor(fn, "name");
if (!nameDesc || nameDesc.configurable) {
Object.defineProperty(
fn,
"name",
Object.assign(nameDesc || {}, {
configurable: true,
value: name,
})
);
}
}
if (typeof arity === "number") {
const lengthDesc = Object.getOwnPropertyDescriptor(fn, "length");
if (!lengthDesc || lengthDesc.configurable) {
Object.defineProperty(
fn,
"length",
Object.assign(lengthDesc || {}, {
configurable: true,
value: arity,
})
);
}
}
return fn;
}
@@ -0,0 +1 @@
{"version":3,"file":"chart-network.js","sources":["../../../src/icons/chart-network.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartNetwork\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTMuMTEgNy42NjQgMS43OCAyLjY3MiIgLz4KICA8cGF0aCBkPSJtMTQuMTYyIDEyLjc4OC0zLjMyNCAxLjQyNCIgLz4KICA8cGF0aCBkPSJtMjAgNC02LjA2IDEuNTE1IiAvPgogIDxwYXRoIGQ9Ik0zIDN2MTZhMiAyIDAgMCAwIDIgMmgxNiIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjYiIHI9IjIiIC8+CiAgPGNpcmNsZSBjeD0iMTYiIGN5PSIxMiIgcj0iMiIgLz4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iMTUiIHI9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-network\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 ChartNetwork = createLucideIcon('ChartNetwork', [\n ['path', { d: 'm13.11 7.664 1.78 2.672', key: 'go2gg9' }],\n ['path', { d: 'm14.162 12.788-3.324 1.424', key: '11x848' }],\n ['path', { d: 'm20 4-6.06 1.515', key: '1wxxh7' }],\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }],\n ['circle', { cx: '12', cy: '6', r: '2', key: '1jj5th' }],\n ['circle', { cx: '16', cy: '12', r: '2', key: '4ma0v8' }],\n ['circle', { cx: '9', cy: '15', r: '2', key: 'lf2ghp' }],\n]);\n\nexport default ChartNetwork;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,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,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_SJ _CD","2":"_OO","132":"_NJ _XP"},C:{"1":"_wO","2":"_xD _0G"},D:{"1":"_SJ _EF","2":"_PR","132":"_NJ _XP"},E:{"1":"K yC _kU","2":"_yG _pE xC"},F:{"1":"_H _eE _h","2":"_8 _GO _O","132":"j _TP _qN"},G:{"1":"yC zD _sE","2":"_7O xC"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"2":"_D","132":"H"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_MK","132":"_EC"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"CSS text-wrap: balance",D:true};
@@ -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_string = void 0;
const base_config_1 = require("./base-config");
exports.es2017_string = {
libs: [],
variables: [['String', base_config_1.TYPE]],
};
@@ -0,0 +1,383 @@
/**
* @fileoverview Rule to require or disallow line breaks inside braces.
* @author Toru Nagashima
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
// Schema objects.
const OPTION_VALUE = {
oneOf: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
multiline: {
type: "boolean",
},
minProperties: {
type: "integer",
minimum: 0,
},
consistent: {
type: "boolean",
},
},
additionalProperties: false,
minProperties: 1,
},
],
};
/**
* Normalizes a given option value.
* @param {string|Object|undefined} value An option value to parse.
* @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object.
*/
function normalizeOptionValue(value) {
let multiline = false;
let minProperties = Number.POSITIVE_INFINITY;
let consistent = false;
if (value) {
if (value === "always") {
minProperties = 0;
} else if (value === "never") {
minProperties = Number.POSITIVE_INFINITY;
} else {
multiline = Boolean(value.multiline);
minProperties = value.minProperties || Number.POSITIVE_INFINITY;
consistent = Boolean(value.consistent);
}
} else {
consistent = true;
}
return { multiline, minProperties, consistent };
}
/**
* Checks if a value is an object.
* @param {any} value The value to check
* @returns {boolean} `true` if the value is an object, otherwise `false`
*/
function isObject(value) {
return typeof value === "object" && value !== null;
}
/**
* Checks if an option is a node-specific option
* @param {any} option The option to check
* @returns {boolean} `true` if the option is node-specific, otherwise `false`
*/
function isNodeSpecificOption(option) {
return isObject(option) || typeof option === "string";
}
/**
* Normalizes a given option value.
* @param {string|Object|undefined} options An option value to parse.
* @returns {{
* ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean},
* ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean},
* ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean},
* ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean}
* }} Normalized option object.
*/
function normalizeOptions(options) {
if (
isObject(options) &&
Object.values(options).some(isNodeSpecificOption)
) {
return {
ObjectExpression: normalizeOptionValue(options.ObjectExpression),
ObjectPattern: normalizeOptionValue(options.ObjectPattern),
ImportDeclaration: normalizeOptionValue(options.ImportDeclaration),
ExportNamedDeclaration: normalizeOptionValue(
options.ExportDeclaration,
),
};
}
const value = normalizeOptionValue(options);
return {
ObjectExpression: value,
ObjectPattern: value,
ImportDeclaration: value,
ExportNamedDeclaration: value,
};
}
/**
* Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration
* node needs to be checked for missing line breaks
* @param {ASTNode} node Node under inspection
* @param {Object} options option specific to node type
* @param {Token} first First object property
* @param {Token} last Last object property
* @returns {boolean} `true` if node needs to be checked for missing line breaks
*/
function areLineBreaksRequired(node, options, first, last) {
let objectProperties;
if (node.type === "ObjectExpression" || node.type === "ObjectPattern") {
objectProperties = node.properties;
} else {
// is ImportDeclaration or ExportNamedDeclaration
objectProperties = node.specifiers.filter(
s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier",
);
}
return (
objectProperties.length >= options.minProperties ||
(options.multiline &&
objectProperties.length > 0 &&
first.loc.start.line !== last.loc.end.line)
);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "object-curly-newline",
url: "https://eslint.style/rules/object-curly-newline",
},
},
],
},
type: "layout",
docs: {
description:
"Enforce consistent line breaks after opening and before closing braces",
recommended: false,
url: "https://eslint.org/docs/latest/rules/object-curly-newline",
},
fixable: "whitespace",
schema: [
{
oneOf: [
OPTION_VALUE,
{
type: "object",
properties: {
ObjectExpression: OPTION_VALUE,
ObjectPattern: OPTION_VALUE,
ImportDeclaration: OPTION_VALUE,
ExportDeclaration: OPTION_VALUE,
},
additionalProperties: false,
minProperties: 1,
},
],
},
],
messages: {
unexpectedLinebreakBeforeClosingBrace:
"Unexpected line break before this closing brace.",
unexpectedLinebreakAfterOpeningBrace:
"Unexpected line break after this opening brace.",
expectedLinebreakBeforeClosingBrace:
"Expected a line break before this closing brace.",
expectedLinebreakAfterOpeningBrace:
"Expected a line break after this opening brace.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const normalizedOptions = normalizeOptions(context.options[0]);
/**
* Reports a given node if it violated this rule.
* @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node.
* @returns {void}
*/
function check(node) {
const options = normalizedOptions[node.type];
if (
(node.type === "ImportDeclaration" &&
!node.specifiers.some(
specifier => specifier.type === "ImportSpecifier",
)) ||
(node.type === "ExportNamedDeclaration" &&
!node.specifiers.some(
specifier => specifier.type === "ExportSpecifier",
))
) {
return;
}
const openBrace = sourceCode.getFirstToken(
node,
token => token.value === "{",
);
let closeBrace;
if (node.typeAnnotation) {
closeBrace = sourceCode.getTokenBefore(node.typeAnnotation);
} else {
closeBrace = sourceCode.getLastToken(
node,
token => token.value === "}",
);
}
let first = sourceCode.getTokenAfter(openBrace, {
includeComments: true,
});
let last = sourceCode.getTokenBefore(closeBrace, {
includeComments: true,
});
const needsLineBreaks = areLineBreaksRequired(
node,
options,
first,
last,
);
const hasCommentsFirstToken = astUtils.isCommentToken(first);
const hasCommentsLastToken = astUtils.isCommentToken(last);
/*
* Use tokens or comments to check multiline or not.
* But use only tokens to check whether line breaks are needed.
* This allows:
* var obj = { // eslint-disable-line foo
* a: 1
* }
*/
first = sourceCode.getTokenAfter(openBrace);
last = sourceCode.getTokenBefore(closeBrace);
if (needsLineBreaks) {
if (astUtils.isTokenOnSameLine(openBrace, first)) {
context.report({
messageId: "expectedLinebreakAfterOpeningBrace",
node,
loc: openBrace.loc,
fix(fixer) {
if (hasCommentsFirstToken) {
return null;
}
return fixer.insertTextAfter(openBrace, "\n");
},
});
}
if (astUtils.isTokenOnSameLine(last, closeBrace)) {
context.report({
messageId: "expectedLinebreakBeforeClosingBrace",
node,
loc: closeBrace.loc,
fix(fixer) {
if (hasCommentsLastToken) {
return null;
}
return fixer.insertTextBefore(closeBrace, "\n");
},
});
}
} else {
const consistent = options.consistent;
const hasLineBreakBetweenOpenBraceAndFirst =
!astUtils.isTokenOnSameLine(openBrace, first);
const hasLineBreakBetweenCloseBraceAndLast =
!astUtils.isTokenOnSameLine(last, closeBrace);
if (
(!consistent && hasLineBreakBetweenOpenBraceAndFirst) ||
(consistent &&
hasLineBreakBetweenOpenBraceAndFirst &&
!hasLineBreakBetweenCloseBraceAndLast)
) {
context.report({
messageId: "unexpectedLinebreakAfterOpeningBrace",
node,
loc: openBrace.loc,
fix(fixer) {
if (hasCommentsFirstToken) {
return null;
}
return fixer.removeRange([
openBrace.range[1],
first.range[0],
]);
},
});
}
if (
(!consistent && hasLineBreakBetweenCloseBraceAndLast) ||
(consistent &&
!hasLineBreakBetweenOpenBraceAndFirst &&
hasLineBreakBetweenCloseBraceAndLast)
) {
context.report({
messageId: "unexpectedLinebreakBeforeClosingBrace",
node,
loc: closeBrace.loc,
fix(fixer) {
if (hasCommentsLastToken) {
return null;
}
return fixer.removeRange([
last.range[1],
closeBrace.range[0],
]);
},
});
}
}
}
return {
ObjectExpression: check,
ObjectPattern: check,
ImportDeclaration: check,
ExportNamedDeclaration: check,
};
},
};
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Cross = createLucideIcon("Cross", [
[
"path",
{
d: "M4 9a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h4a1 1 0 0 1 1 1v4a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-4a1 1 0 0 1 1-1h4a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2h-4a1 1 0 0 1-1-1V4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4a1 1 0 0 1-1 1z",
key: "1xbrqy"
}
]
]);
export { Cross as default };
//# sourceMappingURL=cross.js.map
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _initializerDefineProperty;
function _initializerDefineProperty(target, property, descriptor, context) {
if (!descriptor) return;
Object.defineProperty(target, property, {
enumerable: descriptor.enumerable,
configurable: descriptor.configurable,
writable: descriptor.writable,
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
});
}
//# sourceMappingURL=initializerDefineProperty.js.map
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const File = createLucideIcon("File", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
]);
export { File as default };
//# sourceMappingURL=file.js.map
@@ -0,0 +1,69 @@
/*!
* unpipe
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module exports.
* @public
*/
module.exports = unpipe
/**
* Determine if there are Node.js pipe-like data listeners.
* @private
*/
function hasPipeDataListeners(stream) {
var listeners = stream.listeners('data')
for (var i = 0; i < listeners.length; i++) {
if (listeners[i].name === 'ondata') {
return true
}
}
return false
}
/**
* Unpipe a stream from all destinations.
*
* @param {object} stream
* @public
*/
function unpipe(stream) {
if (!stream) {
throw new TypeError('argument stream is required')
}
if (typeof stream.unpipe === 'function') {
// new-style
stream.unpipe()
return
}
// Node.js 0.8 hack
if (!hasPipeDataListeners(stream)) {
return
}
var listener
var listeners = stream.listeners('close')
for (var i = 0; i < listeners.length; i++) {
listener = listeners[i]
if (listener.name !== 'cleanup' && listener.name !== 'onclose') {
continue
}
// invoke the listener
listener.call(stream)
}
}
@@ -0,0 +1,46 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
{{
var $noEmptySchema = $schema.every(function($sch) {
return {{# def.nonEmptySchema:$sch }};
});
}}
{{? $noEmptySchema }}
{{ var $currentBaseId = $it.baseId; }}
var {{=$errs}} = errors;
var {{=$valid}} = false;
{{# def.setCompositeRule }}
{{~ $schema:$sch:$i }}
{{
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
}}
{{# def.insertSubschemaCode }}
{{=$valid}} = {{=$valid}} || {{=$nextValid}};
if (!{{=$valid}}) {
{{ $closingBraces += '}'; }}
{{~}}
{{# def.resetCompositeRule }}
{{= $closingBraces }}
if (!{{=$valid}}) {
{{# def.extraError:'anyOf' }}
} else {
{{# def.resetErrors }}
{{? it.opts.allErrors }} } {{?}}
{{??}}
{{? $breakOnError }}
if (true) {
{{?}}
{{?}}
@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2024-present VoidZero Inc. & Contributors
Copyright (c) 2023 Boshen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1 @@
module.exports={C:{"92":0.00403,"115":0.08453,"120":0.04025,"121":0.08855,"123":0.0161,"124":0.00403,"135":0.03623,"137":0.00403,"140":0.02818,"141":0.0161,"143":0.00403,"144":0.00403,"147":0.0161,"148":0.00403,"149":0.00805,"150":0.04428,"151":0.02013,"152":0.01208,"153":0.0161,"154":0.14893,"155":0.44678,"156":0.44678,"157":0.0161,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 125 126 127 128 129 130 131 132 133 134 136 138 139 142 145 146 158 159 160 3.5 3.6"},D:{"70":0.00805,"87":0.00403,"98":0.02415,"103":0.02415,"104":0.01208,"105":0.01208,"106":0.01208,"107":0.01208,"108":0.01208,"109":0.41055,"110":0.01208,"111":0.0161,"112":0.01208,"114":0.00805,"116":0.0322,"117":0.01208,"118":0.08855,"119":0.1127,"120":0.2093,"121":0.01208,"122":0.06038,"123":0.01208,"124":0.02013,"125":0.00805,"126":0.0161,"127":0.00403,"128":0.0322,"130":0.00403,"131":0.06843,"132":0.00805,"133":0.05635,"134":0.04025,"135":0.05233,"136":0.04025,"137":0.04428,"138":0.07648,"139":0.0483,"140":0.0644,"141":0.0644,"142":0.16503,"143":0.02013,"144":0.02415,"145":0.04025,"146":0.53533,"147":0.04025,"148":0.06843,"149":0.1127,"150":0.23748,"151":1.26385,"152":10.8514,"153":8.5008,"154":1.82735,"155":0.02415,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 88 89 90 91 92 93 94 95 96 97 99 100 101 102 113 115 129 156 157"},F:{"78":0.00403,"95":0.00403,"101":0.0644,"106":0.00403,"107":0.00403,"133":0.00403,"134":0.0322,"135":0.4186,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 102 103 104 105 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00403,"109":0.01208,"119":0.04025,"120":0.04428,"122":0.00403,"133":0.00805,"136":0.00403,"139":0.00403,"140":0.01208,"141":0.00403,"142":0.00403,"145":0.00403,"147":0.00403,"148":0.00403,"149":0.00403,"150":0.04428,"151":0.1288,"152":2.76518,"153":2.9946,"154":0.9016,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 123 124 125 126 127 128 129 130 131 132 134 135 137 138 143 144 146"},E:{"27":0.15698,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 16.0 16.2 16.5 17.0 27.1 TP","13.1":0.28578,"14.1":0.00403,"15.5":0.00403,"15.6":0.03623,"16.1":0.00403,"16.3":0.01208,"16.4":0.01208,"16.6":0.06843,"17.1":0.0644,"17.2":0.00805,"17.3":0.00403,"17.4":0.00805,"17.5":0.0161,"17.6":0.07245,"18.0":0.05635,"18.1":0.00805,"18.2":0.00403,"18.3":0.02415,"18.4":0.00403,"18.5-18.7":0.00805,"26.0":0.01208,"26.1":0.0161,"26.2":0.0161,"26.3":0.02818,"26.4":0.02415,"26.5":0.20125,"26.6":1.34033,"27.2":0.02013},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00158,"5.0-5.1":0.00158,"6.0-6.1":0,"7.0-7.1":0.00317,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01584,"11.0-11.2":0.00158,"11.3-11.4":0.00317,"12.0-12.1":0,"12.2-12.5":0.04117,"13.0-13.1":0,"13.2":0.00792,"13.3":0,"13.4-13.7":0.00158,"14.0-14.4":0.00633,"14.5-14.8":0.0095,"15.0-15.1":0.0095,"15.2-15.3":0.00633,"15.4":0.00792,"15.5":0.0095,"15.6-15.8":0.20587,"16.0":0.01584,"16.1":0.02851,"16.2":0.01584,"16.3":0.03484,"16.4":0.00792,"16.5":0.01267,"16.6-16.7":0.28664,"17.0":0.01109,"17.1":0.01584,"17.2":0.01584,"17.3":0.02375,"17.4":0.03326,"17.5":0.06493,"17.6-17.7":0.16787,"18.0":0.03484,"18.1":0.06968,"18.2":0.09502,"18.3":0.1647,"18.4":0.10294,"18.5-18.7":2.12683,"26.0":0.10294,"26.1":0.10452,"26.2":0.27239,"26.3":0.29456,"26.4":0.21538,"26.5":1.4427,"26.6":8.90164,"27.0":0.68255,"27.1":0,"27.2":0.01742},P:{"23":0.00954,"24":0.00954,"25":0.00954,"26":0.00954,"27":0.03815,"28":0.05723,"29":0.09538,"30":3.14753,_:"4 20 21 22 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.04777,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.28087,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{"2.5":0.00598,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":41.21299},R:{_:"0"},M:{"0":0.2749},Q:{_:"14.9"},O:{"0":0.10757},H:{all:0}};
@@ -0,0 +1 @@
{"version":3,"file":"microtask.mjs","sources":["../../../src/frameloop/microtask.ts"],"sourcesContent":["import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n"],"names":[],"mappings":";;AAEO,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE;AACzD,gBAAgB,mBAAmB,CAAC,cAAc,EAAE,KAAK;;;;"}
@@ -0,0 +1,16 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_url = require("../../utils/url.js");
const require_router_trie_router_node = require("./node.js");
//#region src/router/trie-router/router.ts
var TrieRouter = class {
name = "TrieRouter";
#node = new require_router_trie_router_node.Node();
add(method, path, handler) {
for (const result of require_utils_url.checkOptionalParameter(path) || [path]) this.#node.insert(method, result, handler);
}
match(method, path) {
return this.#node.search(method, path);
}
};
//#endregion
exports.TrieRouter = TrieRouter;
@@ -0,0 +1,219 @@
flf2a$ 2 2 8 0 14
twopoint by Bruce Jakeway (pbjakeway@neumann.uwaterloo.ca)
For figlet release 2.0
Date: 1994 Aug 11
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be `a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
2 - height of a character
2 - height of a character, not including descenders
8 - max line length (excluding comment lines)
0 - default smushmode for this font (like "-m 15" on command line)
14 - number of comment lines
$$@
$$@@
|@
o@@
''@
$$@@
++@
++@@
(|~@
_|)@@
o/@
/o@@
o @
(_X@@
)@
$@@
/~@
\_@@
~\@
_/@@
\|/@
/|\@@
$|$@
~|~@@
$@
)@@
$$@
~~@@
$@
o@@
$/@
/$@@
/\@
\/@@
'|@
$|@@
~)@
/_@@
~/@
_)@@
/|$@
~|~@@
|~@
_)@@
/ @
(_)@@
~/@
/$@@
(~)@
(_)@@
(~|@
$/$@@
o@
o@@
o@
)@@
/@
\@@
--@
--@@
\@
/@@
~)@
o$@@
_ @
(a)@@
|~|@
|~|@@
|~)@
|_)@@
|~@
|_@@
|~\@
|_/@@
[~@
[_@@
|~@
|~@@
|~_@
|_|@@
|_|@
| |@@
|@
|@@
$|@
_|@@
|/@
|\@@
|$@
|_@@
|\/|@
| |@@
|\ |@
| \|@@
/~\@
\_/@@
|~)@
|~ @@
/~\@
\_X@@
|~)@
|~\@@
(~@
_)@@
~|~@
$|$@@
| |@
|_|@@
\ /@
$\/$@@
| |@
$\/\/$@@
\/@
/\@@
\/@
/$@@
~/@
/_@@
|~@
|_@@
\$@
$\@@
~|@
_|@@
/\@
$$@@
$$@
__@@
(@
@@
$_$@
(_|@@
|_$@
|_)@@
$_@
(_@@
$_|@
(_|@@
$_@
}_@@
$|~@
~|~@@
(~|@
$_|@@
|_$@
| |@@
o@
|@@
$o@
_|@@
|$@
|<@@
|@
|@@
._ _$@
| | |@@
._$@
| |@@
$_$@
(_)@@
|)@
|$@@
(|@
$|@@
._@
|$@@
$_@
_\@@
_|_@
$|$@@
$ $@
|_|@@
$$@
\/@@
$ $@
\/\/@@
$$@
><@@
|_|@
$_|@@
_$@
/_@@
$|~@
~|_@@
|@
|@@
~|$@
_|~@@
/\/@
$ $@@
o~o@
|~|@@
o~o@
\_/@@
q p@
|_|@@
o_o@
(_|@@
o_o@
(_)@@
o o@
|_|@@
|~)@
| )@@