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

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

No files matched your search

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_OL","2":"_WR","322":"_KD"},D:{"1":"_TI","2":"_8N","194":"_iE tB"},E:{"1":"_JB","2":"_5C","33":"_6H _mF"},F:{"1":"_6G","2":"_QK"},G:{"1":"_9","2":"_EB","33":"_lC _FF"},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:{"1":"ME","2":"LE"}},B:4,C:"CSS Shapes Level 1",D:true};
@@ -0,0 +1,195 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
interface Colors {
comment: {
close: string;
open: string;
};
content: {
close: string;
open: string;
};
prop: {
close: string;
open: string;
};
tag: {
close: string;
open: string;
};
value: {
close: string;
open: string;
};
}
type Indent = (arg0: string) => string;
type Refs = Array<unknown>;
type Print = (arg0: unknown) => string;
type Theme = Required<{
comment?: string;
content?: string;
prop?: string;
tag?: string;
value?: string;
}>;
/**
* compare function used when sorting object keys, `null` can be used to skip over sorting.
*/
type CompareKeys = ((a: string, b: string) => number) | null | undefined;
type RequiredOptions = Required<PrettyFormatOptions>;
interface Options extends Omit<RequiredOptions, "compareKeys" | "theme"> {
compareKeys: CompareKeys;
theme: Theme;
}
interface PrettyFormatOptions {
/**
* Call `toJSON` on objects before formatting them.
* Ignored after the formatter has already called `toJSON` once for a value.
* @default true
*/
callToJSON?: boolean;
/**
* Whether to escape special characters in regular expressions.
* @default false
*/
escapeRegex?: boolean;
/**
* Whether to escape special characters in strings.
* @default true
*/
escapeString?: boolean;
/**
* Whether to highlight syntax using terminal colors.
* @default false
*/
highlight?: boolean;
/**
* Number of spaces to use for each level of indentation.
* @default 2
*/
indent?: number;
/**
* Maximum depth to recurse into nested values.
* @default Infinity
*/
maxDepth?: number;
/**
* Maximum number of items to print in arrays, sets, maps, and similar collections.
* @default Infinity
*/
maxWidth?: number;
/**
* Approximate per-depth-level budget for output length.
* When the accumulated output at any single depth level exceeds this value,
* further nesting is collapsed. This is a heuristic safety valve, not a hard
* limit — total output can reach up to roughly `maxDepth × maxOutputLength`.
* @default 1_000_000
*/
maxOutputLength?: number;
/**
* Whether to minimize added whitespace, including indentation and line breaks.
* @default false
*/
min?: boolean;
/**
* Whether to print `Object` / `Array` prefixes for plain objects and arrays.
* @default true
*/
printBasicPrototype?: boolean;
/**
* Whether to include the function name when formatting functions.
* @default true
*/
printFunctionName?: boolean;
/**
* Whether to include shadow-root contents when formatting DOM nodes.
* @default true
*/
printShadowRoot?: boolean;
/**
* Compare function used when sorting object keys. Set to `null` to disable sorting.
*/
compareKeys?: CompareKeys;
/**
* Plugins used to serialize application-specific data types.
* @default []
*/
plugins?: Plugins;
}
type OptionsReceived = PrettyFormatOptions;
interface Config {
callToJSON: boolean;
compareKeys: CompareKeys;
colors: Colors;
escapeRegex: boolean;
escapeString: boolean;
indent: string;
maxDepth: number;
maxWidth: number;
min: boolean;
plugins: Plugins;
printBasicPrototype: boolean;
printFunctionName: boolean;
printShadowRoot: boolean;
spacingInner: string;
spacingOuter: string;
maxOutputLength: number;
}
type Printer = (val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
type Test = (arg0: any) => boolean;
interface NewPlugin {
serialize: (val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
test: Test;
}
interface PluginOptions {
edgeSpacing: string;
min: boolean;
spacing: string;
}
interface OldPlugin {
print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
test: Test;
}
type Plugin = NewPlugin | OldPlugin;
type Plugins = Array<Plugin>;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
declare function createDOMElementFilter(filterNode?: (node: any) => boolean): NewPlugin;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
declare const DEFAULT_OPTIONS: Options;
/**
* Returns a presentation string of your `val` object
* @param val any potential JavaScript object
* @param options Custom settings
*/
declare function format(val: unknown, options?: OptionsReceived): string;
declare const plugins: {
AsymmetricMatcher: NewPlugin;
DOMCollection: NewPlugin;
DOMElement: NewPlugin;
Immutable: NewPlugin;
ReactElement: NewPlugin;
ReactTestComponent: NewPlugin;
Error: NewPlugin;
};
export { DEFAULT_OPTIONS, createDOMElementFilter, format, plugins };
export type { Colors, CompareKeys, Config, NewPlugin, OldPlugin, Options, OptionsReceived, Plugin, Plugins, PrettyFormatOptions, Printer, Refs, Theme };
@@ -0,0 +1,544 @@
var hasMap = typeof Map === 'function' && Map.prototype;
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
var mapForEach = hasMap && Map.prototype.forEach;
var hasSet = typeof Set === 'function' && Set.prototype;
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
var setForEach = hasSet && Set.prototype.forEach;
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
var booleanValueOf = Boolean.prototype.valueOf;
var objectToString = Object.prototype.toString;
var functionToString = Function.prototype.toString;
var $match = String.prototype.match;
var $slice = String.prototype.slice;
var $replace = String.prototype.replace;
var $toUpperCase = String.prototype.toUpperCase;
var $toLowerCase = String.prototype.toLowerCase;
var $test = RegExp.prototype.test;
var $concat = Array.prototype.concat;
var $join = Array.prototype.join;
var $arrSlice = Array.prototype.slice;
var $floor = Math.floor;
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
var gOPS = Object.getOwnPropertySymbols;
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
// ie, `has-tostringtag/shams
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
? Symbol.toStringTag
: null;
var isEnumerable = Object.prototype.propertyIsEnumerable;
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
[].__proto__ === Array.prototype // eslint-disable-line no-proto
? function (O) {
return O.__proto__; // eslint-disable-line no-proto
}
: null
);
function addNumericSeparator(num, str) {
if (
num === Infinity
|| num === -Infinity
|| num !== num
|| (num && num > -1000 && num < 1000)
|| $test.call(/e/, str)
) {
return str;
}
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
if (typeof num === 'number') {
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
if (int !== num) {
var intStr = String(int);
var dec = $slice.call(str, intStr.length + 1);
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
}
}
return $replace.call(str, sepRegex, '$&_');
}
var utilInspect = require('./util.inspect');
var inspectCustom = utilInspect.custom;
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
var quotes = {
__proto__: null,
'double': '"',
single: "'"
};
var quoteREs = {
__proto__: null,
'double': /(["\\])/g,
single: /(['\\])/g
};
module.exports = function inspect_(obj, options, depth, seen) {
var opts = options || {};
if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
throw new TypeError('option "quoteStyle" must be "single" or "double"');
}
if (
has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
: opts.maxStringLength !== null
)
) {
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
}
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
}
if (
has(opts, 'indent')
&& opts.indent !== null
&& opts.indent !== '\t'
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
) {
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
}
if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
}
var numericSeparator = opts.numericSeparator;
if (typeof obj === 'undefined') {
return 'undefined';
}
if (obj === null) {
return 'null';
}
if (typeof obj === 'boolean') {
return obj ? 'true' : 'false';
}
if (typeof obj === 'string') {
return inspectString(obj, opts);
}
if (typeof obj === 'number') {
if (obj === 0) {
return Infinity / obj > 0 ? '0' : '-0';
}
var str = String(obj);
return numericSeparator ? addNumericSeparator(obj, str) : str;
}
if (typeof obj === 'bigint') {
var bigIntStr = String(obj) + 'n';
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
}
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
if (typeof depth === 'undefined') { depth = 0; }
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
return isArray(obj) ? '[Array]' : '[Object]';
}
var indent = getIndent(opts, depth);
if (typeof seen === 'undefined') {
seen = [];
} else if (indexOf(seen, obj) >= 0) {
return '[Circular]';
}
function inspect(value, from, noIndent) {
if (from) {
seen = $arrSlice.call(seen);
seen.push(from);
}
if (noIndent) {
var newOpts = {
depth: opts.depth
};
if (has(opts, 'quoteStyle')) {
newOpts.quoteStyle = opts.quoteStyle;
}
return inspect_(value, newOpts, depth + 1, seen);
}
return inspect_(value, opts, depth + 1, seen);
}
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
var name = nameOf(obj);
var keys = arrObjKeys(obj, inspect);
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
}
if (isSymbol(obj)) {
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
}
if (isElement(obj)) {
var s = '<' + $toLowerCase.call(String(obj.nodeName));
var attrs = obj.attributes || [];
for (var i = 0; i < attrs.length; i++) {
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
}
s += '>';
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
return s;
}
if (isArray(obj)) {
if (obj.length === 0) { return '[]'; }
var xs = arrObjKeys(obj, inspect);
if (indent && !singleLineValues(xs)) {
return '[' + indentedJoin(xs, indent) + ']';
}
return '[ ' + $join.call(xs, ', ') + ' ]';
}
if (isError(obj)) {
var parts = arrObjKeys(obj, inspect);
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
}
if (parts.length === 0) { return '[' + String(obj) + ']'; }
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
}
if (typeof obj === 'object' && customInspect) {
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
return utilInspect(obj, { depth: maxDepth - depth });
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
return obj.inspect();
}
}
if (isMap(obj)) {
var mapParts = [];
if (mapForEach) {
mapForEach.call(obj, function (value, key) {
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
});
}
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
}
if (isSet(obj)) {
var setParts = [];
if (setForEach) {
setForEach.call(obj, function (value) {
setParts.push(inspect(value, obj));
});
}
return collectionOf('Set', setSize.call(obj), setParts, indent);
}
if (isWeakMap(obj)) {
return weakCollectionOf('WeakMap');
}
if (isWeakSet(obj)) {
return weakCollectionOf('WeakSet');
}
if (isWeakRef(obj)) {
return weakCollectionOf('WeakRef');
}
if (isNumber(obj)) {
return markBoxed(inspect(Number(obj)));
}
if (isBigInt(obj)) {
return markBoxed(inspect(bigIntValueOf.call(obj)));
}
if (isBoolean(obj)) {
return markBoxed(booleanValueOf.call(obj));
}
if (isString(obj)) {
return markBoxed(inspect(String(obj)));
}
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
/* eslint-env browser */
if (typeof window !== 'undefined' && obj === window) {
return '{ [object Window] }';
}
if (
(typeof globalThis !== 'undefined' && obj === globalThis)
|| (typeof global !== 'undefined' && obj === global)
) {
return '{ [object globalThis] }';
}
if (!isDate(obj) && !isRegExp(obj)) {
var ys = arrObjKeys(obj, inspect);
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
var protoTag = obj instanceof Object ? '' : 'null prototype';
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
if (ys.length === 0) { return tag + '{}'; }
if (indent) {
return tag + '{' + indentedJoin(ys, indent) + '}';
}
return tag + '{ ' + $join.call(ys, ', ') + ' }';
}
return String(obj);
};
function wrapQuotes(s, defaultStyle, opts) {
var style = opts.quoteStyle || defaultStyle;
var quoteChar = quotes[style];
return quoteChar + s + quoteChar;
}
function quote(s) {
return $replace.call(String(s), /"/g, '&quot;');
}
function canTrustToString(obj) {
return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
}
function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
function isSymbol(obj) {
if (hasShammedSymbols) {
return obj && typeof obj === 'object' && obj instanceof Symbol;
}
if (typeof obj === 'symbol') {
return true;
}
if (!obj || typeof obj !== 'object' || !symToString) {
return false;
}
try {
symToString.call(obj);
return true;
} catch (e) {}
return false;
}
function isBigInt(obj) {
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
return false;
}
try {
bigIntValueOf.call(obj);
return true;
} catch (e) {}
return false;
}
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
function has(obj, key) {
return hasOwn.call(obj, key);
}
function toStr(obj) {
return objectToString.call(obj);
}
function nameOf(f) {
if (f.name) { return f.name; }
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
if (m) { return m[1]; }
return null;
}
function indexOf(xs, x) {
if (xs.indexOf) { return xs.indexOf(x); }
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) { return i; }
}
return -1;
}
function isMap(x) {
if (!mapSize || !x || typeof x !== 'object') {
return false;
}
try {
mapSize.call(x);
try {
setSize.call(x);
} catch (s) {
return true;
}
return x instanceof Map; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakMap(x) {
if (!weakMapHas || !x || typeof x !== 'object') {
return false;
}
try {
weakMapHas.call(x, weakMapHas);
try {
weakSetHas.call(x, weakSetHas);
} catch (s) {
return true;
}
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakRef(x) {
if (!weakRefDeref || !x || typeof x !== 'object') {
return false;
}
try {
weakRefDeref.call(x);
return true;
} catch (e) {}
return false;
}
function isSet(x) {
if (!setSize || !x || typeof x !== 'object') {
return false;
}
try {
setSize.call(x);
try {
mapSize.call(x);
} catch (m) {
return true;
}
return x instanceof Set; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakSet(x) {
if (!weakSetHas || !x || typeof x !== 'object') {
return false;
}
try {
weakSetHas.call(x, weakSetHas);
try {
weakMapHas.call(x, weakMapHas);
} catch (s) {
return true;
}
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isElement(x) {
if (!x || typeof x !== 'object') { return false; }
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
return true;
}
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
}
function inspectString(str, opts) {
if (str.length > opts.maxStringLength) {
var remaining = str.length - opts.maxStringLength;
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
}
var quoteRE = quoteREs[opts.quoteStyle || 'single'];
quoteRE.lastIndex = 0;
// eslint-disable-next-line no-control-regex
var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
return wrapQuotes(s, 'single', opts);
}
function lowbyte(c) {
var n = c.charCodeAt(0);
var x = {
8: 'b',
9: 't',
10: 'n',
12: 'f',
13: 'r'
}[n];
if (x) { return '\\' + x; }
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
}
function markBoxed(str) {
return 'Object(' + str + ')';
}
function weakCollectionOf(type) {
return type + ' { ? }';
}
function collectionOf(type, size, entries, indent) {
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
return type + ' (' + size + ') {' + joinedEntries + '}';
}
function singleLineValues(xs) {
for (var i = 0; i < xs.length; i++) {
if (indexOf(xs[i], '\n') >= 0) {
return false;
}
}
return true;
}
function getIndent(opts, depth) {
var baseIndent;
if (opts.indent === '\t') {
baseIndent = '\t';
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
baseIndent = $join.call(Array(opts.indent + 1), ' ');
} else {
return null;
}
return {
base: baseIndent,
prev: $join.call(Array(depth + 1), baseIndent)
};
}
function indentedJoin(xs, indent) {
if (xs.length === 0) { return ''; }
var lineJoiner = '\n' + indent.prev + indent.base;
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
}
function arrObjKeys(obj, inspect) {
var isArr = isArray(obj);
var xs = [];
if (isArr) {
xs.length = obj.length;
for (var i = 0; i < obj.length; i++) {
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
}
}
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
var symMap;
if (hasShammedSymbols) {
symMap = {};
for (var k = 0; k < syms.length; k++) {
symMap['$' + syms[k]] = syms[k];
}
}
for (var key in obj) { // eslint-disable-line no-restricted-syntax
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
continue; // eslint-disable-line no-restricted-syntax, no-continue
} else if ($test.call(/[^\w$]/, key)) {
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
} else {
xs.push(key + ': ' + inspect(obj[key], obj));
}
}
if (typeof gOPS === 'function') {
for (var j = 0; j < syms.length; j++) {
if (isEnumerable.call(obj, syms[j])) {
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
}
}
}
return xs;
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_Q"},E:{"1":"_nB","132":"_k"},F:{"1":"_vK _KL","2":"_qC","132":"B ZC"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"fC I _n _mN","4":"J 5D"},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:"input placeholder attribute",D:true};
@@ -0,0 +1,160 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _tokenizer = require('../parser/tokenizer');
var _types = require('../parser/tokenizer/types');
var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer);
/**
* Implementation of babel-plugin-transform-react-display-name, which adds a
* display name to usages of React.createClass and createReactClass.
*/
class ReactDisplayNameTransformer extends _Transformer2.default {
constructor(
rootTransformer,
tokens,
importProcessor,
options,
) {
super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.options = options;;
}
process() {
const startIndex = this.tokens.currentIndex();
if (this.tokens.identifierName() === "createReactClass") {
const newName =
this.importProcessor && this.importProcessor.getIdentifierReplacement("createReactClass");
if (newName) {
this.tokens.replaceToken(`(0, ${newName})`);
} else {
this.tokens.copyToken();
}
this.tryProcessCreateClassCall(startIndex);
return true;
}
if (
this.tokens.matches3(_types.TokenType.name, _types.TokenType.dot, _types.TokenType.name) &&
this.tokens.identifierName() === "React" &&
this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 2) === "createClass"
) {
const newName = this.importProcessor
? this.importProcessor.getIdentifierReplacement("React") || "React"
: "React";
if (newName) {
this.tokens.replaceToken(newName);
this.tokens.copyToken();
this.tokens.copyToken();
} else {
this.tokens.copyToken();
this.tokens.copyToken();
this.tokens.copyToken();
}
this.tryProcessCreateClassCall(startIndex);
return true;
}
return false;
}
/**
* This is called with the token position at the open-paren.
*/
tryProcessCreateClassCall(startIndex) {
const displayName = this.findDisplayName(startIndex);
if (!displayName) {
return;
}
if (this.classNeedsDisplayName()) {
this.tokens.copyExpectedToken(_types.TokenType.parenL);
this.tokens.copyExpectedToken(_types.TokenType.braceL);
this.tokens.appendCode(`displayName: '${displayName}',`);
this.rootTransformer.processBalancedCode();
this.tokens.copyExpectedToken(_types.TokenType.braceR);
this.tokens.copyExpectedToken(_types.TokenType.parenR);
}
}
findDisplayName(startIndex) {
if (startIndex < 2) {
return null;
}
if (this.tokens.matches2AtIndex(startIndex - 2, _types.TokenType.name, _types.TokenType.eq)) {
// This is an assignment (or declaration) and the LHS is either an identifier or a member
// expression ending in an identifier, so use that identifier name.
return this.tokens.identifierNameAtIndex(startIndex - 2);
}
if (
startIndex >= 2 &&
this.tokens.tokens[startIndex - 2].identifierRole === _tokenizer.IdentifierRole.ObjectKey
) {
// This is an object literal value.
return this.tokens.identifierNameAtIndex(startIndex - 2);
}
if (this.tokens.matches2AtIndex(startIndex - 2, _types.TokenType._export, _types.TokenType._default)) {
return this.getDisplayNameFromFilename();
}
return null;
}
getDisplayNameFromFilename() {
const filePath = this.options.filePath || "unknown";
const pathSegments = filePath.split("/");
const filename = pathSegments[pathSegments.length - 1];
const dotIndex = filename.lastIndexOf(".");
const baseFilename = dotIndex === -1 ? filename : filename.slice(0, dotIndex);
if (baseFilename === "index" && pathSegments[pathSegments.length - 2]) {
return pathSegments[pathSegments.length - 2];
} else {
return baseFilename;
}
}
/**
* We only want to add a display name when this is a function call containing
* one argument, which is an object literal without `displayName` as an
* existing key.
*/
classNeedsDisplayName() {
let index = this.tokens.currentIndex();
if (!this.tokens.matches2(_types.TokenType.parenL, _types.TokenType.braceL)) {
return false;
}
// The block starts on the {, and we expect any displayName key to be in
// that context. We need to ignore other other contexts to avoid matching
// nested displayName keys.
const objectStartIndex = index + 1;
const objectContextId = this.tokens.tokens[objectStartIndex].contextId;
if (objectContextId == null) {
throw new Error("Expected non-null context ID on object open-brace.");
}
for (; index < this.tokens.tokens.length; index++) {
const token = this.tokens.tokens[index];
if (token.type === _types.TokenType.braceR && token.contextId === objectContextId) {
index++;
break;
}
if (
this.tokens.identifierNameAtIndex(index) === "displayName" &&
this.tokens.tokens[index].identifierRole === _tokenizer.IdentifierRole.ObjectKey &&
token.contextId === objectContextId
) {
// We found a displayName key, so bail out.
return false;
}
}
if (index === this.tokens.tokens.length) {
throw new Error("Unexpected end of input when processing React class.");
}
// If we got this far, we know we have createClass with an object with no
// display name, so we want to proceed as long as that was the only argument.
return (
this.tokens.matches1AtIndex(index, _types.TokenType.parenR) ||
this.tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.parenR)
);
}
} exports.default = ReactDisplayNameTransformer;
@@ -0,0 +1,32 @@
/**
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
* This function also ensures that aliases do not resolve to themselves cyclically.
*
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
* @returns a set of normalised alias mappings.
*/
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
/**
* Resolves a path string to its alias if applicable, otherwise returns the original path.
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
*
* @param path - The path string to resolve.
* @param aliases - A set of alias mappings to use for resolution.
* @returns the resolved path as a string.
*/
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
/**
* Resolves a path string to its possible alias.
*
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
*/
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
/**
* Extracts the filename from a given path, excluding any directory paths and the file extension.
*
* @param path - The full path of the file from which to extract the filename.
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
*/
declare function filename(path: string): string | undefined;
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };
@@ -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 './arrow-down-a-z.js';
//# sourceMappingURL=arrow-down-az.js.map
@@ -0,0 +1 @@
{"version":3,"file":"heart-off.js","sources":["../../../src/icons/heart-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HeartOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMiIgeTE9IjIiIHgyPSIyMiIgeTI9IjIyIiAvPgogIDxwYXRoIGQ9Ik0xNi41IDE2LjUgMTIgMjFsLTctN2MtMS41LTEuNDUtMy0zLjItMy01LjVhNS41IDUuNSAwIDAgMSAyLjE0LTQuMzUiIC8+CiAgPHBhdGggZD0iTTguNzYgMy4xYzEuMTUuMjIgMi4xMy43OCAzLjI0IDEuOSAxLjUtMS41IDIuNzQtMiA0LjUtMkE1LjUgNS41IDAgMCAxIDIyIDguNWMwIDIuMTItMS4zIDMuNzgtMi42NyA1LjE3IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/heart-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 HeartOff = createLucideIcon('HeartOff', [\n ['line', { x1: '2', y1: '2', x2: '22', y2: '22', key: '1w4vcy' }],\n [\n 'path',\n { d: 'M16.5 16.5 12 21l-7-7c-1.5-1.45-3-3.2-3-5.5a5.5 5.5 0 0 1 2.14-4.35', key: '3mpagl' },\n ],\n [\n 'path',\n {\n d: 'M8.76 3.1c1.15.22 2.13.78 3.24 1.9 1.5-1.5 2.74-2 4.5-2A5.5 5.5 0 0 1 22 8.5c0 2.12-1.3 3.78-2.67 5.17',\n key: '1gh3v3',\n },\n ],\n]);\n\nexport default HeartOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CA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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"text-cursor-input.js","sources":["../../../src/icons/text-cursor-input.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TextCursorInput\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSA0aDFhMyAzIDAgMCAxIDMgMyAzIDMgMCAwIDEgMy0zaDEiIC8+CiAgPHBhdGggZD0iTTEzIDIwaC0xYTMgMyAwIDAgMS0zLTMgMyAzIDAgMCAxLTMgM0g1IiAvPgogIDxwYXRoIGQ9Ik01IDE2SDRhMiAyIDAgMCAxLTItMnYtNGEyIDIgMCAwIDEgMi0yaDEiIC8+CiAgPHBhdGggZD0iTTEzIDhoN2EyIDIgMCAwIDEgMiAydjRhMiAyIDAgMCAxLTIgMmgtNyIgLz4KICA8cGF0aCBkPSJNOSA3djEwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/text-cursor-input\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst TextCursorInput = createLucideIcon('TextCursorInput', [\n ['path', { d: 'M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1', key: '18xjzo' }],\n ['path', { d: 'M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5', key: 'fj48gi' }],\n ['path', { d: 'M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1', key: '1n9rhb' }],\n ['path', { d: 'M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7', key: '13ksps' }],\n ['path', { d: 'M9 7v10', key: '1vc8ob' }],\n]);\n\nexport default TextCursorInput;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACrE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.clearProgramCache = void 0;
exports.clearCaches = clearCaches;
const getWatchProgramsForProjects_1 = require("./create-program/getWatchProgramsForProjects");
const parser_1 = require("./parser");
const candidateTSConfigRootDirs_1 = require("./parseSettings/candidateTSConfigRootDirs");
const createParseSettings_1 = require("./parseSettings/createParseSettings");
const resolveProjectList_1 = require("./parseSettings/resolveProjectList");
/**
* Clears all of the internal caches.
* Generally you shouldn't need or want to use this.
* Examples of intended uses:
* - In tests to reset parser state to keep tests isolated.
* - In custom lint tooling that iteratively lints one project at a time to prevent OOMs.
*/
function clearCaches() {
(0, candidateTSConfigRootDirs_1.clearCandidateTSConfigRootDirs)();
(0, parser_1.clearDefaultProjectMatchedFiles)();
(0, parser_1.clearProgramCache)();
(0, getWatchProgramsForProjects_1.clearWatchCaches)();
(0, createParseSettings_1.clearTSConfigMatchCache)();
(0, createParseSettings_1.clearTSServerProjectService)();
(0, resolveProjectList_1.clearGlobCache)();
}
// TODO - delete this in next major
exports.clearProgramCache = clearCaches;
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/use-layout-effect.tsx"],
"sourcesContent": ["import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"],
"mappings": ";AAAA,YAAY,WAAW;AASvB,IAAMA,mBAAkB,YAAY,WAAiB,wBAAkB,MAAM;AAAC;",
"names": ["useLayoutEffect"]
}
@@ -0,0 +1,268 @@
/**
* @fileoverview Rule to flag comparisons to the value NaN
* @author James Allardice
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determines if the given node is a NaN `Identifier` node.
* @param {ASTNode|null} node The node to check.
* @returns {boolean} `true` if the node is 'NaN' identifier.
*/
function isNaNIdentifier(node) {
if (!node) {
return false;
}
const nodeToCheck =
node.type === "SequenceExpression" ? node.expressions.at(-1) : node;
return (
astUtils.isSpecificId(nodeToCheck, "NaN") ||
astUtils.isSpecificMemberAccess(nodeToCheck, "Number", "NaN")
);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
hasSuggestions: true,
type: "problem",
docs: {
description: "Require calls to `isNaN()` when checking for `NaN`",
recommended: true,
url: "https://eslint.org/docs/latest/rules/use-isnan",
},
schema: [
{
type: "object",
properties: {
enforceForSwitchCase: {
type: "boolean",
},
enforceForIndexOf: {
type: "boolean",
},
},
additionalProperties: false,
},
],
defaultOptions: [
{
enforceForIndexOf: false,
enforceForSwitchCase: true,
},
],
messages: {
comparisonWithNaN: "Use the isNaN function to compare with NaN.",
switchNaN:
"'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.",
caseNaN:
"'case NaN' can never match. Use Number.isNaN before the switch.",
indexOfNaN:
"Array prototype method '{{ methodName }}' cannot find NaN.",
replaceWithIsNaN: "Replace with Number.isNaN.",
replaceWithCastingAndIsNaN:
"Replace with Number.isNaN and cast to a Number.",
replaceWithFindIndex:
"Replace with Array.prototype.{{ methodName }}.",
},
},
create(context) {
const [{ enforceForIndexOf, enforceForSwitchCase }] = context.options;
const sourceCode = context.sourceCode;
const fixableOperators = new Set(["==", "===", "!=", "!=="]);
const castableOperators = new Set(["==", "!="]);
/**
* Get a fixer for a binary expression that compares to NaN.
* @param {ASTNode} node The node to fix.
* @param {function(string): string} wrapValue A function that wraps the compared value with a fix.
* @returns {function(Fixer): Fix} The fixer function.
*/
function getBinaryExpressionFixer(node, wrapValue) {
return fixer => {
const comparedValue = isNaNIdentifier(node.left)
? node.right
: node.left;
const shouldWrap = comparedValue.type === "SequenceExpression";
const shouldNegate = node.operator[0] === "!";
const negation = shouldNegate ? "!" : "";
let comparedValueText = sourceCode.getText(comparedValue);
if (shouldWrap) {
comparedValueText = `(${comparedValueText})`;
}
const fixedValue = wrapValue(comparedValueText);
return fixer.replaceText(node, `${negation}${fixedValue}`);
};
}
/**
* Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons.
* @param {ASTNode} node The node to check.
* @returns {void}
*/
function checkBinaryExpression(node) {
if (
/^(?:[<>]|[!=]=)=?$/u.test(node.operator) &&
(isNaNIdentifier(node.left) || isNaNIdentifier(node.right))
) {
const suggestedFixes = [];
const NaNNode = isNaNIdentifier(node.left)
? node.left
: node.right;
const isSequenceExpression =
NaNNode.type === "SequenceExpression";
const isSuggestable =
fixableOperators.has(node.operator) &&
!isSequenceExpression;
const isCastable = castableOperators.has(node.operator);
if (isSuggestable) {
suggestedFixes.push({
messageId: "replaceWithIsNaN",
fix: getBinaryExpressionFixer(
node,
value => `Number.isNaN(${value})`,
),
});
if (isCastable) {
suggestedFixes.push({
messageId: "replaceWithCastingAndIsNaN",
fix: getBinaryExpressionFixer(
node,
value => `Number.isNaN(Number(${value}))`,
),
});
}
}
context.report({
node,
messageId: "comparisonWithNaN",
suggest: suggestedFixes,
});
}
}
/**
* Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:`
* @param {ASTNode} node The node to check.
* @returns {void}
*/
function checkSwitchStatement(node) {
if (isNaNIdentifier(node.discriminant)) {
context.report({ node, messageId: "switchNaN" });
}
for (const switchCase of node.cases) {
if (isNaNIdentifier(switchCase.test)) {
context.report({ node: switchCase, messageId: "caseNaN" });
}
}
}
/**
* Checks the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`.
* @param {ASTNode} node The node to check.
* @returns {void}
*/
function checkCallExpression(node) {
const callee = astUtils.skipChainExpression(node.callee);
if (callee.type === "MemberExpression") {
const methodName = astUtils.getStaticPropertyName(callee);
if (
(methodName === "indexOf" ||
methodName === "lastIndexOf") &&
node.arguments.length <= 2 &&
isNaNIdentifier(node.arguments[0])
) {
/*
* To retain side effects, it's essential to address `NaN` beforehand, which
* is not possible with fixes like `arr.findIndex(Number.isNaN)`.
*/
const isSuggestable =
node.arguments[0].type !== "SequenceExpression" &&
!node.arguments[1];
const suggestedFixes = [];
if (isSuggestable) {
const shouldWrap = callee.computed;
const findIndexMethod =
methodName === "indexOf"
? "findIndex"
: "findLastIndex";
const propertyName = shouldWrap
? `"${findIndexMethod}"`
: findIndexMethod;
suggestedFixes.push({
messageId: "replaceWithFindIndex",
data: { methodName: findIndexMethod },
fix: fixer => [
fixer.replaceText(
callee.property,
propertyName,
),
fixer.replaceText(
node.arguments[0],
"Number.isNaN",
),
],
});
}
context.report({
node,
messageId: "indexOfNaN",
data: { methodName },
suggest: suggestedFixes,
});
}
}
}
const listeners = {
BinaryExpression: checkBinaryExpression,
};
if (enforceForSwitchCase) {
listeners.SwitchStatement = checkSwitchStatement;
}
if (enforceForIndexOf) {
listeners.CallExpression = checkCallExpression;
}
return listeners;
},
};
@@ -0,0 +1,218 @@
"use strict"
var Buffer = require("safer-buffer").Buffer
// Export Node.js internal encodings.
module.exports = {
// Encodings
utf8: { type: "_internal", bomAware: true },
cesu8: { type: "_internal", bomAware: true },
unicode11utf8: "utf8",
ucs2: { type: "_internal", bomAware: true },
utf16le: "ucs2",
binary: { type: "_internal" },
base64: { type: "_internal" },
hex: { type: "_internal" },
// Codec.
_internal: InternalCodec
}
// ------------------------------------------------------------------------------
function InternalCodec (codecOptions, iconv) {
this.enc = codecOptions.encodingName
this.bomAware = codecOptions.bomAware
if (this.enc === "base64") { this.encoder = InternalEncoderBase64 } else if (this.enc === "utf8") { this.encoder = InternalEncoderUtf8 } else if (this.enc === "cesu8") {
this.enc = "utf8" // Use utf8 for decoding.
this.encoder = InternalEncoderCesu8
// Add decoder for versions of Node not supporting CESU-8
if (Buffer.from("eda0bdedb2a9", "hex").toString() !== "💩") {
this.decoder = InternalDecoderCesu8
this.defaultCharUnicode = iconv.defaultCharUnicode
}
}
}
InternalCodec.prototype.encoder = InternalEncoder
InternalCodec.prototype.decoder = InternalDecoder
// ------------------------------------------------------------------------------
// We use node.js internal decoder. Its signature is the same as ours.
var StringDecoder = require("string_decoder").StringDecoder
function InternalDecoder (options, codec) {
this.decoder = new StringDecoder(codec.enc)
}
InternalDecoder.prototype.write = function (buf) {
if (!Buffer.isBuffer(buf)) {
buf = Buffer.from(buf)
}
return this.decoder.write(buf)
}
InternalDecoder.prototype.end = function () {
return this.decoder.end()
}
// ------------------------------------------------------------------------------
// Encoder is mostly trivial
function InternalEncoder (options, codec) {
this.enc = codec.enc
}
InternalEncoder.prototype.write = function (str) {
return Buffer.from(str, this.enc)
}
InternalEncoder.prototype.end = function () {
}
// ------------------------------------------------------------------------------
// Except base64 encoder, which must keep its state.
function InternalEncoderBase64 (options, codec) {
this.prevStr = ""
}
InternalEncoderBase64.prototype.write = function (str) {
str = this.prevStr + str
var completeQuads = str.length - (str.length % 4)
this.prevStr = str.slice(completeQuads)
str = str.slice(0, completeQuads)
return Buffer.from(str, "base64")
}
InternalEncoderBase64.prototype.end = function () {
return Buffer.from(this.prevStr, "base64")
}
// ------------------------------------------------------------------------------
// CESU-8 encoder is also special.
function InternalEncoderCesu8 (options, codec) {
}
InternalEncoderCesu8.prototype.write = function (str) {
var buf = Buffer.alloc(str.length * 3); var bufIdx = 0
for (var i = 0; i < str.length; i++) {
var charCode = str.charCodeAt(i)
// Naive implementation, but it works because CESU-8 is especially easy
// to convert from UTF-16 (which all JS strings are encoded in).
if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) {
buf[bufIdx++] = 0xC0 + (charCode >>> 6)
buf[bufIdx++] = 0x80 + (charCode & 0x3f)
} else { // charCode will always be < 0x10000 in javascript.
buf[bufIdx++] = 0xE0 + (charCode >>> 12)
buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f)
buf[bufIdx++] = 0x80 + (charCode & 0x3f)
}
}
return buf.slice(0, bufIdx)
}
InternalEncoderCesu8.prototype.end = function () {
}
// ------------------------------------------------------------------------------
// CESU-8 decoder is not implemented in Node v4.0+
function InternalDecoderCesu8 (options, codec) {
this.acc = 0
this.contBytes = 0
this.accBytes = 0
this.defaultCharUnicode = codec.defaultCharUnicode
}
InternalDecoderCesu8.prototype.write = function (buf) {
var acc = this.acc; var contBytes = this.contBytes; var accBytes = this.accBytes
var res = ""
for (var i = 0; i < buf.length; i++) {
var curByte = buf[i]
if ((curByte & 0xC0) !== 0x80) { // Leading byte
if (contBytes > 0) { // Previous code is invalid
res += this.defaultCharUnicode
contBytes = 0
}
if (curByte < 0x80) { // Single-byte code
res += String.fromCharCode(curByte)
} else if (curByte < 0xE0) { // Two-byte code
acc = curByte & 0x1F
contBytes = 1; accBytes = 1
} else if (curByte < 0xF0) { // Three-byte code
acc = curByte & 0x0F
contBytes = 2; accBytes = 1
} else { // Four or more are not supported for CESU-8.
res += this.defaultCharUnicode
}
} else { // Continuation byte
if (contBytes > 0) { // We're waiting for it.
acc = (acc << 6) | (curByte & 0x3f)
contBytes--; accBytes++
if (contBytes === 0) {
// Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
if (accBytes === 2 && acc < 0x80 && acc > 0) {
res += this.defaultCharUnicode
} else if (accBytes === 3 && acc < 0x800) {
res += this.defaultCharUnicode
} else {
// Actually add character.
res += String.fromCharCode(acc)
}
}
} else { // Unexpected continuation byte
res += this.defaultCharUnicode
}
}
}
this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes
return res
}
InternalDecoderCesu8.prototype.end = function () {
var res = 0
if (this.contBytes > 0) { res += this.defaultCharUnicode }
return res
}
// ------------------------------------------------------------------------------
// check the chunk boundaries for surrogate pair
function InternalEncoderUtf8 (options, codec) {
this.highSurrogate = ""
}
InternalEncoderUtf8.prototype.write = function (str) {
if (this.highSurrogate) {
str = this.highSurrogate + str
this.highSurrogate = ""
}
if (str.length > 0) {
var charCode = str.charCodeAt(str.length - 1)
if (charCode >= 0xd800 && charCode < 0xdc00) {
this.highSurrogate = str[str.length - 1]
str = str.slice(0, str.length - 1)
}
}
return Buffer.from(str, this.enc)
}
InternalEncoderUtf8.prototype.end = function () {
if (this.highSurrogate) {
var str = this.highSurrogate
this.highSurrogate = ""
return Buffer.from(str, this.enc)
}
}
@@ -0,0 +1,148 @@
import { FSLike } from "fdir";
//#region src/types.d.ts
type FileSystemAdapter = Partial<FSLike>;
interface GlobOptions {
/**
* Whether to return absolute paths. Disable to have relative paths.
* @default false
*/
absolute?: boolean;
/**
* Enables support for brace expansion syntax, like `{a,b}` or `{1..9}`.
* @default true
*/
braceExpansion?: boolean;
/**
* Whether to match in case-sensitive mode.
* @default true
*/
caseSensitiveMatch?: boolean;
/**
* The working directory in which to search. Results will be returned relative to this directory, unless
* {@link absolute} is set.
*
* It is important to avoid globbing outside this directory when possible, even with absolute paths enabled,
* as doing so can harm performance due to having to recalculate relative paths.
* @default process.cwd()
*/
cwd?: string | URL;
/**
* Logs useful debug information. Meant for development purposes. Logs can change at any time.
* @default false
*/
debug?: boolean;
/**
* Maximum directory depth to crawl.
* @default Infinity
*/
deep?: number;
/**
* Whether to return entries that start with a dot, like `.gitignore` or `.prettierrc`.
* @default false
*/
dot?: boolean;
/**
* Whether to automatically expand directory patterns.
*
* Important to disable if migrating from [`fast-glob`](https://github.com/mrmlnc/fast-glob).
* @default true
*/
expandDirectories?: boolean;
/**
* Enables support for extglobs, like `+(pattern)`.
* @default true
*/
extglob?: boolean;
/**
* Whether to traverse and include symbolic links. Can slightly affect performance.
* @default true
*/
followSymbolicLinks?: boolean;
/**
* An object that overrides `node:fs` functions.
* @default import('node:fs')
*/
fs?: FileSystemAdapter;
/**
* Enables support for matching nested directories with globstars (`**`).
* If `false`, `**` behaves exactly like `*`.
* @default true
*/
globstar?: boolean;
/**
* Glob patterns to exclude from the results.
* @default []
*/
ignore?: string | readonly string[];
/**
* Enable to only return directories.
* If `true`, disables {@link onlyFiles}.
* @default false
*/
onlyDirectories?: boolean;
/**
* Enable to only return files.
* @default true
*/
onlyFiles?: boolean;
/**
* @deprecated Provide patterns as the first argument instead.
*/
patterns?: string | readonly string[];
/**
* An `AbortSignal` to abort crawling the file system.
* @default undefined
*/
signal?: AbortSignal;
}
//#endregion
//#region src/utils.d.ts
/**
* 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}
*/
declare const convertPathToPattern: (path: string) => string;
/**
* Escapes a path's special characters depending on the platform.
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
*/
declare const escapePath: (path: string) => string;
/**
* 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}
*/
declare function isDynamicPattern(pattern: string, options?: {
caseSensitiveMatch: boolean;
}): boolean;
//#endregion
//#region src/index.d.ts
/**
* Asynchronously match files following a glob pattern.
* @see {@link https://superchupu.dev/tinyglobby/documentation#glob}
*/
declare function glob(patterns: string | readonly string[], options?: Omit<GlobOptions, "patterns">): Promise<string[]>;
/**
* @deprecated Provide patterns as the first argument instead.
*/
declare function glob(options: GlobOptions): Promise<string[]>;
/**
* Synchronously match files following a glob pattern.
* @see {@link https://superchupu.dev/tinyglobby/documentation#globSync}
*/
declare function globSync(patterns: string | readonly string[], options?: Omit<GlobOptions, "patterns">): string[];
/**
* @deprecated Provide patterns as the first argument instead.
*/
declare function globSync(options: GlobOptions): string[];
//#endregion
export { type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };
@@ -0,0 +1,6 @@
import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils';
import type { ReportDescriptor, RuleContext } from '@typescript-eslint/utils/ts-eslint';
import type { PreferOptionalChainMessageIds, PreferOptionalChainOptions } from './PreferOptionalChainOptions';
export declare function checkNullishAndReport(context: RuleContext<PreferOptionalChainMessageIds, [
PreferOptionalChainOptions
]>, parserServices: ParserServicesWithTypeInformation, { requireNullish }: PreferOptionalChainOptions, maybeNullishNodes: TSESTree.Expression[], descriptor: ReportDescriptor<PreferOptionalChainMessageIds>): void;
@@ -0,0 +1,747 @@
const { humanReadableArgName } = require('./argument.js');
/**
* TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`
* https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types
* @typedef { import("./argument.js").Argument } Argument
* @typedef { import("./command.js").Command } Command
* @typedef { import("./option.js").Option } Option
*/
// Although this is a class, methods are static in style to allow override using subclass or just functions.
class Help {
constructor() {
this.helpWidth = undefined;
this.minWidthToWrap = 40;
this.sortSubcommands = false;
this.sortOptions = false;
this.showGlobalOptions = false;
}
/**
* prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
* and just before calling `formatHelp()`.
*
* Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.
*
* @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions
*/
prepareContext(contextOptions) {
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
}
/**
* Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
*
* @param {Command} cmd
* @returns {Command[]}
*/
visibleCommands(cmd) {
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
const helpCommand = cmd._getHelpCommand();
if (helpCommand && !helpCommand._hidden) {
visibleCommands.push(helpCommand);
}
if (this.sortSubcommands) {
visibleCommands.sort((a, b) => {
// @ts-ignore: because overloaded return type
return a.name().localeCompare(b.name());
});
}
return visibleCommands;
}
/**
* Compare options for sort.
*
* @param {Option} a
* @param {Option} b
* @returns {number}
*/
compareOptions(a, b) {
const getSortKey = (option) => {
// WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.
return option.short
? option.short.replace(/^-/, '')
: option.long.replace(/^--/, '');
};
return getSortKey(a).localeCompare(getSortKey(b));
}
/**
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
*
* @param {Command} cmd
* @returns {Option[]}
*/
visibleOptions(cmd) {
const visibleOptions = cmd.options.filter((option) => !option.hidden);
// Built-in help option.
const helpOption = cmd._getHelpOption();
if (helpOption && !helpOption.hidden) {
// Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.
const removeShort = helpOption.short && cmd._findOption(helpOption.short);
const removeLong = helpOption.long && cmd._findOption(helpOption.long);
if (!removeShort && !removeLong) {
visibleOptions.push(helpOption); // no changes needed
} else if (helpOption.long && !removeLong) {
visibleOptions.push(
cmd.createOption(helpOption.long, helpOption.description),
);
} else if (helpOption.short && !removeShort) {
visibleOptions.push(
cmd.createOption(helpOption.short, helpOption.description),
);
}
}
if (this.sortOptions) {
visibleOptions.sort(this.compareOptions);
}
return visibleOptions;
}
/**
* Get an array of the visible global options. (Not including help.)
*
* @param {Command} cmd
* @returns {Option[]}
*/
visibleGlobalOptions(cmd) {
if (!this.showGlobalOptions) return [];
const globalOptions = [];
for (
let ancestorCmd = cmd.parent;
ancestorCmd;
ancestorCmd = ancestorCmd.parent
) {
const visibleOptions = ancestorCmd.options.filter(
(option) => !option.hidden,
);
globalOptions.push(...visibleOptions);
}
if (this.sortOptions) {
globalOptions.sort(this.compareOptions);
}
return globalOptions;
}
/**
* Get an array of the arguments if any have a description.
*
* @param {Command} cmd
* @returns {Argument[]}
*/
visibleArguments(cmd) {
// Side effect! Apply the legacy descriptions before the arguments are displayed.
if (cmd._argsDescription) {
cmd.registeredArguments.forEach((argument) => {
argument.description =
argument.description || cmd._argsDescription[argument.name()] || '';
});
}
// If there are any arguments with a description then return all the arguments.
if (cmd.registeredArguments.find((argument) => argument.description)) {
return cmd.registeredArguments;
}
return [];
}
/**
* Get the command term to show in the list of subcommands.
*
* @param {Command} cmd
* @returns {string}
*/
subcommandTerm(cmd) {
// Legacy. Ignores custom usage string, and nested commands.
const args = cmd.registeredArguments
.map((arg) => humanReadableArgName(arg))
.join(' ');
return (
cmd._name +
(cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
(cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
(args ? ' ' + args : '')
);
}
/**
* Get the option term to show in the list of options.
*
* @param {Option} option
* @returns {string}
*/
optionTerm(option) {
return option.flags;
}
/**
* Get the argument term to show in the list of arguments.
*
* @param {Argument} argument
* @returns {string}
*/
argumentTerm(argument) {
return argument.name();
}
/**
* Get the longest command term length.
*
* @param {Command} cmd
* @param {Help} helper
* @returns {number}
*/
longestSubcommandTermLength(cmd, helper) {
return helper.visibleCommands(cmd).reduce((max, command) => {
return Math.max(
max,
this.displayWidth(
helper.styleSubcommandTerm(helper.subcommandTerm(command)),
),
);
}, 0);
}
/**
* Get the longest option term length.
*
* @param {Command} cmd
* @param {Help} helper
* @returns {number}
*/
longestOptionTermLength(cmd, helper) {
return helper.visibleOptions(cmd).reduce((max, option) => {
return Math.max(
max,
this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),
);
}, 0);
}
/**
* Get the longest global option term length.
*
* @param {Command} cmd
* @param {Help} helper
* @returns {number}
*/
longestGlobalOptionTermLength(cmd, helper) {
return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
return Math.max(
max,
this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),
);
}, 0);
}
/**
* Get the longest argument term length.
*
* @param {Command} cmd
* @param {Help} helper
* @returns {number}
*/
longestArgumentTermLength(cmd, helper) {
return helper.visibleArguments(cmd).reduce((max, argument) => {
return Math.max(
max,
this.displayWidth(
helper.styleArgumentTerm(helper.argumentTerm(argument)),
),
);
}, 0);
}
/**
* Get the command usage to be displayed at the top of the built-in help.
*
* @param {Command} cmd
* @returns {string}
*/
commandUsage(cmd) {
// Usage
let cmdName = cmd._name;
if (cmd._aliases[0]) {
cmdName = cmdName + '|' + cmd._aliases[0];
}
let ancestorCmdNames = '';
for (
let ancestorCmd = cmd.parent;
ancestorCmd;
ancestorCmd = ancestorCmd.parent
) {
ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;
}
return ancestorCmdNames + cmdName + ' ' + cmd.usage();
}
/**
* Get the description for the command.
*
* @param {Command} cmd
* @returns {string}
*/
commandDescription(cmd) {
// @ts-ignore: because overloaded return type
return cmd.description();
}
/**
* Get the subcommand summary to show in the list of subcommands.
* (Fallback to description for backwards compatibility.)
*
* @param {Command} cmd
* @returns {string}
*/
subcommandDescription(cmd) {
// @ts-ignore: because overloaded return type
return cmd.summary() || cmd.description();
}
/**
* Get the option description to show in the list of options.
*
* @param {Option} option
* @return {string}
*/
optionDescription(option) {
const extraInfo = [];
if (option.argChoices) {
extraInfo.push(
// use stringify to match the display of the default value
`choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,
);
}
if (option.defaultValue !== undefined) {
// default for boolean and negated more for programmer than end user,
// but show true/false for boolean option as may be for hand-rolled env or config processing.
const showDefault =
option.required ||
option.optional ||
(option.isBoolean() && typeof option.defaultValue === 'boolean');
if (showDefault) {
extraInfo.push(
`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,
);
}
}
// preset for boolean and negated are more for programmer than end user
if (option.presetArg !== undefined && option.optional) {
extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);
}
if (option.envVar !== undefined) {
extraInfo.push(`env: ${option.envVar}`);
}
if (extraInfo.length > 0) {
const extraDescription = `(${extraInfo.join(', ')})`;
if (option.description) {
return `${option.description} ${extraDescription}`;
}
return extraDescription;
}
return option.description;
}
/**
* Get the argument description to show in the list of arguments.
*
* @param {Argument} argument
* @return {string}
*/
argumentDescription(argument) {
const extraInfo = [];
if (argument.argChoices) {
extraInfo.push(
// use stringify to match the display of the default value
`choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,
);
}
if (argument.defaultValue !== undefined) {
extraInfo.push(
`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,
);
}
if (extraInfo.length > 0) {
const extraDescription = `(${extraInfo.join(', ')})`;
if (argument.description) {
return `${argument.description} ${extraDescription}`;
}
return extraDescription;
}
return argument.description;
}
/**
* Format a list of items, given a heading and an array of formatted items.
*
* @param {string} heading
* @param {string[]} items
* @param {Help} helper
* @returns string[]
*/
formatItemList(heading, items, helper) {
if (items.length === 0) return [];
return [helper.styleTitle(heading), ...items, ''];
}
/**
* Group items by their help group heading.
*
* @param {Command[] | Option[]} unsortedItems
* @param {Command[] | Option[]} visibleItems
* @param {Function} getGroup
* @returns {Map<string, Command[] | Option[]>}
*/
groupItems(unsortedItems, visibleItems, getGroup) {
const result = new Map();
// Add groups in order of appearance in unsortedItems.
unsortedItems.forEach((item) => {
const group = getGroup(item);
if (!result.has(group)) result.set(group, []);
});
// Add items in order of appearance in visibleItems.
visibleItems.forEach((item) => {
const group = getGroup(item);
if (!result.has(group)) {
result.set(group, []);
}
result.get(group).push(item);
});
return result;
}
/**
* Generate the built-in help text.
*
* @param {Command} cmd
* @param {Help} helper
* @returns {string}
*/
formatHelp(cmd, helper) {
const termWidth = helper.padWidth(cmd, helper);
const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called
function callFormatItem(term, description) {
return helper.formatItem(term, termWidth, description, helper);
}
// Usage
let output = [
`${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,
'',
];
// Description
const commandDescription = helper.commandDescription(cmd);
if (commandDescription.length > 0) {
output = output.concat([
helper.boxWrap(
helper.styleCommandDescription(commandDescription),
helpWidth,
),
'',
]);
}
// Arguments
const argumentList = helper.visibleArguments(cmd).map((argument) => {
return callFormatItem(
helper.styleArgumentTerm(helper.argumentTerm(argument)),
helper.styleArgumentDescription(helper.argumentDescription(argument)),
);
});
output = output.concat(
this.formatItemList('Arguments:', argumentList, helper),
);
// Options
const optionGroups = this.groupItems(
cmd.options,
helper.visibleOptions(cmd),
(option) => option.helpGroupHeading ?? 'Options:',
);
optionGroups.forEach((options, group) => {
const optionList = options.map((option) => {
return callFormatItem(
helper.styleOptionTerm(helper.optionTerm(option)),
helper.styleOptionDescription(helper.optionDescription(option)),
);
});
output = output.concat(this.formatItemList(group, optionList, helper));
});
if (helper.showGlobalOptions) {
const globalOptionList = helper
.visibleGlobalOptions(cmd)
.map((option) => {
return callFormatItem(
helper.styleOptionTerm(helper.optionTerm(option)),
helper.styleOptionDescription(helper.optionDescription(option)),
);
});
output = output.concat(
this.formatItemList('Global Options:', globalOptionList, helper),
);
}
// Commands
const commandGroups = this.groupItems(
cmd.commands,
helper.visibleCommands(cmd),
(sub) => sub.helpGroup() || 'Commands:',
);
commandGroups.forEach((commands, group) => {
const commandList = commands.map((sub) => {
return callFormatItem(
helper.styleSubcommandTerm(helper.subcommandTerm(sub)),
helper.styleSubcommandDescription(helper.subcommandDescription(sub)),
);
});
output = output.concat(this.formatItemList(group, commandList, helper));
});
return output.join('\n');
}
/**
* Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.
*
* @param {string} str
* @returns {number}
*/
displayWidth(str) {
return stripColor(str).length;
}
/**
* Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
*
* @param {string} str
* @returns {string}
*/
styleTitle(str) {
return str;
}
styleUsage(str) {
// Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:
// command subcommand [options] [command] <foo> [bar]
return str
.split(' ')
.map((word) => {
if (word === '[options]') return this.styleOptionText(word);
if (word === '[command]') return this.styleSubcommandText(word);
if (word[0] === '[' || word[0] === '<')
return this.styleArgumentText(word);
return this.styleCommandText(word); // Restrict to initial words?
})
.join(' ');
}
styleCommandDescription(str) {
return this.styleDescriptionText(str);
}
styleOptionDescription(str) {
return this.styleDescriptionText(str);
}
styleSubcommandDescription(str) {
return this.styleDescriptionText(str);
}
styleArgumentDescription(str) {
return this.styleDescriptionText(str);
}
styleDescriptionText(str) {
return str;
}
styleOptionTerm(str) {
return this.styleOptionText(str);
}
styleSubcommandTerm(str) {
// This is very like usage with lots of parts! Assume default string which is formed like:
// subcommand [options] <foo> [bar]
return str
.split(' ')
.map((word) => {
if (word === '[options]') return this.styleOptionText(word);
if (word[0] === '[' || word[0] === '<')
return this.styleArgumentText(word);
return this.styleSubcommandText(word); // Restrict to initial words?
})
.join(' ');
}
styleArgumentTerm(str) {
return this.styleArgumentText(str);
}
styleOptionText(str) {
return str;
}
styleArgumentText(str) {
return str;
}
styleSubcommandText(str) {
return str;
}
styleCommandText(str) {
return str;
}
/**
* Calculate the pad width from the maximum term length.
*
* @param {Command} cmd
* @param {Help} helper
* @returns {number}
*/
padWidth(cmd, helper) {
return Math.max(
helper.longestOptionTermLength(cmd, helper),
helper.longestGlobalOptionTermLength(cmd, helper),
helper.longestSubcommandTermLength(cmd, helper),
helper.longestArgumentTermLength(cmd, helper),
);
}
/**
* Detect manually wrapped and indented strings by checking for line break followed by whitespace.
*
* @param {string} str
* @returns {boolean}
*/
preformatted(str) {
return /\n[^\S\r\n]/.test(str);
}
/**
* Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
*
* So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
* TTT DDD DDDD
* DD DDD
*
* @param {string} term
* @param {number} termWidth
* @param {string} description
* @param {Help} helper
* @returns {string}
*/
formatItem(term, termWidth, description, helper) {
const itemIndent = 2;
const itemIndentStr = ' '.repeat(itemIndent);
if (!description) return itemIndentStr + term;
// Pad the term out to a consistent width, so descriptions are aligned.
const paddedTerm = term.padEnd(
termWidth + term.length - helper.displayWidth(term),
);
// Format the description.
const spacerWidth = 2; // between term and description
const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called
const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;
let formattedDescription;
if (
remainingWidth < this.minWidthToWrap ||
helper.preformatted(description)
) {
formattedDescription = description;
} else {
const wrappedDescription = helper.boxWrap(description, remainingWidth);
formattedDescription = wrappedDescription.replace(
/\n/g,
'\n' + ' '.repeat(termWidth + spacerWidth),
);
}
// Construct and overall indent.
return (
itemIndentStr +
paddedTerm +
' '.repeat(spacerWidth) +
formattedDescription.replace(/\n/g, `\n${itemIndentStr}`)
);
}
/**
* Wrap a string at whitespace, preserving existing line breaks.
* Wrapping is skipped if the width is less than `minWidthToWrap`.
*
* @param {string} str
* @param {number} width
* @returns {string}
*/
boxWrap(str, width) {
if (width < this.minWidthToWrap) return str;
const rawLines = str.split(/\r\n|\n/);
// split up text by whitespace
const chunkPattern = /[\s]*[^\s]+/g;
const wrappedLines = [];
rawLines.forEach((line) => {
const chunks = line.match(chunkPattern);
if (chunks === null) {
wrappedLines.push('');
return;
}
let sumChunks = [chunks.shift()];
let sumWidth = this.displayWidth(sumChunks[0]);
chunks.forEach((chunk) => {
const visibleWidth = this.displayWidth(chunk);
// Accumulate chunks while they fit into width.
if (sumWidth + visibleWidth <= width) {
sumChunks.push(chunk);
sumWidth += visibleWidth;
return;
}
wrappedLines.push(sumChunks.join(''));
const nextChunk = chunk.trimStart(); // trim space at line break
sumChunks = [nextChunk];
sumWidth = this.displayWidth(nextChunk);
});
wrappedLines.push(sumChunks.join(''));
});
return wrappedLines.join('\n');
}
}
/**
* Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.
*
* @param {string} str
* @returns {string}
* @package
*/
function stripColor(str) {
// eslint-disable-next-line no-control-regex
const sgrPattern = /\x1b\[\d*(;\d*)*m/g;
return str.replace(sgrPattern, '');
}
exports.Help = Help;
exports.stripColor = stripColor;
@@ -0,0 +1 @@
{"version":3,"file":"stdio.js","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CAAC;YAE/F,IAAI,cAAc,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACnC,IAAI,CAAC;oBACD,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACnC,CAAC;gBAAC,MAAM,CAAC;oBACL,SAAS;gBACb,CAAC;gBAED,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;YACnG,CAAC;YAED,IAAI,cAAc,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACnC,IAAI,CAAC;oBACD,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACnC,CAAC;gBAAC,MAAM,CAAC;oBACL,SAAS;gBACb,CAAC;YACL,CAAC;QACL,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,CAAC,OAAuB;QACxB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YACrC,CAAC;YAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YACLine truncated
@@ -0,0 +1 @@
{"version":3,"names":["_nullishReceiverError","r","TypeError"],"sources":["../../src/helpers/nullishReceiverError.js"],"sourcesContent":["/* @minVersion 7.22.6 */\n\n// eslint-disable-next-line no-unused-vars\nexport default function _nullishReceiverError(r) {\n throw new TypeError(\"Cannot set property of null or undefined.\");\n}\n"],"mappings":";;;;;;AAGe,SAASA,qBAAqBA,CAACC,CAAC,EAAE;EAC/C,MAAM,IAAIC,SAAS,CAAC,2CAA2C,CAAC;AAClE","ignoreList":[]}
@@ -0,0 +1,16 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/helper/streaming/utils.ts
let isOldBunVersion = () => {
const version = typeof Bun !== "undefined" ? Bun.version : void 0;
if (version === void 0) return false;
const result = version.startsWith("1.1") || version.startsWith("1.0") || version.startsWith("0.");
isOldBunVersion = () => result;
return result;
};
//#endregion
Object.defineProperty(exports, "isOldBunVersion", {
enumerable: true,
get: function() {
return isOldBunVersion;
}
});
@@ -0,0 +1,4 @@
import { createTailwindMerge } from './create-tailwind-merge'
import { getDefaultConfig } from './default-config'
export const twMerge = createTailwindMerge(getDefaultConfig)
@@ -0,0 +1,206 @@
'use strict'
const path = require('path')
const nopt = require('nopt')
const log = require('./log')
const childProcess = require('child_process')
const { EventEmitter } = require('events')
const commands = [
// Module build commands
'build',
'clean',
'configure',
'rebuild',
// Development Header File management commands
'install',
'list',
'remove'
]
class Gyp extends EventEmitter {
/**
* Export the contents of the package.json.
*/
package = require('../package.json')
/**
* nopt configuration definitions
*/
configDefs = {
help: Boolean, // everywhere
arch: String, // 'configure'
cafile: String, // 'install'
debug: Boolean, // 'build'
directory: String, // bin
make: String, // 'build'
'msvs-version': String, // 'configure'
ensure: Boolean, // 'install'
solution: String, // 'build' (windows only)
proxy: String, // 'install'
noproxy: String, // 'install'
devdir: String, // everywhere
nodedir: String, // 'configure'
loglevel: String, // everywhere
python: String, // 'configure'
'dist-url': String, // 'install'
tarball: String, // 'install'
jobs: String, // 'build'
thin: String, // 'configure'
'force-process-config': Boolean // 'configure'
}
/**
* nopt shorthands
*/
shorthands = {
release: '--no-debug',
C: '--directory',
debug: '--debug',
j: '--jobs',
// the README documents --msvs_version, but the option is declared as
// msvs-version, and only npm_config_* env vars get underscores converted
msvs_version: '--msvs-version',
silly: '--loglevel=silly',
verbose: '--loglevel=verbose',
silent: '--loglevel=silent'
}
/**
* expose the command aliases for the bin file to use.
*/
aliases = {
ls: 'list',
rm: 'remove'
}
constructor (...args) {
super(...args)
this.devDir = ''
this.commands = commands.reduce((acc, command) => {
acc[command] = (argv) => require('./' + command)(this, argv)
return acc
}, {})
Object.defineProperty(this, 'version', {
enumerable: true,
get: function () { return this.package.version }
})
}
/**
* Parses the given argv array and sets the 'opts',
* 'argv' and 'command' properties.
*/
parseArgv (argv) {
this.opts = nopt(this.configDefs, this.shorthands, argv)
this.argv = this.opts.argv.remain.slice()
// the environment is read below and would overwrite this, but an explicit
// --loglevel on the command line should win over npm's inherited loglevel
const cliLoglevel = this.opts.loglevel
const commands = this.todo = []
// create a copy of the argv array with aliases mapped
argv = this.argv.map((arg) => {
// is this an alias?
if (arg in this.aliases) {
arg = this.aliases[arg]
}
return arg
})
// process the mapped args into "command" objects ("name" and "args" props)
argv.slice().forEach((arg) => {
if (arg in this.commands) {
const args = argv.splice(0, argv.indexOf(arg))
argv.shift()
if (commands.length > 0) {
commands[commands.length - 1].args = args
}
commands.push({ name: arg, args: [] })
}
})
if (commands.length > 0) {
commands[commands.length - 1].args = argv.splice(0)
}
// support for inheriting config env variables from npm
// npm will set environment variables in the following forms:
// - `npm_config_<key>` for values from npm's own config. Setting arbitrary
// options on npm's config was deprecated in npm v11 but node-gyp still
// supports it for backwards compatibility.
// See https://github.com/nodejs/node-gyp/issues/3156
// - `npm_package_config_node_gyp_<key>` for values from the `config` object
// in package.json. This is the preferred way to set options for node-gyp
// since npm v11. The `node_gyp_` prefix is used to avoid conflicts with
// other tools.
// The `npm_package_config_node_gyp_` prefix will take precedence over
// `npm_config_` keys.
const npmConfigPrefix = /^npm_config_/i
const npmPackageConfigPrefix = /^npm_package_config_node_gyp_/i
const configEnvKeys = Object.keys(process.env)
.filter((k) => npmConfigPrefix.test(k) || npmPackageConfigPrefix.test(k))
// sort so that npm_package_config_node_gyp_ keys come last and will override
.sort((a) => npmConfigPrefix.test(a) ? -1 : 1)
for (const key of configEnvKeys) {
// add the user-defined options to the config
const name = npmConfigPrefix.test(key)
? key.replace(npmConfigPrefix, '')
: key.replace(npmPackageConfigPrefix, '')
// gyp@741b7f1 enters an infinite loop when it encounters
// zero-length options so ensure those don't get through.
if (name) {
// convert names like force_process_config to force-process-config
// and convert to lowercase
this.opts[name.replaceAll('_', '-').toLowerCase()] = process.env[key]
}
}
const loglevel = cliLoglevel || this.opts.loglevel
if (loglevel) {
log.logger.level = loglevel
delete this.opts.loglevel
}
log.resume()
}
/**
* Spawns a child process and emits a 'spawn' event.
*/
spawn (command, args, opts) {
if (!opts) {
opts = {}
}
if (!opts.silent && !opts.stdio) {
opts.stdio = [0, 1, 2]
}
const cp = childProcess.spawn(command, args, opts)
log.info('spawn', command)
log.info('spawn args', args)
return cp
}
/**
* Returns the usage instructions for node-gyp.
*/
usage () {
return [
'',
' Usage: node-gyp <command> [options]',
'',
' where <command> is one of:',
commands.map((c) => ' - ' + c + ' - ' + require('./' + c).usage).join('\n'),
'',
'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'),
'node@' + process.versions.node
].join('\n')
}
}
module.exports = () => new Gyp()
module.exports.Gyp = Gyp
@@ -0,0 +1,20 @@
# MIT License
Copyright 2023 Nathan Friedly, Vedant K
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,32 @@
/**
* @link https://davidwalsh.name/javascript-debounce-function
* @param func needs to implement a function which is debounced
* @param wait how long do you want to wait till the previous declared function is executed
* @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.
*/
var debounce = (func, wait, isImmediate) => {
let timeout;
return function debounce(...args) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const context = this;
const later = () => {
timeout = undefined;
if (!isImmediate) {
func.apply(context, args);
}
};
const shouldCallNow = isImmediate && !timeout;
if (timeout !== undefined) {
clearTimeout(timeout);
}
timeout = setTimeout(later, wait);
if (shouldCallNow) {
func.apply(context, args);
return;
}
return undefined;
};
};
export { debounce as default };
//# sourceMappingURL=debounce.mjs.map
@@ -0,0 +1,799 @@
'use strict'
/** @type {(value: string) => boolean} */
const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu)
/** @type {(value: string) => boolean} */
const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u)
/** @type {(value: string) => boolean} */
const isPort = RegExp.prototype.test.bind(/^\d*$/u)
/** @type {(value: string) => boolean} */
const isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu)
/** @type {(value: string) => boolean} */
const isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu)
/** @type {(value: string) => boolean} */
const isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u)
/** @type {(value: string) => boolean} */
const isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u)
/** @type {(value: string) => boolean} */
const isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u)
const BYTE_HEX = new Array(256)
{
const HEX_DIGITS = '0123456789ABCDEF'
for (let i = 0; i < 256; i++) {
BYTE_HEX[i] = '%' + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 0xF]
}
}
function percentEncodeNonAscii (cp) {
if (cp < 0x800) {
return BYTE_HEX[0xC0 | (cp >> 6)] +
BYTE_HEX[0x80 | (cp & 0x3F)]
}
if (cp < 0x10000) {
return BYTE_HEX[0xE0 | (cp >> 12)] +
BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +
BYTE_HEX[0x80 | (cp & 0x3F)]
}
return BYTE_HEX[0xF0 | (cp >> 18)] +
BYTE_HEX[0x80 | ((cp >> 12) & 0x3F)] +
BYTE_HEX[0x80 | ((cp >> 6) & 0x3F)] +
BYTE_HEX[0x80 | (cp & 0x3F)]
}
/**
* @param {Array<string>} input
* @returns {string}
*/
function stringArrayToHexStripped (input) {
let acc = ''
let code = 0
let i = 0
for (i = 0; i < input.length; i++) {
code = input[i].charCodeAt(0)
if (code === 48) {
continue
}
if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {
return ''
}
acc += input[i]
break
}
for (i += 1; i < input.length; i++) {
code = input[i].charCodeAt(0)
if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {
return ''
}
acc += input[i]
}
return acc
}
/** @type {(value: string) => boolean} */
const isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/)
/** @type {(value: string) => boolean} */
const isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/)
/** @type {(value: string) => boolean} */
const isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/)
/**
* @param {string} value
* @returns {boolean}
*/
const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u)
/**
* @param {string} zone
* @returns {boolean}
*/
function isZoneIdentifier (zone) {
if (zone.length === 0) return false
for (let i = 0; i < zone.length; i++) {
if (isZoneCharacter(zone[i])) continue
if (zone[i] === '%' && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
i += 2
continue
}
return false
}
return true
}
/**
* Compresses the longest run of zero hextets to "::" per RFC 5952. A run of a
* single zero hextet is left uncompressed. On ties the leftmost run wins.
*
* @param {string[]} hextets
* @returns {string}
*/
function compressIPv6ZeroRun (hextets) {
let bestStart = -1
let bestLength = 0
let runStart = -1
let runLength = 0
for (let i = 0; i < hextets.length; i++) {
if (hextets[i] === '0') {
if (runStart === -1) runStart = i
runLength++
if (runLength > bestLength) {
bestLength = runLength
bestStart = runStart
}
} else {
runStart = -1
runLength = 0
}
}
if (bestLength < 2) return hextets.join(':')
const head = hextets.slice(0, bestStart).join(':')
const tail = hextets.slice(bestStart + bestLength).join(':')
return head + '::' + tail
}
/**
* Validates an IPv6 address against the alternatives in RFC 3986 section
* 3.2.2 and returns the same address with leading hextet zeroes removed.
* An embedded IPv4 address counts as two hextets and is only valid at the end.
*
* @param {string} input
* @returns {string|undefined}
*/
function normalizeIPv6Address (input) {
const compression = input.indexOf('::')
if (compression !== -1 && input.indexOf('::', compression + 1) !== -1) return undefined
const left = compression === -1 ? input.split(':') : input.slice(0, compression).split(':')
const right = compression === -1 ? [] : input.slice(compression + 2).split(':')
if (compression !== -1) {
if (left.length === 1 && left[0] === '') left.length = 0
if (right.length === 1 && right[0] === '') right.length = 0
}
const parts = left.concat(right)
let hextetCount = 0
for (let i = 0; i < parts.length; i++) {
const part = parts[i]
if (part === '') return undefined
if (part.indexOf('.') !== -1) {
if (i !== parts.length - 1 || (compression !== -1 && right.length === 0) || !isIPv4(part)) return undefined
hextetCount += 2
continue
}
if (!isHextet(part)) return undefined
parts[i] = parseInt(part, 16).toString(16)
hextetCount++
}
if (compression === -1) {
if (hextetCount !== 8) return undefined
return compressIPv6ZeroRun(parts)
}
if (hextetCount >= 8) return undefined
// expand "::" then re-compress the longest run for a canonical result
const expanded = parts.slice(0, left.length)
for (let i = hextetCount; i < 8; i++) expanded.push('0')
for (let i = left.length; i < parts.length; i++) expanded.push(parts[i])
return compressIPv6ZeroRun(expanded)
}
/**
* @typedef {Object} NormalizeIPv6Result
* @property {string} host - The normalized host.
* @property {string} [escapedHost] - The escaped host.
* @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.
* @property {boolean} [isIPVFuture] - Indicates if the host is an IPvFuture literal.
* @property {boolean} [error] - Indicates if a bracketed IP literal is malformed.
*/
/**
* Validates and normalizes a bracketed IP literal. Raw zone separators remain
* accepted for backwards compatibility, while encoded separators and zone
* contents follow RFC 6874.
*
* @param {string} host
* @returns {NormalizeIPv6Result}
*/
function normalizeIPv6 (host) {
const bracketed = host[0] === '[' && host[host.length - 1] === ']'
const hasBracket = host[0] === '[' || host[host.length - 1] === ']'
if (hasBracket && !bracketed) return { host, isIPV6: false, error: true }
let input = bracketed ? host.slice(1, -1) : host
if (bracketed && isIPvFuture(input)) {
input = input.toLowerCase()
return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true }
}
if (findToken(input, ':') < 2) {
return { host, isIPV6: false, error: bracketed }
}
let zoneIdentifier = ''
const zoneSeparator = input.indexOf('%')
if (zoneSeparator !== -1) {
const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === '%25' ? 3 : 1
zoneIdentifier = input.slice(zoneSeparator + separatorLength)
if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true }
input = input.slice(0, zoneSeparator)
}
const address = normalizeIPv6Address(input)
if (address === undefined) return { host, isIPV6: false, error: true }
return {
host: address + (zoneIdentifier ? '%' + zoneIdentifier : ''),
escapedHost: address + (zoneIdentifier ? '%25' + zoneIdentifier : ''),
isIPV6: true
}
}
/**
* @param {string} str
* @param {string} token
* @returns {number}
*/
function findToken (str, token) {
let ind = 0
for (let i = 0; i < str.length; i++) {
if (str[i] === token) ind++
}
return ind
}
/**
* @param {string} path
* @returns {string}
*
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4
*/
function removeDotSegments (path) {
let input = path
const output = []
let nextSlash = -1
let len = 0
// eslint-disable-next-line no-cond-assign
while (len = input.length) {
if (len === 1) {
if (input === '.') {
break
} else if (input === '/') {
output.push('/')
break
} else {
output.push(input)
break
}
} else if (len === 2) {
if (input[0] === '.') {
if (input[1] === '.') {
break
} else if (input[1] === '/') {
input = input.slice(2)
continue
}
} else if (input[0] === '/') {
if (input[1] === '.' || input[1] === '/') {
output.push('/')
break
}
}
} else if (len === 3) {
if (input === '/..') {
if (output.length !== 0) {
output.pop()
}
output.push('/')
break
}
}
if (input[0] === '.') {
if (input[1] === '.') {
if (input[2] === '/') {
input = input.slice(3)
continue
}
} else if (input[1] === '/') {
input = input.slice(2)
continue
}
} else if (input[0] === '/') {
if (input[1] === '.') {
if (input[2] === '/') {
input = input.slice(2)
continue
} else if (input[2] === '.') {
if (input[3] === '/') {
input = input.slice(3)
if (output.length !== 0) {
output.pop()
}
continue
}
}
}
}
// Rule 2E: Move normal path segment to output
if ((nextSlash = input.indexOf('/', 1)) === -1) {
output.push(input)
break
} else {
output.push(input.slice(0, nextSlash))
input = input.slice(nextSlash)
}
}
return output.join('')
}
/**
* Removes dot segments from the path of a relative reference (a path that does
* not start with "/") without changing what it resolves to against any base.
* Unlike `removeDotSegments`, leading ".." segments that cannot be collapsed
* are kept, the result never becomes root-relative, and a result that would be
* empty or start with an empty segment is prefixed with "." (an empty path
* means "same document" and a leading "//" would introduce an authority).
*
* @param {string} path
* @returns {string}
*/
function removeDotSegmentsRelative (path) {
if (path === '' || path[0] === '/') {
return removeDotSegments(path)
}
const segments = path.split('/')
const last = segments.length - 1
/** @type {string[]} */
const output = []
let trailingDirectory = false
for (let i = 0; i <= last; i++) {
const segment = segments[i]
if (segment === '.' || segment === '..') {
if (segment === '..') {
if (output.length !== 0 && output[output.length - 1] !== '..') {
output.pop()
} else {
output.push('..')
}
}
trailingDirectory = i === last
} else {
output.push(segment)
}
}
if (trailingDirectory && output[output.length - 1] !== '..') {
output.push('')
}
if (output.length === 0 || output[0] === '' || output[0].includes(':')) {
// An empty path, a leading empty segment ("//"), or a first segment
// containing ":" (which would be mistaken for a scheme, RFC 3986 section
// 4.2) must stay behind a "." segment so the reference keeps its meaning.
output.unshift('.')
}
return output.join('/')
}
/**
* Re-escape RFC 3986 gen-delims that must not appear literally in the host.
* After the URI regex parses, these characters cannot be literal in the host
* field, so any that appear after decoding came from percent-encoding and
* must be restored to prevent authority structure changes.
*
* @param {string} host
* @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)
* @returns {string}
*/
const HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }
const HOST_DELIM_RE = /[@/?#:]/g
const HOST_DELIM_NO_COLON_RE = /[@/?#]/g
function reescapeHostDelimiters (host, isIP) {
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE
re.lastIndex = 0
return host.replace(re, (ch) => HOST_DELIMS[ch])
}
/**
* Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.
* Reserved delimiters such as `%2F` stay escaped; `%2E` is unreserved.
*
* @param {string} input
* @param {boolean} [decodeUnreserved=false]
* @returns {string}
*/
function normalizePercentEncoding (input, decodeUnreserved = false) {
if (input.indexOf('%') === -1) {
return input
}
let output = ''
for (let i = 0; i < input.length; i++) {
if (input[i] === '%' && i + 2 < input.length) {
const hex = input.slice(i + 1, i + 3)
if (isHexPair(hex)) {
const normalizedHex = hex.toUpperCase()
const decoded = String.fromCharCode(parseInt(normalizedHex, 16))
if (decodeUnreserved && isUnreserved(decoded)) {
output += decoded
} else {
output += '%' + normalizedHex
}
i += 2
continue
}
}
output += input[i]
}
return output
}
/**
* Normalizes path data without turning reserved escapes into live path syntax.
* Valid escapes are uppercased, raw unsafe characters are escaped, and only
* unreserved bytes that are not `.` are decoded.
*
* @param {string} input
* @returns {string}
*/
function normalizePathEncoding (input) {
let output = ''
for (let i = 0; i < input.length; i++) {
const ch = input[i]
if (ch === '%' && i + 2 < input.length) {
const hex = input.slice(i + 1, i + 3)
if (isHexPair(hex)) {
const normalizedHex = hex.toUpperCase()
const decoded = String.fromCharCode(parseInt(normalizedHex, 16))
if (decoded !== '.' && isUnreserved(decoded)) {
output += decoded
} else {
output += '%' + normalizedHex
}
i += 2
continue
}
}
if (isPathCharacter(ch)) {
output += ch
} else {
const code = input.charCodeAt(i)
if (code < 0x80) {
output += isEscapeSafe(code) ? ch : BYTE_HEX[code]
} else if (code < 0xD800 || code > 0xDFFF) {
output += percentEncodeNonAscii(code)
} else if (code <= 0xDBFF && i + 1 < input.length) {
const low = input.charCodeAt(i + 1)
if (low >= 0xDC00 && low <= 0xDFFF) {
output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))
i++
} else {
output += percentEncodeNonAscii(0xFFFD)
}
} else {
output += percentEncodeNonAscii(0xFFFD)
}
}
}
return output
}
/**
* Serializes a path without rewriting reserved data. Raw RFC 3986 path
* characters remain literal, valid escapes are preserved and uppercased, and
* everything else is UTF-8 percent-encoded. In a path-noscheme, a colon in the
* first segment must be escaped so the result cannot be parsed as a scheme.
*
* @param {string} input
* @param {boolean} [pathNoScheme=false]
* @returns {string}
*/
function serializePathEncoding (input, pathNoScheme = false) {
let output = ''
let firstSegment = pathNoScheme && input[0] !== '/'
for (let i = 0; i < input.length; i++) {
const ch = input[i]
if (ch === '%' && i + 2 < input.length) {
const hex = input.slice(i + 1, i + 3)
if (isHexPair(hex)) {
output += '%' + hex.toUpperCase()
i += 2
continue
}
}
if (ch === '/') {
firstSegment = false
}
if (isPathCharacter(ch) && (ch !== ':' || !firstSegment)) {
output += ch
} else {
const code = input.charCodeAt(i)
if (code < 0x80) {
output += BYTE_HEX[code]
} else if (code < 0xD800 || code > 0xDFFF) {
output += percentEncodeNonAscii(code)
} else if (code <= 0xDBFF && i + 1 < input.length) {
const low = input.charCodeAt(i + 1)
if (low >= 0xDC00 && low <= 0xDFFF) {
output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))
i++
} else {
output += percentEncodeNonAscii(0xFFFD)
}
} else {
output += percentEncodeNonAscii(0xFFFD)
}
}
}
return output
}
/**
* Percent-encodes a URI component using its RFC 3986 literal character set.
* Existing valid escapes are preserved and normalized to uppercase hex.
*
* @param {string} input
* @param {(value: string) => boolean} isAllowed
* @returns {string}
*/
function encodeComponent (input, isAllowed) {
let output = ''
for (let i = 0; i < input.length; i++) {
const ch = input[i]
if (ch === '%' && i + 2 < input.length) {
const hex = input.slice(i + 1, i + 3)
if (isHexPair(hex)) {
output += '%' + hex.toUpperCase()
i += 2
continue
}
}
if (isAllowed(ch)) {
output += ch
} else {
const code = input.charCodeAt(i)
if (code < 0x80) {
output += BYTE_HEX[code]
} else if (code < 0xD800 || code > 0xDFFF) {
output += percentEncodeNonAscii(code)
} else if (code <= 0xDBFF && i + 1 < input.length) {
const low = input.charCodeAt(i + 1)
if (low >= 0xDC00 && low <= 0xDFFF) {
output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))
i++
} else {
output += percentEncodeNonAscii(0xFFFD)
}
} else {
output += percentEncodeNonAscii(0xFFFD)
}
}
}
return output
}
/**
* Encodes userinfo while preserving its RFC 3986 §3.2.1 literal characters.
* In particular, authority delimiters such as `@`, `/`, `?`, and `#` are data.
*
* @param {string} input
* @returns {string}
*/
function encodeUserinfo (input) {
return encodeComponent(input, isUserinfoCharacter)
}
/**
* Encodes query data using the RFC 3986 §3.4 grammar. A literal `#` must be
* escaped because it would otherwise begin the fragment component.
*
* @param {string} input
* @returns {string}
*/
function encodeQuery (input) {
return encodeComponent(input, isQueryFragmentCharacter)
}
/**
* Encodes fragment data using the RFC 3986 §3.5 grammar.
*
* @param {string} input
* @returns {string}
*/
function encodeFragment (input) {
return encodeComponent(input, isQueryFragmentCharacter)
}
function isEscapeSafe (cp) {
return (
(cp >= 0x30 && cp <= 0x39) ||
(cp >= 0x41 && cp <= 0x5A) ||
(cp >= 0x61 && cp <= 0x7A) ||
cp === 0x2A || cp === 0x2B || cp === 0x2D || cp === 0x2E ||
cp === 0x2F || cp === 0x40 || cp === 0x5F
)
}
/**
* Normalizes the percent-encoding of a query or fragment component.
*
* Like `normalizePathEncoding`, but uses the query/fragment character set
* (which additionally allows `?`) and decodes `.` since it has no dot-segment
* meaning outside of a path.
*
* @param {string} input
* @returns {string}
*/
function normalizeQueryFragmentEncoding (input) {
let output = ''
for (let i = 0; i < input.length; i++) {
const ch = input[i]
if (ch === '%' && i + 2 < input.length) {
const hex = input.slice(i + 1, i + 3)
if (isHexPair(hex)) {
const normalizedHex = hex.toUpperCase()
const decoded = String.fromCharCode(parseInt(normalizedHex, 16))
if (isUnreserved(decoded)) {
output += decoded
} else {
output += '%' + normalizedHex
}
i += 2
continue
}
}
if (isQueryFragmentCharacter(ch)) {
output += ch
} else {
const code = input.charCodeAt(i)
if (code < 0x80) {
output += isEscapeSafe(code) ? ch : BYTE_HEX[code]
} else if (code < 0xD800 || code > 0xDFFF) {
output += percentEncodeNonAscii(code)
} else if (code <= 0xDBFF && i + 1 < input.length) {
const low = input.charCodeAt(i + 1)
if (low >= 0xDC00 && low <= 0xDFFF) {
output += percentEncodeNonAscii(0x10000 + ((code - 0xD800) << 10) + (low - 0xDC00))
i++
} else {
output += percentEncodeNonAscii(0xFFFD)
}
} else {
output += percentEncodeNonAscii(0xFFFD)
}
}
}
return output
}
/**
* Escapes a component while preserving existing valid percent escapes.
*
* @param {string} input
* @returns {string}
*/
function escapePreservingEscapes (input) {
let output = ''
for (let i = 0; i < input.length; i++) {
if (input[i] === '%' && i + 2 < input.length) {
const hex = input.slice(i + 1, i + 3)
if (isHexPair(hex)) {
output += '%' + hex.toUpperCase()
i += 2
continue
}
}
output += escape(input[i])
}
return output
}
/**
* @param {import('../types/index').URIComponent} component
* @returns {string|undefined}
*/
function recomposeAuthority (component) {
const uriTokens = []
if (component.userinfo !== undefined) {
uriTokens.push(encodeUserinfo(component.userinfo))
uriTokens.push('@')
}
if (component.host !== undefined) {
let host = component.host
if (!isIPv4(host)) {
let ipV6res = normalizeIPv6(host)
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
// Decode only unreserved bytes, once. In particular, keep %25 encoded
// so it cannot introduce a second escape during recomposition.
host = normalizePercentEncoding(host, true)
ipV6res = normalizeIPv6(host)
}
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
host = `[${ipV6res.escapedHost}]`
} else {
host = reescapeHostDelimiters(host, false)
}
}
uriTokens.push(host)
}
if (typeof component.port === 'number' || typeof component.port === 'string') {
const port = String(component.port)
if (!isPort(port)) {
throw new TypeError('URI port is malformed.')
}
uriTokens.push(':')
uriTokens.push(port)
}
return uriTokens.length ? uriTokens.join('') : undefined
};
module.exports = {
nonSimpleDomain,
recomposeAuthority,
reescapeHostDelimiters,
normalizePercentEncoding,
normalizePathEncoding,
serializePathEncoding,
normalizeQueryFragmentEncoding,
encodeUserinfo,
encodeQuery,
encodeFragment,
escapePreservingEscapes,
removeDotSegments,
removeDotSegmentsRelative,
isIPv4,
isUUID,
normalizeIPv6,
stringArrayToHexStripped
}
@@ -0,0 +1,46 @@
{
"name": "prelude-ls",
"version": "1.2.1",
"author": "George Zahariev <z@georgezahariev.com>",
"description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.",
"keywords": [
"prelude",
"livescript",
"utility",
"ls",
"coffeescript",
"javascript",
"library",
"functional",
"array",
"list",
"object",
"string"
],
"main": "lib/",
"files": [
"lib/",
"README.md",
"LICENSE"
],
"homepage": "http://preludels.com",
"bugs": "https://github.com/gkz/prelude-ls/issues",
"license": "MIT",
"engines": {
"node": ">= 0.8.0"
},
"repository": {
"type": "git",
"url": "git://github.com/gkz/prelude-ls.git"
},
"scripts": {
"test": "make test"
},
"devDependencies": {
"livescript": "^1.6.0",
"uglify-js": "^3.8.1",
"mocha": "^7.1.1",
"browserify": "^16.5.1",
"sinon": "~8.0.1"
}
}
@@ -0,0 +1,52 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTSConfigRootDirFromStack = getTSConfigRootDirFromStack;
const node_path_1 = __importDefault(require("node:path"));
const node_url_1 = require("node:url");
/**
* Infers the `tsconfigRootDir` from the current call stack, using the V8 API.
*
* See https://v8.dev/docs/stack-trace-api
*
* This API is implemented in Deno and Bun as well.
*/
function getTSConfigRootDirFromStack() {
function getStack() {
const stackTraceLimit = Error.stackTraceLimit;
Error.stackTraceLimit = Infinity;
const prepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (_, structuredStackTrace) => structuredStackTrace;
const dummyObject = {};
Error.captureStackTrace(dummyObject, getTSConfigRootDirFromStack);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- stack is set by captureStackTrace
const rv = dummyObject.stack;
Error.prepareStackTrace = prepareStackTrace;
Error.stackTraceLimit = stackTraceLimit;
return rv;
}
for (const callSite of getStack()) {
const stackFrameFilePathOrUrl = callSite.getFileName();
if (!stackFrameFilePathOrUrl) {
continue;
}
// ESM seem to return a file URL, so we'll convert it to a file path.
// AFAICT this isn't documented in the v8 API docs, but it seems to be the case.
// See https://github.com/typescript-eslint/typescript-eslint/issues/11429
const stackFrameFilePath = stackFrameFilePathOrUrl.startsWith('file://')
? (0, node_url_1.fileURLToPath)(stackFrameFilePathOrUrl)
: stackFrameFilePathOrUrl;
const parsedPath = node_path_1.default.parse(stackFrameFilePath);
if (/^eslint\.config\.(c|m)?(j|t)s$/.test(parsedPath.base)) {
if (process.platform === 'win32') {
// workaround for https://github.com/typescript-eslint/typescript-eslint/issues/11530
// (caused by https://github.com/unjs/jiti/issues/397)
return parsedPath.dir.replaceAll('/', node_path_1.default.sep);
}
return parsedPath.dir;
}
}
return undefined;
}
@@ -0,0 +1 @@
{"version":3,"file":"notebook-text.js","sources":["../../../src/icons/notebook-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name NotebookText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA2aDQiIC8+CiAgPHBhdGggZD0iTTIgMTBoNCIgLz4KICA8cGF0aCBkPSJNMiAxNGg0IiAvPgogIDxwYXRoIGQ9Ik0yIDE4aDQiIC8+CiAgPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjIwIiB4PSI0IiB5PSIyIiByeD0iMiIgLz4KICA8cGF0aCBkPSJNOS41IDhoNSIgLz4KICA8cGF0aCBkPSJNOS41IDEySDE2IiAvPgogIDxwYXRoIGQ9Ik05LjUgMTZIMTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/notebook-text\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 NotebookText = createLucideIcon('NotebookText', [\n ['path', { d: 'M2 6h4', key: 'aawbzj' }],\n ['path', { d: 'M2 10h4', key: 'l0bgd4' }],\n ['path', { d: 'M2 14h4', key: '1gsvsf' }],\n ['path', { d: 'M2 18h4', key: '1bu2t1' }],\n ['rect', { width: '16', height: '20', x: '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,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,121 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "caratteri", verb: "avere" },
file: { unit: "byte", verb: "avere" },
array: { unit: "elementi", verb: "avere" },
set: { unit: "elementi", verb: "avere" },
map: { unit: "elementi", verb: "avere" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "input",
email: "indirizzo email",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "data e ora ISO",
date: "data ISO",
time: "ora ISO",
duration: "durata ISO",
ipv4: "indirizzo IPv4",
ipv6: "indirizzo IPv6",
mac: "indirizzo MAC",
cidrv4: "intervallo IPv4",
cidrv6: "intervallo IPv6",
base64: "stringa codificata in base64",
base64url: "URL codificata in base64",
json_string: "stringa JSON",
e164: "numero E.164",
credit_card: "numero di carta di credito",
currency_code: "codice valuta",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "numero",
array: "vettore",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Input non valido: atteso instanceof ${issue.expected}, ricevuto ${received}`;
}
return `Input non valido: atteso ${expected}, ricevuto ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `Input non valido: atteso ${util.stringifyPrimitive(issue.values[0])}`;
return `Opzione non valida: atteso uno tra ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Troppo grande: ${issue.origin ?? "valore"} deve avere ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementi"}`;
return `Troppo grande: ${issue.origin ?? "valore"} deve essere ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Troppo piccolo: ${issue.origin} deve avere ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Troppo piccolo: ${issue.origin} deve essere ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
if (_issue.format === "includes") return `Stringa non valida: deve includere "${_issue.includes}"`;
if (_issue.format === "regex") return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
return `Input non valido: ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Numero non valido: deve essere un multiplo di ${issue.divisor}`;
case "unrecognized_keys":
return `Chiav${issue.keys.length > 1 ? "i" : "e"} non riconosciut${issue.keys.length > 1 ? "e" : "a"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Chiave non valida in ${issue.origin}`;
case "invalid_union":
return "Input non valido";
case "invalid_element":
return `Valore non valido in ${issue.origin}`;
default:
return `Input non valido`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
"use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},u=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of f(e))!l.call(r,c)&&c!==t&&i(r,c,{get:()=>e[c],enumerable:!(o=a(e,c))||o.enumerable});return r};var h=r=>u(i({},"__esModule",{value:!0}),r);var d={};n(d,{clearRequireCache:()=>q});module.exports=h(d);function q(r){for(let e of r)delete require.cache[e]}0&&(module.exports={clearRequireCache});
@@ -0,0 +1,8 @@
import { SEPERATOR_CHAR_COUNT } from '../../data/const.mjs';
var separatorMatcher = () => {
return SEPERATOR_CHAR_COUNT;
};
export { separatorMatcher as default };
//# sourceMappingURL=scoring.mjs.map
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CameraOff = createLucideIcon("CameraOff", [
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }],
["path", { d: "M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16", key: "qmtpty" }],
["path", { d: "M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5", key: "1ufyfc" }],
["path", { d: "M14.121 15.121A3 3 0 1 1 9.88 10.88", key: "11zox6" }]
]);
export { CameraOff as default };
//# sourceMappingURL=camera-off.js.map
@@ -0,0 +1,29 @@
"use strict";
/**
* Experimental MCP SDK features.
* WARNING: These APIs are experimental and may change without notice.
*
* Import experimental features from this module:
* ```typescript
* import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental';
* ```
*
* @experimental
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./tasks/index.js"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"glass-water.js","sources":["../../../src/icons/glass-water.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GlassWater\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNS4xMTYgNC4xMDRBMSAxIDAgMCAxIDYuMTEgM2gxMS43OGExIDEgMCAwIDEgLjk5NCAxLjEwNUwxNy4xOSAyMC4yMUEyIDIgMCAwIDEgMTUuMiAyMkg4LjhhMiAyIDAgMCAxLTItMS43OXoiIC8+CiAgPHBhdGggZD0iTTYgMTJhNSA1IDAgMCAxIDYgMCA1IDUgMCAwIDAgNiAwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/glass-water\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 GlassWater = createLucideIcon('GlassWater', [\n [\n 'path',\n {\n d: 'M5.116 4.104A1 1 0 0 1 6.11 3h11.78a1 1 0 0 1 .994 1.105L17.19 20.21A2 2 0 0 1 15.2 22H8.8a2 2 0 0 1-2-1.79z',\n key: 'p55z4y',\n },\n ],\n ['path', { d: 'M6 12a5 5 0 0 1 6 0 5 5 0 0 0 6 0', key: 'mjntcy' }],\n]);\n\nexport default GlassWater;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAA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AAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,52 @@
import { encode, concat, uint32be } from './buffer_utils.js';
import { checkEncCryptoKey } from './crypto_key.js';
import { digest } from './helpers.js';
function lengthAndInput(input) {
return concat(uint32be(input.length), input);
}
async function concatKdf(Z, L, OtherInfo) {
const dkLen = L >> 3;
const hashLen = 32;
const reps = Math.ceil(dkLen / hashLen);
const dk = new Uint8Array(reps * hashLen);
for (let i = 1; i <= reps; i++) {
const hashInput = new Uint8Array(4 + Z.length + OtherInfo.length);
hashInput.set(uint32be(i), 0);
hashInput.set(Z, 4);
hashInput.set(OtherInfo, 4 + Z.length);
const hashResult = await digest('sha256', hashInput);
dk.set(hashResult, (i - 1) * hashLen);
}
return dk.slice(0, dkLen);
}
export async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new Uint8Array(), apv = new Uint8Array()) {
checkEncCryptoKey(publicKey, 'ECDH');
checkEncCryptoKey(privateKey, 'ECDH', 'deriveBits');
const algorithmID = lengthAndInput(encode(algorithm));
const partyUInfo = lengthAndInput(apu);
const partyVInfo = lengthAndInput(apv);
const suppPubInfo = uint32be(keyLength);
const suppPrivInfo = new Uint8Array();
const otherInfo = concat(algorithmID, partyUInfo, partyVInfo, suppPubInfo, suppPrivInfo);
const Z = new Uint8Array(await crypto.subtle.deriveBits({
name: publicKey.algorithm.name,
public: publicKey,
}, privateKey, getEcdhBitLength(publicKey)));
return concatKdf(Z, keyLength, otherInfo);
}
function getEcdhBitLength(publicKey) {
if (publicKey.algorithm.name === 'X25519') {
return 256;
}
return (Math.ceil(parseInt(publicKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3);
}
export function allowed(key) {
switch (key.algorithm.namedCurve) {
case 'P-256':
case 'P-384':
case 'P-521':
return true;
default:
return key.algorithm.name === 'X25519';
}
}
@@ -0,0 +1,15 @@
# Changelog
## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18)
### Bug Fixes
* Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6)
## 1.0.0 (2022-08-17)
### Features
* Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563))
@@ -0,0 +1,2 @@
export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom';
//# sourceMappingURL=projection.mjs.map
@@ -0,0 +1 @@
{"version":3,"names":["_arrayLikeToArray","arr","len","length","i","arr2","Array"],"sources":["../../src/helpers/arrayLikeToArray.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nexport default function _arrayLikeToArray<T>(\n arr: ArrayLike<T>,\n len?: number | null,\n) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array<T>(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,GAAiB,EACjBC,GAAmB,EACnB;EACA,IAAIA,GAAG,IAAI,IAAI,IAAIA,GAAG,GAAGD,GAAG,CAACE,MAAM,EAAED,GAAG,GAAGD,GAAG,CAACE,MAAM;EACrD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,IAAI,GAAG,IAAIC,KAAK,CAAIJ,GAAG,CAAC,EAAEE,CAAC,GAAGF,GAAG,EAAEE,CAAC,EAAE,EAAEC,IAAI,CAACD,CAAC,CAAC,GAAGH,GAAG,CAACG,CAAC,CAAC;EACxE,OAAOC,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./gOPD')} */
module.exports = Object.getOwnPropertyDescriptor;
@@ -0,0 +1 @@
{"version":3,"file":"firstnames.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"thermometer-snowflake.js","sources":["../../../src/icons/thermometer-snowflake.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ThermometerSnowflake\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTAgMjAtMS4yNS0yLjVMNiAxOCIgLz4KICA8cGF0aCBkPSJNMTAgNCA4Ljc1IDYuNSA2IDYiIC8+CiAgPHBhdGggZD0iTTEwLjU4NSAxNUgxMCIgLz4KICA8cGF0aCBkPSJNMiAxMmg2LjVMMTAgOSIgLz4KICA8cGF0aCBkPSJNMjAgMTQuNTRhNCA0IDAgMSAxLTQgMFY0YTIgMiAwIDAgMSA0IDB6IiAvPgogIDxwYXRoIGQ9Im00IDEwIDEuNSAyTDQgMTQiIC8+CiAgPHBhdGggZD0ibTcgMjEgMy02LTEuNS0zIiAvPgogIDxwYXRoIGQ9Im03IDMgMyA2aDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/thermometer-snowflake\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 ThermometerSnowflake = createLucideIcon('ThermometerSnowflake', [\n ['path', { d: 'm10 20-1.25-2.5L6 18', key: '18frcb' }],\n ['path', { d: 'M10 4 8.75 6.5 6 6', key: '7mghy3' }],\n ['path', { d: 'M10.585 15H10', key: '4nqulp' }],\n ['path', { d: 'M2 12h6.5L10 9', key: 'kv9z4n' }],\n ['path', { d: 'M20 14.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0z', key: 'yu0u2z' }],\n ['path', { d: 'm4 10 1.5 2L4 14', key: 'k9enpj' }],\n ['path', { d: 'm7 21 3-6-1.5-3', key: 'j8hb9u' }],\n ['path', { d: 'm7 3 3 6h2', key: '1bbqgq' }],\n]);\n\nexport default ThermometerSnowflake;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,iBAAiB,sBAAwB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,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AA,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,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,27 @@
import type { Scope } from '../scope';
import type { Variable } from './Variable';
import { ESLintScopeVariable } from './ESLintScopeVariable';
export interface ImplicitLibVariableOptions {
readonly eslintImplicitGlobalSetting?: ESLintScopeVariable['eslintImplicitGlobalSetting'];
readonly isTypeVariable?: boolean;
readonly isValueVariable?: boolean;
readonly writeable?: boolean;
}
export interface LibDefinition {
libs: readonly LibDefinition[];
variables: readonly [string, ImplicitLibVariableOptions][];
}
/**
* An variable implicitly defined by the TS Lib
*/
export declare class ImplicitLibVariable extends ESLintScopeVariable implements Variable {
/**
* `true` if the variable is valid in a type context, false otherwise
*/
readonly isTypeVariable: boolean;
/**
* `true` if the variable is valid in a value context, false otherwise
*/
readonly isValueVariable: boolean;
constructor(scope: Scope, name: string, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }: ImplicitLibVariableOptions);
}
@@ -0,0 +1 @@
{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"}
@@ -0,0 +1,116 @@
flf2a$ 1 0 9 -1 13 0 0 0
Author : Pipeline
Date : 2005/12/2 19:56:55
Version: 1.0
-------------------------------------------------
This font was inspired by pwning nubs in WoW
Use it when you feel a nubblestiltskin is just
begging to be RUINED.
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ ##
!!1 ##
'' ##
###
$##
%##
&##
'##
(##
)##
*##
+ ##
,##
-- ##
.##
/##
0##
1##
2##
3##
4##
5##
6##
7##
8##
9##
:: ##
:; ##
<##
::: ##
>##
?##
@##
//-\ ##
][3 ##
<< ##
][_) ##
]E ##
][= ##
((6 ##
][-][ ##
]][ ##
;_][ ##
][< ##
][_ ##
][\/][ ##
][\][ ##
[[]] ##
]]P ##
[[]]. ##
][2 ##
((5 ##
`][` ##
][_][ ##
\\/ ##
\\/\\/ ##
>><< ##
``// ##
``//. ##
[##
\##
]##
^##
_##
`##
//-\ ##
][3 ##
<< ##
][_) ##
]E ##
][= ##
((6 ##
][-][ ##
]][ ##
;_][ ##
][< ##
][_ ##
][\/][ ##
][\][ ##
[[]] ##
]]P ##
[[]]. ##
][2 ##
((5 ##
`][` ##
][_][ ##
\\/ ##
\\/\\/ ##
>><< ##
``// ##
``//. ##
{##
|##
}##
~##
//-\ ##
[[]] ##
][_][ ##
//-\ ##
[[]] ##
][_][ ##
ß##
@@ -0,0 +1,22 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2018" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
@@ -0,0 +1,49 @@
import { getFeatureDefinitions, setFeatureDefinitions } from 'motion-dom';
const featureProps = {
animation: [
"animate",
"variants",
"whileHover",
"whileTap",
"exit",
"whileInView",
"whileFocus",
"whileDrag",
],
exit: ["exit"],
drag: ["drag", "dragControls"],
focus: ["whileFocus"],
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
layout: ["layout", "layoutId"],
};
let isInitialized = false;
/**
* Initialize feature definitions with isEnabled checks.
* This must be called before any motion components are rendered.
*/
function initFeatureDefinitions() {
if (isInitialized)
return;
const initialFeatureDefinitions = {};
for (const key in featureProps) {
initialFeatureDefinitions[key] = {
isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
};
}
setFeatureDefinitions(initialFeatureDefinitions);
isInitialized = true;
}
/**
* Get the current feature definitions, initializing if needed.
*/
function getInitializedFeatureDefinitions() {
initFeatureDefinitions();
return getFeatureDefinitions();
}
export { getInitializedFeatureDefinitions, initFeatureDefinitions };
//# sourceMappingURL=definitions.mjs.map
@@ -0,0 +1,115 @@
import {Deprecation} from '../deprecations';
import {SourceSpan} from './source_span';
export {SourceLocation} from './source_location';
export {SourceSpan} from './source_span';
/**
* The options passed to {@link Logger.warn}.
*
* * `deprecation`: Whether this is a deprecation warning.
*
* * `deprecationType`: The type of deprecation. Only set if `deprecation` is
* true.
*
* * `span`: The location in the Sass source code that generated this warning.
* This may be unset if the warning didn't come from Sass source, for
* example if it's from a deprecated JavaScript option.
*
* * `stack`: The Sass stack trace at the point the warning was issued. This may
* be unset if the warning didn't come from Sass source, for example if it's
* from a deprecated JavaScript option.
*
* @category Logger
*/
export type LoggerWarnOptions = (
| {
deprecation: true;
deprecationType: Deprecation;
}
| {deprecation: false}
) & {
span?: SourceSpan;
stack?: string;
};
/**
* An object that can be passed to {@link LegacySharedOptions.logger} to control
* how Sass emits warnings and debug messages.
*
* @example
*
* ```js
* const fs = require('fs');
* const sass = require('sass');
*
* let log = "";
* sass.renderSync({
* file: 'input.scss',
* logger: {
* warn(message, options) {
* if (options.span) {
* log += `${span.url}:${span.start.line}:${span.start.column}: ` +
* `${message}\n`;
* } else {
* log += `::: ${message}\n`;
* }
* }
* }
* });
*
* fs.writeFileSync('log.txt', log);
* ```
*
* @category Logger
*/
export interface Logger {
/**
* This method is called when Sass emits a warning, whether due to a [`@warn`
* rule](https://sass-lang.com/documentation/at-rules/warn) or a warning
* generated by the Sass compiler.
*
* If this is `undefined`, Sass will print warnings to standard error.
*
* `options` may contain the following fields:
*
* @param message - The warning message.
*/
warn?(message: string, options: LoggerWarnOptions): void;
/**
* This method is called when Sass emits a debug message due to a [`@debug`
* rule](https://sass-lang.com/documentation/at-rules/debug).
*
* If this is `undefined`, Sass will print debug messages to standard error.
*
* @param message - The debug message.
* @param options.span - The location in the Sass source code that generated this
* debug message.
*/
debug?(message: string, options: {span: SourceSpan}): void;
}
/**
* A namespace for built-in {@link Logger}s.
*
* @category Logger
* @compatibility dart: "1.43.0", node: false
*/
export namespace Logger {
/**
* A {@link Logger} that silently ignores all warnings and debug messages.
*
* @example
*
* ```js
* const sass = require('sass');
*
* const result = sass.renderSync({
* file: 'input.scss',
* logger: sass.Logger.silent,
* });
* ```
*/
export const silent: Logger;
}
@@ -0,0 +1 @@
{"version":3,"file":"Group.mjs","sources":["../../../../src/components/Reorder/Group.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, JSX, useEffect, useRef } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, items will be draggable on this axis.\n * To make draggable on both axes, set `<Reorder.Item drag />`\n *\n * @public\n */\n axis?: \"x\" | \"y\"\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * <Reorder.Group values={items} onReorder={setItems}>\n * {items.map((item) => <Reorder.Item key={item} value={item} />)}\n * </Reorder.Group>\n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props<V, TagName> &\n Omit<HTMLMotionProps<TagName>, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis = \"y\",\n onReorder,\n values,\n ...props\n }: ReorderGroupProps<V, TagName>,\n externalRef?: React.ForwardedRef<any>\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren<HTMLMotionProps<any> & { ref?: React.Ref<any> }>\n >\n\n const order: ItemData<V>[] = []\n const isReordering = useRef(false)\n const groupRef = useRef<Element>(null)\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const context: ReorderContextProps<V> = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n // If the entry was already added, update it rather than adding it again\n const idx = order.findIndex((entry) => value === entry.value)\n if (idx !== -1) {\n order[idx].layout = layout[axis]\n } else {\n order.push({ value: value, layout: layout[axis] })\n }\n order.sort(compareMin)\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const newOrder = checkReorder(order, item, offset, velocity)\n\n if (order !== newOrder) {\n isReordering.current = true\n\n // Find which two values swapped and apply that swap\n // to the full values array. This preserves unmeasured\n // items (e.g. in virtualized lists).\n const newValues = [...values]\n for (let i = 0; i < newOrder.length; i++) {\n if (order[i].value !== newOrder[i].value) {\n const a = values.indexOf(order[i].value)\n const b = values.indexOf(newOrder[i].value)\n if (a !== -1 && b !== -1) {\n ;[newValues[a], newValues[b]] = [newValues[b], newValues[a]]\n }\n break\n }\n }\n onReorder(newValues)\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject<Element | null>).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(\n externalRef as React.MutableRefObject<Element | null>\n ).current = element\n }\n }Line truncated
@@ -0,0 +1,26 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const DropletOff = createLucideIcon("DropletOff", [
[
"path",
{
d: "M18.715 13.186C18.29 11.858 17.384 10.607 16 9.5c-2-1.6-3.5-4-4-6.5a10.7 10.7 0 0 1-.884 2.586",
key: "8suz2t"
}
],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
[
"path",
{ d: "M8.795 8.797A11 11 0 0 1 8 9.5C6 11.1 5 13 5 15a7 7 0 0 0 13.222 3.208", key: "19dw9m" }
]
]);
export { DropletOff as default };
//# sourceMappingURL=droplet-off.js.map
@@ -0,0 +1,616 @@
flf2a$ 6 5 20 -1 3
Bright Font by Dennis Monk 7/94
Identical to contrast.flf, but with different characters, making it
brighter.
........@
........@
........@
........@
........@
........@@
...##...@
...##...@
...##...@
........@
...##...@
........@@
.##..##.@
.##..##.@
..#..#..@
........@
........@
........@@
..#..#..@
.######.@
..#..#..@
.######.@
..#..#..@
........@@
..#####.@
.##.#...@
..####..@
...#.##.@
.#####..@
........@@
.##..##.@
.#..##..@
...##...@
..##..#.@
.##..##.@
........@@
..#####..@
.##...##.@
..##.##..@
.##.##.#.@
..#####..@
.........@@
...##...@
...##...@
....#...@
........@
........@
........@@
....###.@
..##....@
.#......@
..##....@
....###.@
........@@
.###....@
....##..@
......#.@
....##..@
.###....@
........@@
.#..#..#.@
..#.#.#..@
.#######.@
..#.#.#..@
.#..#..#.@
.........@@
...##...@
...##...@
.######.@
...##...@
...##...@
........@@
........@
........@
...##...@
...##...@
....#...@
........@@
........@
........@
.######.@
........@
........@
........@@
........@
........@
........@
...##...@
...##...@
........@@
.....##.@
....##..@
...##...@
..##....@
.##.....@
........@@
..####..@
.##..##.@
.######.@
.##..##.@
..####..@
........@@
...##...@
..###...@
...##...@
...##...@
.######.@
........@@
..####..@
.....##.@
..####..@
.##.....@
.######.@
........@@
.######.@
....##..@
...###..@
.....##.@
.#####..@
........@@
.....##.@
.##..##.@
.######.@
.....##.@
.....##.@
........@@
.######.@
.##.....@
..####..@
.....##.@
.#####..@
........@@
...##...@
..##....@
.#####..@
.##..##.@
..####..@
........@@
.######.@
....##..@
...##...@
..##....@
.##.....@
........@@
..####..@
.##..##.@
..####..@
.##..##.@
..####..@
........@@
..####..@
.##..##.@
..####..@
...##...@
..##....@
........@@
........@
...##...@
........@
...##...@
........@
........@@
........@
...##...@
........@
...##...@
....#...@
........@@
.....##.@
...##...@
.##.....@
...##...@
.....##.@
........@@
........@
.######.@
........@
.######.@
........@
........@@
.##.....@
...##...@
.....##.@
...##...@
.##.....@
........@@
..####..@
.##..##.@
....##..@
...##...@
...##...@
........@@
..####..@
.#.##.#.@
.#.##.#.@
.#..#.#.@
..####..@
........@@
..####..@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.#####..@
........@@
..####..@
.##..##.@
.##.....@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.##..##.@
.##..##.@
.#####..@
........@@
.######.@
.##.....@
.####...@
.##.....@
.######.@
........@@
.######.@
.##.....@
.####...@
.##.....@
.##.....@
........@@
..####..@
.##.....@
.##.###.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.######.@
...##...@
...##...@
...##...@
.######.@
........@@
.######.@
.....##.@
.....##.@
.##..##.@
..####..@
........@@
.##..##.@
.##.##..@
.####...@
.##.##..@
.##..##.@
........@@
.##.....@
.##.....@
.##.....@
.##.....@
.######.@
........@@
.##...##.@
.###.###.@
.##.#.##.@
.##...##.@
.##...##.@
.........@@
.##..##.@
.###.##.@
.##.###.@
.##..##.@
.##..##.@
........@@
..####..@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.#####..@
.##.....@
.##.....@
........@@
..####..@
.##..##.@
.##.###.@
.##..##.@
..#####.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.##..##.@
........@@
..####..@
.##.....@
..####..@
.....##.@
..####..@
........@@
.######.@
...##...@
...##...@
...##...@
...##...@
........@@
.##..##.@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.##..##.@
..####..@
...##...@
........@@
.##...##.@
.##...##.@
.##.#.##.@
.#######.@
..##.##..@
.........@@
.##..##.@
..####..@
...##...@
..####..@
.##..##.@
........@@
.##..##.@
..####..@
...##...@
...##...@
...##...@
........@@
.######.@
....##..@
...##...@
..##....@
.######.@
........@@
.######.@
.##.....@
.##.....@
.##.....@
.######.@
........@@
.##.....@
..##....@
...##...@
....##..@
.....##.@
........@@
.######.@
.....##.@
.....##.@
.....##.@
.######.@
........@@
...##...@
..####..@
.##..##.@
........@
........@
........@@
........@
........@
........@
........@
.######.@
........@@
...##...@
...##...@
...#....@
........@
........@
........@@
..####..@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.#####..@
........@@
..####..@
.##..##.@
.##.....@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.##..##.@
.##..##.@
.#####..@
........@@
.######.@
.##.....@
.####...@
.##.....@
.######.@
........@@
.######.@
.##.....@
.####...@
.##.....@
.##.....@
........@@
..####..@
.##.....@
.##.###.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.######.@
...##...@
...##...@
...##...@
.######.@
........@@
.######.@
.....##.@
.....##.@
.##..##.@
..####..@
........@@
.##..##.@
.##.##..@
.####...@
.##.##..@
.##..##.@
........@@
.##.....@
.##.....@
.##.....@
.##.....@
.######.@
........@@
.##...##.@
.###.###.@
.##.#.##.@
.##...##.@
.##...##.@
.........@@
.##..##.@
.###.##.@
.##.###.@
.##..##.@
.##..##.@
........@@
..####..@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.#####..@
.##.....@
.##.....@
........@@
..####..@
.##..##.@
.##.###.@
.##..##.@
..#####.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.##..##.@
........@@
..####..@
.##.....@
..####..@
.....##.@
..####..@
........@@
.######.@
...##...@
...##...@
...##...@
...##...@
........@@
.##..##.@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.##..##.@
..####..@
...##...@
........@@
.##...##.@
.##...##.@
.##.#.##.@
.#######.@
..##.##..@
.........@@
.##..##.@
..####..@
...##...@
..####..@
.##..##.@
........@@
.##..##.@
..####..@
...##...@
...##...@
...##...@
........@@
.######.@
....##..@
...##...@
..##....@
.######.@
........@@
...####.@
...##...@
.###....@
...##...@
...####.@
........@@
...##...@
...##...@
...##...@
...##...@
...##...@
...##...@@
.####...@
...##...@
....###.@
...##...@
.####...@
........@@
..###.#.@
.#.###..@
........@
........@
........@
........@@
.##..##.@
........@
..#####.@
.##..##.@
..#####.@
........@@
.##..##.@
........@
..####..@
.##..##.@
..####..@
........@@
.##..##.@
........@
.##..##.@
.##..##.@
..####..@
........@@
.##..##.@
........@
..#####.@
.##..##.@
..#####.@
........@@
.##..##.@
........@
..####..@
.##..##.@
..####..@
........@@
.##..##.@
........@
.##..##.@
.##..##.@
..####..@
........@@
..#####..@
.##...##.@
.##.###..@
.##...##.@
.##.###..@
.##......@@
@@ -0,0 +1 @@
{"version":3,"file":"legacy.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAoB,MAAM,YAAY,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAqBhD;;GAEG;AACH,MAAM,MAAM,GAGR;IACA,QAAQ,CAAC,IAAI;QACT,IAAI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ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ArrowDownNarrowWide = createLucideIcon("ArrowDownNarrowWide", [
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
["path", { d: "M7 20V4", key: "1yoxec" }],
["path", { d: "M11 4h4", key: "6d7r33" }],
["path", { d: "M11 8h7", key: "djye34" }],
["path", { d: "M11 12h10", key: "1438ji" }]
]);
export { ArrowDownNarrowWide as default };
//# sourceMappingURL=arrow-down-narrow-wide.js.map
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Bed = createLucideIcon("Bed", [
["path", { d: "M2 4v16", key: "vw9hq8" }],
["path", { d: "M2 8h18a2 2 0 0 1 2 2v10", key: "1dgv2r" }],
["path", { d: "M2 17h20", key: "18nfp3" }],
["path", { d: "M6 8v9", key: "1yriud" }]
]);
export { Bed as default };
//# sourceMappingURL=bed.js.map
@@ -0,0 +1 @@
{"version":3,"file":"matching.mjs","sources":["../../../src/matcher/repeat/matching.ts"],"sourcesContent":[null],"names":["MatchRepeat","MatcherBaseClass","constructor","options","scoring","Scoring","match","password","omniMatch","matches","lastIndex","length","greedyMatch","getGreedyMatch","lazyMatch","getLazyMatch","baseToken","setMatchToken","j","index","baseGuesses","getBaseGuesses","push","normalizeMatch","hasPromises","some","Promise","all","baseMatch","pattern","i","token","repeatCount","then","resolvedBaseGuesses","greedy","exec","lazy","lazyAnchored","temp","resolvedMatches","baseAnalysis","mostGuessableMatchSequence","guesses"],"mappings":";;;AAMA;;;;AAIG;AACH,MAAMA,WAAY,SAAQC,gBAAgB,CAAA;EAGxCC,WAAAA,CAAYC,OAAgB,EAAA;IAC1B,KAAK,CAACA,OAAO,CAAC;AACd,IAAA,IAAI,CAACC,OAAO,GAAG,IAAIC,OAAO,CAACF,OAAO,CAAC;AACrC,EAAA;AAEA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CAAC,CAAC,CAACH,MAAM,EAAE;AAC5D;AACA;AACA;AACAL,MAAAA,KAAK,GAAGM,WAAW;AACnB;AACA;AACA;AACA;MACA,MAAM2B,IAAI,GAAGD,YAAY,CAACF,IAAI,CAAC9B,KAAK,CAAC,CAAC,CAAC,CAAC;AACxC,MAAA,IAAIiC,IAAI,EAAE;AACRvB,QAAAA,SAAS,GAAGuB,IAAI,CAAC,CAAC,CAAC;AACrB,MAAA;AACF,IAAA,CAAC,MAAM;AACL;AACA;AACA;AACAjC,MAAAA,KAAK,GAAGQ,SAAS;AACjB,MAAA,IAAIR,KAAK,EAAE;AACTU,QAAAA,SAAS,GAAGV,KAAK,CAAC,CAAC,CAAC;AACtB,MAAA;AACF,IAAA;IACA,OAAO;MACLA,KAAK;AACLU,MAAAA;KACD;AACH,EAAA;AAEAK,EAAAA,cAAcA,CAACL,SAAiB,EAAER,SAAmB,EAAA;AACnD,IAAA,MAAMC,OAAO,GAAGD,SAAS,CAACF,KAAK,CAACU,SAAS,CAAC;IAC1C,IAAIP,OAAO,YAAYiB,OAAO,EAAE;AAC9B,MAAA,OAAOjB,OAAO,CAACwB,IAAI,CAAEO,eAAe,IAAI;QACtC,MAAMC,YAAY,GAAG,IAAI,CAACrC,OAAO,CAACsC,0BAA0B,CAC1D1B,SAAS,EACTwB,eAAe,CAChB;QACD,OAAOC,YAAY,CAACE,OAAO;AAC7B,MAAA,CAAC,CAAC;AACJ,IAAA;IACA,MAAMF,YAAY,GAAG,IAAI,CAACrC,OAAO,CAACsC,0BAA0B,CAC1D1B,SAAS,EACTP,OAAO,CACR;IACD,OAAOgC,YAAY,CAACE,OAAO;AAC7B,EAAA;AACD;;;;"}
@@ -0,0 +1,2 @@
export * from './compilerOptions';
export * from './getParsedConfigFile';
@@ -0,0 +1 @@
{"version":3,"file":"calendar-arrow-down.js","sources":["../../../src/icons/calendar-arrow-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarArrowDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTQgMTggNCA0IDQtNCIgLz4KICA8cGF0aCBkPSJNMTYgMnY0IiAvPgogIDxwYXRoIGQ9Ik0xOCAxNHY4IiAvPgogIDxwYXRoIGQ9Ik0yMSAxMS4zNTRWNmEyIDIgMCAwIDAtMi0ySDVhMiAyIDAgMCAwLTIgMnYxNGEyIDIgMCAwIDAgMiAyaDcuMzQzIiAvPgogIDxwYXRoIGQ9Ik0zIDEwaDE4IiAvPgogIDxwYXRoIGQ9Ik04IDJ2NCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/calendar-arrow-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CalendarArrowDown = createLucideIcon('CalendarArrowDown', [\n ['path', { d: 'm14 18 4 4 4-4', key: '1waygx' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['path', { d: 'M18 14v8', key: 'irew45' }],\n [\n 'path',\n { d: 'M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343', key: 'bse4f3' },\n ],\n ['path', { d: 'M3 10h18', key: '8toen8' }],\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n]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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC1F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -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 ReplyAll = createLucideIcon("ReplyAll", [
["polyline", { points: "7 17 2 12 7 7", key: "t83bqg" }],
["polyline", { points: "12 17 7 12 12 7", key: "1g4ajm" }],
["path", { d: "M22 18v-2a4 4 0 0 0-4-4H7", key: "1fcyog" }]
]);
export { ReplyAll as default };
//# sourceMappingURL=reply-all.js.map
@@ -0,0 +1,16 @@
/**
* Experimental task interfaces for MCP SDK.
* WARNING: These APIs are experimental and may change without notice.
*/
/**
* Checks if a task status represents a terminal state.
* Terminal states are those where the task has finished and will not change.
*
* @param status - The task status to check
* @returns True if the status is terminal (completed, failed, or cancelled)
* @experimental
*/
export function isTerminal(status) {
return status === 'completed' || status === 'failed' || status === 'cancelled';
}
//# sourceMappingURL=interfaces.js.map
@@ -0,0 +1,102 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-empty-interface',
meta: {
type: 'suggestion',
deprecated: {
deprecatedSince: '8.0.0',
replacedBy: [
{
rule: {
name: '@typescript-eslint/no-empty-object-type',
url: 'https://typescript-eslint.io/rules/no-empty-object-type',
},
},
],
url: 'https://github.com/typescript-eslint/typescript-eslint/pull/8977',
},
docs: {
description: 'Disallow the declaration of empty interfaces',
},
fixable: 'code',
hasSuggestions: true,
messages: {
noEmpty: 'An empty interface is equivalent to `{}`.',
noEmptyWithSuper: 'An interface declaring no members is equivalent to its supertype.',
},
replacedBy: ['@typescript-eslint/no-empty-object-type'],
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowSingleExtends: {
type: 'boolean',
description: 'Whether to allow empty interfaces that extend a single other interface.',
},
},
},
],
},
defaultOptions: [
{
allowSingleExtends: false,
},
],
create(context, [{ allowSingleExtends }]) {
return {
TSInterfaceDeclaration(node) {
if (node.body.body.length !== 0) {
// interface contains members --> Nothing to report
return;
}
const extend = node.extends;
if (extend.length === 0) {
context.report({
node: node.id,
messageId: 'noEmpty',
});
}
else if (extend.length === 1 &&
// interface extends exactly 1 interface --> Report depending on rule setting
!allowSingleExtends) {
const fix = (fixer) => {
let typeParam = '';
if (node.typeParameters) {
typeParam = context.sourceCode.getText(node.typeParameters);
}
return fixer.replaceText(node, `type ${context.sourceCode.getText(node.id)}${typeParam} = ${context.sourceCode.getText(extend[0])}`);
};
const scope = context.sourceCode.getScope(node);
const mergedWithClassDeclaration = scope.set
.get(node.id.name)
?.defs.some(def => def.node.type === utils_1.AST_NODE_TYPES.ClassDeclaration);
const isInAmbientDeclaration = (0, util_1.isDefinitionFile)(context.filename) &&
scope.type === scope_manager_1.ScopeType.tsModule &&
scope.block.declare;
const useAutoFix = !(isInAmbientDeclaration || mergedWithClassDeclaration);
context.report({
node: node.id,
messageId: 'noEmptyWithSuper',
...(useAutoFix
? { fix }
: !mergedWithClassDeclaration
? {
suggest: [
{
messageId: 'noEmptyWithSuper',
fix,
},
],
}
: null),
});
}
},
};
},
});
@@ -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 Clock11 = createLucideIcon("Clock11", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["polyline", { points: "12 6 12 12 9.5 8", key: "l5bg6f" }]
]);
export { Clock11 as default };
//# sourceMappingURL=clock-11.js.map
@@ -0,0 +1,34 @@
/**
* We keep these listed separately as we use the lowercase tag names as part
* of the runtime bundle to detect SVG components
*/
const lowercaseSVGElements = [
"animate",
"circle",
"defs",
"desc",
"ellipse",
"g",
"image",
"line",
"filter",
"marker",
"mask",
"metadata",
"path",
"pattern",
"polygon",
"polyline",
"rect",
"stop",
"switch",
"symbol",
"svg",
"text",
"tspan",
"use",
"view",
];
export { lowercaseSVGElements };
//# sourceMappingURL=lowercase-elements.mjs.map
@@ -0,0 +1 @@
{"version":3,"names":["_path","data","require","_plugin","_util","_item","_configChain","_environment","_options","_index","_resolveTargets","_excluded","_objectWithoutPropertiesLoose","r","e","t","n","hasOwnProperty","call","indexOf","resolveRootMode","rootDir","rootMode","upwardRootDir","findConfigUpwards","Object","assign","Error","ROOT_CONFIG_FILENAMES","join","code","dirname","loadPrivatePartialConfig","inputOpts","Array","isArray","args","validate","envName","getEnv","cwd","root","caller","cloneInputAst","absoluteCwd","path","resolve","absoluteRootDir","filename","undefined","showConfigPath","resolveShowConfigPath","context","showConfig","configChain","buildRootChain","merged","assumptions","options","forEach","opts","mergeOptions","targets","resolveTargets","babelrc","configFile","browserslistConfigFile","passPerPreset","plugins","map","descriptor","createItemFromDescriptor","presets","fileHandling","ignore","config","files","loadPartialConfig","showIgnoredFiles","_opts","result","item","value","Plugin","PartialConfig","filepath","constructor","babelignore","freeze","hasFilesystemConfig","prototype"],"sources":["../../src/config/partial.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { Handler } from \"gensync\";\nimport Plugin from \"./plugin.ts\";\nimport { mergeOptions } from \"./util.ts\";\nimport { createItemFromDescriptor } from \"./item.ts\";\nimport { buildRootChain } from \"./config-chain.ts\";\nimport type { ConfigContext, FileHandling } from \"./config-chain.ts\";\nimport { getEnv } from \"./helpers/environment.ts\";\nimport { validate } from \"./validation/options.ts\";\n\nimport type {\n RootMode,\n InputOptions,\n NormalizedOptions,\n} from \"./validation/options.ts\";\n\nimport {\n findConfigUpwards,\n resolveShowConfigPath,\n ROOT_CONFIG_FILENAMES,\n} from \"./files/index.ts\";\nimport type { ConfigFile, IgnoreFile } from \"./files/index.ts\";\nimport { resolveTargets } from \"./resolve-targets.ts\";\n\nfunction resolveRootMode(rootDir: string, rootMode: RootMode): string {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n\n throw Object.assign(\n new Error(\n `Babel was run with rootMode:\"upward\" but a root could not ` +\n `be found when searching upward from \"${rootDir}\".\\n` +\n `One of the following config files must be in the directory tree: ` +\n `\"${ROOT_CONFIG_FILENAMES.join(\", \")}\".`,\n ) as any,\n {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir,\n },\n );\n }\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\nexport type PrivPartialConfig = {\n showIgnoredFiles?: boolean;\n options: NormalizedOptions;\n context: ConfigContext;\n babelrc: ConfigFile | undefined;\n config: ConfigFile | undefined;\n ignore: IgnoreFile | undefined;\n fileHandling: FileHandling;\n files: Set<string>;\n};\n\nexport default function* loadPrivatePartialConfig(\n inputOpts: InputOptions,\n): Handler<PrivPartialConfig | null> {\n if (\n inputOpts != null &&\n (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))\n ) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? validate(\"arguments\", inputOpts) : {};\n\n const {\n envName = getEnv(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n cloneInputAst = true,\n } = args;\n const absoluteCwd = path.resolve(cwd);\n const absoluteRootDir = resolveRootMode(\n path.resolve(absoluteCwd, rootDir),\n rootMode,\n );\n\n const filename =\n typeof args.filename === \"string\"\n ? path.resolve(cwd, args.filename)\n : undefined;\n\n const showConfigPath = yield* resolveShowConfigPath(absoluteCwd);\n\n const context: ConfigContext = {\n filename,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n showConfig: showConfigPath === filename,\n };\n\n const configChain = yield* buildRootChain(args, context);\n if (!configChain) return null;\n\n const merged = {\n assumptions: {},\n };\n configChain.options.forEach(opts => {\n mergeOptions(merged as any, opts);\n });\n\n const options: NormalizedOptions = {\n ...merged,\n targets: resolveTargets(merged, absoluteRootDir),\n\n // Tack the passes onto the object itself so that, if this object is\n // passed back to Babel a second time, it will be in the right structure\n // to not change behavior.\n cloneInputAst,\n babelrc: false,\n configFile: false,\n browserslistConfigFile: false,\n paLine truncated
@@ -0,0 +1,119 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "文字", verb: "である" },
file: { unit: "バイト", verb: "である" },
array: { unit: "要素", verb: "である" },
set: { unit: "要素", verb: "である" },
map: { unit: "要素", verb: "である" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "入力値",
email: "メールアドレス",
url: "URL",
emoji: "絵文字",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO日時",
date: "ISO日付",
time: "ISO時刻",
duration: "ISO期間",
ipv4: "IPv4アドレス",
ipv6: "IPv6アドレス",
mac: "MACアドレス",
cidrv4: "IPv4範囲",
cidrv6: "IPv6範囲",
base64: "base64エンコード文字列",
base64url: "base64urlエンコード文字列",
json_string: "JSON文字列",
e164: "E.164番号",
credit_card: "クレジットカード番号",
currency_code: "通貨コード",
iban: "IBAN",
jwt: "JWT",
template_literal: "入力値",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "数値",
array: "配列",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `無効な入力: instanceof ${issue.expected}が期待されましたが、${received}が入力されました`;
}
return `無効な入力: ${expected}が期待されましたが、${received}が入力されました`;
}
case "invalid_value":
if (issue.values.length === 1) return `無効な入力: ${util.stringifyPrimitive(issue.values[0])}が期待されました`;
return `無効な選択: ${util.joinValues(issue.values, "、")}のいずれかである必要があります`;
case "too_big": {
const adj = issue.inclusive ? "以下である" : "より小さい";
const sizing = getSizing(issue.origin);
if (sizing)
return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${adj}必要があります`;
}
case "too_small": {
const adj = issue.inclusive ? "以上である" : "より大きい";
const sizing = getSizing(issue.origin);
if (sizing)
return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${sizing.unit}${adj}必要があります`;
return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${adj}必要があります`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `無効な文字列: "${_issue.prefix}"で始まる必要があります`;
if (_issue.format === "ends_with") return `無効な文字列: "${_issue.suffix}"で終わる必要があります`;
if (_issue.format === "includes") return `無効な文字列: "${_issue.includes}"を含む必要があります`;
if (_issue.format === "regex") return `無効な文字列: パターン${_issue.pattern}に一致する必要があります`;
return `無効な${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `無効な数値: ${issue.divisor}の倍数である必要があります`;
case "unrecognized_keys":
return `認識されていないキー${issue.keys.length > 1 ? "群" : ""}: ${util.joinValues(issue.keys, "、")}`;
case "invalid_key":
return `${issue.origin}内の無効なキー`;
case "invalid_union":
return "無効な入力";
case "invalid_element":
return `${issue.origin}内の無効な値`;
default:
return `無効な入力`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,117 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "merkkiä", subject: "merkkijonon" },
file: { unit: "tavua", subject: "tiedoston" },
array: { unit: "alkiota", subject: "listan" },
set: { unit: "alkiota", subject: "joukon" },
map: { unit: "alkiota", subject: "kuvauksen" },
number: { unit: "", subject: "luvun" },
bigint: { unit: "", subject: "suuren kokonaisluvun" },
int: { unit: "", subject: "kokonaisluvun" },
date: { unit: "", subject: "päivämäärän" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "säännöllinen lauseke",
email: "sähköpostiosoite",
url: "URL-osoite",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-aikaleima",
date: "ISO-päivämäärä",
time: "ISO-aika",
duration: "ISO-kesto",
ipv4: "IPv4-osoite",
ipv6: "IPv6-osoite",
mac: "MAC-osoite",
cidrv4: "IPv4-alue",
cidrv6: "IPv6-alue",
base64: "base64-koodattu merkkijono",
base64url: "base64url-koodattu merkkijono",
json_string: "JSON-merkkijono",
e164: "E.164-luku",
credit_card: "luottokortin numero",
currency_code: "valuuttakoodi",
iban: "IBAN",
jwt: "JWT",
template_literal: "templaattimerkkijono",
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Virheellinen tyyppi: odotettiin instanceof ${issue.expected}, oli ${received}`;
}
return `Virheellinen tyyppi: odotettiin ${expected}, oli ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Virheellinen syöte: täytyy olla ${util.stringifyPrimitive(issue.values[0])}`;
return `Virheellinen valinta: täytyy olla yksi seuraavista: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Liian suuri: ${sizing.subject} täytyy olla ${adj}${issue.maximum.toString()} ${sizing.unit}`.trim();
}
return `Liian suuri: arvon täytyy olla ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Liian pieni: ${sizing.subject} täytyy olla ${adj}${issue.minimum.toString()} ${sizing.unit}`.trim();
}
return `Liian pieni: arvon täytyy olla ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Virheellinen syöte: täytyy alkaa "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Virheellinen syöte: täytyy loppua "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Virheellinen syöte: täytyy sisältää "${_issue.includes}"`;
if (_issue.format === "regex") {
return `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${_issue.pattern}`;
}
return `Virheellinen ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Virheellinen luku: täytyy olla luvun ${issue.divisor} monikerta`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return "Virheellinen avain tietueessa";
case "invalid_union":
return "Virheellinen unioni";
case "invalid_element":
return "Virheellinen arvo joukossa";
default:
return `Virheellinen syöte`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,35 @@
'use client';
export {
createAlertDialogScope,
//
AlertDialog,
AlertDialogTrigger,
AlertDialogPortal,
AlertDialogOverlay,
AlertDialogContent,
AlertDialogAction,
AlertDialogCancel,
AlertDialogTitle,
AlertDialogDescription,
//
Root,
Trigger,
Portal,
Overlay,
Content,
Action,
Cancel,
Title,
Description,
} from './alert-dialog';
export type {
AlertDialogProps,
AlertDialogTriggerProps,
AlertDialogPortalProps,
AlertDialogOverlayProps,
AlertDialogContentProps,
AlertDialogActionProps,
AlertDialogCancelProps,
AlertDialogTitleProps,
AlertDialogDescriptionProps,
} from './alert-dialog';
@@ -0,0 +1 @@
{"version":3,"file":"useLocation.js","names":[],"sources":["../../src/useLocation.tsx"],"sourcesContent":["'use client'\n\nimport { useStore } from '@tanstack/react-store'\nimport { useRef } from 'react'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\n\nexport interface UseLocationBaseOptions<\n TRouter extends AnyRouter,\n TSelected,\n TStructuralSharing extends boolean = boolean,\n> {\n select?: (\n state: RouterState<TRouter['routeTree']>['location'],\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLocationResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected\n ? RouterState<TRouter['routeTree']>['location']\n : TSelected\n\n/**\n * Read the current location from the router state with optional selection.\n * Useful for subscribing to just the pieces of location you care about.\n *\n * Options:\n * - `select`: Project the `location` object to a derived value\n * - `structuralSharing`: Enable structural sharing for stable references\n *\n * @returns The current location (or selected value).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook\n */\nexport function useLocation<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseLocationBaseOptions<TRouter, TSelected, TStructuralSharing> &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n): UseLocationResult<TRouter, TSelected> {\n const router = useRouter<TRouter>()\n\n if (isServer ?? router.isServer) {\n const location = router.stores.location.get()\n return (\n opts?.select ? opts.select(location as any) : location\n ) as UseLocationResult<TRouter, TSelected>\n }\n\n const previousResult =\n // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static\n useRef<ValidateSelected<TRouter, TSelected, TStructuralSharing>>(undefined)\n\n // eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static\n return useStore(router.stores.location, (location) => {\n const selected = (\n opts?.select ? opts.select(location as any) : location\n ) as ValidateSelected<TRouter, TSelected, TStructuralSharing>\n\n if (opts?.structuralSharing ?? router.options.defaultStructuralSharing) {\n const shared = replaceEqualDeep(previousResult.current, selected)\n previousResult.current = shared\n return shared\n }\n\n return selected\n }) as UseLocationResult<TRouter, TSelected>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6CA,SAAgB,YAKd,MAEuC;CACvC,MAAM,SAAS,WAAoB;AAEnC,KAAI,YAAY,OAAO,UAAU;EAC/B,MAAM,WAAW,OAAO,OAAO,SAAS,KAAK;AAC7C,SACE,MAAM,SAAS,KAAK,OAAO,SAAgB,GAAG;;CAIlD,MAAM,iBAEJ,OAAiE,KAAA,EAAU;AAG7E,QAAO,SAAS,OAAO,OAAO,WAAW,aAAa;EACpD,MAAM,WACJ,MAAM,SAAS,KAAK,OAAO,SAAgB,GAAG;AAGhD,MAAI,MAAM,qBAAqB,OAAO,QAAQ,0BAA0B;GACtE,MAAM,SAAS,iBAAiB,eAAe,SAAS,SAAS;AACjE,kBAAe,UAAU;AACzB,UAAO;;AAGT,SAAO;GACP"}
@@ -0,0 +1,6 @@
export { createRequestHandler } from './createRequestHandler.cjs';
export type { RequestHandler } from './createRequestHandler.cjs';
export { defineHandlerCallback } from './handlerCallback.cjs';
export type { HandlerCallback } from './handlerCallback.cjs';
export { transformPipeableStreamWithRouter, transformStreamWithRouter, transformReadableStreamWithRouter, } from './transformStreamWithRouter.cjs';
export { attachRouterServerSsrUtils, getNormalizedURL, getOrigin, } from './ssr-server.cjs';
@@ -0,0 +1,420 @@
flf2a$ 4 3 8 -1 11 0 7936 0
Author : Katerina L.
Date : 2008/5/3 13:55:36
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
$ #
$ #
$ #
$ ##
#
| #
| #
> ##
#
>> #
#
##
##
#
#
##
$#
#
#
##
%#
#
#
##
&#
#
#
##
'#
#
#
##
(#
#
#
##
)#
#
#
##
*#
#
#
##
#
| #
-<- #
| ##
,#
#
#
##
#
#
-<- #
##
.#
#
#
##
/#
#
#
##
0#
#
#
##
1#
#
#
##
2#
#
#
##
3#
#
#
##
4#
#
#
##
5#
#
#
##
6#
#
#
##
7#
#
#
##
8#
#
#
##
9#
#
#
##
#
< #
< #
##
#
< #
/ #
##
<#
#
#
##
#
>-- #
>-- #
##
>#
#
#
##
?#
#
#
##
@#
#
#
##
__ #
| | #
|><| #
| | ##
__ #
| | #
|<>' #
|__' ##
__ #
|<< #
| #
|__ ##
#
__| #
|<<| #
|__| ##
__ #
| #
|<< #
|__ ##
__ #
| #
|<< #
| ##
__ #
| #
| >> #
'__| ##
#
| | #
|><| #
| | ##
#
> #
| #
| ##
__ #
| #
<< | #
|__' ##
#
| / #
|<< #
| \ ##
#
| #
| #
|<< ##
#
|\ /| #
| < | #
| | ##
#
| | #
|\| #
| | ##
#
>> #
| | #
<< ##
#
|<<' #
|>>| #
| ##
#
>> #
| | #
<<\ ##
#
|<< #
|>>| #
| \ ##
#
|<< #
-- #
>>| ##
#
>>|<< #
| #
| ##
#
| | #
| | #
'<<' ##
#
| | #
| | #
\/ ##
#
| | #
| < | #
|/ \| ##
#
\ / #
< #
/ \ ##
#
| | #
\</ #
| ##
#
>>> #
/ #
/<< ##
[#
#
#
##
\#
#
#
##
]#
#
#
##
^#
#
#
##
_#
#
#
##
`#
#
#
##
__ #
| | #
|><| #
| | ##
__ #
| | #
|<>' #
|__' ##
__ #
|<< #
| #
|__ ##
#
__| #
|<<| #
|__| ##
__ #
| #
|<< #
|__ ##
__ #
| #
|<< #
| ##
__ #
| #
| >> #
'__| ##
#
| | #
|><| #
| | ##
#
> #
| #
| ##
__ #
| #
<< | #
|__' ##
#
| / #
|<< #
| \ ##
#
| #
| #
|<< ##
#
|\ /| #
| < | #
| | ##
#
| | #
|\| #
| | ##
#
>> #
| | #
<< ##
#
|<<' #
|>>| #
| ##
#
>> #
| | #
<<\ ##
#
|<< #
|>>| #
| \ ##
#
|<< #
-- #
>>| ##
#
>>|<< #
| #
| ##
#
| | #
| | #
'<<' ##
#
| | #
| | #
\/ ##
#
| | #
| < | #
|/ \| ##
#
\ / #
< #
/ \ ##
#
| | #
\</ #
| ##
#
>>> #
/ #
/<< ##
{#
#
#
##
|#
#
#
##
}#
#
#
##
~#
#
#
##
__ #
| | #
|><| #
| | ##
#
>> #
| | #
<< ##
#
| | #
| | #
'<<' ##
__ #
| | #
|><| #
| | ##
#
>> #
| | #
<< ##
#
| | #
| | #
'<<' ##
ß#
#
#
##