This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1 @@
module.exports={C:{"47":0.00469,"52":0.01875,"78":0.00937,"112":0.00469,"113":0.00469,"114":0.00469,"115":0.47339,"121":0.00469,"124":0.00469,"125":0.00469,"127":0.01875,"128":0.07968,"129":0.00469,"130":0.00469,"131":0.00469,"132":0.00469,"133":0.07968,"134":0.04218,"135":0.66555,"136":2.49348,"137":0.00469,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 116 117 118 119 120 122 123 126 138 139 140 3.5 3.6"},D:{"41":0.01875,"47":0.00469,"49":0.01875,"53":0.00469,"56":0.00469,"66":0.00469,"74":0.00469,"75":0.00937,"76":0.00469,"77":0.00937,"79":0.10311,"81":0.02812,"84":0.01406,"86":0.00469,"87":0.1078,"88":0.00937,"89":0.00469,"90":0.00469,"91":0.00469,"92":0.00469,"93":0.00469,"94":0.01875,"95":0.01875,"102":0.00469,"103":0.01406,"104":0.00469,"105":0.00469,"106":0.02344,"107":0.00937,"108":0.01875,"109":1.42954,"110":0.00469,"111":0.01875,"112":0.01406,"113":0.00469,"114":0.00937,"115":0.00469,"116":0.07031,"117":0.00937,"118":0.01406,"119":0.0375,"120":0.07968,"121":0.01875,"122":0.12655,"123":0.02344,"124":0.1078,"125":0.01875,"126":0.04687,"127":0.01875,"128":0.07031,"129":0.04218,"130":0.07968,"131":0.29528,"132":0.45933,"133":9.67397,"134":20.10254,"135":0.00937,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 43 44 45 46 48 50 51 52 54 55 57 58 59 60 61 62 63 64 65 67 68 69 70 71 72 73 78 80 83 85 96 97 98 99 100 101 136 137 138"},F:{"46":0.02812,"70":0.00469,"85":0.00469,"87":0.03281,"88":0.01875,"89":0.00469,"95":0.06562,"114":0.00469,"115":0.00469,"116":0.29059,"117":1.43422,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 78 79 80 81 82 83 84 86 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00469,"109":0.05156,"110":0.00469,"114":0.00937,"117":0.00469,"118":0.00937,"119":0.00469,"122":0.00469,"123":0.00469,"125":0.00469,"126":0.00469,"127":0.00469,"129":0.00469,"130":0.02344,"131":0.07499,"132":0.07031,"133":0.98427,"134":2.58722,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 111 112 113 115 116 120 121 124 128"},E:{"14":0.00469,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 15.4","13.1":0.00937,"14.1":0.01875,"15.1":0.00469,"15.5":0.00469,"15.6":0.07968,"16.0":0.02344,"16.1":0.00469,"16.2":0.00937,"16.3":0.01875,"16.4":0.00937,"16.5":0.01406,"16.6":0.09843,"17.0":0.01875,"17.1":0.06562,"17.2":0.04218,"17.3":0.02344,"17.4":0.03281,"17.5":0.10311,"17.6":0.13592,"18.0":0.02812,"18.1":0.1078,"18.2":0.03281,"18.3":0.64212,"18.4":0.02344},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00189,"5.0-5.1":0,"6.0-6.1":0.00568,"7.0-7.1":0.00379,"8.1-8.4":0,"9.0-9.2":0.00284,"9.3":0.01326,"10.0-10.2":0.00095,"10.3":0.02179,"11.0-11.2":0.10041,"11.3-11.4":0.00663,"12.0-12.1":0.00379,"12.2-12.5":0.09378,"13.0-13.1":0.00189,"13.2":0.00284,"13.3":0.00379,"13.4-13.7":0.01326,"14.0-14.4":0.03316,"14.5-14.8":0.03979,"15.0-15.1":0.02179,"15.2-15.3":0.02179,"15.4":0.02652,"15.5":0.03031,"15.6-15.8":0.37324,"16.0":0.05305,"16.1":0.10894,"16.2":0.05684,"16.3":0.09852,"16.4":0.02179,"16.5":0.04073,"16.6-16.7":0.44239,"17.0":0.02652,"17.1":0.04737,"17.2":0.036,"17.3":0.05021,"17.4":0.10041,"17.5":0.22356,"17.6-17.7":0.64891,"18.0":0.18188,"18.1":0.59491,"18.2":0.26619,"18.3":5.56354,"18.4":0.08242},P:{"4":0.1454,"21":0.01039,"22":0.01039,"23":0.05193,"24":0.02077,"25":0.06231,"26":0.11424,"27":3.34422,_:"20 8.2 9.2 10.1 11.1-11.2 12.0 14.0 15.0 16.0 18.0","5.0-5.4":0.03116,"6.2-6.4":0.04154,"7.2-7.4":0.04154,"13.0":0.01039,"17.0":0.01039,"19.0":0.01039},I:{"0":0.03711,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},K:{"0":0.47286,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00937,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.41441},Q:{_:"14.9"},O:{"0":0.09032},H:{"0":0},L:{"0":39.38997}};

View File

