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,16 @@
/**
* @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 CircleSlash = createLucideIcon("CircleSlash", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["line", { x1: "9", x2: "15", y1: "15", y2: "9", key: "1dfufj" }]
]);
export { CircleSlash as default };
//# sourceMappingURL=circle-slash.js.map
@@ -0,0 +1,93 @@
import Dispatcher from './dispatcher'
import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'
import { setGlobalOrigin, getGlobalOrigin } from './global-origin'
import Pool from './pool'
import { RedirectHandler, DecoratorHandler } from './handlers'
import BalancedPool from './balanced-pool'
import RoundRobinPool from './round-robin-pool'
import Client from './client'
import H2CClient from './h2c-client'
import buildConnector from './connector'
import errors from './errors'
import Agent from './agent'
import Dispatcher1Wrapper from './dispatcher1-wrapper'
import MockClient from './mock-client'
import MockPool from './mock-pool'
import MockAgent from './mock-agent'
import { SnapshotAgent } from './snapshot-agent'
import { MockCallHistory, MockCallHistoryLog } from './mock-call-history'
import mockErrors from './mock-errors'
import ProxyAgent from './proxy-agent'
import Socks5ProxyAgent from './socks5-proxy-agent'
import EnvHttpProxyAgent from './env-http-proxy-agent'
import RetryHandler from './retry-handler'
import RetryAgent from './retry-agent'
import { request, pipeline, stream, connect, upgrade } from './api'
import interceptors from './interceptors'
import CacheInterceptor from './cache-interceptor'
declare const cacheStores: {
MemoryCacheStore: typeof CacheInterceptor.MemoryCacheStore;
SqliteCacheStore: typeof CacheInterceptor.SqliteCacheStore;
}
export * from './util'
export * from './cookies'
export * from './eventsource'
export * from './fetch'
export * from './formdata'
export * from './diagnostics-channel'
export * from './websocket'
export * from './content-type'
export * from './cache'
export { Interceptable } from './mock-interceptor'
declare function globalThisInstall (): void
export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, Dispatcher1Wrapper, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, Socks5ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
export default Undici
declare namespace Undici {
const Dispatcher: typeof import('./dispatcher').default
const Pool: typeof import('./pool').default
const RedirectHandler: typeof import ('./handlers').RedirectHandler
const DecoratorHandler: typeof import ('./handlers').DecoratorHandler
const RetryHandler: typeof import ('./retry-handler').default
const BalancedPool: typeof import('./balanced-pool').default
const RoundRobinPool: typeof import('./round-robin-pool').default
const Client: typeof import('./client').default
const H2CClient: typeof import('./h2c-client').default
const buildConnector: typeof import('./connector').default
const errors: typeof import('./errors').default
const Agent: typeof import('./agent').default
const Dispatcher1Wrapper: typeof import('./dispatcher1-wrapper').default
const setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher
const getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher
const request: typeof import('./api').request
const stream: typeof import('./api').stream
const pipeline: typeof import('./api').pipeline
const connect: typeof import('./api').connect
const upgrade: typeof import('./api').upgrade
const MockClient: typeof import('./mock-client').default
const MockPool: typeof import('./mock-pool').default
const MockAgent: typeof import('./mock-agent').default
const SnapshotAgent: typeof import('./snapshot-agent').SnapshotAgent
const MockCallHistory: typeof import('./mock-call-history').MockCallHistory
const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog
const mockErrors: typeof import('./mock-errors').default
const ProxyAgent: typeof import('./proxy-agent').default
const Socks5ProxyAgent: typeof import('./socks5-proxy-agent').default
const fetch: typeof import('./fetch').fetch
const Headers: typeof import('./fetch').Headers
const Response: typeof import('./fetch').Response
const Request: typeof import('./fetch').Request
const FormData: typeof import('./formdata').FormData
const caches: typeof import('./cache').caches
const interceptors: typeof import('./interceptors').default
const cacheStores: {
MemoryCacheStore: typeof import('./cache-interceptor').default.MemoryCacheStore,
SqliteCacheStore: typeof import('./cache-interceptor').default.SqliteCacheStore
}
const install: typeof globalThisInstall
}
@@ -0,0 +1 @@
module.exports={C:{"50":0.00698,"53":0.00698,"55":0.00698,"56":0.00698,"57":0.00698,"58":0.00698,"59":0.00698,"60":0.00698,"61":0.00698,"62":0.00698,"64":0.00698,"65":0.00698,"66":0.00698,"115":0.02093,"120":1.91895,"121":4.02631,"136":0.03489,"140":0.09071,"147":0.02093,"150":0.04187,"151":0.00698,"152":0.01396,"153":0.01396,"154":0.11863,"155":0.23725,"156":0.24423,"157":0.00698,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 51 52 54 63 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 127 128 129 130 131 132 133 134 135 137 138 139 141 142 143 144 145 146 148 149 158 159 160 3.5","3.6":0.00698},D:{"56":0.02093,"60":0.00698,"61":0.00698,"62":0.00698,"63":0.01396,"64":0.00698,"65":0.02093,"66":0.02093,"67":0.00698,"68":0.01396,"69":0.04885,"70":0.00698,"71":0.00698,"72":0.00698,"73":0.0628,"74":0.02791,"75":0.01396,"76":0.00698,"77":0.00698,"78":0.00698,"79":0.02093,"80":0.00698,"81":0.00698,"83":0.03489,"84":0.00698,"86":0.05582,"87":0.02093,"90":0.02093,"92":0.01396,"95":0.02093,"98":0.04885,"100":0.00698,"101":1.00483,"103":0.73269,"104":0.78154,"105":0.78154,"106":0.80945,"107":0.76758,"108":0.78851,"109":0.90714,"110":0.76758,"111":0.77456,"112":0.7606,"113":0.03489,"114":0.1256,"116":1.46538,"117":0.71873,"118":3.16103,"119":4.11004,"120":4.89158,"122":0.00698,"124":0.80945,"125":0.00698,"126":0.00698,"127":0.00698,"128":0.00698,"131":1.49329,"132":0.02791,"133":1.9678,"134":0.49544,"135":0.4745,"136":0.46753,"137":0.54428,"138":0.56522,"139":0.46753,"140":0.55824,"141":0.57917,"142":1.68868,"143":0.01396,"144":0.06978,"145":0.1256,"146":0.50939,"147":0.04187,"148":0.35588,"149":1.03972,"150":0.43961,"151":3.99839,"152":4.50081,"153":3.09823,"154":0.79549,"155":0.00698,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 59 85 88 89 91 93 94 96 97 99 102 115 121 123 129 130 156 157"},F:{"46":0.00698,"50":0.00698,"51":0.01396,"52":0.00698,"53":0.00698,"54":0.02093,"55":0.02093,"56":0.03489,"57":0.01396,"60":0.00698,"90":0.00698,"95":0.0628,"101":0.02093,"131":0.00698,"133":0.02093,"134":0.1256,"135":1.37467,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 58 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 94 96 97 98 99 100 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00698,"90":0.00698,"92":0.05582,"105":0.00698,"108":0.00698,"109":0.02093,"113":0.00698,"119":1.9678,"120":2.07944,"135":0.00698,"140":0.00698,"146":0.01396,"147":0.03489,"148":0.02093,"149":0.05582,"150":0.02791,"151":0.19538,"152":1.03972,"153":1.40258,"154":0.3489,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 102 103 104 106 107 110 111 112 114 115 116 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 136 137 138 139 141 142 143 144 145"},E:{"5":0.00698,"27":0.04187,_:"4 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 16.0 16.1 16.2 16.3 16.4 17.0 17.2 17.3 17.4 18.0 18.1 18.2 18.3 18.4 18.5-18.7 26.0 26.1 26.2 27.1 27.2 TP","13.1":0.00698,"14.1":0.01396,"15.5":0.01396,"15.6":0.02791,"16.5":0.01396,"16.6":0.07676,"17.1":0.09071,"17.5":0.00698,"17.6":0.0628,"26.3":0.01396,"26.4":0.02093,"26.5":0.02093,"26.6":0.16049},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00026,"5.0-5.1":0.00026,"6.0-6.1":0,"7.0-7.1":0.00051,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00256,"11.0-11.2":0.00026,"11.3-11.4":0.00051,"12.0-12.1":0,"12.2-12.5":0.00666,"13.0-13.1":0,"13.2":0.00128,"13.3":0,"13.4-13.7":0.00026,"14.0-14.4":0.00103,"14.5-14.8":0.00154,"15.0-15.1":0.00154,"15.2-15.3":0.00103,"15.4":0.00128,"15.5":0.00154,"15.6-15.8":0.03331,"16.0":0.00256,"16.1":0.00461,"16.2":0.00256,"16.3":0.00564,"16.4":0.00128,"16.5":0.00205,"16.6-16.7":0.04638,"17.0":0.00179,"17.1":0.00256,"17.2":0.00256,"17.3":0.00384,"17.4":0.00538,"17.5":0.01051,"17.6-17.7":0.02716,"18.0":0.00564,"18.1":0.01128,"18.2":0.01538,"18.3":0.02665,"18.4":0.01666,"18.5-18.7":0.34416,"26.0":0.01666,"26.1":0.01691,"26.2":0.04408,"26.3":0.04767,"26.4":0.03485,"26.5":0.23346,"26.6":1.44047,"27.0":0.11045,"27.1":0,"27.2":0.00282},P:{"4":0.02386,"26":0.00795,"28":0.04773,"29":0.11136,"30":0.4375,_:"20 21 22 23 24 25 27 5.0-5.4 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 17.0 18.0 19.0","7.2-7.4":0.03182,"8.2":0.01591,"16.0":0.01591},I:{"0":0.00302,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.71621,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.01047,_:"6 7 8 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 1Line truncated
@@ -0,0 +1,204 @@
/**
* @fileoverview Rule to disallow unnecessary computed property keys in object literals
* @author Burak Yigit Kaya
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determines whether the computed key syntax is unnecessarily used for the given node.
* In particular, it determines whether removing the square brackets and using the content between them
* directly as the key (e.g. ['foo'] -> 'foo') would produce valid syntax and preserve the same behavior.
* Valid non-computed keys are only: identifiers, number literals and string literals.
* Only literals can preserve the same behavior, with a few exceptions for specific node types:
* Property
* - { ["__proto__"]: foo } defines a property named "__proto__"
* { "__proto__": foo } defines object's prototype
* PropertyDefinition
* - class C { ["constructor"]; } defines an instance field named "constructor"
* class C { "constructor"; } produces a parsing error
* - class C { static ["constructor"]; } defines a static field named "constructor"
* class C { static "constructor"; } produces a parsing error
* - class C { static ["prototype"]; } produces a runtime error (doesn't break the whole script)
* class C { static "prototype"; } produces a parsing error (breaks the whole script)
* MethodDefinition
* - class C { ["constructor"]() {} } defines a prototype method named "constructor"
* class C { "constructor"() {} } defines the constructor
* - class C { static ["prototype"]() {} } produces a runtime error (doesn't break the whole script)
* class C { static "prototype"() {} } produces a parsing error (breaks the whole script)
* @param {ASTNode} node The node to check. It can be `Property`, `PropertyDefinition` or `MethodDefinition`.
* @throws {Error} (Unreachable.)
* @returns {void} `true` if the node has useless computed key.
*/
function hasUselessComputedKey(node) {
if (!node.computed) {
return false;
}
const { key } = node;
if (key.type !== "Literal") {
return false;
}
const { value } = key;
if (typeof value !== "number" && typeof value !== "string") {
return false;
}
switch (node.type) {
case "Property":
if (node.parent.type === "ObjectExpression") {
return value !== "__proto__";
}
return true;
case "PropertyDefinition":
if (node.static) {
return value !== "constructor" && value !== "prototype";
}
return value !== "constructor";
case "MethodDefinition":
if (node.static) {
return value !== "prototype";
}
return value !== "constructor";
/* c8 ignore next */
default:
throw new Error(`Unexpected node type: ${node.type}`);
}
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
enforceForClassMembers: true,
},
],
docs: {
description:
"Disallow unnecessary computed property keys in objects and classes",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-useless-computed-key",
},
schema: [
{
type: "object",
properties: {
enforceForClassMembers: {
type: "boolean",
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
unnecessarilyComputedProperty:
"Unnecessarily computed property [{{property}}] found.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const [{ enforceForClassMembers }] = context.options;
/**
* Reports a given node if it violated this rule.
* @param {ASTNode} node The node to check.
* @returns {void}
*/
function check(node) {
if (hasUselessComputedKey(node)) {
const { key } = node;
context.report({
node,
messageId: "unnecessarilyComputedProperty",
data: { property: sourceCode.getText(key) },
fix(fixer) {
const leftSquareBracket = sourceCode.getTokenBefore(
key,
astUtils.isOpeningBracketToken,
);
const rightSquareBracket = sourceCode.getTokenAfter(
key,
astUtils.isClosingBracketToken,
);
// If there are comments between the brackets and the property name, don't do a fix.
if (
sourceCode.commentsExistBetween(
leftSquareBracket,
rightSquareBracket,
)
) {
return null;
}
const tokenBeforeLeftBracket =
sourceCode.getTokenBefore(leftSquareBracket);
// Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} })
const needsSpaceBeforeKey =
tokenBeforeLeftBracket.range[1] ===
leftSquareBracket.range[0] &&
!astUtils.canTokensBeAdjacent(
tokenBeforeLeftBracket,
sourceCode.getFirstToken(key),
);
const replacementKey =
(needsSpaceBeforeKey ? " " : "") + key.raw;
return fixer.replaceTextRange(
[
leftSquareBracket.range[0],
rightSquareBracket.range[1],
],
replacementKey,
);
},
});
}
}
/**
* A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`.
* @returns {void}
* @private
*/
function noop() {}
return {
Property: check,
MethodDefinition: enforceForClassMembers ? check : noop,
PropertyDefinition: enforceForClassMembers ? check : noop,
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/press/index.ts"],"sourcesContent":["import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet<Event>()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\"pointerup\", onPointerUp)\n window.removeEventListener(\"pointercancel\", onPointerCancel)\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions)\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions)\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n"],"names":[],"mappings":";;;;;;;;;AAYA;;;AAGG;AACH,SAAS,iBAAiB,CAAC,KAAmB,EAAA;IAC1C,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE;AACrD;AAEA,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAAS;AAOrD;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,KAAK,CACjB,gBAAmC,EACnC,YAA+B,EAC/B,UAA+B,EAAE,EAAA;AAEjC,IAAA,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,GAAG,YAAY,CACtD,gBAAgB,EAChB,OAAO,CACV;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,UAAwB,KAAI;AAC5C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,aAAwB;AAElD,QAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YLine truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"FD","8":"_HB"},B:{"1":"_J"},C:{"1":"_fD","8":"GD"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_oB","2":"F"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},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:"getElementsByClassName",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"scan-text.js","sources":["../../../src/icons/scan-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ScanText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA3VjVhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Ik0xNyAzaDJhMiAyIDAgMCAxIDIgMnYyIiAvPgogIDxwYXRoIGQ9Ik0yMSAxN3YyYTIgMiAwIDAgMS0yIDJoLTIiIC8+CiAgPHBhdGggZD0iTTcgMjFINWEyIDIgMCAwIDEtMi0ydi0yIiAvPgogIDxwYXRoIGQ9Ik03IDhoOCIgLz4KICA8cGF0aCBkPSJNNyAxMmgxMCIgLz4KICA8cGF0aCBkPSJNNyAxNmg2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/scan-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 ScanText = createLucideIcon('ScanText', [\n ['path', { d: 'M3 7V5a2 2 0 0 1 2-2h2', key: 'aa7l1z' }],\n ['path', { d: 'M17 3h2a2 2 0 0 1 2 2v2', key: '4qcy5o' }],\n ['path', { d: 'M21 17v2a2 2 0 0 1-2 2h-2', key: '6vwrx8' }],\n ['path', { d: 'M7 21H5a2 2 0 0 1-2-2v-2', key: 'ioqczr' }],\n ['path', { d: 'M7 8h8', key: '1jbsf9' }],\n ['path', { d: 'M7 12h10', key: 'b7w52i' }],\n ['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4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,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;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,250 @@
import DictionaryL33tMatcher from '../dictionary/variants/matching/l33t'
import DictionaryReverseMatcher from '../dictionary/variants/matching/reverse'
import DictionaryMatcher from '../dictionary/matching'
import Options from '../../Options'
import {
MatchOptions,
WordSequenceMatch,
DictionaryMatch,
MatcherBaseClass,
L33tMatch,
} from '../../types'
interface WordMatch {
word: string
i: number
j: number
rank: number
dictionaryName: string
}
/*
*-------------------------------------------------------------------------------
* word sequences (oneTwoThree, fourFiveSix) ------------------------------
*-------------------------------------------------------------------------------
*/
class MatchWordSequence extends MatcherBaseClass {
dictionary: DictionaryMatcher
dictionaryL33t: DictionaryL33tMatcher
dictionaryReverse: DictionaryReverseMatcher
constructor(options: Options) {
super(options)
this.dictionary = new DictionaryMatcher(this.options, true)
this.dictionaryL33t = new DictionaryL33tMatcher(this.options, true)
this.dictionaryReverse = new DictionaryReverseMatcher(this.options, true)
}
match(matchOptions: MatchOptions): WordSequenceMatch[] {
const { password } = matchOptions
// Get all dictionary matches first
const dictionaryMatches = this.dictionary.match(matchOptions)
const dictionaryL33tMatches = this.dictionaryL33t.match(matchOptions)
const dictionaryReverseMatches = this.dictionaryReverse.match(matchOptions)
const filteredDictionaryMatches = this.filterDictionaryMatches([
...dictionaryMatches,
...dictionaryL33tMatches,
...dictionaryReverseMatches,
])
// Convert dictionary matches to our internal format
const wordMatches = this.convertToWordMatches(filteredDictionaryMatches)
// Find sequences of consecutive words
return this.findWordSequences(wordMatches, password)
}
private filterDictionaryMatches(matches: (L33tMatch | DictionaryMatch)[]) {
// sort by start index, then by end index
return (
[...matches]
.sort((a, b) => {
if (a.i !== b.i) return a.i - b.i
if (a.j !== b.j) return a.j - b.j
// prefer forward over reversed
if (a.reversed !== b.reversed) return a.reversed ? 1 : -1
// prefer non-l33t
if (a.l33t !== b.l33t) return a.l33t ? 1 : -1
// prefer better rank
return a.rank - b.rank
})
// Keep only non-overlapping matches, favoring earlier ones
.reduce<DictionaryMatch[]>((acc, match) => {
const last = acc[acc.length - 1]
if (!last || match.i > last.j) {
acc.push(match)
}
return acc
}, [])
)
}
private convertToWordMatches(
dictionaryMatches: DictionaryMatch[],
): WordMatch[] {
return dictionaryMatches.map((match) => ({
word: match.matchedWord,
i: match.i,
j: match.j,
rank: match.rank,
dictionaryName: match.dictionaryName,
}))
}
private findWordSequences(
wordMatches: WordMatch[],
password: string,
): WordSequenceMatch[] {
const sequences: WordSequenceMatch[] = []
if (wordMatches.length === 0) {
return sequences
}
// Sort matches by start position
const sortedMatches = [...wordMatches].sort((a, b) => a.i - b.i)
// Find all possible sequences
for (let startIdx = 0; startIdx < sortedMatches.length; startIdx += 1) {
const sequencesFromStart = this.findSequencesFromStart(
sortedMatches,
startIdx,
password,
)
sequences.push(...sequencesFromStart)
}
return sequences
}
// eslint-disable-next-line max-statements
private findSequencesFromStart(
sortedMatches: WordMatch[],
startIdx: number,
password: string,
): WordSequenceMatch[] {
const sequences: WordSequenceMatch[] = []
const startMatch = sortedMatches[startIdx]
// Start with single word sequence
let currentSequence = [startMatch]
let currentEnd = startMatch.j
// Try to extend the sequence
for (
let nextIdx = startIdx + 1;
nextIdx < sortedMatches.length;
nextIdx += 1
) {
const nextMatch = sortedMatches[nextIdx]
// Only extend if the next word can form a valid sequence
if (this.isValidWordSequence(currentSequence, nextMatch, password)) {
currentSequence.push(nextMatch)
currentEnd = nextMatch.j
} else if (nextMatch.i > currentEnd) {
// Gap found, save current sequence and start new one
if (currentSequence.length > 1) {
sequences.push(
this.createWordSequenceMatch(currentSequence, password),
)
}
currentSequence = [nextMatch]
currentEnd = nextMatch.j
}
// If nextMatch.i <= currentEnd, it overlaps, so we skip it
}
// Don't forget the last sequence
if (currentSequence.length > 1) {
sequences.push(this.createWordSequenceMatch(currentSequence, password))
}
return sequences
}
private isValidWordSequence(
currentSequence: WordMatch[],
nextMatch: WordMatch,
password: string,
): boolean {
// Get the text between the last word and the next word
const lastWord = currentSequence[currentSequence.length - 1]
const textBetween = password.slice(lastWord.j + 1, nextMatch.i)
// Check for common word separators
const separators = ['', ' ', '-', '_', '.', '']
// For simple concatenation (no separator)
const isSimpleConcat = textBetween === ''
// For snake_case or kebab-case, check for separators
const hasValidSeparator = separators.some((sep) => textBetween === sep)
// For camelCase, we need to check if the next word starts with uppercase
// and there's no separator (or just a single character that could be uppercase)
const isCamelCase =
textBetween.length === 1 &&
textBetween === textBetween.toUpperCase() &&
textBetween !== textBetween.toLowerCase()
return hasValidSeparator || isSimpleConcat || isCamelCase
}
private createWordSequenceMatch(
sequence: WordMatch[],
password: string,
): WordSequenceMatch {
const firstMatch = sequence[0]
const lastMatch = sequence[sequence.length - 1]
const words = sequence.map((match) => match.word)
// Determine if sequence is ascending (by rank)
const ranks = sequence.map((match) => match.rank)
const ascending = ranks.every((rank, i) => i === 0 || rank >= ranks[i - 1])
// Use the most common dictionary name, or the first one
const dictionaryNames = sequence.map((match) => match.dictionaryName)
const dictionaryName =
this.getMostCommon(dictionaryNames) || firstMatch.dictionaryName
return {
pattern: 'wordSequence',
i: firstMatch.i,
j: lastMatch.j,
token: password.slice(firstMatch.i, lastMatch.j + 1),
words,
wordCount: words.length,
dictionaryName,
ascending,
}
}
private getMostCommon<T>(array: T[]): T | null {
if (array.length === 0) return null
const counts = new Map<T, number>()
let maxCount = 0
let mostCommon: T | null = null
array.forEach((item) => {
const count = (counts.get(item) || 0) + 1
counts.set(item, count)
if (count > maxCount) {
maxCount = count
mostCommon = item
}
})
return mostCommon
}
}
export default MatchWordSequence
@@ -0,0 +1,33 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface ArrayConstructor {
/**
* Creates an array from an async iterator or iterable object.
* @param iterableOrArrayLike An async iterator or array-like object to convert to an array.
*/
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
/**
* Creates an array from an async iterator or iterable object.
*
* @param iterableOrArrayLike An async iterator or array-like object to convert to an array.
* @param mapfn A mapping function to call on every element of itarableOrArrayLike.
* Each return value is awaited before being added to result array.
* @param thisArg Value of 'this' used when executing mapfn.
*/
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,uDAAyI;AACzI,0CA0CqB;AACrB,mEAAuE;AAEvE,mDAA4G;AAE5G,+DAA0E;AAC1E,iEAAoH;AA6CpH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,MAIX,SAAQ,sBAA8F;IAapG;;OAEG;IACH,YACY,WAA2B,EACnC,OAAuB;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHP,gBAAW,GAAX,WAAW,CAAgB;QAyCvC,+BAA+B;QACvB,mBAAc,GAAG,IAAI,GAAG,EAAoC,CAAC;QAErE,uCAAuC;QACtB,uBAAkB,GAAG,IAAI,GAAG,CAAC,6BAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAEhH,2FAA2F;QACnF,qBAAgB,GAAG,CAAC,KAAmB,EAAE,SAAkB,EAAW,EAAE;YAC5E,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACxD,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QACnH,CAAC,CAAC;QA/CE,IAAI,CAAC,aAAa,GAAG,OAAO,EAAE,YAAY,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,aAAa,GAAG,OAAO,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,sCAAsC;QACtC,OAAO,KAAK,CAAC,iBAAiB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAES,yBAAyB,CAAC,MAA0B;QAC1D,QAAQ,MAAiC,EAAE,CAAC;YACxC,KAAK,wBAAwB;gBACzB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,EAAE,CAAC;oBACtC,MAAM,IAAI,KAAK,CAAC,kDAAkD,MAAM,GAAG,CAAC,CAAC;gBACjF,CAAC;gBACD,MAAM;YAEV,KAAK,oBAAoB;gBACrB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,EAAE,CAAC;oBACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,MAAM,GAAG,CAAC,CAAC;gBACpF,CAAC;gBACD,MAAM;YAEV,KAAK,YAAY;gBACb,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,uDAAuD,MAAM,GAAG,CAAC,CAAC;gBACtF,CAAC;gBACD,MAAM;YAEV,KAAK,MAAM;gBACP,2CAA2C;gBAC3C,MAAM;QACd,CAAC;IACL,CAAC;IAES,4BAA4B,CAAC,MAAsD;QACzF,QAAQ,MAAsC,EAAE,CAAC;YAC7C,KAAK,uBAAuB;gBACxB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;oBAC9B,MAAM,IAAI,KAAK,CAAC,iDAAiD,MAAM,GAAG,CAAC,CAAC;gBAChF,CAAC;gBACD,MAAM;YAEV,KAAK,iCAAiC,CAAC;YACvC,KAAK,sCAAsC;gBACvC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;oBAChC,MAAM,IAAI,KAAKLine truncated
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _nullishReceiverError;
function _nullishReceiverError(r) {
throw new TypeError("Cannot set property of null or undefined.");
}
//# sourceMappingURL=nullishReceiverError.js.map
@@ -0,0 +1,10 @@
"use strict";
module.exports = function (it) {
const { pattern, globDisabled } = it;
return `
No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found.
Please check for typing mistakes in the pattern.
`.trimStart();
};
@@ -0,0 +1,9 @@
import type { TSESLint } from '@typescript-eslint/utils';
export declare function getFixOrSuggest<MessageId extends string>({ fixOrSuggest, suggestion, }: {
fixOrSuggest: 'fix' | 'none' | 'suggest';
suggestion: TSESLint.SuggestionReportDescriptor<MessageId>;
}): {
fix: TSESLint.ReportFixFunction;
} | {
suggest: TSESLint.SuggestionReportDescriptor<MessageId>[];
} | undefined;
@@ -0,0 +1,306 @@
import { createRoute } from './route'
import { useMatch } from './useMatch'
import { useLoaderDeps } from './useLoaderDeps'
import { useLoaderData } from './useLoaderData'
import { useSearch } from './useSearch'
import { useParams } from './useParams'
import { useNavigate } from './useNavigate'
import { useRouter } from './useRouter'
import { useRouteContext } from './useRouteContext'
import type { UseParamsRoute } from './useParams'
import type { UseMatchRoute } from './useMatch'
import type { UseSearchRoute } from './useSearch'
import type {
AnyContext,
AnyRoute,
AnyRouter,
Constrain,
ConstrainLiteral,
FileBaseRouteOptions,
FileRoutesByPath,
LazyRouteOptions,
Register,
RegisteredRouter,
ResolveParams,
Route,
RouteById,
RouteConstraints,
RouteIds,
RouteLoaderEntry,
UpdatableRouteOptions,
UseNavigateResult,
} from '@tanstack/router-core'
import type { UseLoaderDepsRoute } from './useLoaderDeps'
import type { UseLoaderDataRoute } from './useLoaderData'
import type { UseRouteContextRoute } from './useRouteContext'
/**
* Creates a file-based Route factory for a given path.
*
* Used by TanStack Router's file-based routing to associate a file with a
* route. The returned function accepts standard route options. In normal usage
* the `path` string is inserted and maintained by the `tsr` generator.
*
* @param path File path literal for the route (usually auto-generated).
* @returns A function that accepts Route options and returns a Route instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
*/
export function createFileRoute<
TFilePath extends keyof FileRoutesByPath,
TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
TFullPath extends RouteConstraints['TFullPath'] =
FileRoutesByPath[TFilePath]['fullPath'],
>(
path?: TFilePath,
): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {
return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {
silent: true,
}).createRoute
}
/**
@deprecated It's no longer recommended to use the `FileRoute` class directly.
Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.
*/
export class FileRoute<
TFilePath extends keyof FileRoutesByPath,
TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
TFullPath extends RouteConstraints['TFullPath'] =
FileRoutesByPath[TFilePath]['fullPath'],
> {
silent?: boolean
constructor(
public path?: TFilePath,
_opts?: { silent: boolean },
) {
this.silent = _opts?.silent
}
createRoute = <
TRegister = Register,
TSearchValidator = undefined,
TParams = ResolveParams<TPath>,
TRouteContextFn = AnyContext,
TBeforeLoadFn = AnyContext,
TLoaderDeps extends Record<string, any> = {},
TLoaderFn = undefined,
TChildren = unknown,
TSSR = unknown,
const TMiddlewares = unknown,
THandlers = undefined,
>(
options?: FileBaseRouteOptions<
TRegister,
TParentRoute,
TId,
TPath,
TSearchValidator,
TParams,
TLoaderDeps,
TLoaderFn,
AnyContext,
TRouteContextFn,
TBeforeLoadFn,
AnyContext,
TSSR,
TMiddlewares,
THandlers
> &
UpdatableRouteOptions<
TParentRoute,
TId,
TFullPath,
TParams,
TSearchValidator,
TLoaderFn,
TLoaderDeps,
AnyContext,
TRouteContextFn,
TBeforeLoadFn
>,
): Route<
TRegister,
TParentRoute,
TPath,
TFullPath,
TFilePath,
TId,
TSearchValidator,
TParams,
AnyContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
unknown,
TSSR,
TMiddlewares,
THandlers
> => {
if (process.env.NODE_ENV !== 'production') {
if (!this.silent) {
console.warn(
'Warning: FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.',
)
}
}
const route = createRoute(options as any)
;(route as any).isRoot = false
return route as any
}
}
/**
@deprecated It's recommended not to split loaders into separate files.
Instead, place the loader function in the main route file via `createFileRoute`.
*/
export function FileRouteLoader<
TFilePath extends keyof FileRoutesByPath,
TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],
>(
_path: TFilePath,
): <TLoaderFn>(
loaderFn: Constrain<
TLoaderFn,
RouteLoaderEntry<
Register,
TRoute['parentRoute'],
TRoute['types']['id'],
TRoute['types']['params'],
TRoute['types']['loaderDeps'],
TRoute['types']['routerContext'],
TRoute['types']['routeContextFn'],
TRoute['types']['beforeLoadFn']
>
>,
) => TLoaderFn {
if (process.env.NODE_ENV !== 'production') {
console.warn(
`Warning: FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the main route file, inside the \`createFileRoute('/path/to/file')(options)\` options`,
)
}
return (loaderFn) => loaderFn as any
}
declare module '@tanstack/router-core' {
export interface LazyRoute<in out TRoute extends AnyRoute> {
useMatch: UseMatchRoute<TRoute['id']>
useRouteContext: UseRouteContextRoute<TRoute['id']>
useSearch: UseSearchRoute<TRoute['id']>
useParams: UseParamsRoute<TRoute['id']>
useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>
useLoaderData: UseLoaderDataRoute<TRoute['id']>
useNavigate: () => UseNavigateResult<TRoute['fullPath']>
}
}
export class LazyRoute<TRoute extends AnyRoute> {
options: {
id: string
} & LazyRouteOptions
constructor(
opts: {
id: string
} & LazyRouteOptions,
) {
this.options = opts
}
useMatch: UseMatchRoute<TRoute['id']> = (opts) => {
return useMatch({
select: opts?.select,
from: this.options.id,
structuralSharing: opts?.structuralSharing,
} as any) as any
}
useRouteContext: UseRouteContextRoute<TRoute['id']> = (opts) => {
return useRouteContext({ ...(opts as any), from: this.options.id })
}
useSearch: UseSearchRoute<TRoute['id']> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.options.id,
} as any) as any
}
useParams: UseParamsRoute<TRoute['id']> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.options.id,
} as any) as any
}
useLoaderDeps: UseLoaderDepsRoute<TRoute['id']> = (opts) => {
return useLoaderDeps({ ...opts, from: this.options.id } as any)
}
useLoaderData: UseLoaderDataRoute<TRoute['id']> = (opts) => {
return useLoaderData({ ...opts, from: this.options.id } as any)
}
useNavigate = (): UseNavigateResult<TRoute['fullPath']> => {
const router = useRouter()
return useNavigate({ from: router.routesById[this.options.id].fullPath })
}
}
/**
* Creates a lazily-configurable code-based route stub by ID.
*
* Use this for code-splitting with code-based routes. The returned function
* accepts only non-critical route options like `component`, `pendingComponent`,
* `errorComponent`, and `notFoundComponent` which are applied when the route
* is matched.
*
* @param id Route ID string literal to associate with the lazy route.
* @returns A function that accepts lazy route options and returns a `LazyRoute`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction
*/
export function createLazyRoute<
TRouter extends AnyRouter = RegisteredRouter,
TId extends string = string,
TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>,
>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {
return (opts: LazyRouteOptions) => {
return new LazyRoute<TRoute>({
id: id,
...opts,
})
}
}
/**
* Creates a lazily-configurable file-based route stub by file path.
*
* Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).
* The returned function accepts only non-critical route options like
* `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.
*
* @param id File path literal for the route file.
* @returns A function that accepts lazy route options and returns a `LazyRoute`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
*/
export function createLazyFileRoute<
TFilePath extends keyof FileRoutesByPath,
TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],
>(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute<TRoute> {
if (typeof id === 'object') {
return new LazyRoute<TRoute>(id) as any
}
return (opts: LazyRouteOptions) => new LazyRoute<TRoute>({ id, ...opts })
}
@@ -0,0 +1 @@
{"version":3,"file":"bell-ring.js","sources":["../../../src/icons/bell-ring.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BellRing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAuMjY4IDIxYTIgMiAwIDAgMCAzLjQ2NCAwIiAvPgogIDxwYXRoIGQ9Ik0yMiA4YzAtMi4zLS44LTQuMy0yLTYiIC8+CiAgPHBhdGggZD0iTTMuMjYyIDE1LjMyNkExIDEgMCAwIDAgNCAxN2gxNmExIDEgMCAwIDAgLjc0LTEuNjczQzE5LjQxIDEzLjk1NiAxOCAxMi40OTkgMTggOEE2IDYgMCAwIDAgNiA4YzAgNC40OTktMS40MTEgNS45NTYtMi43MzggNy4zMjYiIC8+CiAgPHBhdGggZD0iTTQgMkMyLjggMy43IDIgNS43IDIgOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/bell-ring\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 BellRing = createLucideIcon('BellRing', [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0', key: 'vwvbt9' }],\n ['path', { d: 'M22 8c0-2.3-.8-4.3-2-6', key: '5bb3ad' }],\n [\n 'path',\n {\n d: 'M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326',\n key: '11g9vi',\n },\n ],\n ['path', { d: 'M4 2C2.8 3.7 2 5.7 2 8', key: 'tap9e0' }],\n]);\n\nexport default BellRing;\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,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7D,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,CA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AA,CAAA;AAAA,CAAA,CACA,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;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,74 @@
import { C as ProxifiedObject, c as Proxified, m as ProxifiedFunctionCall, x as ProxifiedModule } from "./types-D5FmR3uJ.js";
import { VariableDeclarator } from "@babel/types";
//#region src/helpers/deep-merge.d.ts
declare function deepMergeObject(magicast: Proxified<any>, object: any): void;
//#endregion
//#region src/helpers/nuxt.d.ts
declare function addNuxtModule(magicast: ProxifiedModule<any>, name: string, optionsKey?: string, options?: any): void;
//#endregion
//#region src/helpers/vite.d.ts
interface AddVitePluginOptions {
/**
* The import path of the plugin
*/
from: string;
/**
* The import name of the plugin
* @default "default"
*/
imported?: string;
/**
* The name of local variable
*/
constructor: string;
/**
* The options of the plugin
*/
options?: Record<string, any>;
/**
* The index in the plugins array where the plugin should be inserted at.
* By default, the plugin is appended to the array.
*/
index?: number;
}
interface UpdateVitePluginConfigOptions {
/**
* The import path of the plugin
*/
from: string;
/**
* The import name of the plugin
* @default "default"
*/
imported?: string;
}
declare function addVitePlugin(magicast: ProxifiedModule<any>, plugin: AddVitePluginOptions): boolean;
declare function findVitePluginCall(magicast: ProxifiedModule<any>, plugin: UpdateVitePluginConfigOptions | string): ProxifiedFunctionCall | undefined;
declare function updateVitePluginConfig(magicast: ProxifiedModule<any>, plugin: UpdateVitePluginConfigOptions | string, handler: Record<string, any> | ((args: any[]) => any[])): boolean;
//#endregion
//#region src/helpers/config.d.ts
declare function getDefaultExportOptions(magicast: ProxifiedModule<any>): ProxifiedObject<any>;
/**
* Returns the vite config object from a variable declaration thats
* exported as the default export.
*
* Example:
*
* ```js
* const config = {};
* export default config;
* ```
*
* @param magicast the module
*
* @returns an object containing the proxified config object and the
* declaration "parent" to attach the modified config to later.
* If no config declaration is found, undefined is returned.
*/
declare function getConfigFromVariableDeclaration(magicast: ProxifiedModule<any>): {
declaration: VariableDeclarator;
config: ProxifiedObject<any> | undefined;
};
//#endregion
export { AddVitePluginOptions, UpdateVitePluginConfigOptions, addNuxtModule, addVitePlugin, deepMergeObject, findVitePluginCall, getConfigFromVariableDeclaration, getDefaultExportOptions, updateVitePluginConfig };
@@ -0,0 +1 @@
{"version":3,"file":"badge-plus.js","sources":["../../../src/icons/badge-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BadgePlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy44NSA4LjYyYTQgNCAwIDAgMSA0Ljc4LTQuNzcgNCA0IDAgMCAxIDYuNzQgMCA0IDQgMCAwIDEgNC43OCA0Ljc4IDQgNCAwIDAgMSAwIDYuNzQgNCA0IDAgMCAxLTQuNzcgNC43OCA0IDQgMCAwIDEtNi43NSAwIDQgNCAwIDAgMS00Ljc4LTQuNzcgNCA0IDAgMCAxIDAtNi43NloiIC8+CiAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSI4IiB5Mj0iMTYiIC8+CiAgPGxpbmUgeDE9IjgiIHgyPSIxNiIgeTE9IjEyIiB5Mj0iMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/badge-plus\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 BadgePlus = createLucideIcon('BadgePlus', [\n [\n 'path',\n {\n d: 'M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z',\n key: '3c2336',\n },\n ],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '16', key: '10p56q' }],\n ['line', { x1: '8', x2: '16', y1: '12', y2: '12', key: '1jonct' }],\n]);\n\nexport default BadgePlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,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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AAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,89 @@
import bruteforceMatcher from './matcher/bruteforce/feedback.mjs';
import dateMatcher from './matcher/date/feedback.mjs';
import dictionaryMatcher from './matcher/dictionary/feedback.mjs';
import regexMatcher from './matcher/regex/feedback.mjs';
import repeatMatcher from './matcher/repeat/feedback.mjs';
import sequenceMatcher from './matcher/sequence/feedback.mjs';
import spatialMatcher from './matcher/spatial/feedback.mjs';
import separatorMatcher from './matcher/separator/feedback.mjs';
import wordSequenceMatcher from './matcher/wordSequence/feedback.mjs';
const defaultFeedback = {
warning: null,
suggestions: []
};
/*
* -------------------------------------------------------------------------------
* Generate feedback ---------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class Feedback {
constructor(options) {
this.options = options;
this.matchers = {};
this.defaultFeedback = {
warning: null,
suggestions: []
};
this.setDefaultSuggestions();
this.matchers = {
bruteforce: bruteforceMatcher,
date: dateMatcher,
dictionary: dictionaryMatcher,
regex: regexMatcher,
repeat: repeatMatcher,
sequence: sequenceMatcher,
spatial: spatialMatcher,
separator: separatorMatcher,
wordSequence: wordSequenceMatcher
};
Object.entries(this.options.matchers).forEach(([key, matcher]) => {
if (matcher.feedback) {
this.matchers[key] = matcher.feedback;
}
});
}
setDefaultSuggestions() {
this.defaultFeedback.suggestions.push(this.options.translations.suggestions.useWords, this.options.translations.suggestions.noNeed);
}
getFeedback(score, sequence) {
if (sequence.length === 0) {
return this.defaultFeedback;
}
if (score > 2) {
return defaultFeedback;
}
const extraFeedback = this.options.translations.suggestions.anotherWord;
const longestMatch = this.getLongestMatch(sequence);
let feedback = this.getMatchFeedback(longestMatch, sequence.length === 1);
if (feedback !== null && feedback !== undefined) {
feedback.suggestions.unshift(extraFeedback);
} else {
feedback = {
warning: null,
suggestions: [extraFeedback]
};
}
return feedback;
}
getLongestMatch(sequence) {
let longestMatch = sequence[0];
// ignore first entry
for (let i = 1; i < sequence.length; i += 1) {
const match = sequence[i];
if (match.token.length > longestMatch.token.length) {
longestMatch = match;
}
}
return longestMatch;
}
getMatchFeedback(match, isSoleMatch) {
if (this.matchers[match.pattern]) {
return this.matchers[match.pattern](this.options, match, isSoleMatch);
}
return defaultFeedback;
}
}
export { Feedback as default };
//# sourceMappingURL=Feedback.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"scan-line.js","sources":["../../../src/icons/scan-line.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ScanLine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA3VjVhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Ik0xNyAzaDJhMiAyIDAgMCAxIDIgMnYyIiAvPgogIDxwYXRoIGQ9Ik0yMSAxN3YyYTIgMiAwIDAgMS0yIDJoLTIiIC8+CiAgPHBhdGggZD0iTTcgMjFINWEyIDIgMCAwIDEtMi0ydi0yIiAvPgogIDxwYXRoIGQ9Ik03IDEyaDEwIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/scan-line\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 ScanLine = createLucideIcon('ScanLine', [\n ['path', { d: 'M3 7V5a2 2 0 0 1 2-2h2', key: 'aa7l1z' }],\n ['path', { d: 'M17 3h2a2 2 0 0 1 2 2v2', key: '4qcy5o' }],\n ['path', { d: 'M21 17v2a2 2 0 0 1-2 2h-2', key: '6vwrx8' }],\n ['path', { d: 'M7 21H5a2 2 0 0 1-2-2v-2', key: 'ioqczr' }],\n ['path', { d: 'M7 12h10', key: 'b7w52i' }],\n]);\n\nexport default ScanLine;\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,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,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1D,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,54 @@
{
"name": "vp-runtime-helper",
"version": "1.0.10",
"description": "Vite plugin runtime helper.",
"types": "./dist/index.d.ts",
"module": "./dist/index.mjs",
"main": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
"engines": {
"node": ">=14.18.0",
"vite": ">=3.1.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fengxinming/vite-plugins.git",
"directory": "packages/vp-runtime-helper"
},
"keywords": [
"vite-plugin",
"vp-runtime-helper"
],
"author": "Jesse Feng <fxm0016@126.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/fengxinming/vite-plugins/issues"
},
"homepage": "https://fengxinming.github.io/vite-plugins/",
"dependencies": {
"@types/fs-extra": "^11.0.4",
"base-log-factory": "^2.1.4",
"blf-debug-appender": "^1.0.2",
"figlet": "^1.8.0",
"fs-extra": "^11.3.0",
"picocolors": "^1.0.0"
},
"devDependencies": {
"@rollup/plugin-typescript": "^12.1.2",
"vite": "^6.1.0"
},
"files": [
"dist"
],
"scripts": {
"build": "vite build",
"watch": "vite build --watch",
"release": "npm publish"
}
}
@@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PredefinedFormatToCheckFunction = void 0;
const enums_1 = require("./enums");
/*
These format functions are taken from `tslint-consistent-codestyle/naming-convention`:
https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/rules/namingConventionRule.ts#L603-L645
The license for the code can be viewed here:
https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/LICENSE
*/
/*
Why not regex here? Because it's actually really, really difficult to create a regex to handle
all of the unicode cases, and we have many non-english users that use non-english characters.
https://gist.github.com/mathiasbynens/6334847
*/
function isPascalCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toUpperCase() && !name.includes('_')));
}
function isStrictPascalCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toUpperCase() && hasStrictCamelHumps(name, true)));
}
function isCamelCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toLowerCase() && !name.includes('_')));
}
function isStrictCamelCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toLowerCase() && hasStrictCamelHumps(name, false)));
}
function hasStrictCamelHumps(name, isUpper) {
function isUppercaseChar(char) {
return char === char.toUpperCase() && char !== char.toLowerCase();
}
if (name.startsWith('_')) {
return false;
}
for (let i = 1; i < name.length; ++i) {
if (name[i] === '_') {
return false;
}
if (isUpper === isUppercaseChar(name[i])) {
if (isUpper) {
return false;
}
}
else {
isUpper = !isUpper;
}
}
return true;
}
function isSnakeCase(name) {
return (name.length === 0 ||
(name === name.toLowerCase() && validateUnderscores(name)));
}
function isUpperCase(name) {
return (name.length === 0 ||
(name === name.toUpperCase() && validateUnderscores(name)));
}
/** Check for leading trailing and adjacent underscores */
function validateUnderscores(name) {
if (name.startsWith('_')) {
return false;
}
let wasUnderscore = false;
for (let i = 1; i < name.length; ++i) {
if (name[i] === '_') {
if (wasUnderscore) {
return false;
}
wasUnderscore = true;
}
else {
wasUnderscore = false;
}
}
return !wasUnderscore;
}
exports.PredefinedFormatToCheckFunction = {
[enums_1.PredefinedFormats.camelCase]: isCamelCase,
[enums_1.PredefinedFormats.PascalCase]: isPascalCase,
[enums_1.PredefinedFormats.snake_case]: isSnakeCase,
[enums_1.PredefinedFormats.strictCamelCase]: isStrictCamelCase,
[enums_1.PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[enums_1.PredefinedFormats.UPPER_CASE]: isUpperCase,
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_z","548":"B"},B:{"1":"_K","516":"_I"},C:{"1":"_qR","2":"_PK","676":"_oD _YH","1700":"_TC _KD _sB"},D:{"1":"_RN _kC","2":"_Y","676":"_cC","804":"_GB _yE _rD"},E:{"1":"_QE","2":"_4","548":"_yP _qE","676":"ND","804":"_fJ _GR"},F:{"1":"_8F aC","2":"_VE","804":"_QJ _sB"},G:{"2":"_JI","2052":"_WJ"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"D","292":"A"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"A","548":"B"},O:{"1":"bC"},P:{"1":"_DF","804":"_OD"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"Fullscreen API",D:true};
@@ -0,0 +1,221 @@
import { expect, test, vi } from "vitest";
import * as z from "zod/v4";
/**
* Schema methods are exposed in a way that works when detached from the
* schema instance — `const opt = schema.optional; opt()` must produce a
* working `ZodOptional`, not a corrupt one. This pattern is used in real
* code (e.g. `arr.map(schema.parse)`, `arr.map(schema.optional)`,
* destructuring inside utility functions).
*
* This test caught a regression in colinhacks/zod#5870 where a memory
* optimization moved methods to the prototype and made `this`-binding
* required, silently breaking any detached usage.
*/
const probeArgs: Record<string, unknown[]> = {
// ZodType
optional: [],
exactOptional: [],
nullable: [],
nullish: [],
array: [],
describe: ["x"],
brand: [],
readonly: [],
default: ["fallback"],
catch: ["fallback"],
// _ZodString
min: [1],
max: [10],
length: [5],
nonempty: [],
trim: [],
toLowerCase: [],
toUpperCase: [],
// ZodString format methods
email: [],
url: [],
uuid: [],
cuid: [],
cuid2: [],
ulid: [],
base64: [],
base64url: [],
ipv4: [],
ipv6: [],
// ZodNumber
int: [],
positive: [],
negative: [],
finite: [],
};
test("detached parse-family methods work without `this` binding", () => {
const schema = z.string();
const { parse, safeParse } = schema;
expect(parse("hello")).toBe("hello");
expect(safeParse("hello").success).toBe(true);
});
test("detached schema.optional() returns a working ZodOptional", () => {
const schema = z.string();
const opt = schema.optional;
const detached = opt();
expect(detached).toBeInstanceOf(z.ZodOptional);
expect(detached.safeParse("hello").success).toBe(true);
expect(detached.safeParse(undefined).success).toBe(true);
expect(detached.safeParse(123).success).toBe(false);
});
test("detached schema.nullable() returns a working ZodNullable", () => {
const schema = z.string();
const nul = schema.nullable;
const detached = nul();
expect(detached).toBeInstanceOf(z.ZodNullable);
expect(detached.safeParse("hello").success).toBe(true);
expect(detached.safeParse(null).success).toBe(true);
expect(detached.safeParse(123).success).toBe(false);
});
test("detached schema.array() returns a working ZodArray", () => {
const schema = z.string();
const arr = schema.array;
const detached = arr();
expect(detached).toBeInstanceOf(z.ZodArray);
expect(detached.safeParse(["a", "b"]).success).toBe(true);
expect(detached.safeParse([1, 2]).success).toBe(false);
});
test("detached schema.describe() returns a described schema", () => {
const schema = z.string();
const describe = schema.describe;
const described = describe("hello world");
expect(described.description).toBe("hello world");
});
test("detached refinement still validates", () => {
const schema = z.string();
const refine = schema.refine;
const refined = refine((s: string) => s.startsWith("x"), "must start with x");
expect(refined.safeParse("xhello").success).toBe(true);
expect(refined.safeParse("hello").success).toBe(false);
});
test("detached chained calls work — schema.optional then parse", () => {
const schema = z.string();
const opt = schema.optional;
const optionalSchema = opt();
const { parse } = optionalSchema;
expect(parse("hi")).toBe("hi");
expect(parse(undefined)).toBe(undefined);
});
test("detached parse can be called as a free function", () => {
const schema = z.string();
const parse = schema.parse;
const inputs = ["a", "b", "c"];
const results = inputs.map((v) => parse(v));
expect(results).toEqual(["a", "b", "c"]);
});
test("detached methods on z.number() work", () => {
const schema = z.number();
const min = schema.min;
const max = schema.max;
const positive = schema.positive;
expect(min(5).safeParse(3).success).toBe(false);
expect(max(5).safeParse(7).success).toBe(false);
expect(positive().safeParse(-1).success).toBe(false);
});
test("detached object methods work", () => {
const schema = z.object({ a: z.string(), b: z.number() });
const pick = schema.pick;
const omit = schema.omit;
const partial = schema.partial;
const exactPartial = schema.exactPartial;
const extend = schema.extend;
expect(Object.keys(pick({ a: true })._zod.def.shape)).toEqual(["a"]);
expect(Object.keys(omit({ a: true })._zod.def.shape)).toEqual(["b"]);
expect(partial().safeParse({}).success).toBe(true);
expect(exactPartial().safeParse({}).success).toBe(true);
expect(exactPartial().safeParse({ a: undefined }).success).toBe(false);
const extended = extend({ c: z.boolean() });
expect(Object.keys(extended._zod.def.shape).sort()).toEqual(["a", "b", "c"]);
});
// Sweep across many builder methods at once. If any of them break with the `const m = schema.foo; m(...)` pattern, this test will report which.
test("broad sweep: detaching builder methods does not throw or produce a corrupt schema", () => {
const stringSchema = z.string();
const numberSchema = z.number();
const broken: Array<{ method: string; reason: string }> = [];
for (const [methodName, args] of Object.entries(probeArgs)) {
const target: any = methodName in stringSchema ? stringSchema : methodName in numberSchema ? numberSchema : null;
if (!target) continue;
const detached = target[methodName] as Function | undefined;
if (typeof detached !== "function") continue;
try {
const result = detached(...args);
// If the detached call returned a schema, sanity-check it parses its base type. (e.g. `optional()` should accept its inner type.)
if (result && typeof result === "object" && "_zod" in result && typeof (result as any).safeParse === "function") {
const probeValue = target === stringSchema ? "x" : 1;
const r = (result as any).safeParse(probeValue);
// success or a clean failure are both fine — we only fail on throw or on a schema with corrupt internal state (innerType undefined etc).
if (r === undefined || (typeof r === "object" && !("success" in r))) {
broken.push({ method: methodName, reason: "safeParse returned malformed result" });
}
}
} catch (err: any) {
broken.push({ method: methodName, reason: err?.message ?? String(err) });
}
}
expect(broken).toEqual([]);
});
test("vi.spyOn wraps a prototype method that was never read", () => {
const schema = z.object({ a: z.string() });
const spy = vi.spyOn(schema, "safeParse").mockReturnValue({ success: true, data: { a: "mocked" } });
expect(schema.safeParse({})).toEqual({ success: true, data: { a: "mocked" } });
expect(spy).toHaveBeenCalledOnce();
spy.mockRestore();
expect(schema.safeParse({ a: "x" })).toEqual({ success: true, data: { a: "x" } });
expect(schema.safeParse({}).success).toBe(false);
const json = vi.spyOn(schema, "toJSONSchema").mockReturnValue({ type: "null" } as any);
expect(schema.toJSONSchema()).toEqual({ type: "null" });
json.mockRestore();
expect(schema.toJSONSchema().type).toBe("object");
});
test("a getter member answers a bare read without a receiver", () => {
const schema = z.string();
const get = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(schema), "spa")!.get!;
expect(get.call(undefined)).toBeUndefined();
expect(schema.spa).toBe(schema.safeParseAsync);
});
@@ -0,0 +1 @@
module.exports={C:{"47":0.00287,"49":0.00573,"50":0.00287,"51":0.00573,"52":0.02007,"54":0.00287,"56":0.00287,"57":0.00287,"58":0.00573,"60":0.00287,"64":0.00287,"65":0.00287,"67":0.00287,"69":0.00287,"72":0.01147,"73":0.00287,"75":0.00287,"82":0.00287,"110":0.00287,"112":0.00573,"114":0.00573,"115":0.18636,"120":0.04587,"121":0.09748,"122":0.00573,"123":0.0086,"124":0.00573,"125":0.00287,"127":0.06021,"130":0.00287,"131":0.00287,"133":0.00287,"136":0.00573,"138":0.01147,"139":0.00573,"140":0.05447,"141":0.0086,"142":0.00287,"143":0.00287,"144":0.00287,"145":0.00573,"146":0.00287,"147":0.0086,"148":0.0086,"149":0.01147,"150":0.0172,"151":0.02007,"152":0.03154,"153":0.14335,"154":0.43865,"155":0.71102,"156":0.57053,"157":0.02867,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 53 55 59 61 62 63 66 68 70 71 74 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 113 116 117 118 119 126 128 129 132 134 135 137 158 159 160 3.5 3.6"},D:{"38":0.00287,"50":0.00287,"52":0.00287,"56":0.0172,"57":0.00287,"58":0.00573,"62":0.00287,"64":0.00287,"65":0.00573,"67":0.00287,"68":0.00287,"69":0.00573,"70":0.00573,"71":0.00573,"72":0.0086,"73":0.00573,"74":0.0086,"75":0.00287,"76":0.00287,"77":0.00573,"78":0.00287,"79":0.0086,"80":0.01147,"81":0.01434,"83":0.00573,"84":0.00287,"86":0.00573,"87":0.00573,"88":0.00573,"89":0.00287,"90":0.00287,"93":0.01147,"94":0.00287,"95":0.0086,"98":0.10035,"101":0.0258,"102":0.00287,"103":0.03154,"104":0.01434,"105":0.0086,"106":0.01434,"107":0.01147,"108":0.01147,"109":0.40425,"110":0.01434,"111":0.02007,"112":0.0086,"113":0.00573,"114":0.0086,"115":0.00287,"116":0.0344,"117":0.01147,"118":0.21503,"119":0.11755,"120":0.10895,"121":0.00287,"122":0.04874,"123":0.0258,"124":0.0344,"125":0.0086,"126":0.01434,"127":0.04587,"128":0.0344,"129":0.01147,"130":0.02007,"131":0.04874,"132":0.00287,"133":0.06881,"134":0.08601,"135":0.05734,"136":0.06594,"137":0.09461,"138":0.12902,"139":0.07741,"140":0.09174,"141":0.07168,"142":0.21503,"143":0.0258,"144":0.0344,"145":0.03154,"146":0.18922,"147":0.10608,"148":0.17489,"149":0.18922,"150":0.47306,"151":1.9725,"152":5.23514,"153":4.31484,"154":0.76549,"155":0.01147,"156":0.00287,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 47 48 49 51 53 54 55 59 60 61 63 66 85 91 92 96 97 99 100 157"},F:{"44":0.00287,"62":0.00287,"66":0.00287,"76":0.00287,"79":0.00573,"89":0.00287,"90":0.00287,"94":0.00287,"95":0.01434,"100":0.00287,"101":0.01147,"102":0.00287,"106":0.01147,"107":0.00287,"111":0.00287,"112":0.00287,"113":0.00287,"114":0.06881,"115":0.00287,"116":0.00287,"119":0.00287,"120":0.00573,"122":0.00287,"124":0.00287,"126":0.02294,"127":0.00287,"131":0.01147,"132":0.00287,"133":0.0172,"134":0.10035,"135":1.38189,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 63 64 65 67 68 69 70 71 72 73 74 75 77 78 80 81 82 83 84 85 86 87 88 91 92 93 96 97 98 99 103 104 105 108 109 110 117 118 121 123 125 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.01147,"16":0.00287,"17":0.00287,"18":0.0258,"84":0.00573,"89":0.01147,"90":0.01147,"92":0.07454,"100":0.0172,"109":0.00573,"111":0.00287,"114":0.00287,"119":0.04874,"120":0.04587,"122":0.02867,"123":0.0086,"131":0.00287,"132":0.00287,"135":0.00287,"136":0.00287,"138":0.00573,"139":0.02007,"140":0.0344,"141":0.00573,"142":0.0086,"143":0.02294,"144":0.0086,"145":0.0258,"146":0.01434,"147":0.02867,"148":0.0258,"149":0.12328,"150":0.06307,"151":0.20929,"152":1.03212,"153":1.29302,"154":0.34404,_:"12 13 15 79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 112 113 115 116 117 118 121 124 125 126 127 128 129 130 133 134 137"},E:{"10":0.00287,"27":0.0086,_:"4 5 6 7 8 9 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 15.1 15.4 15.5 16.0 16.1 16.3 16.4 16.5 17.0 17.3 18.2 18.5-18.7 27.1 27.2 TP","11.1":0.00573,"13.1":0.0086,"14.1":0.00573,"15.2-15.3":0.00287,"15.6":0.04587,"16.2":0.00287,"16.6":0.0086,"17.1":0.0086,"17.2":0.00287,"17.4":0.01434,"17.5":0.01434,"17.6":0.02867,"18.0":0.00287,"18.1":0.00287,"18.3":0.0086,"18.4":0.00287,"26.0":0.02007,"26.1":0.00287,"26.2":0.0086,"26.3":0.01434,"26.4":0.0086,"26.5":0.04014,"26.6":0.09174},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00094,"5.0-5.1":0.00094,"6.0-6.1":0,"7.0-7.1":0.00188,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00939,"11.0-11.2":0.00094,"11.3-11.4":0.00188,"12.0-12.1":0,"12.2-12.5":0.02441,"13.0-13.1":0,"13.2":0.00469,"13.3":0,"13.4-13.7":0.00094,"14.0-14.4":0.00375,"14.5-14.8":0.00563,"15.0-15.1":0.00563,"15.2-15.3":0.00375,"15.4":0.00469,"15.5":0.00563,"15.6-15.8":0.12203,"16.0":0.00939,"16.1":0.0169,"16.2":0.00939,"16.3":0.02065,"16.4":0.00469,"16.5":0.00751,"16.6-16.7":0.16991,"17.0":0.00657,"17.1":0.00939,"1Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"bell-minus.js","sources":["../../../src/icons/bell-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BellMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAuMjY4IDIxYTIgMiAwIDAgMCAzLjQ2NCAwIiAvPgogIDxwYXRoIGQ9Ik0xNSA4aDYiIC8+CiAgPHBhdGggZD0iTTE2LjI0MyAzLjc1N0E2IDYgMCAwIDAgNiA4YzAgNC40OTktMS40MTEgNS45NTYtMi43MzggNy4zMjZBMSAxIDAgMCAwIDQgMTdoMTZhMSAxIDAgMCAwIC43NC0xLjY3M0E5LjQgOS40IDAgMCAxIDE4LjY2NyAxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/bell-minus\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 BellMinus = createLucideIcon('BellMinus', [\n ['path', { d: 'M10.268 21a2 2 0 0 0 3.464 0', key: 'vwvbt9' }],\n ['path', { d: 'M15 8h6', key: '8ybuxh' }],\n [\n 'path',\n {\n d: 'M16.243 3.757A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673A9.4 9.4 0 0 1 18.667 12',\n key: 'bdwj86',\n },\n ],\n]);\n\nexport default BellMinus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CA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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,2 @@
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}var i=a((function(e,t){!function e(t){var r,n,o,a,i,s;function u(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?u(r):r);return n}function l(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplaLine truncated
//# sourceMappingURL=esquery.esm.min.js.map
@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dynamicRef = void 0;
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const ref_1 = require("../core/ref");
const def = {
keyword: "$dynamicRef",
schemaType: "string",
code: (cxt) => dynamicRef(cxt, cxt.schema),
};
function dynamicRef(cxt, ref) {
const { gen, keyword, it } = cxt;
if (ref[0] !== "#")
throw new Error(`"${keyword}" only supports hash fragment reference`);
const anchor = ref.slice(1);
if (it.allErrors) {
_dynamicRef();
}
else {
const valid = gen.let("valid", false);
_dynamicRef(valid);
cxt.ok(valid);
}
function _dynamicRef(valid) {
// TODO the assumption here is that `recursiveRef: #` always points to the root
// of the schema object, which is not correct, because there may be $id that
// makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
// Because of that 2 tests in recursiveRef.json fail.
// This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
// (This problem is not tested in JSON-Schema-Test-Suite)
if (it.schemaEnv.root.dynamicAnchors[anchor]) {
const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
}
else {
_callRef(it.validateName, valid)();
}
}
function _callRef(validate, valid) {
return valid
? () => gen.block(() => {
(0, ref_1.callRef)(cxt, validate);
gen.let(valid, true);
})
: () => (0, ref_1.callRef)(cxt, validate);
}
}
exports.dynamicRef = dynamicRef;
exports.default = def;
//# sourceMappingURL=dynamicRef.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_w","2":"_g","33":"_L"},D:{"1":"_DP","33":"_UC"},E:{"1":"_YB","33":"mB","164":"_k"},F:{"1":"_dD","2":"_fB"},G:{"1":"_t","33":"_FG","164":"lC"},H:{"2":"1D"},I:{"1":"_PE","164":"_LB"},J:{"1":"A","33":"D"},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:4,C:"CSS3 Box-shadow",D:true};
@@ -0,0 +1,13 @@
import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'
import { RouterServer } from './RouterServer'
import { renderRouterToStream } from './renderRouterToStream'
export const defaultStreamHandler = defineHandlerCallback(
({ request, router, responseHeaders }) =>
renderRouterToStream({
request,
router,
responseHeaders,
children: <RouterServer router={router} />,
}),
)
@@ -0,0 +1,16 @@
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | [1-9] ( [0-9] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
@@ -0,0 +1,87 @@
2.0.2 / 2025-06-06
==================
* Migrate to `String.prototype.slice()`
2.0.1 / 2021-01-03
==================
* Fix returning values from `Object.prototype`
2.0.0 / 2020-04-19
==================
* Drop support for Node.js 0.6
* Fix messaging casing of `418 I'm a Teapot`
* Remove code 306
* Remove `status[code]` exports; use `status.message[code]`
* Remove `status[msg]` exports; use `status.code[msg]`
* Rename `425 Unordered Collection` to standard `425 Too Early`
* Rename `STATUS_CODES` export to `message`
* Return status message for `statuses(code)` when given code
1.5.0 / 2018-03-27
==================
* Add `103 Early Hints`
1.4.0 / 2017-10-20
==================
* Add `STATUS_CODES` export
1.3.1 / 2016-11-11
==================
* Fix return type in JSDoc
1.3.0 / 2016-05-17
==================
* Add `421 Misdirected Request`
* perf: enable strict mode
1.2.1 / 2015-02-01
==================
* Fix message for status 451
- `451 Unavailable For Legal Reasons`
1.2.0 / 2014-09-28
==================
* Add `208 Already Repored`
* Add `226 IM Used`
* Add `306 (Unused)`
* Add `415 Unable For Legal Reasons`
* Add `508 Loop Detected`
1.1.1 / 2014-09-24
==================
* Add missing 308 to `codes.json`
1.1.0 / 2014-09-21
==================
* Add `codes.json` for universal support
1.0.4 / 2014-08-20
==================
* Package cleanup
1.0.3 / 2014-06-08
==================
* Add 308 to `.redirect` category
1.0.2 / 2014-03-13
==================
* Add `.retry` category
1.0.1 / 2014-03-12
==================
* Initial release
@@ -0,0 +1 @@
{"version":3,"file":"cone.js","sources":["../../../src/icons/cone.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Cone\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjAuOSAxOC41NS04LTE1Ljk4YTEgMSAwIDAgMC0xLjggMGwtOCAxNS45OCIgLz4KICA8ZWxsaXBzZSBjeD0iMTIiIGN5PSIxOSIgcng9IjkiIHJ5PSIzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/cone\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 Cone = createLucideIcon('Cone', [\n ['path', { d: 'm20.9 18.55-8-15.98a1 1 0 0 0-1.8 0l-8 15.98', key: '53pte7' }],\n ['ellipse', { cx: '12', cy: '19', rx: '9', ry: '3', key: '1ji25f' }],\n]);\n\nexport default Cone;\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,CAAgD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7E,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACrE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,147 @@
/**
* @fileoverview Rule to enforce declarations in program or function body root.
* @author Brandon Mills
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const validParent = new Set([
"Program",
"StaticBlock",
"ExportNamedDeclaration",
"ExportDefaultDeclaration",
]);
const validBlockStatementParent = new Set([
"FunctionDeclaration",
"FunctionExpression",
"ArrowFunctionExpression",
]);
/**
* Finds the nearest enclosing context where this rule allows declarations and returns its description.
* @param {ASTNode} node Node to search from.
* @returns {string} Description. One of "program", "function body", "class static block body".
*/
function getAllowedBodyDescription(node) {
let { parent } = node;
while (parent) {
if (parent.type === "StaticBlock") {
return "class static block body";
}
if (astUtils.isFunction(parent)) {
return "function body";
}
({ parent } = parent);
}
return "program";
}
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: ["functions", { blockScopedFunctions: "allow" }],
docs: {
description:
"Disallow variable or `function` declarations in nested blocks",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-inner-declarations",
},
schema: [
{
enum: ["functions", "both"],
},
{
type: "object",
properties: {
blockScopedFunctions: {
enum: ["allow", "disallow"],
},
},
additionalProperties: false,
},
],
messages: {
moveDeclToRoot: "Move {{type}} declaration to {{body}} root.",
},
},
create(context) {
const both = context.options[0] === "both";
const { blockScopedFunctions } = context.options[1];
const sourceCode = context.sourceCode;
const ecmaVersion = context.languageOptions.ecmaVersion;
/**
* Ensure that a given node is at a program or function body's root.
* @param {ASTNode} node Declaration node to check.
* @returns {void}
*/
function check(node) {
const parent = node.parent;
if (
parent.type === "BlockStatement" &&
validBlockStatementParent.has(parent.parent.type)
) {
return;
}
if (validParent.has(parent.type)) {
return;
}
context.report({
node,
messageId: "moveDeclToRoot",
data: {
type:
node.type === "FunctionDeclaration"
? "function"
: "variable",
body: getAllowedBodyDescription(node),
},
});
}
return {
FunctionDeclaration(node) {
const isInStrictCode = sourceCode.getScope(node).upper.isStrict;
if (
blockScopedFunctions === "allow" &&
ecmaVersion >= 2015 &&
isInStrictCode
) {
return;
}
check(node);
},
VariableDeclaration(node) {
if (both && node.kind === "var") {
check(node);
}
},
};
},
};
@@ -0,0 +1 @@
export { renderToReadableStream, renderToStaticMarkup, renderToString } from "./server";
@@ -0,0 +1,379 @@
# Search Param Validation Patterns Reference
Comprehensive validation patterns for TanStack Router search params across all supported validation approaches.
## Zod with `@tanstack/zod-adapter`
Zod v3 does not implement Standard Schema, so the `@tanstack/zod-adapter` wrapper is required. Always use `fallback()` from the adapter instead of zod's `.catch()`. Always wrap with `zodValidator()`.
### Basic Types
```tsx
import { zodValidator, fallback } from '@tanstack/zod-adapter'
import { z } from 'zod'
const schema = z.object({
count: fallback(z.number(), 0),
name: fallback(z.string(), ''),
active: fallback(z.boolean(), true),
})
export const Route = createFileRoute('/example')({
validateSearch: zodValidator(schema),
})
```
### Optional Params
```tsx
const schema = z.object({
// Truly optional — can be undefined in component
searchTerm: z.string().optional(),
// Optional in URL but always has a value in component
page: fallback(z.number(), 1).default(1),
})
```
### Default Values
```tsx
const schema = z.object({
// .default() means the param is optional during navigation
// but always present (with default) when reading
page: fallback(z.number(), 1).default(1),
sort: fallback(z.enum(['name', 'date', 'price']), 'name').default('name'),
ascending: fallback(z.boolean(), true).default(true),
})
```
### Array Params
```tsx
const schema = z.object({
tags: fallback(z.string().array(), []).default([]),
selectedIds: fallback(z.number().array(), []).default([]),
})
// URL: /items?tags=%5B%22react%22%2C%22typescript%22%5D&selectedIds=%5B1%2C2%2C3%5D
// Parsed: { tags: ['react', 'typescript'], selectedIds: [1, 2, 3] }
```
### Nested Object Params
```tsx
const schema = z.object({
filters: fallback(
z.object({
status: z.enum(['active', 'inactive']).optional(),
tags: z.string().array().optional(),
priceRange: z
.object({
min: z.number().min(0),
max: z.number().min(0),
})
.optional(),
}),
{},
).default({}),
})
```
### Enum with Constraints
```tsx
const schema = z.object({
sort: fallback(z.enum(['newest', 'oldest', 'price']), 'newest').default(
'newest',
),
page: fallback(z.number().int().min(1).max(1000), 1).default(1),
limit: fallback(z.number().int().min(10).max(100), 20).default(20),
})
```
### Discriminated Union
```tsx
const schema = z.object({
searchType: fallback(z.enum(['basic', 'advanced']), 'basic').default('basic'),
query: fallback(z.string(), '').default(''),
// Advanced-only fields are optional
category: z.string().optional(),
minPrice: z.number().optional(),
maxPrice: z.number().optional(),
})
```
For true discriminated union validation:
```tsx
const basicSearch = z.object({
searchType: z.literal('basic'),
query: z.string(),
})
const advancedSearch = z.object({
searchType: z.literal('advanced'),
query: z.string(),
category: z.string(),
minPrice: z.number(),
maxPrice: z.number(),
})
const schema = z.discriminatedUnion('searchType', [basicSearch, advancedSearch])
export const Route = createFileRoute('/search')({
validateSearch: zodValidator(schema),
})
```
### Input Transforms (String to Number)
When using the zod adapter with transforms, configure `input` and `output` types:
```tsx
const schema = z.object({
page: fallback(z.number(), 1).default(1),
filter: fallback(z.string(), '').default(''),
})
export const Route = createFileRoute('/items')({
// Default: input type used for navigation, output type used for reading
validateSearch: zodValidator(schema),
// Advanced: swap input/output inference
// validateSearch: zodValidator({ schema, input: 'output', output: 'input' }),
})
```
### Schema Composition
```tsx
const paginationSchema = z.object({
page: fallback(z.number().int().positive(), 1).default(1),
limit: fallback(z.number().int().min(1).max(100), 20).default(20),
})
const sortSchema = z.object({
sortBy: z.enum(['name', 'date', 'relevance']).optional(),
sortOrder: z.enum(['asc', 'desc']).optional(),
})
// Compose for specific routes
const productSearchSchema = paginationSchema.extend({
category: z.string().optional(),
inStock: fallback(z.boolean(), true).default(true),
})
const userSearchSchema = paginationSchema.merge(sortSchema).extend({
role: z.enum(['admin', 'user']).optional(),
})
```
---
## Valibot (Standard Schema)
Valibot 1.0+ implements Standard Schema. No adapter wrapper needed — pass the schema directly to `validateSearch`. The `@tanstack/valibot-adapter` is optional and only needed for explicit input/output type control.
```bash
npm install valibot
```
```tsx
import { createFileRoute } from '@tanstack/react-router'
import * as v from 'valibot'
const productSearchSchema = v.object({
page: v.optional(v.fallback(v.number(), 1), 1),
filter: v.optional(v.fallback(v.string(), ''), ''),
sort: v.optional(
v.fallback(v.picklist(['newest', 'oldest', 'price']), 'newest'),
'newest',
),
})
export const Route = createFileRoute('/products')({
// Pass schema directly — Standard Schema compliant
validateSearch: productSearchSchema,
component: ProductsPage,
})
function ProductsPage() {
const { page, filter, sort } = Route.useSearch()
return <div>Page {page}</div>
}
```
### Valibot with Constraints
```tsx
import * as v from 'valibot'
const schema = v.object({
page: v.optional(
v.fallback(v.pipe(v.number(), v.integer(), v.minValue(1)), 1),
1,
),
query: v.optional(v.pipe(v.string(), v.minLength(1), v.maxLength(100))),
tags: v.optional(v.fallback(v.array(v.string()), []), []),
})
```
### Valibot with Adapter (Alternative)
If you need explicit input/output type control:
```tsx
import { valibotValidator } from '@tanstack/valibot-adapter'
import * as v from 'valibot'
const schema = v.object({
page: v.optional(v.fallback(v.number(), 1), 1),
})
export const Route = createFileRoute('/items')({
validateSearch: valibotValidator(schema),
})
```
---
## ArkType (Standard Schema)
ArkType 2.0-rc+ implements Standard Schema. No adapter needed — pass the type directly to `validateSearch`. The `@tanstack/arktype-adapter` is optional and only needed for explicit input/output type control.
```bash
npm install arktype
```
```tsx
import { createFileRoute } from '@tanstack/react-router'
import { type } from 'arktype'
const productSearchSchema = type({
page: 'number = 1',
filter: 'string = ""',
sort: '"newest" | "oldest" | "price" = "newest"',
})
export const Route = createFileRoute('/products')({
// Pass directly — Standard Schema compliant
validateSearch: productSearchSchema,
component: ProductsPage,
})
function ProductsPage() {
const { page, filter, sort } = Route.useSearch()
return <div>Page {page}</div>
}
```
### ArkType with Constraints
```tsx
import { type } from 'arktype'
const searchSchema = type({
'query?': 'string>0&<=100',
page: 'number>0 = 1',
'sortBy?': "'name'|'date'|'relevance'",
'filters?': 'string[]',
})
```
---
## Manual Validation Function
For full control without any library. The function receives raw JSON-parsed (but unvalidated) search params.
```tsx
import { createFileRoute } from '@tanstack/react-router'
type ProductSearch = {
page: number
filter: string
sort: 'newest' | 'oldest' | 'price'
}
export const Route = createFileRoute('/products')({
validateSearch: (search: Record<string, unknown>): ProductSearch => ({
page: Number(search?.page ?? 1),
filter: (search.filter as string) || '',
sort:
search.sort === 'newest' ||
search.sort === 'oldest' ||
search.sort === 'price'
? search.sort
: 'newest',
}),
component: ProductsPage,
})
function ProductsPage() {
const { page, filter, sort } = Route.useSearch()
return <div>Page {page}</div>
}
```
### Manual Validation with Error Throwing
If `validateSearch` throws, the route's `errorComponent` renders instead:
```tsx
export const Route = createFileRoute('/products')({
validateSearch: (search: Record<string, unknown>) => {
const page = Number(search.page)
if (isNaN(page) || page < 1) {
throw new Error('Invalid page number')
}
return { page }
},
errorComponent: ({ error }) => <div>Bad search params: {error.message}</div>,
})
```
---
## Pattern: Object with `parse` Method
Any object with a `.parse()` method works as `validateSearch`:
```tsx
const mySchema = {
parse: (input: Record<string, unknown>) => ({
page: Number(input.page ?? 1),
query: String(input.query ?? ''),
}),
}
export const Route = createFileRoute('/search')({
validateSearch: mySchema,
})
```
---
## Dates in Search Params
Never put `Date` objects in search params. Always use ISO strings:
```tsx
const schema = z.object({
// Store as string, parse in component if needed
startDate: z.string().optional(),
endDate: z.string().optional(),
})
// In component:
function DateFilter() {
const { startDate } = Route.useSearch()
const date = startDate ? new Date(startDate) : null
return <div>{date?.toLocaleDateString()}</div>
}
// When navigating:
;<Link search={(prev) => ({ ...prev, startDate: new Date().toISOString() })}>
Set Start Date
</Link>
```
@@ -0,0 +1,46 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
test("parse async test", async () => {
const schema1 = z.string().refine(async (_val) => false);
expect(() => schema1.parse("asdf")).toThrow();
const schema2 = z.string().refine((_val) => Promise.resolve(true));
return await expect(() => schema2.parse("asdf")).toThrow();
});
test("parseAsync async test", async () => {
const schema1 = z.string().refine(async (_val) => true);
await schema1.parseAsync("asdf");
const schema2 = z.string().refine(async (_val) => false);
return await expect(schema2.parseAsync("asdf")).rejects.toBeDefined();
// expect(async () => await schema2.parseAsync('asdf')).toThrow();
});
test("parseAsync async test", async () => {
// expect.assertions(2);
const schema1 = z.string().refine((_val) => Promise.resolve(true));
const v1 = await schema1.parseAsync("asdf");
expect(v1).toEqual("asdf");
const schema2 = z.string().refine((_val) => Promise.resolve(false));
await expect(schema2.parseAsync("asdf")).rejects.toBeDefined();
const schema3 = z.string().refine((_val) => Promise.resolve(true));
await expect(schema3.parseAsync("asdf")).resolves.toEqual("asdf");
return await expect(schema3.parseAsync("qwer")).resolves.toEqual("qwer");
});
test("parseAsync async with value", async () => {
const schema1 = z.string().refine(async (val) => {
return val.length > 5;
});
await expect(schema1.parseAsync("asdf")).rejects.toBeDefined();
const v = await schema1.parseAsync("asdf123");
return await expect(v).toEqual("asdf123");
});
@@ -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 FolderSearch = createLucideIcon("FolderSearch", [
[
"path",
{
d: "M10.7 20H4a2 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.9H20a2 2 0 0 1 2 2v4.1",
key: "1bw5m7"
}
],
["path", { d: "m21 21-1.9-1.9", key: "1g2n9r" }],
["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }]
]);
export { FolderSearch as default };
//# sourceMappingURL=folder-search.js.map
@@ -0,0 +1,19 @@
let passiveSupported = false;
if (typeof window !== 'undefined') {
try {
const options = Object.defineProperty({}, 'passive', {
get() {
passiveSupported = true;
return true;
},
});
// @ts-ignore
window.addEventListener('test', options, options);
// @ts-ignore
window.removeEventListener('test', options, options);
}
catch (err) {
passiveSupported = false;
}
}
export const nonPassive = passiveSupported ? { passive: false } : false;
@@ -0,0 +1,191 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{
var $rule = this
, $definition = 'definition' + $lvl
, $rDef = $rule.definition
, $closingBraces = '';
var $validate = $rDef.validate;
var $compile, $inline, $macro, $ruleValidate, $validateCode;
}}
{{? $isData && $rDef.$data }}
{{
$validateCode = 'keywordValidate' + $lvl;
var $validateSchema = $rDef.validateSchema;
}}
var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition;
var {{=$validateCode}} = {{=$definition}}.validate;
{{??}}
{{
$ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
if (!$ruleValidate) return;
$schemaValue = 'validate.schema' + $schemaPath;
$validateCode = $ruleValidate.code;
$compile = $rDef.compile;
$inline = $rDef.inline;
$macro = $rDef.macro;
}}
{{?}}
{{
var $ruleErrs = $validateCode + '.errors'
, $i = 'i' + $lvl
, $ruleErr = 'ruleErr' + $lvl
, $asyncKeyword = $rDef.async;
if ($asyncKeyword && !it.async)
throw new Error('async keyword in sync schema');
}}
{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}}
var {{=$errs}} = errors;
var {{=$valid}};
{{## def.callRuleValidate:
{{=$validateCode}}.call(
{{? it.opts.passContext }}this{{??}}self{{?}}
{{? $compile || $rDef.schema === false }}
, {{=$data}}
{{??}}
, {{=$schemaValue}}
, {{=$data}}
, validate.schema{{=it.schemaPath}}
{{?}}
, {{# def.dataPath }}
{{# def.passParentData }}
, rootData
)
#}}
{{## def.extendErrors:_inline:
for (var {{=$i}}={{=$errs}}; {{=$i}}<errors; {{=$i}}++) {
var {{=$ruleErr}} = vErrors[{{=$i}}];
if ({{=$ruleErr}}.dataPath === undefined)
{{=$ruleErr}}.dataPath = (dataPath || '') + {{= it.errorPath }};
{{# _inline ? 'if (\{\{=$ruleErr\}\}.schemaPath === undefined) {' : '' }}
{{=$ruleErr}}.schemaPath = "{{=$errSchemaPath}}";
{{# _inline ? '}' : '' }}
{{? it.opts.verbose }}
{{=$ruleErr}}.schema = {{=$schemaValue}};
{{=$ruleErr}}.data = {{=$data}};
{{?}}
}
#}}
{{? $isData && $rDef.$data }}
{{ $closingBraces += '}'; }}
if ({{=$schemaValue}} === undefined) {
{{=$valid}} = true;
} else {
{{? $validateSchema }}
{{ $closingBraces += '}'; }}
{{=$valid}} = {{=$definition}}.validateSchema({{=$schemaValue}});
if ({{=$valid}}) {
{{?}}
{{?}}
{{? $inline }}
{{? $rDef.statements }}
{{= $ruleValidate.validate }}
{{??}}
{{=$valid}} = {{= $ruleValidate.validate }};
{{?}}
{{?? $macro }}
{{# def.setupNextLevel }}
{{
$it.schema = $ruleValidate.validate;
$it.schemaPath = '';
}}
{{# def.setCompositeRule }}
{{ var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); }}
{{# def.resetCompositeRule }}
{{= $code }}
{{??}}
{{# def.beginDefOut}}
{{# def.callRuleValidate }}
{{# def.storeDefOut:def_callRuleValidate }}
{{? $rDef.errors === false }}
{{=$valid}} = {{? $asyncKeyword }}await {{?}}{{= def_callRuleValidate }};
{{??}}
{{? $asyncKeyword }}
{{ $ruleErrs = 'customErrors' + $lvl; }}
var {{=$ruleErrs}} = null;
try {
{{=$valid}} = await {{= def_callRuleValidate }};
} catch (e) {
{{=$valid}} = false;
if (e instanceof ValidationError) {{=$ruleErrs}} = e.errors;
else throw e;
}
{{??}}
{{=$ruleErrs}} = null;
{{=$valid}} = {{= def_callRuleValidate }};
{{?}}
{{?}}
{{?}}
{{? $rDef.modifying }}
if ({{=$parentData}}) {{=$data}} = {{=$parentData}}[{{=$parentDataProperty}}];
{{?}}
{{= $closingBraces }}
{{## def.notValidationResult:
{{? $rDef.valid === undefined }}
!{{? $macro }}{{=$nextValid}}{{??}}{{=$valid}}{{?}}
{{??}}
{{= !$rDef.valid }}
{{?}}
#}}
{{? $rDef.valid }}
{{? $breakOnError }} if (true) { {{?}}
{{??}}
if ({{# def.notValidationResult }}) {
{{ $errorKeyword = $rule.keyword; }}
{{# def.beginDefOut}}
{{# def.error:'custom' }}
{{# def.storeDefOut:def_customError }}
{{? $inline }}
{{? $rDef.errors }}
{{? $rDef.errors != 'full' }}
{{# def.extendErrors:true }}
{{?}}
{{??}}
{{? $rDef.errors === false}}
{{= def_customError }}
{{??}}
if ({{=$errs}} == errors) {
{{= def_customError }}
} else {
{{# def.extendErrors:true }}
}
{{?}}
{{?}}
{{?? $macro }}
{{# def.extraError:'custom' }}
{{??}}
{{? $rDef.errors === false}}
{{= def_customError }}
{{??}}
if (Array.isArray({{=$ruleErrs}})) {
if (vErrors === null) vErrors = {{=$ruleErrs}};
else vErrors = vErrors.concat({{=$ruleErrs}});
errors = vErrors.length;
{{# def.extendErrors:false }}
} else {
{{= def_customError }}
}
{{?}}
{{?}}
} {{? $breakOnError }} else { {{?}}
{{?}}
@@ -0,0 +1,17 @@
/**
* @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 SquareArrowDownRight = createLucideIcon("SquareArrowDownRight", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "m8 8 8 8", key: "1imecy" }],
["path", { d: "M16 8v8H8", key: "1lbpgo" }]
]);
export { SquareArrowDownRight as default };
//# sourceMappingURL=square-arrow-down-right.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ssePollingExample.js","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":";;;;;AAeA,6CAAyC;AACzC,gDAAgD;AAChD,wDAA8D;AAC9D,sEAA+E;AAC/E,6CAAqE;AACrE,2EAAqE;AACrE,gDAAwB;AAExB,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KAChC,CACJ,CAAC;IAEF,6EAA6E;IAC7E,MAAM,CAAC,IAAI,CACP,WAAW,EACX,0GAA0G,EAC1G,EAAE,EACF,KAAK,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE;QAC5C,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,I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GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,0DAA0D,IAAI,MAAM,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;ILine truncated
@@ -0,0 +1,71 @@
/// <reference types="node"/>
import {
PathLike,
readFile as fsReadFile,
readFileSync as fsReadFileSync,
writeFile as fsWriteFile,
writeFileSync as fsWriteFileSync,
} from "fs";
import { Url } from "url";
export type Path = PathLike | Url;
export interface FS {
readFile: typeof fsReadFile;
readFileSync: typeof fsReadFileSync;
writeFile: typeof fsWriteFile;
writeFileSync: typeof fsWriteFileSync;
}
export type JFReadOptions =
| {
encoding?: string | null | undefined;
flag?: string | undefined;
throws?: boolean | undefined;
fs?: FS | undefined;
reviver?: ((key: any, value: any) => any) | undefined;
}
| string
| null
| undefined;
export type JFWriteOptions =
| {
encoding?: string | null | undefined;
mode?: string | number | undefined;
flag?: string | undefined;
fs?: FS | undefined;
EOL?: string | undefined;
spaces?: string | number | undefined;
replacer?: ((key: string, value: any) => any) | undefined;
}
| string
| null;
export type ReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void;
export type WriteCallback = (err: NodeJS.ErrnoException | null) => void;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback}
*/
export function readFile(file: Path, options: JFReadOptions, callback: ReadCallback): void;
export function readFile(file: Path, callback: ReadCallback): void;
export function readFile(file: Path, options?: JFReadOptions): Promise<any>;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options}
*/
export function readFileSync(file: Path, options?: JFReadOptions): any;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#writefilefilename-obj-options-callback}
*/
export function writeFile(file: Path, obj: any, options: JFWriteOptions, callback: WriteCallback): void;
export function writeFile(file: Path, obj: any, callback: WriteCallback): void;
export function writeFile(file: Path, obj: any, options?: JFWriteOptions): Promise<void>;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options}
*/
export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void;
@@ -0,0 +1 @@
{"version":3,"file":"swatch-book.js","sources":["../../../src/icons/swatch-book.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SwatchBook\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTdhNCA0IDAgMCAxLTggMFY1YTIgMiAwIDAgMSAyLTJoNGEyIDIgMCAwIDEgMiAyWiIgLz4KICA8cGF0aCBkPSJNMTYuNyAxM0gxOWEyIDIgMCAwIDEgMiAydjRhMiAyIDAgMCAxLTIgMkg3IiAvPgogIDxwYXRoIGQ9Ik0gNyAxN2guMDEiIC8+CiAgPHBhdGggZD0ibTExIDggMi4zLTIuM2EyLjQgMi40IDAgMCAxIDMuNDA0LjAwNEwxOC42IDcuNmEyLjQgMi40IDAgMCAxIC4wMjYgMy40MzRMOS45IDE5LjgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/swatch-book\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 SwatchBook = createLucideIcon('SwatchBook', [\n ['path', { d: 'M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z', key: '1ldrpk' }],\n ['path', { d: 'M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7', key: '11i5po' }],\n ['path', { d: 'M 7 17h.01', key: '1euzgo' }],\n [\n 'path',\n {\n d: 'm11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8',\n key: 'o2gii7',\n },\n ],\n]);\n\nexport default SwatchBook;\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,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACtF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AAA,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,54 @@
import { PropsWithChildren } from "./types.js";
import { FC } from "./base.js";
//#region src/jsx/context.d.ts
export interface Context<T> extends FC<PropsWithChildren<{
value: T;
}>> {
values: T[];
Provider: FC<PropsWithChildren<{
value: T;
}>>;
}
export declare const globalContexts: Context<unknown>[];
/** Per-render context store, isolated per request so values never leak across renders. */
type RenderStore = WeakMap<Context<unknown>, unknown[]>;
/**
* Establish the request-scoped context store for a render.
*
* `resumeStore` continues a suspended subtree in the same store on the fallback
* path (ignored when `AsyncLocalStorage` is available, where isolation is
* automatic).
*
* Without `AsyncLocalStorage` a render can't be followed across `await`, so the
* store lives in `fallbackStore` only during synchronous work (mirroring
* React's request storage). Reading context after `await` then finds no store
* and falls back to the default value — never another request's value.
*/
export declare const runWithRenderContext: <T>(callback: () => T, resumeStore?: RenderStore) => T;
/**
* Capture the current render store and return a resumer that re-establishes it
* around a deferred continuation (e.g. a re-render after a suspended promise
* settles). Shared by every suspension point so none reimplements it.
*/
export declare const captureRenderContext: () => (<T>(callback: () => T) => T);
/**
* Create a context whose value can be provided with `<Context.Provider>` and
* read with {@link useContext}.
*
* Server-side renders are isolated per request, so a provided value never leaks
* into a concurrent request — even across `await` in an async component, when
* `AsyncLocalStorage` is available (Node.js >= 20.16, Deno, Bun, Cloudflare
* Workers with `nodejs_compat`). Without it, reading context after `await`
* returns the default value; synchronous components and `use()`-based
* suspension are unaffected.
*/
export declare const createContext: <T>(defaultValue: T) => Context<T>;
/**
* Read the current value of a context created with {@link createContext}.
*
* Safe to call from async components after `await`. See {@link createContext}
* for the per-runtime isolation guarantees.
*/
export declare const useContext: <T>(context: Context<T>) => T;
//#endregion
export {};
@@ -0,0 +1,33 @@
'use strict';
//all requires must be explicit because browserify won't work with dynamic requires
module.exports = {
'$ref': require('./ref'),
allOf: require('./allOf'),
anyOf: require('./anyOf'),
'$comment': require('./comment'),
const: require('./const'),
contains: require('./contains'),
dependencies: require('./dependencies'),
'enum': require('./enum'),
format: require('./format'),
'if': require('./if'),
items: require('./items'),
maximum: require('./_limit'),
minimum: require('./_limit'),
maxItems: require('./_limitItems'),
minItems: require('./_limitItems'),
maxLength: require('./_limitLength'),
minLength: require('./_limitLength'),
maxProperties: require('./_limitProperties'),
minProperties: require('./_limitProperties'),
multipleOf: require('./multipleOf'),
not: require('./not'),
oneOf: require('./oneOf'),
pattern: require('./pattern'),
properties: require('./properties'),
propertyNames: require('./propertyNames'),
required: require('./required'),
uniqueItems: require('./uniqueItems'),
validate: require('./validate')
};
@@ -0,0 +1,17 @@
"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 __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./createProjectService"), exports);
@@ -0,0 +1,972 @@
## 8.16.0 (2026-02-19)
### New features
The `sourceType` option can now be set to `"commonjs"` to have the parser treat the top level scope as a function scope.
Add support for Unicode 17.
### Bug fixes
Don't recognize `await using` as contextual keywords when followed directly by a backslash.
Fix an issue where the parser would allow `return` statements in `static` blocks when `allowReturnOutsideFunction` was enabled.
Properly reject `using` declarations that appear directly in `switch` or `for` head scopes.
Fix some corner case issues in the recognition of `using` syntax.
## 8.15.0 (2025-06-08)
### New features
Support `using` and `await using` syntax.
The `AnyNode` type is now defined in such a way that plugins can extend it.
### Bug fixes
Fix an issue where the `bigint` property of literal nodes for non-decimal bigints had the wrong format.
The `acorn` CLI tool no longer crashes when emitting a tree that contains a bigint.
## 8.14.1 (2025-03-05)
### Bug fixes
Fix an issue where `await` expressions in class field initializers were inappropriately allowed.
Properly allow await inside an async arrow function inside a class field initializer.
Mention the source file name in syntax error messages when given.
Properly add an empty `attributes` property to every form of `ExportNamedDeclaration`.
## 8.14.0 (2024-10-27)
### New features
Support ES2025 import attributes.
Support ES2025 RegExp modifiers.
### Bug fixes
Support some missing Unicode properties.
## 8.13.0 (2024-10-16)
### New features
Upgrade to Unicode 16.0.
## 8.12.1 (2024-07-03)
### Bug fixes
Fix a regression that caused Acorn to no longer run on Node versions <8.10.
## 8.12.0 (2024-06-14)
### New features
Support ES2025 duplicate capture group names in regular expressions.
### Bug fixes
Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error.
Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name.
Properly recognize \"use strict\" when preceded by a string with an escaped newline.
Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors.
Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled.
Properly normalize line endings in raw strings of invalid template tokens.
Properly track line numbers for escaped newlines in strings.
Fix a bug that broke line number accounting after a template literal with invalid escape sequences.
## 8.11.3 (2023-12-29)
### Bug fixes
Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.
Make sure `onToken` get an `import` keyword token when parsing `import.meta`.
Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.
## 8.11.2 (2023-10-27)
### Bug fixes
Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.
## 8.11.1 (2023-10-26)
### Bug fixes
Fix a regression where `onToken` would receive 'name' tokens for 'new' keyword tokens.
## 8.11.0 (2023-10-26)
### Bug fixes
Fix an issue where tokenizing (without parsing) an object literal with a property named `class` or `function` could, in some circumstance, put the tokenizer into an invalid state.
Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression.
### New features
Upgrade to Unicode 15.1.
Use a set of new, much more precise, TypeScript types.
## 8.10.0 (2023-07-05)
### New features
Add a `checkPrivateFields` option that disables strict checking of private property use.
## 8.9.0 (2023-06-16)
### Bug fixes
Forbid dynamic import after `new`, even when part of a member expression.
### New features
Add Unicode properties for ES2023.
Add support for the `v` flag to regular expressions.
## 8.8.2 (2023-01-23)
### Bug fixes
Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.
Fix an exception when passing no option object to `parse` or `new Parser`.
Fix incorrect parse error on `if (0) let\n[astral identifier char]`.
## 8.8.1 (2022-10-24)
### Bug fixes
Make type for `Comment` compatible with estree types.
## 8.8.0 (2022-07-21)
### Bug fixes
Allow parentheses around spread args in destructuring object assignment.
Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.
### New features
Support hashbang comments by default in ECMAScript 2023 and later.
## 8.7.1 (2021-04-26)
### Bug fixes
Stop handling `"use strict"` directives in ECMAScript versions before 5.
Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.
Add missing type for `tokTypes`.
## 8.7.0 (2021-12-27)
### New features
Support quoted export names.
Upgrade to Unicode 14.
Add support for Unicode 13 properties in regular expressions.
### Bug fixes
Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.
## 8.6.0 (2021-11-18)
### Bug fixes
Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.
### New features
Support class private fields with the `in` operator.
## 8.5.0 (2021-09-06)
### Bug fixes
Improve context-dependent tokenization in a number of corner cases.
Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
Fix wrong end locations stored on SequenceExpression nodes.
Implement restriction that `for`/`of` loop LHS can't start with `let`.
### New features
Add support for ES2022 class static blocks.
Allow multiple input files to be passed to the CLI tool.
## 8.4.1 (2021-06-24)
### Bug fixes
Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.
## 8.4.0 (2021-06-11)
### New features
A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.
## 8.3.0 (2021-05-31)
### New features
Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.
Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.
## 8.2.4 (2021-05-04)
### Bug fixes
Fix spec conformity in corner case 'for await (async of ...)'.
## 8.2.3 (2021-05-04)
### Bug fixes
Fix an issue where the library couldn't parse 'for (async of ...)'.
Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.
## 8.2.2 (2021-04-29)
### Bug fixes
Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.
## 8.2.1 (2021-04-24)
### Bug fixes
Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
## 8.2.0 (2021-04-24)
### New features
Add support for ES2022 class fields and private methods.
## 8.1.1 (2021-04-12)
### Various
Stop shipping source maps in the NPM package.
## 8.1.0 (2021-03-09)
### Bug fixes
Fix a spurious error in nested destructuring arrays.
### New features
Expose `allowAwaitOutsideFunction` in CLI interface.
Make `allowImportExportAnywhere` also apply to `import.meta`.
## 8.0.5 (2021-01-25)
### Bug fixes
Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
## 8.0.4 (2020-10-05)
### Bug fixes
Make `await x ** y` an error, following the spec.
Fix potentially exponential regular expression.
## 8.0.3 (2020-10-02)
### Bug fixes
Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.
## 8.0.2 (2020-09-30)
### Bug fixes
Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
Fix another regexp/division tokenizer issue.
## 8.0.1 (2020-08-12)
### Bug fixes
Provide the correct value in the `version` export.
## 8.0.0 (2020-08-12)
### Bug fixes
Disallow expressions like `(a = b) = c`.
Make non-octal escape sequences a syntax error in strict mode.
### New features
The package can now be loaded directly as an ECMAScript module in node 13+.
Update to the set of Unicode properties from ES2021.
### Breaking changes
The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
Some changes to method signatures that may be used by plugins.
## 7.4.0 (2020-08-03)
### New features
Add support for logical assignment operators.
Add support for numeric separators.
## 7.3.1 (2020-06-11)
### Bug fixes
Make the string in the `version` export match the actual library version.
## 7.3.0 (2020-06-11)
### Bug fixes
Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
### New features
Add support for optional chaining (`?.`).
## 7.2.0 (2020-05-09)
### Bug fixes
Fix precedence issue in parsing of async arrow functions.
### New features
Add support for nullish coalescing.
Add support for `import.meta`.
Support `export * as ...` syntax.
Upgrade to Unicode 13.
## 6.4.1 (2020-03-09)
### Bug fixes
More carefully check for valid UTF16 surrogate pairs in regexp validator.
## 7.1.1 (2020-03-01)
### Bug fixes
Treat `\8` and `\9` as invalid escapes in template strings.
Allow unicode escapes in property names that are keywords.
Don't error on an exponential operator expression as argument to `await`.
More carefully check for valid UTF16 surrogate pairs in regexp validator.
## 7.1.0 (2019-09-24)
### Bug fixes
Disallow trailing object literal commas when ecmaVersion is less than 5.
### New features
Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
## 7.0.0 (2019-08-13)
### Breaking changes
Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).
Makes 10 (ES2019) the default value for the `ecmaVersion` option.
## 6.3.0 (2019-08-12)
### New features
`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
## 6.2.1 (2019-07-21)
### Bug fixes
Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
## 6.2.0 (2019-07-04)
### Bug fixes
Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
Disallow binding `let` in patterns.
### New features
Support bigint syntax with `ecmaVersion` >= 11.
Support dynamic `import` syntax with `ecmaVersion` >= 11.
Upgrade to Unicode version 12.
## 6.1.1 (2019-02-27)
### Bug fixes
Fix bug that caused parsing default exports of with names to fail.
## 6.1.0 (2019-02-08)
### Bug fixes
Fix scope checking when redefining a `var` as a lexical binding.
### New features
Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
## 6.0.7 (2019-02-04)
### Bug fixes
Check that exported bindings are defined.
Don't treat `\u180e` as a whitespace character.
Check for duplicate parameter names in methods.
Don't allow shorthand properties when they are generators or async methods.
Forbid binding `await` in async arrow function's parameter list.
## 6.0.6 (2019-01-30)
### Bug fixes
The content of class declarations and expressions is now always parsed in strict mode.
Don't allow `let` or `const` to bind the variable name `let`.
Treat class declarations as lexical.
Don't allow a generator function declaration as the sole body of an `if` or `else`.
Ignore `"use strict"` when after an empty statement.
Allow string line continuations with special line terminator characters.
Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
Fix bug with parsing `yield` in a `for` loop initializer.
Implement special cases around scope checking for functions.
## 6.0.5 (2019-01-02)
### Bug fixes
Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
Don't treat `let` as a keyword when the next token is `{` on the next line.
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
## 6.0.4 (2018-11-05)
### Bug fixes
Further improvements to tokenizing regular expressions in corner cases.
## 6.0.3 (2018-11-04)
### Bug fixes
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
Remove stray symlink in the package tarball.
## 6.0.2 (2018-09-26)
### Bug fixes
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
## 6.0.1 (2018-09-14)
### Bug fixes
Fix wrong value in `version` export.
## 6.0.0 (2018-09-14)
### Bug fixes
Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
Forbid `new.target` in top-level arrow functions.
Fix issue with parsing a regexp after `yield` in some contexts.
### New features
The package now comes with TypeScript definitions.
### Breaking changes
The default value of the `ecmaVersion` option is now 9 (2018).
Plugins work differently, and will have to be rewritten to work with this version.
The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
## 5.7.3 (2018-09-10)
### Bug fixes
Fix failure to tokenize regexps after expressions like `x.of`.
Better error message for unterminated template literals.
## 5.7.2 (2018-08-24)
### Bug fixes
Properly handle `allowAwaitOutsideFunction` in for statements.
Treat function declarations at the top level of modules like let bindings.
Don't allow async function declarations as the only statement under a label.
## 5.7.0 (2018-06-15)
### New features
Upgraded to Unicode 11.
## 5.6.0 (2018-05-31)
### New features
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
Allow binding-less catch statements when ECMAVersion >= 10.
Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
## 5.5.3 (2018-03-08)
### Bug fixes
A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
## 5.5.2 (2018-03-08)
### Bug fixes
A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
## 5.5.1 (2018-03-06)
### Bug fixes
Fix misleading error message for octal escapes in template strings.
## 5.5.0 (2018-02-27)
### New features
The identifier character categorization is now based on Unicode version 10.
Acorn will now validate the content of regular expressions, including new ES9 features.
## 5.4.0 (2018-02-01)
### Bug fixes
Disallow duplicate or escaped flags on regular expressions.
Disallow octal escapes in strings in strict mode.
### New features
Add support for async iteration.
Add support for object spread and rest.
## 5.3.0 (2017-12-28)
### Bug fixes
Fix parsing of floating point literals with leading zeroes in loose mode.
Allow duplicate property names in object patterns.
Don't allow static class methods named `prototype`.
Disallow async functions directly under `if` or `else`.
Parse right-hand-side of `for`/`of` as an assignment expression.
Stricter parsing of `for`/`in`.
Don't allow unicode escapes in contextual keywords.
### New features
Parsing class members was factored into smaller methods to allow plugins to hook into it.
## 5.2.1 (2017-10-30)
### Bug fixes
Fix a token context corruption bug.
## 5.2.0 (2017-10-30)
### Bug fixes
Fix token context tracking for `class` and `function` in property-name position.
Make sure `%*` isn't parsed as a valid operator.
Allow shorthand properties `get` and `set` to be followed by default values.
Disallow `super` when not in callee or object position.
### New features
Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
## 5.1.2 (2017-09-04)
### Bug fixes
Disable parsing of legacy HTML-style comments in modules.
Fix parsing of async methods whose names are keywords.
## 5.1.1 (2017-07-06)
### Bug fixes
Fix problem with disambiguating regexp and division after a class.
## 5.1.0 (2017-07-05)
### Bug fixes
Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
Parse zero-prefixed numbers with non-octal digits as decimal.
Allow object/array patterns in rest parameters.
Don't error when `yield` is used as a property name.
Allow `async` as a shorthand object property.
### New features
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
## 5.0.3 (2017-04-01)
### Bug fixes
Fix spurious duplicate variable definition errors for named functions.
## 5.0.2 (2017-03-30)
### Bug fixes
A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
## 5.0.0 (2017-03-28)
### Bug fixes
Raise an error for duplicated lexical bindings.
Fix spurious error when an assignement expression occurred after a spread expression.
Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
Allow labels in front or `var` declarations, even in strict mode.
### Breaking changes
Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
## 4.0.11 (2017-02-07)
### Bug fixes
Allow all forms of member expressions to be parenthesized as lvalue.
## 4.0.10 (2017-02-07)
### Bug fixes
Don't expect semicolons after default-exported functions or classes, even when they are expressions.
Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
## 4.0.9 (2017-02-06)
### Bug fixes
Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
## 4.0.8 (2017-02-03)
### Bug fixes
Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
## 4.0.7 (2017-02-02)
### Bug fixes
Accept invalidly rejected code like `(x).y = 2` again.
Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
## 4.0.6 (2017-02-02)
### Bug fixes
Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
## 4.0.5 (2017-02-02)
### Bug fixes
Disallow parenthesized pattern expressions.
Allow keywords as export names.
Don't allow the `async` keyword to be parenthesized.
Properly raise an error when a keyword contains a character escape.
Allow `"use strict"` to appear after other string literal expressions.
Disallow labeled declarations.
## 4.0.4 (2016-12-19)
### Bug fixes
Fix crash when `export` was followed by a keyword that can't be
exported.
## 4.0.3 (2016-08-16)
### Bug fixes
Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
Properly parse properties named `async` in ES2017 mode.
Fix bug where reserved words were broken in ES2017 mode.
## 4.0.2 (2016-08-11)
### Bug fixes
Don't ignore period or 'e' characters after octal numbers.
Fix broken parsing for call expressions in default parameter values of arrow functions.
## 4.0.1 (2016-08-08)
### Bug fixes
Fix false positives in duplicated export name errors.
## 4.0.0 (2016-08-07)
### Breaking changes
The default `ecmaVersion` option value is now 7.
A number of internal method signatures changed, so plugins might need to be updated.
### Bug fixes
The parser now raises errors on duplicated export names.
`arguments` and `eval` can now be used in shorthand properties.
Duplicate parameter names in non-simple argument lists now always produce an error.
### New features
The `ecmaVersion` option now also accepts year-style version numbers
(2015, etc).
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
## 3.3.0 (2016-07-25)
### Bug fixes
Fix bug in tokenizing of regexp operator after a function declaration.
Fix parser crash when parsing an array pattern with a hole.
### New features
Implement check against complex argument lists in functions that enable strict mode in ES7.
## 3.2.0 (2016-06-07)
### Bug fixes
Improve handling of lack of unicode regexp support in host
environment.
Properly reject shorthand properties whose name is a keyword.
### New features
Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
## 3.1.0 (2016-04-18)
### Bug fixes
Properly tokenize the division operator directly after a function expression.
Allow trailing comma in destructuring arrays.
## 3.0.4 (2016-02-25)
### Fixes
Allow update expressions as left-hand-side of the ES7 exponential operator.
## 3.0.2 (2016-02-10)
### Fixes
Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
## 3.0.0 (2016-02-10)
### Breaking changes
The default value of the `ecmaVersion` option is now 6 (used to be 5).
Support for comprehension syntax (which was dropped from the draft spec) has been removed.
### Fixes
`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
A parenthesized class or function expression after `export default` is now parsed correctly.
### New features
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
The identifier character ranges are now based on Unicode 8.0.0.
Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
## 2.7.0 (2016-01-04)
### Fixes
Stop allowing rest parameters in setters.
Disallow `y` rexexp flag in ES5.
Disallow `\00` and `\000` escapes in strict mode.
Raise an error when an import name is a reserved word.
## 2.6.2 (2015-11-10)
### Fixes
Don't crash when no options object is passed.
## 2.6.0 (2015-11-09)
### Fixes
Add `await` as a reserved word in module sources.
Disallow `yield` in a parameter default value for a generator.
Forbid using a comma after a rest pattern in an array destructuring.
### New features
Support parsing stdin in command-line tool.
## 2.5.0 (2015-10-27)
### Fixes
Fix tokenizer support in the command-line tool.
Stop allowing `new.target` outside of functions.
Remove legacy `guard` and `guardedHandler` properties from try nodes.
Stop allowing multiple `__proto__` properties on an object literal in strict mode.
Don't allow rest parameters to be non-identifier patterns.
Check for duplicate paramter names in arrow functions.
@@ -0,0 +1,64 @@
import utils from '../../../../scoring/utils.mjs';
const countSubstring = (string, substring) => {
let count = 0;
let pos = string.indexOf(substring);
while (pos >= 0) {
count += 1;
pos = string.indexOf(substring, pos + substring.length);
}
return count;
};
const getCounts = ({
sub,
token
}) => {
// lower-case match.token before calculating: capitalization shouldn't affect l33t calc.
const tokenLower = token.toLowerCase();
// num of subbed chars
const subbedCount = countSubstring(tokenLower, sub.substitution);
// num of unsubbed chars
const unsubbedCount = countSubstring(tokenLower, sub.letter);
return {
subbedCount,
unsubbedCount
};
};
var l33tVariant = ({
l33t,
subs,
token
}) => {
if (!l33t) {
return 1;
}
let variations = 1;
subs.forEach(sub => {
const {
subbedCount,
unsubbedCount
} = getCounts({
sub,
token
});
if (subbedCount === 0 || unsubbedCount === 0) {
// for this sub, password is either fully subbed (444) or fully unsubbed (aaa)
// treat that as doubling the space (attacker needs to try fully subbed chars in addition to
// unsubbed.)
variations *= 2;
} else {
// this case is similar to capitalization:
// with aa44a, U = 3, S = 2, attacker needs to try unsubbed + one sub + two subs
const p = Math.min(unsubbedCount, subbedCount);
let possibilities = 0;
for (let i = 1; i <= p; i += 1) {
possibilities += utils.nCk(unsubbedCount + subbedCount, i);
}
variations *= possibilities;
}
});
return variations;
};
export { l33tVariant as default };
//# sourceMappingURL=l33t.mjs.map
@@ -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 './square-percent.js';
//# sourceMappingURL=percent-square.js.map
@@ -0,0 +1,14 @@
type LegacyAllowConstantLoopConditions = boolean;
type AllowConstantLoopConditions = 'always' | 'never' | 'only-allowed-literals';
export type Options = [
{
allowConstantLoopConditions?: AllowConstantLoopConditions | LegacyAllowConstantLoopConditions;
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
checkTypePredicates?: boolean;
}
];
export type MessageId = 'alwaysFalsy' | 'alwaysFalsyFunc' | 'alwaysNullish' | 'alwaysTruthy' | 'alwaysTruthyFunc' | 'comparisonBetweenLiteralTypes' | 'never' | 'neverNullish' | 'neverOptionalChain' | 'noOverlapBooleanExpression' | 'noStrictNullCheck' | 'suggestRemoveOptionalChain' | 'typeGuardAlreadyIsType';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageId, Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,6 @@
export { mergeHeaders } from './headers.js';
export { json } from './json.js';
export type { JsonResponse } from './json.js';
export { hydrate } from './ssr-client.js';
export * from './ssr-client.js';
export type { TsrSsrGlobal, DehydratedMatch, DehydratedRouter } from './types.js';
@@ -0,0 +1,74 @@
import { Parser } from "./Parser.js";
export { Parser } from "./Parser.js";
import { DomHandler, } from "domhandler";
export { DomHandler,
// Old name for DomHandler
DomHandler as DefaultHandler, } from "domhandler";
// Helper methods
/**
* Parses the data, returns the resulting document.
*
* @param data The data that should be parsed.
* @param options Optional options for the parser and DOM handler.
*/
export function parseDocument(data, options) {
const handler = new DomHandler(undefined, options);
new Parser(handler, options).end(data);
return handler.root;
}
/**
* Parses data, returns an array of the root nodes.
*
* Note that the root nodes still have a `Document` node as their parent.
* Use `parseDocument` to get the `Document` node instead.
*
* @param data The data that should be parsed.
* @param options Optional options for the parser and DOM handler.
* @deprecated Use `parseDocument` instead.
*/
export function parseDOM(data, options) {
return parseDocument(data, options).children;
}
/**
* Creates a parser instance, with an attached DOM handler.
*
* @param callback A callback that will be called once parsing has been completed, with the resulting document.
* @param options Optional options for the parser and DOM handler.
* @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.
*/
export function createDocumentStream(callback, options, elementCallback) {
const handler = new DomHandler((error) => callback(error, handler.root), options, elementCallback);
return new Parser(handler, options);
}
/**
* Creates a parser instance, with an attached DOM handler.
*
* @param callback A callback that will be called once parsing has been completed, with an array of root nodes.
* @param options Optional options for the parser and DOM handler.
* @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.
* @deprecated Use `createDocumentStream` instead.
*/
export function createDomStream(callback, options, elementCallback) {
const handler = new DomHandler(callback, options, elementCallback);
return new Parser(handler, options);
}
export { default as Tokenizer, QuoteType, } from "./Tokenizer.js";
/*
* All of the following exports exist for backwards-compatibility.
* They should probably be removed eventually.
*/
export * as ElementType from "domelementtype";
import { getFeed } from "domutils";
export { getFeed } from "domutils";
const parseFeedDefaultOptions = { xmlMode: true };
/**
* Parse a feed.
*
* @param feed The feed that should be parsed, as a string.
* @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.
*/
export function parseFeed(feed, options = parseFeedDefaultOptions) {
return getFeed(parseDOM(feed, options));
}
export * as DomUtils from "domutils";
//# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classCheckPrivateStaticFieldDescriptor;
function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
if (descriptor === undefined) {
throw new TypeError("attempted to " + action + " private static field before its declaration");
}
}
//# sourceMappingURL=classCheckPrivateStaticFieldDescriptor.js.map
@@ -0,0 +1,124 @@
const threshold = 50;
const maxSpeed = 25;
const overflowStyles = new Set(["auto", "scroll"]);
// Track initial scroll limits per scrollable element (Bug 1 fix)
const initialScrollLimits = new WeakMap();
const activeScrollEdge = new WeakMap();
// Track which group element is currently dragging to clear state on end
let currentGroupElement = null;
function resetAutoScrollState() {
if (currentGroupElement) {
const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y");
if (scrollableAncestor) {
activeScrollEdge.delete(scrollableAncestor);
initialScrollLimits.delete(scrollableAncestor);
}
// Also try x axis
const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x");
if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {
activeScrollEdge.delete(scrollableAncestorX);
initialScrollLimits.delete(scrollableAncestorX);
}
currentGroupElement = null;
}
}
function isScrollableElement(element, axis) {
const style = getComputedStyle(element);
const overflow = axis === "x" ? style.overflowX : style.overflowY;
const isDocumentScroll = element === document.body ||
element === document.documentElement;
return overflowStyles.has(overflow) || isDocumentScroll;
}
function findScrollableAncestor(element, axis) {
let current = element?.parentElement;
while (current) {
if (isScrollableElement(current, axis)) {
return current;
}
current = current.parentElement;
}
return null;
}
function getScrollAmount(pointerPosition, scrollElement, axis) {
const rect = scrollElement.getBoundingClientRect();
const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top);
const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom);
const distanceFromStart = pointerPosition - start;
const distanceFromEnd = end - pointerPosition;
if (distanceFromStart < threshold) {
const intensity = 1 - distanceFromStart / threshold;
return { amount: -maxSpeed * intensity * intensity, edge: "start" };
}
else if (distanceFromEnd < threshold) {
const intensity = 1 - distanceFromEnd / threshold;
return { amount: maxSpeed * intensity * intensity, edge: "end" };
}
return { amount: 0, edge: null };
}
function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) {
if (!groupElement)
return;
// Track the group element for cleanup
currentGroupElement = groupElement;
const scrollableAncestor = findScrollableAncestor(groupElement, axis);
if (!scrollableAncestor)
return;
// Convert pointer position from page coordinates to viewport coordinates.
// The gesture system uses pageX/pageY but getBoundingClientRect() returns
// viewport-relative coordinates, so we need to account for page scroll.
const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY);
const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis);
// If not in any threshold zone, clear all state
if (edge === null) {
activeScrollEdge.delete(scrollableAncestor);
initialScrollLimits.delete(scrollableAncestor);
return;
}
const currentActiveEdge = activeScrollEdge.get(scrollableAncestor);
const isDocumentScroll = scrollableAncestor === document.body ||
scrollableAncestor === document.documentElement;
// If not currently scrolling this edge, check velocity to see if we should start
if (currentActiveEdge !== edge) {
// Only start scrolling if velocity is towards the edge
const shouldStart = (edge === "start" && velocity < 0) ||
(edge === "end" && velocity > 0);
if (!shouldStart)
return;
// Activate this edge
activeScrollEdge.set(scrollableAncestor, edge);
// Record initial scroll limit (prevents infinite scroll)
const maxScroll = axis === "x"
? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)
: scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight);
initialScrollLimits.set(scrollableAncestor, maxScroll);
}
// Cap scrolling at initial limit (prevents infinite scroll)
if (scrollAmount > 0) {
const initialLimit = initialScrollLimits.get(scrollableAncestor);
const currentScroll = axis === "x"
? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)
: (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop);
if (currentScroll >= initialLimit)
return;
}
// Apply scroll
if (axis === "x") {
if (isDocumentScroll) {
window.scrollBy({ left: scrollAmount });
}
else {
scrollableAncestor.scrollLeft += scrollAmount;
}
}
else {
if (isDocumentScroll) {
window.scrollBy({ top: scrollAmount });
}
else {
scrollableAncestor.scrollTop += scrollAmount;
}
}
}
export { autoScrollIfNeeded, resetAutoScrollState };
//# sourceMappingURL=auto-scroll.mjs.map
@@ -0,0 +1,5 @@
'use strict'
const compare = require('./compare')
const lt = (a, b, loose) => compare(a, b, loose) < 0
module.exports = lt
@@ -0,0 +1,24 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2016" />
/// <reference lib="es2017.arraybuffer" />
/// <reference lib="es2017.date" />
/// <reference lib="es2017.intl" />
/// <reference lib="es2017.object" />
/// <reference lib="es2017.sharedmemory" />
/// <reference lib="es2017.string" />
/// <reference lib="es2017.typedarrays" />
@@ -0,0 +1,4 @@
export function parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
export function stringify(value: any, replacer?: (string | number)[] | ((this: any, key: string, value: any) => any), space?: string | number | undefined): string;
export function toJSON(value: any): any;
export function fromJSON(value: any): any;
@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2014-2017 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,90 @@
type StringOrRegExp = string | RegExp;
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
export type FilterExpressionKind = FilterExpression['kind'];
export type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
export type TopLevelFilterExpression = Include | Exclude;
declare class And {
kind: 'and';
args: FilterExpression[];
constructor(...args: FilterExpression[]);
}
declare class Or {
kind: 'or';
args: FilterExpression[];
constructor(...args: FilterExpression[]);
}
declare class Not {
kind: 'not';
expr: FilterExpression;
constructor(expr: FilterExpression);
}
export interface QueryFilterObject {
[key: string]: StringOrRegExp | boolean;
}
interface IdParams {
cleanUrl?: boolean;
}
declare class Id {
kind: 'id';
pattern: StringOrRegExp;
params: IdParams;
constructor(pattern: StringOrRegExp, params?: IdParams);
}
declare class ImporterId {
kind: 'importerId';
pattern: StringOrRegExp;
params: IdParams;
constructor(pattern: StringOrRegExp, params?: IdParams);
}
declare class ModuleType {
kind: 'moduleType';
pattern: PluginModuleType;
constructor(pattern: PluginModuleType);
}
declare class Code {
kind: 'code';
pattern: StringOrRegExp;
constructor(expr: StringOrRegExp);
}
declare class Query {
kind: 'query';
key: string;
pattern: StringOrRegExp | boolean;
constructor(key: string, pattern: StringOrRegExp | boolean);
}
declare class Include {
kind: 'include';
expr: FilterExpression;
constructor(expr: FilterExpression);
}
declare class Exclude {
kind: 'exclude';
expr: FilterExpression;
constructor(expr: FilterExpression);
}
export declare function and(...args: FilterExpression[]): And;
export declare function or(...args: FilterExpression[]): Or;
export declare function not(expr: FilterExpression): Not;
export declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
export declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
export declare function moduleType(pattern: PluginModuleType): ModuleType;
export declare function code(pattern: StringOrRegExp): Code;
export declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
export declare function include(expr: FilterExpression): Include;
export declare function exclude(expr: FilterExpression): Exclude;
/**
* convert a queryObject to FilterExpression like
* ```js
* and(query(k1, v1), query(k2, v2))
* ```
* @param queryFilterObject The query filter object needs to be matched.
* @returns a `And` FilterExpression
*/
export declare function queries(queryFilter: QueryFilterObject): And;
export declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
interface InterpreterCtx {
urlSearchParamsCache?: URLSearchParams;
}
export declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
export declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
export {};
@@ -0,0 +1,2 @@
import { AnyRouter } from '../router.cjs';
export declare function getScrollRestorationScriptForRouter(_router: AnyRouter): null;
@@ -0,0 +1,18 @@
/**
* @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 Minimize = createLucideIcon("Minimize", [
["path", { d: "M8 3v3a2 2 0 0 1-2 2H3", key: "hohbtr" }],
["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3", key: "5jw1f3" }],
["path", { d: "M3 16h3a2 2 0 0 1 2 2v3", key: "198tvr" }],
["path", { d: "M16 21v-3a2 2 0 0 1 2-2h3", key: "ph8mxp" }]
]);
export { Minimize as default };
//# sourceMappingURL=minimize.js.map
@@ -0,0 +1,255 @@
import type { ClassicConfig, FlatConfig, SharedConfig } from './Config';
import type { Parser } from './Parser';
import type { Processor as ProcessorType } from './Processor';
import type { AnyRuleCreateFunction, AnyRuleModule, RuleCreateFunction, RuleFix, RuleModule } from './Rule';
import type { SourceCode } from './SourceCode';
export type MinimalRuleModule<MessageIds extends string = string, Options extends readonly unknown[] = []> = Partial<Omit<RuleModule<MessageIds, Options>, 'create'>> & Pick<RuleModule<MessageIds, Options>, 'create'>;
declare class LinterBase {
/**
* The version from package.json.
*/
readonly version: string;
/**
* Initialize the Linter.
* @param config the config object
*/
constructor(config?: Linter.LinterOptions);
/**
* Define a new parser module
* @param parserId Name of the parser
* @param parserModule The parser object
*/
defineParser(parserId: string, parserModule: Parser.LooseParserModule): void;
/**
* Defines a new linting rule.
* @param ruleId A unique rule identifier
* @param ruleModule Function from context to object mapping AST node types to event handlers
*/
defineRule<MessageIds extends string, Options extends readonly unknown[]>(ruleId: string, ruleModule: MinimalRuleModule<MessageIds, Options> | RuleCreateFunction): void;
/**
* Defines many new linting rules.
* @param rulesToDefine map from unique rule identifier to rule
*/
defineRules<MessageIds extends string, Options extends readonly unknown[]>(rulesToDefine: Record<string, MinimalRuleModule<MessageIds, Options> | RuleCreateFunction<MessageIds, Options>>): void;
/**
* Gets an object with all loaded rules.
* @returns All loaded rules
*/
getRules(): Map<string, MinimalRuleModule<string, unknown[]>>;
/**
* Gets the `SourceCode` object representing the parsed source.
* @returns The `SourceCode` object.
*/
getSourceCode(): SourceCode;
/**
* Verifies the text against the rules specified by the second argument.
* @param textOrSourceCode The text to parse or a SourceCode object.
* @param config An ESLintConfig instance to configure everything.
* @param filenameOrOptions The optional filename of the file being checked.
* If this is not set, the filename will default to '<input>' in the rule context.
* If this is an object, then it has "filename", "allowInlineConfig", and some properties.
* @returns The results as an array of messages or an empty array if no messages.
*/
verify(textOrSourceCode: string | SourceCode, config: Linter.ConfigType, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[];
/**
* The version from package.json.
*/
static readonly version: string;
/**
* Performs multiple autofix passes over the text until as many fixes as possible have been applied.
* @param code The source text to apply fixes to.
* @param config The ESLint config object to use.
* @param options The ESLint options object to use.
* @returns The result of the fix operation as returned from the SourceCodeFixer.
*/
verifyAndFix(code: string, config: Linter.ConfigType, options: Linter.FixOptions): Linter.FixReport;
}
declare namespace Linter {
interface LinterOptions {
/**
* Which config format to use.
* @default 'flat'
*/
configType?: ConfigTypeSpecifier;
/**
* path to a directory that should be considered as the current working directory.
*/
cwd?: string;
}
type ConfigTypeSpecifier = 'eslintrc' | 'flat';
type EnvironmentConfig = SharedConfig.EnvironmentConfig;
type GlobalsConfig = SharedConfig.GlobalsConfig;
type GlobalVariableOption = SharedConfig.GlobalVariableOption;
type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
type ParserOptions = SharedConfig.ParserOptions;
type PluginMeta = SharedConfig.PluginMeta;
type RuleEntry = SharedConfig.RuleEntry;
type RuleLevel = SharedConfig.RuleLevel;
type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
type RulesRecord = SharedConfig.RulesRecord;
type Severity = SharedConfig.Severity;
type SeverityString = SharedConfig.SeverityString;
/** @deprecated use {@link Linter.ConfigType} instead */
type Config = ClassicConfig.Config;
type ConfigType = ClassicConfig.Config | FlatConfig.Config | FlatConfig.ConfigArray;
/** @deprecated use {@link ClassicConfig.ConfigOverride} instead */
type ConfigOverride = ClassicConfig.ConfigOverride;
interface VerifyOptions {
/**
* Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
* Useful if you want to validate JS without comments overriding rules.
*/
allowInlineConfig?: boolean;
/**
* if `true` then the linter doesn't make `fix` properties into the lint result.
*/
disableFixes?: boolean;
/**
* the filename of the source code.
*/
filename?: string;
/**
* the predicate function that selects adopt code blocks.
*/
filterCodeBlock?: (filename: string, text: string) => boolean;
/**
* postprocessor for report messages.
* If provided, this should accept an array of the message lists
* for each code block returned from the preprocessor, apply a mapping to
* the messages as appropriate, and return a one-dimensional array of
* messages.
*/
postprocess?: ProcessorType.PostProcess;
/**
* preprocessor for source text.
* If provided, this should accept a string of source text, and return an array of code blocks to lint.
*/
preprocess?: ProcessorType.PreProcess;
/**
* Adds reported errors for unused `eslint-disable` directives.
*/
reportUnusedDisableDirectives?: boolean | SeverityString;
}
interface FixOptions extends VerifyOptions {
/**
* Determines whether fixes should be applied.
*/
fix?: boolean;
}
interface LintSuggestion {
desc: string;
fix: RuleFix;
messageId?: string;
}
interface LintMessage {
/**
* The 1-based column number.
*/
column: number;
/**
* The 1-based column number of the end location.
*/
endColumn?: number;
/**
* The 1-based line number of the end location.
*/
endLine?: number;
/**
* If `true` then this is a fatal error.
*/
fatal?: true;
/**
* Information for autofix.
*/
fix?: RuleFix;
/**
* The 1-based line number.
*/
line: number;
/**
* The error message.
*/
message: string;
messageId?: string;
/**
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
*/
nodeType?: string;
/**
* The ID of the rule which makes this message.
*/
ruleId: string | null;
/**
* The severity of this message.
*/
severity: Severity;
source: string | null;
/**
* Information for suggestions
*/
suggestions?: LintSuggestion[];
}
interface FixReport {
/**
* True, if the code was fixed
*/
fixed: boolean;
/**
* Collection of all messages for the given code
*/
messages: LintMessage[];
/**
* Fixed code text (might be the same as input if no fixes were applied).
*/
output: string;
}
/** @deprecated use {@link Parser.ParserModule} */
type ParserModule = Parser.LooseParserModule;
/** @deprecated use {@link Parser.ParseResult} */
type ESLintParseResult = Parser.ParseResult;
/** @deprecated use {@link ProcessorType.ProcessorModule} */
type Processor = ProcessorType.ProcessorModule;
interface Environment {
/**
* The definition of global variables.
*/
globals?: GlobalsConfig;
/**
* The parser options that will be enabled under this environment.
*/
parserOptions?: ParserOptions;
}
type LegacyPluginRules = Record<string, AnyRuleCreateFunction | AnyRuleModule>;
type PluginRules = Record<string, AnyRuleModule>;
interface Plugin {
/**
* The definition of plugin configs.
*/
configs?: Record<string, ClassicConfig.Config>;
/**
* The definition of plugin environments.
*/
environments?: Record<string, Environment>;
/**
* Metadata about your plugin for easier debugging and more effective caching of plugins.
*/
meta?: PluginMeta;
/**
* The definition of plugin processors.
*/
processors?: Record<string, ProcessorType.ProcessorModule>;
/**
* The definition of plugin rules.
*/
rules?: LegacyPluginRules;
}
}
declare const Linter_base: typeof LinterBase;
/**
* The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it
* simply parses and reports on the code. In particular, the Linter object does not process configuration objects
* or files.
*/
declare class Linter extends Linter_base {
}
export { Linter };
@@ -0,0 +1 @@
{"version":3,"file":"baggage-claim.js","sources":["../../../src/icons/baggage-claim.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BaggageClaim\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMThINmEyIDIgMCAwIDEtMi0yVjdhMiAyIDAgMCAwLTItMiIgLz4KICA8cGF0aCBkPSJNMTcgMTRWNGEyIDIgMCAwIDAtMi0yaC0xYTIgMiAwIDAgMC0yIDJ2MTAiIC8+CiAgPHJlY3Qgd2lkdGg9IjEzIiBoZWlnaHQ9IjgiIHg9IjgiIHk9IjYiIHJ4PSIxIiAvPgogIDxjaXJjbGUgY3g9IjE4IiBjeT0iMjAiIHI9IjIiIC8+CiAgPGNpcmNsZSBjeD0iOSIgY3k9IjIwIiByPSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/baggage-claim\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 BaggageClaim = createLucideIcon('BaggageClaim', [\n ['path', { d: 'M22 18H6a2 2 0 0 1-2-2V7a2 2 0 0 0-2-2', key: '4irg2o' }],\n ['path', { d: 'M17 14V4a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v10', key: '14fcyx' }],\n ['rect', { width: '13', height: '8', x: '8', y: '6', rx: '1', key: 'o6oiis' }],\n ['circle', { cx: '18', cy: '20', r: '2', key: 't9985n' }],\n ['circle', { cx: '9', cy: '20', r: '2', key: 'e5v82j' }],\n]);\n\nexport default BaggageClaim;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0C,CAAA,CAAA,CAAA,CAA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AAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,36 @@
/**
* Copyright 2022 Joe Bell. All rights reserved.
*
* This file is licensed to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
import { clsx } from "clsx";
import type { ClassProp, ClassValue, OmitUndefined, StringToBoolean } from "./types";
export type VariantProps<Component extends (...args: any) => any> = Omit<OmitUndefined<Parameters<Component>[0]>, "class" | "className">;
export type CxOptions = Parameters<typeof clsx>;
export type CxReturn = ReturnType<typeof clsx>;
export declare const cx: typeof clsx;
type ConfigSchema = Record<string, Record<string, ClassValue>>;
type ConfigVariants<T extends ConfigSchema> = {
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;
};
type ConfigVariantsMulti<T extends ConfigSchema> = {
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined;
};
type Config<T> = T extends ConfigSchema ? {
variants?: T;
defaultVariants?: ConfigVariants<T>;
compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[];
} : never;
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
export declare const cva: <T>(base?: ClassValue, config?: Config<T>) => (props?: Props<T>) => string;
export {};
@@ -0,0 +1 @@
{"version":3,"file":"simpleClientCredentials.js","sourceRoot":"","sources":["../../../../src/examples/client/simpleClientCredentials.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;GAiBG;;AAEH,oDAA+C;AAC/C,sEAA+E;AAC/E,wEAAmG;AAGnG,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,2BAA2B,CAAC;AAErF,SAAS,cAAc;IACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,kEAAkE;IAClE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACvD,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,iEAAiE;IACjE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC7D,IAAI,aAAa,EAAE,CAAC;QAChB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,IAAI,0CAAqB,CAAC;YAC7B,QAAQ;YACR,UAAU,EAAE,aAAa;YACzB,SAAS;YACT,cAAc;SACjB,CAAC,CAAC;IACP,CAAC;IAED,oDAAoD;IAC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