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,21 @@
The MIT License (MIT)
Copyright (c) 2020 James Halliday (mail@substack.net) and Mathias Buus
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.

View File

@@ -0,0 +1,35 @@
/**
* These are types for things that are present in the React `canary` release channel.
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
*/
// See https://github.com/facebook/react/blob/main/packages/react/src/React.js to see how the exports are declared,
import React = require(".");
export {};
declare const UNDEFINED_VOID_ONLY: unique symbol;
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
declare module "." {
export function unstable_useCacheRefresh(): () => void;
}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_OverloadYield","value","kind","v","k"],"sources":["../../src/helpers/OverloadYield.ts"],"sourcesContent":["/* @minVersion 7.18.14 */\n\n/*\n * 'kind' is an enum:\n * 0 => This yield was an await expression\n * 1 => This yield comes from yield*\n */\n\n// _OverloadYield is actually a class\ndeclare class _OverloadYield<T = any> {\n constructor(value: T, /** 0: await 1: delegate */ kind: 0 | 1);\n\n v: T;\n /** 0: await 1: delegate */\n k: 0 | 1;\n}\n\n// The actual implementation of _OverloadYield starts here\nfunction _OverloadYield<T>(\n this: _OverloadYield<T>,\n value: T,\n /** 0: await 1: delegate */ kind: 0 | 1,\n) {\n this.v = value;\n this.k = kind;\n}\n\nexport { _OverloadYield as default };\n"],"mappings":";;;;;;AAkBA,SAASA,cAAcA,CAErBC,KAAQ,EACoBC,IAAW,EACvC;EACA,IAAI,CAACC,CAAC,GAAGF,KAAK;EACd,IAAI,CAACG,CAAC,GAAGF,IAAI;AACf","ignoreList":[]}

View File

