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,84 @@
{
"name": "@eslint/eslintrc",
"version": "3.3.1",
"description": "The legacy ESLintRC config file format for ESLint",
"type": "module",
"main": "./dist/eslintrc.cjs",
"types": "./dist/eslintrc.d.cts",
"exports": {
".": {
"import": "./lib/index.js",
"require": "./dist/eslintrc.cjs",
"types": "./lib/types/index.d.ts"
},
"./package.json": "./package.json",
"./universal": {
"import": "./lib/index-universal.js",
"require": "./dist/eslintrc-universal.cjs"
}
},
"files": [
"lib",
"conf",
"LICENSE",
"dist",
"universal.js"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "rollup -c && node -e \"fs.copyFileSync('./lib/types/index.d.ts', './dist/eslintrc.d.cts')\"",
"lint": "eslint . --report-unused-disable-directives",
"lint:fix": "npm run lint -- --fix",
"prepare": "npm run build",
"release:generate:latest": "eslint-generate-release",
"release:generate:alpha": "eslint-generate-prerelease alpha",
"release:generate:beta": "eslint-generate-prerelease beta",
"release:generate:rc": "eslint-generate-prerelease rc",
"release:publish": "eslint-publish-release",
"test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'",
"test:types": "tsc -p tests/lib/types/tsconfig.json"
},
"repository": "eslint/eslintrc",
"funding": "https://opencollective.com/eslint",
"keywords": [
"ESLint",
"ESLintRC",
"Configuration"
],
"author": "Nicholas C. Zakas",
"license": "MIT",
"bugs": {
"url": "https://github.com/eslint/eslintrc/issues"
},
"homepage": "https://github.com/eslint/eslintrc#readme",
"devDependencies": {
"c8": "^7.7.3",
"chai": "^4.3.4",
"eslint": "^9.20.1",
"eslint-config-eslint": "^11.0.0",
"eslint-release": "^3.2.0",
"fs-teardown": "^0.1.3",
"mocha": "^9.0.3",
"rollup": "^2.70.1",
"shelljs": "^0.8.5",
"sinon": "^11.1.2",
"temp-dir": "^2.0.0",
"typescript": "^5.7.3"
},
"dependencies": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
"espree": "^10.0.1",
"globals": "^14.0.0",
"ignore": "^5.2.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"minimatch": "^3.1.2",
"strip-json-comments": "^3.1.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function redirect(opts) {
opts.isRedirect = true;
opts.statusCode = opts.statusCode || opts.code || 307;
opts.headers = opts.headers || {};
if (!opts.reloadDocument) {
opts.reloadDocument = false;
try {
new URL(`${opts.href}`);
opts.reloadDocument = true;
} catch {
}
}
if (opts.throw) {
throw opts;
}
return opts;
}
function isRedirect(obj) {
return !!(obj == null ? void 0 : obj.isRedirect);
}
function isResolvedRedirect(obj) {
return !!(obj == null ? void 0 : obj.isRedirect) && obj.href;
}
exports.isRedirect = isRedirect;
exports.isResolvedRedirect = isResolvedRedirect;
exports.redirect = redirect;
//# sourceMappingURL=redirect.cjs.map

View File