@@ -0,0 +1,187 @@
declare module "safe-buffer" {
export class Buffer {
length: number
write(string: string, offset?: number, length?: number, encoding?: string): number;
toString(encoding?: string, start?: number, end?: number): string;
toJSON(): { type: 'Buffer', data: any[] };
equals(otherBuffer: Buffer): boolean;
compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
slice(start?: number, end?: number): Buffer;
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readUInt8(offset: number, noAssert?: boolean): number;
readUInt16LE(offset: number, noAssert?: boolean): number;
readUInt16BE(offset: number, noAssert?: boolean): number;
readUInt32LE(offset: number, noAssert?: boolean): number;
readUInt32BE(offset: number, noAssert?: boolean): number;
readInt8(offset: number, noAssert?: boolean): number;
readInt16LE(offset: number, noAssert?: boolean): number;
readInt16BE(offset: number, noAssert?: boolean): number;
readInt32LE(offset: number, noAssert?: boolean): number;
readInt32BE(offset: number, noAssert?: boolean): number;
readFloatLE(offset: number, noAssert?: boolean): number;
readFloatBE(offset: number, noAssert?: boolean): number;
readDoubleLE(offset: number, noAssert?: boolean): number;
readDoubleBE(offset: number, noAssert?: boolean): number;
swap16(): Buffer;
swap32(): Buffer;
swap64(): Buffer;
writeUInt8(value: number, offset: number, noAssert?: boolean): number;
writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
writeInt8(value: number, offset: number, noAssert?: boolean): number;
writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
fill(value: any, offset?: number, end?: number): this;
indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
/**
* Allocates a new buffer containing the given {str}.
*
* @param str String to store in buffer.
* @param encoding encoding to use, optional. Default is 'utf8'
*/
constructor (str: string, encoding?: string);
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
*/
constructor (size: number);
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
constructor (array: Uint8Array);
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}.
*
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
*/
constructor (arrayBuffer: ArrayBuffer);
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
constructor (array: any[]);
/**
* Copies the passed {buffer} data onto a new {Buffer} instance.
*
* @param buffer The buffer to copy.
*/
constructor (buffer: Buffer);
prototype: Buffer;
/**
* Allocates a new Buffer using an {array} of octets.
*
* @param array
*/
static from(array: any[]): Buffer;
/**
* When passed a reference to the .buffer property of a TypedArray instance,
* the newly created Buffer will share the same allocated memory as the TypedArray.
* The optional {byteOffset} and {length} arguments specify a memory range
* within the {arrayBuffer} that will be shared by the Buffer.
*
* @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
* @param byteOffset
* @param length
*/
static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
/**
* Copies the passed {buffer} data onto a new Buffer instance.
*
* @param buffer
*/
static from(buffer: Buffer): Buffer;
/**
* Creates a new Buffer containing the given JavaScript string {str}.
* If provided, the {encoding} parameter identifies the character encoding.
* If not provided, {encoding} defaults to 'utf8'.
*
* @param str
*/
static from(str: string, encoding?: string): Buffer;
/**
* Returns true if {obj} is a Buffer
*
* @param obj object to test.
*/
static isBuffer(obj: any): obj is Buffer;
/**
* Returns true if {encoding} is a valid encoding argument.
* Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*
* @param encoding string to test.
*/
static isEncoding(encoding: string): boolean;
/**
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
* This is not the same as String.prototype.length since that returns the number of characters in a string.
*
* @param string string to test.
* @param encoding encoding used to evaluate (defaults to 'utf8')
*/
static byteLength(string: string, encoding?: string): number;
/**
* Returns a buffer which is the result of concatenating all the buffers in the list together.
*
* If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
* If the list has exactly one item, then the first item of the list is returned.
* If the list has more than one item, then a new Buffer is created.
*
* @param list An array of Buffer objects to concatenate
* @param totalLength Total length of the buffers when concatenated.
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
*/
static concat(list: Buffer[], totalLength?: number): Buffer;
/**
* The same as buf1.compare(buf2).
*/
static compare(buf1: Buffer, buf2: Buffer): number;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @param fill if specified, buffer will be initialized by calling buf.fill(fill).
* If parameter is omitted, buffer will be filled with zeros.
* @param encoding encoding used for call to buf.fill while initalizing
*/
static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
/**
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
static allocUnsafe(size: number): Buffer;
/**
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
static allocUnsafeSlow(size: number): Buffer;
}
}

View File

@@ -0,0 +1,22 @@
{
"name": "node-releases",
"version": "2.0.19",
"description": "Node.js releases data",
"type": "module",
"scripts": {
"build": "node scripts/build.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/chicoxyzzy/node-releases.git"
},
"keywords": [
"nodejs",
"releases"
],
"author": "Sergey Rubanov <chi187@gmail.com>",
"license": "MIT",
"devDependencies": {
"semver": "^7.3.5"
}
}

View File

@@ -0,0 +1,385 @@
/**
* @fileoverview Rule to enforce getter and setter pairs in objects and classes.
* @author Gyandeep Singh
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* Property name if it can be computed statically, otherwise the list of the tokens of the key node.
* @typedef {string|Token[]} Key
*/
/**
* Accessor nodes with the same key.
* @typedef {Object} AccessorData
* @property {Key} key Accessor's key
* @property {ASTNode[]} getters List of getter nodes.
* @property {ASTNode[]} setters List of setter nodes.
*/
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks whether or not the given lists represent the equal tokens in the same order.
* Tokens are compared by their properties, not by instance.
* @param {Token[]} left First list of tokens.
* @param {Token[]} right Second list of tokens.
* @returns {boolean} `true` if the lists have same tokens.
*/
function areEqualTokenLists(left, right) {
if (left.length !== right.length) {
return false;
}
for (let i = 0; i < left.length; i++) {
const leftToken = left[i],
rightToken = right[i];
if (
leftToken.type !== rightToken.type ||
leftToken.value !== rightToken.value
) {
return false;
}
}
return true;
}
/**
* Checks whether or not the given keys are equal.
* @param {Key} left First key.
* @param {Key} right Second key.
* @returns {boolean} `true` if the keys are equal.
*/
function areEqualKeys(left, right) {
if (typeof left === "string" && typeof right === "string") {
// Statically computed names.
return left === right;
}
if (Array.isArray(left) && Array.isArray(right)) {
// Token lists.
return areEqualTokenLists(left, right);
}
return false;
}
/**
* Checks whether or not a given node is of an accessor kind ('get' or 'set').
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node is of an accessor kind.
*/
function isAccessorKind(node) {
return node.kind === "get" || node.kind === "set";
}
/**
* Checks whether or not a given node is an argument of a specified method call.
* @param {ASTNode} node A node to check.
* @param {number} index An expected index of the node in arguments.
* @param {string} object An expected name of the object of the method.
* @param {string} property An expected name of the method.
* @returns {boolean} `true` if the node is an argument of the specified method call.
*/
function isArgumentOfMethodCall(node, index, object, property) {
const parent = node.parent;
return (
parent.type === "CallExpression" &&
astUtils.isSpecificMemberAccess(parent.callee, object, property) &&
parent.arguments[index] === node
);
}
/**
* Checks whether or not a given node is a property descriptor.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node is a property descriptor.
*/
function isPropertyDescriptor(node) {
// Object.defineProperty(obj, "foo", {set: ...})
if (
isArgumentOfMethodCall(node, 2, "Object", "defineProperty") ||
isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty")
) {
return true;
}
/*
* Object.defineProperties(obj, {foo: {set: ...}})
* Object.create(proto, {foo: {set: ...}})
*/
const grandparent = node.parent.parent;
return (
grandparent.type === "ObjectExpression" &&
(isArgumentOfMethodCall(grandparent, 1, "Object", "create") ||
isArgumentOfMethodCall(
grandparent,
1,
"Object",
"defineProperties",
))
);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
enforceForClassMembers: true,
getWithoutSet: false,
setWithoutGet: true,
},
],
docs: {
description:
"Enforce getter and setter pairs in objects and classes",
recommended: false,
url: "https://eslint.org/docs/latest/rules/accessor-pairs",
},
schema: [
{
type: "object",
properties: {
getWithoutSet: {
type: "boolean",
},
setWithoutGet: {
type: "boolean",
},
enforceForClassMembers: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
missingGetterInPropertyDescriptor:
"Getter is not present in property descriptor.",
missingSetterInPropertyDescriptor:
"Setter is not present in property descriptor.",
missingGetterInObjectLiteral:
"Getter is not present for {{ name }}.",
missingSetterInObjectLiteral:
"Setter is not present for {{ name }}.",
missingGetterInClass: "Getter is not present for class {{ name }}.",
missingSetterInClass: "Setter is not present for class {{ name }}.",
},
},
create(context) {
const [
{
getWithoutSet: checkGetWithoutSet,
setWithoutGet: checkSetWithoutGet,
enforceForClassMembers,
},
] = context.options;
const sourceCode = context.sourceCode;
/**
* Reports the given node.
* @param {ASTNode} node The node to report.
* @param {string} messageKind "missingGetter" or "missingSetter".
* @returns {void}
* @private
*/
function report(node, messageKind) {
if (node.type === "Property") {
context.report({
node,
messageId: `${messageKind}InObjectLiteral`,
loc: astUtils.getFunctionHeadLoc(node.value, sourceCode),
data: {
name: astUtils.getFunctionNameWithKind(node.value),
},
});
} else if (node.type === "MethodDefinition") {
context.report({
node,
messageId: `${messageKind}InClass`,
loc: astUtils.getFunctionHeadLoc(node.value, sourceCode),
data: {
name: astUtils.getFunctionNameWithKind(node.value),
},
});
} else {
context.report({
node,
messageId: `${messageKind}InPropertyDescriptor`,
});
}
}
/**
* Reports each of the nodes in the given list using the same messageId.
* @param {ASTNode[]} nodes Nodes to report.
* @param {string} messageKind "missingGetter" or "missingSetter".
* @returns {void}
* @private
*/
function reportList(nodes, messageKind) {
for (const node of nodes) {
report(node, messageKind);
}
}
/**
* Checks accessor pairs in the given list of nodes.
* @param {ASTNode[]} nodes The list to check.
* @returns {void}
* @private
*/
function checkList(nodes) {
const accessors = [];
let found = false;
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (isAccessorKind(node)) {
// Creates a new `AccessorData` object for the given getter or setter node.
const name = astUtils.getStaticPropertyName(node);
const key =
name !== null ? name : sourceCode.getTokens(node.key);
// Merges the given `AccessorData` object into the given accessors list.
for (let j = 0; j < accessors.length; j++) {
const accessor = accessors[j];
if (areEqualKeys(accessor.key, key)) {
accessor.getters.push(
...(node.kind === "get" ? [node] : []),
);
accessor.setters.push(
...(node.kind === "set" ? [node] : []),
);
found = true;
break;
}
}
if (!found) {
accessors.push({
key,
getters: node.kind === "get" ? [node] : [],
setters: node.kind === "set" ? [node] : [],
});
}
found = false;
}
}
for (const { getters, setters } of accessors) {
if (checkSetWithoutGet && setters.length && !getters.length) {
reportList(setters, "missingGetter");
}
if (checkGetWithoutSet && getters.length && !setters.length) {
reportList(getters, "missingSetter");
}
}
}
/**
* Checks accessor pairs in an object literal.
* @param {ASTNode} node `ObjectExpression` node to check.
* @returns {void}
* @private
*/
function checkObjectLiteral(node) {
checkList(node.properties.filter(p => p.type === "Property"));
}
/**
* Checks accessor pairs in a property descriptor.
* @param {ASTNode} node Property descriptor `ObjectExpression` node to check.
* @returns {void}
* @private
*/
function checkPropertyDescriptor(node) {
const namesToCheck = new Set(
node.properties
.filter(
p =>
p.type === "Property" &&
p.kind === "init" &&
!p.computed,
)
.map(({ key }) => key.name),
);
const hasGetter = namesToCheck.has("get");
const hasSetter = namesToCheck.has("set");
if (checkSetWithoutGet && hasSetter && !hasGetter) {
report(node, "missingGetter");
}
if (checkGetWithoutSet && hasGetter && !hasSetter) {
report(node, "missingSetter");
}
}
/**
* Checks the given object expression as an object literal and as a possible property descriptor.
* @param {ASTNode} node `ObjectExpression` node to check.
* @returns {void}
* @private
*/
function checkObjectExpression(node) {
checkObjectLiteral(node);
if (isPropertyDescriptor(node)) {
checkPropertyDescriptor(node);
}
}
/**
* Checks the given class body.
* @param {ASTNode} node `ClassBody` node to check.
* @returns {void}
* @private
*/
function checkClassBody(node) {
const methodDefinitions = node.body.filter(
m => m.type === "MethodDefinition",
);
checkList(methodDefinitions.filter(m => m.static));
checkList(methodDefinitions.filter(m => !m.static));
}
const listeners = {};
if (checkSetWithoutGet || checkGetWithoutSet) {
listeners.ObjectExpression = checkObjectExpression;
if (enforceForClassMembers) {
listeners.ClassBody = checkClassBody;
}
}
return listeners;
},
};