@@ -0,0 +1,553 @@
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;
var parse$1 = function(input) {
var tokens = [];
var value = input;
var next,
quote,
prev,
token,
escape,
escapePos,
whitespacePos,
parenthesesOpenPos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) {
// Whitespaces
if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) {
after = token;
} else if (prev && prev.type === "div") {
prev.after = token;
prev.sourceEndIndex += token.length;
} else if (
code === comma ||
code === colon ||
(code === slash &&
value.charCodeAt(next + 1) !== star &&
(!parent ||
(parent && parent.type === "function" && parent.value !== "calc")))
) {
before = token;
} else {
tokens.push({
type: "space",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
// Quotes
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : '"';
token = {
type: "string",
sourceIndex: pos,
quote: quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
token.sourceEndIndex = token.unclosed ? next : next + 1;
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
// Comments
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
next = value.indexOf("*/", pos);
token = {
type: "comment",
sourceIndex: pos,
sourceEndIndex: next + 2
};
if (next === -1) {
token.unclosed = true;
next = value.length;
token.sourceEndIndex = next;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
// Operation within calc
} else if (
(code === slash || code === star) &&
parent &&
parent.type === "function" &&
parent.value === "calc"
) {
token = value[pos];
tokens.push({
type: "word",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token
});
pos += 1;
code = value.charCodeAt(pos);
// Dividers
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token,
before: before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
// Open parentheses
} else if (openParentheses === code) {
// Whitespaces after open parentheses
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
parenthesesOpenPos = pos;
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(parenthesesOpenPos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
// Whitespaces before closed
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (parenthesesOpenPos < whitespacePos) {
if (pos !== whitespacePos + 1) {
token.nodes = [
{
type: "word",
sourceIndex: pos,
sourceEndIndex: whitespacePos + 1,
value: value.slice(pos, whitespacePos + 1)
}
];
} else {
token.nodes = [];
}
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
sourceEndIndex: next,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
token.sourceEndIndex = next;
}
} else {
token.after = "";
token.nodes = [];
}
pos = next + 1;
token.sourceEndIndex = token.unclosed ? next : pos;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
token.sourceEndIndex = pos + 1;
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
// Close parentheses
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
parent.sourceEndIndex += after.length;
after = "";
balanced -= 1;
stack[stack.length - 1].sourceEndIndex = pos;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
// Words
} else {
next = pos;
do {
if (code === backslash) {
next += 1;
}
next += 1;
code = value.charCodeAt(next);
} while (
next < max &&
!(
code <= 32 ||
code === singleQuote ||
code === doubleQuote ||
code === comma ||
code === colon ||
code === slash ||
code === openParentheses ||
(code === star &&
parent &&
parent.type === "function" &&
parent.value === "calc") ||
(code === slash &&
parent.type === "function" &&
parent.value === "calc") ||
(code === closeParentheses && balanced)
)
);
token = value.slice(pos, next);
if (openParentheses === code) {
name = token;
} else if (
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
plus === token.charCodeAt(1) &&
isUnicodeRange.test(token.slice(2))
) {
tokens.push({
type: "unicode-range",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
} else {
tokens.push({
type: "word",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
}
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
stack[pos].sourceEndIndex = value.length;
}
return stack[0].nodes;
};
var walk$1 = function walk(nodes, cb, bubble) {
var i, max, node, result;
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
if (!bubble) {
result = cb(node, i, nodes);
}
if (
result !== false &&
node.type === "function" &&
Array.isArray(node.nodes)
) {
walk(node.nodes, cb, bubble);
}
if (bubble) {
cb(node, i, nodes);
}
}
};
function stringifyNode(node, custom) {
var type = node.type;
var value = node.value;
var buf;
var customResult;
if (custom && (customResult = custom(node)) !== undefined) {
return customResult;
} else if (type === "word" || type === "space") {
return value;
} else if (type === "string") {
buf = node.quote || "";
return buf + value + (node.unclosed ? "" : buf);
} else if (type === "comment") {
return "/*" + value + (node.unclosed ? "" : "*/");
} else if (type === "div") {
return (node.before || "") + value + (node.after || "");
} else if (Array.isArray(node.nodes)) {
buf = stringify$1(node.nodes, custom);
if (type !== "function") {
return buf;
}
return (
value +
"(" +
(node.before || "") +
buf +
(node.after || "") +
(node.unclosed ? "" : ")")
);
}
return value;
}
function stringify$1(nodes, custom) {
var result, i;
if (Array.isArray(nodes)) {
result = "";
for (i = nodes.length - 1; ~i; i -= 1) {
result = stringifyNode(nodes[i], custom) + result;
}
return result;
}
return stringifyNode(nodes, custom);
}
var stringify_1 = stringify$1;
var unit;
var hasRequiredUnit;
function requireUnit () {
if (hasRequiredUnit) return unit;
hasRequiredUnit = 1;
var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);
// Check if three code points would start a number
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
function likeNumber(value) {
var code = value.charCodeAt(0);
var nextCode;
if (code === plus || code === minus) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
var nextNextCode = value.charCodeAt(2);
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
return true;
}
return false;
}
if (code === dot) {
nextCode = value.charCodeAt(1);
if (nextCode >= 48 && nextCode <= 57) {
return true;
}
return false;
}
if (code >= 48 && code <= 57) {
return true;
}
return false;
}
// Consume a number
// https://www.w3.org/TR/css-syntax-3/#consume-number
unit = function(value) {
var pos = 0;
var length = value.length;
var code;
var nextCode;
var nextNextCode;
if (length === 0 || !likeNumber(value)) {
return false;
}
code = value.charCodeAt(pos);
if (code === plus || code === minus) {
pos++;
}
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
if (code === dot && nextCode >= 48 && nextCode <= 57) {
pos += 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
code = value.charCodeAt(pos);
nextCode = value.charCodeAt(pos + 1);
nextNextCode = value.charCodeAt(pos + 2);
if (
(code === exp || code === EXP) &&
((nextCode >= 48 && nextCode <= 57) ||
((nextCode === plus || nextCode === minus) &&
nextNextCode >= 48 &&
nextNextCode <= 57))
) {
pos += nextCode === plus || nextCode === minus ? 3 : 2;
while (pos < length) {
code = value.charCodeAt(pos);
if (code < 48 || code > 57) {
break;
}
pos += 1;
}
}
return {
number: value.slice(0, pos),
unit: value.slice(pos)
};
};
return unit;
}
var parse = parse$1;
var walk = walk$1;
var stringify = stringify_1;
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = requireUnit();
ValueParser.walk = walk;
ValueParser.stringify = stringify;
var lib = ValueParser;
export { lib as l };

View File

@@ -0,0 +1 @@
module.exports={C:{"4":0.03193,"52":0.00456,"78":0.00456,"112":0.00912,"113":0.01825,"115":0.18704,"119":0.00456,"120":0.00456,"121":0.00456,"125":0.00912,"127":0.01825,"128":0.02281,"129":0.00456,"130":0.00456,"131":0.00456,"132":0.00456,"133":0.01369,"134":0.03193,"135":0.39689,"136":1.7883,"137":0.00456,_:"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 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 114 116 117 118 122 123 124 126 138 139 140 3.5 3.6"},D:{"38":0.00456,"39":0.01369,"40":0.00912,"41":0.00912,"42":0.00912,"43":0.00912,"44":0.01369,"45":0.01369,"46":0.00912,"47":0.02281,"48":0.00912,"49":0.01825,"50":0.00912,"51":0.01369,"52":0.01369,"53":0.01369,"54":0.00912,"55":0.01369,"56":0.01369,"57":0.00912,"58":0.01369,"59":0.00912,"60":0.01369,"65":0.00456,"66":0.00456,"70":0.00456,"71":0.00912,"74":0.00456,"75":0.01369,"76":0.00456,"79":0.11861,"81":0.00456,"83":0.00456,"84":0.02737,"85":0.00912,"86":0.00456,"87":0.10949,"88":0.00456,"91":0.00456,"93":0.01369,"94":0.0365,"95":0.00456,"97":0.00456,"98":0.00456,"99":0.00456,"101":0.00456,"102":0.00456,"103":0.08212,"104":0.0365,"105":0.00456,"106":0.01369,"107":0.00912,"108":0.01825,"109":0.83941,"110":0.02737,"111":0.00912,"112":0.00456,"113":0.01825,"114":0.00912,"115":0.00456,"116":0.15511,"117":0.00456,"118":0.01369,"119":0.05018,"120":0.03193,"121":0.07755,"122":0.17336,"123":0.0958,"124":0.06843,"125":0.17336,"126":0.06387,"127":0.05018,"128":0.20073,"129":0.06843,"130":0.1323,"131":0.31478,"132":0.37408,"133":8.18423,"134":18.73157,"135":0.00912,"136":0.01369,_:"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 61 62 63 64 67 68 69 72 73 77 78 80 89 90 92 96 100 137 138"},F:{"87":0.00456,"88":0.00456,"89":0.00456,"95":0.03193,"109":0.00456,"114":0.00912,"116":0.56113,"117":1.45984,_:"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 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 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:{"18":0.00456,"85":0.00456,"92":0.01369,"100":0.00456,"105":0.00456,"107":0.00456,"109":0.04562,"114":0.02737,"119":0.00456,"120":0.00456,"122":0.00456,"124":0.01825,"125":0.00912,"126":0.00912,"127":0.00456,"128":0.00456,"129":0.00456,"130":0.04562,"131":0.04106,"132":0.05931,"133":1.12225,"134":2.94249,_:"12 13 14 15 16 17 79 80 81 83 84 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 106 108 110 111 112 113 115 116 117 118 121 123"},E:{"14":0.00456,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 15.4","5.1":0.00456,"13.1":0.00912,"14.1":0.01369,"15.1":0.00456,"15.5":0.00456,"15.6":0.05474,"16.0":0.00456,"16.1":0.00912,"16.2":0.00912,"16.3":0.01369,"16.4":0.00456,"16.5":0.00456,"16.6":0.05474,"17.0":0.00456,"17.1":0.02737,"17.2":0.04562,"17.3":0.00456,"17.4":0.01825,"17.5":0.05018,"17.6":0.12317,"18.0":0.02281,"18.1":0.06843,"18.2":0.03193,"18.3":0.75729,"18.4":0.01825},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00184,"5.0-5.1":0,"6.0-6.1":0.00552,"7.0-7.1":0.00368,"8.1-8.4":0,"9.0-9.2":0.00276,"9.3":0.01288,"10.0-10.2":0.00092,"10.3":0.02116,"11.0-11.2":0.09753,"11.3-11.4":0.00644,"12.0-12.1":0.00368,"12.2-12.5":0.09109,"13.0-13.1":0.00184,"13.2":0.00276,"13.3":0.00368,"13.4-13.7":0.01288,"14.0-14.4":0.0322,"14.5-14.8":0.03864,"15.0-15.1":0.02116,"15.2-15.3":0.02116,"15.4":0.02576,"15.5":0.02944,"15.6-15.8":0.36252,"16.0":0.05153,"16.1":0.10581,"16.2":0.05521,"16.3":0.09569,"16.4":0.02116,"16.5":0.03956,"16.6-16.7":0.42969,"17.0":0.02576,"17.1":0.04601,"17.2":0.03496,"17.3":0.04877,"17.4":0.09753,"17.5":0.21715,"17.6-17.7":0.63028,"18.0":0.17666,"18.1":0.57783,"18.2":0.25855,"18.3":5.4038,"18.4":0.08005},P:{"4":0.082,"21":0.01025,"22":0.0205,"23":0.01025,"24":0.0205,"25":0.0205,"26":0.1025,"27":1.03525,_:"20 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0","5.0-5.4":0.0205,"7.2-7.4":0.082,"17.0":0.01025,"19.0":0.01025},I:{"0":0.02171,"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.00002},K:{"0":0.1577,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.03193,_:"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.14683},Q:{"14.9":0.00544},O:{"0":0.02719},H:{"0":0},L:{"0":46.21415}};

View File

@@ -0,0 +1,43 @@
{
"name": "@types/babel__generator",
"version": "7.27.0",
"description": "TypeScript definitions for @babel/generator",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"githubUsername": "yortus",
"url": "https://github.com/yortus"
},
{
"name": "Melvin Groenhoff",
"githubUsername": "mgroenhoff",
"url": "https://github.com/mgroenhoff"
},
{
"name": "Cameron Yan",
"githubUsername": "khell",
"url": "https://github.com/khell"
},
{
"name": "Lyanbin",
"githubUsername": "Lyanbin",
"url": "https://github.com/Lyanbin"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__generator"
},
"scripts": {},
"dependencies": {
"@babel/types": "^7.0.0"
},
"peerDependencies": {},
"typesPublisherContentHash": "b5c7deac65dbd6ab9b313d1d71c86afe4383b881dcb4e3b3ac51dab07b8f95fb",
"typeScriptVersion": "5.1"
}

View File

@@ -0,0 +1 @@
module.exports={C:{"45":0.0021,"47":0.0021,"60":0.0021,"65":0.00419,"72":0.0021,"78":0.0021,"84":0.0021,"85":0.03562,"89":0.0021,"99":0.05028,"102":0.0021,"111":0.00629,"115":0.15922,"123":0.0021,"127":0.01257,"128":0.02933,"130":0.01048,"132":0.00419,"133":0.00838,"134":0.00838,"135":0.40434,"136":1.55659,"137":0.00419,_:"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 46 48 49 50 51 52 53 54 55 56 57 58 59 61 62 63 64 66 67 68 69 70 71 73 74 75 76 77 79 80 81 82 83 86 87 88 90 91 92 93 94 95 96 97 98 100 101 103 104 105 106 107 108 109 110 112 113 114 116 117 118 119 120 121 122 124 125 126 129 131 138 139 140 3.5 3.6"},D:{"11":0.0021,"38":0.00419,"39":0.0021,"40":0.0021,"41":0.0021,"42":0.0021,"43":0.0021,"44":0.0021,"45":0.0021,"46":0.0021,"47":0.0021,"49":0.00629,"50":0.0021,"51":0.0021,"52":0.0021,"54":0.0021,"55":0.0021,"56":0.0021,"57":0.0021,"58":0.0021,"59":0.0021,"60":0.0021,"66":0.0021,"69":0.0021,"70":0.00419,"72":0.0021,"73":0.01048,"75":0.00838,"76":0.00838,"79":0.06704,"81":0.00629,"83":0.11313,"86":0.0021,"87":0.13408,"88":0.00629,"89":0.0021,"91":0.0021,"93":0.0859,"94":0.00629,"95":0.00838,"96":0.0021,"97":0.0021,"98":0.00629,"101":0.00419,"102":0.0021,"103":0.02095,"106":0.00629,"108":0.0021,"109":0.30587,"110":0.00419,"111":0.0021,"113":0.0021,"114":0.07961,"115":0.0021,"116":0.02933,"117":0.0021,"118":0.01676,"119":0.01257,"120":0.00838,"121":0.0021,"122":0.02305,"123":0.0021,"124":0.01467,"125":0.02095,"126":0.00629,"127":0.00838,"128":0.02305,"129":0.01886,"130":0.01048,"131":0.11523,"132":0.11732,"133":2.1788,"134":4.18372,"135":0.00419,_:"4 5 6 7 8 9 10 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 48 53 61 62 63 64 65 67 68 71 74 77 78 80 84 85 90 92 99 100 104 105 107 112 136 137 138"},F:{"45":0.07752,"79":0.00629,"87":0.0021,"95":0.03771,"107":0.0021,"114":0.01048,"115":0.0021,"116":0.03143,"117":1.13759,_:"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 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 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 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:{"12":0.0021,"13":0.0021,"14":0.0021,"15":0.0021,"18":0.01048,"84":0.0021,"89":0.0021,"92":0.06285,"100":0.0021,"107":0.0021,"109":0.01467,"118":0.0021,"120":0.0021,"122":0.00629,"124":0.0021,"126":0.0021,"127":0.0021,"128":0.0021,"129":0.00629,"130":0.00629,"131":0.01676,"132":0.03981,"133":1.19415,"134":2.57266,_:"16 17 79 80 81 83 85 86 87 88 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 108 110 111 112 113 114 115 116 117 119 121 123 125"},E:{"14":0.00838,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 6.1 7.1 9.1 10.1 15.1 15.2-15.3 15.4 16.0 16.1 16.2 16.4 17.0 17.1 17.2 18.4","5.1":0.0021,"11.1":0.00419,"12.1":0.0021,"13.1":0.00629,"14.1":0.00419,"15.5":0.02305,"15.6":0.01886,"16.3":0.00838,"16.5":0.01676,"16.6":0.06704,"17.3":0.0021,"17.4":0.0021,"17.5":0.01257,"17.6":0.02514,"18.0":0.0021,"18.1":0.00419,"18.2":0.0021,"18.3":0.07961},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00123,"5.0-5.1":0,"6.0-6.1":0.0037,"7.0-7.1":0.00247,"8.1-8.4":0,"9.0-9.2":0.00185,"9.3":0.00863,"10.0-10.2":0.00062,"10.3":0.01418,"11.0-11.2":0.06536,"11.3-11.4":0.00432,"12.0-12.1":0.00247,"12.2-12.5":0.06104,"13.0-13.1":0.00123,"13.2":0.00185,"13.3":0.00247,"13.4-13.7":0.00863,"14.0-14.4":0.02158,"14.5-14.8":0.0259,"15.0-15.1":0.01418,"15.2-15.3":0.01418,"15.4":0.01726,"15.5":0.01973,"15.6-15.8":0.24294,"16.0":0.03453,"16.1":0.07091,"16.2":0.037,"16.3":0.06413,"16.4":0.01418,"16.5":0.02651,"16.6-16.7":0.28795,"17.0":0.01726,"17.1":0.03083,"17.2":0.02343,"17.3":0.03268,"17.4":0.06536,"17.5":0.14552,"17.6-17.7":0.42236,"18.0":0.11839,"18.1":0.38722,"18.2":0.17326,"18.3":3.62123,"18.4":0.05364},P:{"4":0.10501,"23":0.021,"24":0.0105,"25":0.0105,"26":0.063,"27":0.45153,_:"20 21 22 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.042},I:{"0":0.17354,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00005,"4.4":0,"4.4.3-4.4.4":0.00019},K:{"0":1.35215,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.00244,"11":0.01222,_:"6 7 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.04743},Q:{"14.9":0.01581},O:{"0":0.11858},H:{"0":0.3},L:{"0":74.8258}};

View File

@@ -0,0 +1,142 @@
/**
* @fileoverview Disallow construction of dense arrays using the Array constructor
* @author Matt DuVall <http://www.mattduvall.com/>
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const {
getVariableByName,
isClosingParenToken,
isOpeningParenToken,
isStartOfExpressionStatement,
needsPrecedingSemicolon,
} = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow `Array` constructors",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-array-constructor",
},
hasSuggestions: true,
schema: [],
messages: {
preferLiteral: "The array literal notation [] is preferable.",
useLiteral: "Replace with an array literal.",
useLiteralAfterSemicolon:
"Replace with an array literal, add preceding semicolon.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Gets the text between the calling parentheses of a CallExpression or NewExpression.
* @param {ASTNode} node A CallExpression or NewExpression node.
* @returns {string} The text between the calling parentheses, or an empty string if there are none.
*/
function getArgumentsText(node) {
const lastToken = sourceCode.getLastToken(node);
if (!isClosingParenToken(lastToken)) {
return "";
}
let firstToken = node.callee;
do {
firstToken = sourceCode.getTokenAfter(firstToken);
if (!firstToken || firstToken === lastToken) {
return "";
}
} while (!isOpeningParenToken(firstToken));
return sourceCode.text.slice(
firstToken.range[1],
lastToken.range[0],
);
}
/**
* Disallow construction of dense arrays using the Array constructor
* @param {ASTNode} node node to evaluate
* @returns {void}
* @private
*/
function check(node) {
if (
node.callee.type !== "Identifier" ||
node.callee.name !== "Array" ||
(node.arguments.length === 1 &&
node.arguments[0].type !== "SpreadElement")
) {
return;
}
const variable = getVariableByName(
sourceCode.getScope(node),
"Array",
);
/*
* Check if `Array` is a predefined global variable: predefined globals have no declarations,
* meaning that the `identifiers` list of the variable object is empty.
*/
if (variable && variable.identifiers.length === 0) {
const argsText = getArgumentsText(node);
let fixText;
let messageId;
/*
* Check if the suggested change should include a preceding semicolon or not.
* Due to JavaScript's ASI rules, a missing semicolon may be inserted automatically
* before an expression like `Array()` or `new Array()`, but not when the expression
* is changed into an array literal like `[]`.
*/
if (
isStartOfExpressionStatement(node) &&
needsPrecedingSemicolon(sourceCode, node)
) {
fixText = `;[${argsText}]`;
messageId = "useLiteralAfterSemicolon";
} else {
fixText = `[${argsText}]`;
messageId = "useLiteral";
}
context.report({
node,
messageId: "preferLiteral",
suggest: [
{
messageId,
fix: fixer => fixer.replaceText(node, fixText),
},
],
});
}
}
return {
CallExpression: check,
NewExpression: check,
};
},
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["_index","require","buildUndefinedNode","unaryExpression","numericLiteral"],"sources":["../../src/builders/productions.ts"],"sourcesContent":["import { numericLiteral, unaryExpression } from \"./generated/index.ts\";\n\nexport function buildUndefinedNode() {\n return unaryExpression(\"void\", numericLiteral(0), true);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,OAAO,IAAAC,sBAAe,EAAC,MAAM,EAAE,IAAAC,qBAAc,EAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACzD","ignoreList":[]}