@@ -0,0 +1,315 @@
/**
* @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before
* @author Benoît Zugmeyer
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "10.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin-js",
url: "https://eslint.style/packages/js",
},
rule: {
name: "operator-linebreak",
url: "https://eslint.style/rules/js/operator-linebreak",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent linebreak style for operators",
recommended: false,
url: "https://eslint.org/docs/latest/rules/operator-linebreak",
},
schema: [
{
enum: ["after", "before", "none", null],
},
{
type: "object",
properties: {
overrides: {
type: "object",
additionalProperties: {
enum: ["after", "before", "none", "ignore"],
},
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
operatorAtBeginning:
"'{{operator}}' should be placed at the beginning of the line.",
operatorAtEnd:
"'{{operator}}' should be placed at the end of the line.",
badLinebreak: "Bad line breaking before and after '{{operator}}'.",
noLinebreak:
"There should be no line break before or after '{{operator}}'.",
},
},
create(context) {
const usedDefaultGlobal = !context.options[0];
const globalStyle = context.options[0] || "after";
const options = context.options[1] || {};
const styleOverrides = options.overrides
? Object.assign({}, options.overrides)
: {};
if (usedDefaultGlobal && !styleOverrides["?"]) {
styleOverrides["?"] = "before";
}
if (usedDefaultGlobal && !styleOverrides[":"]) {
styleOverrides[":"] = "before";
}
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Gets a fixer function to fix rule issues
* @param {Token} operatorToken The operator token of an expression
* @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none'
* @returns {Function} A fixer function
*/
function getFixer(operatorToken, desiredStyle) {
return fixer => {
const tokenBefore = sourceCode.getTokenBefore(operatorToken);
const tokenAfter = sourceCode.getTokenAfter(operatorToken);
const textBefore = sourceCode.text.slice(
tokenBefore.range[1],
operatorToken.range[0],
);
const textAfter = sourceCode.text.slice(
operatorToken.range[1],
tokenAfter.range[0],
);
const hasLinebreakBefore = !astUtils.isTokenOnSameLine(
tokenBefore,
operatorToken,
);
const hasLinebreakAfter = !astUtils.isTokenOnSameLine(
operatorToken,
tokenAfter,
);
let newTextBefore, newTextAfter;
if (
hasLinebreakBefore !== hasLinebreakAfter &&
desiredStyle !== "none"
) {
// If there is a comment before and after the operator, don't do a fix.
if (
sourceCode.getTokenBefore(operatorToken, {
includeComments: true,
}) !== tokenBefore &&
sourceCode.getTokenAfter(operatorToken, {
includeComments: true,
}) !== tokenAfter
) {
return null;
}
/*
* If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator.
* foo &&
* bar
* would get fixed to
* foo
* && bar
*/
newTextBefore = textAfter;
newTextAfter = textBefore;
} else {
const LINEBREAK_REGEX =
astUtils.createGlobalLinebreakMatcher();
// Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings.
newTextBefore =
desiredStyle === "before" || textBefore.trim()
? textBefore
: textBefore.replace(LINEBREAK_REGEX, "");
newTextAfter =
desiredStyle === "after" || textAfter.trim()
? textAfter
: textAfter.replace(LINEBREAK_REGEX, "");
// If there was no change (due to interfering comments), don't output a fix.
if (
newTextBefore === textBefore &&
newTextAfter === textAfter
) {
return null;
}
}
if (
newTextAfter === "" &&
tokenAfter.type === "Punctuator" &&
"+-".includes(operatorToken.value) &&
tokenAfter.value === operatorToken.value
) {
// To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-.
newTextAfter += " ";
}
return fixer.replaceTextRange(
[tokenBefore.range[1], tokenAfter.range[0]],
newTextBefore + operatorToken.value + newTextAfter,
);
};
}
/**
* Checks the operator placement
* @param {ASTNode} node The node to check
* @param {ASTNode} rightSide The node that comes after the operator in `node`
* @param {string} operator The operator
* @private
* @returns {void}
*/
function validateNode(node, rightSide, operator) {
/*
* Find the operator token by searching from the right side, because between the left side and the operator
* there could be additional tokens from type annotations. Search specifically for the token which
* value equals the operator, in order to skip possible opening parentheses before the right side node.
*/
const operatorToken = sourceCode.getTokenBefore(
rightSide,
token => token.value === operator,
);
const leftToken = sourceCode.getTokenBefore(operatorToken);
const rightToken = sourceCode.getTokenAfter(operatorToken);
const operatorStyleOverride = styleOverrides[operator];
const style = operatorStyleOverride || globalStyle;
const fix = getFixer(operatorToken, style);
// if single line
if (
astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
// do nothing.
} else if (
operatorStyleOverride !== "ignore" &&
!astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
!astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
// lone operator
context.report({
node,
loc: operatorToken.loc,
messageId: "badLinebreak",
data: {
operator,
},
fix,
});
} else if (
style === "before" &&
astUtils.isTokenOnSameLine(leftToken, operatorToken)
) {
context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtBeginning",
data: {
operator,
},
fix,
});
} else if (
style === "after" &&
astUtils.isTokenOnSameLine(operatorToken, rightToken)
) {
context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtEnd",
data: {
operator,
},
fix,
});
} else if (style === "none") {
context.report({
node,
loc: operatorToken.loc,
messageId: "noLinebreak",
data: {
operator,
},
fix,
});
}
}
/**
* Validates a binary expression using `validateNode`
* @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
* @returns {void}
*/
function validateBinaryExpression(node) {
validateNode(node, node.right, node.operator);
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
BinaryExpression: validateBinaryExpression,
LogicalExpression: validateBinaryExpression,
AssignmentExpression: validateBinaryExpression,
VariableDeclarator(node) {
if (node.init) {
validateNode(node, node.init, "=");
}
},
PropertyDefinition(node) {
if (node.value) {
validateNode(node, node.value, "=");
}
},
ConditionalExpression(node) {
validateNode(node, node.consequent, "?");
validateNode(node, node.alternate, ":");
},
};
},
};

View File

@@ -0,0 +1,41 @@
import { useRouterState } from './useRouterState'
import type {
StructuralSharingOption,
ValidateSelected,
} from './structuralSharing'
import type {
AnyRouter,
RegisteredRouter,
RouterState,
} from '@tanstack/router-core'
export interface UseLocationBaseOptions<
TRouter extends AnyRouter,
TSelected,
TStructuralSharing extends boolean = boolean,
> {
select?: (
state: RouterState<TRouter['routeTree']>['location'],
) => ValidateSelected<TRouter, TSelected, TStructuralSharing>
}
export type UseLocationResult<
TRouter extends AnyRouter,
TSelected,
> = unknown extends TSelected
? RouterState<TRouter['routeTree']>['location']
: TSelected
export function useLocation<
TRouter extends AnyRouter = RegisteredRouter,
TSelected = unknown,
TStructuralSharing extends boolean = boolean,
>(
opts?: UseLocationBaseOptions<TRouter, TSelected, TStructuralSharing> &
StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,
): UseLocationResult<TRouter, TSelected> {
return useRouterState({
select: (state: any) =>
opts?.select ? opts.select(state.location) : state.location,
} as any) as UseLocationResult<TRouter, TSelected>
}

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const routerCore = require("@tanstack/router-core");
const useRouter = require("./useRouter.cjs");
function useScrollRestoration() {
const router = useRouter.useRouter();
routerCore.setupScrollRestoration(router, true);
}
function ScrollRestoration(_props) {
useScrollRestoration();
if (process.env.NODE_ENV === "development") {
console.warn(
"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead."
);
}
return null;
}
function useElementScrollRestoration(options) {
var _a;
useScrollRestoration();
const router = useRouter.useRouter();
const getKey = options.getKey || routerCore.defaultGetScrollRestorationKey;
let elementSelector = "";
if (options.id) {
elementSelector = `[data-scroll-restoration-id="${options.id}"]`;
} else {
const element = (_a = options.getElement) == null ? void 0 : _a.call(options);
if (!element) {
return;
}
elementSelector = element instanceof Window ? "window" : routerCore.getCssSelector(element);
}
const restoreKey = getKey(router.latestLocation);
const byKey = routerCore.scrollRestorationCache.state[restoreKey];
return byKey == null ? void 0 : byKey[elementSelector];
}
exports.ScrollRestoration = ScrollRestoration;
exports.useElementScrollRestoration = useElementScrollRestoration;
//# sourceMappingURL=ScrollRestoration.cjs.map

View File