View File

@@ -0,0 +1,49 @@
import { SCHEMES } from "../uri";
const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})";
const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})";
const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]";
const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)";
const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$");
const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$");
const URN_PARSE = /^([^\:]+)\:(.*)/;
const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;
//RFC 2141
const handler = {
scheme: "urn",
parse: function (components, options) {
const matches = components.path && components.path.match(URN_PARSE);
let urnComponents = components;
if (matches) {
const scheme = options.scheme || urnComponents.scheme || "urn";
const nid = matches[1].toLowerCase();
const nss = matches[2];
const urnScheme = `${scheme}:${options.nid || nid}`;
const schemeHandler = SCHEMES[urnScheme];
urnComponents.nid = nid;
urnComponents.nss = nss;
urnComponents.path = undefined;
if (schemeHandler) {
urnComponents = schemeHandler.parse(urnComponents, options);
}
}
else {
urnComponents.error = urnComponents.error || "URN can not be parsed.";
}
return urnComponents;
},
serialize: function (urnComponents, options) {
const scheme = options.scheme || urnComponents.scheme || "urn";
const nid = urnComponents.nid;
const urnScheme = `${scheme}:${options.nid || nid}`;
const schemeHandler = SCHEMES[urnScheme];
if (schemeHandler) {
urnComponents = schemeHandler.serialize(urnComponents, options);
}
const uriComponents = urnComponents;
const nss = urnComponents.nss;
uriComponents.path = `${nid || options.nid}:${nss}`;
return uriComponents;
},
};
export default handler;
//# sourceMappingURL=urn.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q"},C:{"1":"DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB qC rC"},D:{"1":"0 9 r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q"},E:{"1":"WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC"},F:{"1":"0 g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD"},H:{"2":"WD"},I:{"2":"LC J I XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"1":"2 3 4 5 6 7 8","2":"J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","16":"1"},Q:{"2":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:6,C:"Passkeys",D:true};

View File

@@ -0,0 +1,42 @@
module.exports = isexe
isexe.sync = sync
var fs = require('fs')
function checkPathExt (path, options) {
var pathext = options.pathExt !== undefined ?
options.pathExt : process.env.PATHEXT
if (!pathext) {
return true
}
pathext = pathext.split(';')
if (pathext.indexOf('') !== -1) {
return true
}
for (var i = 0; i < pathext.length; i++) {
var p = pathext[i].toLowerCase()
if (p && path.substr(-p.length).toLowerCase() === p) {
return true
}
}
return false
}
function checkStat (stat, path, options) {
if (!stat.isSymbolicLink() && !stat.isFile()) {
return false
}
return checkPathExt(path, options)
}
function isexe (path, options, cb) {
fs.stat(path, function (er, stat) {
cb(er, er ? false : checkStat(stat, path, options))
})
}
function sync (path, options) {
return checkStat(fs.statSync(path), path, options)
}

View File

@@ -0,0 +1 @@
export default function warning(condition: any, message: string): void

View File

