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

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

No files matched your search

@@ -0,0 +1,247 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-find',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result',
recommended: 'stylistic',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
preferFind: 'Prefer .find(...) instead of .filter(...)[0].',
preferFindSuggestion: 'Use .find(...) instead of .filter(...)[0].',
},
schema: [],
},
defaultOptions: [],
create(context) {
const globalScope = context.sourceCode.getScope(context.sourceCode.ast);
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function parseArrayFilterExpressions(expression) {
const node = (0, util_1.skipChainExpression)(expression);
if (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) {
// Only the last expression in (a, b, [1, 2, 3].filter(condition))[0] matters
const lastExpression = (0, util_1.nullThrows)(node.expressions.at(-1), 'Expected to have more than zero expressions in a sequence expression');
return parseArrayFilterExpressions(lastExpression);
}
// This is the only reason we're returning a list rather than a single value.
if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) {
// Both branches of the ternary _must_ return results.
const consequentResult = parseArrayFilterExpressions(node.consequent);
if (consequentResult.length === 0) {
return [];
}
const alternateResult = parseArrayFilterExpressions(node.alternate);
if (alternateResult.length === 0) {
return [];
}
// Accumulate the results from both sides and pass up the chain.
return [...consequentResult, ...alternateResult];
}
// Check if it looks like <<stuff>>(...), but not <<stuff>>?.(...)
if (node.type === utils_1.AST_NODE_TYPES.CallExpression && !node.optional) {
const callee = node.callee;
// Check if it looks like <<stuff>>.filter(...) or <<stuff>>['filter'](...),
// or the optional chaining variants.
if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression) {
const isBracketSyntaxForFilter = callee.computed;
if ((0, util_1.isStaticMemberAccessOfValue)(callee, context, 'filter')) {
const filterNode = callee.property;
const filteredObjectType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object);
// As long as the object is a (possibly nullable) array,
// this is an Array.prototype.filter expression.
if (isArrayish(filteredObjectType)) {
return [
{
filterNode,
isBracketSyntaxForFilter,
},
];
}
}
}
}
// not a filter expression.
return [];
}
/**
* Tells whether the type is a possibly nullable array/tuple or union thereof.
*/
function isArrayish(type) {
let isAtLeastOneArrayishComponent = false;
for (const unionPart of tsutils.unionConstituents(type)) {
if (tsutils.isIntrinsicNullType(unionPart) ||
tsutils.isIntrinsicUndefinedType(unionPart)) {
continue;
}
// apparently checker.isArrayType(T[] & S[]) => false.
// so we need to check the intersection parts individually.
const isArrayOrIntersectionThereof = tsutils
.intersectionConstituents(unionPart)
.every(intersectionPart => checker.isArrayType(intersectionPart) ||
checker.isTupleType(intersectionPart));
if (!isArrayOrIntersectionThereof) {
// There is a non-array, non-nullish type component,
// so it's not an array.
return false;
}
isAtLeastOneArrayishComponent = true;
}
return isAtLeastOneArrayishComponent;
}
function getObjectIfArrayAtZeroExpression(node) {
// .at() should take exactly one argument.
if (node.arguments.length !== 1) {
return undefined;
}
const callee = node.callee;
if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
!callee.optional &&
(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'at')) {
const atArgument = (0, util_1.getStaticValue)(node.arguments[0], globalScope);
if (atArgument != null && isTreatedAsZeroByArrayAt(atArgument.value)) {
return callee.object;
}
}
return undefined;
}
/**
* Implements the algorithm for array indexing by `.at()` method.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at#parameters
*/
function isTreatedAsZeroByArrayAt(value) {
// This would cause the number constructor coercion to throw. Other static
// values are safe.
if (typeof value === 'symbol') {
return false;
}
const asNumber = Number(value);
if (isNaN(asNumber)) {
return true;
}
return Math.trunc(asNumber) === 0;
}
function isMemberAccessOfZero(node) {
const property = (0, util_1.getStaticValue)(node.property, globalScope);
// Check if it looks like <<stuff>>[0] or <<stuff>>['0'], but not <<stuff>>?.[0]
return (!node.optional &&
property != null &&
isTreatedAsZeroByMemberAccess(property.value));
}
/**
* Implements the algorithm for array indexing by member operator.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#array_indices
*/
function isTreatedAsZeroByMemberAccess(value) {
return String(value) === '0';
}
function generateFixToRemoveArrayElementAccess(fixer, arrayNode, wholeExpressionBeingFlagged) {
const tokenToStartDeletingFrom = (0, util_1.nullThrows)(
// The next `.` or `[` is what we're looking for.
// think of (...).at(0) or (...)[0] or even (...)["at"](0).
context.sourceCode.getTokenAfter(arrayNode, token => token.value === '.' || token.value === '['), 'Expected to find a member access token!');
return fixer.removeRange([
tokenToStartDeletingFrom.range[0],
wholeExpressionBeingFlagged.range[1],
]);
}
function generateFixToReplaceFilterWithFind(fixer, filterExpression) {
return fixer.replaceText(filterExpression.filterNode, filterExpression.isBracketSyntaxForFilter ? '"find"' : 'find');
}
return {
// This query will be used to find things like `filteredResults.at(0)`.
CallExpression(node) {
const object = getObjectIfArrayAtZeroExpression(node);
if (object) {
const filterExpressions = parseArrayFilterExpressions(object);
if (filterExpressions.length !== 0) {
context.report({
node,
messageId: 'preferFind',
suggest: [
{
messageId: 'preferFindSuggestion',
fix: (fixer) => {
return [
...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)),
// Get rid of the .at(0) or ['at'](0).
generateFixToRemoveArrayElementAccess(fixer, object, node),
];
},
},
],
});
}
}
},
// This query will be used to find things like `filteredResults[0]`.
//
// Note: we're always looking for array member access to be "computed",
// i.e. `filteredResults[0]`, since `filteredResults.0` isn't a thing.
'MemberExpression[computed=true]'(node) {
if (isMemberAccessOfZero(node)) {
const object = node.object;
const filterExpressions = parseArrayFilterExpressions(object);
if (filterExpressions.length !== 0) {
context.report({
node,
messageId: 'preferFind',
suggest: [
{
messageId: 'preferFindSuggestion',
fix: (fixer) => {
return [
...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)),
// Get rid of the [0].
generateFixToRemoveArrayElementAccess(fixer, object, node),
];
},
},
],
});
}
}
},
};
},
});
@@ -0,0 +1,3 @@
import type { Vocabulary } from "../../types";
declare const dynamic: Vocabulary;
export default dynamic;
@@ -0,0 +1,228 @@
import { K as isSingleLine, f as createRule, g as import_ast_utils, o as isJSX } from "../utils.js";
var jsx_wrap_multilines_default = createRule({
name: "jsx-wrap-multilines",
meta: {
type: "layout",
docs: { description: "Disallow missing parentheses around multiline JSX" },
fixable: "code",
schema: [{
type: "object",
properties: {
declaration: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
assignment: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
return: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
arrow: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
condition: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
logical: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
prop: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
},
propertyValue: {
type: ["string", "boolean"],
enum: [
true,
false,
"ignore",
"parens",
"parens-new-line"
]
}
},
additionalProperties: false
}],
defaultOptions: [{
declaration: "parens",
assignment: "parens",
return: "parens",
arrow: "parens",
condition: "ignore",
logical: "ignore",
prop: "ignore",
propertyValue: "ignore"
}],
messages: {
missingParens: "Missing parentheses around multilines JSX",
parensOnNewLines: "Parentheses around JSX should be on separate lines"
}
},
create(context, [options]) {
function isEnabled(type) {
const option = options[type];
return option && option !== "ignore";
}
const { sourceCode } = context;
function needsOpeningNewLine(node) {
const previousToken = sourceCode.getTokenBefore(node);
if (!(0, import_ast_utils.isParenthesized)(node, sourceCode)) return false;
if ((0, import_ast_utils.isTokenOnSameLine)(previousToken, node)) return true;
return false;
}
function needsClosingNewLine(node) {
const nextToken = sourceCode.getTokenAfter(node);
if (!(0, import_ast_utils.isParenthesized)(node, sourceCode)) return false;
if ((0, import_ast_utils.isTokenOnSameLine)(node, nextToken)) return true;
return false;
}
function trimTokenBeforeNewline(tokenBefore) {
const isBracket = tokenBefore.value === "{" || tokenBefore.value === "[";
return `${tokenBefore.value.trim()}${isBracket ? "" : " "}`;
}
function check(node, type) {
if (!node || !isJSX(node)) return;
const option = options[type];
if ((option === true || option === "parens") && !(0, import_ast_utils.isParenthesized)(node, sourceCode) && !isSingleLine(node)) context.report({
node,
messageId: "missingParens",
fix: (fixer) => fixer.replaceText(node, `(${sourceCode.getText(node)})`)
});
if (option === "parens-new-line" && !isSingleLine(node)) if (!(0, import_ast_utils.isParenthesized)(node, sourceCode)) {
const tokenBefore = sourceCode.getTokenBefore(node);
const tokenAfter = sourceCode.getTokenAfter(node);
const start = node.loc.start;
if (tokenBefore.loc.end.line < start.line) {
const textBefore = sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim();
const isTab = /^\t/.test(sourceCode.lines[start.line - 1]);
const INDENT = isTab ? " " : " ";
const indentBefore = INDENT.repeat(start.column);
const indentAfter = INDENT.repeat(Math.max(0, start.column - (isTab ? 1 : 2)));
context.report({
node,
messageId: "missingParens",
fix: (fixer) => fixer.replaceTextRange([tokenBefore.range[0], tokenAfter && (tokenAfter.value === ";" || tokenAfter.value === "}") ? tokenAfter.range[0] : node.range[1]], `${trimTokenBeforeNewline(tokenBefore)}(\n${indentBefore}${textBefore}${textBefore.length > 0 ? `\n${indentBefore}` : ""}${sourceCode.getText(node)}\n${indentAfter})`)
});
} else context.report({
node,
messageId: "missingParens",
fix: (fixer) => fixer.replaceText(node, `(\n${sourceCode.getText(node)}\n)`)
});
} else {
const needsOpening = needsOpeningNewLine(node);
const needsClosing = needsClosingNewLine(node);
if (needsOpening || needsClosing) context.report({
node,
messageId: "parensOnNewLines",
fix: (fixer) => {
let fixed = sourceCode.getText(node);
if (needsOpening) fixed = `\n${fixed}`;
if (needsClosing) fixed = `${fixed}\n`;
return fixer.replaceText(node, fixed);
}
});
}
}
return {
VariableDeclarator(node) {
const type = "declaration";
if (!isEnabled(type)) return;
if (!isEnabled("condition") && node.init?.type === "ConditionalExpression") {
check(node.init.consequent, type);
check(node.init.alternate, type);
return;
}
check(node.init, type);
},
AssignmentExpression(node) {
const type = "assignment";
if (!isEnabled(type)) return;
if (!isEnabled("condition") && node.right.type === "ConditionalExpression") {
check(node.right.consequent, type);
check(node.right.alternate, type);
return;
}
check(node.right, type);
},
ReturnStatement(node) {
const type = "return";
if (isEnabled(type)) check(node.argument, type);
},
"ArrowFunctionExpression:exit": (node) => {
const arrowBody = node.body;
const type = "arrow";
if (isEnabled(type) && arrowBody.type !== "BlockStatement") check(arrowBody, type);
},
ConditionalExpression(node) {
const type = "condition";
if (isEnabled(type)) {
check(node.consequent, type);
check(node.alternate, type);
}
},
LogicalExpression(node) {
const type = "logical";
if (isEnabled(type)) check(node.right, type);
},
JSXAttribute(node) {
const type = "prop";
if (isEnabled(type) && node.value?.type === "JSXExpressionContainer") check(node.value.expression, type);
},
ObjectExpression(node) {
const type = "propertyValue";
if (isEnabled(type)) node.properties.forEach((property) => {
if (property.type === "Property" && property.value.type === "JSXElement") check(property.value, type);
});
}
};
}
});
export { jsx_wrap_multilines_default as t };
@@ -0,0 +1,23 @@
import { ConsolaInstance, ConsolaOptions } from './core.cjs';
export { ConfirmPromptOptions, Consola, ConsolaReporter, FormatOptions, InputLogObject, LogLevel, LogLevels, LogObject, LogType, LogTypes, MultiSelectOptions, PromptOptions, SelectPromptOptions, TextPromptOptions } from './core.cjs';
/**
* Factory function to create a new Consola instance
*
* @param {Partial<ConsolaOptions & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link ConsolaOptions}.
* @returns {ConsolaInstance} A new Consola instance configured with the given options.
*/
declare function createConsola(options?: Partial<ConsolaOptions & {
fancy: boolean;
}>): ConsolaInstance;
/**
* Creates and exports a standard instance of Consola with the default configuration.
* This instance can be used directly for logging throughout the application.
*
* @type {ConsolaInstance} consola - The default instance of Consola.
*/
declare const consola: ConsolaInstance;
// @ts-ignore
export = consola;
export { ConsolaInstance, ConsolaOptions, consola, createConsola };
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_Q"},E:{"1":"_YB","2":"_k","16":"mB"},F:{"1":"_wJ","2":"_qC"},G:{"1":"_eB","16":"lC"},H:{"1":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"_CB","2":"A"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"document.head",D:true};
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Eye = createLucideIcon("Eye", [
[
"path",
{
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
key: "1nclc0"
}
],
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
]);
export { Eye as default };
//# sourceMappingURL=eye.js.map
@@ -0,0 +1,11 @@
import { Parser, Printer } from "../index.js";
export declare const parsers: {
css: Parser;
less: Parser;
scss: Parser;
};
export declare const printers: {
postcss: Printer;
};
@@ -0,0 +1,14 @@
"use client";
import { animations } from '../../motion/features/animations.mjs';
import { createDomVisualElement } from './create-visual-element.mjs';
/**
* @public
*/
const domMin = {
renderer: createDomVisualElement,
...animations,
};
export { domMin };
//# sourceMappingURL=features-min.mjs.map
@@ -0,0 +1,15 @@
import type { TSESTree } from '@typescript-eslint/utils';
import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util';
declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpectedThis", [({
capIsConstructor?: boolean;
} | undefined)?], unknown, {
ThisExpression(node: TSESTree.ThisExpression): void;
}>;
export type Options = InferOptionsTypeFromRule<typeof baseRule>;
export type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpectedThis", [({
capIsConstructor?: boolean;
} | undefined)?], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,17 @@
import { useStore } from '@tanstack/react-store'
import { isServer } from '@tanstack/router-core/isServer'
import { useRouter } from './useRouter'
export function useCanGoBack() {
const router = useRouter()
if (isServer ?? router.isServer) {
return router.stores.location.get().state.__TSR_index !== 0
}
// eslint-disable-next-line react-hooks/rules-of-hooks -- condition is static
return useStore(
router.stores.location,
(location) => location.state.__TSR_index !== 0,
)
}
@@ -0,0 +1 @@
{"version":3,"file":"umbrella.js","sources":["../../../src/icons/umbrella.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Umbrella\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMTJhMTAuMDYgMTAuMDYgMSAwIDAtMjAgMFoiIC8+CiAgPHBhdGggZD0iTTEyIDEydjhhMiAyIDAgMCAwIDQgMCIgLz4KICA8cGF0aCBkPSJNMTIgMnYxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/umbrella\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Umbrella = createLucideIcon('Umbrella', [\n ['path', { d: 'M22 12a10.06 10.06 1 0 0-20 0Z', key: '1teyop' }],\n ['path', { d: 'M12 12v8a2 2 0 0 0 4 0', key: 'ulpmoc' }],\n ['path', { d: 'M12 2v1', key: '11qlp1' }],\n]);\n\nexport default Umbrella;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,21 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../router.js");
//#region src/router/reg-exp-router/matcher.ts
const emptyParam = [];
function match(method, path) {
const matchers = this.buildAllMatchers();
const match = ((method, path) => {
const matcher = matchers[method] || matchers["ALL"];
const staticMatch = matcher[2][path];
if (staticMatch) return staticMatch;
const match = path.match(matcher[0]);
if (!match) return [[], emptyParam];
const index = match.indexOf("", 1);
return [matcher[1][index], match];
});
this.match = match;
return match(method, path);
}
//#endregion
exports.emptyParam = emptyParam;
exports.match = match;
@@ -0,0 +1,24 @@
import { Register } from './router.js';
import { AnyContext, AnyPathParams, AnyRoute, FileBaseRouteOptions, ResolveParams, Route, RouteConstraints, UpdatableRouteOptions } from './route.js';
import { AnyValidator } from './validators.js';
export interface FileRouteTypes {
fileRoutesByFullPath: any;
fullPaths: any;
to: any;
fileRoutesByTo: any;
id: any;
fileRoutesById: any;
}
export type InferFileRouteTypes<TRouteTree extends AnyRoute> = unknown extends TRouteTree['types']['fileRouteTypes'] ? never : TRouteTree['types']['fileRouteTypes'] extends FileRouteTypes ? TRouteTree['types']['fileRouteTypes'] : never;
export interface FileRoutesByPath {
}
export interface FileRouteOptions<TRegister, TFilePath extends string, TParentRoute extends AnyRoute, TId extends RouteConstraints['TId'], TPath extends RouteConstraints['TPath'], TFullPath extends RouteConstraints['TFullPath'], TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> extends FileBaseRouteOptions<TRegister, TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, AnyContext, TRouteContextFn, TBeforeLoadFn, AnyContext, TSSR, TServerMiddlewares, THandlers>, UpdatableRouteOptions<TParentRoute, TId, TFullPath, TParams, TSearchValidator, TLoaderFn, TLoaderDeps, AnyContext, TRouteContextFn, TBeforeLoadFn> {
}
export type CreateFileRoute<TFilePath extends string, TParentRoute extends AnyRoute, TId extends RouteConstraints['TId'], TPath extends RouteConstraints['TPath'], TFullPath extends RouteConstraints['TFullPath']> = <TRegister = Register, TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined>(options?: FileRouteOptions<TRegister, TFilePath, TParentRoute, TId, TPath, TFullPath, TSearchValidator, TParams, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TSSR, TServerMiddlewares, THandlers>) => Route<TRegister, TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchValidator, TParams, AnyContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown, TSSR, TServerMiddlewares, THandlers>;
export type LazyRouteOptions = Pick<UpdatableRouteOptions<AnyRoute, string, string, AnyPathParams, AnyValidator, {}, AnyContext, AnyContext, AnyContext, AnyContext>, 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent'>;
export interface LazyRoute<in out TRoute extends AnyRoute> {
options: {
id: string;
} & LazyRouteOptions;
}
export type CreateLazyFileRoute<TRoute extends AnyRoute> = (opts: LazyRouteOptions) => LazyRoute<TRoute>;
@@ -0,0 +1,221 @@
export default `tlf2a 2 3 6 -1 15 0 0 0
===============================================================================
This is smbraille.tlf", or “Small Braille”, by Sam Hocevar <sam@hocevar.net>.
It was created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % & * + , : ; < > ?
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@@
⡇!
⠅!!
⠃⠃"
""
@
#@@
@
$@@
@
%@@
@
&@@
⠃'
''
⡔⠁(
⠣⡀((
⠈⢢)
⢀⠜))
@
*@@
@
+@@
@
,@@
-
⠉⠉--
.
⠶..
⡜/
⠎ //
⣎⣵0
⠫⠜00
⢺ 1
⠼⠄11
⠊⡱2
⠮⠤22
⢉⡹3
⠤⠜33
⢇⣸4
⠸44
⣏⡉5
⠤⠜55
⣎⡁8
⠣⠜88
⠉⡹7
⠸ 77
⢎⡱8
⠣⠜88
⢎⣱9
⠠⠜99
@
:@@
@
;@@
@
<@@
⣀⣀=
⠒⠒==
@
>@@
@
?@@
⣎⣱@
⠫⠥@@
⣎⣱A
⠇⠸AA
⣏⡱B
⠧⠜BB
⡎⠑C
⠣⠔CC
⡏⢱D
⠧⠜DD
⣏⡉E
⠧⠤EE
⣏⡉F
⠇ FF
⡎⠑G
⠣⠝GG
⣇⣸H
⠇⠸HH
⡇I
⠇II
⠈⢹J
⠣⠜JJ
⣇⠜K
⠇⠱KK
⡇ L
⠧⠤LL
⡷⢾M
⠇⠸MM
⡷⣸N
⠇⠹NN
⡎⢱O
⠣⠜OO
⣏⡱P
⠇ PP
⡎⢱Q
⠣⠪QQ
⣏⡱R
⠇⠱RR
⢎⡑S
⠢⠜SS
⢹⠁T
⠸ TT
⡇⢸U
⠣⠜UU
⡇⢸V
⠸⠃VV
⡇⢸W
⠟⠻WW
⢇⡸X
⠇⠸XX
⢇⢸Y
⠇YY
⢉⠝Z
⠮⠤ZZ
⡏[
⣇[[
⢣ \\
⠱\\\\
⢹]
⣸]]
⠊⠂^
^^
_
⠤⠤__
⠑\`
\`\`
⢀⣀a
⠣⠼aa
⣇⡀b
⠧⠜bb
⢀⣀c
⠣⠤cc
⢀⣸d
⠣⠼dd
⢀⡀e
⠣⠭ee
⣰⡁f
⢸ ff
⢀⡀g
⣑⡺gg
⣇⡀h
⠇⠸hh
⠄i
⠇ii
⠠j
⡸jj
⡇⡠k
⠏⠢kk
⡇l
⠣ll
⣀⣀ m
⠇⠇⠇mm
⣀⡀n
⠇⠸nn
⢀⡀o
⠣⠜oo
⣀⡀p
⡧⠜pp
⢀⣀q
⠣⢼qq
⡀⣀r
⠏ rr
⢀⣀s
⠭⠕ss
⣰⡀t
⠘⠤tt
⡀⢀u
⠣⠼uu
⡀⢀v
⠱⠃vv
⡀ ⢀w
⠱⠱⠃ww
⡀⢀x
⠜⠣xx
⡀⢀y
⣑⡺yy
⣀⣀z
⠴⠥zz
⡰⠁{
⠘⠄{{
⡇|
⠇||
⠈⢆}
⠠⠃}}
⡠⡠~
~~
⣕⣪Ä
⠇⠸ÄÄ
⡕⢪Ö
⠣⠜ÖÖ
⡅⢨Ü
⠣⠜ÜÜ
⢂⣐ä
⠣⠼ää
⢂⡐ö
⠣⠜öö
⡂⢐ü
⠣⠼üü
⡔⡢ß
⡇⠜ßß
`
@@ -0,0 +1,280 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_jsx_constants = require("../constants.js");
const require_jsx_dom_render = require("../dom/render.js");
//#region src/jsx/hooks/index.ts
const STASH_SATE = 0;
const STASH_EFFECT = 1;
const STASH_CALLBACK = 2;
const STASH_MEMO = 3;
const STASH_REF = 4;
const resolvedPromiseValueMap = /* @__PURE__ */ new WeakMap();
const isDepsChanged = (prevDeps, deps) => !prevDeps || !deps || prevDeps.length !== deps.length || deps.some((dep, i) => dep !== prevDeps[i]);
let viewTransitionState = void 0;
const documentStartViewTransition = (cb) => {
if (document?.startViewTransition) return document.startViewTransition(cb);
else {
cb();
return { finished: Promise.resolve() };
}
};
let updateHook = void 0;
const viewTransitionHook = (context, node, cb) => {
const state = [true, false];
let lastVC = node.vC;
return documentStartViewTransition(() => {
if (lastVC === node.vC) {
viewTransitionState = state;
cb(context);
viewTransitionState = void 0;
lastVC = node.vC;
}
}).finished.then(() => {
if (state[1] && lastVC === node.vC) {
state[0] = false;
viewTransitionState = state;
cb(context);
viewTransitionState = void 0;
}
});
};
const startViewTransition = (callback) => {
updateHook = viewTransitionHook;
try {
callback();
} finally {
updateHook = void 0;
}
};
const useViewTransition = () => {
if (!require_jsx_dom_render.buildDataStack.at(-1)) return [false, () => {}];
if (viewTransitionState) viewTransitionState[1] = true;
return [!!viewTransitionState?.[0], startViewTransition];
};
const pendingStack = [];
const runCallback = (type, callback) => {
let resolve;
const promise = new Promise((r) => resolve = r);
pendingStack.push([type, promise]);
try {
const res = callback();
if (res instanceof Promise) res.then(resolve, resolve);
else resolve();
} finally {
pendingStack.pop();
}
};
const startTransition = (callback) => {
runCallback(1, callback);
};
const startTransitionHook = (callback) => {
runCallback(2, callback);
};
const useTransition = () => {
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) return [false, () => {}];
const [error, setError] = useState();
const [state, updateState] = useState();
if (error) throw error[0];
const startTransitionLocalHook = useCallback((callback) => {
startTransitionHook(() => {
updateState((state) => !state);
let res = callback();
if (res instanceof Promise) res = res.catch((e) => {
setError([e]);
});
return res;
});
}, [state]);
const [context] = buildData;
return [context[0] === 2, startTransitionLocalHook];
};
const useDeferredValue = (value, ...rest) => {
const [values, setValues] = useState(rest.length ? [rest[0], rest[0]] : [value, value]);
if (Object.is(values[1], value)) return values[1];
pendingStack.push([3, Promise.resolve()]);
updateHook = async (context, _, cb) => {
cb(context);
values[0] = value;
};
setValues([values[0], value]);
updateHook = void 0;
pendingStack.pop();
return values[0];
};
const useState = (initialState) => {
const resolveInitialState = () => typeof initialState === "function" ? initialState() : initialState;
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) return [resolveInitialState(), () => {}];
const [, node] = buildData;
const stateArray = node[require_jsx_constants.DOM_STASH][1][STASH_SATE] ||= [];
const hookIndex = node[require_jsx_constants.DOM_STASH][0]++;
return stateArray[hookIndex] ||= [resolveInitialState(), (newState) => {
const localUpdateHook = updateHook;
const stateData = stateArray[hookIndex];
if (typeof newState === "function") newState = newState(stateData[0]);
if (!Object.is(newState, stateData[0])) {
stateData[0] = newState;
if (pendingStack.length) {
const [pendingType, pendingPromise] = pendingStack.at(-1);
Promise.all([pendingType === 3 ? node : require_jsx_dom_render.update([
pendingType,
false,
localUpdateHook
], node), pendingPromise]).then(([node]) => {
if (!node || !(pendingType === 2 || pendingType === 3)) return;
const lastVC = node.vC;
const addUpdateTask = () => {
setTimeout(() => {
if (lastVC !== node.vC) return;
require_jsx_dom_render.update([
pendingType === 3 ? 1 : 0,
false,
localUpdateHook
], node);
});
};
requestAnimationFrame(addUpdateTask);
});
} else require_jsx_dom_render.update([
0,
false,
localUpdateHook
], node);
}
}];
};
const useReducer = (reducer, initialArg, init) => {
const handler = useCallback((action) => {
setState((state) => reducer(state, action));
}, [reducer]);
const [state, setState] = useState(() => init ? init(initialArg) : initialArg);
return [state, handler];
};
const useEffectCommon = (index, effect, deps) => {
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) return;
const [, node] = buildData;
const effectDepsArray = node[require_jsx_constants.DOM_STASH][1][1] ||= [];
const hookIndex = node[require_jsx_constants.DOM_STASH][0]++;
const [prevDeps, , prevCleanup] = effectDepsArray[hookIndex] ||= [];
if (isDepsChanged(prevDeps, deps)) {
if (prevCleanup) prevCleanup();
const runner = () => {
data[index] = void 0;
data[2] = effect();
};
const data = [
deps,
void 0,
void 0,
void 0,
void 0
];
data[index] = runner;
effectDepsArray[hookIndex] = data;
}
};
const useEffect = (effect, deps) => useEffectCommon(3, effect, deps);
const useLayoutEffect = (effect, deps) => useEffectCommon(1, effect, deps);
const useInsertionEffect = (effect, deps) => useEffectCommon(4, effect, deps);
const useCallback = (callback, deps) => {
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) return callback;
const [, node] = buildData;
const callbackArray = node[require_jsx_constants.DOM_STASH][1][STASH_CALLBACK] ||= [];
const hookIndex = node[require_jsx_constants.DOM_STASH][0]++;
const prevDeps = callbackArray[hookIndex];
if (isDepsChanged(prevDeps?.[1], deps)) callbackArray[hookIndex] = [callback, deps];
else callback = callbackArray[hookIndex][0];
return callback;
};
function useRef(initialValue) {
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) return { current: initialValue };
const [, node] = buildData;
const refArray = node[require_jsx_constants.DOM_STASH][1][STASH_REF] ||= [];
const hookIndex = node[require_jsx_constants.DOM_STASH][0]++;
return refArray[hookIndex] ||= { current: initialValue };
}
const use = (promise) => {
const cachedRes = resolvedPromiseValueMap.get(promise);
if (cachedRes) {
if (cachedRes.length === 2) throw cachedRes[1];
return cachedRes[0];
}
promise.then((res) => resolvedPromiseValueMap.set(promise, [res]), (e) => resolvedPromiseValueMap.set(promise, [void 0, e]));
throw promise;
};
const useMemo = (factory, deps) => {
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) return factory();
const [, node] = buildData;
const memoArray = node[require_jsx_constants.DOM_STASH][1][STASH_MEMO] ||= [];
const hookIndex = node[require_jsx_constants.DOM_STASH][0]++;
const prevDeps = memoArray[hookIndex];
if (isDepsChanged(prevDeps?.[1], deps)) memoArray[hookIndex] = [factory(), deps];
return memoArray[hookIndex][0];
};
let idCounter = 0;
const useId = () => useMemo(() => `:r${(idCounter++).toString(32)}:`, []);
const useDebugValue = (_value, _formatter) => {};
const createRef = () => {
return { current: null };
};
const forwardRef = (Component) => {
return (props) => {
const { ref, ...rest } = props;
return Component(rest, ref);
};
};
const useImperativeHandle = (ref, createHandle, deps) => {
useEffect(() => {
ref.current = createHandle();
return () => {
ref.current = null;
};
}, deps);
};
const useSyncExternalStore = (subscribe, getSnapshot, getServerSnapshot) => {
const buildData = require_jsx_dom_render.buildDataStack.at(-1);
if (!buildData) {
if (!getServerSnapshot) throw new Error("getServerSnapshot is required for server side rendering");
return getServerSnapshot();
}
const snapshot = buildData[0][4] && getServerSnapshot ? getServerSnapshot() : getSnapshot();
const [, setVersion] = useState(0);
const latestSnapshot = useRef([snapshot, getSnapshot]);
latestSnapshot.current = [snapshot, getSnapshot];
const unsubscribeRef = useRef(null);
useEffect(() => {
const update = () => setVersion((version) => version + 1);
unsubscribeRef.current?.();
unsubscribeRef.current = subscribe(update);
const [snapshot, getSnapshot] = latestSnapshot.current;
if (!Object.is(snapshot, getSnapshot())) update();
}, [subscribe]);
useEffect(() => () => unsubscribeRef.current?.(), []);
return snapshot;
};
//#endregion
exports.STASH_EFFECT = STASH_EFFECT;
exports.createRef = createRef;
exports.forwardRef = forwardRef;
exports.startTransition = startTransition;
exports.startViewTransition = startViewTransition;
exports.use = use;
exports.useCallback = useCallback;
exports.useDebugValue = useDebugValue;
exports.useDeferredValue = useDeferredValue;
exports.useEffect = useEffect;
exports.useId = useId;
exports.useImperativeHandle = useImperativeHandle;
exports.useInsertionEffect = useInsertionEffect;
exports.useLayoutEffect = useLayoutEffect;
exports.useMemo = useMemo;
exports.useReducer = useReducer;
exports.useRef = useRef;
exports.useState = useState;
exports.useSyncExternalStore = useSyncExternalStore;
exports.useTransition = useTransition;
exports.useViewTransition = useViewTransition;
@@ -0,0 +1,44 @@
{
"name": "cookie",
"description": "HTTP server cookie parsing and serialization",
"version": "0.7.2",
"author": "Roman Shtylman <shtylman@gmail.com>",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>"
],
"license": "MIT",
"keywords": [
"cookie",
"cookies"
],
"repository": "jshttp/cookie",
"devDependencies": {
"beautify-benchmark": "0.2.4",
"benchmark": "2.1.4",
"eslint": "8.53.0",
"eslint-plugin-markdown": "3.0.1",
"mocha": "10.2.0",
"nyc": "15.1.0",
"safe-buffer": "5.2.1",
"top-sites": "1.1.194"
},
"files": [
"HISTORY.md",
"LICENSE",
"README.md",
"SECURITY.md",
"index.js"
],
"main": "index.js",
"engines": {
"node": ">= 0.6"
},
"scripts": {
"bench": "node benchmark/index.js",
"lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"update-bench": "node scripts/update-benchmark.js"
}
}
@@ -0,0 +1,116 @@
import { statSync } from "node:fs";
import { parse, relative, join } from "node:path";
import { isObject } from "is-what-type";
import { glob } from "tinyglobby";
import { logFactory, banner, sleep, displayTime, toAbsolutePath } from "vp-runtime-helper";
import { readFile } from "node:fs/promises";
import { inspect } from "node:util";
import { copy, outputFile } from "fs-extra";
const name = "vite-plugin-cp";
const PLUGIN_NAME = name;
const logger = logFactory.getLogger(PLUGIN_NAME);
function stringify(value) {
return inspect(value, { breakLength: Infinity });
}
function changeName(name2, rename) {
if (typeof rename === "function") {
return rename(name2) || name2;
}
return rename || name2;
}
function makeCopy(transform) {
return typeof transform === "function" ? function(from, to) {
return readFile(from).then((buf) => transform(buf, from)).then((data) => {
return outputFile(to, data);
});
} : copy;
}
async function doCopy(config, cwd, globOptions, copyOptions) {
const { src, rename, flatten, transform } = config;
let { dest } = config;
if (!src || !dest) {
throw new Error(`${stringify(config)} target must have "src" and "dest" properties.`);
}
dest = toAbsolutePath(dest, cwd);
const cpFile = makeCopy(transform);
const run = async (source) => {
const absSource = toAbsolutePath(source, cwd);
let isNotFlatten = false;
try {
isNotFlatten = statSync(absSource).isDirectory() && !flatten;
} catch (e) {
}
const matchedPaths = await glob(absSource, globOptions);
if (!matchedPaths.length) {
logger.warn(`Could not find files with "${source}".`);
return null;
}
await Promise.all(matchedPaths.map((matchedPath) => {
let targetFileName;
let destDir = dest;
if (isNotFlatten) {
const tmp = parse(relative(absSource, matchedPath));
targetFileName = tmp.base;
destDir = join(destDir, tmp.dir);
} else {
targetFileName = parse(matchedPath).base;
}
const destPath = join(destDir, changeName(targetFileName, rename));
return cpFile(matchedPath, destPath, copyOptions).then(() => {
logger.trace(`Copied "${matchedPath}" to "${destPath}".`);
}, (e) => {
logger.warn(`Could not copy "${matchedPath}" to "${destPath}".`, e);
});
}));
};
if (typeof src === "string") {
await run(src);
} else if (Array.isArray(src)) {
await Promise.all(src.map(run));
}
}
function pluginCp(opts) {
const { hook = "closeBundle", enforce, targets, cwd = process.cwd(), globOptions, copyOptions, logLevel, delay, enableBanner } = opts || {};
if (!Array.isArray(targets) || !targets.length) {
logger.warn("No targets specified.");
return;
}
if (enableBanner) {
banner(PLUGIN_NAME);
}
if (logLevel) {
logger.level = logLevel;
}
const plugin = {
name: PLUGIN_NAME
};
if (enforce) {
plugin.enforce = enforce;
}
let called = false;
plugin[hook] = async function() {
if (called) {
return;
}
if (delay !== void 0) {
await sleep(delay);
}
called = true;
const startTime = Date.now();
await Promise.all(targets.map((target) => {
if (!isObject(target)) {
throw new TypeError(`${stringify(target)} target must be an object`);
}
return doCopy(target, cwd, Object.assign({}, globOptions, target.globOptions, {
absolute: true,
expandDirectories: true,
onlyFiles: true
}), Object.assign({}, copyOptions, target.copyOptions));
}));
logger.info(`Done in ${displayTime(Date.now() - startTime)}`);
};
return plugin;
}
export {
pluginCp as default
};
@@ -0,0 +1,7 @@
"use strict";
const constants = require("./constants-DR3SPJ7u.js");
const addMilliseconds = require("./addMilliseconds.js");
function addMinutes(date, minutes) {
return addMilliseconds(date, minutes * constants.MS_IN_MINUTE);
}
module.exports = addMinutes;
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './circle-chevron-up.js';
//# sourceMappingURL=chevron-up-circle.js.map
@@ -0,0 +1 @@
{"version":3,"file":"images.js","sources":["../../../src/icons/images.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Images\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggMjJINGEyIDIgMCAwIDEtMi0yVjYiIC8+CiAgPHBhdGggZD0ibTIyIDEzLTEuMjk2LTEuMjk2YTIuNDEgMi40MSAwIDAgMC0zLjQwOCAwTDExIDE4IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iMiIgLz4KICA8cmVjdCB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHg9IjYiIHk9IjIiIHJ4PSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/images\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Images = createLucideIcon('Images', [\n ['path', { d: 'M18 22H4a2 2 0 0 1-2-2V6', key: 'pblm9e' }],\n ['path', { d: 'm22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18', key: 'nf6bnh' }],\n ['circle', { cx: '12', cy: '8', r: '2', key: '1822b1' }],\n ['rect', { width: '16', height: '16', x: '6', y: '2', rx: '2', key: '12espp' }],\n]);\n\nexport default Images;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjF,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,2 @@
const e=(e,t,n)=>n>t?t:n<e?e:n;function t(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let n=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={};function o(e){return"object"==typeof e&&null!==e}const i=e=>e,a=(e,t)=>n=>t(e(n)),c=(...e)=>e.reduce(a),l=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};const u=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function f(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=u.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(c.schedule(t),e()),t(i)}const c={schedule:(e,s=!1,i=!1)=>{const a=i&&r?t:n;return s&&o.add(e),a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(i=e,r)return void(s=!0);r=!0;const o=t;t=n,n=o,t.forEach(a),t.clear(),r=!1,s&&(s=!1,c.process(e))}};return c}(i),e),{}),{setup:c,read:l,resolveKeyframes:f,preUpdate:d,update:g,preRender:h,render:p,postRender:m}=a,v=()=>{const i=s.useManualTiming,a=i?o.timestamp:performance.now();n=!1,i||(o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1)),o.timestamp=a,o.isProcessing=!0,c.process(o),l.process(o),f.process(o),d.process(o),g.process(o),h.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:u.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(v)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;t<u.length;t++)a[u[t]].cancel(e)},state:o,steps:a}}const{schedule:d,cancel:g,state:h}=f("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:i,!0),p=(e=>t=>"string"==typeof t&&t.startsWith(e))("var(--"),m=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,v={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},y={...v,transform:t=>e(0,1,t)},w=e=>Math.round(1e5*e)/1e5,b=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const x=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,E=(e,t)=>n=>Boolean("string"==typeof n&&x.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),W=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(b);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},L={...v,transform:t=>Math.round((t=>e(0,255,t))(t))},A={test:E("rgb","red"),parse:W("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+L.transform(e)+", "+L.transform(t)+", "+L.transform(n)+", "+w(y.transform(r))+")"};const S={test:E("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:A.transform},M=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),B={test:E("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+M.transform(w(t))+", "+M.transform(w(n))+", "+w(y.transform(r))+")"},T={test:e=>A.test(e)||S.test(e)||B.test(e),parse:e=>A.test(e)?A.parse(e):B.test(e)?B.parse(e):S.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?A.transform(e):B.transform(e),getAnimatableNone:e=>{const t=T.parse(e);return t.alpha=0,T.transform(t)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const O="number",H="color",z=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function F(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(z,e=>(T.test(e)?(r.color.push(o),s.push(H),n.push(T.parse(e))):e.startsWith("var(")?(r.var.push(o),s.push("var"),n.push(e)):(r.number.push(o),s.push(O),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:s}}function N({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],void 0!==r[o]){const e=t[o];s+=e===O?w(r[o]):e===H?T.transform(r[o]):r[o]}return s}}const k=(e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:T.test(n)?T.getAnimatableNone(n):n;var n};const P={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(b)?.length||0)+(e.match($)?.length||0)>0},parse:function(e){return F(e).valLine truncated
//# sourceMappingURL=size-rollup-scroll.js.map
@@ -0,0 +1,22 @@
import { getBunServer } from "./server.js";
//#region src/adapter/bun/conninfo.ts
/**
* Get ConnInfo with Bun
* @param c Context
* @returns ConnInfo
* @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead.
*/
const getConnInfo = (c) => {
const server = getBunServer(c);
if (!server) throw new TypeError("env has to include the 2nd argument of fetch.");
if (typeof server.requestIP !== "function") throw new TypeError("server.requestIP is not a function.");
const info = server.requestIP(c.req.raw);
if (!info) return { remote: {} };
return { remote: {
address: info.address,
addressType: info.family === "IPv6" || info.family === "IPv4" ? info.family : void 0,
port: info.port
} };
};
//#endregion
export { getConnInfo };
@@ -0,0 +1,98 @@
//#region src/router.d.ts
/**
* @module
* This module provides types definitions and variables for the routers.
*/
/**
* Constant representing all HTTP methods in uppercase.
*/
export declare const METHOD_NAME_ALL: "ALL";
/**
* Constant representing all HTTP methods in lowercase.
*/
export declare const METHOD_NAME_ALL_LOWERCASE: "all";
/**
* Array of supported HTTP methods.
*/
export declare const METHODS: readonly ["get", "post", "put", "delete", "options", "patch", "query"];
/**
* Error message indicating that a route cannot be added because the matcher is already built.
*/
export declare const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
/**
* Interface representing a router.
*
* @template T - The type of the handler.
*/
export interface Router<T> {
/**
* The name of the router.
*/
name: string;
/**
* Adds a route to the router.
*
* @param method - The HTTP method (e.g., 'get', 'post').
* @param path - The path for the route.
* @param handler - The handler for the route.
*/
add(method: string, path: string, handler: T): void;
/**
* Matches a route based on the given method and path.
*
* @param method - The HTTP method (e.g., 'get', 'post').
* @param path - The path to match.
* @returns The result of the match.
*/
match(method: string, path: string): Result<T>;
}
/**
* Type representing a map of parameter indices.
*/
export type ParamIndexMap = Record<string, number>;
/**
* Type representing a stash of parameters.
*/
export type ParamStash = string[];
/**
* Type representing a map of parameters.
*/
export type Params = Record<string, string>;
/**
* Type representing the result of a route match.
*
* The result can be in one of two formats:
* 1. An array of handlers with their corresponding parameter index maps, followed by a parameter stash.
* 2. An array of handlers with their corresponding parameter maps.
*
* Example:
*
* [[handler, paramIndexMap][], paramArray]
* ```typescript
* [
* [
* [middlewareA, {}], // '*'
* [funcA, {'id': 0}], // '/user/:id/*'
* [funcB, {'id': 0, 'action': 1}], // '/user/:id/:action'
* ],
* ['123', 'abc']
* ]
* ```
*
* [[handler, params][]]
* ```typescript
* [
* [
* [middlewareA, {}], // '*'
* [funcA, {'id': '123'}], // '/user/:id/*'
* [funcB, {'id': '123', 'action': 'abc'}], // '/user/:id/:action'
* ]
* ]
* ```
*/
export type Result<T> = [[T, ParamIndexMap][], ParamStash] | [[T, Params][]];
/**
* Error class representing an unsupported path error.
*/
export declare class UnsupportedPathError extends Error {}
//#endregion
@@ -0,0 +1,47 @@
{
"name": "tslib",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "2.8.1",
"license": "0BSD",
"description": "Runtime library for TypeScript helper functions",
"keywords": [
"TypeScript",
"Microsoft",
"compiler",
"language",
"javascript",
"tslib",
"runtime"
],
"bugs": {
"url": "https://github.com/Microsoft/TypeScript/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/tslib.git"
},
"main": "tslib.js",
"module": "tslib.es6.js",
"jsnext:main": "tslib.es6.js",
"typings": "tslib.d.ts",
"sideEffects": false,
"exports": {
".": {
"module": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
},
"import": {
"node": "./modules/index.js",
"default": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
}
},
"default": "./tslib.js"
},
"./*": "./*",
"./": "./"
}
}
@@ -0,0 +1,76 @@
{
"name": "dunder-proto",
"version": "1.0.1",
"description": "If available, the `Object.prototype.__proto__` accessor and mutator, call-bound",
"main": false,
"exports": {
"./get": "./get.js",
"./set": "./set.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"prelint": "evalmd README.md",
"lint": "eslint --ext=.js,.mjs .",
"postlint": "tsc -p . && attw -P",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "npx npm@'>= 10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/es-shims/dunder-proto.git"
},
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/es-shims/dunder-proto/issues"
},
"homepage": "https://github.com/es-shims/dunder-proto#readme",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/tape": "^5.7.0",
"auto-changelog": "^2.5.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"testling": {
"files": "test/index.js"
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,431 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PathError = exports.TokenData = void 0;
exports.parse = parse;
exports.compile = compile;
exports.match = match;
exports.pathToRegexp = pathToRegexp;
exports.stringify = stringify;
const DEFAULT_DELIMITER = "/";
const NOOP_VALUE = (value) => value;
const ID_START = /^[$_\p{ID_Start}]$/u;
const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u;
const ID = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
/**
* Escape text for stringify to path.
*/
function escapeText(str) {
return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
}
/**
* Escape a regular expression string.
*/
function escape(str) {
return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
}
/**
* Tokenized path instance.
*/
class TokenData {
constructor(tokens, originalPath) {
this.tokens = tokens;
this.originalPath = originalPath;
}
}
exports.TokenData = TokenData;
/**
* ParseError is thrown when there is an error processing the path.
*/
class PathError extends TypeError {
constructor(message, originalPath) {
let text = message;
if (originalPath)
text += `: ${originalPath}`;
text += `; visit https://git.new/pathToRegexpError for info`;
super(text);
this.originalPath = originalPath;
}
}
exports.PathError = PathError;
/**
* Parse a string for the raw tokens.
*/
function parse(str, options = {}) {
const { encodePath = NOOP_VALUE } = options;
const chars = [...str];
let index = 0;
function consumeUntil(end) {
const output = [];
let path = "";
function writePath() {
if (!path)
return;
output.push({
type: "text",
value: encodePath(path),
});
path = "";
}
while (index < chars.length) {
const value = chars[index++];
if (value === end) {
writePath();
return output;
}
if (value === "\\") {
if (index === chars.length) {
throw new PathError(`Unexpected end after \\ at index ${index}`, str);
}
path += chars[index++];
continue;
}
if (value === ":" || value === "*") {
const type = value === ":" ? "param" : "wildcard";
let name = "";
if (ID_START.test(chars[index])) {
do {
name += chars[index++];
} while (ID_CONTINUE.test(chars[index]));
}
else if (chars[index] === '"') {
let quoteStart = index;
while (index < chars.length) {
if (chars[++index] === '"') {
index++;
quoteStart = 0;
break;
}
// Increment over escape characters.
if (chars[index] === "\\")
index++;
name += chars[index];
}
if (quoteStart) {
throw new PathError(`Unterminated quote at index ${quoteStart}`, str);
}
}
if (!name) {
throw new PathError(`Missing parameter name at index ${index}`, str);
}
writePath();
output.push({ type, name });
continue;
}
if (value === "{") {
writePath();
output.push({
type: "group",
tokens: consumeUntil("}"),
});
continue;
}
if (value === "}" ||
value === "(" ||
value === ")" ||
value === "[" ||
value === "]" ||
value === "+" ||
value === "?" ||
value === "!") {
throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);
}
path += value;
}
if (end) {
throw new PathError(`Unexpected end at index ${index}, expected ${end}`, str);
}
writePath();
return output;
}
return new TokenData(consumeUntil(""), str);
}
/**
* Compile a string to a template function for the path.
*/
function compile(path, options = {}) {
const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
const data = typeof path === "object" ? path : parse(path, options);
const fn = tokensToFunction(data.tokens, delimiter, encode);
return function path(params = {}) {
const missing = [];
const path = fn(params, missing);
if (missing.length) {
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
}
return path;
};
}
function tokensToFunction(tokens, delimiter, encode) {
const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));
return (data, missing) => {
let result = "";
for (const encoder of encoders) {
result += encoder(data, missing);
}
return result;
};
}
/**
* Convert a single token into a path building function.
*/
function tokenToFunction(token, delimiter, encode) {
if (token.type === "text")
return () => token.value;
if (token.type === "group") {
const fn = tokensToFunction(token.tokens, delimiter, encode);
return (data, missing) => {
const len = missing.length;
const value = fn(data, missing);
if (missing.length === len)
return value;
missing.length = len; // Reset optional group.
return "";
};
}
const encodeValue = encode || NOOP_VALUE;
if (token.type === "wildcard" && encode !== false) {
return (data, missing) => {
const value = data[token.name];
if (value == null) {
missing.push(token.name);
return "";
}
if (!Array.isArray(value) || value.length === 0) {
throw new TypeError(`Expected "${token.name}" to be a non-empty array`);
}
let result = "";
for (let i = 0; i < value.length; i++) {
if (typeof value[i] !== "string") {
throw new TypeError(`Expected "${token.name}/${i}" to be a string`);
}
if (i > 0)
result += delimiter;
result += encodeValue(value[i]);
}
return result;
};
}
return (data, missing) => {
const value = data[token.name];
if (value == null) {
missing.push(token.name);
return "";
}
if (typeof value !== "string") {
throw new TypeError(`Expected "${token.name}" to be a string`);
}
return encodeValue(value);
};
}
/**
* Transform a path into a match function.
*/
function match(path, options = {}) {
const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
const { regexp, keys } = pathToRegexp(path, options);
const decoders = keys.map((key) => {
if (decode === false)
return NOOP_VALUE;
if (key.type === "param")
return decode;
return (value) => value.split(delimiter).map(decode);
});
return function match(input) {
const m = regexp.exec(input);
if (!m)
return false;
const path = m[0];
const params = Object.create(null);
for (let i = 1; i < m.length; i++) {
if (m[i] === undefined)
continue;
const key = keys[i - 1];
const decoder = decoders[i - 1];
params[key.name] = decoder(m[i]);
}
return { path, params };
};
}
/**
* Transform a path into a regular expression and capture keys.
*/
function pathToRegexp(path, options = {}) {
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;
const keys = [];
let source = "";
let combinations = 0;
function process(path) {
if (Array.isArray(path)) {
for (const p of path)
process(p);
return;
}
const data = typeof path === "object" ? path : parse(path, options);
flatten(data.tokens, 0, [], (tokens) => {
if (combinations >= 256) {
throw new PathError("Too many path combinations", data.originalPath);
}
if (combinations > 0)
source += "|";
source += toRegExpSource(tokens, delimiter, keys, data.originalPath);
combinations++;
});
}
process(path);
let pattern = `^(?:${source})`;
if (trailing)
pattern += "(?:" + escape(delimiter) + "$)?";
pattern += end ? "$" : "(?=" + escape(delimiter) + "|$)";
return { regexp: new RegExp(pattern, sensitive ? "" : "i"), keys };
}
/**
* Generate a flat list of sequence tokens from the given tokens.
*/
function flatten(tokens, index, result, callback) {
while (index < tokens.length) {
const token = tokens[index++];
if (token.type === "group") {
const len = result.length;
flatten(token.tokens, 0, result, (seq) => flatten(tokens, index, seq, callback));
result.length = len;
continue;
}
result.push(token);
}
callback(result);
}
/**
* Transform a flat sequence of tokens into a regular expression.
*/
function toRegExpSource(tokens, delimiter, keys, originalPath) {
let result = "";
let backtrack = "";
let wildcardBacktrack = "";
let prevCaptureType = 0;
let hasSegmentCapture = 0;
let index = 0;
function hasInSegment(index, type) {
while (index < tokens.length) {
const token = tokens[index++];
if (token.type === type)
return true;
if (token.type === "text") {
if (token.value.includes(delimiter))
break;
}
}
return false;
}
function peekText(index) {
let result = "";
while (index < tokens.length) {
const token = tokens[index++];
if (token.type !== "text")
break;
result += token.value;
}
return result;
}
while (index < tokens.length) {
const token = tokens[index++];
if (token.type === "text") {
result += escape(token.value);
backtrack += token.value;
if (prevCaptureType === 2)
wildcardBacktrack += token.value;
if (token.value.includes(delimiter))
hasSegmentCapture = 0;
continue;
}
if (token.type === "param" || token.type === "wildcard") {
if (prevCaptureType && !backtrack) {
throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath);
}
if (token.type === "param") {
result +=
hasSegmentCapture & 2 // Seen wildcard in segment.
? `(${negate(delimiter, backtrack)}+)`
: hasInSegment(index, "wildcard") // See wildcard later in segment.
? `(${negate(delimiter, peekText(index))}+)`
: hasSegmentCapture & 1 // Seen parameter in segment.
? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`
: `(${negate(delimiter, "")}+)`;
hasSegmentCapture |= prevCaptureType = 1;
}
else {
result +=
hasSegmentCapture & 2 // Seen wildcard in segment.
? `(${negate(backtrack, "")}+)`
: wildcardBacktrack // No capture in segment, seen wildcard in path.
? `(${negate(wildcardBacktrack, "")}+|${negate(delimiter, "")}+)`
: `([^]+)`;
wildcardBacktrack = "";
hasSegmentCapture |= prevCaptureType = 2;
}
keys.push(token);
backtrack = "";
continue;
}
throw new TypeError(`Unknown token type: ${token.type}`);
}
return result;
}
/**
* Block backtracking on previous text/delimiter.
*/
function negate(a, b) {
if (b.length > a.length)
return negate(b, a); // Longest string first.
if (a === b)
b = ""; // Cleaner regex strings, no duplication.
if (b.length > 1)
return `(?:(?!${escape(a)}|${escape(b)})[^])`;
if (a.length > 1)
return `(?:(?!${escape(a)})[^${escape(b)}])`;
return `[^${escape(a + b)}]`;
}
/**
* Stringify an array of tokens into a path string.
*/
function stringifyTokens(tokens, index) {
let value = "";
while (index < tokens.length) {
const token = tokens[index++];
if (token.type === "text") {
value += escapeText(token.value);
continue;
}
if (token.type === "group") {
value += "{" + stringifyTokens(token.tokens, 0) + "}";
continue;
}
if (token.type === "param") {
value += ":" + stringifyName(token.name, tokens[index]);
continue;
}
if (token.type === "wildcard") {
value += "*" + stringifyName(token.name, tokens[index]);
continue;
}
throw new TypeError(`Unknown token type: ${token.type}`);
}
return value;
}
/**
* Stringify token data into a path string.
*/
function stringify(data) {
return stringifyTokens(data.tokens, 0);
}
/**
* Stringify a parameter name, escaping when it cannot be emitted directly.
*/
function stringifyName(name, next) {
if (!ID.test(name))
return JSON.stringify(name);
if ((next === null || next === void 0 ? void 0 : next.type) === "text" && ID_CONTINUE.test(next.value[0])) {
return JSON.stringify(name);
}
return name;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,80 @@
import type {
CodeKeywordDefinition,
ErrorObject,
KeywordErrorDefinition,
AnySchema,
} from "../../types"
import type {SchemaObjCxt} from "../../compile"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, checkStrictMode} from "../../compile/util"
export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema>
const error: KeywordErrorDefinition = {
message: ({params}) => str`must match "${params.ifClause}" schema`,
params: ({params}) => _`{failingKeyword: ${params.ifClause}}`,
}
const def: CodeKeywordDefinition = {
keyword: "if",
schemaType: ["object", "boolean"],
trackErrors: true,
error,
code(cxt: KeywordCxt) {
const {gen, parentSchema, it} = cxt
if (parentSchema.then === undefined && parentSchema.else === undefined) {
checkStrictMode(it, '"if" without "then" and "else" is ignored')
}
const hasThen = hasSchema(it, "then")
const hasElse = hasSchema(it, "else")
if (!hasThen && !hasElse) return
const valid = gen.let("valid", true)
const schValid = gen.name("_valid")
validateIf()
cxt.reset()
if (hasThen && hasElse) {
const ifClause = gen.let("ifClause")
cxt.setParams({ifClause})
gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause))
} else if (hasThen) {
gen.if(schValid, validateClause("then"))
} else {
gen.if(not(schValid), validateClause("else"))
}
cxt.pass(valid, () => cxt.error(true))
function validateIf(): void {
const schCxt = cxt.subschema(
{
keyword: "if",
compositeRule: true,
createErrors: false,
allErrors: false,
},
schValid
)
cxt.mergeEvaluated(schCxt)
}
function validateClause(keyword: string, ifClause?: Name): () => void {
return () => {
const schCxt = cxt.subschema({keyword}, schValid)
gen.assign(valid, schValid)
cxt.mergeValidEvaluated(schCxt, valid)
if (ifClause) gen.assign(ifClause, _`${keyword}`)
else cxt.setParams({ifClause: keyword})
}
}
},
}
function hasSchema(it: SchemaObjCxt, keyword: string): boolean {
const schema = it.schema[keyword]
return schema !== undefined && !alwaysValidSchema(it, schema)
}
export default def
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BookX = createLucideIcon("BookX", [
["path", { d: "m14.5 7-5 5", key: "dy991v" }],
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
],
["path", { d: "m9.5 7 5 5", key: "s45iea" }]
]);
export { BookX as default };
//# sourceMappingURL=book-x.js.map
@@ -0,0 +1,91 @@
# std-env
[![npm version](https://img.shields.io/npm/v/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env)
[![npm downloads](https://img.shields.io/npm/dm/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env)
[![bundle size](https://img.shields.io/bundlephobia/min/std-env/latest.svg?style=flat-square)](https://bundlephobia.com/result?p=std-env)
Runtime-agnostic JS utils for detecting environments, runtimes, CI providers, and AI coding agents.
## Runtime Detection
Detects the current JavaScript runtime based on global variables, following the [WinterCG Runtime Keys proposal](https://runtime-keys.proposal.wintercg.org/).
```ts
import { runtime, runtimeInfo } from "std-env";
console.log(runtime); // "" | "node" | "deno" | "bun" | "workerd" ...
console.log(runtimeInfo); // { name: "node" }
```
Individual named exports: `isNode`, `isBun`, `isDeno`, `isNetlify`, `isEdgeLight`, `isWorkerd`, `isFastly`
> [!NOTE]
> `isNode` is also `true` in Bun/Deno with Node.js compatibility mode. Use `runtime === "node"` for strict checks.
See [./src/runtimes.ts](./src/runtimes.ts) for the full list.
## Provider Detection
Detects the current CI/CD provider based on environment variables.
```ts
import { isCI, provider, providerInfo } from "std-env";
console.log({ isCI, provider, providerInfo });
// { isCI: true, provider: "github_actions", providerInfo: { name: "github_actions", ci: true } }
```
Use `detectProvider()` to re-run detection. See [./src/providers.ts](./src/providers.ts) for the full list.
## Agent Detection
Detects if the environment is running inside an AI coding agent.
```ts
import { isAgent, agent, agentInfo } from "std-env";
console.log({ isAgent, agent, agentInfo });
// { isAgent: true, agent: "claude", agentInfo: { name: "claude" } }
```
Set the `AI_AGENT` env var to explicitly specify the agent name. Use `detectAgent()` to re-run detection.
Supported agents: `cursor`, `claude`, `devin`, `replit`, `gemini`, `codex`, `auggie`, `opencode`, `kiro`, `goose`, `pi`
## Flags
```js
import { env, isDevelopment, isProduction } from "std-env";
```
| Export | Description |
| ------------------ | ------------------------------------------------------------ |
| `hasTTY` | stdout TTY is available |
| `hasWindow` | Global `window` is available |
| `isCI` | Running in CI |
| `isColorSupported` | Terminal color output supported |
| `isDebug` | `DEBUG` env var is set |
| `isDevelopment` | `NODE_ENV` is `dev`/`development` or `MODE` is `development` |
| `isLinux` | Linux platform |
| `isMacOS` | macOS (darwin) platform |
| `isMinimal` | `MINIMAL` env is set, CI, test, or no TTY |
| `isProduction` | `NODE_ENV` or `MODE` is `production` |
| `isTest` | `NODE_ENV` is `test` or `TEST` env is set |
| `isWindows` | Windows platform |
| `platform` | Value of `process.platform` |
| `nodeVersion` | Node.js version string (e.g. `"22.0.0"`) |
| `nodeMajorVersion` | Node.js major version number (e.g. `22`) |
See [./src/flags.ts](./src/flags.ts) for details.
## Environment
| Export | Description |
| --------- | ---------------------------------------------------- |
| `env` | Universal `process.env` (works across all runtimes) |
| `process` | Universal `process` shim (works across all runtimes) |
| `nodeENV` | Current `NODE_ENV` value (undefined if unset) |
## License
MIT
@@ -0,0 +1,22 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
export interface ZodMiniISODateTime extends schemas.ZodMiniStringFormat<"datetime"> {
_zod: core.$ZodISODateTimeInternals;
}
export declare const ZodMiniISODateTime: core.$constructor<ZodMiniISODateTime>;
export declare function datetime(params?: string | core.$ZodISODateTimeParams): ZodMiniISODateTime;
export interface ZodMiniISODate extends schemas.ZodMiniStringFormat<"date"> {
_zod: core.$ZodISODateInternals;
}
export declare const ZodMiniISODate: core.$constructor<ZodMiniISODate>;
export declare function date(params?: string | core.$ZodISODateParams): ZodMiniISODate;
export interface ZodMiniISOTime extends schemas.ZodMiniStringFormat<"time"> {
_zod: core.$ZodISOTimeInternals;
}
export declare const ZodMiniISOTime: core.$constructor<ZodMiniISOTime>;
export declare function time(params?: string | core.$ZodISOTimeParams): ZodMiniISOTime;
export interface ZodMiniISODuration extends schemas.ZodMiniStringFormat<"duration"> {
_zod: core.$ZodISODurationInternals;
}
export declare const ZodMiniISODuration: core.$constructor<ZodMiniISODuration>;
export declare function duration(params?: string | core.$ZodISODurationParams): ZodMiniISODuration;
@@ -0,0 +1 @@
{"version":3,"file":"delta-remove.mjs","sources":["../../../../src/projection/geometry/delta-remove.ts"],"sourcesContent":["import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,QAAiB,EAAA;IAEjB,KAAK,IAAI,SAAS;IAClB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC;AAEjD,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,WAAW,CAAC;IACxD;AAEA,IAAA,OAAO,KAAK;AAChB;AAEA;;AAEG;AACG,SAAU,eAAe,CAC3B,IAAU,EACV,SAAA,GAA6B,CAAC,EAC9B,KAAA,GAAgB,CAAC,EACjB,MAAA,GAAiB,GAAG,EACpB,QAAiB,EACjB,aAAmB,IAAI,EACvB,aAAmB,IAAI,EAAA;AAEvB,IAAA,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AACzB,QAAA,SAAS,GAAG,UAAU,CAAC,SAAmB,CAAC;AAC3C,QAAA,MAAM,gBAAgB,GAAG,SAAS,CAC9B,UAAU,CAAC,GAAG,EACd,UAAU,CAAC,GAAG,EACd,SAAS,GAAG,GAAG,CAClB;AACD,QAAA,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC,GAAG;IACjD;IAEA,IAAI,OAAO,SAAS,KAAK,QAAQ;QAAE;AAEnC,IAAA,IAAI,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;IACnE,IAAI,IAAI,KAAK,UAAU;QAAE,WAAW,IAAI,SAAS;AAEjD,IAAA,IAAI,CAAC,GAAG,GAAG,gBAAgB,CACvB,IAAI,CAAC,GAAG,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,CACX;AAED,IAAA,IAAI,CAAC,GAAG,GAAG,gBAAgB,CACvB,IAAI,CAAC,GAAG,EACR,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,CACX;AACL;AAEA;;;AAGG;SACa,oBAAoB,CAChC,IAAU,EACV,UAA0B,EAC1B,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAW,EACpC,MAAa,EACb,UAAiB,EAAA;IAEjB,eAAe,CACX,IAAI,EACJ,UAAU,CAAC,GAAG,CAAW,EACzB,UAAU,CAAC,QAAQ,CAAW,EAC9B,UAAU,CAAC,SAAS,CAAW,EAC/B,UAAU,CAAC,KAAe,EAC1B,MAAM,EACN,UAAU,CACb;AACL;AAEA;;AAEG;AACH,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC;AACxC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC;AAExC;;;AAGG;AACG,SAAU,mBAAmB,CAC/B,GAAQ,EACR,UAA0B,EAC1B,SAAe,EACf,SAAe,EAAA;ALine truncated
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.clear = clear;
exports.clearPath = clearPath;
exports.clearScope = clearScope;
exports.getCachedPaths = getCachedPaths;
exports.getOrCreateCachedPaths = getOrCreateCachedPaths;
exports.scope = exports.path = void 0;
let pathsCache = exports.path = new WeakMap();
let scope = exports.scope = new WeakMap();
function clear() {
clearPath();
clearScope();
}
function clearPath() {
exports.path = pathsCache = new WeakMap();
}
function clearScope() {
exports.scope = scope = new WeakMap();
}
function getCachedPaths(path) {
const {
parent,
parentPath
} = path;
return pathsCache.get(parent);
}
function getOrCreateCachedPaths(node, parentPath) {
let paths = pathsCache.get(node);
if (!paths) pathsCache.set(node, paths = new Map());
return paths;
}
//# sourceMappingURL=cache.js.map
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toPrimitive;
function toPrimitive(input, hint) {
if (typeof input !== "object" || !input) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
//# sourceMappingURL=toPrimitive.js.map
@@ -0,0 +1 @@
{"version":3,"file":"cpu.js","sources":["../../../src/icons/cpu.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Cpu\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHg9IjQiIHk9IjQiIHJ4PSIyIiAvPgogIDxyZWN0IHdpZHRoPSI2IiBoZWlnaHQ9IjYiIHg9IjkiIHk9IjkiIHJ4PSIxIiAvPgogIDxwYXRoIGQ9Ik0xNSAydjIiIC8+CiAgPHBhdGggZD0iTTE1IDIwdjIiIC8+CiAgPHBhdGggZD0iTTIgMTVoMiIgLz4KICA8cGF0aCBkPSJNMiA5aDIiIC8+CiAgPHBhdGggZD0iTTIwIDE1aDIiIC8+CiAgPHBhdGggZD0iTTIwIDloMiIgLz4KICA8cGF0aCBkPSJNOSAydjIiIC8+CiAgPHBhdGggZD0iTTkgMjB2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/cpu\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Cpu = createLucideIcon('Cpu', [\n ['rect', { width: '16', height: '16', x: '4', y: '4', rx: '2', key: '14l7u7' }],\n ['rect', { width: '6', height: '6', x: '9', y: '9', rx: '1', key: '5aljv4' }],\n ['path', { d: 'M15 2v2', key: '13l42r' }],\n ['path', { d: 'M15 20v2', key: '15mkzm' }],\n ['path', { d: 'M2 15h2', key: '1gxd5l' }],\n ['path', { d: 'M2 9h2', key: '1bbxkp' }],\n ['path', { d: 'M20 15h2', key: '19e6y8' }],\n ['path', { d: 'M20 9h2', key: '19tzq7' }],\n ['path', { d: 'M9 2v2', key: '165o2o' }],\n ['path', { d: 'M9 20v2', key: 'i2bqo8' }],\n]);\n\nexport default Cpu;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","getBindingIdentifiers","node","duplicates","outerOnly","newBindingsOnly","search","concat","ids","Object","create","length","id","shift","isAssignmentExpression","isUnaryExpression","isUpdateExpression","isIdentifier","_ids","name","push","isExportDeclaration","isExportAllDeclaration","isDeclaration","declaration","isFunctionDeclaration","isFunctionExpression","keys","type","i","key","nodes","Array","isArray","DeclareClass","DeclareFunction","DeclareModule","DeclareVariable","DeclareInterface","DeclareTypeAlias","DeclareOpaqueType","InterfaceDeclaration","TypeAlias","OpaqueType","CatchClause","LabeledStatement","UnaryExpression","AssignmentExpression","ImportSpecifier","ImportNamespaceSpecifier","ImportDefaultSpecifier","ImportDeclaration","TSImportEqualsDeclaration","ExportSpecifier","ExportNamespaceSpecifier","ExportDefaultSpecifier","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression","ObjectMethod","ClassMethod","ClassPrivateMethod","ForInStatement","ForOfStatement","ClassDeclaration","ClassExpression","RestElement","UpdateExpression","ObjectProperty","AssignmentPattern","ArrayPattern","ObjectPattern","VariableDeclaration","VariableDeclarator"],"sources":["../../src/retrievers/getBindingIdentifiers.ts"],"sourcesContent":["import {\n isExportDeclaration,\n isIdentifier,\n isClassExpression,\n isDeclaration,\n isFunctionDeclaration,\n isFunctionExpression,\n isExportAllDeclaration,\n isAssignmentExpression,\n isUnaryExpression,\n isUpdateExpression,\n} from \"../validators/generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport { getBindingIdentifiers as default };\n\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates: true,\n outerOnly?: boolean,\n newBindingsOnly?: boolean,\n): Record<string, t.Identifier[]>;\n\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates?: false,\n outerOnly?: boolean,\n newBindingsOnly?: boolean,\n): Record<string, t.Identifier>;\n\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates?: boolean,\n outerOnly?: boolean,\n newBindingsOnly?: boolean,\n): Record<string, t.Identifier> | Record<string, t.Identifier[]>;\n\n/**\n * Return a list of binding identifiers associated with the input `node`.\n */\nfunction getBindingIdentifiers(\n node: t.Node,\n duplicates?: boolean,\n outerOnly?: boolean,\n newBindingsOnly?: boolean,\n): Record<string, t.Identifier> | Record<string, t.Identifier[]> {\n const search: t.Node[] = [].concat(node);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n\n if (\n newBindingsOnly &&\n // These nodes do not introduce _new_ bindings, but they are included\n // in getBindingIdentifiers.keys for backwards compatibility.\n // TODO(@nicolo-ribaudo): Check if we can remove them from .keys in a\n // backward-compatible way, and if not what we need to do to remove them\n // in Babel 8.\n (isAssignmentExpression(id) ||\n isUnaryExpression(id) ||\n isUpdateExpression(id))\n ) {\n continue;\n }\n\n if (isIdentifier(id)) {\n if (duplicates) {\n const _ids = (ids[id.name] = ids[id.name] || []);\n _ids.push(id);\n } else {\n ids[id.name] = id;\n }\n continue;\n }\n\n if (isExportDeclaration(id) && !isExportAllDeclaration(id)) {\n if (isDeclaration(id.declaration)) {\n search.push(id.declaration);\n }\n continue;\n }\n\n if (outerOnly) {\n if (isFunctionDeclaration(id)) {\n search.push(id.id);\n continue;\n }\n\n if (\n isFunctionExpression(id) ||\n (process.env.BABEL_8_BREAKING && isClassExpression(id))\n ) {\n continue;\n }\n }\n\n const keys = getBindingIdentifiers.keys[id.type];\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const nodes =\n // @ts-expect-error key must present in id\n id[key] as t.Node[] | t.Node | undefined | null;\n if (nodes) {\n if (Array.isArray(nodes)) {\n search.push(...nodes);\n } else {\n search.push(nodes);\n }\n }\n }\n }\n }\n return ids;\n}\n\n/**\n * Mapping of types to their identifier keys.\n */\ntype KeysMap = {\n [N in t.Node as N[\"type\"]]?: (keyof N)[];\n};\n\nconst keys: KeysMap = {\n DeclareClass: [\"id\"],\n DeclareFunction: [\"id\"],\n DeclareModule: [\"id\"],\n DeclareVariable: [\"id\"],\n DeclareInterface: [\"id\"],\n DeclareTypeAlias: [\"id\"],\n DeclareOpaqueType: [\"id\"],\n InterfaceDeclaration: [\"id\"],\n TypeAlias: [\"id\"],\n OpaqueType: [\"id\"],\n\n CatchClause: [\"param\"],\n LabeledStatement: [\"label\"],\n UnaryExpression: [\"argument\"],\n AssignmentExpression: [\"left\"],\n\n ImportSpecifier: [\"local\"],\n ImportNamespaceSpecifier: [\"localLine truncated
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
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 @@
{"version":3,"file":"text.js","sources":["../../../src/icons/text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Text\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgNi4xSDMiIC8+CiAgPHBhdGggZD0iTTIxIDEyLjFIMyIgLz4KICA8cGF0aCBkPSJNMTUuMSAxOEgzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/text\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Text = createLucideIcon('Text', [\n ['path', { d: 'M17 6.1H3', key: 'wptmhv' }],\n ['path', { d: 'M21 12.1H3', key: '1j38uz' }],\n ['path', { d: 'M15.1 18H3', key: '1nb16a' }],\n]);\n\nexport default Text;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
// This file is auto generated by data-scripts/_helpers/runtime.ts
import tempAdjacencyGraphs from './adjacencyGraphs.json'
import diceware from './diceware.json'
import passwords from './passwords.json'
const dictionary = {
'diceware-common': diceware,
'passwords-common': passwords,
}
// reinit the variable because the typescript compile will otherwise just reexport the json file which will break as it's a json file
const adjacencyGraphs = tempAdjacencyGraphs
export { dictionary, adjacencyGraphs }
@@ -0,0 +1,9 @@
import { TraceMap } from './trace-mapping.cts';
import type { SectionedSourceMapInput, Ro } from './types.cts';
type FlattenMap = {
new (map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
(map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
};
export declare const FlattenMap: FlattenMap;
export {};
//# sourceMappingURL=flatten-map.d.ts.map
@@ -0,0 +1,5 @@
import { ESLintUtils } from '@typescript-eslint/utils';
import type { ESLintPluginDocs } from '../../rules';
export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, ESLintPluginDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, ESLintPluginDocs, ESLintUtils.RuleListener> & {
name: string;
};
@@ -0,0 +1,256 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const getWrappedCode_1 = require("../util/getWrappedCode");
exports.default = (0, util_1.createRule)({
name: 'consistent-type-assertions',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce consistent usage of type assertions',
recommended: 'stylistic',
},
fixable: 'code',
hasSuggestions: true,
messages: {
'angle-bracket': "Use '<{{cast}}>' instead of 'as {{cast}}'.",
as: "Use 'as {{cast}}' instead of '<{{cast}}>'.",
never: 'Do not use any type assertions.',
replaceArrayTypeAssertionWithAnnotation: 'Use const x: {{cast}} = [ ... ] instead.',
replaceArrayTypeAssertionWithSatisfies: 'Use const x = [ ... ] satisfies {{cast}} instead.',
replaceObjectTypeAssertionWithAnnotation: 'Use const x: {{cast}} = { ... } instead.',
replaceObjectTypeAssertionWithSatisfies: 'Use const x = { ... } satisfies {{cast}} instead.',
unexpectedArrayTypeAssertion: 'Always prefer const x: T[] = [ ... ].',
unexpectedObjectTypeAssertion: 'Always prefer const x: T = { ... }.',
},
schema: [
{
oneOf: [
{
type: 'object',
additionalProperties: false,
properties: {
assertionStyle: {
type: 'string',
description: 'The expected assertion style to enforce.',
enum: ['never'],
},
},
required: ['assertionStyle'],
},
{
type: 'object',
additionalProperties: false,
properties: {
arrayLiteralTypeAssertions: {
type: 'string',
description: 'Whether to always prefer type declarations for array literals used as variable initializers, rather than type assertions.',
enum: ['allow', 'allow-as-parameter', 'never'],
},
assertionStyle: {
type: 'string',
description: 'The expected assertion style to enforce.',
enum: ['as', 'angle-bracket'],
},
objectLiteralTypeAssertions: {
type: 'string',
description: 'Whether to always prefer type declarations for object literals used as variable initializers, rather than type assertions.',
enum: ['allow', 'allow-as-parameter', 'never'],
},
},
},
],
},
],
},
defaultOptions: [
{
arrayLiteralTypeAssertions: 'allow',
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow',
},
],
create(context, [options]) {
function isConst(node) {
if (node.type !== utils_1.AST_NODE_TYPES.TSTypeReference) {
return false;
}
return (node.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
node.typeName.name === 'const');
}
function reportIncorrectAssertionType(node) {
const messageId = options.assertionStyle;
// If this node is `as const`, then don't report an error.
if (isConst(node.typeAnnotation) && messageId === 'never') {
return;
}
context.report({
node,
messageId,
data: messageId !== 'never'
? { cast: context.sourceCode.getText(node.typeAnnotation) }
: {},
fix: messageId === 'as'
? (fixer) => {
// lazily access parserServices to avoid crashing on non TS files (#9860)
const tsNode = (0, util_1.getParserServices)(context, true).esTreeNodeToTSNodeMap.get(node);
const expressionCode = context.sourceCode.getText(node.expression);
const typeAnnotationCode = context.sourceCode.getText(node.typeAnnotation);
const asPrecedence = (0, util_1.getOperatorPrecedence)(ts.SyntaxKind.AsExpression, ts.SyntaxKind.Unknown);
const parentPrecedence = (0, util_1.getOperatorPrecedence)(tsNode.parent.kind, ts.isBinaryExpression(tsNode.parent)
? tsNode.parent.operatorToken.kind
: ts.SyntaxKind.Unknown, ts.isNewExpression(tsNode.parent)
? tsNode.parent.arguments != null &&
tsNode.parent.arguments.length > 0
: undefined);
const expressionPrecedence = (0, util_1.getOperatorPrecedenceForNode)(node.expression);
const expressionCodeWrapped = (0, getWrappedCode_1.getWrappedCode)(expressionCode, expressionPrecedence, asPrecedence);
const text = `${expressionCodeWrapped} as ${typeAnnotationCode}`;
return fixer.replaceText(node, (0, util_1.isParenthesized)(node, context.sourceCode)
? text
: (0, getWrappedCode_1.getWrappedCode)(text, asPrecedence, parentPrecedence));
}
: undefined,
});
}
function checkType(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSAnyKeyword:
case utils_1.AST_NODE_TYPES.TSUnknownKeyword:
return false;
case utils_1.AST_NODE_TYPES.TSTypeReference:
return (
// Ignore `as const` and `<const>`
!isConst(node) ||
// Allow qualified names which have dots between identifiers, `Foo.Bar`
node.typeName.type === utils_1.AST_NODE_TYPES.TSQualifiedName);
default:
return true;
}
}
function getSuggestions(node, annotationMessageId, satisfiesMessageId) {
const suggestions = [];
if (node.parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator &&
!node.parent.id.typeAnnotation) {
const { parent } = node;
suggestions.push({
messageId: annotationMessageId,
data: { cast: context.sourceCode.getText(node.typeAnnotation) },
fix: fixer => [
fixer.insertTextAfter(parent.id, `: ${context.sourceCode.getText(node.typeAnnotation)}`),
fixer.replaceText(node, (0, util_1.getTextWithParentheses)(context.sourceCode, node.expression)),
],
});
}
suggestions.push({
messageId: satisfiesMessageId,
data: { cast: context.sourceCode.getText(node.typeAnnotation) },
fix: fixer => [
fixer.replaceText(node, (0, util_1.getTextWithParentheses)(context.sourceCode, node.expression)),
fixer.insertTextAfter(node, ` satisfies ${context.sourceCode.getText(node.typeAnnotation)}`),
],
});
return suggestions;
}
function isAsParameter(node) {
return (node.parent.type === utils_1.AST_NODE_TYPES.NewExpression ||
node.parent.type === utils_1.AST_NODE_TYPES.CallExpression ||
node.parent.type === utils_1.AST_NODE_TYPES.ThrowStatement ||
node.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern ||
node.parent.type === utils_1.AST_NODE_TYPES.JSXExpressionContainer ||
(node.parent.type === utils_1.AST_NODE_TYPES.TemplateLiteral &&
node.parent.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression));
}
function checkExpressionForObjectAssertion(node) {
if (options.assertionStyle === 'never' ||
options.objectLiteralTypeAssertions === 'allow' ||
node.expression.type !== utils_1.AST_NODE_TYPES.ObjectExpression) {
return;
}
if (options.objectLiteralTypeAssertions === 'allow-as-parameter' &&
isAsParameter(node)) {
return;
}
if (checkType(node.typeAnnotation)) {
const suggest = getSuggestions(node, 'replaceObjectTypeAssertionWithAnnotation', 'replaceObjectTypeAssertionWithSatisfies');
context.report({
node,
messageId: 'unexpectedObjectTypeAssertion',
suggest,
});
}
}
function checkExpressionForArrayAssertion(node) {
if (options.assertionStyle === 'never' ||
options.arrayLiteralTypeAssertions === 'allow' ||
node.expression.type !== utils_1.AST_NODE_TYPES.ArrayExpression) {
return;
}
if (options.arrayLiteralTypeAssertions === 'allow-as-parameter' &&
isAsParameter(node)) {
return;
}
if (checkType(node.typeAnnotation)) {
const suggest = getSuggestions(node, 'replaceArrayTypeAssertionWithAnnotation', 'replaceArrayTypeAssertionWithSatisfies');
context.report({
node,
messageId: 'unexpectedArrayTypeAssertion',
suggest,
});
}
}
return {
TSAsExpression(node) {
if (options.assertionStyle !== 'as') {
reportIncorrectAssertionType(node);
return;
}
checkExpressionForObjectAssertion(node);
checkExpressionForArrayAssertion(node);
},
TSTypeAssertion(node) {
if (options.assertionStyle !== 'angle-bracket') {
reportIncorrectAssertionType(node);
return;
}
checkExpressionForObjectAssertion(node);
checkExpressionForArrayAssertion(node);
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"folder-up.js","sources":["../../../src/icons/folder-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMjBhMiAyIDAgMCAwIDItMlY4YTIgMiAwIDAgMC0yLTJoLTcuOWEyIDIgMCAwIDEtMS42OS0uOUw5LjYgMy45QTIgMiAwIDAgMCA3LjkzIDNINGEyIDIgMCAwIDAtMiAydjEzYTIgMiAwIDAgMCAyIDJaIiAvPgogIDxwYXRoIGQ9Ik0xMiAxMHY2IiAvPgogIDxwYXRoIGQ9Im05IDEzIDMtMyAzIDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/folder-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FolderUp = createLucideIcon('FolderUp', [\n [\n 'path',\n {\n d: 'M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z',\n key: '1kt360',\n },\n ],\n ['path', { d: 'M12 10v6', key: '1bos4e' }],\n ['path', { d: 'm9 13 3-3 3 3', key: '1pxg3c' }],\n]);\n\nexport default FolderUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,118 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
import type {HermesNode} from './HermesAST';
import type {DocblockDirectives, Program} from 'hermes-estree';
const DIRECTIVE_REGEX = /^\s*@([a-zA-Z0-9_-]+)( +.+)?$/;
export function parseDocblockString(docblock: string): DocblockDirectives {
const directiveLines = docblock
.split('\n')
// remove the leading " *" from each line
.map(line => line.trimStart().replace(/^\* ?/, '').trim())
.filter(line => line.startsWith('@'));
const directives: {
[string]: Array<string>,
} =
// $FlowExpectedError[incompatible-type] - flow types this return as {...}
Object.create(null);
for (const line of directiveLines) {
const match = DIRECTIVE_REGEX.exec(line);
if (match == null) {
continue;
}
const name = match[1];
// explicitly use an empty string if there's no value
// this way the array length tracks how many instances of the directive there was
const value = (match[2] ?? '').trim();
if (directives[name]) {
directives[name].push(value);
} else {
directives[name] = [value];
}
}
return directives;
}
export function getModuleDocblock(
hermesProgram: HermesNode,
): Program['docblock'] {
const docblockNode = (() => {
if (hermesProgram.type !== 'Program') {
return null;
}
// $FlowExpectedError[incompatible-type] - escape out of the unsafe hermes types
const program: Program = hermesProgram;
if (program.comments.length === 0) {
return null;
}
const firstComment = (() => {
const first = program.comments[0];
if (first.type === 'Block') {
return first;
}
if (program.comments.length === 1) {
return null;
}
// ESLint will always strip out the shebang comment from the code before passing it to the parser
// https://github.com/eslint/eslint/blob/21d647904dc30f9484b22acdd9243a6d0ecfba38/lib/linter/linter.js#L779
// this means that we're forced to parse it as a line comment :(
// this hacks around it by selecting the second comment in this case
const second = program.comments[1];
if (
first.type === 'Line' &&
first.range[0] === 0 &&
second.type === 'Block'
) {
return second;
}
return null;
})();
if (firstComment == null) {
return null;
}
/*
Handle cases like this where the comment isn't actually the first thing in the code:
```
const x = 1; /* docblock *./
```
*/
if (
program.body.length > 0 &&
program.body[0].range[0] < firstComment.range[0]
) {
return null;
}
return firstComment;
})();
if (docblockNode == null) {
return null;
}
return {
directives: parseDocblockString(docblockNode.value),
comment: docblockNode,
};
}
@@ -0,0 +1,11 @@
export { P as PluginUtils } from './resolve-config-QUZ9b-Gn.mjs';
import { a as PluginFn, C as Config, b as PluginWithConfig, c as PluginWithOptions } from './types-CJYAW1ql.mjs';
export { d as PluginAPI, P as PluginsConfig, T as ThemeConfig } from './types-CJYAW1ql.mjs';
import './colors.mjs';
declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
declare namespace createPlugin {
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
}
export { Config, PluginFn as PluginCreator, createPlugin as default };
@@ -0,0 +1,60 @@
{
"name": "@radix-ui/react-use-previous",
"version": "1.1.2",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"devDependencies": {
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"typescript": "^5.9.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git",
"directory": "packages/react/use-previous"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "oxlint --max-warnings 0 src",
"clean": "rm -rf dist",
"reset": "rm -rf dist node_modules",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = gatherSequenceExpressions;
var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers.js");
var _index = require("../validators/generated/index.js");
var _index2 = require("../builders/generated/index.js");
var _productions = require("../builders/productions.js");
var _cloneNode = require("../clone/cloneNode.js");
function gatherSequenceExpressions(nodes, declars) {
const exprs = [];
let ensureLastUndefined = true;
for (const node of nodes) {
if (!(0, _index.isEmptyStatement)(node)) {
ensureLastUndefined = false;
}
if ((0, _index.isExpression)(node)) {
exprs.push(node);
} else if ((0, _index.isExpressionStatement)(node)) {
exprs.push(node.expression);
} else if ((0, _index.isVariableDeclaration)(node)) {
if (node.kind !== "var") return;
for (const declar of node.declarations) {
const bindings = (0, _getBindingIdentifiers.default)(declar);
for (const key of Object.keys(bindings)) {
declars.push({
kind: node.kind,
id: (0, _cloneNode.default)(bindings[key])
});
}
if (declar.init) {
exprs.push((0, _index2.assignmentExpression)("=", declar.id, declar.init));
}
}
ensureLastUndefined = true;
} else if ((0, _index.isIfStatement)(node)) {
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], declars) : (0, _productions.buildUndefinedNode)();
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], declars) : (0, _productions.buildUndefinedNode)();
if (!consequent || !alternate) return;
exprs.push((0, _index2.conditionalExpression)(node.test, consequent, alternate));
} else if ((0, _index.isBlockStatement)(node)) {
const body = gatherSequenceExpressions(node.body, declars);
if (!body) return;
exprs.push(body);
} else if ((0, _index.isEmptyStatement)(node)) {
if (nodes.indexOf(node) === 0) {
ensureLastUndefined = true;
}
} else {
return;
}
}
if (ensureLastUndefined) {
exprs.push((0, _productions.buildUndefinedNode)());
}
if (exprs.length === 1) {
return exprs[0];
} else {
return (0, _index2.sequenceExpression)(exprs);
}
}
//# sourceMappingURL=gatherSequenceExpressions.js.map
@@ -0,0 +1,20 @@
require("./_virtual/_rolldown/runtime.cjs");
const require_useRouter = require("./useRouter.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
//#region src/ScriptOnce.tsx
/**
* Server-only helper to emit a script tag exactly once during SSR.
*/
function ScriptOnce({ children }) {
const router = require_useRouter.useRouter();
if (!(_tanstack_router_core_isServer.isServer ?? router.isServer)) return null;
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("script", {
nonce: router.options.ssr?.nonce,
dangerouslySetInnerHTML: { __html: children + ";document.currentScript.remove()" }
});
}
//#endregion
exports.ScriptOnce = ScriptOnce;
//# sourceMappingURL=ScriptOnce.cjs.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ShieldBan = createLucideIcon("ShieldBan", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "m4.243 5.21 14.39 12.472", key: "1c9a7c" }]
]);
export { ShieldBan as default };
//# sourceMappingURL=shield-ban.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_typeof","obj","Symbol","iterator","exports","default","constructor","prototype"],"sources":["../../src/helpers/typeof.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _typeof(\n obj: unknown,\n):\n | \"string\"\n | \"number\"\n | \"bigint\"\n | \"boolean\"\n | \"symbol\"\n | \"undefined\"\n | \"object\"\n | \"function\" {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n // @ts-expect-error -- deliberate re-defining typeof\n _typeof = function (obj: unknown) {\n return typeof obj;\n };\n } else {\n // @ts-expect-error -- deliberate re-defining typeof\n _typeof = function (obj: unknown) {\n return obj &&\n typeof Symbol === \"function\" &&\n obj.constructor === Symbol &&\n obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n"],"mappings":";;;;;;AAEe,SAASA,OAAOA,CAC7BC,GAAY,EASC;EACb,yBAAyB;;EAEzB,IAAI,OAAOC,MAAM,KAAK,UAAU,IAAI,OAAOA,MAAM,CAACC,QAAQ,KAAK,QAAQ,EAAE;IAEvEC,OAAA,CAAAC,OAAA,GAAAL,OAAO,GAAG,SAAAA,CAAUC,GAAY,EAAE;MAChC,OAAO,OAAOA,GAAG;IACnB,CAAC;EACH,CAAC,MAAM;IAELG,OAAA,CAAAC,OAAA,GAAAL,OAAO,GAAG,SAAAA,CAAUC,GAAY,EAAE;MAChC,OAAOA,GAAG,IACR,OAAOC,MAAM,KAAK,UAAU,IAC5BD,GAAG,CAACK,WAAW,KAAKJ,MAAM,IAC1BD,GAAG,KAAKC,MAAM,CAACK,SAAS,GACtB,QAAQ,GACR,OAAON,GAAG;IAChB,CAAC;EACH;EAEA,OAAOD,OAAO,CAACC,GAAG,CAAC;AACrB","ignoreList":[]}
@@ -0,0 +1,44 @@
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
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.
--------------------------------------------------------------------------------
Copyright Joyent, Inc. and other Node 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,9 @@
import type TokenProcessor from "../TokenProcessor";
/**
* Special case code to scan for imported names in ESM TypeScript. We need to do this so we can
* properly get globals so we can compute shadowed globals.
*
* This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS
* replacement and flow type imports.
*/
export default function getTSImportedNames(tokens: TokenProcessor): Set<string>;
@@ -0,0 +1,49 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
// You can regenerate it using `pnpm run generate-configs`
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = __importDefault(require("./base"));
const eslint_recommended_1 = __importDefault(require("./eslint-recommended"));
/**
* Recommended rules for code correctness that you can drop in without additional configuration.
* @see {@link https://typescript-eslint.io/users/configs#recommended}
*/
exports.default = (plugin, parser) => [
(0, base_1.default)(plugin, parser),
(0, eslint_recommended_1.default)(plugin, parser),
{
name: 'typescript-eslint/recommended',
rules: {
'@typescript-eslint/ban-ts-comment': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-wrapper-object-types': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
},
},
];
@@ -0,0 +1,100 @@
/**
* @fileoverview Rule to disallow a negated condition
* @author Alberto Rodríguez
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow negated conditions",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-negated-condition",
},
schema: [],
messages: {
unexpectedNegated: "Unexpected negated condition.",
},
},
create(context) {
/**
* Determines if a given node is an if-else without a condition on the else
* @param {ASTNode} node The node to check.
* @returns {boolean} True if the node has an else without an if.
* @private
*/
function hasElseWithoutCondition(node) {
return node.alternate && node.alternate.type !== "IfStatement";
}
/**
* Determines if a given node is a negated unary expression
* @param {Object} test The test object to check.
* @returns {boolean} True if the node is a negated unary expression.
* @private
*/
function isNegatedUnaryExpression(test) {
return test.type === "UnaryExpression" && test.operator === "!";
}
/**
* Determines if a given node is a negated binary expression
* @param {Test} test The test to check.
* @returns {boolean} True if the node is a negated binary expression.
* @private
*/
function isNegatedBinaryExpression(test) {
return (
test.type === "BinaryExpression" &&
(test.operator === "!=" || test.operator === "!==")
);
}
/**
* Determines if a given node has a negated if expression
* @param {ASTNode} node The node to check.
* @returns {boolean} True if the node has a negated if expression.
* @private
*/
function isNegatedIf(node) {
return (
isNegatedUnaryExpression(node.test) ||
isNegatedBinaryExpression(node.test)
);
}
return {
IfStatement(node) {
if (!hasElseWithoutCondition(node)) {
return;
}
if (isNegatedIf(node)) {
context.report({
node,
messageId: "unexpectedNegated",
});
}
},
ConditionalExpression(node) {
if (isNegatedIf(node)) {
context.report({
node,
messageId: "unexpectedNegated",
});
}
},
};
},
};
@@ -0,0 +1 @@
import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as b,M as T,W as x,L as S,N as A,O as M,P as k,Q as C,R as E,S as V,T as P,U as D,V as O,r as I,X as F,Y as L,i as R,o as K,Z as B,_ as j,$ as q,a0 as N,a1 as U,a2 as G,a3 as H,a4 as $,a5 as W,a6 as _,d as z,s as Y,a7 as X,a8 as J,k as Z,e as Q,f as tt,a9 as et,b as nt,aa as it,j as st,ab as rt,g as ot}from"./size-rollup-dom-animation-assets.js";import{Fragment as at}from"react";const ut=(t,e)=>n=>e(t(n)),lt=(...t)=>t.reduce(ut),ct=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ht=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function dt(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=ht(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:ht(r(t),n,s)}const pt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mt=t=>e=>1-t(1-e),ft=dt(.33,1.53,.69,.99),yt=mt(ft),vt=pt(yt),gt=t=>t>=1?1:(t*=2)<1?.5*yt(t):.5*(2-Math.pow(2,-10*(t-1))),wt=t=>1-Math.sin(Math.acos(t)),bt=mt(wt),Tt=pt(wt),xt=dt(.42,0,1,1),St=dt(0,0,.58,1),At=dt(.42,0,.58,1),Mt={linear:t,easeIn:xt,easeInOut:At,easeOut:St,circIn:wt,circInOut:Tt,circOut:bt,backIn:yt,backInOut:vt,backOut:ft,anticipate:gt},kt=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return dt(e,i,s,r)}return"string"==typeof t?(n(void 0!==Mt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Mt[t]):t};function Ct(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Et(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Pt=[o,s,r];function Dt(t){const e=(n=t,Pt.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ct(a,i,t+1/3),r=Ct(a,i,t),o=Ct(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Ot=(t,e)=>{const n=Dt(t),r=Dt(e);if(!n||!r)return Et(t,e);const o={...n};return t=>(o.red=Vt(n.red,r.red,t),o.green=Vt(n.green,r.green,t),o.blue=Vt(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},It=new Set(["none","hidden"]);function Ft(t,e){return n=>i(t,e,n)}function Lt(t){return"number"==typeof t?Ft:"string"==typeof t?u(t)?Et:l.test(t)?Ot:Bt:Array.isArray(t)?Rt:"object"==typeof t?l.test(t)?Ot:Kt:Et}function Rt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Lt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Kt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Lt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Bt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?It.has(t)&&!s.values.length||It.has(e)&&!i.values.length?function(t,e){return It.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):lt(Rt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(a(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Et(t,e))};function jt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return i(t,e,n);return Lt(t)(t,e)}const qt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},Nt=2e4;function Ut(t){let e=0;let n=t.next(e);for(;!n.done&&e<Nt;)e+=50,n=t.next(e);return e>=Nt?1/0:e}const Gt=100,Ht=10,$t=1,Wt=0,_t=800,zt=.3,Yt=.3,Xt={granular:.01,default:2},Jt={granular:.005,default:.5},Zt=.01,Qt=10,te=.05,ee=1;function ne(t,e){return t*Math.sqrt(1-e*e)}const ie=.001;const se=["duration","bounce"],re=["stiffness","damping","mass"];function oe(t,e){return e.some(e=>void 0!==t[e])}function ae(t){let e={velocity:Wt,stiffness:Gt,damping:Ht,mass:$t,isResolvedFromDuration:!1,...t};if(!oe(t,re)&&oe(t,se))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=function({duration:t=_t,bounce:e=zt,velocity:n=Wt,mass:i=$t}){let s,r;a(t<=w(Qt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=v(te,ee,o),t=v(Zt,Qt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ne(e,o),u=Math.exp(-s);return ie-r/a*u},r=e=>Line truncated
@@ -0,0 +1,46 @@
import { GenMapping } from '@jridgewell/gen-mapping';
import type { TraceMap } from '@jridgewell/trace-mapping';
export type SourceMapSegmentObject = {
column: number;
line: number;
name: string;
source: string;
content: string | null;
ignore: boolean;
};
export type OriginalSource = {
map: null;
sources: Sources[];
source: string;
content: string | null;
ignore: boolean;
};
export type MapSource = {
map: TraceMap;
sources: Sources[];
source: string;
content: null;
ignore: false;
};
export type Sources = OriginalSource | MapSource;
/**
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
* (which may themselves be SourceMapTrees).
*/
export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource;
/**
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
* segment tracing ends at the `OriginalSource`.
*/
export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource;
/**
* traceMappings is only called on the root level SourceMapTree, and begins the process of
* resolving each mapping in terms of the original source files.
*/
export declare function traceMappings(tree: MapSource): GenMapping;
/**
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
* child SourceMapTrees, until we find the original source map.
*/
export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null;
//# sourceMappingURL=source-map-tree.d.ts.map
@@ -0,0 +1,104 @@
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
function normalizeWindowsPath(input = "") {
if (!input) {
return input;
}
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
}
const _UNC_REGEX = /^[/\\]{2}/;
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
const normalize = function(path) {
if (path.length === 0) {
return ".";
}
path = normalizeWindowsPath(path);
const isUNCPath = path.match(_UNC_REGEX);
const isPathAbsolute = isAbsolute(path);
const trailingSeparator = path[path.length - 1] === "/";
path = normalizeString(path, !isPathAbsolute);
if (path.length === 0) {
if (isPathAbsolute) {
return "/";
}
return trailingSeparator ? "./" : ".";
}
if (trailingSeparator) {
path += "/";
}
if (_DRIVE_LETTER_RE.test(path)) {
path += "/";
}
if (isUNCPath) {
if (!isPathAbsolute) {
return `//./${path}`;
}
return `//${path}`;
}
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
};
function normalizeString(path, allowAboveRoot) {
let res = "";
let lastSegmentLength = 0;
let lastSlash = -1;
let dots = 0;
let char = null;
for (let index = 0; index <= path.length; ++index) {
if (index < path.length) {
char = path[index];
} else if (char === "/") {
break;
} else {
char = "/";
}
if (char === "/") {
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
if (res.length > 2) {
const lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex === -1) {
res = "";
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
}
lastSlash = index;
dots = 0;
continue;
} else if (res.length > 0) {
res = "";
lastSegmentLength = 0;
lastSlash = index;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
res += res.length > 0 ? "/.." : "..";
lastSegmentLength = 2;
}
} else {
if (res.length > 0) {
res += `/${path.slice(lastSlash + 1, index)}`;
} else {
res = path.slice(lastSlash + 1, index);
}
lastSegmentLength = index - lastSlash - 1;
}
lastSlash = index;
dots = 0;
} else if (char === "." && dots !== -1) {
++dots;
} else {
dots = -1;
}
}
return res;
}
const isAbsolute = function(p) {
return _IS_ABSOLUTE_RE.test(p);
};
export { normalize as n };
@@ -0,0 +1,42 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }/**
* This module was automatically generated by `ts-interface-builder`
*/
var _tsinterfacechecker = require('ts-interface-checker'); var t = _interopRequireWildcard(_tsinterfacechecker);
// tslint:disable:object-literal-key-quotes
const Transform = t.union(
t.lit("jsx"),
t.lit("typescript"),
t.lit("flow"),
t.lit("imports"),
t.lit("react-hot-loader"),
t.lit("jest"),
); exports.Transform = Transform;
const SourceMapOptions = t.iface([], {
compiledFilename: "string",
}); exports.SourceMapOptions = SourceMapOptions;
const Options = t.iface([], {
transforms: t.array("Transform"),
disableESTransforms: t.opt("boolean"),
jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))),
production: t.opt("boolean"),
jsxImportSource: t.opt("string"),
jsxPragma: t.opt("string"),
jsxFragmentPragma: t.opt("string"),
keepUnusedImports: t.opt("boolean"),
preserveDynamicImport: t.opt("boolean"),
injectCreateRequireForImportRequire: t.opt("boolean"),
enableLegacyTypeScriptModuleInterop: t.opt("boolean"),
enableLegacyBabel5ModuleInterop: t.opt("boolean"),
sourceMapOptions: t.opt("SourceMapOptions"),
filePath: t.opt("string"),
}); exports.Options = Options;
const exportedTypeSuite = {
Transform: exports.Transform,
SourceMapOptions: exports.SourceMapOptions,
Options: exports.Options,
};
exports. default = exportedTypeSuite;
@@ -0,0 +1,379 @@
export class Yallist {
tail;
head;
length = 0;
static create(list = []) {
return new Yallist(list);
}
constructor(list = []) {
for (const item of list) {
this.push(item);
}
}
*[Symbol.iterator]() {
for (let walker = this.head; walker; walker = walker.next) {
yield walker.value;
}
}
removeNode(node) {
if (node.list !== this) {
throw new Error('removing node which does not belong to this list');
}
const next = node.next;
const prev = node.prev;
if (next) {
next.prev = prev;
}
if (prev) {
prev.next = next;
}
if (node === this.head) {
this.head = next;
}
if (node === this.tail) {
this.tail = prev;
}
this.length--;
node.next = undefined;
node.prev = undefined;
node.list = undefined;
return next;
}
unshiftNode(node) {
if (node === this.head) {
return;
}
if (node.list) {
node.list.removeNode(node);
}
const head = this.head;
node.list = this;
node.next = head;
if (head) {
head.prev = node;
}
this.head = node;
if (!this.tail) {
this.tail = node;
}
this.length++;
}
pushNode(node) {
if (node === this.tail) {
return;
}
if (node.list) {
node.list.removeNode(node);
}
const tail = this.tail;
node.list = this;
node.prev = tail;
if (tail) {
tail.next = node;
}
this.tail = node;
if (!this.head) {
this.head = node;
}
this.length++;
}
push(...args) {
for (let i = 0, l = args.length; i < l; i++) {
push(this, args[i]);
}
return this.length;
}
unshift(...args) {
for (var i = 0, l = args.length; i < l; i++) {
unshift(this, args[i]);
}
return this.length;
}
pop() {
if (!this.tail) {
return undefined;
}
const res = this.tail.value;
const t = this.tail;
this.tail = this.tail.prev;
if (this.tail) {
this.tail.next = undefined;
}
else {
this.head = undefined;
}
t.list = undefined;
this.length--;
return res;
}
shift() {
if (!this.head) {
return undefined;
}
const res = this.head.value;
const h = this.head;
this.head = this.head.next;
if (this.head) {
this.head.prev = undefined;
}
else {
this.tail = undefined;
}
h.list = undefined;
this.length--;
return res;
}
forEach(fn, thisp) {
thisp = thisp || this;
for (let walker = this.head, i = 0; !!walker; i++) {
fn.call(thisp, walker.value, i, this);
walker = walker.next;
}
}
forEachReverse(fn, thisp) {
thisp = thisp || this;
for (let walker = this.tail, i = this.length - 1; !!walker; i--) {
fn.call(thisp, walker.value, i, this);
walker = walker.prev;
}
}
get(n) {
let i = 0;
let walker = this.head;
for (; !!walker && i < n; i++) {
walker = walker.next;
}
if (i === n && !!walker) {
return walker.value;
}
}
getReverse(n) {
let i = 0;
let walker = this.tail;
for (; !!walker && i < n; i++) {
// abort out of the list early if we hit a cycle
walker = walker.prev;
}
if (i === n && !!walker) {
return walker.value;
}
}
map(fn, thisp) {
thisp = thisp || this;
const res = new Yallist();
for (let walker = this.head; !!walker;) {
res.push(fn.call(thisp, walker.value, this));
walker = walker.next;
}
return res;
}
mapReverse(fn, thisp) {
thisp = thisp || this;
var res = new Yallist();
for (let walker = this.tail; !!walker;) {
res.push(fn.call(thisp, walker.value, this));
walker = walker.prev;
}
return res;
}
reduce(fn, initial) {
let acc;
let walker = this.head;
if (arguments.length > 1) {
acc = initial;
}
else if (this.head) {
walker = this.head.next;
acc = this.head.value;
}
else {
throw new TypeError('Reduce of empty list with no initial value');
}
for (var i = 0; !!walker; i++) {
acc = fn(acc, walker.value, i);
walker = walker.next;
}
return acc;
}
reduceReverse(fn, initial) {
let acc;
let walker = this.tail;
if (arguments.length > 1) {
acc = initial;
}
else if (this.tail) {
walker = this.tail.prev;
acc = this.tail.value;
}
else {
throw new TypeError('Reduce of empty list with no initial value');
}
for (let i = this.length - 1; !!walker; i--) {
acc = fn(acc, walker.value, i);
walker = walker.prev;
}
return acc;
}
toArray() {
const arr = new Array(this.length);
for (let i = 0, walker = this.head; !!walker; i++) {
arr[i] = walker.value;
walker = walker.next;
}
return arr;
}
toArrayReverse() {
const arr = new Array(this.length);
for (let i = 0, walker = this.tail; !!walker; i++) {
arr[i] = walker.value;
walker = walker.prev;
}
return arr;
}
slice(from = 0, to = this.length) {
if (to < 0) {
to += this.length;
}
if (from < 0) {
from += this.length;
}
const ret = new Yallist();
if (to < from || to < 0) {
return ret;
}
if (from < 0) {
from = 0;
}
if (to > this.length) {
to = this.length;
}
let walker = this.head;
let i = 0;
for (i = 0; !!walker && i < from; i++) {
walker = walker.next;
}
for (; !!walker && i < to; i++, walker = walker.next) {
ret.push(walker.value);
}
return ret;
}
sliceReverse(from = 0, to = this.length) {
if (to < 0) {
to += this.length;
}
if (from < 0) {
from += this.length;
}
const ret = new Yallist();
if (to < from || to < 0) {
return ret;
}
if (from < 0) {
from = 0;
}
if (to > this.length) {
to = this.length;
}
let i = this.length;
let walker = this.tail;
for (; !!walker && i > to; i--) {
walker = walker.prev;
}
for (; !!walker && i > from; i--, walker = walker.prev) {
ret.push(walker.value);
}
return ret;
}
splice(start, deleteCount = 0, ...nodes) {
if (start > this.length) {
start = this.length - 1;
}
if (start < 0) {
start = this.length + start;
}
let walker = this.head;
for (let i = 0; !!walker && i < start; i++) {
walker = walker.next;
}
const ret = [];
for (let i = 0; !!walker && i < deleteCount; i++) {
ret.push(walker.value);
walker = this.removeNode(walker);
}
if (!walker) {
walker = this.tail;
}
else if (walker !== this.tail) {
walker = walker.prev;
}
for (const v of nodes) {
walker = insertAfter(this, walker, v);
}
return ret;
}
reverse() {
const head = this.head;
const tail = this.tail;
for (let walker = head; !!walker; walker = walker.prev) {
const p = walker.prev;
walker.prev = walker.next;
walker.next = p;
}
this.head = tail;
this.tail = head;
return this;
}
}
// insertAfter undefined means "make the node the new head of list"
function insertAfter(self, node, value) {
const prev = node;
const next = node ? node.next : self.head;
const inserted = new Node(value, prev, next, self);
if (inserted.next === undefined) {
self.tail = inserted;
}
if (inserted.prev === undefined) {
self.head = inserted;
}
self.length++;
return inserted;
}
function push(self, item) {
self.tail = new Node(item, self.tail, undefined, self);
if (!self.head) {
self.head = self.tail;
}
self.length++;
}
function unshift(self, item) {
self.head = new Node(item, undefined, self.head, self);
if (!self.tail) {
self.tail = self.head;
}
self.length++;
}
export class Node {
list;
next;
prev;
value;
constructor(value, prev, next, list) {
this.list = list;
this.value = value;
if (prev) {
prev.next = this;
this.prev = prev;
}
else {
this.prev = undefined;
}
if (next) {
next.prev = this;
this.next = next;
}
else {
this.next = undefined;
}
}
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,113 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "caratteri", verb: "avere" },
file: { unit: "byte", verb: "avere" },
array: { unit: "elementi", verb: "avere" },
set: { unit: "elementi", verb: "avere" },
map: { unit: "elementi", verb: "avere" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "input",
email: "indirizzo email",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "data e ora ISO",
date: "data ISO",
time: "ora ISO",
duration: "durata ISO",
ipv4: "indirizzo IPv4",
ipv6: "indirizzo IPv6",
mac: "indirizzo MAC",
cidrv4: "intervallo IPv4",
cidrv6: "intervallo IPv6",
base64: "stringa codificata in base64",
base64url: "URL codificata in base64",
json_string: "stringa JSON",
e164: "numero E.164",
credit_card: "numero di carta di credito",
currency_code: "codice valuta",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary = {
nan: "NaN",
number: "numero",
array: "vettore",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Input non valido: atteso instanceof ${issue.expected}, ricevuto ${received}`;
}
return `Input non valido: atteso ${expected}, ricevuto ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Input non valido: atteso ${util.stringifyPrimitive(issue.values[0])}`;
return `Opzione non valida: atteso uno tra ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Troppo grande: ${issue.origin ?? "valore"} deve avere ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementi"}`;
return `Troppo grande: ${issue.origin ?? "valore"} deve essere ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Troppo piccolo: ${issue.origin} deve avere ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Troppo piccolo: ${issue.origin} deve essere ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Stringa non valida: deve includere "${_issue.includes}"`;
if (_issue.format === "regex")
return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
return `Input non valido: ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Numero non valido: deve essere un multiplo di ${issue.divisor}`;
case "unrecognized_keys":
return `Chiav${issue.keys.length > 1 ? "i" : "e"} non riconosciut${issue.keys.length > 1 ? "e" : "a"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Chiave non valida in ${issue.origin}`;
case "invalid_union":
return "Input non valido";
case "invalid_element":
return `Valore non valido in ${issue.origin}`;
default:
return `Input non valido`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,2 @@
export declare const normalizeWindowsPath: (p: unknown) => string;
//# sourceMappingURL=normalize-windows-path.d.ts.map
@@ -0,0 +1,27 @@
var wordSequenceMatcher = (options, match) => {
if (match.pattern !== 'wordSequence') {
return null;
}
let warning = null;
const suggestions = [];
// Warning for common word sequences
if (match.wordCount >= 3) {
warning = options.translations.warnings.sequences;
}
// Suggestions based on sequence characteristics
if (match.ascending) {
suggestions.push(options.translations.suggestions.sequences);
} else {
suggestions.push(options.translations.suggestions.anotherWord);
}
if (match.wordCount > 2) {
suggestions.push(options.translations.suggestions.useWords);
}
return {
warning,
suggestions
};
};
export { wordSequenceMatcher as default };
//# sourceMappingURL=feedback.mjs.map
@@ -0,0 +1,3 @@
declare const RequestPlugin: any;
export default RequestPlugin;
//# sourceMappingURL=request.d.ts.map
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./maxArrayLength')} */
module.exports = 4294967295; // Math.pow(2, 32) - 1;
@@ -0,0 +1,7 @@
import addMonths from "./addMonths.mjs";
function subMonths(date, months) {
return addMonths(date, -months);
}
export {
subMonths as default
};
@@ -0,0 +1 @@
{"version":3,"file":"folder-open.js","sources":["../../../src/icons/folder-open.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderOpen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNiAxNCAxLjUtMi45QTIgMiAwIDAgMSA5LjI0IDEwSDIwYTIgMiAwIDAgMSAxLjk0IDIuNWwtMS41NCA2YTIgMiAwIDAgMS0xLjk1IDEuNUg0YTIgMiAwIDAgMS0yLTJWNWEyIDIgMCAwIDEgMi0yaDMuOWEyIDIgMCAwIDEgMS42OS45bC44MSAxLjJhMiAyIDAgMCAwIDEuNjcuOUgxOGEyIDIgMCAwIDEgMiAydjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/folder-open\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FolderOpen = createLucideIcon('FolderOpen', [\n [\n 'path',\n {\n d: 'm6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2',\n key: 'usdka0',\n },\n ],\n]);\n\nexport default FolderOpen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAChD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
const { dirname, resolve } = require('path');
const { readdirSync, statSync } = require('fs');
module.exports = function (start, callback) {
let dir = resolve('.', start);
let tmp, stats = statSync(dir);
if (!stats.isDirectory()) {
dir = dirname(dir);
}
while (true) {
tmp = callback(dir, readdirSync(dir));
if (tmp) return resolve(dir, tmp);
dir = dirname(tmp = dir);
if (tmp === dir) break;
}
}
@@ -0,0 +1,13 @@
import Options from '../../Options'
import { MatchEstimated } from '../../types'
export default (options: Options, match: MatchEstimated) => {
let warning = options.translations.warnings.keyPattern
if (match.turns === 1) {
warning = options.translations.warnings.straightRow
}
return {
warning,
suggestions: [options.translations.suggestions.longerKeyboardPattern],
}
}
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BookA = createLucideIcon("BookA", [
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
],
["path", { d: "m8 13 4-7 4 7", key: "4rari8" }],
["path", { d: "M9.1 11h5.7", key: "1gkovt" }]
]);
export { BookA as default };
//# sourceMappingURL=book-a.js.map
@@ -0,0 +1,26 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Piano = createLucideIcon("Piano", [
[
"path",
{
d: "M18.5 8c-1.4 0-2.6-.8-3.2-2A6.87 6.87 0 0 0 2 9v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-8.5C22 9.6 20.4 8 18.5 8",
key: "lag0yf"
}
],
["path", { d: "M2 14h20", key: "myj16y" }],
["path", { d: "M6 14v4", key: "9ng0ue" }],
["path", { d: "M10 14v4", key: "1v8uk5" }],
["path", { d: "M14 14v4", key: "1tqops" }],
["path", { d: "M18 14v4", key: "18uqwm" }]
]);
export { Piano as default };
//# sourceMappingURL=piano.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_2D","2":"C"},C:{"1":"_LF","2":"_g _6E _L","33":"N _ZG"},D:{"1":"_TI","2":"_FC","33":"_1B _dJ","66":"_PO _FH"},E:{"1":"_JB","2":"_RB"},F:{"1":"_6G","2":"_T","33":"_6M"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_D","16":"H"},L:{"2":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"16":"bC"},P:{"2":"_F"},Q:{"16":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"Pointer Lock API",D:true};
@@ -0,0 +1,96 @@
import { E as Transport, bn as JSONRPCMessage } from "./index-J2FaQ-KY.cjs";
import { IOType } from "node:child_process";
import { Stream } from "node:stream";
//#region src/client/stdio.d.ts
type StdioServerParameters = {
/**
* The executable to run to start the server.
*/
command: string;
/**
* Command line arguments to pass to the executable.
*/
args?: string[];
/**
* The environment to use when spawning the process.
*
* If not specified, the result of {@linkcode getDefaultEnvironment} will be used.
*/
env?: Record<string, string>;
/**
* How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`.
*
* The default is `"inherit"`, meaning messages to stderr will be printed to the parent process's stderr.
*/
stderr?: IOType | Stream | number;
/**
* The working directory to use when spawning the process.
*
* If not specified, the current working directory will be inherited.
*/
cwd?: string;
/**
* Maximum size of the read buffer in bytes. If a single message exceeds
* this size the transport will emit an error and close.
*
* Defaults to 10 MB.
*/
maxBufferSize?: number;
};
/**
* Environment variables to inherit by default, if an environment is not explicitly given.
*/
declare const DEFAULT_INHERITED_ENV_VARS: string[];
/**
* Returns a default environment object including only environment variables deemed safe to inherit.
*/
declare function getDefaultEnvironment(): Record<string, string>;
/**
* Client transport for stdio: this will connect to a server by spawning a process and communicating with it over stdin/stdout.
*
* This transport is only available in Node.js environments.
*/
declare class StdioClientTransport implements Transport {
private _process?;
private _readBuffer;
private _serverParams;
private _stderrStream;
onclose?: () => void;
onerror?: (error: Error) => void;
onmessage?: (message: JSONRPCMessage) => void;
constructor(server: StdioServerParameters);
/**
* Starts the server process and prepares to communicate with it.
*/
start(): Promise<void>;
/**
* The `stderr` stream of the child process, if {@linkcode StdioServerParameters.stderr} was set to `"pipe"` or `"overlapped"`.
*
* If `stderr` piping was requested, a `PassThrough` stream is returned _immediately_, allowing callers to
* attach listeners before the `start` method is invoked. This prevents loss of any early
* error output emitted by the child process.
*/
get stderr(): Stream | null;
/**
* The child process pid spawned by this transport.
*
* This is only available after the transport has been started.
*/
get pid(): number | null;
private processReadBuffer;
/**
* Reap a disposable probe sibling (see the version-negotiation sibling
* flow): signal-first teardown awaiting process `exit` — never the `close`
* event, so a helper process holding the child's stdio pipes can never
* block disposal. Not part of the public transport lifecycle.
*
* @internal
*/
private _dispose;
close(): Promise<void>;
send(message: JSONRPCMessage): Promise<void>;
}
//#endregion
export { DEFAULT_INHERITED_ENV_VARS, StdioClientTransport, type StdioServerParameters, getDefaultEnvironment };
//# sourceMappingURL=stdio.d.cts.map