@@ -0,0 +1,54 @@
# 1.0.0 - 2016-01-07
- Removed: unused speed test
- Added: Automatic routing between previously unsupported conversions
([#27](https://github.com/Qix-/color-convert/pull/27))
- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
([#27](https://github.com/Qix-/color-convert/pull/27))
- Removed: `convert()` class
([#27](https://github.com/Qix-/color-convert/pull/27))
- Changed: all functions to lookup dictionary
([#27](https://github.com/Qix-/color-convert/pull/27))
- Changed: `ansi` to `ansi256`
([#27](https://github.com/Qix-/color-convert/pull/27))
- Fixed: argument grouping for functions requiring only one argument
([#27](https://github.com/Qix-/color-convert/pull/27))
# 0.6.0 - 2015-07-23
- Added: methods to handle
[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
- rgb2ansi16
- rgb2ansi
- hsl2ansi16
- hsl2ansi
- hsv2ansi16
- hsv2ansi
- hwb2ansi16
- hwb2ansi
- cmyk2ansi16
- cmyk2ansi
- keyword2ansi16
- keyword2ansi
- ansi162rgb
- ansi162hsl
- ansi162hsv
- ansi162hwb
- ansi162cmyk
- ansi162keyword
- ansi2rgb
- ansi2hsl
- ansi2hsv
- ansi2hwb
- ansi2cmyk
- ansi2keyword
([#18](https://github.com/harthur/color-convert/pull/18))
# 0.5.3 - 2015-06-02
- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
([#15](https://github.com/harthur/color-convert/issues/15))
---
Check out commit logs for older releases

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _arrayWithHoles;
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
//# sourceMappingURL=arrayWithHoles.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"47":0.00266,"50":0.00266,"52":0.00266,"55":0.00266,"65":0.00266,"66":0.00266,"68":0.00532,"72":0.00532,"88":0.00266,"91":0.00532,"93":0.00532,"98":0.00266,"102":0.00266,"110":0.00266,"111":0.00266,"112":0.00266,"115":0.25526,"126":0.00266,"127":0.01595,"128":0.02393,"129":0.00266,"130":0.00266,"132":0.00798,"133":0.01064,"134":0.01861,"135":0.34833,"136":0.98383,"137":0.0452,_:"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 51 53 54 56 57 58 59 60 61 62 63 64 67 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 90 92 94 95 96 97 99 100 101 103 104 105 106 107 108 109 113 114 116 117 118 119 120 121 122 123 124 125 131 138 139 140 3.5 3.6"},D:{"11":0.00266,"19":0.00532,"31":0.00266,"39":0.00266,"48":0.00266,"49":0.00266,"50":0.00266,"51":0.00266,"52":0.00266,"53":0.00266,"54":0.00266,"55":0.00266,"57":0.00266,"58":0.00532,"59":0.00266,"64":0.01064,"65":0.00266,"67":0.00266,"68":0.00798,"70":0.00798,"71":0.00266,"72":0.0133,"73":0.00266,"75":0.00532,"76":0.00532,"77":0.00266,"78":0.00266,"79":0.01064,"80":0.00266,"81":0.00266,"83":0.01861,"86":0.00266,"87":0.02127,"88":0.01595,"89":0.00532,"91":0.00532,"92":0.00266,"93":0.0133,"94":0.02393,"95":0.00532,"97":0.00532,"98":0.00798,"99":0.00532,"100":0.01064,"101":0.00266,"102":0.00266,"103":0.0452,"104":0.01595,"105":0.00798,"106":0.0133,"107":0.00532,"108":0.00532,"109":0.72325,"110":0.00532,"111":0.05318,"112":0.00532,"113":0.00532,"114":0.08509,"116":0.08775,"117":0.00266,"118":0.02127,"119":0.03457,"120":0.01595,"121":0.01861,"122":0.04254,"123":0.0133,"124":0.02393,"125":0.02127,"126":0.03191,"127":0.03191,"128":0.06648,"129":0.01861,"130":0.04786,"131":0.22867,"132":0.20474,"133":3.93798,"134":7.13144,"135":0.01064,"136":0.00266,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 20 21 22 23 24 25 26 27 28 29 30 32 33 34 35 36 37 38 40 41 42 43 44 45 46 47 56 60 61 62 63 66 69 74 84 85 90 96 115 137 138"},F:{"37":0.00266,"73":0.00266,"79":0.00532,"83":0.02127,"86":0.00266,"87":0.02393,"88":0.00532,"95":0.05052,"102":0.00266,"107":0.00266,"114":0.00532,"115":0.00266,"116":0.02925,"117":0.55839,_:"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 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 74 75 76 77 78 80 81 82 84 85 89 90 91 92 93 94 96 97 98 99 100 101 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.01064,"13":0.00266,"14":0.0133,"15":0.00266,"16":0.02127,"17":0.00266,"18":0.07711,"84":0.00798,"89":0.01064,"90":0.01595,"92":0.05318,"94":0.00266,"100":0.00798,"108":0.00266,"109":0.0133,"111":0.00532,"112":0.00798,"114":0.00798,"116":0.00266,"117":0.00266,"120":0.00532,"121":0.00266,"122":0.00798,"123":0.00266,"124":0.00532,"125":0.00266,"126":0.00532,"127":0.00532,"128":0.00532,"129":0.0133,"130":0.02393,"131":0.05318,"132":0.05318,"133":0.67007,"134":1.59274,_:"79 80 81 83 85 86 87 88 91 93 95 96 97 98 99 101 102 103 104 105 106 107 110 113 115 118 119"},E:{"12":0.01595,"13":0.00532,_:"0 4 5 6 7 8 9 10 11 14 15 3.1 3.2 6.1 7.1 9.1 10.1 15.2-15.3 15.4 16.0 16.2 16.5","5.1":0.00266,"11.1":0.00532,"12.1":0.00266,"13.1":0.01595,"14.1":0.00798,"15.1":0.00266,"15.5":0.00266,"15.6":0.0585,"16.1":0.00266,"16.3":0.00266,"16.4":0.00532,"16.6":0.01861,"17.0":0.00266,"17.1":0.00798,"17.2":0.00532,"17.3":0.00532,"17.4":0.00266,"17.5":0.01064,"17.6":0.05318,"18.0":0.00532,"18.1":0.00798,"18.2":0.0133,"18.3":0.1489,"18.4":0.00266},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00071,"5.0-5.1":0,"6.0-6.1":0.00213,"7.0-7.1":0.00142,"8.1-8.4":0,"9.0-9.2":0.00107,"9.3":0.00497,"10.0-10.2":0.00036,"10.3":0.00817,"11.0-11.2":0.03766,"11.3-11.4":0.00249,"12.0-12.1":0.00142,"12.2-12.5":0.03518,"13.0-13.1":0.00071,"13.2":0.00107,"13.3":0.00142,"13.4-13.7":0.00497,"14.0-14.4":0.01244,"14.5-14.8":0.01492,"15.0-15.1":0.00817,"15.2-15.3":0.00817,"15.4":0.00995,"15.5":0.01137,"15.6-15.8":0.13999,"16.0":0.0199,"16.1":0.04086,"16.2":0.02132,"16.3":0.03695,"16.4":0.00817,"16.5":0.01528,"16.6-16.7":0.16593,"17.0":0.00995,"17.1":0.01777,"17.2":0.0135,"17.3":0.01883,"17.4":0.03766,"17.5":0.08385,"17.6-17.7":0.24338,"18.0":0.06822,"18.1":0.22313,"18.2":0.09984,"18.3":2.0867,"18.4":0.03091},P:{"4":0.0307,"20":0.01023,"21":0.02047,"22":0.04094,"23":0.02047,"24":0.40937,"25":0.10234,"26":0.11258,"27":0.7164,"5.0-5.4":0.01023,_:"6.2-6.4 8.2 10.1 12.0 13.0 15.0 18.0","7.2-7.4":0.08187,"9.2":0.06141,"11.1-11.2":0.0307,"14.0":0.02047,"16.0":0.02047,"17.0":0.01023,"19.0":0.04094},I:{"0":0.0586,"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.00006},K:{"0":4.29186,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.03723,_:"6 7 8 9 10 5.5"},S:{"2.5":0.10277,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.11012},Q:{_:"14.9"},O:{"0":0.23491},H:{"0":4.51},L:{"0":65.84401}};

View File

@@ -0,0 +1,7 @@
import { StructuralSharingOption, ValidateSelected } from './structuralSharing.js';
import { AnyRouter, RegisteredRouter, RouterState } from '@tanstack/router-core';
export interface UseLocationBaseOptions<TRouter extends AnyRouter, TSelected, TStructuralSharing extends boolean = boolean> {
select?: (state: RouterState<TRouter['routeTree']>['location']) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
}
export type UseLocationResult<TRouter extends AnyRouter, TSelected> = unknown extends TSelected ? RouterState<TRouter['routeTree']>['location'] : TSelected;
export declare function useLocation<TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseLocationBaseOptions<TRouter, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>): UseLocationResult<TRouter, TSelected>;

View File

@@ -0,0 +1,2 @@
export { shallow } from 'zustand/vanilla/shallow';
export { useShallow } from 'zustand/react/shallow';

View File

@@ -0,0 +1,75 @@
{
"name": "espree",
"description": "An Esprima-compatible JavaScript parser built on Acorn",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
"homepage": "https://github.com/eslint/js/blob/main/packages/espree/README.md",
"main": "dist/espree.cjs",
"type": "module",
"exports": {
".": [
{
"import": "./espree.js",
"require": "./dist/espree.cjs",
"default": "./dist/espree.cjs"
},
"./dist/espree.cjs"
],
"./package.json": "./package.json"
},
"version": "10.3.0",
"files": [
"lib",
"dist/espree.cjs",
"espree.js"
],
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"repository": "eslint/js",
"bugs": {
"url": "https://github.com/eslint/js/issues"
},
"funding": "https://opencollective.com/eslint",
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^8.14.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^4.2.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"c8": "^7.11.0",
"eslint-release": "^3.2.0",
"esprima-fb": "^8001.2001.0-dev-harmony-fb",
"mocha": "^9.2.2",
"npm-run-all2": "^6.2.2",
"rollup": "^2.79.1",
"shelljs": "^0.8.5"
},
"keywords": [
"ast",
"ecmascript",
"javascript",
"parser",
"syntax",
"acorn"
],
"scripts": {
"build": "rollup -c rollup.config.js",
"build:debug": "npm run build -- -m",
"build:docs": "node tools/sync-docs.js",
"build:update-version": "node tools/update-version.js",
"prepublishOnly": "npm run build:update-version && npm run build",
"pretest": "npm run build",
"release:generate:latest": "eslint-generate-release",
"release:generate:alpha": "eslint-generate-prerelease alpha",
"release:generate:beta": "eslint-generate-prerelease beta",
"release:generate:rc": "eslint-generate-prerelease rc",
"release:publish": "eslint-publish-release",
"test": "npm-run-all -s test:*",
"test:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs",
"test:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'"
}
}

View File

@@ -0,0 +1 @@
module.exports={C:{"38":0.00208,"43":0.00208,"46":0.00208,"52":0.00624,"70":0.00208,"72":0.00208,"95":0.00624,"110":0.0104,"115":0.06029,"120":0.01455,"127":0.00832,"128":0.00416,"133":0.00208,"134":0.00416,"135":0.05613,"136":0.29938,_:"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 39 40 41 42 44 45 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 113 114 116 117 118 119 121 122 123 124 125 126 129 130 131 132 137 138 139 140 3.5 3.6"},D:{"39":0.00208,"40":0.00416,"41":0.01455,"42":0.00208,"43":0.00208,"44":0.00208,"45":0.00208,"46":0.00208,"47":0.00208,"48":0.00208,"49":0.00416,"50":0.00208,"51":0.00208,"52":0.00208,"53":0.00208,"54":0.00208,"55":0.00208,"56":0.00208,"57":0.00832,"58":0.08732,"59":0.00208,"60":0.00208,"61":0.00416,"64":0.00208,"67":0.00416,"68":0.00208,"69":0.00208,"70":0.02495,"71":0.00416,"72":0.00416,"73":0.00208,"74":0.00416,"75":0.00208,"78":0.00624,"79":0.0395,"83":0.00208,"86":0.00208,"87":0.01455,"88":0.00416,"89":0.00624,"92":0.00416,"93":0.00416,"94":0.00624,"95":0.00208,"96":0.00208,"98":0.00208,"99":0.00208,"103":0.00208,"104":0.00208,"105":0.00208,"106":0.02079,"107":0.00416,"108":0.00832,"109":0.31393,"110":0.00208,"111":0.01247,"113":0.00208,"114":0.01455,"115":0.00208,"116":0.00416,"117":0.00208,"118":0.00416,"119":0.02703,"120":0.02495,"121":0.00208,"122":0.00832,"123":0.01871,"124":0.01247,"125":0.00624,"126":0.0104,"127":0.00624,"128":0.00416,"129":0.00832,"130":0.05821,"131":0.09979,"132":0.19335,"133":0.921,"134":1.7526,"135":0.00208,"136":0.00624,_:"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 62 63 65 66 76 77 80 81 84 85 90 91 97 100 101 102 112 137 138"},F:{"46":0.00208,"73":0.00208,"79":0.00208,"83":0.00416,"84":0.14761,"85":0.00416,"86":0.00832,"87":0.15177,"88":0.0894,"116":0.00208,"117":0.06445,_:"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 74 75 76 77 78 80 81 82 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"13":0.00208,"16":0.00208,"18":0.00624,"84":0.00208,"89":0.00624,"92":0.02079,"100":0.00208,"109":0.00624,"114":0.00208,"120":0.00208,"122":0.00208,"124":0.00624,"125":0.00208,"128":0.00208,"130":0.00208,"131":0.00832,"132":0.11019,"133":0.14969,"134":0.39293,_:"12 14 15 17 79 80 81 83 85 86 87 88 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 121 123 126 127 129"},E:{"14":0.00208,_:"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 13.1 14.1 15.1 15.2-15.3 15.4 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.4 17.5 18.2 18.4","5.1":0.02287,"15.5":0.00832,"15.6":0.01455,"16.6":0.00208,"17.6":0.00624,"18.0":0.00208,"18.1":0.00208,"18.3":0.02495},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00046,"5.0-5.1":0,"6.0-6.1":0.00137,"7.0-7.1":0.00091,"8.1-8.4":0,"9.0-9.2":0.00068,"9.3":0.00319,"10.0-10.2":0.00023,"10.3":0.00525,"11.0-11.2":0.02418,"11.3-11.4":0.0016,"12.0-12.1":0.00091,"12.2-12.5":0.02258,"13.0-13.1":0.00046,"13.2":0.00068,"13.3":0.00091,"13.4-13.7":0.00319,"14.0-14.4":0.00798,"14.5-14.8":0.00958,"15.0-15.1":0.00525,"15.2-15.3":0.00525,"15.4":0.00639,"15.5":0.0073,"15.6-15.8":0.08987,"16.0":0.01277,"16.1":0.02623,"16.2":0.01369,"16.3":0.02372,"16.4":0.00525,"16.5":0.00981,"16.6-16.7":0.10652,"17.0":0.00639,"17.1":0.0114,"17.2":0.00867,"17.3":0.01209,"17.4":0.02418,"17.5":0.05383,"17.6-17.7":0.15625,"18.0":0.04379,"18.1":0.14324,"18.2":0.06409,"18.3":1.33961,"18.4":0.01984},P:{"4":0.13075,"20":0.01006,"21":0.02012,"22":0.02012,"23":0.05029,"24":0.03017,"25":0.06035,"26":0.14081,"27":1.24715,"5.0-5.4":0.01006,"6.2-6.4":0.02012,"7.2-7.4":0.06035,_:"8.2 10.1","9.2":0.03017,"11.1-11.2":0.04023,"12.0":0.02012,"13.0":0.03017,"14.0":0.08046,"15.0":0.02012,"16.0":0.11063,"17.0":0.03017,"18.0":0.01006,"19.0":0.03017},I:{"0":0.13436,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00004,"4.4":0,"4.4.3-4.4.4":0.00015},K:{"0":3.76672,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00624,_:"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.13464},Q:{_:"14.9"},O:{"0":6.08256},H:{"0":2.3},L:{"0":76.96498}};

View File

@@ -0,0 +1,126 @@
import Container, {
ContainerProps,
ContainerWithChildren
} from './container.js'
declare namespace Rule {
export interface RuleRaws extends Record<string, unknown> {
/**
* The space symbols after the last child of the node to the end of the node.
*/
after?: string
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string
/**
* The symbols between the selector and `{` for rules.
*/
between?: string
/**
* Contains the text of the semicolon after this rule.
*/
ownSemicolon?: string
/**
* The rules selector with comments.
*/
selector?: {
raw: string
value: string
}
/**
* Contains `true` if the last child has an (optional) semicolon.
*/
semicolon?: boolean
}
export type RuleProps = {
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
raws?: RuleRaws
} & (
| {
/** Selector or selectors of the rule. */
selector: string
selectors?: never
}
| {
selector?: never
/** Selectors of the rule represented as an array of strings. */
selectors: readonly string[]
}
) & ContainerProps
// eslint-disable-next-line @typescript-eslint/no-use-before-define
export { Rule_ as default }
}
/**
* Represents a CSS rule: a selector followed by a declaration block.
*
* ```js
* Once (root, { Rule }) {
* let a = new Rule({ selector: 'a' })
* a.append(…)
* root.append(a)
* }
* ```
*
* ```js
* const root = postcss.parse('a{}')
* const rule = root.first
* rule.type //=> 'rule'
* rule.toString() //=> 'a{}'
* ```
*/
declare class Rule_ extends Container {
nodes: NonNullable<Container['nodes']>
parent: ContainerWithChildren | undefined
raws: Rule.RuleRaws
type: 'rule'
/**
* The rules full selector represented as a string.
*
* ```js
* const root = postcss.parse('a, b { }')
* const rule = root.first
* rule.selector //=> 'a, b'
* ```
*/
get selector(): string
set selector(value: string)
/**
* An array containing the rules individual selectors.
* Groups of selectors are split at commas.
*
* ```js
* const root = postcss.parse('a, b { }')
* const rule = root.first
*
* rule.selector //=> 'a, b'
* rule.selectors //=> ['a', 'b']
*
* rule.selectors = ['a', 'strong']
* rule.selector //=> 'a, strong'
* ```
*/
get selectors(): string[]
set selectors(values: string[])
constructor(defaults?: Rule.RuleProps)
assign(overrides: object | Rule.RuleProps): this
clone(overrides?: Partial<Rule.RuleProps>): this
cloneAfter(overrides?: Partial<Rule.RuleProps>): this
cloneBefore(overrides?: Partial<Rule.RuleProps>): this
}
declare class Rule extends Rule_ {}
export = Rule

View File

@@ -0,0 +1,90 @@
/**
* @fileoverview Enforce a maximum number of classes per file
* @author James Garbutt <https://github.com/43081j>
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Enforce a maximum number of classes per file",
recommended: false,
url: "https://eslint.org/docs/latest/rules/max-classes-per-file",
},
schema: [
{
oneOf: [
{
type: "integer",
minimum: 1,
},
{
type: "object",
properties: {
ignoreExpressions: {
type: "boolean",
},
max: {
type: "integer",
minimum: 1,
},
},
additionalProperties: false,
},
],
},
],
messages: {
maximumExceeded:
"File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}.",
},
},
create(context) {
const [option = {}] = context.options;
const [ignoreExpressions, max] =
typeof option === "number"
? [false, option || 1]
: [option.ignoreExpressions, option.max || 1];
let classCount = 0;
return {
Program() {
classCount = 0;
},
"Program:exit"(node) {
if (classCount > max) {
context.report({
node,
messageId: "maximumExceeded",
data: {
classCount,
max,
},
});
}
},
ClassDeclaration() {
classCount++;
},
ClassExpression() {
if (!ignoreExpressions) {
classCount++;
}
},
};
},
};

View File

@@ -0,0 +1,46 @@
/**
* Basic text editor in order to create a FreeTex annotation.
*/
export class StampEditor extends AnnotationEditor {
static _type: string;
static _editorType: number;
/** @inheritdoc */
static initialize(l10n: any, uiManager: any): void;
static get supportedTypes(): any;
static get supportedTypesStr(): any;
/** @inheritdoc */
static isHandlingMimeForPasting(mime: any): any;
/** @inheritdoc */
static paste(item: any, parent: any): void;
static computeTelemetryFinalData(data: any): {
hasAltText: any;
hasNoAltText: any;
};
/** @inheritdoc */
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
constructor(params: any);
/** @inheritdoc */
get telemetryFinalData(): {
type: string;
hasAltText: boolean;
};
mlGuessAltText(imageData?: null, updateAltTextData?: boolean): Promise<any>;
copyCanvas(maxDataDimension: any, maxPreviewDimension: any, createImageData?: boolean): {
canvas: HTMLCanvasElement | null;
width: any;
height: any;
imageData: {
width: any;
height: any;
data: Uint8ClampedArray;
} | null;
};
/** @inheritdoc */
getImageForAltText(): null;
/** @inheritdoc */
serialize(isForCopying?: boolean, context?: null): Object | null;
/** @inheritdoc */
renderAnnotationElement(annotation: any): null;
#private;
}
import { AnnotationEditor } from "./editor.js";

View File

@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _isValidIdentifier = require("../validators/isValidIdentifier.js");
var _index = require("../builders/generated/index.js");
var _default = exports.default = valueToNode;
const objectToString = Function.call.bind(Object.prototype.toString);
function isRegExp(value) {
return objectToString(value) === "[object RegExp]";
}
function isPlainObject(value) {
if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
return false;
}
const proto = Object.getPrototypeOf(value);
return proto === null || Object.getPrototypeOf(proto) === null;
}
function valueToNode(value) {
if (value === undefined) {
return (0, _index.identifier)("undefined");
}
if (value === true || value === false) {
return (0, _index.booleanLiteral)(value);
}
if (value === null) {
return (0, _index.nullLiteral)();
}
if (typeof value === "string") {
return (0, _index.stringLiteral)(value);
}
if (typeof value === "number") {
let result;
if (Number.isFinite(value)) {
result = (0, _index.numericLiteral)(Math.abs(value));
} else {
let numerator;
if (Number.isNaN(value)) {
numerator = (0, _index.numericLiteral)(0);
} else {
numerator = (0, _index.numericLiteral)(1);
}
result = (0, _index.binaryExpression)("/", numerator, (0, _index.numericLiteral)(0));
}
if (value < 0 || Object.is(value, -0)) {
result = (0, _index.unaryExpression)("-", result);
}
return result;
}
if (typeof value === "bigint") {
return (0, _index.bigIntLiteral)(value.toString());
}
if (isRegExp(value)) {
const pattern = value.source;
const flags = /\/([a-z]*)$/.exec(value.toString())[1];
return (0, _index.regExpLiteral)(pattern, flags);
}
if (Array.isArray(value)) {
return (0, _index.arrayExpression)(value.map(valueToNode));
}
if (isPlainObject(value)) {
const props = [];
for (const key of Object.keys(value)) {
let nodeKey,
computed = false;
if ((0, _isValidIdentifier.default)(key)) {
if (key === "__proto__") {
computed = true;
nodeKey = (0, _index.stringLiteral)(key);
} else {
nodeKey = (0, _index.identifier)(key);
}
} else {
nodeKey = (0, _index.stringLiteral)(key);
}
props.push((0, _index.objectProperty)(nodeKey, valueToNode(value[key]), computed));
}
return (0, _index.objectExpression)(props);
}
throw new Error("don't know how to turn this value into a node");
}
//# sourceMappingURL=valueToNode.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"48":0.00471,"52":0.0377,"78":0.00471,"103":0.00471,"104":0.00471,"115":0.32513,"123":0.00471,"125":0.00942,"127":0.01414,"128":0.05654,"130":0.00471,"131":0.00471,"132":0.00942,"133":0.00942,"134":0.01885,"135":0.36754,"136":1.49842,"137":0.01414,_:"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 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 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 124 126 129 138 139 140 3.5 3.6"},D:{"41":0.00471,"49":0.02356,"52":0.00471,"58":0.00942,"61":0.00471,"70":0.00942,"71":0.00471,"76":0.01885,"77":0.06126,"79":0.01414,"87":0.01414,"88":0.00942,"90":0.00471,"91":0.00471,"92":0.00471,"94":0.00942,"99":0.00471,"100":0.06126,"102":0.00942,"103":0.00942,"104":0.06597,"106":0.00471,"107":0.00471,"108":0.01885,"109":0.96125,"110":0.00942,"111":0.00471,"112":0.01414,"113":0.01414,"114":0.02827,"116":0.02827,"117":0.00471,"118":0.01414,"119":0.01414,"120":0.33926,"121":0.01885,"122":0.04712,"123":0.01414,"124":0.07068,"125":0.02827,"126":0.04241,"127":0.03298,"128":0.05654,"129":0.05654,"130":0.06126,"131":0.30157,"132":0.26858,"133":11.05435,"134":23.76733,"135":0.00942,"136":0.00471,_:"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 47 48 50 51 53 54 55 56 57 59 60 62 63 64 65 66 67 68 69 72 73 74 75 78 80 81 83 84 85 86 89 93 95 96 97 98 101 105 115 137 138"},F:{"46":0.00471,"85":0.00471,"87":0.01414,"88":0.00471,"95":0.0377,"114":0.00471,"115":0.00471,"116":0.36754,"117":1.40418,_:"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 86 89 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:{"18":0.00471,"92":0.00471,"105":0.00471,"109":0.02356,"114":0.00471,"119":0.00471,"122":0.00471,"126":0.00471,"127":0.00471,"128":0.00471,"129":0.00471,"130":0.0801,"131":0.04712,"132":0.05654,"133":0.67853,"134":1.65862,_:"12 13 14 15 16 17 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 120 121 123 124 125"},E:{"14":0.00471,_:"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.1 15.2-15.3 15.4","13.1":0.00471,"14.1":0.00942,"15.5":0.00471,"15.6":0.0377,"16.0":0.00471,"16.1":0.00471,"16.2":0.00471,"16.3":0.00942,"16.4":0.00942,"16.5":0.00471,"16.6":0.0377,"17.0":0.00471,"17.1":0.02827,"17.2":0.00942,"17.3":0.00942,"17.4":0.02356,"17.5":0.02827,"17.6":0.07068,"18.0":0.01414,"18.1":0.04241,"18.2":0.02356,"18.3":0.43822,"18.4":0.00942},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00238,"5.0-5.1":0,"6.0-6.1":0.00715,"7.0-7.1":0.00476,"8.1-8.4":0,"9.0-9.2":0.00357,"9.3":0.01667,"10.0-10.2":0.00119,"10.3":0.02739,"11.0-11.2":0.12623,"11.3-11.4":0.00834,"12.0-12.1":0.00476,"12.2-12.5":0.11789,"13.0-13.1":0.00238,"13.2":0.00357,"13.3":0.00476,"13.4-13.7":0.01667,"14.0-14.4":0.04168,"14.5-14.8":0.05002,"15.0-15.1":0.02739,"15.2-15.3":0.02739,"15.4":0.03334,"15.5":0.03811,"15.6-15.8":0.4692,"16.0":0.06669,"16.1":0.13695,"16.2":0.07145,"16.3":0.12385,"16.4":0.02739,"16.5":0.05121,"16.6-16.7":0.55613,"17.0":0.03334,"17.1":0.05954,"17.2":0.04525,"17.3":0.06312,"17.4":0.12623,"17.5":0.28104,"17.6-17.7":0.81574,"18.0":0.22864,"18.1":0.74786,"18.2":0.33463,"18.3":6.99391,"18.4":0.1036},P:{"4":0.02057,"20":0.01028,"21":0.01028,"22":0.03085,"23":0.04113,"24":0.07198,"25":0.04113,"26":0.08227,"27":2.78674,_:"5.0-5.4 8.2 9.2 10.1 11.1-11.2 13.0 14.0 15.0 16.0 17.0 18.0","6.2-6.4":0.01028,"7.2-7.4":0.01028,"12.0":0.02057,"19.0":0.01028},I:{"0":0.03166,"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.00003},K:{"0":0.30142,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.01885,_:"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.30142},Q:{_:"14.9"},O:{"0":0.05288},H:{"0":0},L:{"0":37.58902}};

View File

@@ -0,0 +1,59 @@
export interface URIComponents {
scheme?: string;
userinfo?: string;
host?: string;
port?: number | string;
path?: string;
query?: string;
fragment?: string;
reference?: string;
error?: string;
}
export interface URIOptions {
scheme?: string;
reference?: string;
tolerant?: boolean;
absolutePath?: boolean;
iri?: boolean;
unicodeSupport?: boolean;
domainHost?: boolean;
}
export interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {
scheme: string;
parse(components: ParentComponents, options: Options): Components;
serialize(components: Components, options: Options): ParentComponents;
unicodeSupport?: boolean;
domainHost?: boolean;
absolutePath?: boolean;
}
export interface URIRegExps {
NOT_SCHEME: RegExp;
NOT_USERINFO: RegExp;
NOT_HOST: RegExp;
NOT_PATH: RegExp;
NOT_PATH_NOSCHEME: RegExp;
NOT_QUERY: RegExp;
NOT_FRAGMENT: RegExp;
ESCAPE: RegExp;
UNRESERVED: RegExp;
OTHER_CHARS: RegExp;
PCT_ENCODED: RegExp;
IPV4ADDRESS: RegExp;
IPV6ADDRESS: RegExp;
}
export declare const SCHEMES: {
[scheme: string]: URISchemeHandler;
};
export declare function pctEncChar(chr: string): string;
export declare function pctDecChars(str: string): string;
export declare function parse(uriString: string, options?: URIOptions): URIComponents;
export declare function removeDotSegments(input: string): string;
export declare function serialize(components: URIComponents, options?: URIOptions): string;
export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents;
export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string;
export declare function normalize(uri: string, options?: URIOptions): string;
export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents;
export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean;
export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean;
export declare function escapeComponent(str: string, options?: URIOptions): string;
export declare function unescapeComponent(str: string, options?: URIOptions): string;

View File

@@ -0,0 +1,72 @@
// This file replaces `index.js` in bundlers like webpack or Rollup,
// according to `browser` config in `package.json`.
let { urlAlphabet } = require('./url-alphabet/index.cjs')
let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
let customRandom = (alphabet, defaultSize, getRandom) => {
// First, a bitmask is necessary to generate the ID. The bitmask makes bytes
// values closer to the alphabet size. The bitmask calculates the closest
// `2^31 - 1` number, which exceeds the alphabet size.
// For example, the bitmask for the alphabet size 30 is 31 (00011111).
// `Math.clz32` is not used, because it is not available in browsers.
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
// Though, the bitmask solution is not perfect since the bytes exceeding
// the alphabet size are refused. Therefore, to reliably generate the ID,
// the random bytes redundancy has to be satisfied.
// Note: every hardware random generator call is performance expensive,
// because the system call for entropy collection takes a lot of time.
// So, to avoid additional system calls, extra bytes are requested in advance.
// Next, a step determines how many random bytes to generate.
// The number of random bytes gets decided upon the ID size, mask,
// alphabet size, and magic number 1.6 (using 1.6 peaks at performance
// according to benchmarks).
// `-~f => Math.ceil(f)` if f is a float
// `-~i => i + 1` if i is an integer
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
return (size = defaultSize) => {
let id = ''
while (true) {
let bytes = getRandom(step)
// A compact alternative for `for (var i = 0; i < step; i++)`.
let j = step | 0
while (j--) {
// Adding `|| ''` refuses a random byte that exceeds the alphabet size.
id += alphabet[bytes[j] & mask] || ''
if (id.length === size) return id
}
}
}
}
let customAlphabet = (alphabet, size = 21) =>
customRandom(alphabet, size, random)
let nanoid = (size = 21) =>
crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
// It is incorrect to use bytes exceeding the alphabet size.
// The following mask reduces the random byte in the 0-255 value
// range to the 0-63 value range. Therefore, adding hacks, such
// as empty string fallback or magic numbers, is unneccessary because
// the bitmask trims bytes down to the alphabet size.
byte &= 63
if (byte < 36) {
// `0-9a-z`
id += byte.toString(36)
} else if (byte < 62) {
// `A-Z`
id += (byte - 26).toString(36).toUpperCase()
} else if (byte > 62) {
id += '-'
} else {
id += '_'
}
return id
}, '')
module.exports = { nanoid, customAlphabet, customRandom, urlAlphabet, random }

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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 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"},C:{"1":"0 3 4 5 6 7 8 9 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","2":"1 2 nC LC J PB K D E F A B C L M G N O P QB qC rC"},D:{"1":"0 9 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","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"},E:{"1":"F A B C L M G 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","2":"J PB K D E sC SC tC uC vC"},F:{"1":"0 1 2 3 4 5 6 7 8 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 GC","2":"F B C 4C 5C 6C 7C FC kC 8C"},G:{"1":"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","2":"E SC 9C lC AD BD CD DD"},H:{"1":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},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 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:4,C:"CSS Feature Queries",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"useLocation.cjs","sources":["../../src/useLocation.tsx"],"sourcesContent":["import { useRouterState } from './useRouterState'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\n\nexport interface UseLocationBaseOptions<\n TRouter extends AnyRouter,\n TSelected,\n TStructuralSharing extends boolean = boolean,\n> {\n select?: (\n state: RouterState<TRouter['routeTree']>['location'],\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n}\n\nexport type UseLocationResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected\n ? RouterState<TRouter['routeTree']>['location']\n : TSelected\n\nexport function useLocation<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseLocationBaseOptions<TRouter, TSelected, TStructuralSharing> &\n StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,\n): UseLocationResult<TRouter, TSelected> {\n return useRouterState({\n select: (state: any) =>\n opts?.select ? opts.select(state.location) : state.location,\n } as any) as UseLocationResult<TRouter, TSelected>\n}\n"],"names":["useRouterState"],"mappings":";;;AA4BO,SAAS,YAKd,MAEuC;AACvC,SAAOA,8BAAe;AAAA,IACpB,QAAQ,CAAC,WACP,6BAAM,UAAS,KAAK,OAAO,MAAM,QAAQ,IAAI,MAAM;AAAA,EAAA,CAC/C;AACV;;"}