@@ -0,0 +1,811 @@
/**
* @fileoverview Shared types for ESLint Core.
*/
import { JSONSchema4 } from "json-schema";
/**
* Represents an error inside of a file.
*/
export interface FileError {
message: string;
line: number;
column: number;
endLine?: number;
endColumn?: number;
}
/**
* Represents a problem found in a file.
*/
export interface FileProblem {
ruleId: string | null;
message: string;
loc: SourceLocation;
}
/**
* Represents the start and end coordinates of a node inside the source.
*/
export interface SourceLocation {
start: Position;
end: Position;
}
/**
* Represents the start and end coordinates of a node inside the source with an offset.
*/
export interface SourceLocationWithOffset {
start: PositionWithOffset;
end: PositionWithOffset;
}
/**
* Represents a location coordinate inside the source. ESLint-style formats
* have just `line` and `column` while others may have `offset` as well.
*/
export interface Position {
line: number;
column: number;
}
/**
* Represents a location coordinate inside the source with an offset.
*/
export interface PositionWithOffset extends Position {
offset: number;
}
/**
* Represents a range of characters in the source.
*/
export type SourceRange = [number, number];
/**
* What the rule is responsible for finding:
* - `problem` means the rule has noticed a potential error.
* - `suggestion` means the rule suggests an alternate or better approach.
* - `layout` means the rule is looking at spacing, indentation, etc.
*/
export type RuleType = "problem" | "suggestion" | "layout";
/**
* The type of fix the rule can provide:
* - `code` means the rule can fix syntax.
* - `whitespace` means the rule can fix spacing and indentation.
*/
export type RuleFixType = "code" | "whitespace";
/**
* An object containing visitor information for a rule. Each method is either the
* name of a node type or a selector, or is a method that will be called at specific
* times during the traversal.
*/
export type RuleVisitor = Record<string, ((...args: any[]) => void) | undefined>;
/**
* Rule meta information used for documentation.
*/
export interface RulesMetaDocs {
/**
* A short description of the rule.
*/
description?: string | undefined;
/**
* The URL to the documentation for the rule.
*/
url?: string | undefined;
/**
* The category the rule falls under.
* @deprecated No longer used.
*/
category?: string | undefined;
/**
* Indicates if the rule is generally recommended for all users.
*/
recommended?: boolean | undefined;
/**
* Indicates if the rule is frozen (no longer accepting feature requests).
*/
frozen?: boolean | undefined;
}
/**
* Meta information about a rule.
*/
export interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
/**
* Properties that are used when documenting the rule.
*/
docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
/**
* The type of rule.
*/
type?: RuleType | undefined;
/**
* The schema for the rule options. Required if the rule has options.
*/
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
/**
* Any default options to be recursively merged on top of any user-provided options.
**/
defaultOptions?: RuleOptions;
/**
* The messages that the rule can report.
*/
messages?: Record<MessageIds, string>;
/**
* Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
*/
deprecated?: boolean | DeprecatedInfo | undefined;
/**
* @deprecated Use deprecated.replacedBy instead.
* The name of the rule(s) this rule was replaced by, if it was deprecated.
*/
replacedBy?: readonly string[] | undefined;
/**
* Indicates if the rule is fixable, and if so, what type of fix it provides.
*/
fixable?: RuleFixType | undefined;
/**
* Indicates if the rule may provide suggestions.
*/
hasSuggestions?: boolean | undefined;
/**
* The language the rule is intended to lint.
*/
language?: string;
/**
* The dialects of `language` that the rule is intended to lint.
*/
dialects?: string[];
}
/**
* Provides additional metadata about a deprecation.
*/
export interface DeprecatedInfo {
/**
* General message presented to the user, e.g. for the key rule why the rule
* is deprecated or for info how to replace the rule.
*/
message?: string;
/**
* URL to more information about this deprecation in general.
*/
url?: string;
/**
* An empty array explicitly states that there is no replacement.
*/
replacedBy?: ReplacedByInfo[];
/**
* The package version since when the rule is deprecated (should use full
* semver without a leading "v").
*/
deprecatedSince?: string;
/**
* The estimated version when the rule is removed (probably the next major
* version). null means the rule is "frozen" (will be available but will not
* be changed).
*/
availableUntil?: string | null;
}
/**
* Provides metadata about a replacement
*/
export interface ReplacedByInfo {
/**
* General message presented to the user, e.g. how to replace the rule
*/
message?: string;
/**
* URL to more information about this replacement in general
*/
url?: string;
/**
* Name should be "eslint" if the replacement is an ESLint core rule. Omit
* the property if the replacement is in the same plugin.
*/
plugin?: ExternalSpecifier;
/**
* Name and documentation of the replacement rule
*/
rule?: ExternalSpecifier;
}
/**
* Specifies the name and url of an external resource. At least one property
* should be set.
*/
export interface ExternalSpecifier {
/**
* Name of the referenced plugin / rule.
*/
name?: string;
/**
* URL pointing to documentation for the plugin / rule.
*/
url?: string;
}
/**
* Generic type for `RuleContext`.
*/
export interface RuleContextTypeOptions {
LangOptions: LanguageOptions;
Code: SourceCode;
RuleOptions: unknown[];
Node: unknown;
MessageIds: string;
}
/**
* Represents the context object that is passed to a rule. This object contains
* information about the current state of the linting process and is the rule's
* view into the outside world.
*/
export interface RuleContext<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
/**
* The current working directory for the session.
*/
cwd: string;
/**
* Returns the current working directory for the session.
* @deprecated Use `cwd` instead.
*/
getCwd(): string;
/**
* The filename of the file being linted.
*/
filename: string;
/**
* Returns the filename of the file being linted.
* @deprecated Use `filename` instead.
*/
getFilename(): string;
/**
* The physical filename of the file being linted.
*/
physicalFilename: string;
/**
* Returns the physical filename of the file being linted.
* @deprecated Use `physicalFilename` instead.
*/
getPhysicalFilename(): string;
/**
* The source code object that the rule is running on.
*/
sourceCode: Options["Code"];
/**
* Returns the source code object that the rule is running on.
* @deprecated Use `sourceCode` instead.
*/
getSourceCode(): Options["Code"];
/**
* Shared settings for the configuration.
*/
settings: SettingsConfig;
/**
* Parser-specific options for the configuration.
* @deprecated Use `languageOptions.parserOptions` instead.
*/
parserOptions: Record<string, unknown>;
/**
* The language options for the configuration.
*/
languageOptions: Options["LangOptions"];
/**
* The CommonJS path to the parser used while parsing this file.
* @deprecated No longer used.
*/
parserPath: string | undefined;
/**
* The rule ID.
*/
id: string;
/**
* The rule's configured options.
*/
options: Options["RuleOptions"];
/**
* The report function that the rule should use to report problems.
* @param violation The violation to report.
*/
report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
}
/**
* Manager of text edits for a rule fix.
*/
export interface RuleTextEditor<EditableSyntaxElement = unknown> {
/**
* Inserts text after the specified node or token.
* @param syntaxElement The node or token to insert after.
* @param text The edit to insert after the node or token.
*/
insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
/**
* Inserts text after the specified range.
* @param range The range to insert after.
* @param text The edit to insert after the range.
*/
insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit;
/**
* Inserts text before the specified node or token.
* @param syntaxElement A syntax element with location information to insert before.
* @param text The edit to insert before the node or token.
*/
insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
/**
* Inserts text before the specified range.
* @param range The range to insert before.
* @param text The edit to insert before the range.
*/
insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit;
/**
* Removes the specified node or token.
* @param syntaxElement A syntax element with location information to remove.
* @returns The edit to remove the node or token.
*/
remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
/**
* Removes the specified range.
* @param range The range to remove.
* @returns The edit to remove the range.
*/
removeRange(range: SourceRange): RuleTextEdit;
/**
* Replaces the specified node or token with the given text.
* @param syntaxElement A syntax element with location information to replace.
* @param text The text to replace the node or token with.
* @returns The edit to replace the node or token.
*/
replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
/**
* Replaces the specified range with the given text.
* @param range The range to replace.
* @param text The text to replace the range with.
* @returns The edit to replace the range.
*/
replaceTextRange(range: SourceRange, text: string): RuleTextEdit;
}
/**
* Represents a fix for a rule violation implemented as a text edit.
*/
export interface RuleTextEdit {
/**
* The range to replace.
*/
range: SourceRange;
/**
* The text to insert.
*/
text: string;
}
/**
* Fixes a violation.
* @param fixer The text editor to apply the fix.
* @returns The fix(es) for the violation.
*/
type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
interface ViolationReportBase {
/**
* The type of node that the violation is for.
* @deprecated May be removed in the future.
*/
nodeType?: string | undefined;
/**
* The data to insert into the message.
*/
data?: Record<string, string> | undefined;
/**
* The fix to be applied for the violation.
*/
fix?: RuleFixer | null | undefined;
/**
* An array of suggested fixes for the problem. These fixes may change the
* behavior of the code, so they are not applied automatically.
*/
suggest?: SuggestedEdit[] | null | undefined;
}
type ViolationMessage<MessageIds = string> = {
message: string;
} | {
messageId: MessageIds;
};
type ViolationLocation<Node> = {
loc: SourceLocation | Position;
} | {
node: Node;
};
export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
interface SuggestedEditBase {
/**
* The data to insert into the message.
*/
data?: Record<string, string> | undefined;
/**
* The fix to be applied for the suggestion.
*/
fix?: RuleFixer | null | undefined;
}
type SuggestionMessage = {
desc: string;
} | {
messageId: string;
};
/**
* A suggested edit for a rule violation.
*/
export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
/**
* Generic options for the `RuleDefinition` type.
*/
export interface RuleDefinitionTypeOptions {
LangOptions: LanguageOptions;
Code: SourceCode;
RuleOptions: unknown[];
Visitor: RuleVisitor;
Node: unknown;
MessageIds: string;
ExtRuleDocs: unknown;
}
/**
* The definition of an ESLint rule.
*/
export interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
/**
* The meta information for the rule.
*/
meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
/**
* Creates the visitor that ESLint uses to apply the rule during traversal.
* @param context The rule context.
* @returns The rule visitor.
*/
create(context: RuleContext<{
LangOptions: Options["LangOptions"];
Code: Options["Code"];
RuleOptions: Options["RuleOptions"];
Node: Options["Node"];
MessageIds: Options["MessageIds"];
}>): Options["Visitor"];
}
/**
* The human readable severity level used in a configuration.
*/
export type SeverityName = "off" | "warn" | "error";
/**
* The numeric severity level for a rule.
*
* - `0` means off.
* - `1` means warn.
* - `2` means error.
*/
export type SeverityLevel = 0 | 1 | 2;
/**
* The severity of a rule in a configuration.
*/
export type Severity = SeverityName | SeverityLevel;
/**
* Represents the configuration options for the core linter.
*/
export interface LinterOptionsConfig {
/**
* Indicates whether or not inline configuration is evaluated.
*/
noInlineConfig?: boolean;
/**
* Indicates what to do when an unused disable directive is found.
*/
reportUnusedDisableDirectives?: boolean | Severity;
}
/**
* Shared settings that are accessible from within plugins.
*/
export type SettingsConfig = Record<string, unknown>;
/**
* The configuration for a rule.
*/
export type RuleConfig = Severity | [Severity, ...unknown[]];
/**
* A collection of rules and their configurations.
*/
export type RulesConfig = Record<string, RuleConfig>;
/**
* Generic options for the `Language` type.
*/
export interface LanguageTypeOptions {
LangOptions: LanguageOptions;
Code: SourceCode;
RootNode: unknown;
Node: unknown;
}
/**
* Represents a plugin language.
*/
export interface Language<Options extends LanguageTypeOptions = {
LangOptions: LanguageOptions;
Code: SourceCode;
RootNode: unknown;
Node: unknown;
}> {
/**
* Indicates how ESLint should read the file.
*/
fileType: "text";
/**
* First line number returned from the parser (text mode only).
*/
lineStart: 0 | 1;
/**
* First column number returned from the parser (text mode only).
*/
columnStart: 0 | 1;
/**
* The property to read the node type from. Used in selector querying.
*/
nodeTypeKey: string;
/**
* The traversal path that tools should take when evaluating the AST
*/
visitorKeys?: Record<string, string[]>;
/**
* Default language options. User-defined options are merged with this object.
*/
defaultLanguageOptions?: LanguageOptions;
/**
* Validates languageOptions for this language.
*/
validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
/**
* Normalizes languageOptions for this language.
*/
normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
/**
* Helper for esquery that allows languages to match nodes against
* class. esquery currently has classes like `function` that will
* match all the various function nodes. This method allows languages
* to implement similar shorthands.
*/
matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
/**
* Parses the given file input into its component parts. This file should not
* throws errors for parsing errors but rather should return any parsing
* errors as parse of the ParseResult object.
*/
parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
/**
* Creates SourceCode object that ESLint uses to work with a file.
*/
createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
}
/**
* Plugin-defined options for the language.
*/
export type LanguageOptions = Record<string, unknown>;
/**
* The context object that is passed to the language plugin methods.
*/
export interface LanguageContext<LangOptions = LanguageOptions> {
languageOptions: LangOptions;
}
/**
* Represents a file read by ESLint.
*/
export interface File {
/**
* The path that ESLint uses for this file. May be a virtual path
* if it was returned by a processor.
*/
path: string;
/**
* The path to the file on disk. This always maps directly to a file
* regardless of whether it was returned from a processor.
*/
physicalPath: string;
/**
* Indicates if the original source contained a byte-order marker.
* ESLint strips the BOM from the `body`, but this info is needed
* to correctly apply autofixing.
*/
bom: boolean;
/**
* The body of the file to parse.
*/
body: string | Uint8Array;
}
/**
* Represents the successful result of parsing a file.
*/
export interface OkParseResult<RootNode = unknown> {
/**
* Indicates if the parse was successful. If true, the parse was successful
* and ESLint should continue on to create a SourceCode object and run rules;
* if false, ESLint should just report the error(s) without doing anything
* else.
*/
ok: true;
/**
* The abstract syntax tree created by the parser. (only when ok: true)
*/
ast: RootNode;
/**
* Any additional data that the parser wants to provide.
*/
[key: string]: any;
}
/**
* Represents the unsuccessful result of parsing a file.
*/
export interface NotOkParseResult {
/**
* Indicates if the parse was successful. If true, the parse was successful
* and ESLint should continue on to create a SourceCode object and run rules;
* if false, ESLint should just report the error(s) without doing anything
* else.
*/
ok: false;
/**
* Any parsing errors, whether fatal or not. (only when ok: false)
*/
errors: FileError[];
/**
* Any additional data that the parser wants to provide.
*/
[key: string]: any;
}
export type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
/**
* Represents inline configuration found in the source code.
*/
interface InlineConfigElement {
/**
* The location of the inline config element.
*/
loc: SourceLocation;
/**
* The interpreted configuration from the inline config element.
*/
config: {
rules: RulesConfig;
};
}
/**
* Generic options for the `SourceCodeBase` type.
*/
interface SourceCodeBaseTypeOptions {
LangOptions: LanguageOptions;
RootNode: unknown;
SyntaxElementWithLoc: unknown;
ConfigNode: unknown;
}
/**
* Represents the basic interface for a source code object.
*/
interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions = {
LangOptions: LanguageOptions;
RootNode: unknown;
SyntaxElementWithLoc: unknown;
ConfigNode: unknown;
}> {
/**
* Root of the AST.
*/
ast: Options["RootNode"];
/**
* The traversal path that tools should take when evaluating the AST.
* When present, this overrides the `visitorKeys` on the language for
* just this source code object.
*/
visitorKeys?: Record<string, string[]>;
/**
* Retrieves the equivalent of `loc` for a given node or token.
* @param syntaxElement The node or token to get the location for.
* @returns The location of the node or token.
*/
getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation;
/**
* Retrieves the equivalent of `range` for a given node or token.
* @param syntaxElement The node or token to get the range for.
* @returns The range of the node or token.
*/
getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange;
/**
* Traversal of AST.
*/
traverse(): Iterable<TraversalStep>;
/**
* Applies language options passed in from the ESLint core.
*/
applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
/**
* Return all of the inline areas where ESLint should be disabled/enabled
* along with any problems found in evaluating the directives.
*/
getDisableDirectives?(): {
directives: Directive[];
problems: FileProblem[];
};
/**
* Returns an array of all inline configuration nodes found in the
* source code.
*/
getInlineConfigNodes?(): Options["ConfigNode"][];
/**
* Applies configuration found inside of the source code. This method is only
* called when ESLint is running with inline configuration allowed.
*/
applyInlineConfig?(): {
configs: InlineConfigElement[];
problems: FileProblem[];
};
/**
* Called by ESLint core to indicate that it has finished providing
* information. We now add in all the missing variables and ensure that
* state-changing methods cannot be called by rules.
* @returns {void}
*/
finalize?(): void;
}
/**
* Represents the source of a text file being linted.
*/
export interface TextSourceCode<Options extends SourceCodeBaseTypeOptions = {
LangOptions: LanguageOptions;
RootNode: unknown;
SyntaxElementWithLoc: unknown;
ConfigNode: unknown;
}> extends SourceCodeBase<Options> {
/**
* The body of the file that you'd like rule developers to access.
*/
text: string;
}
/**
* Represents the source of a binary file being linted.
*/
export interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions = {
LangOptions: LanguageOptions;
RootNode: unknown;
SyntaxElementWithLoc: unknown;
ConfigNode: unknown;
}> extends SourceCodeBase<Options> {
/**
* The body of the file that you'd like rule developers to access.
*/
body: Uint8Array;
}
export type SourceCode<Options extends SourceCodeBaseTypeOptions = {
LangOptions: LanguageOptions;
RootNode: unknown;
SyntaxElementWithLoc: unknown;
ConfigNode: unknown;
}> = TextSourceCode<Options> | BinarySourceCode<Options>;
/**
* Represents a traversal step visiting the AST.
*/
export interface VisitTraversalStep {
kind: 1;
target: unknown;
phase: 1 | 2;
args: unknown[];
}
/**
* Represents a traversal step calling a function.
*/
export interface CallTraversalStep {
kind: 2;
target: string;
phase?: string;
args: unknown[];
}
export type TraversalStep = VisitTraversalStep | CallTraversalStep;
/**
* The type of disable directive. This determines how ESLint will disable rules.
*/
export type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
/**
* Represents a disable directive.
*/
export interface Directive {
/**
* The type of directive.
*/
type: DirectiveType;
/**
* The node of the directive. May be in the AST or a comment/token.
*/
node: unknown;
/**
* The value of the directive.
*/
value: string;
/**
* The justification for the directive.
*/
justification?: string;
}
export {};