View File

@@ -0,0 +1,38 @@
# Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
* (a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
* (b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
* (c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
* (d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
## Moderation Policy
The [Node.js Moderation Policy] applies to this WG.
## Code of Conduct
The [Node.js Code of Conduct][] applies to this WG.
[Node.js Code of Conduct]:
https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
[Node.js Moderation Policy]:
https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md

View File

@@ -0,0 +1,35 @@
import crypto from 'crypto'
import { urlAlphabet } from '../url-alphabet/index.js'
let random = bytes =>
new Promise((resolve, reject) => {
crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => {
if (err) {
reject(err)
} else {
resolve(buf)
}
})
})
let customAlphabet = (alphabet, defaultSize = 21) => {
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
let tick = (id, size = defaultSize) =>
random(step).then(bytes => {
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length >= size) return id
}
return tick(id, size)
})
return size => tick('', size)
}
let nanoid = (size = 21) =>
random((size |= 0)).then(bytes => {
let id = ''
while (size--) {
id += urlAlphabet[bytes[size] & 63]
}
return id
})
export { nanoid, customAlphabet, random }

View File

@@ -0,0 +1,150 @@
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var isExtglob = require('is-extglob');
var chars = { '{': '}', '(': ')', '[': ']'};
var strictCheck = function(str) {
if (str[0] === '!') {
return true;
}
var index = 0;
var pipeIndex = -2;
var closeSquareIndex = -2;
var closeCurlyIndex = -2;
var closeParenIndex = -2;
var backSlashIndex = -2;
while (index < str.length) {
if (str[index] === '*') {
return true;
}
if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
return true;
}
if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
if (closeSquareIndex < index) {
closeSquareIndex = str.indexOf(']', index);
}
if (closeSquareIndex > index) {
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
return true;
}
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
return true;
}
}
}
if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
closeCurlyIndex = str.indexOf('}', index);
if (closeCurlyIndex > index) {
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
return true;
}
}
}
if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
closeParenIndex = str.indexOf(')', index);
if (closeParenIndex > index) {
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
return true;
}
}
}
if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
if (pipeIndex < index) {
pipeIndex = str.indexOf('|', index);
}
if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
closeParenIndex = str.indexOf(')', pipeIndex);
if (closeParenIndex > pipeIndex) {
backSlashIndex = str.indexOf('\\', pipeIndex);
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
return true;
}
}
}
}
if (str[index] === '\\') {
var open = str[index + 1];
index += 2;
var close = chars[open];
if (close) {
var n = str.indexOf(close, index);
if (n !== -1) {
index = n + 1;
}
}
if (str[index] === '!') {
return true;
}
} else {
index++;
}
}
return false;
};
var relaxedCheck = function(str) {
if (str[0] === '!') {
return true;
}
var index = 0;
while (index < str.length) {
if (/[*?{}()[\]]/.test(str[index])) {
return true;
}
if (str[index] === '\\') {
var open = str[index + 1];
index += 2;
var close = chars[open];
if (close) {
var n = str.indexOf(close, index);
if (n !== -1) {
index = n + 1;
}
}
if (str[index] === '!') {
return true;
}
} else {
index++;
}
}
return false;
};
module.exports = function isGlob(str, options) {
if (typeof str !== 'string' || str === '') {
return false;
}
if (isExtglob(str)) {
return true;
}
var check = strictCheck;
// optionally relax check
if (options && options.strict === false) {
check = relaxedCheck;
}
return check(str);
};

