update
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
export { TSR_DEFERRED_PROMISE, defer } from './defer.cjs';
|
||||
export type { DeferredPromiseState, DeferredPromise } from './defer.cjs';
|
||||
export { preloadWarning } from './link.cjs';
|
||||
export type { IsRequiredParams, ParsePathParams, AddTrailingSlash, RemoveTrailingSlashes, AddLeadingSlash, RemoveLeadingSlashes, ActiveOptions, LinkOptionsProps, ResolveCurrentPath, ResolveParentPath, ResolveRelativePath, LinkCurrentTargetElement, FindDescendantToPaths, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, FromPathOption, MakeOptionalSearchParams, MaskOptions, ToSubOptionsProps, RequiredToOptions, } from './link.cjs';
|
||||
export type { RouteToPath, TrailingSlashOptionByRouter, ParseRoute, CodeRouteToPath, RouteIds, FullSearchSchema, FullSearchSchemaInput, AllParams, RouteById, AllContext, RoutePaths, RoutesById, RoutesByPath, AllLoaderData, RouteByPath, } from './routeInfo.cjs';
|
||||
export type { InferFileRouteTypes, FileRouteTypes, FileRoutesByPath, LazyRoute, LazyRouteOptions, } from './fileRoute.cjs';
|
||||
export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, SerializerExtensions, } from './serializer.cjs';
|
||||
export type { ParsedLocation } from './location.cjs';
|
||||
export type { Manifest, RouterManagedTag } from './manifest.cjs';
|
||||
export { isMatch } from './Matches.cjs';
|
||||
export type { AnyMatchAndValue, FindValueByIndex, FindValueByKey, CreateMatchAndValue, NextMatchAndValue, IsMatchKeyOf, IsMatchPath, IsMatchResult, IsMatchParse, IsMatch, RouteMatch, RouteMatchExtensions, MakeRouteMatchUnion, MakeRouteMatch, AnyRouteMatch, MakeRouteMatchFromRoute, MatchRouteOptions, } from './Matches.cjs';
|
||||
export { joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, removeTrailingSlash, exactPathTest, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, } from './path.cjs';
|
||||
export type { Segment } from './path.cjs';
|
||||
export { encode, decode } from './qss.cjs';
|
||||
export { rootRouteId } from './root.cjs';
|
||||
export type { RootRouteId } from './root.cjs';
|
||||
export { BaseRoute, BaseRouteApi, BaseRootRoute } from './route.cjs';
|
||||
export type { AnyPathParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, SearchFilter, SearchMiddlewareContext, SearchMiddleware, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, InferAllParams, InferAllContext, MetaDescriptor, RouteLinkEntry, SearchValidator, AnySearchValidator, DefaultSearchValidator, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, ParseSplatParams, SplatParams, ResolveParams, ParseParamsFn, StringifyParamsFn, ParamsOptions, UpdatableStaticRouteOption, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveRouteContext, ResolveLoaderData, RoutePrefix, TrimPath, TrimPathLeft, TrimPathRight, ResolveSearchSchemaFnInput, ResolveSearchSchemaInput, ResolveSearchSchemaFn, ResolveSearchSchema, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllContext, BeforeLoadContextParameter, RouteContextParameter, ResolveAllParamsFromParent, AnyRoute, Route, RouteTypes, FullSearchSchemaOption, RemountDepsOptions, MakeRemountDepsOptionsUnion, ResolveFullPath, AnyRouteWithContext, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, RouteContextFn, BeforeLoadFn, ContextOptions, RouteContextOptions, BeforeLoadContextOptions, RootRouteOptions, UpdatableRouteOptionsExtensions, RouteConstraints, RouteTypesById, RouteMask, RouteExtensions, RouteLazyFn, RouteAddChildrenFn, RouteAddFileChildrenFn, RouteAddFileTypesFn, } from './route.cjs';
|
||||
export { defaultSerializeError, getLocationChangeInfo, RouterCore, componentTypes, lazyFn, SearchParamError, PathParamError, getInitialRouterState, } from './router.cjs';
|
||||
export type { ViewTransitionOptions, ExtractedBaseEntry, ExtractedStream, ExtractedPromise, ExtractedEntry, StreamState, TrailingSlashOption, Register, AnyRouter, AnyRouterWithContext, RegisteredRouter, RouterState, BuildNextOptions, RouterListener, RouterEvent, ListenerFn, RouterEvents, MatchRoutesOpts, RouterOptionsExtensions, DefaultRemountDepsFn, PreloadRouteFn, MatchRouteFn, RouterContextOptions, RouterOptions, RouterConstructorOptions, UpdateFn, ParseLocationFn, InvalidateFn, ControllablePromise, InjectedHtmlEntry, RouterErrorSerializer, MatchedRoutesResult, EmitFn, LoadFn, GetMatchFn, SubscribeFn, UpdateMatchFn, CommitLocationFn, GetMatchRoutesFn, MatchRoutesFn, StartTransitionFn, LoadRouteChunkFn, ServerSrr, ClearCacheFn, CreateRouterFn, } from './router.cjs';
|
||||
export type { MatchLocation, CommitLocationOptions, NavigateFn, BuildLocationFn, } from './RouterProvider.cjs';
|
||||
export { retainSearchParams, stripSearchParams } from './searchMiddleware.cjs';
|
||||
export { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, } from './searchParams.cjs';
|
||||
export type { SearchSerializer, SearchParser } from './searchParams.cjs';
|
||||
export type { OptionalStructuralSharing } from './structuralSharing.cjs';
|
||||
export { last, functionalUpdate, pick, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, escapeJSON, shallow, createControlledPromise, } from './utils.cjs';
|
||||
export type { NoInfer, IsAny, PickAsRequired, PickRequired, PickOptional, WithoutEmpty, Expand, DeepPartial, MakeDifferenceOptional, IsUnion, IsNonEmptyObject, Assign, IntersectAssign, Timeout, Updater, NonNullableUpdater, StringLiteral, ThrowOrOptional, ThrowConstraint, ControlledPromise, ExtractObjects, PartialMergeAllObject, MergeAllPrimitive, ExtractPrimitives, PartialMergeAll, Constrain, ConstrainLiteral, UnionToIntersection, MergeAllObjects, MergeAll, ValidateJSON, StrictOrFrom, } from './utils.cjs';
|
||||
export type { StandardSchemaValidatorProps, StandardSchemaValidator, AnyStandardSchemaValidator, StandardSchemaValidatorTypes, AnyStandardSchemaValidateSuccess, AnyStandardSchemaValidateFailure, AnyStandardSchemaValidateIssue, AnyStandardSchemaValidateInput, AnyStandardSchemaValidate, ValidatorObj, AnyValidatorObj, ValidatorAdapter, AnyValidatorAdapter, AnyValidatorFn, ValidatorFn, Validator, AnyValidator, AnySchema, DefaultValidator, ResolveSearchValidatorInputFn, ResolveSearchValidatorInput, ResolveValidatorInputFn, ResolveValidatorInput, ResolveValidatorOutputFn, ResolveValidatorOutput, } from './validators.cjs';
|
||||
export type { UseRouteContextBaseOptions, UseRouteContextOptions, UseRouteContextResult, } from './useRouteContext.cjs';
|
||||
export type { UseSearchResult, ResolveUseSearch } from './useSearch.cjs';
|
||||
export type { UseParamsResult, ResolveUseParams } from './useParams.cjs';
|
||||
export type { UseNavigateResult } from './useNavigate.cjs';
|
||||
export type { UseLoaderDepsResult, ResolveUseLoaderDeps } from './useLoaderDeps.cjs';
|
||||
export type { UseLoaderDataResult, ResolveUseLoaderData } from './useLoaderData.cjs';
|
||||
export type { Redirect, ResolvedRedirect, AnyRedirect } from './redirect.cjs';
|
||||
export { redirect, isRedirect, isResolvedRedirect } from './redirect.cjs';
|
||||
export type { NotFoundError } from './not-found.cjs';
|
||||
export { isNotFound, notFound } from './not-found.cjs';
|
||||
export { defaultGetScrollRestorationKey, restoreScroll, storageKey, getCssSelector, scrollRestorationCache, setupScrollRestoration, handleHashScroll, } from './scroll-restoration.cjs';
|
||||
export type { ScrollRestorationOptions, ScrollRestorationEntry, } from './scroll-restoration.cjs';
|
||||
export type { ValidateFromPath, ValidateToPath, ValidateSearch, ValidateParams, InferFrom, InferTo, InferMaskTo, InferMaskFrom, ValidateNavigateOptions, ValidateNavigateOptionsArray, ValidateRedirectOptions, ValidateRedirectOptionsArray, ValidateId, InferStrict, InferShouldThrow, InferSelected, ValidateUseSearchResult, ValidateUseParamsResult, } from './typePrimitives.cjs';
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.26.2",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-code-frame"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.25.9",
|
||||
"js-tokens": "^4.0.0",
|
||||
"picocolors": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"import-meta-resolve": "^4.1.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const useMatch = require("./useMatch.cjs");
|
||||
function useLoaderData(opts) {
|
||||
return useMatch.useMatch({
|
||||
from: opts.from,
|
||||
strict: opts.strict,
|
||||
structuralSharing: opts.structuralSharing,
|
||||
select: (s) => {
|
||||
return opts.select ? opts.select(s.loaderData) : s.loaderData;
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.useLoaderData = useLoaderData;
|
||||
//# sourceMappingURL=useLoaderData.cjs.map
|
||||
@@ -0,0 +1,319 @@
|
||||
/**
|
||||
* @fileoverview Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead
|
||||
* @author Sharmila Jesupaul
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils");
|
||||
const {
|
||||
isCommaToken,
|
||||
isOpeningParenToken,
|
||||
isClosingParenToken,
|
||||
isParenthesised,
|
||||
} = require("./utils/ast-utils");
|
||||
|
||||
const ANY_SPACE = /\s/u;
|
||||
|
||||
/**
|
||||
* Helper that checks if the Object.assign call has array spread
|
||||
* @param {ASTNode} node The node that the rule warns on
|
||||
* @returns {boolean} - Returns true if the Object.assign call has array spread
|
||||
*/
|
||||
function hasArraySpread(node) {
|
||||
return node.arguments.some(arg => arg.type === "SpreadElement");
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the given node is an accessor property (getter/setter).
|
||||
* @param {ASTNode} node Node to check.
|
||||
* @returns {boolean} `true` if the node is a getter or a setter.
|
||||
*/
|
||||
function isAccessorProperty(node) {
|
||||
return (
|
||||
node.type === "Property" && (node.kind === "get" || node.kind === "set")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the given object expression node has accessor properties (getters/setters).
|
||||
* @param {ASTNode} node `ObjectExpression` node to check.
|
||||
* @returns {boolean} `true` if the node has at least one getter/setter.
|
||||
*/
|
||||
function hasAccessors(node) {
|
||||
return node.properties.some(isAccessorProperty);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters).
|
||||
* @param {ASTNode} node `CallExpression` node to check.
|
||||
* @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter.
|
||||
*/
|
||||
function hasArgumentsWithAccessors(node) {
|
||||
return node.arguments
|
||||
.filter(arg => arg.type === "ObjectExpression")
|
||||
.some(hasAccessors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper that checks if the node needs parentheses to be valid JS.
|
||||
* The default is to wrap the node in parentheses to avoid parsing errors.
|
||||
* @param {ASTNode} node The node that the rule warns on
|
||||
* @param {Object} sourceCode in context sourcecode object
|
||||
* @returns {boolean} - Returns true if the node needs parentheses
|
||||
*/
|
||||
function needsParens(node, sourceCode) {
|
||||
const parent = node.parent;
|
||||
|
||||
switch (parent.type) {
|
||||
case "VariableDeclarator":
|
||||
case "ArrayExpression":
|
||||
case "ReturnStatement":
|
||||
case "CallExpression":
|
||||
case "Property":
|
||||
return false;
|
||||
case "AssignmentExpression":
|
||||
return parent.left === node && !isParenthesised(sourceCode, node);
|
||||
default:
|
||||
return !isParenthesised(sourceCode, node);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if an argument needs parentheses. The default is to not add parens.
|
||||
* @param {ASTNode} node The node to be checked.
|
||||
* @param {Object} sourceCode in context sourcecode object
|
||||
* @returns {boolean} True if the node needs parentheses
|
||||
*/
|
||||
function argNeedsParens(node, sourceCode) {
|
||||
switch (node.type) {
|
||||
case "AssignmentExpression":
|
||||
case "ArrowFunctionExpression":
|
||||
case "ConditionalExpression":
|
||||
return !isParenthesised(sourceCode, node);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parenthesis tokens of a given ObjectExpression node.
|
||||
* This includes the braces of the object literal and enclosing parentheses.
|
||||
* @param {ASTNode} node The node to get.
|
||||
* @param {Token} leftArgumentListParen The opening paren token of the argument list.
|
||||
* @param {SourceCode} sourceCode The source code object to get tokens.
|
||||
* @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location.
|
||||
*/
|
||||
function getParenTokens(node, leftArgumentListParen, sourceCode) {
|
||||
const parens = [
|
||||
sourceCode.getFirstToken(node),
|
||||
sourceCode.getLastToken(node),
|
||||
];
|
||||
let leftNext = sourceCode.getTokenBefore(node);
|
||||
let rightNext = sourceCode.getTokenAfter(node);
|
||||
|
||||
// Note: don't include the parens of the argument list.
|
||||
while (
|
||||
leftNext &&
|
||||
rightNext &&
|
||||
leftNext.range[0] > leftArgumentListParen.range[0] &&
|
||||
isOpeningParenToken(leftNext) &&
|
||||
isClosingParenToken(rightNext)
|
||||
) {
|
||||
parens.push(leftNext, rightNext);
|
||||
leftNext = sourceCode.getTokenBefore(leftNext);
|
||||
rightNext = sourceCode.getTokenAfter(rightNext);
|
||||
}
|
||||
|
||||
return parens.sort((a, b) => a.range[0] - b.range[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the range of a given token and around whitespaces.
|
||||
* @param {Token} token The token to get range.
|
||||
* @param {SourceCode} sourceCode The source code object to get tokens.
|
||||
* @returns {number} The end of the range of the token and around whitespaces.
|
||||
*/
|
||||
function getStartWithSpaces(token, sourceCode) {
|
||||
const text = sourceCode.text;
|
||||
let start = token.range[0];
|
||||
|
||||
// If the previous token is a line comment then skip this step to avoid commenting this token out.
|
||||
{
|
||||
const prevToken = sourceCode.getTokenBefore(token, {
|
||||
includeComments: true,
|
||||
});
|
||||
|
||||
if (prevToken && prevToken.type === "Line") {
|
||||
return start;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect spaces before the token.
|
||||
while (ANY_SPACE.test(text[start - 1] || "")) {
|
||||
start -= 1;
|
||||
}
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the range of a given token and around whitespaces.
|
||||
* @param {Token} token The token to get range.
|
||||
* @param {SourceCode} sourceCode The source code object to get tokens.
|
||||
* @returns {number} The start of the range of the token and around whitespaces.
|
||||
*/
|
||||
function getEndWithSpaces(token, sourceCode) {
|
||||
const text = sourceCode.text;
|
||||
let end = token.range[1];
|
||||
|
||||
// Detect spaces after the token.
|
||||
while (ANY_SPACE.test(text[end] || "")) {
|
||||
end += 1;
|
||||
}
|
||||
|
||||
return end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Autofixes the Object.assign call to use an object spread instead.
|
||||
* @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call
|
||||
* @param {string} sourceCode sourceCode of the Object.assign call
|
||||
* @returns {Function} autofixer - replaces the Object.assign with a spread object.
|
||||
*/
|
||||
function defineFixer(node, sourceCode) {
|
||||
return function* (fixer) {
|
||||
const leftParen = sourceCode.getTokenAfter(
|
||||
node.callee,
|
||||
isOpeningParenToken,
|
||||
);
|
||||
const rightParen = sourceCode.getLastToken(node);
|
||||
|
||||
// Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren.
|
||||
yield fixer.removeRange([node.range[0], leftParen.range[0]]);
|
||||
|
||||
// Replace the parens of argument list to braces.
|
||||
if (needsParens(node, sourceCode)) {
|
||||
yield fixer.replaceText(leftParen, "({");
|
||||
yield fixer.replaceText(rightParen, "})");
|
||||
} else {
|
||||
yield fixer.replaceText(leftParen, "{");
|
||||
yield fixer.replaceText(rightParen, "}");
|
||||
}
|
||||
|
||||
// Process arguments.
|
||||
for (const argNode of node.arguments) {
|
||||
const innerParens = getParenTokens(argNode, leftParen, sourceCode);
|
||||
const left = innerParens.shift();
|
||||
const right = innerParens.pop();
|
||||
|
||||
if (argNode.type === "ObjectExpression") {
|
||||
const maybeTrailingComma = sourceCode.getLastToken(argNode, 1);
|
||||
const maybeArgumentComma = sourceCode.getTokenAfter(right);
|
||||
|
||||
/*
|
||||
* Make bare this object literal.
|
||||
* And remove spaces inside of the braces for better formatting.
|
||||
*/
|
||||
for (const innerParen of innerParens) {
|
||||
yield fixer.remove(innerParen);
|
||||
}
|
||||
const leftRange = [
|
||||
left.range[0],
|
||||
getEndWithSpaces(left, sourceCode),
|
||||
];
|
||||
const rightRange = [
|
||||
Math.max(
|
||||
getStartWithSpaces(right, sourceCode),
|
||||
leftRange[1],
|
||||
), // Ensure ranges don't overlap
|
||||
right.range[1],
|
||||
];
|
||||
|
||||
yield fixer.removeRange(leftRange);
|
||||
yield fixer.removeRange(rightRange);
|
||||
|
||||
// Remove the comma of this argument if it's duplication.
|
||||
if (
|
||||
(argNode.properties.length === 0 ||
|
||||
isCommaToken(maybeTrailingComma)) &&
|
||||
isCommaToken(maybeArgumentComma)
|
||||
) {
|
||||
yield fixer.remove(maybeArgumentComma);
|
||||
}
|
||||
} else {
|
||||
// Make spread.
|
||||
if (argNeedsParens(argNode, sourceCode)) {
|
||||
yield fixer.insertTextBefore(left, "...(");
|
||||
yield fixer.insertTextAfter(right, ")");
|
||||
} else {
|
||||
yield fixer.insertTextBefore(left, "...");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead",
|
||||
recommended: false,
|
||||
frozen: true,
|
||||
url: "https://eslint.org/docs/latest/rules/prefer-object-spread",
|
||||
},
|
||||
|
||||
schema: [],
|
||||
fixable: "code",
|
||||
|
||||
messages: {
|
||||
useSpreadMessage:
|
||||
"Use an object spread instead of `Object.assign` eg: `{ ...foo }`.",
|
||||
useLiteralMessage:
|
||||
"Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
return {
|
||||
Program(node) {
|
||||
const scope = sourceCode.getScope(node);
|
||||
const tracker = new ReferenceTracker(scope);
|
||||
const trackMap = {
|
||||
Object: {
|
||||
assign: { [CALL]: true },
|
||||
},
|
||||
};
|
||||
|
||||
// Iterate all calls of `Object.assign` (only of the global variable `Object`).
|
||||
for (const { node: refNode } of tracker.iterateGlobalReferences(
|
||||
trackMap,
|
||||
)) {
|
||||
if (
|
||||
refNode.arguments.length >= 1 &&
|
||||
refNode.arguments[0].type === "ObjectExpression" &&
|
||||
!hasArraySpread(refNode) &&
|
||||
!(
|
||||
refNode.arguments.length > 1 &&
|
||||
hasArgumentsWithAccessors(refNode)
|
||||
)
|
||||
) {
|
||||
const messageId =
|
||||
refNode.arguments.length === 1
|
||||
? "useLiteralMessage"
|
||||
: "useSpreadMessage";
|
||||
const fix = defineFixer(refNode, sourceCode);
|
||||
|
||||
context.report({ node: refNode, messageId, fix });
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
var _utils = require("./utils.js");
|
||||
var _placeholders = require("./placeholders.js");
|
||||
var _core = require("./core.js");
|
||||
const defineType = (0, _utils.defineAliasedType)("Miscellaneous");
|
||||
{
|
||||
defineType("Noop", {
|
||||
visitor: []
|
||||
});
|
||||
}
|
||||
defineType("Placeholder", {
|
||||
visitor: [],
|
||||
builder: ["expectedNode", "name"],
|
||||
fields: Object.assign({
|
||||
name: {
|
||||
validate: (0, _utils.assertNodeType)("Identifier")
|
||||
},
|
||||
expectedNode: {
|
||||
validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS)
|
||||
}
|
||||
}, (0, _core.patternLikeCommon)())
|
||||
});
|
||||
defineType("V8IntrinsicIdentifier", {
|
||||
builder: ["name"],
|
||||
fields: {
|
||||
name: {
|
||||
validate: (0, _utils.assertValueType)("string")
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=misc.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E mC","4":"F A B"},B:{"1":"0 9 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","4":"C L M G N"},C:{"1":"0 9 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 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB qC rC","194":"ZB aB bB cB dB eB fB gB"},D:{"1":"0 9 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","4":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB"},E:{"1":"A B C L M G 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","4":"J PB K D E F sC SC tC uC vC wC"},F:{"1":"0 4 5 6 7 8 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","2":"F B C 4C 5C 6C 7C FC kC 8C GC","4":"1 2 3 G N O P QB"},G:{"1":"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","4":"E SC 9C lC AD BD CD DD ED FD"},H:{"2":"WD"},I:{"1":"I","4":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D","4":"A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"4":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","4":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:4,C:"Font unicode-range subsetting",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"K D E 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 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC 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","132":"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":"sC","4":"SC","132":"J PB K D E tC uC vC"},F:{"1":"0 1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 4C 5C 6C 7C FC kC 8C GC"},G:{"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","132":"E SC 9C lC AD BD CD DD"},H:{"1":"WD"},I:{"1":"I bD cD","2":"XD YD ZD","132":"LC J aD lC"},J:{"1":"D A"},K:{"1":"A B C H FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"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:1,C:"SVG in HTML img element",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w","194":"x y z"},C:{"1":"0 9 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 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B qC rC"},D:{"1":"0 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w","194":"x y z"},E:{"1":"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 F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C"},F:{"1":"0 m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i 4C 5C 6C 7C FC kC 8C GC","194":"j k l"},G:{"1":"IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"1":"5 6 7 8","2":"1 2 3 4 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"2":"oD"},R:{"2":"pD"},S:{"1":"rD","2":"qD"}},B:4,C:"CSS Subgrid",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P"},C:{"1":"0 9 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 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qC rC","194":"qB rB"},D:{"1":"0 9 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 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB"},E:{"1":"3C","2":"J PB K D E F A B C L sC SC tC uC vC wC TC FC GC","322":"M G 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"},F:{"1":"0 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","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB 4C 5C 6C 7C FC kC 8C GC"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD","322":"PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:5,C:"requestIdleCallback",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"4":0.03645,"52":0.00521,"78":0.01041,"115":0.09893,"120":0.00521,"122":0.00521,"123":0.01041,"125":0.00521,"128":0.02083,"132":0.01041,"133":0.00521,"134":0.00521,"135":0.15621,"136":0.6717,"137":0.00521,_:"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 112 113 114 116 117 118 119 121 124 126 127 129 130 131 138 139 140 3.5 3.6"},D:{"38":0.01041,"39":0.00521,"40":0.00521,"41":0.00521,"42":0.00521,"43":0.00521,"44":0.00521,"45":0.00521,"46":0.00521,"47":0.01562,"48":0.00521,"49":0.02604,"50":0.00521,"51":0.00521,"52":0.00521,"53":0.00521,"54":0.00521,"55":0.00521,"56":0.00521,"57":0.00521,"58":0.00521,"59":0.00521,"60":0.00521,"72":0.00521,"74":0.00521,"78":0.00521,"79":0.12497,"80":0.02083,"81":0.01041,"85":0.00521,"87":0.09893,"88":0.00521,"91":0.01041,"93":0.00521,"94":0.01562,"96":0.00521,"99":0.00521,"100":0.01041,"101":0.00521,"102":0.01041,"103":0.01562,"104":0.01041,"106":0.00521,"107":0.02604,"108":0.05728,"109":1.46317,"110":0.02083,"111":0.01562,"112":0.01562,"113":0.00521,"114":0.04686,"115":0.00521,"116":0.05728,"117":0.00521,"118":0.01041,"119":0.02604,"120":0.06248,"121":0.0729,"122":0.13018,"123":0.12497,"124":0.09893,"125":0.06769,"126":0.09373,"127":0.06769,"128":0.09893,"129":0.0729,"130":0.10414,"131":0.45822,"132":0.43218,"133":11.29919,"134":25.05088,"135":0.02083,"136":0.01041,_:"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 65 66 67 68 69 70 71 73 75 76 77 83 84 86 89 90 92 95 97 98 105 137 138"},F:{"36":0.00521,"87":0.00521,"95":0.04166,"114":0.00521,"116":0.7446,"117":1.83807,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00521,"85":0.00521,"92":0.01562,"100":0.00521,"102":0.00521,"109":0.02604,"114":0.01041,"120":0.00521,"121":0.00521,"122":0.01041,"123":0.03124,"124":0.00521,"125":0.00521,"126":0.00521,"127":0.00521,"128":0.02083,"129":0.00521,"130":0.01562,"131":0.05728,"132":0.04166,"133":1.05702,"134":2.72326,_:"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 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119"},E:{"15":0.00521,_:"0 4 5 6 7 8 9 10 11 12 13 14 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 15.5 16.2 17.0","5.1":0.00521,"13.1":0.00521,"14.1":0.01041,"15.1":0.00521,"15.4":0.01562,"15.6":0.02604,"16.0":0.00521,"16.1":0.00521,"16.3":0.00521,"16.4":0.01041,"16.5":0.00521,"16.6":0.03124,"17.1":0.01041,"17.2":0.01562,"17.3":0.01041,"17.4":0.01562,"17.5":0.02083,"17.6":0.05207,"18.0":0.02604,"18.1":0.05728,"18.2":0.02604,"18.3":0.39573,"18.4":0.01041},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00092,"5.0-5.1":0,"6.0-6.1":0.00277,"7.0-7.1":0.00185,"8.1-8.4":0,"9.0-9.2":0.00138,"9.3":0.00646,"10.0-10.2":0.00046,"10.3":0.01061,"11.0-11.2":0.04892,"11.3-11.4":0.00323,"12.0-12.1":0.00185,"12.2-12.5":0.04569,"13.0-13.1":0.00092,"13.2":0.00138,"13.3":0.00185,"13.4-13.7":0.00646,"14.0-14.4":0.01615,"14.5-14.8":0.01938,"15.0-15.1":0.01061,"15.2-15.3":0.01061,"15.4":0.01292,"15.5":0.01477,"15.6-15.8":0.18182,"16.0":0.02584,"16.1":0.05307,"16.2":0.02769,"16.3":0.04799,"16.4":0.01061,"16.5":0.01984,"16.6-16.7":0.21551,"17.0":0.01292,"17.1":0.02307,"17.2":0.01754,"17.3":0.02446,"17.4":0.04892,"17.5":0.10891,"17.6-17.7":0.31611,"18.0":0.0886,"18.1":0.2898,"18.2":0.12967,"18.3":2.71021,"18.4":0.04015},P:{"4":0.12351,"21":0.01029,"22":0.01029,"23":0.04117,"24":0.04117,"25":0.03088,"26":0.03088,"27":0.75134,_:"20 8.2 10.1 12.0 14.0 15.0 16.0 17.0 18.0","5.0-5.4":0.02058,"6.2-6.4":0.01029,"7.2-7.4":0.07205,"9.2":0.01029,"11.1-11.2":0.01029,"13.0":0.01029,"19.0":0.01029},I:{"0":0.02869,"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.1773,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.04166,_:"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.1198},Q:{_:"14.9"},O:{"0":0.01917},H:{"0":0},L:{"0":43.29506}};
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2010 LearnBoost <tj@learnboost.com>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <napi.h>
|
||||
#include <cairo.h>
|
||||
|
||||
class Gradient : public Napi::ObjectWrap<Gradient> {
|
||||
public:
|
||||
static void Initialize(Napi::Env& env, Napi::Object& target);
|
||||
Gradient(const Napi::CallbackInfo& info);
|
||||
void AddColorStop(const Napi::CallbackInfo& info);
|
||||
inline cairo_pattern_t *pattern(){ return _pattern; }
|
||||
~Gradient();
|
||||
|
||||
Napi::Env env;
|
||||
|
||||
private:
|
||||
cairo_pattern_t *_pattern;
|
||||
};
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"K D E 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 1 2 3 4 5 6 7 8 9 LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC","16":"nC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"1":"J PB K D E F A B C L M G tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","16":"sC SC"},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 4C 5C 6C 7C FC kC 8C","16":"C"},G:{"1":"E AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","16":"SC 9C lC"},H:{"2":"WD"},I:{"1":"LC J I ZD aD lC bD cD","16":"XD YD"},J:{"1":"D A"},K:{"1":"H GC","2":"A B FC kC","16":"C"},L:{"1":"I"},M:{"130":"EC"},N:{"130":"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:7,C:"KeyboardEvent.charCode",D:true};
|
||||
@@ -0,0 +1,83 @@
|
||||
declare namespace locatePath {
|
||||
interface Options {
|
||||
/**
|
||||
Current working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
|
||||
/**
|
||||
Type of path to match.
|
||||
|
||||
@default 'file'
|
||||
*/
|
||||
readonly type?: 'file' | 'directory';
|
||||
|
||||
/**
|
||||
Allow symbolic links to match if they point to the requested path type.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly allowSymlinks?: boolean;
|
||||
}
|
||||
|
||||
interface AsyncOptions extends Options {
|
||||
/**
|
||||
Number of concurrently pending promises. Minimum: `1`.
|
||||
|
||||
@default Infinity
|
||||
*/
|
||||
readonly concurrency?: number;
|
||||
|
||||
/**
|
||||
Preserve `paths` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly preserveOrder?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const locatePath: {
|
||||
/**
|
||||
Synchronously get the first path that exists on disk of multiple paths.
|
||||
|
||||
@param paths - Paths to check.
|
||||
@returns The first path that exists or `undefined` if none exists.
|
||||
*/
|
||||
sync: (
|
||||
paths: Iterable<string>,
|
||||
options?: locatePath.Options
|
||||
) => string | undefined;
|
||||
|
||||
/**
|
||||
Get the first path that exists on disk of multiple paths.
|
||||
|
||||
@param paths - Paths to check.
|
||||
@returns The first path that exists or `undefined` if none exists.
|
||||
|
||||
@example
|
||||
```
|
||||
import locatePath = require('locate-path');
|
||||
|
||||
const files = [
|
||||
'unicorn.png',
|
||||
'rainbow.png', // Only this one actually exists on disk
|
||||
'pony.png'
|
||||
];
|
||||
|
||||
(async () => {
|
||||
console(await locatePath(files));
|
||||
//=> 'rainbow'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
(paths: Iterable<string>, options?: locatePath.AsyncOptions): Promise<
|
||||
string | undefined
|
||||
>;
|
||||
};
|
||||
|
||||
export = locatePath;
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,90 @@
|
||||
import { BaseRootRoute, BaseRoute, BaseRouteApi, AnyContext, AnyRoute, AnyRouter, ConstrainLiteral, ErrorComponentProps, NotFoundError, NotFoundRouteProps, RegisteredRouter, ResolveFullPath, ResolveId, ResolveParams, RootRouteId, RootRouteOptions, RouteConstraints, RouteIds, RouteMask, RouteOptions, RouteTypesById, RouterCore, ToMaskOptions, UseNavigateResult } from '@tanstack/router-core';
|
||||
import { UseLoaderDataRoute } from './useLoaderData.cjs';
|
||||
import { UseMatchRoute } from './useMatch.cjs';
|
||||
import { UseLoaderDepsRoute } from './useLoaderDeps.cjs';
|
||||
import { UseParamsRoute } from './useParams.cjs';
|
||||
import { UseSearchRoute } from './useSearch.cjs';
|
||||
import { UseRouteContextRoute } from './useRouteContext.cjs';
|
||||
import type * as React from 'react';
|
||||
declare module '@tanstack/router-core' {
|
||||
interface UpdatableRouteOptionsExtensions {
|
||||
component?: RouteComponent;
|
||||
errorComponent?: false | null | ErrorRouteComponent;
|
||||
notFoundComponent?: NotFoundRouteComponent;
|
||||
pendingComponent?: RouteComponent;
|
||||
}
|
||||
interface RouteExtensions<TId extends string, TFullPath extends string> {
|
||||
useMatch: UseMatchRoute<TId>;
|
||||
useRouteContext: UseRouteContextRoute<TId>;
|
||||
useSearch: UseSearchRoute<TId>;
|
||||
useParams: UseParamsRoute<TId>;
|
||||
useLoaderDeps: UseLoaderDepsRoute<TId>;
|
||||
useLoaderData: UseLoaderDataRoute<TId>;
|
||||
useNavigate: () => UseNavigateResult<TFullPath>;
|
||||
}
|
||||
}
|
||||
export declare function getRouteApi<const TId, TRouter extends AnyRouter = RegisteredRouter>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>): RouteApi<TId, TRouter>;
|
||||
export declare class RouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> extends BaseRouteApi<TId, TRouter> {
|
||||
/**
|
||||
* @deprecated Use the `getRouteApi` function instead.
|
||||
*/
|
||||
constructor({ id }: {
|
||||
id: TId;
|
||||
});
|
||||
useMatch: UseMatchRoute<TId>;
|
||||
useRouteContext: UseRouteContextRoute<TId>;
|
||||
useSearch: UseSearchRoute<TId>;
|
||||
useParams: UseParamsRoute<TId>;
|
||||
useLoaderDeps: UseLoaderDepsRoute<TId>;
|
||||
useLoaderData: UseLoaderDataRoute<TId>;
|
||||
useNavigate: () => UseNavigateResult<RouteTypesById<TRouter, TId>["fullPath"]>;
|
||||
notFound: (opts?: NotFoundError) => NotFoundError;
|
||||
}
|
||||
export declare class Route<in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, in out TPath extends RouteConstraints['TPath'] = '/', in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends RouteConstraints['TCustomId'] = string, in out TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchValidator = undefined, in out TParams = ResolveParams<TPath>, in out TRouterContext = AnyContext, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown> extends BaseRoute<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes> {
|
||||
/**
|
||||
* @deprecated Use the `createRoute` function instead.
|
||||
*/
|
||||
constructor(options?: RouteOptions<TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn>);
|
||||
useMatch: UseMatchRoute<TId>;
|
||||
useRouteContext: UseRouteContextRoute<TId>;
|
||||
useSearch: UseSearchRoute<TId>;
|
||||
useParams: UseParamsRoute<TId>;
|
||||
useLoaderDeps: UseLoaderDepsRoute<TId>;
|
||||
useLoaderData: UseLoaderDataRoute<TId>;
|
||||
useNavigate: () => UseNavigateResult<TFullPath>;
|
||||
}
|
||||
export declare function createRoute<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown>(options: RouteOptions<TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, AnyContext, TRouteContextFn, TBeforeLoadFn>): Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, AnyContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren>;
|
||||
export type AnyRootRoute = RootRoute<any, any, any, any, any, any, any, any>;
|
||||
export declare function createRootRouteWithContext<TRouterContext extends {}>(): <TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined>(options?: RootRouteOptions<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn>) => RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown>;
|
||||
/**
|
||||
* @deprecated Use the `createRootRouteWithContext` function instead.
|
||||
*/
|
||||
export declare const rootRouteWithContext: typeof createRootRouteWithContext;
|
||||
export declare class RootRoute<in out TSearchValidator = undefined, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown> extends BaseRootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes> {
|
||||
/**
|
||||
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
|
||||
*/
|
||||
constructor(options?: RootRouteOptions<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn>);
|
||||
useMatch: UseMatchRoute<RootRouteId>;
|
||||
useRouteContext: UseRouteContextRoute<RootRouteId>;
|
||||
useSearch: UseSearchRoute<RootRouteId>;
|
||||
useParams: UseParamsRoute<RootRouteId>;
|
||||
useLoaderDeps: UseLoaderDepsRoute<RootRouteId>;
|
||||
useLoaderData: UseLoaderDataRoute<RootRouteId>;
|
||||
useNavigate: () => UseNavigateResult<"/">;
|
||||
}
|
||||
export declare function createRootRoute<TSearchValidator = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined>(options?: RootRouteOptions<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn>): RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown>;
|
||||
export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends string, TTo extends string>(opts: {
|
||||
routeTree: TRouteTree;
|
||||
} & ToMaskOptions<RouterCore<TRouteTree, 'never', boolean>, TFrom, TTo>): RouteMask<TRouteTree>;
|
||||
export type ReactNode = any;
|
||||
export type SyncRouteComponent<TProps> = ((props: TProps) => ReactNode) | React.LazyExoticComponent<(props: TProps) => ReactNode>;
|
||||
export type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
|
||||
preload?: () => Promise<void>;
|
||||
};
|
||||
export type RouteComponent<TProps = any> = AsyncRouteComponent<TProps>;
|
||||
export type ErrorRouteComponent = RouteComponent<ErrorComponentProps>;
|
||||
export type NotFoundRouteComponent = SyncRouteComponent<NotFoundRouteProps>;
|
||||
export declare class NotFoundRoute<TParentRoute extends AnyRootRoute, TRouterContext = AnyContext, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown> extends Route<TParentRoute, '/404', '/404', '404', '404', TSearchValidator, {}, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren> {
|
||||
constructor(options: Omit<RouteOptions<TParentRoute, string, string, string, string, TSearchValidator, {}, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn>, 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'path' | 'id' | 'params'>);
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
/**
|
||||
* @fileoverview Rule to enforce requiring named capture groups in regular expression.
|
||||
* @author Pig Fang <https://github.com/g-plane>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const {
|
||||
CALL,
|
||||
CONSTRUCT,
|
||||
ReferenceTracker,
|
||||
getStringIfConstant,
|
||||
} = require("@eslint-community/eslint-utils");
|
||||
const regexpp = require("@eslint-community/regexpp");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const parser = new regexpp.RegExpParser();
|
||||
|
||||
/**
|
||||
* Creates fixer suggestions for the regex, if statically determinable.
|
||||
* @param {number} groupStart Starting index of the regex group.
|
||||
* @param {string} pattern The regular expression pattern to be checked.
|
||||
* @param {string} rawText Source text of the regexNode.
|
||||
* @param {ASTNode} regexNode AST node which contains the regular expression.
|
||||
* @returns {Array<SuggestionResult>} Fixer suggestions for the regex, if statically determinable.
|
||||
*/
|
||||
function suggestIfPossible(groupStart, pattern, rawText, regexNode) {
|
||||
switch (regexNode.type) {
|
||||
case "Literal":
|
||||
if (typeof regexNode.value === "string" && rawText.includes("\\")) {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
case "TemplateLiteral":
|
||||
if (
|
||||
regexNode.expressions.length ||
|
||||
rawText.slice(1, -1) !== pattern
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
const start = regexNode.range[0] + groupStart + 2;
|
||||
|
||||
return [
|
||||
{
|
||||
fix(fixer) {
|
||||
const existingTemps = pattern.match(/temp\d+/gu) || [];
|
||||
const highestTempCount = existingTemps.reduce(
|
||||
(previous, next) =>
|
||||
Math.max(previous, Number(next.slice("temp".length))),
|
||||
0,
|
||||
);
|
||||
|
||||
return fixer.insertTextBeforeRange(
|
||||
[start, start],
|
||||
`?<temp${highestTempCount + 1}>`,
|
||||
);
|
||||
},
|
||||
messageId: "addGroupName",
|
||||
},
|
||||
{
|
||||
fix(fixer) {
|
||||
return fixer.insertTextBeforeRange([start, start], "?:");
|
||||
},
|
||||
messageId: "addNonCapture",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Enforce using named capture group in regular expression",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/prefer-named-capture-group",
|
||||
},
|
||||
|
||||
hasSuggestions: true,
|
||||
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
addGroupName: "Add name to capture group.",
|
||||
addNonCapture: "Convert group to non-capturing.",
|
||||
required:
|
||||
"Capture group '{{group}}' should be converted to a named or non-capturing group.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
/**
|
||||
* Function to check regular expression.
|
||||
* @param {string} pattern The regular expression pattern to be checked.
|
||||
* @param {ASTNode} node AST node which contains the regular expression or a call/new expression.
|
||||
* @param {ASTNode} regexNode AST node which contains the regular expression.
|
||||
* @param {string|null} flags The regular expression flags to be checked.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkRegex(pattern, node, regexNode, flags) {
|
||||
let ast;
|
||||
|
||||
try {
|
||||
ast = parser.parsePattern(pattern, 0, pattern.length, {
|
||||
unicode: Boolean(flags && flags.includes("u")),
|
||||
unicodeSets: Boolean(flags && flags.includes("v")),
|
||||
});
|
||||
} catch {
|
||||
// ignore regex syntax errors
|
||||
return;
|
||||
}
|
||||
|
||||
regexpp.visitRegExpAST(ast, {
|
||||
onCapturingGroupEnter(group) {
|
||||
if (!group.name) {
|
||||
const rawText = sourceCode.getText(regexNode);
|
||||
const suggest = suggestIfPossible(
|
||||
group.start,
|
||||
pattern,
|
||||
rawText,
|
||||
regexNode,
|
||||
);
|
||||
|
||||
context.report({
|
||||
node,
|
||||
messageId: "required",
|
||||
data: {
|
||||
group: group.raw,
|
||||
},
|
||||
suggest,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
Literal(node) {
|
||||
if (node.regex) {
|
||||
checkRegex(
|
||||
node.regex.pattern,
|
||||
node,
|
||||
node,
|
||||
node.regex.flags,
|
||||
);
|
||||
}
|
||||
},
|
||||
Program(node) {
|
||||
const scope = sourceCode.getScope(node);
|
||||
const tracker = new ReferenceTracker(scope);
|
||||
const traceMap = {
|
||||
RegExp: {
|
||||
[CALL]: true,
|
||||
[CONSTRUCT]: true,
|
||||
},
|
||||
};
|
||||
|
||||
for (const { node: refNode } of tracker.iterateGlobalReferences(
|
||||
traceMap,
|
||||
)) {
|
||||
const regex = getStringIfConstant(refNode.arguments[0]);
|
||||
const flags = getStringIfConstant(refNode.arguments[1]);
|
||||
|
||||
if (regex) {
|
||||
checkRegex(regex, refNode, refNode.arguments[0], flags);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user