View File

@@ -0,0 +1,93 @@
function debounce(fn, delay) {
let handle
return () => {
clearTimeout(handle)
handle = setTimeout(fn, delay)
}
}
/* eslint-disable no-undef */
const hooks = []
window.__registerBeforePerformReactRefresh = (cb) => {
hooks.push(cb)
}
const enqueueUpdate = debounce(async () => {
if (hooks.length) await Promise.all(hooks.map((cb) => cb()))
exports.performReactRefresh()
}, 16)
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
// This allows to resister components not detected by SWC like styled component
function registerExportsForReactRefresh(filename, moduleExports) {
for (const key in moduleExports) {
if (key === '__esModule') continue
const exportValue = moduleExports[key]
if (exports.isLikelyComponentType(exportValue)) {
// 'export' is required to avoid key collision when renamed exports that
// shadow a local component name: https://github.com/vitejs/vite-plugin-react/issues/116
// The register function has an identity check to not register twice the same component,
// so this is safe to not used the same key here.
exports.register(exportValue, filename + ' export ' + key)
}
}
}
function validateRefreshBoundaryAndEnqueueUpdate(id, prevExports, nextExports) {
const ignoredExports = window.__getReactRefreshIgnoredExports?.({ id }) ?? []
if (
predicateOnExport(
ignoredExports,
prevExports,
(key) => key in nextExports,
) !== true
) {
return 'Could not Fast Refresh (export removed)'
}
if (
predicateOnExport(
ignoredExports,
nextExports,
(key) => key in prevExports,
) !== true
) {
return 'Could not Fast Refresh (new export)'
}
let hasExports = false
const allExportsAreComponentsOrUnchanged = predicateOnExport(
ignoredExports,
nextExports,
(key, value) => {
hasExports = true
if (exports.isLikelyComponentType(value)) return true
return prevExports[key] === nextExports[key]
},
)
if (hasExports && allExportsAreComponentsOrUnchanged === true) {
enqueueUpdate()
} else {
return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports`
}
}
function predicateOnExport(ignoredExports, moduleExports, predicate) {
for (const key in moduleExports) {
if (key === '__esModule') continue
if (ignoredExports.includes(key)) continue
const desc = Object.getOwnPropertyDescriptor(moduleExports, key)
if (desc && desc.get) return key
if (!predicate(key, moduleExports[key])) return key
}
return true
}
// Hides vite-ignored dynamic import so that Vite can skip analysis if no other
// dynamic import is present (https://github.com/vitejs/vite/pull/12732)
function __hmr_import(module) {
return import(/* @vite-ignore */ module)
}
exports.__hmr_import = __hmr_import
exports.registerExportsForReactRefresh = registerExportsForReactRefresh
exports.validateRefreshBoundaryAndEnqueueUpdate =
validateRefreshBoundaryAndEnqueueUpdate

View File

@@ -0,0 +1 @@
{"version":3,"names":["Hub","getCode","getScope","addHelper","Error","buildError","node","msg","TypeError","exports","default"],"sources":["../src/hub.ts"],"sourcesContent":["import type Scope from \"./scope/index.ts\";\nimport type { Node } from \"@babel/types\";\n\nexport interface HubInterface {\n getCode(): string | void;\n getScope(): Scope | void;\n addHelper(name: string): any;\n buildError(node: Node, msg: string, Error: new () => Error): Error;\n}\n\nexport default class Hub implements HubInterface {\n getCode() {}\n\n getScope() {}\n\n addHelper() {\n throw new Error(\"Helpers are not supported by the default hub.\");\n }\n\n buildError(node: Node, msg: string, Error = TypeError): Error {\n return new Error(msg);\n }\n}\n"],"mappings":";;;;;;AAUe,MAAMA,GAAG,CAAyB;EAC/CC,OAAOA,CAAA,EAAG,CAAC;EAEXC,QAAQA,CAAA,EAAG,CAAC;EAEZC,SAASA,CAAA,EAAG;IACV,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC;EAClE;EAEAC,UAAUA,CAACC,IAAU,EAAEC,GAAW,EAAEH,KAAK,GAAGI,SAAS,EAAS;IAC5D,OAAO,IAAIJ,KAAK,CAACG,GAAG,CAAC;EACvB;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAV,GAAA","ignoreList":[]}

View File

@@ -0,0 +1 @@
module.exports={C:{"4":0.04373,"52":0.01193,"88":0.00795,"91":0.00795,"113":0.00398,"115":0.1431,"120":0.00795,"125":0.00398,"128":0.05565,"131":0.00398,"132":0.00398,"133":0.01193,"134":0.0159,"135":0.21465,"136":0.91425,"137":0.00398,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 121 122 123 124 126 127 129 130 138 139 140 3.5 3.6"},D:{"39":0.00795,"40":0.00795,"41":0.00795,"42":0.00795,"43":0.00795,"44":0.00795,"45":0.00795,"46":0.00795,"47":0.01193,"48":0.01193,"49":0.01988,"50":0.00795,"51":0.01193,"52":0.01193,"53":0.00795,"54":0.00795,"55":0.01193,"56":0.01193,"57":0.00795,"58":0.01193,"59":0.00795,"60":0.00795,"66":0.00795,"75":0.00795,"78":0.00795,"79":0.03578,"81":0.00795,"85":0.00398,"86":0.00795,"87":0.03975,"88":0.00795,"89":0.00398,"90":0.00398,"91":0.00795,"94":0.02783,"96":0.00398,"99":0.00795,"101":0.00398,"102":0.00795,"103":0.02783,"104":0.03975,"105":0.01193,"106":0.01193,"107":0.0159,"108":0.02783,"109":1.29585,"110":0.0159,"111":0.0159,"112":0.01193,"113":0.00398,"114":0.01988,"116":0.05963,"117":0.0477,"118":0.00795,"119":0.02783,"120":0.02783,"121":0.03578,"122":0.08348,"123":0.03578,"124":0.07155,"125":0.08745,"126":0.07553,"127":0.05565,"128":0.15503,"129":0.07553,"130":0.0954,"131":0.35378,"132":0.3975,"133":7.40543,"134":17.42243,"135":0.01988,"136":0.00795,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 67 68 69 70 71 72 73 74 76 77 80 83 84 92 93 95 97 98 100 115 137 138"},F:{"87":0.00795,"95":0.02783,"114":0.00795,"116":0.84668,"117":1.91198,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.01193,"105":0.00398,"109":0.02783,"114":0.00795,"122":0.00398,"125":0.00398,"126":0.00795,"127":0.00398,"128":0.00398,"129":0.00795,"130":0.01193,"131":0.03578,"132":0.07155,"133":1.0335,"134":2.862,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 110 111 112 113 115 116 117 118 119 120 121 123 124"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 17.0","5.1":0.00398,"13.1":0.00795,"14.1":0.00795,"15.6":0.03578,"16.1":0.00795,"16.3":0.00795,"16.4":0.00398,"16.5":0.00398,"16.6":0.03975,"17.1":0.0159,"17.2":0.00795,"17.3":0.00795,"17.4":0.0159,"17.5":0.02385,"17.6":0.07553,"18.0":0.0159,"18.1":0.03578,"18.2":0.01988,"18.3":0.40943,"18.4":0.01193},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00127,"6.0-6.1":0,"7.0-7.1":0.00063,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00698,"10.0-10.2":0.0019,"10.3":0.01269,"11.0-11.2":0.14021,"11.3-11.4":0.01079,"12.0-12.1":0,"12.2-12.5":0.02284,"13.0-13.1":0,"13.2":0.00063,"13.3":0.00063,"13.4-13.7":0.00127,"14.0-14.4":0.00634,"14.5-14.8":0.00634,"15.0-15.1":0.00317,"15.2-15.3":0.00381,"15.4":0.00381,"15.5":0.00825,"15.6-15.8":0.17003,"16.0":0.02411,"16.1":0.05773,"16.2":0.02221,"16.3":0.04568,"16.4":0.00634,"16.5":0.01142,"16.6-16.7":0.32229,"17.0":0.00825,"17.1":0.01332,"17.2":0.01015,"17.3":0.0184,"17.4":0.03807,"17.5":0.12625,"17.6-17.7":0.35528,"18.0":0.11864,"18.1":0.47519,"18.2":0.15163,"18.3":4.07559,"18.4":0.05646},P:{"4":0.01085,"21":0.01085,"22":0.01085,"23":0.02169,"24":0.02169,"25":0.02169,"26":0.06507,"27":1.27971,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.05423,"17.0":0.02169},I:{"0":0.18659,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00015},K:{"0":0.21088,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.00427,"11":0.11101,_:"6 7 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.1205},Q:{_:"14.9"},O:{"0":0.0241},H:{"0":0},L:{"0":52.83308}};

View File

@@ -0,0 +1,96 @@
declare namespace callsites {
interface CallSite {
/**
Returns the value of `this`.
*/
getThis(): unknown | undefined;
/**
Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property.
*/
getTypeName(): string | null;
/**
Returns the current function.
*/
getFunction(): Function | undefined;
/**
Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
*/
getFunctionName(): string | null;
/**
Returns the name of the property of `this` or one of its prototypes that holds the current function.
*/
getMethodName(): string | undefined;
/**
Returns the name of the script if this function was defined in a script.
*/
getFileName(): string | null;
/**
Returns the current line number if this function was defined in a script.
*/
getLineNumber(): number | null;
/**
Returns the current column number if this function was defined in a script.
*/
getColumnNumber(): number | null;
/**
Returns a string representing the location where `eval` was called if this function was created using a call to `eval`.
*/
getEvalOrigin(): string | undefined;
/**
Returns `true` if this is a top-level invocation, that is, if it's a global object.
*/
isToplevel(): boolean;
/**
Returns `true` if this call takes place in code defined by a call to `eval`.
*/
isEval(): boolean;
/**
Returns `true` if this call is in native V8 code.
*/
isNative(): boolean;
/**
Returns `true` if this is a constructor call.
*/
isConstructor(): boolean;
}
}
declare const callsites: {
/**
Get callsites from the V8 stack trace API.
@returns An array of `CallSite` objects.
@example
```
import callsites = require('callsites');
function unicorn() {
console.log(callsites()[0].getFileName());
//=> '/Users/sindresorhus/dev/callsites/test.js'
}
unicorn();
```
*/
(): callsites.CallSite[];
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function callsites(): callsites.CallSite[];
// export = callsites;
default: typeof callsites;
};
export = callsites;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g"},C:{"1":"0 9 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w qC rC"},D:{"1":"0 9 g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z e f","66":"a b c d"},E:{"2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"1":"0 S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC 4C 5C 6C 7C FC kC 8C GC"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 KC nD","2":"J dD eD fD gD hD TC iD jD kD lD mD IC JC"},Q:{"2":"oD"},R:{"1":"pD"},S:{"2":"qD rD"}},B:5,C:"WebTransport",D:true};

View File

@@ -0,0 +1,19 @@
# @babel/compat-data
> The compat-data to determine required Babel plugins
See our website [@babel/compat-data](https://babeljs.io/docs/babel-compat-data) for more information.
## Install
Using npm:
```sh
npm install --save @babel/compat-data
```
or using yarn:
```sh
yarn add @babel/compat-data
```

View File

@@ -0,0 +1,138 @@
# Retry utility
by [Nicholas C. Zakas](https://humanwhocodes.com)
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.
## Description
A utility for retrying failed async JavaScript calls based on the error returned.
## Usage
### Node.js
Install using [npm][npm] or [yarn][yarn]:
```
npm install @humanwhocodes/retry
# or
yarn add @humanwhocodes/retry
```
Import into your Node.js project:
```js
// CommonJS
const { Retrier } = require("@humanwhocodes/retry");
// ESM
import { Retrier } from "@humanwhocodes/retry";
```
### Deno
Install using [JSR](https://jsr.io):
```shell
deno add @humanwhocodes/retry
#or
jsr add @humanwhocodes/retry
```
Then import into your Deno project:
```js
import { Retrier } from "@humanwhocodes/retry";
```
### Bun
Install using this command:
```
bun add @humanwhocodes/retry
```
Import into your Bun project:
```js
import { Retrier } from "@humanwhocodes/retry";
```
### Browser
It's recommended to import the minified version to save bandwidth:
```js
import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry?min";
```
However, you can also import the unminified version for debugging purposes:
```js
import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry";
```
## API
After importing, create a new instance of `Retrier` and specify the function to run on the error. This function should return `true` if you want the call retried and `false` if not.
```js
// this instance will retry if the specific error code is found
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
});
```
Then, call the `retry()` method around the function you'd like to retry, such as:
```js
import fs from "fs/promises";
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
});
const text = await retrier.retry(() => fs.readFile("README.md", "utf8"));
```
The `retry()` method will either pass through the result on success or wait and retry on failure. Any error that isn't caught by the retrier is automatically rejected so the end result is a transparent passing through of both success and failure.
You can also pass an `AbortSignal` to cancel a retry:
```js
import fs from "fs/promises";
const controller = new AbortController();
const retrier = new Retrier(error => {
return error.code === "ENFILE" || error.code === "EMFILE";
});
const text = await retrier.retry(
() => fs.readFile("README.md", "utf8"),
{ signal: controller.signal }
);
```
## Developer Setup
1. Fork the repository
2. Clone your fork
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests
## License
Apache 2.0
## Prior Art
This utility is inspired by, and contains code from [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/

View File

@@ -0,0 +1,35 @@
{
"name": "@babel/plugin-transform-react-jsx-source",
"version": "7.25.9",
"description": "Add a __source prop to all JSX Elements",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-transform-react-jsx-source"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-react-jsx-source",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "./lib/index.js",
"keywords": [
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.9"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.25.9",
"@babel/helper-plugin-test-runner": "^7.25.9",
"@babel/plugin-syntax-jsx": "^7.25.9"
},
"engines": {
"node": ">=6.9.0"
},
"author": "The Babel Team (https://babel.dev/team)",
"type": "commonjs"
}

View File

@@ -0,0 +1,109 @@
import { AnyRoute, StaticDataRouteOption } from './route.cjs';
import { AllContext, AllLoaderData, AllParams, FullSearchSchema, ParseRoute, RouteById, RouteIds } from './routeInfo.cjs';
import { AnyRouter, RegisteredRouter } from './router.cjs';
import { Constrain, ControlledPromise } from './utils.cjs';
export type AnyMatchAndValue = {
match: any;
value: any;
};
export type FindValueByIndex<TKey, TValue extends ReadonlyArray<any>> = TKey extends `${infer TIndex extends number}` ? TValue[TIndex] : never;
export type FindValueByKey<TKey, TValue> = TValue extends ReadonlyArray<any> ? FindValueByIndex<TKey, TValue> : TValue[TKey & keyof TValue];
export type CreateMatchAndValue<TMatch, TValue> = TValue extends any ? {
match: TMatch;
value: TValue;
} : never;
export type NextMatchAndValue<TKey, TMatchAndValue extends AnyMatchAndValue> = TMatchAndValue extends any ? CreateMatchAndValue<TMatchAndValue['match'], FindValueByKey<TKey, TMatchAndValue['value']>> : never;
export type IsMatchKeyOf<TValue> = TValue extends ReadonlyArray<any> ? number extends TValue['length'] ? `${number}` : keyof TValue & `${number}` : TValue extends object ? keyof TValue & string : never;
export type IsMatchPath<TParentPath extends string, TMatchAndValue extends AnyMatchAndValue> = `${TParentPath}${IsMatchKeyOf<TMatchAndValue['value']>}`;
export type IsMatchResult<TKey, TMatchAndValue extends AnyMatchAndValue> = TMatchAndValue extends any ? TKey extends keyof TMatchAndValue['value'] ? TMatchAndValue['match'] : never : never;
export type IsMatchParse<TPath, TMatchAndValue extends AnyMatchAndValue, TParentPath extends string = ''> = TPath extends `${string}.${string}` ? TPath extends `${infer TFirst}.${infer TRest}` ? IsMatchParse<TRest, NextMatchAndValue<TFirst, TMatchAndValue>, `${TParentPath}${TFirst}.`> : never : {
path: IsMatchPath<TParentPath, TMatchAndValue>;
result: IsMatchResult<TPath, TMatchAndValue>;
};
export type IsMatch<TMatch, TPath> = IsMatchParse<TPath, TMatch extends any ? {
match: TMatch;
value: TMatch;
} : never>;
/**
* Narrows matches based on a path
* @experimental
*/
export declare const isMatch: <TMatch, TPath extends string>(match: TMatch, path: Constrain<TPath, IsMatch<TMatch, TPath>["path"]>) => match is IsMatch<TMatch, TPath>["result"];
export interface DefaultRouteMatchExtensions {
scripts?: unknown;
links?: unknown;
headScripts?: unknown;
meta?: unknown;
}
export interface RouteMatchExtensions extends DefaultRouteMatchExtensions {
}
export interface RouteMatch<out TRouteId, out TFullPath, out TAllParams, out TFullSearchSchema, out TLoaderData, out TAllContext, out TLoaderDeps> extends RouteMatchExtensions {
id: string;
routeId: TRouteId;
fullPath: TFullPath;
index: number;
pathname: string;
params: TAllParams;
_strictParams: TAllParams;
status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound';
isFetching: false | 'beforeLoad' | 'loader';
error: unknown;
paramsError: unknown;
searchError: unknown;
updatedAt: number;
loadPromise?: ControlledPromise<void>;
beforeLoadPromise?: ControlledPromise<void>;
loaderPromise?: ControlledPromise<void>;
loaderData?: TLoaderData;
__routeContext: Record<string, unknown>;
__beforeLoadContext: Record<string, unknown>;
context: TAllContext;
search: TFullSearchSchema;
_strictSearch: TFullSearchSchema;
fetchCount: number;
abortController: AbortController;
cause: 'preload' | 'enter' | 'stay';
loaderDeps: TLoaderDeps;
preload: boolean;
invalid: boolean;
headers?: Record<string, string>;
globalNotFound?: boolean;
staticData: StaticDataRouteOption;
minPendingPromise?: ControlledPromise<void>;
pendingTimeout?: ReturnType<typeof setTimeout>;
}
export type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch<TRoute['types']['id'], TRoute['types']['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']>;
export type MakeRouteMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TRouteId = RouteIds<TRouteTree>, TStrict extends boolean = true> = RouteMatch<TRouteId, RouteById<TRouteTree, TRouteId>['types']['fullPath'], TStrict extends false ? AllParams<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allParams'], TStrict extends false ? FullSearchSchema<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'], TStrict extends false ? AllLoaderData<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['loaderData'], TStrict extends false ? AllContext<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allContext'], RouteById<TRouteTree, TRouteId>['types']['loaderDeps']>;
export type AnyRouteMatch = RouteMatch<any, any, any, any, any, any, any>;
export type MakeRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? RouteMatch<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']> : never;
/**
* The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)
*/
export interface MatchRouteOptions {
/**
* If `true`, will match against pending location instead of the current location.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#pending-property)
*/
pending?: boolean;
/**
* If `true`, will match against the current location with case sensitivity.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)
*/
caseSensitive?: boolean;
/**
* If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }`.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#includesearch-property)
*/
includeSearch?: boolean;
/**
* If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123`.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#fuzzy-property)
*/
fuzzy?: boolean;
}