View File

@@ -0,0 +1,24 @@
// Copyright 2017 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0
'use strict';
const isLinux = () => process.platform === 'linux';
let report = null;
const getReport = () => {
if (!report) {
/* istanbul ignore next */
if (isLinux() && process.report) {
const orig = process.report.excludeNetwork;
process.report.excludeNetwork = true;
report = process.report.getReport();
process.report.excludeNetwork = orig;
} else {
report = {};
}
}
return report;
};
module.exports = { isLinux, getReport };

View File

@@ -0,0 +1,26 @@
{
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
'cflags': [ '-fno-exceptions' ],
'cflags_cc': [ '-fno-exceptions' ],
'conditions': [
["OS=='win'", {
# _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
#"defines": [
# "_HAS_EXCEPTIONS=0"
#],
"msvs_settings": {
"VCCLCompilerTool": {
'ExceptionHandling': 0,
'EnablePREfast': 'true',
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
},
}],
],
}

View File

@@ -0,0 +1,5 @@
## Security contact information
To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.

View File

@@ -0,0 +1 @@
module.exports={C:{"49":0.00297,"52":0.00595,"65":0.00297,"72":0.00297,"88":0.02676,"99":0.00297,"101":0.00297,"102":0.00595,"105":0.00595,"106":0.00892,"107":0.00595,"108":0.00892,"109":0.00595,"110":0.00595,"111":0.00595,"113":0.00297,"115":0.43703,"116":0.00297,"122":0.00297,"123":0.00892,"125":0.00297,"127":0.00892,"128":0.03568,"130":0.00297,"131":0.00297,"132":0.00297,"133":0.00892,"134":0.01784,"135":0.4073,"136":1.5311,"137":0.05649,"138":0.00297,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 53 54 55 56 57 58 59 60 61 62 63 64 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 100 103 104 112 114 117 118 119 120 121 124 126 129 139 140 3.5 3.6"},D:{"38":0.00297,"41":0.00297,"47":0.00297,"48":0.00297,"49":0.00297,"55":0.00297,"56":0.00595,"57":0.00297,"58":0.00297,"66":0.00297,"69":0.00595,"70":0.00297,"71":0.00297,"72":0.00297,"73":0.01487,"74":0.00297,"75":0.01189,"76":0.00297,"77":0.00297,"78":0.00595,"79":0.00892,"81":0.00595,"83":0.00892,"85":0.00595,"86":0.01189,"87":0.01189,"89":0.00297,"90":0.00297,"91":0.00297,"92":0.00297,"93":0.00892,"94":0.01189,"95":0.00595,"96":0.00297,"97":0.00595,"98":0.00297,"99":0.00297,"100":0.00595,"101":0.00595,"102":0.00595,"103":0.03865,"104":0.27054,"105":0.02378,"106":0.08324,"107":0.10703,"108":0.1427,"109":1.05244,"110":0.06243,"111":0.07135,"112":0.08324,"113":0.00297,"114":0.01189,"115":0.00297,"116":0.01487,"117":0.00297,"118":0.02378,"119":0.01784,"120":0.02676,"121":0.01189,"122":0.05351,"123":0.02081,"124":0.06243,"125":0.07135,"126":0.03568,"127":0.02676,"128":0.05351,"129":0.0773,"130":0.05054,"131":0.1546,"132":0.15162,"133":5.8033,"134":11.17253,"135":0.0446,"136":0.02081,_:"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 39 40 42 43 44 45 46 50 51 52 53 54 59 60 61 62 63 64 65 67 68 80 84 88 137 138"},F:{"46":0.00297,"86":0.00297,"87":0.04757,"88":0.01784,"91":0.00297,"92":0.00297,"93":0.00297,"94":0.00595,"95":0.01784,"96":0.00297,"97":0.00297,"116":0.06838,"117":0.41919,_:"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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 89 90 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.00297,"18":0.00297,"92":0.01189,"102":0.00297,"105":0.00297,"106":0.00595,"107":0.01784,"108":0.01784,"109":0.01487,"110":0.01189,"111":0.00595,"114":0.07135,"121":0.00297,"122":0.00297,"125":0.00297,"126":0.00297,"127":0.00297,"128":0.00297,"129":0.00297,"130":0.00297,"131":0.06838,"132":0.01784,"133":0.32703,"134":0.8146,_:"12 13 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 103 104 112 113 115 116 117 118 119 120 123 124"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 15.5 16.2 16.4","13.1":0.00297,"14.1":0.00297,"15.1":0.00595,"15.4":0.00297,"15.6":0.01784,"16.0":0.00595,"16.1":0.00297,"16.3":0.00297,"16.5":0.00595,"16.6":0.01784,"17.0":0.00297,"17.1":0.00595,"17.2":0.00297,"17.3":0.00595,"17.4":0.03568,"17.5":0.00892,"17.6":0.01784,"18.0":0.00892,"18.1":0.01189,"18.2":0.00892,"18.3":0.15757,"18.4":0.00297},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00045,"5.0-5.1":0,"6.0-6.1":0.00136,"7.0-7.1":0.00091,"8.1-8.4":0,"9.0-9.2":0.00068,"9.3":0.00318,"10.0-10.2":0.00023,"10.3":0.00522,"11.0-11.2":0.02406,"11.3-11.4":0.00159,"12.0-12.1":0.00091,"12.2-12.5":0.02247,"13.0-13.1":0.00045,"13.2":0.00068,"13.3":0.00091,"13.4-13.7":0.00318,"14.0-14.4":0.00795,"14.5-14.8":0.00953,"15.0-15.1":0.00522,"15.2-15.3":0.00522,"15.4":0.00636,"15.5":0.00726,"15.6-15.8":0.08944,"16.0":0.01271,"16.1":0.02611,"16.2":0.01362,"16.3":0.02361,"16.4":0.00522,"16.5":0.00976,"16.6-16.7":0.10601,"17.0":0.00636,"17.1":0.01135,"17.2":0.00863,"17.3":0.01203,"17.4":0.02406,"17.5":0.05357,"17.6-17.7":0.1555,"18.0":0.04358,"18.1":0.14256,"18.2":0.06379,"18.3":1.3332,"18.4":0.01975},P:{"4":0.11262,"21":0.01024,"22":0.01024,"23":0.02048,"24":0.01024,"25":0.02048,"26":0.04095,"27":0.44025,_:"20 5.0-5.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 16.0 18.0","6.2-6.4":0.03071,"7.2-7.4":0.09214,"11.1-11.2":0.01024,"17.0":0.02048,"19.0":0.01024},I:{"0":0.07715,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00009},K:{"0":1.5113,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.00329,"11":0.08887,_:"6 7 9 10 5.5"},S:{"2.5":0.01406,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.11948},Q:{"14.9":0.00703},O:{"0":1.60941},H:{"0":0.07},L:{"0":67.66909}};

View File

@@ -0,0 +1,234 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ArgumentPlaceholder = ArgumentPlaceholder;
exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
exports.BigIntLiteral = BigIntLiteral;
exports.BooleanLiteral = BooleanLiteral;
exports.Identifier = Identifier;
exports.NullLiteral = NullLiteral;
exports.NumericLiteral = NumericLiteral;
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
exports.ObjectMethod = ObjectMethod;
exports.ObjectProperty = ObjectProperty;
exports.PipelineBareFunction = PipelineBareFunction;
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
exports.PipelineTopicExpression = PipelineTopicExpression;
exports.RecordExpression = RecordExpression;
exports.RegExpLiteral = RegExpLiteral;
exports.SpreadElement = exports.RestElement = RestElement;
exports.StringLiteral = StringLiteral;
exports.TopicReference = TopicReference;
exports.TupleExpression = TupleExpression;
exports._getRawIdentifier = _getRawIdentifier;
var _t = require("@babel/types");
var _jsesc = require("jsesc");
const {
isAssignmentPattern,
isIdentifier
} = _t;
let lastRawIdentNode = null;
let lastRawIdentResult = "";
function _getRawIdentifier(node) {
if (node === lastRawIdentNode) return lastRawIdentResult;
lastRawIdentNode = node;
const {
name
} = node;
const token = this.tokenMap.find(node, tok => tok.value === name);
if (token) {
lastRawIdentResult = this._originalCode.slice(token.start, token.end);
return lastRawIdentResult;
}
return lastRawIdentResult = node.name;
}
function Identifier(node) {
var _node$loc;
this.sourceIdentifierName(((_node$loc = node.loc) == null ? void 0 : _node$loc.identifierName) || node.name);
this.word(this.tokenMap ? this._getRawIdentifier(node) : node.name);
}
function ArgumentPlaceholder() {
this.tokenChar(63);
}
function RestElement(node) {
this.token("...");
this.print(node.argument);
}
function ObjectExpression(node) {
const props = node.properties;
this.tokenChar(123);
if (props.length) {
const exit = this.enterDelimited();
this.space();
this.printList(props, this.shouldPrintTrailingComma("}"), true, true);
this.space();
exit();
}
this.sourceWithOffset("end", node.loc, -1);
this.tokenChar(125);
}
function ObjectMethod(node) {
this.printJoin(node.decorators);
this._methodHead(node);
this.space();
this.print(node.body);
}
function ObjectProperty(node) {
this.printJoin(node.decorators);
if (node.computed) {
this.tokenChar(91);
this.print(node.key);
this.tokenChar(93);
} else {
if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
this.print(node.value);
return;
}
this.print(node.key);
if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
return;
}
}
this.tokenChar(58);
this.space();
this.print(node.value);
}
function ArrayExpression(node) {
const elems = node.elements;
const len = elems.length;
this.tokenChar(91);
const exit = this.enterDelimited();
for (let i = 0; i < elems.length; i++) {
const elem = elems[i];
if (elem) {
if (i > 0) this.space();
this.print(elem);
if (i < len - 1 || this.shouldPrintTrailingComma("]")) {
this.token(",", false, i);
}
} else {
this.token(",", false, i);
}
}
exit();
this.tokenChar(93);
}
function RecordExpression(node) {
const props = node.properties;
let startToken;
let endToken;
{
if (this.format.recordAndTupleSyntaxType === "bar") {
startToken = "{|";
endToken = "|}";
} else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) {
throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
} else {
startToken = "#{";
endToken = "}";
}
}
this.token(startToken);
if (props.length) {
this.space();
this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);
this.space();
}
this.token(endToken);
}
function TupleExpression(node) {
const elems = node.elements;
const len = elems.length;
let startToken;
let endToken;
{
if (this.format.recordAndTupleSyntaxType === "bar") {
startToken = "[|";
endToken = "|]";
} else if (this.format.recordAndTupleSyntaxType === "hash") {
startToken = "#[";
endToken = "]";
} else {
throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
}
}
this.token(startToken);
for (let i = 0; i < elems.length; i++) {
const elem = elems[i];
if (elem) {
if (i > 0) this.space();
this.print(elem);
if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {
this.token(",", false, i);
}
}
}
this.token(endToken);
}
function RegExpLiteral(node) {
this.word(`/${node.pattern}/${node.flags}`);
}
function BooleanLiteral(node) {
this.word(node.value ? "true" : "false");
}
function NullLiteral() {
this.word("null");
}
function NumericLiteral(node) {
const raw = this.getPossibleRaw(node);
const opts = this.format.jsescOption;
const value = node.value;
const str = value + "";
if (opts.numbers) {
this.number(_jsesc(value, opts), value);
} else if (raw == null) {
this.number(str, value);
} else if (this.format.minified) {
this.number(raw.length < str.length ? raw : str, value);
} else {
this.number(raw, value);
}
}
function StringLiteral(node) {
const raw = this.getPossibleRaw(node);
if (!this.format.minified && raw !== undefined) {
this.token(raw);
return;
}
const val = _jsesc(node.value, this.format.jsescOption);
this.token(val);
}
function BigIntLiteral(node) {
const raw = this.getPossibleRaw(node);
if (!this.format.minified && raw !== undefined) {
this.word(raw);
return;
}
this.word(node.value + "n");
}
const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]);
function TopicReference() {
const {
topicToken
} = this.format;
if (validTopicTokenSet.has(topicToken)) {
this.token(topicToken);
} else {
const givenTopicTokenJSON = JSON.stringify(topicToken);
const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v));
throw new Error(`The "topicToken" generator option must be one of ` + `${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`);
}
}
function PipelineTopicExpression(node) {
this.print(node.expression);
}
function PipelineBareFunction(node) {
this.print(node.callee);
}
function PipelinePrimaryTopicReference() {
this.tokenChar(35);
}
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1,104 @@
export interface NavigateOptions {
ignoreBlocker?: boolean;
}
type SubscriberHistoryAction = {
type: Exclude<HistoryAction, 'GO'>;
} | {
type: 'GO';
index: number;
};
type SubscriberArgs = {
location: HistoryLocation;
action: SubscriberHistoryAction;
};
export interface RouterHistory {
location: HistoryLocation;
length: number;
subscribers: Set<(opts: SubscriberArgs) => void>;
subscribe: (cb: (opts: SubscriberArgs) => void) => () => void;
push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void;
replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void;
go: (index: number, navigateOpts?: NavigateOptions) => void;
back: (navigateOpts?: NavigateOptions) => void;
forward: (navigateOpts?: NavigateOptions) => void;
canGoBack: () => boolean;
createHref: (href: string) => string;
block: (blocker: NavigationBlocker) => () => void;
flush: () => void;
destroy: () => void;
notify: (action: SubscriberHistoryAction) => void;
_ignoreSubscribers?: boolean;
}
export interface HistoryLocation extends ParsedPath {
state: ParsedHistoryState;
}
export interface ParsedPath {
href: string;
pathname: string;
search: string;
hash: string;
}
export interface HistoryState {
}
export type ParsedHistoryState = HistoryState & {
key?: string;
__TSR_index: number;
};
type ShouldAllowNavigation = any;
export type HistoryAction = 'PUSH' | 'REPLACE' | 'FORWARD' | 'BACK' | 'GO';
export type BlockerFnArgs = {
currentLocation: HistoryLocation;
nextLocation: HistoryLocation;
action: HistoryAction;
};
export type BlockerFn = (args: BlockerFnArgs) => Promise<ShouldAllowNavigation> | ShouldAllowNavigation;
export type NavigationBlocker = {
blockerFn: BlockerFn;
enableBeforeUnload?: (() => boolean) | boolean;
};
export declare function createHistory(opts: {
getLocation: () => HistoryLocation;
getLength: () => number;
pushState: (path: string, state: any) => void;
replaceState: (path: string, state: any) => void;
go: (n: number) => void;
back: (ignoreBlocker: boolean) => void;
forward: (ignoreBlocker: boolean) => void;
createHref: (path: string) => string;
flush?: () => void;
destroy?: () => void;
onBlocked?: () => void;
getBlockers?: () => Array<NavigationBlocker>;
setBlockers?: (blockers: Array<NavigationBlocker>) => void;
notifyOnIndexChange?: boolean;
}): RouterHistory;
/**
* Creates a history object that can be used to interact with the browser's
* navigation. This is a lightweight API wrapping the browser's native methods.
* It is designed to work with TanStack Router, but could be used as a standalone API as well.
* IMPORTANT: This API implements history throttling via a microtask to prevent
* excessive calls to the history API. In some browsers, calling history.pushState or
* history.replaceState in quick succession can cause the browser to ignore subsequent
* calls. This API smooths out those differences and ensures that your application
* state will *eventually* match the browser state. In most cases, this is not a problem,
* but if you need to ensure that the browser state is up to date, you can use the
* `history.flush` method to immediately flush all pending state changes to the browser URL.
* @param opts
* @param opts.getHref A function that returns the current href (path + search + hash)
* @param opts.createHref A function that takes a path and returns a href (path + search + hash)
* @returns A history instance
*/
export declare function createBrowserHistory(opts?: {
parseLocation?: () => HistoryLocation;
createHref?: (path: string) => string;
window?: any;
}): RouterHistory;
export declare function createHashHistory(opts?: {
window?: any;
}): RouterHistory;
export declare function createMemoryHistory(opts?: {
initialEntries: Array<string>;
initialIndex?: number;
}): RouterHistory;
export declare function parseHref(href: string, state: ParsedHistoryState | undefined): HistoryLocation;
export {};

View File

@@ -0,0 +1,29 @@
import { _ as _default } from './colors-b_6i0Oi7.js';
type NamedUtilityValue = {
kind: 'named';
/**
* ```
* bg-red-500
* ^^^^^^^
*
* w-1/2
* ^
* ```
*/
value: string;
/**
* ```
* w-1/2
* ^^^
* ```
*/
fraction: string | null;
};
type PluginUtils = {
theme: (keypath: string, defaultValue?: any) => any;
colors: typeof _default;
};
export type { NamedUtilityValue as N, PluginUtils as P };

View File

@@ -0,0 +1,75 @@
{
"name": "@ampproject/remapping",
"version": "2.3.0",
"description": "Remap sequential sourcemaps through transformations to point at the original source code",
"keywords": [
"source",
"map",
"remap"
],
"main": "dist/remapping.umd.js",
"module": "dist/remapping.mjs",
"types": "dist/types/remapping.d.ts",
"exports": {
".": [
{
"types": "./dist/types/remapping.d.ts",
"browser": "./dist/remapping.umd.js",
"require": "./dist/remapping.umd.js",
"import": "./dist/remapping.mjs"
},
"./dist/remapping.umd.js"
],
"./package.json": "./package.json"
},
"files": [
"dist"
],
"author": "Justin Ridgewell <jridgewell@google.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/ampproject/remapping.git"
},
"license": "Apache-2.0",
"engines": {
"node": ">=6.0.0"
},
"scripts": {
"build": "run-s -n build:*",
"build:rollup": "rollup -c rollup.config.js",
"build:ts": "tsc --project tsconfig.build.json",
"lint": "run-s -n lint:*",
"lint:prettier": "npm run test:lint:prettier -- --write",
"lint:ts": "npm run test:lint:ts -- --fix",
"prebuild": "rm -rf dist",
"prepublishOnly": "npm run preversion",
"preversion": "run-s test build",
"test": "run-s -n test:lint test:only",
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
"test:lint": "run-s -n test:lint:*",
"test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
"test:lint:ts": "eslint '{src,test}/**/*.ts'",
"test:only": "jest --coverage",
"test:watch": "jest --coverage --watch"
},
"devDependencies": {
"@rollup/plugin-typescript": "8.3.2",
"@types/jest": "27.4.1",
"@typescript-eslint/eslint-plugin": "5.20.0",
"@typescript-eslint/parser": "5.20.0",
"eslint": "8.14.0",
"eslint-config-prettier": "8.5.0",
"jest": "27.5.1",
"jest-config": "27.5.1",
"npm-run-all": "4.1.5",
"prettier": "2.6.2",
"rollup": "2.70.2",
"ts-jest": "27.1.4",
"tslib": "2.4.0",
"typescript": "4.6.3"
},
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.24"
}
}