View File

@@ -0,0 +1,56 @@
{
"name": "jsesc",
"version": "3.1.0",
"description": "Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.",
"homepage": "https://mths.be/jsesc",
"engines": {
"node": ">=6"
},
"main": "jsesc.js",
"bin": "bin/jsesc",
"man": "man/jsesc.1",
"keywords": [
"buffer",
"escape",
"javascript",
"json",
"map",
"set",
"string",
"stringify",
"tool"
],
"license": "MIT",
"author": {
"name": "Mathias Bynens",
"url": "https://mathiasbynens.be/"
},
"repository": {
"type": "git",
"url": "https://github.com/mathiasbynens/jsesc.git"
},
"bugs": "https://github.com/mathiasbynens/jsesc/issues",
"files": [
"LICENSE-MIT.txt",
"jsesc.js",
"bin/",
"man/"
],
"scripts": {
"build": "grunt template",
"coveralls": "istanbul cover --verbose --dir 'coverage' 'tests/tests.js' && coveralls < coverage/lcov.info'",
"cover": "istanbul cover --report 'html' --verbose --dir 'coverage' 'tests/tests.js'",
"test": "mocha tests"
},
"devDependencies": {
"coveralls": "^2.11.6",
"grunt": "^0.4.5",
"grunt-cli": "^1.3.2",
"grunt-template": "^0.2.3",
"istanbul": "^0.4.2",
"mocha": "^5.2.0",
"regenerate": "^1.3.0",
"requirejs": "^2.1.22",
"unicode-13.0.0": "0.8.0"
}
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E mC","388":"F A B"},B:{"4":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","260":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC","2":"nC","4":"LC"},D:{"4":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"2":"sC SC","4":"J PB K D E F A B C L M G tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"4":"0 1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 4C 5C 6C 7C FC kC 8C GC"},G:{"4":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"2":"LC J XD YD ZD aD lC","4":"I bD cD"},J:{"1":"A","2":"D"},K:{"4":"A B C H FC kC GC"},L:{"4":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"4":"HC"},P:{"4":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"4":"oD"},R:{"4":"pD"},S:{"1":"qD rD"}},B:2,C:"SVG effects for HTML",D:true};

View File

@@ -0,0 +1,68 @@
/**
* @fileoverview Disallow sparse arrays
* @author Nicholas C. Zakas
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow sparse arrays",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-sparse-arrays",
},
schema: [],
messages: {
unexpectedSparseArray: "Unexpected comma in middle of array.",
},
},
create(context) {
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
ArrayExpression(node) {
if (!node.elements.includes(null)) {
return;
}
const { sourceCode } = context;
let commaToken;
for (const [index, element] of node.elements.entries()) {
if (index === node.elements.length - 1 && element) {
return;
}
commaToken = sourceCode.getTokenAfter(
element ?? commaToken ?? sourceCode.getFirstToken(node),
astUtils.isCommaToken,
);
if (element) {
continue;
}
context.report({
node,
loc: commaToken.loc,
messageId: "unexpectedSparseArray",
});
}
},
};
},
};