View File

@@ -0,0 +1,10 @@
import { useRouterState } from "./useRouterState.js";
function useLocation(opts) {
return useRouterState({
select: (state) => (opts == null ? void 0 : opts.select) ? opts.select(state.location) : state.location
});
}
export {
useLocation
};
//# sourceMappingURL=useLocation.js.map

View File

@@ -0,0 +1,37 @@
#pragma once
#include <string>
#include <napi.h>
class CanvasError {
public:
std::string message;
std::string syscall;
std::string path;
int cerrno = 0;
void set(const char* iMessage = NULL, const char* iSyscall = NULL, int iErrno = 0, const char* iPath = NULL) {
if (iMessage) message.assign(iMessage);
if (iSyscall) syscall.assign(iSyscall);
cerrno = iErrno;
if (iPath) path.assign(iPath);
}
void reset() {
message.clear();
syscall.clear();
path.clear();
cerrno = 0;
}
bool empty() {
return cerrno == 0 && message.empty();
}
Napi::Error toError(Napi::Env env) {
if (cerrno) {
Napi::Error err = Napi::Error::New(env, strerror(cerrno));
if (!syscall.empty()) err.Value().Set("syscall", syscall);
if (!path.empty()) err.Value().Set("path", path);
return err;
} else {
return Napi::Error::New(env, message);
}
}
};