docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

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,15 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
test("void", () => {
const v = z.void();
v.parse(undefined);
expect(() => v.parse(null)).toThrow();
expect(() => v.parse("")).toThrow();
type v = z.infer<typeof v>;
util.assertEqual<v, void>(true);
});
@@ -0,0 +1 @@
module.exports={C:{"52":0.03893,"78":0.00324,"84":0.133,"85":0.00324,"86":0.00324,"88":0.00324,"89":0.01946,"100":0.00324,"113":0.00324,"115":0.30818,"120":0.04217,"121":0.0811,"124":0.00324,"125":0.00324,"127":0.00324,"128":0.00324,"132":0.00324,"134":0.00324,"135":0.00324,"136":0.00649,"137":0.00324,"138":0.00324,"139":0.00324,"140":0.12327,"141":0.00324,"142":0.02271,"143":0.00324,"144":0.00324,"145":0.00324,"146":0.00649,"147":0.00973,"148":0.00324,"149":0.01298,"150":0.01298,"151":0.02271,"152":0.03244,"153":0.10056,"154":0.34711,"155":1.02186,"156":1.01213,"157":0.0292,_:"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 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 87 90 91 92 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 122 123 126 129 130 131 133 158 159 160 3.5 3.6"},D:{"49":0.00324,"63":0.00324,"70":0.00649,"79":0.00324,"80":0.00649,"83":0.00324,"86":0.00324,"87":0.00324,"88":0.00324,"91":0.00324,"93":0.00649,"98":1.01213,"100":0.00649,"101":0.00324,"103":0.03568,"104":0.0292,"105":0.0292,"106":0.03244,"107":0.0292,"108":0.03893,"109":1.20028,"110":0.0292,"111":0.03244,"112":0.0292,"114":0.01622,"115":0.00324,"116":0.06164,"117":0.03244,"118":0.07137,"119":0.08434,"120":0.12003,"121":0.01622,"122":0.0292,"123":0.00973,"124":0.04866,"125":0.00324,"126":0.00973,"127":0.00324,"128":0.01622,"129":0.00649,"130":0.00649,"131":0.0811,"132":0.00649,"133":0.09083,"134":0.03893,"135":0.04217,"136":0.0519,"137":0.04542,"138":0.09083,"139":0.03893,"140":0.05515,"141":0.04866,"142":0.12327,"143":0.01298,"144":0.0292,"145":0.03568,"146":0.0292,"147":0.03568,"148":0.09083,"149":0.10381,"150":0.20437,"151":1.26516,"152":8.1392,"153":6.27065,"154":1.86854,"155":0.02271,"156":0.00324,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 64 65 66 67 68 69 71 72 73 74 75 76 77 78 81 84 85 89 90 92 94 95 96 97 99 102 113 157"},F:{"46":0.00324,"87":0.00324,"95":0.03893,"100":0.00324,"101":0.03244,"102":0.00324,"106":0.00324,"123":0.00324,"131":0.00324,"133":0.00649,"134":0.06812,"135":0.5385,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 103 104 105 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 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:{"92":0.00324,"109":0.02595,"119":0.03893,"120":0.04217,"122":0.00324,"132":0.00324,"135":0.00324,"136":0.00324,"138":0.00324,"140":0.00973,"141":0.00324,"142":0.00324,"143":0.00324,"144":0.00324,"145":0.00324,"146":0.00649,"147":0.01622,"148":0.01298,"149":0.00973,"150":0.0292,"151":0.1103,"152":1.09323,"153":1.26192,"154":0.35035,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 123 124 125 126 127 128 129 130 131 133 134 137 139"},E:{"27":0.04866,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.4 17.0 17.4 18.0 18.2 27.1 27.2 TP","14.1":0.00324,"15.6":0.01946,"16.1":0.00324,"16.2":0.00324,"16.3":0.00324,"16.5":0.00324,"16.6":0.04542,"17.1":0.0292,"17.2":0.00324,"17.3":0.00324,"17.5":0.00649,"17.6":0.02271,"18.1":0.00324,"18.3":0.00649,"18.4":0.00324,"18.5-18.7":0.00649,"26.0":0.00324,"26.1":0.00324,"26.2":0.01298,"26.3":0.01298,"26.4":0.00973,"26.5":0.06488,"26.6":0.28872},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0012,"5.0-5.1":0.0012,"6.0-6.1":0,"7.0-7.1":0.00239,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01196,"11.0-11.2":0.0012,"11.3-11.4":0.00239,"12.0-12.1":0,"12.2-12.5":0.03109,"13.0-13.1":0,"13.2":0.00598,"13.3":0,"13.4-13.7":0.0012,"14.0-14.4":0.00478,"14.5-14.8":0.00717,"15.0-15.1":0.00717,"15.2-15.3":0.00478,"15.4":0.00598,"15.5":0.00717,"15.6-15.8":0.15543,"16.0":0.01196,"16.1":0.02152,"16.2":0.01196,"16.3":0.0263,"16.4":0.00598,"16.5":0.00957,"16.6-16.7":0.21641,"17.0":0.00837,"17.1":0.01196,"17.2":0.01196,"17.3":0.01793,"17.4":0.02511,"17.5":0.04902,"17.6-17.7":0.12674,"18.0":0.0263,"18.1":0.05261,"18.2":0.07174,"18.3":0.12435,"18.4":0.07772,"18.5-18.7":1.60574,"26.0":0.07772,"26.1":0.07891,"26.2":0.20565,"26.3":0.22239,"26.4":0.16261,"26.5":1.08922,"26.6":6.72066,"27.0":0.51532,"27.1":0,"27.2":0.01315},P:{"4":0.00937,"22":0.01875,"23":0.00937,"24":0.01875,"25":0.00937,"26":0.01875,"27":0.07498,"28":0.07498,"29":0.1406,"30":2.79317,_:"20 21 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.07425,"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.00003},K:{"0":0.32424,_:"10 11 12 Line truncated
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true
},
"$dynamicAnchor": "meta",
"title": "Format vocabulary meta-schema for annotation results",
"type": ["object", "boolean"],
"properties": {
"format": {"type": "string"}
}
}
@@ -0,0 +1,14 @@
import Range = require("../classes/range");
import SemVer = require("../classes/semver");
import semver = require("../index");
/**
* Return the lowest version in the list that satisfies the range, or null if none of them do.
*/
declare function minSatisfying<T extends string | SemVer>(
versions: readonly T[],
range: string | Range,
optionsOrLoose?: boolean | semver.RangeOptions,
): T | null;
export = minSatisfying;
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,157 @@
/**
* dd-droppable.ts 12.6.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/
import { DDManager } from './dd-manager';
import { DDBaseImplement } from './dd-base-impl';
import { Utils } from './utils';
import { DDTouch, isTouch, pointerenter, pointerleave } from './dd-touch';
// let count = 0; // TEST
export class DDDroppable extends DDBaseImplement {
constructor(el, option = {}) {
super();
this.el = el;
this.option = option;
// create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
this._mouseEnter = this._mouseEnter.bind(this);
this._mouseLeave = this._mouseLeave.bind(this);
this.enable();
this._setupAccept();
}
on(event, callback) {
super.on(event, callback);
}
off(event) {
super.off(event);
}
enable() {
if (this.disabled === false)
return;
super.enable();
this.el.classList.add('ui-droppable');
this.el.classList.remove('ui-droppable-disabled');
this.el.addEventListener('mouseenter', this._mouseEnter);
this.el.addEventListener('mouseleave', this._mouseLeave);
if (isTouch) {
this.el.addEventListener('pointerenter', pointerenter);
this.el.addEventListener('pointerleave', pointerleave);
}
}
disable(forDestroy = false) {
if (this.disabled === true)
return;
super.disable();
this.el.classList.remove('ui-droppable');
if (!forDestroy)
this.el.classList.add('ui-droppable-disabled');
this.el.removeEventListener('mouseenter', this._mouseEnter);
this.el.removeEventListener('mouseleave', this._mouseLeave);
if (isTouch) {
this.el.removeEventListener('pointerenter', pointerenter);
this.el.removeEventListener('pointerleave', pointerleave);
}
}
destroy() {
this.disable(true);
this.el.classList.remove('ui-droppable');
this.el.classList.remove('ui-droppable-disabled');
super.destroy();
}
updateOption(opts) {
Object.keys(opts).forEach(key => this.option[key] = opts[key]);
this._setupAccept();
return this;
}
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
_mouseEnter(e) {
// console.log(`${count++} Enter ${this.el.id}`); // TEST
if (!DDManager.dragElement)
return;
// During touch drag operations, ignore real browser-generated mouseenter events (isTrusted:true) vs our simulated ones (isTrusted:false).
// The browser can fire spurious mouseenter events when we dispatch simulated mousemove events.
if (DDTouch.touchHandled && e.isTrusted)
return;
if (!this._canDrop(DDManager.dragElement.el))
return;
e.preventDefault();
e.stopPropagation();
DDManager.dragElement._stopScrolling();
// make sure when we enter this, that the last one gets a leave FIRST to correctly cleanup as we don't always do
if (DDManager.dropElement && DDManager.dropElement !== this) {
DDManager.dropElement._mouseLeave(e, true); // calledByEnter = true
}
DDManager.dropElement = this;
const ev = Utils.initEvent(e, { target: this.el, type: 'dropover' });
if (this.option.over) {
this.option.over(ev, this._ui(DDManager.dragElement));
}
this.triggerEvent('dropover', ev);
this.el.classList.add('ui-droppable-over');
// console.log('tracking'); // TEST
}
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
_mouseLeave(e, calledByEnter = false) {
// console.log(`${count++} Leave ${this.el.id}`); // TEST
if (!DDManager.dragElement || DDManager.dropElement !== this)
return;
e.preventDefault();
e.stopPropagation();
// stop the old grid's auto-scroll only when entering a new grid; if leaving to empty space keep scrolling until mouseup
if (calledByEnter)
DDManager.dragElement._stopScrolling();
const ev = Utils.initEvent(e, { target: this.el, type: 'dropout' });
if (this.option.out) {
this.option.out(ev, this._ui(DDManager.dragElement));
}
this.triggerEvent('dropout', ev);
if (DDManager.dropElement === this) {
delete DDManager.dropElement;
// console.log('not tracking'); // TEST
// if we're still over a parent droppable, send it an enter as we don't get one from leaving nested children
if (!calledByEnter) {
let parentDrop;
let parent = this.el.parentElement;
while (!parentDrop && parent) {
parentDrop = parent.ddElement?.ddDroppable;
parent = parent.parentElement;
}
if (parentDrop) {
parentDrop._mouseEnter(e);
}
}
}
}
/** item is being dropped on us - called by the drag mouseup handler - this calls the client drop event */
drop(e) {
e.preventDefault();
const ev = Utils.initEvent(e, { target: this.el, type: 'drop' });
if (this.option.drop) {
this.option.drop(ev, this._ui(DDManager.dragElement));
}
this.triggerEvent('drop', ev);
}
/** @internal true if element matches the string/method accept option */
_canDrop(el) {
return el && (!this.accept || this.accept(el));
}
/** @internal */
_setupAccept() {
if (!this.option.accept)
return this;
if (typeof this.option.accept === 'string') {
this.accept = (el) => el.classList.contains(this.option.accept) || el.matches(this.option.accept);
}
else {
this.accept = this.option.accept;
}
return this;
}
/** @internal */
_ui(drag) {
return {
draggable: drag.el,
...drag.ui()
};
}
}
//# sourceMappingURL=dd-droppable.js.map
@@ -0,0 +1,19 @@
import { OAuthClientInformationFull } from '../../shared/auth.js';
/**
* Stores information about registered OAuth clients for this server.
*/
export interface OAuthRegisteredClientsStore {
/**
* Returns information about a registered client, based on its ID.
*/
getClient(clientId: string): OAuthClientInformationFull | undefined | Promise<OAuthClientInformationFull | undefined>;
/**
* Registers a new client with the server. The client ID and secret will be automatically generated by the library. A modified version of the client information can be returned to reflect specific values enforced by the server.
*
* NOTE: Implementations should NOT delete expired client secrets in-place. Auth middleware provided by this library will automatically check the `client_secret_expires_at` field and reject requests with expired secrets. Any custom logic for authenticating clients should check the `client_secret_expires_at` field as well.
*
* If unimplemented, dynamic client registration is unsupported.
*/
registerClient?(client: Omit<OAuthClientInformationFull, 'client_id' | 'client_id_issued_at'>): OAuthClientInformationFull | Promise<OAuthClientInformationFull>;
}
//# sourceMappingURL=clients.d.ts.map
@@ -0,0 +1,833 @@
flf2a$ 8 8 13 0 16 0 16255 0
Author : myflix
Date : 2004/9/26 12:32:07
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
,---. #
| | #
| | #
| | #
| .' #
`--' #
.--. #
`--' ##
#
,--.,--. #
\ |\ | #
`-' `-' #
#
#
#
##
#
#
,-.,-. #
,-| || |-. #
,-| || |-. #
'-| || |-' #
`-'`-' #
##
,-. #
.-|-|-. #
| | |_| #
`-|.| '. #
.-| | | #
| |-| / #
`|-|'' #
`-' ##
,-. #
,-. / / #
'-'/ / #
/ / #
/ / #
/ /,-. #
/ / '-' #
`-' ##
#
.---. #
/ .-. \ #
\ '-' ,-. #
/ /'. / #
\ '-' .__) #
`---' #
##
#
,--. #
\ | #
`-' #
#
#
#
##
,-. #
/ | #
' .' #
| | #
| | #
' '. #
\ | #
`-' ##
,-. #
| \ #
'. ' #
| | #
| | #
.' ' #
| / #
`-' ##
#
_ #
.-,| |,-. #
_\ ' ' /_ #
(__ __)#
/ . . \ #
`-'|_|`-' #
##
#
#
,-. #
,-| |-. #
'-| |-' #
`-' #
#
##
#
#
#
#
#
#
,-. #
'./ ##
#
#
(`-') #
( OO).-> #
(,------. #
`------' #
#
##
#
#
#
#
#
#
,-. #
'-' ##
,-. #
/ / #
/ / #
/ / #
/ / #
/ / #
/ / #
`-' ##
#
#
.----. #
/ .. \ #
| / \ . #
' \ / ' #
\ `' / #
`---'' ##
#
#
.--. #
/_ | #
| | #
| | #
| | #
`--' ##
#
#
.----. #
\_,-. | #
.' .' #
.' /_ #
| | #
`------' ##
#
#
.----. #
\_.-, | #
|_ < #
.-. \ | #
\ `-' / #
`---'' ##
#
#
.---. #
/ . | #
/ /| | #
/ '-' || #
`---| |' #
`--' ##
#
#
.-----. #
| __| #
`--. '. #
.- | | #
| `-' / #
`---'' ##
#
#
,--. #
/ .' #
. / -. #
' .-. \ #
\ `-' / #
`----' ##
#
#
.-------. #
| _ ' #
`-' / / #
. / #
/ / #
`--' ##
#
#
.----. #
/ .-. \ #
\ '-' / #
/ /`. \ #
\ '-' / #
`---'' ##
#
#
.----. #
/ ,-. \ #
\ '-' . #
`- / .' #
.' / #
`--' ##
#
#
,-. #
'-' #
,-. #
'-' #
#
##
#
#
,-. #
'-' #
,-. #
'./ #
#
##
,-. #
/ | #
/ .' #
/ / #
\ \ #
\ '. #
\ | #
`-' ##
#
#
,-----. #
'-----' #
,-----. #
'-----' #
#
##
,-. #
| \ #
'. \ #
\ \ #
/ / #
.' / #
| / #
`-' ##
,------. #
/ .--. ' #
| | | | #
`--'__. | #
| .' #
|___| #
.---. #
`---' ##
#
<-. #
,----.' #
' (`-')| #
| (OO / #
' '-'\ #
`----' #
##
(`-') _ #
(OO ).-/ #
/ ,---. #
| \ /`.\ #
'-'|_.' | #
(| .-. | #
| | | | #
`--' `--' ##
<-.(`-') #
__( OO) #
'-'---.\ #
| .-. (/ #
| '-' `.) #
| /`'. | #
| '--' / #
`------' ##
#
_ #
\-,-----. #
| .--./ #
/_) (`-') #
|| |OO ) #
(_' '--'\ #
`-----' ##
_(`-') #
( (OO ).-> #
\ .'_ #
'`'-..__) #
| | ' | #
| | / : #
| '-' / #
`------' ##
(`-') _ #
( OO).-/ #
(,------. #
| .---' #
(| '--. #
| .--' #
| `---. #
`------' ##
#
<-. #
(`-')-----.#
(OO|(_\---'#
/ | '--. #
\_) .--' #
`| |_) #
`--' ##
#
.-> #
,---(`-') #
' .-(OO ) #
| | .-, \ #
| | '.(_/ #
| '-' | #
`-----' ##
(`-').-> #
(OO )__ #
,--. ,'-' #
| | | | #
| `-' | #
| .-. | #
| | | | #
`--' `--' ##
_ #
(_) #
,-(`-') #
| ( OO) #
| | ) #
(| |_/ #
| |'-> #
`--' ##
#
#
<-.--. #
(`-'| ,| #
(OO |(_| #
,--. | | #
| '-' / #
`-----' ##
<-.(`-') #
__( OO) #
'-'. ,--. #
| .' / #
| /) #
| . ' #
| |\ \ #
`--' '--' ##
#
<-. #
,--. ) #
| (`-') #
| |OO ) #
(| '__ | #
| |' #
`-----' ##
<-. (`-') #
\(OO )_ #
,--./ ,-.)#
| `.' |#
| |'.'| |#
| | | |#
| | | |#
`--' `--'##
<-. (`-')_ #
\( OO) )#
,--./ ,--/ #
| \ | | #
| . '| |)#
| |\ | #
| | \ | #
`--' `--' ##
#
.-> #
(`-')----. #
( OO).-. '#
( _) | | |#
\| |)| |#
' '-' '#
`-----' ##
_ (`-') #
\-.(OO ) #
_.' \ #
(_...--'' #
| |_.' | #
| .___.' #
| | #
`--' ##
<-.(`-') #
__( OO) #
'-'---\_) #
| .-. | #
| | | <-' #
| | | | #
' '-' '-.#
`-----'--'##
(`-') #
<-.(OO ) #
,------,) #
| /`. ' #
| |_.' | #
| . .' #
| |\ \ #
`--' '--' ##
(`-').-> #
( OO)_ #
(_)--\_) #
/ _ / #
\_..`--. #
.-._) \ #
\ / #
`-----' ##
(`-') #
( OO).-> #
/ '._ #
|'--...__) #
`--. .--' #
| | #
| | #
`--' ##
#
.-> #
,--.(,--. #
| | |(`-')#
| | |(OO )#
| | | | \#
\ '-'(_ .'#
`-----' ##
(`-')#
_(OO )#
,--.(_/,-.\#
\ \ / (_/#
\ / / #
_ \ /_)#
\-'\ / #
`-' ##
.-> #
(`(`-')/`)#
,-`( OO).',#
| |\ | |#
| | '.| |#
| |.'.| |#
| ,'. |#
`--' '--'##
(`-') #
(OO )_.-> #
(_| \_)--.#
\ `.' / #
\ .') #
.' \ #
/ .'. \ #
`--' '--'##
#
.-> #
,--.' ,-.#
(`-')'.' /#
(OO \ / #
| / /) #
`-/ /` #
`--' ##
(`-') #
( OO).-> #
,(_/----. #
|__, | #
(_/ / #
.' .'_ #
| | #
`-------' ##
,----. #
| | #
| .-' #
| | #
| | #
| '-. #
| | #
`----' ##
,-. #
\ \ #
\ \ #
\ \ #
\ \ #
\ \ #
\ \ #
`-' ##
,----. #
| | #
`-. | #
| | #
| | #
.-' | #
| | #
`----' ##
#
,--. #
/ \ \ #
`--'`-- #
#
#
#
##
#
#
#
#
(`-') #
<-.(OO ) #
,------.) #
`------' ##
#
,--. #
'. \ #
`--' #
#
#
#
##
(`-') _ #
(OO ).-/ #
/ ,---. #
| \ /`.\ #
'-'|_.' | #
(| .-. | #
| | | | #
`--' `--' ##
<-.(`-') #
__( OO) #
'-'---.\ #
| .-. (/ #
| '-' `.) #
| /`'. | #
| '--' / #
`------' ##
#
_ #
\-,-----. #
| .--./ #
/_) (`-') #
|| |OO ) #
(_' '--'\ #
`-----' ##
_(`-') #
( (OO ).-> #
\ .'_ #
'`'-..__) #
| | ' | #
| | / : #
| '-' / #
`------' ##
(`-') _ #
( OO).-/ #
(,------. #
| .---' #
(| '--. #
| .--' #
| `---. #
`------' ##
#
<-. #
(`-')-----.#
(OO|(_\---'#
/ | '--. #
\_) .--' #
`| |_) #
`--' ##
#
.-> #
,---(`-') #
' .-(OO ) #
| | .-, \ #
| | '.(_/ #
| '-' | #
`-----' ##
(`-').-> #
(OO )__ #
,--. ,'-' #
| | | | #
| `-' | #
| .-. | #
| | | | #
`--' `--' ##
_ #
(_) #
,-(`-') #
| ( OO) #
| | ) #
(| |_/ #
| |'-> #
`--' ##
#
#
<-.--. #
(`-'| ,| #
(OO |(_| #
,--. | | #
| '-' / #
`-----' ##
<-.(`-') #
__( OO) #
'-'. ,--. #
| .' / #
| /) #
| . ' #
| |\ \ #
`--' '--' ##
#
<-. #
,--. ) #
| (`-') #
| |OO ) #
(| '__ | #
| |' #
`-----' ##
<-. (`-') #
\(OO )_ #
,--./ ,-.)#
| `.' |#
| |'.'| |#
| | | |#
| | | |#
`--' `--'##
<-. (`-')_ #
\( OO) )#
,--./ ,--/ #
| \ | | #
| . '| |)#
| |\ | #
| | \ | #
`--' `--' ##
#
.-> #
(`-')----. #
( OO).-. '#
( _) | | |#
\| |)| |#
' '-' '#
`-----' ##
_ (`-') #
\-.(OO ) #
_.' \ #
(_...--'' #
| |_.' | #
| .___.' #
| | #
`--' ##
<-.(`-') #
__( OO) #
'-'---\_) #
| .-. | #
| | | <-' #
| | | | #
' '-' '-.#
`-----'--'##
(`-') #
<-.(OO ) #
,------,) #
| /`. ' #
| |_.' | #
| . .' #
| |\ \ #
`--' '--' ##
(`-').-> #
( OO)_ #
(_)--\_) #
/ _ / #
\_..`--. #
.-._) \ #
\ / #
`-----' ##
(`-') #
( OO).-> #
/ '._ #
|'--...__) #
`--. .--' #
| | #
| | #
`--' ##
#
.-> #
,--.(,--. #
| | |(`-')#
| | |(OO )#
| | | | \#
\ '-'(_ .'#
`-----' ##
(`-')#
_(OO )#
,--.(_/,-.\#
\ \ / (_/#
\ / / #
_ \ /_)#
\-'\ / #
`-' ##
.-> #
(`(`-')/`)#
,-`( OO).',#
| |\ | |#
| | '.| |#
| |.'.| |#
| ,'. |#
`--' '--'##
(`-') #
(OO )_.-> #
(_| \_)--.#
\ `.' / #
\ .') #
.' \ #
/ .'. \ #
`--' '--'##
#
.-> #
,--.' ,-.#
(`-')'.' /#
(OO \ / #
| / /) #
`-/ /` #
`--' ##
(`-') #
( OO).-> #
,(_/----. #
|__, | #
(_/ / #
.' .'_ #
| | #
`-------' ##
,--. #
| | #
| .' #
/ / #
\ \ #
| '. #
| | #
`--' ##
,-. #
| | #
| | #
| | #
| | #
| | #
| | #
`-' ##
,--. #
| | #
'. | #
\ \ #
/ / #
.' | #
| | #
`--' ##
.--, #
.-' / #
/ --` #
`--' #
#
#
#
##
(`-') _ #
(OO ).-/ #
/ ,---. #
| \ /`.\ #
'-'|_.' | #
(| .-. | #
| | | | #
`--' `--' ##
#
.-> #
(`-')----. #
( OO).-. '#
( _) | | |#
\| |)| |#
' '-' '#
`-----' ##
#
.-> #
,--.(,--. #
| | |(`-')#
| | |(OO )#
| | | | \#
\ '-'(_ .'#
`-----' ##
(`-') _ #
(OO ).-/ #
/ ,---. #
| \ /`.\ #
'-'|_.' | #
(| .-. | #
| | | | #
`--' `--' ##
#
.-> #
(`-')----. #
( OO).-. '#
( _) | | |#
\| |)| |#
' '-' '#
`-----' ##
#
.-> #
,--.(,--. #
| | |(`-')#
| | |(OO )#
| | | | \#
\ '-'(_ .'#
`-----' ##
ß#
#
#
#
#
#
#
##
@@ -0,0 +1,32 @@
export { JSON5ParseOptions, JSON5StringifyOptions, parseJSON5, stringifyJSON5 } from './json5.js';
export { JSONCParseError, JSONCParseOptions, parseJSONC, stringifyJSONC } from './jsonc.js';
export { YAMLParseOptions, YAMLStringifyOptions, parseYAML, stringifyYAML } from './yaml.js';
import { F as FormatOptions } from './shared/confbox.9745c98f.js';
export { parseTOML, stringifyTOML } from './toml.js';
/**
* Converts a [JSON](https://www.json.org/json-en.html) string into an object.
*
* Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
*/
declare function parseJSON<T = unknown>(text: string, options?: JSONParseOptions): T;
/**
* Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
*
* Indentation status is auto detected and preserved when using value from parseJSON.
*/
declare function stringifyJSON(value: any, options?: JSONStringifyOptions): string;
interface JSONParseOptions extends FormatOptions {
/**
* A function that transforms the results. This function is called for each member of the object.
*/
reviver?: (this: any, key: string, value: any) => any;
}
interface JSONStringifyOptions extends FormatOptions {
/**
* A function that transforms the results. This function is called for each member of the object.
*/
replacer?: (this: any, key: string, value: any) => any;
}
export { type JSONParseOptions, type JSONStringifyOptions, parseJSON, stringifyJSON };
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/standalone/index.ts"],"names":[],"mappings":";;AAGA,oDAAkG;AAClG,kDAA0F;AAE1F,SAAS,cAAc,CACrB,GAAY,EACZ,UAA2D;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gBAC7D,IAAI,SAAS,CAAC,YAAY,CAAC,KAAK,sBAAc,CAAC,OAAO;oBAAE,OAAO,OAAO,CAAA;gBACtE,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA;gBACxD,OAAO,IAAA,QAAC,EAAA,GAAG,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;YACnC,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,SAAS,SAAS,CAAC,IAAoB;;YACrC,OAAO,MAAA,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,0CAAE,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3C,CAAC;QAED,SAAS,YAAY,CAAC,IAAoB,EAAE,KAAqB;YAC/D,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAA;YACrB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,cAAc,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"git-branch-plus.js","sources":["../../../src/icons/git-branch-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GitBranchPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAzdjEyIiAvPgogIDxwYXRoIGQ9Ik0xOCA5YTMgMyAwIDEgMCAwLTYgMyAzIDAgMCAwIDAgNnoiIC8+CiAgPHBhdGggZD0iTTYgMjFhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2eiIgLz4KICA8cGF0aCBkPSJNMTUgNmE5IDkgMCAwIDAtOSA5IiAvPgogIDxwYXRoIGQ9Ik0xOCAxNXY2IiAvPgogIDxwYXRoIGQ9Ik0yMSAxOGgtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/git-branch-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 GitBranchPlus = createLucideIcon('GitBranchPlus', [\n ['path', { d: 'M6 3v12', key: 'qpgusn' }],\n ['path', { d: 'M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z', key: '1d02ji' }],\n ['path', { d: 'M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z', key: 'chk6ph' }],\n ['path', { d: 'M15 6a9 9 0 0 0-9 9', key: 'or332x' }],\n ['path', { d: 'M18 15v6', key: '9wciyi' }],\n ['path', { d: 'M21 18h-6', key: '139f0c' }],\n]);\n\nexport default GitBranchPlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpD,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,144 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.parseForESLint = parseForESLint;
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
const visitor_keys_1 = require("@typescript-eslint/visitor-keys");
const debug_1 = __importDefault(require("debug"));
const typescript_1 = require("typescript");
const log = (0, debug_1.default)('typescript-eslint:parser:parser');
function validateBoolean(value, fallback = false) {
if (typeof value !== 'boolean') {
return fallback;
}
return value;
}
const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.[cm]?ts$/;
function getLib(compilerOptions) {
if (compilerOptions.lib) {
return compilerOptions.lib
.map(lib => LIB_FILENAME_REGEX.exec(lib.toLowerCase())?.[1])
.filter((lib) => !!lib);
}
const defaultTarget = typescript_estree_1.typescriptVersionIsAtLeast['6.0']
? typescript_1.ScriptTarget.LatestStandard
: typescript_1.ScriptTarget.ES5; // eslint-disable-line @typescript-eslint/no-deprecated -- Deprecated in TS 6 but we support TS < 6
const target = compilerOptions.target ?? defaultTarget;
// https://github.com/microsoft/TypeScript/blob/35ff23d4b0cc715691323ebe54f523c16fe6e3a5/src/compiler/utilitiesPublic.ts#L312-L346
switch (target) {
case typescript_1.ScriptTarget.ES2015:
return ['es6'];
case typescript_1.ScriptTarget.ES2016:
return ['es2016.full'];
case typescript_1.ScriptTarget.ES2017:
return ['es2017.full'];
case typescript_1.ScriptTarget.ES2018:
return ['es2018.full'];
case typescript_1.ScriptTarget.ES2019:
return ['es2019.full'];
case typescript_1.ScriptTarget.ES2020:
return ['es2020.full'];
case typescript_1.ScriptTarget.ES2021:
return ['es2021.full'];
case typescript_1.ScriptTarget.ES2022:
return ['es2022.full'];
case typescript_1.ScriptTarget.ES2023:
return ['es2023.full'];
case typescript_1.ScriptTarget.ES2024:
return ['es2024.full'];
case typescript_1.ScriptTarget.ES2025:
return ['es2025.full'];
case typescript_1.ScriptTarget.ESNext:
return ['esnext.full'];
default:
return ['lib'];
}
}
function parse(code, options) {
return parseForESLint(code, options).ast;
}
function parseForESLint(code, parserOptions) {
if (!parserOptions || typeof parserOptions !== 'object') {
parserOptions = {};
}
else {
parserOptions = { ...parserOptions };
}
// https://eslint.org/docs/user-guide/configuring#specifying-parser-options
// if sourceType is not provided by default eslint expect that it will be set to "script"
if (parserOptions.sourceType !== 'module' &&
parserOptions.sourceType !== 'script') {
parserOptions.sourceType = 'script';
}
if (typeof parserOptions.ecmaFeatures !== 'object') {
parserOptions.ecmaFeatures = {};
}
/**
* Allow the user to suppress the warning from typescript-estree if they are using an unsupported
* version of TypeScript
*/
const warnOnUnsupportedTypeScriptVersion = validateBoolean(parserOptions.warnOnUnsupportedTypeScriptVersion, true);
const tsestreeOptions = {
jsx: validateBoolean(parserOptions.ecmaFeatures.jsx),
...(!warnOnUnsupportedTypeScriptVersion && { loggerFn: false }),
...parserOptions,
// Override errorOnTypeScriptSyntacticAndSemanticIssues and set it to false to prevent use from user config
// https://github.com/typescript-eslint/typescript-eslint/issues/8681#issuecomment-2000411834
errorOnTypeScriptSyntacticAndSemanticIssues: false,
// comment, loc, range, and tokens should always be set for ESLint usage
// https://github.com/typescript-eslint/typescript-eslint/issues/8347
comment: true,
loc: true,
range: true,
tokens: true,
};
const analyzeOptions = {
globalReturn: parserOptions.ecmaFeatures.globalReturn,
jsxFragmentName: parserOptions.jsxFragmentName,
jsxPragma: parserOptions.jsxPragma,
lib: parserOptions.lib,
sourceType: parserOptions.sourceType,
};
const { ast, services } = (0, typescript_estree_1.parseAndGenerateServices)(code, tsestreeOptions);
ast.sourceType = parserOptions.sourceType;
if (services.program) {
// automatically apply the options configured for the program
const compilerOptions = services.program.getCompilerOptions();
if (analyzeOptions.lib == null) {
analyzeOptions.lib = getLib(compilerOptions);
log('Resolved libs from program: %o', analyzeOptions.lib);
}
if (
// eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
analyzeOptions.jsxPragma === undefined &&
compilerOptions.jsxFactory != null) {
// in case the user has specified something like "preact.h"
const factory = compilerOptions.jsxFactory.split('.')[0].trim();
analyzeOptions.jsxPragma = factory;
log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma);
}
if (
// eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
analyzeOptions.jsxFragmentName === undefined &&
compilerOptions.jsxFragmentFactory != null) {
// in case the user has specified something like "preact.Fragment"
const fragFactory = compilerOptions.jsxFragmentFactory
.split('.')[0]
.trim();
analyzeOptions.jsxFragmentName = fragFactory;
log('Resolved jsxFragmentName from program: %s', analyzeOptions.jsxFragmentName);
}
}
const scopeManager = (0, scope_manager_1.analyze)(ast, analyzeOptions);
// if not defined - override from the parserOptions
services.emitDecoratorMetadata ??=
parserOptions.emitDecoratorMetadata === true;
services.experimentalDecorators ??=
parserOptions.experimentalDecorators === true;
services.isolatedDeclarations ??= parserOptions.isolatedDeclarations === true;
return { ast, scopeManager, services, visitorKeys: visitor_keys_1.visitorKeys };
}
@@ -0,0 +1 @@
{"version":3,"file":"new-process-route-tree.js","names":[],"sources":["../../src/new-process-route-tree.ts"],"sourcesContent":["import { invariant } from './invariant'\nimport { createLRUCache } from './lru-cache'\nimport { last } from './utils'\nimport type { LRUCache } from './lru-cache'\n\nexport const SEGMENT_TYPE_PATHNAME = 0\nexport const SEGMENT_TYPE_PARAM = 1\nexport const SEGMENT_TYPE_WILDCARD = 2\nexport const SEGMENT_TYPE_OPTIONAL_PARAM = 3\nconst SEGMENT_TYPE_INDEX = 4\nconst SEGMENT_TYPE_PATHLESS = 5 // only used in matching to represent pathless routes that need to carry more information\n\n/**\n * All the kinds of segments that can be present in a route path.\n */\nexport type SegmentKind =\n | typeof SEGMENT_TYPE_PATHNAME\n | typeof SEGMENT_TYPE_PARAM\n | typeof SEGMENT_TYPE_WILDCARD\n | typeof SEGMENT_TYPE_OPTIONAL_PARAM\n\n/**\n * All the kinds of segments that can be present in the segment tree.\n */\ntype ExtendedSegmentKind =\n | SegmentKind\n | typeof SEGMENT_TYPE_INDEX\n | typeof SEGMENT_TYPE_PATHLESS\n\nfunction getOpenAndCloseBraces(\n part: string,\n): [openBrace: number, closeBrace: number] | null {\n const openBrace = part.indexOf('{')\n if (openBrace === -1) return null\n const closeBrace = part.indexOf('}', openBrace)\n if (closeBrace === -1) return null\n const afterOpen = openBrace + 1\n if (afterOpen >= part.length) return null\n return [openBrace, closeBrace]\n}\n\ntype ParsedSegment = Uint16Array & {\n /** segment type (0 = pathname, 1 = param, 2 = wildcard, 3 = optional param) */\n 0: SegmentKind\n /** index of the end of the prefix */\n 1: number\n /** index of the start of the value */\n 2: number\n /** index of the end of the value */\n 3: number\n /** index of the start of the suffix */\n 4: number\n /** index of the end of the segment */\n 5: number\n}\n\n/**\n * Populates the `output` array with the parsed representation of the given `segment` string.\n *\n * Usage:\n * ```ts\n * let output\n * let cursor = 0\n * while (cursor < path.length) {\n * output = parseSegment(path, cursor, output)\n * const end = output[5]\n * cursor = end + 1\n * ```\n *\n * `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed\n * or initialized, it will be done automatically.\n */\nexport function parseSegment(\n /** The full path string containing the segment. */\n path: string,\n /** The starting index of the segment within the path. */\n start: number,\n /** A Uint16Array (length: 6) to populate with the parsed segment data. */\n output: Uint16Array = new Uint16Array(6),\n): ParsedSegment {\n const next = path.indexOf('/', start)\n const end = next === -1 ? path.length : next\n const part = path.substring(start, end)\n\n if (!part || !part.includes('$')) {\n // early escape for static pathname\n output[0] = SEGMENT_TYPE_PATHNAME\n output[1] = start\n output[2] = start\n output[3] = end\n output[4] = end\n output[5] = end\n return output as ParsedSegment\n }\n\n // $ (wildcard)\n if (part === '$') {\n const total = path.length\n output[0] = SEGMENT_TYPE_WILDCARD\n output[1] = start\n output[2] = start\n output[3] = total\n output[4] = total\n output[5] = total\n return output as ParsedSegment\n }\n\n // $paramName\n if (part.charCodeAt(0) === 36) {\n output[0] = SEGMENT_TYPE_PARAM\n output[1] = start\n output[2] = start + 1 // skip '$'\n output[3] = end\n output[4] = end\n output[5] = end\n return output as ParsedSegment\n }\n\n const braces = getOpenAndCloseBraces(part)\n if (braces) {\n const [openBrace, closeBrace] = braces\n const firstChar = part.charCodeAt(openBrace + 1)\n\n // Check for {-$...} (optional param)\n // prefix{-$paramName}suffix\n // /^([^{]*)\\{-\\$([a-zA-Z_$][a-zA-Z0-9_$]*)\\}([^}]*)$/\n if (firstChar === 45) {\n // '-'\n if (\n openBrace + 2 < part.length &&\n part.charCodeAt(openBrace + 2) === 36 // '$'\n ) {\n const paramStart = openBrace + 3\n const paramEnd = closeBrace\n // Validate param name exists\n if (paramStart < paramEnd) {\n output[0] = SEGMENT_TYPE_OPTIONAL_PARAM\n output[1] = start + openBrace\n output[2] = start + paramStart\n output[3] = start + paramEnd\n output[4] = start + closeBrace + 1\n output[5] = end\n return output as ParsedSegment\n }\n }\n } else if (firstChar === 36) {\n // '$'\n const dollarPos = openBrace + 1\n const afterDollar = openBrace + 2\n // Check for {$} (wildcard)\n if (afterDollar === closeBrace) {\n // For wildcard, value should be '$' (from dollarPos to afterDollar)\n // prefix{$}suffix\n // /^([^{]*)\\{\\$\\}([^}]*)$/\n output[0] = SEGMENT_TYPE_WILDCARD\n output[1] = start + openBrace\n output[2] = start + dollarPos\n output[3] = sLine truncated
@@ -0,0 +1,3 @@
import { getConnInfo } from "./conninfo.js";
import { Callback, CloudFrontConfig, CloudFrontEdgeEvent, CloudFrontRequest, CloudFrontResponse, handle } from "./handler.js";
export { type Callback, type CloudFrontConfig, type CloudFrontEdgeEvent, type CloudFrontRequest, type CloudFrontResponse, getConnInfo, handle };
@@ -0,0 +1 @@
{"version":3,"file":"hand-coins.js","sources":["../../../src/icons/hand-coins.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HandCoins\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTVoMmEyIDIgMCAxIDAgMC00aC0zYy0uNiAwLTEuMS4yLTEuNC42TDMgMTciIC8+CiAgPHBhdGggZD0ibTcgMjEgMS42LTEuNGMuMy0uNC44LS42IDEuNC0uNmg0YzEuMSAwIDIuMS0uNCAyLjgtMS4ybDQuNi00LjRhMiAyIDAgMCAwLTIuNzUtMi45MWwtNC4yIDMuOSIgLz4KICA8cGF0aCBkPSJtMiAxNiA2IDYiIC8+CiAgPGNpcmNsZSBjeD0iMTYiIGN5PSI5IiByPSIyLjkiIC8+CiAgPGNpcmNsZSBjeD0iNiIgY3k9IjUiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/hand-coins\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 HandCoins = createLucideIcon('HandCoins', [\n ['path', { d: 'M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17', key: 'geh8rc' }],\n [\n 'path',\n {\n d: 'm7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9',\n key: '1fto5m',\n },\n ],\n ['path', { d: 'm2 16 6 6', key: '1pfhp9' }],\n ['circle', { cx: '16', cy: '9', r: '2.9', key: '1n0dlu' }],\n ['circle', { cx: '6', cy: '5', r: '3', key: '151irh' }],\n]);\n\nexport default HandCoins;\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,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA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A,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACxD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,34 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_helper_websocket_index = require("../../helper/websocket/index.js");
//#region src/adapter/cloudflare-workers/websocket.ts
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
const upgradeWebSocket = require_helper_websocket_index.defineWebSocketHelper(async (c, events) => {
if (c.req.header("Upgrade") !== "websocket") return;
const webSocketPair = new WebSocketPair();
const client = webSocketPair[0];
const server = webSocketPair[1];
const wsContext = new require_helper_websocket_index.WSContext({
close: (code, reason) => server.close(code, reason),
get protocol() {
return server.protocol;
},
raw: server,
get readyState() {
return server.readyState;
},
url: server.url ? new URL(server.url) : null,
send: (source) => server.send(source)
});
if (events.onClose) server.addEventListener("close", (evt) => events.onClose?.(evt, wsContext));
if (events.onMessage) server.addEventListener("message", (evt) => events.onMessage?.(evt, wsContext));
if (events.onError) server.addEventListener("error", (evt) => events.onError?.(evt, wsContext));
server.accept?.();
return new Response(null, {
status: 101,
webSocket: client
});
});
//#endregion
exports.upgradeWebSocket = upgradeWebSocket;
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assert = assert;
// the base assert module doesn't use ts assertion syntax
function assert(value, message) {
if (value == null) {
throw new Error(message);
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"8":"_Z","1924":"_A"},B:{"1":"_J"},C:{"1":"_kR","8":"_OC","516":"LB MB","772":"_uF LD"},D:{"1":"_oO","8":"_KC","516":"LB _WQ","772":"KB","900":"_jH _2B"},E:{"1":"_7C","8":"_4","900":"_iG OD"},F:{"1":"_a","8":"_SR","900":"C _KL"},G:{"1":"_2","8":"_d","900":"_xC"},H:{"900":"1D"},I:{"1":"_X","8":"_n","900":"_GF"},J:{"1":"A","900":"D"},K:{"1":"H","8":"_A","900":"_EL"},L:{"1":"I"},M:{"1":"YC"},N:{"900":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"classList (DOMTokenList)",D:true};
@@ -0,0 +1,132 @@
import { Minipass } from 'minipass';
import { normalizeWindowsPath } from './normalize-windows-path.js';
export class ReadEntry extends Minipass {
extended;
globalExtended;
header;
startBlockSize;
blockRemain;
remain;
type;
meta = false;
ignore = false;
path;
mode;
uid;
gid;
uname;
gname;
size = 0;
mtime;
atime;
ctime;
linkpath;
dev;
ino;
nlink;
invalid = false;
absolute;
unsupported = false;
constructor(header, ex, gex) {
super({});
// read entries always start life paused. this is to avoid the
// situation where Minipass's auto-ending empty streams results
// in an entry ending before we're ready for it.
this.pause();
this.extended = ex;
this.globalExtended = gex;
this.header = header;
/* c8 ignore start */
this.remain = header.size ?? 0;
/* c8 ignore stop */
this.startBlockSize = 512 * Math.ceil(this.remain / 512);
this.blockRemain = this.startBlockSize;
this.type = header.type;
switch (this.type) {
case 'File':
case 'OldFile':
case 'Link':
case 'SymbolicLink':
case 'CharacterDevice':
case 'BlockDevice':
case 'Directory':
case 'FIFO':
case 'ContiguousFile':
case 'GNUDumpDir':
break;
case 'NextFileHasLongLinkpath':
case 'NextFileHasLongPath':
case 'OldGnuLongPath':
case 'GlobalExtendedHeader':
case 'ExtendedHeader':
case 'OldExtendedHeader':
this.meta = true;
break;
// NOTE: gnutar and bsdtar treat unrecognized types as 'File'
// it may be worth doing the same, but with a warning.
default:
this.ignore = true;
}
/* c8 ignore start */
if (!header.path) {
throw new Error('no path provided for tar.ReadEntry');
}
/* c8 ignore stop */
this.path = normalizeWindowsPath(header.path);
this.mode = header.mode;
if (this.mode) {
this.mode = this.mode & 0o7777;
}
this.uid = header.uid;
this.gid = header.gid;
this.uname = header.uname;
this.gname = header.gname;
this.size = this.remain;
this.mtime = header.mtime;
this.atime = header.atime;
this.ctime = header.ctime;
/* c8 ignore start */
this.linkpath =
header.linkpath ? normalizeWindowsPath(header.linkpath) : undefined;
/* c8 ignore stop */
this.uname = header.uname;
this.gname = header.gname;
if (ex) {
this.#slurp(ex);
}
if (gex) {
this.#slurp(gex, true);
}
}
write(data) {
const writeLen = data.length;
if (writeLen > this.blockRemain) {
throw new Error('writing more to entry than is appropriate');
}
const r = this.remain;
const br = this.blockRemain;
this.remain = Math.max(0, r - writeLen);
this.blockRemain = Math.max(0, br - writeLen);
if (this.ignore) {
return true;
}
if (r >= writeLen) {
return super.write(data);
}
// r < writeLen
return super.write(data.subarray(0, r));
}
#slurp(ex, gex = false) {
if (ex.path)
ex.path = normalizeWindowsPath(ex.path);
if (ex.linkpath)
ex.linkpath = normalizeWindowsPath(ex.linkpath);
Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
// we slurp in everything except for the path attribute in
// a global extended header, because that's weird. Also, any
// null/undefined values are ignored.
return !(v === null || v === undefined || (k === 'path' && gex));
})));
}
}
//# sourceMappingURL=read-entry.js.map
@@ -0,0 +1,105 @@
"use strict"
var Buffer = require("safer-buffer").Buffer
// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
// we opt to dependency-inject it instead of creating a hard dependency.
module.exports = function (streamModule) {
var Transform = streamModule.Transform
// == Encoder stream =======================================================
function IconvLiteEncoderStream (conv, options) {
this.conv = conv
options = options || {}
options.decodeStrings = false // We accept only strings, so we don't need to decode them.
Transform.call(this, options)
}
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
constructor: { value: IconvLiteEncoderStream }
})
IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) {
if (typeof chunk !== "string") {
return done(new Error("Iconv encoding stream needs strings as its input."))
}
try {
var res = this.conv.write(chunk)
if (res && res.length) this.push(res)
done()
} catch (e) {
done(e)
}
}
IconvLiteEncoderStream.prototype._flush = function (done) {
try {
var res = this.conv.end()
if (res && res.length) this.push(res)
done()
} catch (e) {
done(e)
}
}
IconvLiteEncoderStream.prototype.collect = function (cb) {
var chunks = []
this.on("error", cb)
this.on("data", function (chunk) { chunks.push(chunk) })
this.on("end", function () {
cb(null, Buffer.concat(chunks))
})
return this
}
// == Decoder stream =======================================================
function IconvLiteDecoderStream (conv, options) {
this.conv = conv
options = options || {}
options.encoding = this.encoding = "utf8" // We output strings.
Transform.call(this, options)
}
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
constructor: { value: IconvLiteDecoderStream }
})
IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) {
if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) }
try {
var res = this.conv.write(chunk)
if (res && res.length) this.push(res, this.encoding)
done()
} catch (e) {
done(e)
}
}
IconvLiteDecoderStream.prototype._flush = function (done) {
try {
var res = this.conv.end()
if (res && res.length) this.push(res, this.encoding)
done()
} catch (e) {
done(e)
}
}
IconvLiteDecoderStream.prototype.collect = function (cb) {
var res = ""
this.on("error", cb)
this.on("data", function (chunk) { res += chunk })
this.on("end", function () {
cb(null, res)
})
return this
}
return {
IconvLiteEncoderStream: IconvLiteEncoderStream,
IconvLiteDecoderStream: IconvLiteDecoderStream
}
}
@@ -0,0 +1,17 @@
export * as core from "../core/index.js";
export * from "./schemas.js";
export * from "./checks.js";
export * from "./errors.js";
export * from "./parse.js";
export * from "./compat.js";
export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
export { toJSONSchema } from "../core/json-schema-processors.js";
export { fromJSONSchema } from "./from-json-schema.js";
export { deepPartial } from "./deep-partial.js";
// Types and values both, from one module — re-exporting the types from core would collide.
export { input, output } from "./in-out.js";
export * as locales from "../locales/index.js";
// iso must be exported from top-level https://github.com/colinhacks/zod/issues/4491
export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
export * as iso from "./iso.js";
export * as coerce from "./coerce.js";
@@ -0,0 +1,18 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
module.exports.deprecate = (fn, msg) => {
let once = true;
return function deprecate() {
if (once) {
// eslint-disable-next-line no-console
console.warn(`DeprecationWarning: ${msg}`);
once = false;
}
// eslint-disable-next-line prefer-rest-params
return fn.apply(this, arguments);
};
};
@@ -0,0 +1,13 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var motionDom = require('motion-dom');
Object.defineProperty(exports, "recordStats", {
enumerable: true,
get: function () { return motionDom.recordStats; }
});
//# sourceMappingURL=debug.js.map
@@ -0,0 +1,473 @@
import { createPlugin, createStream } from 'seroval'
import type { PluginData, PluginInfo, SerovalNode } from 'seroval'
/**
* Hint for RawStream encoding strategy during SSR serialization.
* - 'binary': Always use base64 encoding (best for binary data like files, images)
* - 'text': Try UTF-8 first, fallback to base64 (best for text-heavy data like RSC payloads)
*/
export type RawStreamHint = 'binary' | 'text'
/**
* Options for RawStream configuration.
*/
export interface RawStreamOptions {
/**
* Encoding hint for SSR serialization.
* - 'binary' (default): Always use base64 encoding
* - 'text': Try UTF-8 first, fallback to base64 for invalid UTF-8 chunks
*/
hint?: RawStreamHint
}
/**
* Marker class for ReadableStream<Uint8Array> that should be serialized
* with base64 encoding (SSR) or binary framing (server functions).
*
* Wrap your binary streams with this to get efficient serialization:
* ```ts
* // For binary data (files, images, etc.)
* return { data: new RawStream(file.stream()) }
*
* // For text-heavy data (RSC payloads, etc.)
* return { data: new RawStream(rscStream, { hint: 'text' }) }
* ```
*/
export class RawStream {
public readonly hint: RawStreamHint
constructor(
public readonly stream: ReadableStream<Uint8Array>,
options?: RawStreamOptions,
) {
this.hint = options?.hint ?? 'binary'
}
}
/**
* Callback type for RPC plugin to register raw streams with multiplexer
*/
export type OnRawStreamCallback = (
streamId: number,
stream: ReadableStream<Uint8Array>,
) => void
// Base64 helpers used in both Node and browser.
// In Node-like runtimes, prefer Buffer for speed and compatibility.
const BufferCtor: any = (globalThis as any).Buffer
const hasNodeBuffer = !!BufferCtor && typeof BufferCtor.from === 'function'
function uint8ArrayToBase64(bytes: Uint8Array): string {
if (bytes.length === 0) return ''
if (hasNodeBuffer) {
return BufferCtor.from(bytes).toString('base64')
}
// Browser fallback: chunked String.fromCharCode + btoa
const CHUNK_SIZE = 0x8000 // 32KB chunks to avoid stack overflow
const chunks: Array<string> = []
for (let i = 0; i < bytes.length; i += CHUNK_SIZE) {
const chunk = bytes.subarray(i, i + CHUNK_SIZE)
chunks.push(String.fromCharCode.apply(null, chunk as any))
}
return btoa(chunks.join(''))
}
function base64ToUint8Array(base64: string): Uint8Array {
if (base64.length === 0) return new Uint8Array(0)
if (hasNodeBuffer) {
const buf = BufferCtor.from(base64, 'base64')
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength)
}
const binary = atob(base64)
const bytes = new Uint8Array(binary.length)
for (let i = 0; i < binary.length; i++) {
bytes[i] = binary.charCodeAt(i)
}
return bytes
}
// Factory sentinels - use null-proto objects to avoid prototype surprises
const RAW_STREAM_FACTORY_BINARY: Record<string, never> = Object.create(null)
const RAW_STREAM_FACTORY_TEXT: Record<string, never> = Object.create(null)
// Factory constructor for binary mode - converts seroval stream to ReadableStream<Uint8Array>
// All chunks are base64 encoded strings
const RAW_STREAM_FACTORY_CONSTRUCTOR_BINARY = (
stream: ReturnType<typeof createStream>,
) =>
new ReadableStream<Uint8Array>({
start(controller) {
stream.on({
next(base64: string) {
try {
controller.enqueue(base64ToUint8Array(base64))
} catch {
// Stream may be closed
}
},
throw(error: unknown) {
controller.error(error)
},
return() {
try {
controller.close()
} catch {
// Stream may already be closed
}
},
})
},
})
// Factory constructor for text mode - converts seroval stream to ReadableStream<Uint8Array>
// Chunks are either strings (UTF-8) or { $b64: string } (base64 fallback)
// Use module-level TextEncoder to avoid per-factory allocation
const textEncoderForFactory = new TextEncoder()
const RAW_STREAM_FACTORY_CONSTRUCTOR_TEXT = (
stream: ReturnType<typeof createStream>,
) => {
return new ReadableStream<Uint8Array>({
start(controller) {
stream.on({
next(value: string | { $b64: string }) {
try {
if (typeof value === 'string') {
controller.enqueue(textEncoderForFactory.encode(value))
} else {
controller.enqueue(base64ToUint8Array(value.$b64))
}
} catch {
// Stream may be closed
}
},
throw(error: unknown) {
controller.error(error)
},
return() {
try {
controller.close()
} catch {
// Stream may already be closed
}
},
})
},
})
}
// Minified factory function for binary mode - all chunks are base64 strings
// This must be self-contained since it's injected into the HTML
const FACTORY_BINARY = `(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))`
// Minified factory function for text mode - chunks are string or {$b64: string}
// Uses cached TextEncoder for performance
const FACTORY_TEXT = `(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})`
// Convert ReadableStream<Uint8Array> to seroval stream with base64-encoded chunks (binary mode)
function toBinaryStream(readable: ReadableStream<Uint8Array>) {
const stream = createStream()
const reader = readable.getReader()
// Use iterative loop instead of recursive async to avoid stack accumulation
;(async () => {
try {
while (true) {
const { done, value } = await reader.read()
if (done) {
stream.return(undefined)
break
}
stream.next(uint8ArrayToBase64(value))
}
} catch (error) {
stream.throw(error)
} finally {
reader.releaseLock()
}
})()
return stream
}
// Convert ReadableStream<Uint8Array> to seroval stream with UTF-8 first, base64 fallback (text mode)
function toTextStream(readable: ReadableStream<Uint8Array>) {
const stream = createStream()
const reader = readable.getReader()
const decoder = new TextDecoder('utf-8', { fatal: true })
// Use iterative loop instead of recursive async to avoid stack accumulation
;(async () => {
try {
while (true) {
const { done, value } = await reader.read()
if (done) {
// Flush any remaining bytes in the decoder
try {
const remaining = decoder.decode()
if (remaining.length > 0) {
stream.next(remaining)
}
} catch {
// Ignore decode errors on flush
}
stream.return(undefined)
break
}
try {
// Try UTF-8 decode first
const text = decoder.decode(value, { stream: true })
if (text.length > 0) {
stream.next(text)
}
} catch {
// UTF-8 decode failed, fallback to base64
stream.next({ $b64: uint8ArrayToBase64(value) })
}
}
} catch (error) {
stream.throw(error)
} finally {
reader.releaseLock()
}
})()
return stream
}
// Factory plugin for binary mode
const RawStreamFactoryBinaryPlugin = /* @__PURE__ */ createPlugin<
Record<string, never>,
PluginInfo
>({
tag: 'tss/RawStreamFactory',
test(value) {
return value === RAW_STREAM_FACTORY_BINARY
},
parse: {
sync(_value, _ctx, _data) {
return {}
},
async async(_value, _ctx, _data) {
return {}
},
stream(_value, _ctx, _data) {
return {}
},
},
serialize(_node, _ctx, _data) {
return FACTORY_BINARY
},
deserialize(_node, _ctx, _data) {
return RAW_STREAM_FACTORY_BINARY
},
})
// Factory plugin for text mode
const RawStreamFactoryTextPlugin = /* @__PURE__ */ createPlugin<
Record<string, never>,
PluginInfo
>({
tag: 'tss/RawStreamFactoryText',
test(value) {
return value === RAW_STREAM_FACTORY_TEXT
},
parse: {
sync(_value, _ctx, _data) {
return {}
},
async async(_value, _ctx, _data) {
return {}
},
stream(_value, _ctx, _data) {
return {}
},
},
serialize(_node, _ctx, _data) {
return FACTORY_TEXT
},
deserialize(_node, _ctx, _data) {
return RAW_STREAM_FACTORY_TEXT
},
})
export interface RawStreamSSRNode extends PluginInfo {
hint: SerovalNode
factory: SerovalNode
stream: SerovalNode
}
export interface RawStreamRPCNode extends PluginInfo {
streamId: SerovalNode
}
/**
* SSR Plugin - uses base64 or UTF-8+base64 encoding for chunks, delegates to seroval's stream mechanism.
* Used during SSR when serializing to JavaScript code for HTML injection.
*
* Supports two modes based on RawStream hint:
* - 'binary': Always base64 encode (default)
* - 'text': Try UTF-8 first, fallback to base64 for invalid UTF-8
*/
export const RawStreamSSRPlugin = /* @__PURE__ */ createPlugin<
RawStream,
RawStreamSSRNode
>({
tag: 'tss/RawStream',
extends: [RawStreamFactoryBinaryPlugin, RawStreamFactoryTextPlugin],
test(value: unknown) {
return value instanceof RawStream
},
parse: {
sync(value: RawStream, ctx, _data) {
// Sync parse not really supported for streams, return empty stream
const factory =
value.hint === 'text'
? RAW_STREAM_FACTORY_TEXT
: RAW_STREAM_FACTORY_BINARY
return {
hint: ctx.parse(value.hint),
factory: ctx.parse(factory),
stream: ctx.parse(createStream()),
}
},
async async(value: RawStream, ctx, _data) {
const factory =
value.hint === 'text'
? RAW_STREAM_FACTORY_TEXT
: RAW_STREAM_FACTORY_BINARY
const encodedStream =
value.hint === 'text'
? toTextStream(value.stream)
: toBinaryStream(value.stream)
return {
hint: await ctx.parse(value.hint),
factory: await ctx.parse(factory),
stream: await ctx.parse(encodedStream),
}
},
stream(value: RawStream, ctx, _data) {
const factory =
value.hint === 'text'
? RAW_STREAM_FACTORY_TEXT
: RAW_STREAM_FACTORY_BINARY
const encodedStream =
value.hint === 'text'
? toTextStream(value.stream)
: toBinaryStream(value.stream)
return {
hint: ctx.parse(value.hint),
factory: ctx.parse(factory),
stream: ctx.parse(encodedStream),
}
},
},
serialize(node: RawStreamSSRNode, ctx, _data) {
return (
'(' +
ctx.serialize(node.factory) +
')(' +
ctx.serialize(node.stream) +
')'
)
},
deserialize(node: RawStreamSSRNode, ctx, _data): any {
const stream: ReturnType<typeof createStream> = ctx.deserialize(node.stream)
const hint = ctx.deserialize(node.hint)
return hint === 'text'
? RAW_STREAM_FACTORY_CONSTRUCTOR_TEXT(stream)
: RAW_STREAM_FACTORY_CONSTRUCTOR_BINARY(stream)
},
})
/**
* Creates an RPC plugin instance that registers raw streams with a multiplexer.
* Used for server function responses where we want binary framing.
* Note: RPC always uses binary framing regardless of hint.
*
* @param onRawStream Callback invoked when a RawStream is encountered during serialization
*/
/* @__NO_SIDE_EFFECTS__ */
export function createRawStreamRPCPlugin(onRawStream: OnRawStreamCallback) {
// Own stream counter - sequential IDs starting at 1, independent of seroval internals
let nextStreamId = 1
return /* @__PURE__ */ createPlugin<RawStream, RawStreamRPCNode>({
tag: 'tss/RawStream',
test(value: unknown) {
return value instanceof RawStream
},
parse: {
async async(value: RawStream, ctx, _data: PluginData) {
const streamId = nextStreamId++
onRawStream(streamId, value.stream)
return { streamId: await ctx.parse(streamId) }
},
stream(value: RawStream, ctx, _data: PluginData) {
const streamId = nextStreamId++
onRawStream(streamId, value.stream)
return { streamId: ctx.parse(streamId) }
},
},
serialize(): never {
// RPC uses toCrossJSONStream which produces JSON nodes, not JS code.
// This method is only called by crossSerialize* which we don't use.
throw new Error(
'RawStreamRPCPlugin.serialize should not be called. RPC uses JSON serialization, not JS code generation.',
)
},
deserialize(): never {
// Client uses createRawStreamDeserializePlugin instead
throw new Error(
'RawStreamRPCPlugin.deserialize should not be called. Use createRawStreamDeserializePlugin on client.',
)
},
})
}
/**
* Creates a deserialize-only plugin for client-side stream reconstruction.
* Used in serverFnFetcher to wire up streams from frame decoder.
*
* @param getOrCreateStream Function to get/create a stream by ID from frame decoder
*/
export function createRawStreamDeserializePlugin(
getOrCreateStream: (id: number) => ReadableStream<Uint8Array>,
) {
return /* @__PURE__ */ createPlugin<any, RawStreamRPCNode>({
tag: 'tss/RawStream',
test: () => false, // Client never serializes RawStream
parse: {}, // Client only deserializes, never parses
serialize(): never {
// Client never serializes RawStream back to server
throw new Error(
'RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.',
)
},
deserialize(node, ctx, _data) {
// In normal seroval usage, ctx.deserialize exists.
// Some unit tests call plugin.deserialize directly with a minimal ctx.
const id =
typeof (ctx as any)?.deserialize === 'function'
? (ctx as any).deserialize(node.streamId)
: (node as any).streamId
return getOrCreateStream(id as number)
},
})
}
@@ -0,0 +1,116 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "znaků", verb: "mít" },
file: { unit: "bajtů", verb: "mít" },
array: { unit: "prvků", verb: "mít" },
set: { unit: "prvků", verb: "mít" },
map: { unit: "prvků", verb: "mít" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "regulární výraz",
email: "e-mailová adresa",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "datum a čas ve formátu ISO",
date: "datum ve formátu ISO",
time: "čas ve formátu ISO",
duration: "doba trvání ISO",
ipv4: "IPv4 adresa",
ipv6: "IPv6 adresa",
mac: "MAC adresa",
cidrv4: "rozsah IPv4",
cidrv6: "rozsah IPv6",
base64: "řetězec zakódovaný ve formátu base64",
base64url: "řetězec zakódovaný ve formátu base64url",
json_string: "řetězec ve formátu JSON",
e164: "číslo E.164",
credit_card: "číslo kreditní karty",
currency_code: "kód měny",
iban: "IBAN",
jwt: "JWT",
template_literal: "vstup",
};
const TypeDictionary = {
nan: "NaN",
number: "číslo",
string: "řetězec",
function: "funkce",
array: "pole",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Neplatný vstup: očekáváno instanceof ${issue.expected}, obdrženo ${received}`;
}
return `Neplatný vstup: očekáváno ${expected}, obdrženo ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Neplatný vstup: očekáváno ${util.stringifyPrimitive(issue.values[0])}`;
return `Neplatná možnost: očekávána jedna z hodnot ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.maximum.toString()} ${sizing.unit ?? "prvků"}`;
}
return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.minimum.toString()} ${sizing.unit ?? "prvků"}`;
}
return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Neplatný řetězec: musí končit na "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`;
if (_issue.format === "regex")
return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`;
return `Neplatný formát ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Neplatné číslo: musí být násobkem ${issue.divisor}`;
case "unrecognized_keys":
return `Neznámé klíče: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Neplatný klíč v ${issue.origin}`;
case "invalid_union":
return "Neplatný vstup";
case "invalid_element":
return `Neplatná hodnota v ${issue.origin}`;
default:
return `Neplatný vstup`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,63 @@
{
"name": "make-dir",
"version": "4.0.0",
"description": "Make a directory and its parents if needed - Think `mkdir -p`",
"license": "MIT",
"repository": "sindresorhus/make-dir",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && nyc ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"mkdir",
"mkdirp",
"make",
"directories",
"folders",
"directory",
"folder",
"path",
"parent",
"parents",
"intermediate",
"recursively",
"recursive",
"create",
"fs",
"filesystem",
"file-system"
],
"dependencies": {
"semver": "^7.5.3"
},
"devDependencies": {
"@types/graceful-fs": "^4.1.3",
"@types/node": "^14.14.6",
"ava": "^2.4.0",
"codecov": "^3.2.0",
"graceful-fs": "^4.1.15",
"nyc": "^15.0.0",
"path-type": "^4.0.0",
"tempy": "^1.0.0",
"tsd": "^0.13.1",
"xo": "^0.34.2"
},
"nyc": {
"reporter": [
"text",
"lcov"
]
}
}
@@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('../cjs/use-sync-external-store-shim.native.production.js');
} else {
module.exports = require('../cjs/use-sync-external-store-shim.native.development.js');
}
@@ -0,0 +1,15 @@
# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls)
is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, <a href="http://livescript.net">LiveScript</a>.
See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more.
You can install via npm `npm install prelude-ls`
### Development
`make test` to test
`make build` to build `lib` from `src`
`make build-browser` to build browser versions
@@ -0,0 +1 @@
{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":"^4.0.0","immutable":"^5.1.5","source-map-js":">=0.6.2 <2.0.0"},"optionalDependencies":{"@parcel/watcher":"^2.4.1"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","node":{"require":"./sass.node.js","default":"./sass.node.mjs"},"default":{"require":"./sass.default.cjs","default":"./sass.default.js"}},"version":"1.99.0","bin":{"sass":"sass.js"},"main":"sass.node.js"}
@@ -0,0 +1,582 @@
# ufo
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![Codecov][codecov-src]][codecov-href]
URL utils for humans.
## Install
Install using npm or your favourite package manager:
Install package:
```sh
# npm
npm install ufo
# yarn
yarn add ufo
# pnpm
pnpm install ufo
# bun
bun install ufo
```
Import utils:
```js
// ESM
import { normalizeURL, joinURL } from "ufo";
// CommonJS
const { normalizeURL, joinURL } = require("ufo");
// Deno
import { parseURL } from "https://unpkg.com/ufo/dist/index.mjs";
```
<!-- automd:jsdocs src=./src defaultGroup=utils -->
## Encoding Utils
### `decode(text)`
Decodes text using `decodeURIComponent`. Returns the original text if it fails.
### `decodePath(text)`
Decodes path section of URL (consistent with encodePath for slash encoding).
### `decodeQueryKey(text)`
Decodes query key (consistent with `encodeQueryKey` for plus encoding).
### `decodeQueryValue(text)`
Decodes query value (consistent with `encodeQueryValue` for plus encoding).
### `encode(text)`
Encodes characters that need to be encoded in the path, search and hash sections of the URL.
### `encodeHash(text)`
Encodes characters that need to be encoded in the hash section of the URL.
### `encodeHost(name)`
Encodes hostname with punycode encoding.
### `encodeParam(text)`
Encodes characters that need to be encoded in the path section of the URL as a param. This function encodes everything `encodePath` does plus the slash (`/`) character.
### `encodePath(text)`
Encodes characters that need to be encoded in the path section of the URL.
### `encodeQueryKey(text)`
Encodes characters that need to be encoded for query values in the query section of the URL and also encodes the `=` character.
### `encodeQueryValue(input)`
Encodes characters that need to be encoded for query values in the query section of the URL.
## Parsing Utils
### `parseAuth(input)`
Takes a string of the form `username:password` and returns an object with the username and password decoded.
### `parseFilename(input, opts?: { strict? })`
Parses a URL and returns last segment in path as filename.
If `{ strict: true }` is passed as the second argument, it will only return the last segment only if ending with an extension.
**Example:**
```js
// Result: filename.ext
parseFilename("http://example.com/path/to/filename.ext");
// Result: undefined
parseFilename("/path/to/.hidden-file", { strict: true });
```
### `parseHost(input)`
Takes a string, and returns an object with two properties: `hostname` and `port`.
**Example:**
```js
parseHost("foo.com:8080");
// { hostname: 'foo.com', port: '8080' }
```
### `parsePath(input)`
Splits the input string into three parts, and returns an object with those three parts.
**Example:**
```js
parsePath("http://foo.com/foo?test=123#token");
// { pathname: 'http://foo.com/foo', search: '?test=123', hash: '#token' }
```
### `parseURL(input, defaultProto?)`
Takes a URL string and returns an object with the URL's `protocol`, `auth`, `host`, `pathname`, `search`, and `hash`.
**Example:**
```js
parseURL("http://foo.com/foo?test=123#token");
// { protocol: 'http:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' }
parseURL("foo.com/foo?test=123#token");
// { pathname: 'foo.com/foo', search: '?test=123', hash: '#token' }
parseURL("foo.com/foo?test=123#token", "https://");
// { protocol: 'https:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' }
```
### `stringifyParsedURL(parsed)`
Takes a `ParsedURL` object and returns the stringified URL.
**Example:**
```js
const obj = parseURL("http://foo.com/foo?test=123#token");
obj.host = "bar.com";
stringifyParsedURL(obj); // "http://bar.com/foo?test=123#token"
```
## Query Utils
### `encodeQueryItem(key, value)`
Encodes a pair of key and value into a url query string value.
If the value is an array, it will be encoded as multiple key-value pairs with the same key.
**Example:**
```js
encodeQueryItem('message', 'Hello World')
// 'message=Hello+World'
encodeQueryItem('tags', ['javascript', 'web', 'dev'])
// 'tags=javascript&tags=web&tags=dev'
```
### `parseQuery(parametersString)`
Parses and decodes a query string into an object.
The input can be a query string with or without the leading `?`.
**Example:**
```js
parseQuery("?foo=bar&baz=qux");
// { foo: "bar", baz: "qux" }
parseQuery("tags=javascript&tags=web&tags=dev");
// { tags: ["javascript", "web", "dev"] }
```
### `stringifyQuery(query)`
Stringfies and encodes a query object into a query string.
**Example:**
```js
stringifyQuery({ foo: 'bar', baz: 'qux' })
// 'foo=bar&baz=qux'
stringifyQuery({ foo: 'bar', baz: undefined })
// 'foo=bar'
```
## Utils
### `$URL()`
### `cleanDoubleSlashes(input)`
Removes double slashes from the URL.
**Example:**
```js
cleanDoubleSlashes("//foo//bar//"); // "/foo/bar/"
cleanDoubleSlashes("http://example.com/analyze//http://localhost:3000//");
// Returns "http://example.com/analyze/http://localhost:3000/"
```
### `filterQuery(input, predicate)`
Removes the query section of the URL.
**Example:**
```js
filterQuery("/foo?bar=1&baz=2", (key) => key !== "bar"); // "/foo?baz=2"
```
### `getQuery(input)`
Parses and decodes the query object of an input URL into an object.
**Example:**
```js
getQuery("http://foo.com/foo?test=123&unicode=%E5%A5%BD");
// { test: "123", unicode: "好" }
```
### `hasLeadingSlash(input)`
Checks if the input has a leading slash (e.g. `/foo`).
### `hasProtocol(inputString, opts)`
Checks if the input has a protocol.
You can use `{ acceptRelative: true }` to accept relative URLs as valid protocol.
**Example:**
```js
hasProtocol('https://example.com'); // true
hasProtocol("//example.com"); // false
hasProtocol('//example.com', { acceptRelative: true }); // true
hasProtocol("ftp://example.com"); // true
hasProtocol('data:text/plain'); // true
hasProtocol('data:text/plain', { strict: true }); // false
```
### `hasTrailingSlash(input, respectQueryAndFragment?)`
Checks if the input has a trailing slash.
**Example:**
```js
hasTrailingSlash("/foo/"); // true
hasTrailingSlash("/foo"); // false
hasTrailingSlash("/foo?query=true", true); // false
hasTrailingSlash("/foo/?query=true", true); // true
```
### `isEmptyURL(url)`
Checks if the input URL is empty or `/`.
### `isEqual(a, b, options)`
Checks if two paths are equal regardless of encoding, trailing slash, and leading slash differences.
You can make slash check strict by setting `{ trailingSlash: true, leadingSlash: true }` as options.
You can make encoding check strict by setting `{ encoding: true }` as options.
**Example:**
```js
isEqual("/foo", "foo"); // true
isEqual("foo/", "foo"); // true
isEqual("/foo bar", "/foo%20bar"); // true
// Strict compare
isEqual("/foo", "foo", { leadingSlash: true }); // false
isEqual("foo/", "foo", { trailingSlash: true }); // false
isEqual("/foo bar", "/foo%20bar", { encoding: true }); // false
```
### `isNonEmptyURL(url)`
Checks if the input URL is neither empty nor `/`.
### `isRelative(inputString)`
Check if a path starts with `./` or `../`.
**Example:**
```js
isRelative("./foo"); // true
```
### `isSamePath(p1, p2)`
Check if two paths are equal or not. Trailing slash and encoding are normalized before comparison.
**Example:**
```js
isSamePath("/foo", "/foo/"); // true
```
### `isScriptProtocol(protocol?)`
Checks if the input protocol is any of the dangerous `blob:`, `data:`, `javascript`: or `vbscript:` protocols.
**Example:**
```js
isScriptProtocol("javascript:alert(1)"); // true
isScriptProtocol("data:text/html,hello"); // true
isScriptProtocol("blob:hello"); // true
isScriptProtocol("vbscript:alert(1)"); // true
isScriptProtocol("https://example.com"); // false
```
### `joinRelativeURL()`
Joins multiple URL segments into a single URL and also handles relative paths with `./` and `../`.
**Example:**
```js
joinRelativeURL("/a", "../b", "./c"); // "/b/c"
```
### `joinURL(base)`
Joins multiple URL segments into a single URL.
**Example:**
```js
joinURL("a", "/b", "/c"); // "a/b/c"
```
### `normalizeURL(input)`
Normalizes the input URL:
- Ensures the URL is properly encoded - Ensures pathname starts with a slash - Preserves protocol/host if provided
**Example:**
```js
normalizeURL("test?query=123 123#hash, test");
// Returns "test?query=123%20123#hash,%20test"
normalizeURL("http://localhost:3000");
// Returns "http://localhost:3000"
```
### `resolveURL(base)`
Resolves multiple URL segments into a single URL.
**Example:**
```js
resolveURL("http://foo.com/foo?test=123#token", "bar", "baz");
// Returns "http://foo.com/foo/bar/baz?test=123#token"
```
### `withBase(input, base)`
Ensures the URL or pathname starts with base.
If input already starts with base, it will not be added again.
**Example:**
```js
withBase("/foo/bar", "/foo"); // "/foo/bar"
withBase("/foo/bar", "/baz"); // "/baz/foo/bar"
```
### `withFragment(input, hash)`
Adds or replaces the fragment section of the URL.
**Example:**
```js
withFragment("/foo", "bar"); // "/foo#bar"
withFragment("/foo#bar", "baz"); // "/foo#baz"
withFragment("/foo#bar", ""); // "/foo"
```
### `withHttp(input)`
Adds or replaces the URL protocol to `http://`.
**Example:**
```js
withHttp("https://example.com"); // http://example.com
```
### `withHttps(input)`
Adds or replaces the URL protocol to `https://`.
**Example:**
```js
withHttps("http://example.com"); // https://example.com
```
### `withLeadingSlash(input)`
Ensures the URL or pathname has a leading slash.
**Example:**
```js
withLeadingSlash("foo"); // "/foo"
```
### `withoutBase(input, base)`
Removes the base from the URL or pathname.
If input does not start with base, it will not be removed.
**Example:**
```js
withoutBase("/foo/bar", "/foo"); // "/bar"
```
### `withoutFragment(input)`
Removes the fragment section from the URL.
**Example:**
```js
withoutFragment("http://example.com/foo?q=123#bar")
// Returns "http://example.com/foo?q=123"
```
### `withoutHost(input)`
Removes the host from the URL while preserving everything else.
**Example:**
```js
withoutHost("http://example.com/foo?q=123#bar")
// Returns "/foo?q=123#bar"
```
### `withoutLeadingSlash(input)`
Removes leading slash from the URL or pathname.
**Example:**
```js
withoutLeadingSlash("/foo"); // "foo"
```
### `withoutProtocol(input)`
Removes the protocol from the input.
**Example:**
```js
withoutProtocol("http://example.com"); // "example.com"
```
### `withoutTrailingSlash(input, respectQueryAndFragment?)`
Removes the trailing slash from the URL or pathname.
If second argument is `true`, it will only remove the trailing slash if it's not part of the query or fragment with cost of more expensive operations.
**Example:**
```js
withoutTrailingSlash("/foo/"); // "/foo"
withoutTrailingSlash("/path/?query=true", true); // "/path?query=true"
```
### `withProtocol(input, protocol)`
Adds or replaces protocol of the input URL.
**Example:**
```js
withProtocol("http://example.com", "ftp://"); // "ftp://example.com"
```
### `withQuery(input, query)`
Add/Replace the query section of the URL.
**Example:**
```js
withQuery("/foo?page=a", { token: "secret" }); // "/foo?page=a&token=secret"
```
### `withTrailingSlash(input, respectQueryAndFragment?)`
Ensures the URL ends with a trailing slash.
If second argument is `true`, it will only add the trailing slash if it's not part of the query or fragment with cost of more expensive operation.
**Example:**
```js
withTrailingSlash("/foo"); // "/foo/"
withTrailingSlash("/path?query=true", true); // "/path/?query=true"
```
<!-- /automd -->
## License
[MIT](./LICENSE)
Special thanks to Eduardo San Martin Morote ([posva](https://github.com/posva)) for [encoding utilities](https://github.com/vuejs/vue-router-next/blob/v4.0.1/src/encoding.ts)
<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/ufo?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/ufo
[npm-downloads-src]: https://img.shields.io/npm/dm/ufo?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/ufo
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/ufo/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/ufo
[bundle-src]: https://img.shields.io/bundlephobia/minzip/ufo?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=ufo
@@ -0,0 +1,109 @@
import { expect, test } from "vitest";
test("placeholder test", () => {
expect(2).toBe(2);
});
// test("overload types", () => {
// const schema = z.string().json();
// util.assertEqual<typeof schema, z.ZodString>(true);
// const schema2 = z.string().json(z.number());
// util.assertEqual<typeof schema2, z.ZodPipe<z.ZodTransform<any, string>, z.ZodNumber>>(true);
// const r2 = schema2.parse("12");
// util.assertEqual<number, typeof r2>(true);
// });
// test("parse string to json", async () => {
// const Env = z.object({
// myJsonConfig: z.string().jsonString(z.object({ foo: z.number() })),
// someOtherValue: z.string(),
// });
// expect(
// Env.parse({
// myJsonConfig: '{ "foo": 123 }',
// someOtherValue: "abc",
// })
// ).toEqual({
// myJsonConfig: { foo: 123 },
// someOtherValue: "abc",
// });
// const invalidValues = Env.safeParse({
// myJsonConfig: '{"foo": "not a number!"}',
// someOtherValue: null,
// });
// expect(JSON.parse(JSON.stringify(invalidValues))).toEqual({
// success: false,
// error: {
// name: "ZodError",
// issues: [
// {
// code: "invalid_type",
// expected: "number",
// input: "not a number!",
// received: "string",
// path: ["myJsonConfig", "foo"],
// message: "Expected number, received string",
// },
// {
// code: "invalid_type",
// expected: "string",
// input: null,
// received: "null",
// path: ["someOtherValue"],
// message: "Expected string, received null",
// },
// ],
// },
// });
// const invalidJsonSyntax = Env.safeParse({
// myJsonConfig: "This is not valid json",
// someOtherValue: null,
// });
// expect(JSON.parse(JSON.stringify(invalidJsonSyntax))).toMatchObject({
// success: false,
// error: {
// name: "ZodError",
// issues: [
// {
// code: "invalid_string",
// input: {
// _def: {
// catchall: {
// _def: {
// typeName: "ZodNever",
// },
// },
// typeName: "ZodObject",
// unknownKeys: "strip",
// },
// },
// validation: "json",
// message: "Invalid json",
// path: ["myJsonConfig"],
// },
// {
// code: "invalid_type",
// expected: "string",
// input: null,
// received: "null",
// path: ["someOtherValue"],
// message: "Expected string, received null",
// },
// ],
// },
// });
// });
// test("no argument", () => {
// const schema = z.string().json();
// util.assertEqual<typeof schema, z.ZodString>(true);
// z.string().json().parse(`{}`);
// z.string().json().parse(`null`);
// z.string().json().parse(`12`);
// z.string().json().parse(`{ "test": "test"}`);
// expect(() => z.string().json().parse(`asdf`)).toThrow();
// expect(() => z.string().json().parse(`{ "test": undefined }`)).toThrow();
// expect(() => z.string().json().parse(`{ "test": 12n }`)).toThrow();
// expect(() => z.string().json().parse(`{ test: "test" }`)).toThrow();
// });
@@ -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 MailX = createLucideIcon("MailX", [
["path", { d: "M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h9", key: "1j9vog" }],
["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }],
["path", { d: "m17 17 4 4", key: "1b3523" }],
["path", { d: "m21 17-4 4", key: "uinynz" }]
]);
export { MailX as default };
//# sourceMappingURL=mail-x.js.map
@@ -0,0 +1,240 @@
#!/usr/bin/env node
"use strict";
const validators = require("./validators");
const config = require("..");
const prettier = require("../prettier");
// Require locally installed eslint, for `npx eslint-config-prettier` support
// with no local eslint-config-prettier installation.
const localRequire = (request) =>
require(
require.resolve(request, {
paths: [process.cwd(), ...require.resolve.paths("eslint")],
})
);
let experimentalApi = {};
try {
experimentalApi = localRequire("eslint/use-at-your-own-risk");
} catch (_error) {}
const { ESLint, FlatESLint = experimentalApi.FlatESLint } =
localRequire("eslint");
const SPECIAL_RULES_URL =
"https://github.com/prettier/eslint-config-prettier#special-rules";
const PRETTIER_RULES_URL =
"https://github.com/prettier/eslint-config-prettier#arrow-body-style-and-prefer-arrow-callback";
if (module === require.main) {
const args = process.argv.slice(2);
if (args.length === 0) {
console.error(help());
process.exit(1);
}
const eslint = new ESLint();
const flatESLint = FlatESLint === undefined ? undefined : new FlatESLint();
Promise.all(
args.map((file) => {
switch (process.env.ESLINT_USE_FLAT_CONFIG) {
case "true": {
return flatESLint.calculateConfigForFile(file);
}
case "false": {
return eslint.calculateConfigForFile(file);
}
default: {
// This turns synchronous errors (such as `.calculateConfigForFile` not existing)
// and turns them into promise rejections.
return Promise.resolve()
.then(() => flatESLint.calculateConfigForFile(file))
.catch(() => eslint.calculateConfigForFile(file));
}
}
})
)
.then((configs) => {
const rules = configs.flatMap(
(
// Initializing config and rules for files that aren't included in the flat config,
// which is a very unlikely scenario, but should still be treated as a success
{ rules = {} } = {},
index
) => Object.entries(rules).map((entry) => [...entry, args[index]])
);
const result = processRules(rules);
if (result.stderr) {
console.error(result.stderr);
}
if (result.stdout) {
console.error(result.stdout);
}
process.exit(result.code);
})
.catch((error) => {
console.error(error.message);
process.exit(1);
});
}
function help() {
return `
Usage: npx eslint-config-prettier FILE...
Resolves an ESLint configuration for every given FILE and checks if they
contain rules that are unnecessary or conflict with Prettier. Example:
npx eslint-config-prettier index.js test/index.js other/file/to/check.js
Exit codes:
0: No automatically detectable problems found.
1: General error.
2: Conflicting rules found.
For more information, see:
https://github.com/prettier/eslint-config-prettier#cli-helper-tool
`.trim();
}
function processRules(configRules) {
const regularRules = filterRules(config.rules, (_, value) => value === "off");
const optionsRules = filterRules(
config.rules,
(ruleName, value) => value === 0 && ruleName in validators
);
const specialRules = filterRules(
config.rules,
(ruleName, value) => value === 0 && !(ruleName in validators)
);
const enabledRules = configRules
.map(([ruleName, value, source]) => {
const arrayValue = Array.isArray(value) ? value : [value];
const [level, ...options] = arrayValue;
const isOff = level === "off" || level === 0;
return isOff ? null : { ruleName, options, source };
})
.filter(Boolean);
const flaggedRules = enabledRules.filter(
({ ruleName }) => ruleName in config.rules
);
const regularFlaggedRuleNames = filterRuleNames(
flaggedRules,
({ ruleName }) => ruleName in regularRules
);
const optionsFlaggedRuleNames = filterRuleNames(
flaggedRules,
({ ruleName, ...rule }) =>
ruleName in optionsRules && !validators[ruleName](rule)
);
const specialFlaggedRuleNames = filterRuleNames(
flaggedRules,
({ ruleName }) => ruleName in specialRules
);
const prettierFlaggedRuleNames = filterRuleNames(
enabledRules,
({ ruleName, source }) =>
ruleName in prettier.rules &&
enabledRules.some(
(rule) =>
rule.ruleName === "prettier/prettier" && rule.source === source
)
);
const regularMessage = [
"The following rules are unnecessary or might conflict with Prettier:",
"",
printRuleNames(regularFlaggedRuleNames),
].join("\n");
const optionsMessage = [
"The following rules are enabled with config that might conflict with Prettier. See:",
SPECIAL_RULES_URL,
"",
printRuleNames(optionsFlaggedRuleNames),
].join("\n");
const specialMessage = [
"The following rules are enabled but cannot be automatically checked. See:",
SPECIAL_RULES_URL,
"",
printRuleNames(specialFlaggedRuleNames),
].join("\n");
const prettierMessage = [
"The following rules can cause issues when using eslint-plugin-prettier at the same time.",
"Only enable them if you know what you are doing! See:",
PRETTIER_RULES_URL,
"",
printRuleNames(prettierFlaggedRuleNames),
].join("\n");
if (
regularFlaggedRuleNames.length === 0 &&
optionsFlaggedRuleNames.length === 0
) {
const message =
specialFlaggedRuleNames.length === 0 &&
prettierFlaggedRuleNames.length === 0
? "No rules that are unnecessary or conflict with Prettier were found."
: [
specialFlaggedRuleNames.length === 0 ? null : specialMessage,
prettierFlaggedRuleNames.length === 0 ? null : prettierMessage,
"Other than that, no rules that are unnecessary or conflict with Prettier were found.",
]
.filter(Boolean)
.join("\n\n");
return {
stdout: message,
code: 0,
};
}
const message = [
regularFlaggedRuleNames.length === 0 ? null : regularMessage,
optionsFlaggedRuleNames.length === 0 ? null : optionsMessage,
specialFlaggedRuleNames.length === 0 ? null : specialMessage,
prettierFlaggedRuleNames.length === 0 ? null : prettierMessage,
]
.filter(Boolean)
.join("\n\n");
return {
stdout: message,
code: 2,
};
}
function filterRules(rules, fn) {
return Object.fromEntries(
Object.entries(rules)
.filter(([ruleName, value]) => fn(ruleName, value))
.map(([ruleName]) => [ruleName, true])
);
}
function filterRuleNames(rules, fn) {
return [
...new Set(rules.filter((rule) => fn(rule)).map((rule) => rule.ruleName)),
];
}
function printRuleNames(ruleNames) {
return ruleNames
.slice()
.sort()
.map((ruleName) => `- ${ruleName}`)
.join("\n");
}
exports.processRules = processRules;
@@ -0,0 +1,69 @@
{
"name": "dom-serializer",
"version": "2.0.0",
"description": "render domhandler DOM nodes to a string",
"author": "Felix Boehm <me@feedic.com>",
"sideEffects": false,
"keywords": [
"html",
"xml",
"render"
],
"repository": {
"type": "git",
"url": "git://github.com/cheeriojs/dom-serializer.git"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"module": "lib/esm/index.js",
"exports": {
"require": "./lib/index.js",
"import": "./lib/esm/index.js"
},
"files": [
"lib/**/*"
],
"dependencies": {
"domelementtype": "^2.3.0",
"domhandler": "^5.0.2",
"entities": "^4.2.0"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"cheerio": "^1.0.0-rc.9",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"htmlparser2": "^7.2.0",
"jest": "^27.5.1",
"prettier": "^2.6.2",
"ts-jest": "^27.1.4",
"typescript": "^4.6.3"
},
"scripts": {
"test": "npm run test:jest && npm run lint",
"test:jest": "jest",
"lint": "npm run lint:es && npm run lint:prettier",
"lint:es": "eslint --ignore-path .gitignore .",
"lint:prettier": "npm run prettier -- --check",
"format": "npm run format:es && npm run format:prettier",
"format:es": "npm run lint:es -- --fix",
"format:prettier": "npm run prettier -- --write",
"prettier": "prettier \"**/*.{ts,md,json,yml}\" --ignore-path .gitignore",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc",
"build:esm": "tsc --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
"prepare": "npm run build"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"moduleNameMapper": {
"^(.*)\\.js$": "$1"
}
},
"funding": "https://github.com/cheeriojs/dom-serializer?sponsor=1",
"license": "MIT"
}
@@ -0,0 +1 @@
{"version":3,"file":"encode-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAM9C,SAAS,WAAW,CAChB,GAAM;IAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAClC;IACD,OAAO,GAAG,C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,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,SAAS,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,EAACLine truncated
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_9M _lB","33":"_TS"},D:{"1":"_TI","33":"_9J"},E:{"1":"_PB","33":"_UB"},F:{"1":"_2M _YF _vB _4I","2":"_6C","33":"_6M"},G:{"2":"_M"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"33":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"2":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:2,C:"CSS3 Cursors: zoom-in & zoom-out",D:true};
@@ -0,0 +1,9 @@
import type { HistoryLocation } from '@tanstack/history'
declare module '@tanstack/history' {
interface HistoryState {
__tempLocation?: HistoryLocation
__tempKey?: string
__hashScrollIntoViewOptions?: boolean | ScrollIntoViewOptions
}
}
@@ -0,0 +1,30 @@
/**
* @fileoverview Provides helper functions to start/stop the time measurements
* that are provided by the ESLint 'stats' option.
* @author Mara Kiefer <http://github.com/mnkiefer>
*/
"use strict";
/**
* Start time measurement
* @returns {[number, number]} t variable for tracking time
*/
function startTime() {
return process.hrtime();
}
/**
* End time measurement
* @param {[number, number]} t Variable for tracking time
* @returns {number} The measured time in milliseconds
*/
function endTime(t) {
const time = process.hrtime(t);
return time[0] * 1e3 + time[1] / 1e6;
}
module.exports = {
startTime,
endTime,
};
@@ -0,0 +1 @@
{"version":3,"file":"is-easing-array.mjs","sources":["../../../../src/easing/utils/is-easing-array.ts"],"sourcesContent":["import { Easing } from \"../types\"\n\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n"],"names":[],"mappings":"AAEO,MAAM,aAAa,GAAG,CAAC,IAAS,KAAsB;AACzD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;AAC7D;;;;"}
@@ -0,0 +1,21 @@
import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
export type PropertyDependencies = {
[K in string]?: string[];
};
export interface DependenciesErrorParams {
property: string;
missingProperty: string;
depsCount: number;
deps: string;
}
export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, {
[K in string]?: string[] | AnySchema;
}>;
export declare const error: KeywordErrorDefinition;
declare const def: CodeKeywordDefinition;
export declare function validatePropertyDeps(cxt: KeywordCxt, propertyDeps?: {
[K in string]?: string[];
}): void;
export declare function validateSchemaDeps(cxt: KeywordCxt, schemaDeps?: SchemaMap): void;
export default def;
@@ -0,0 +1,119 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "توکي", verb: "ولري" },
file: { unit: "بایټس", verb: "ولري" },
array: { unit: "توکي", verb: "ولري" },
set: { unit: "توکي", verb: "ولري" },
map: { unit: "توکي", verb: "ولري" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "ورودي",
email: "بریښنالیک",
url: "یو آر ال",
emoji: "ایموجي",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "نیټه او وخت",
date: "نېټه",
time: "وخت",
duration: "موده",
ipv4: "د IPv4 پته",
ipv6: "د IPv6 پته",
mac: "د MAC پته",
cidrv4: "د IPv4 ساحه",
cidrv6: "د IPv6 ساحه",
base64: "base64-encoded متن",
base64url: "base64url-encoded متن",
json_string: "JSON متن",
e164: "د E.164 شمېره",
credit_card: "د کریډیټ کارت شمیره",
currency_code: "د اسعارو کوډ",
iban: "IBAN",
jwt: "JWT",
template_literal: "ورودي",
};
const TypeDictionary = {
nan: "NaN",
number: "عدد",
array: "ارې",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `ناسم ورودي: باید instanceof ${issue.expected} وای, مګر ${received} ترلاسه شو`;
}
return `ناسم ورودي: باید ${expected} وای, مګر ${received} ترلاسه شو`;
}
case "invalid_value":
if (issue.values.length === 1) {
return `ناسم ورودي: باید ${util.stringifyPrimitive(issue.values[0])} وای`;
}
return `ناسم انتخاب: باید یو له ${util.joinValues(issue.values, "|")} څخه وای`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
}
return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} وي`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} ولري`;
}
return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} وي`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
}
if (_issue.format === "ends_with") {
return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
}
if (_issue.format === "includes") {
return `ناسم متن: باید "${_issue.includes}" ولري`;
}
if (_issue.format === "regex") {
return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
}
return `${FormatDictionary[_issue.format] ?? issue.format} ناسم دی`;
}
case "not_multiple_of":
return `ناسم عدد: باید د ${issue.divisor} مضرب وي`;
case "unrecognized_keys":
return `ناسم ${issue.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `ناسم کلیډ په ${issue.origin} کې`;
case "invalid_union":
return `ناسمه ورودي`;
case "invalid_element":
return `ناسم عنصر په ${issue.origin} کې`;
default:
return `ناسمه ورودي`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,10 @@
MIT License
-----------
Copyright (C) 2018-2022 Guy Bedford
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,31 @@
{
"name": "thenify",
"description": "Promisify a callback-based function",
"version": "3.3.1",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"license": "MIT",
"repository": "thenables/thenify",
"dependencies": {
"any-promise": "^1.0.0"
},
"devDependencies": {
"bluebird": "^3.1.1",
"istanbul": "^0.4.0",
"mocha": "^3.0.2"
},
"scripts": {
"test": "mocha --reporter spec",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
},
"keywords": [
"promisify",
"promise",
"thenify",
"then",
"es6"
],
"files": [
"index.js"
]
}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyC;AACzC,0DAA4B;AAE5B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE;IAC5D,IAAI,CAAC;QACH,OAAO,iBAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACtC,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,IAAK,EAA4B,EAAE,IAAI,KAAK,QAAQ;YAAE,MAAM,EAAE,CAAA;IAChE,CAAC;AACH,CAAC,CAAA;AAED,MAAM,KAAK,GAAG,CACZ,KAAa,EACb,GAAW,EACX,GAAW,EACX,EAAyB,EACzB,EAAE;IACF,iBAAE,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE;QAC9B,oBAAoB;QACpB,EAAE,CAAC,EAAE,IAAK,EAA4B,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,I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EAAE,EAAE;IAChE,IAAI,QAAkB,CAAA;IACtB,IAAI,CAAC;QACH,QAAQ,GAAG,iBAAE,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;IACvD,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,MAAM,CAAC,GAAG,EAA2B,CAAA;QACrC,IAAI,CAAC,EAAE,IAAI,KAAK,QAAQ;YAAE,OAAM;aAC3B,IAAI,CAAC,EAAE,IAAI,KAAK,SAAS,IAAI,CAAC,EAAE,IAAI,KAAK,SAAS;YACrD,OAAO,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;;YAC3B,MAAM,CAAC,CAAA;IACd,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACnC,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAChC,CAAC,CAAA;AAjBY,QAAA,UAAU,cAiBtB","sourcesContent":["import fs, { type Dirent } from 'node:fs'\nimport path from 'node:path'\n\nconst lchownSync = (path: string, uid: number, gid: number) => {\n try {\n return fs.lchownSync(path, uid, gid)\n } catch (er) {\n if ((er as NodeJS.ErrnoException)?.code !== 'ENOENT') throw er\n }\n}\n\nconst chown = (\n cpath: string,\n uid: number,\n gid: number,\n cb: (er?: unknown) => any,\n) => {\n fs.lchown(cpath, uid, gid, er => {\n // Skip ENOENT error\n cb(er && (er as NodeJS.ErrnoException)?.code !== 'ENOENT' ? er : null)\n })\n}\n\nconst chownrKid = (\n p: string,\n child: Dirent,\n uid: number,\n gid: number,\n cb: (er?: unknown) => any,\n) => {\n if (child.isDirectory()) {\n chownr(path.resolve(p, child.name), uid, gid, (er: unknown) => {\n if (er) return cb(er)\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n })\n } else {\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n }\n}\n\nexport const chownr = (\n p: string,\n uid: number,\n gid: number,\n cb: (er?: unknown) => any,\n) => {\n fs.readdir(p, { withFileTypes: true }, (er, children) => {\n // any error other than ENOTDIR or ENOTSUP means it's not readable,\n // or doesn't exist. give up.\n if (er) {\n if (er.code === 'ENOENT') return cb()\n else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')\n return cb(er)\n }\n if (er || !children.length) return chown(p, uid, gid, cb)\n\n let len = children.length\n let errState: null | NodeJS.ErrnoException = null\n const then = (er?: unknown) => {\n /* c8 ignore start */\n if (erLine truncated
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ForScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class ForScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.for, upperScope, block, false);
}
}
exports.ForScope = ForScope;
@@ -0,0 +1,371 @@
'use strict'
/**
* @param {string} value
* @returns {boolean}
*/
function isCTLExcludingHtab (value) {
for (let i = 0; i < value.length; ++i) {
const code = value.charCodeAt(i)
if (
(code >= 0x00 && code <= 0x08) ||
(code >= 0x0A && code <= 0x1F) ||
code === 0x7F
) {
return true
}
}
return false
}
/**
CHAR = <any US-ASCII character (octets 0 - 127)>
token = 1*<any CHAR except CTLs or separators>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
* @param {string} name
*/
function validateCookieName (name) {
for (let i = 0; i < name.length; ++i) {
const code = name.charCodeAt(i)
if (
code < 0x21 || // exclude CTLs (0-31), SP and HT
code > 0x7E || // exclude non-ascii and DEL
code === 0x22 || // "
code === 0x28 || // (
code === 0x29 || // )
code === 0x3C || // <
code === 0x3E || // >
code === 0x40 || // @
code === 0x2C || // ,
code === 0x3B || // ;
code === 0x3A || // :
code === 0x5C || // \
code === 0x2F || // /
code === 0x5B || // [
code === 0x5D || // ]
code === 0x3F || // ?
code === 0x3D || // =
code === 0x7B || // {
code === 0x7D // }
) {
throw new Error('Invalid cookie name')
}
}
}
/**
cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
; US-ASCII characters excluding CTLs,
; whitespace DQUOTE, comma, semicolon,
; and backslash
* @param {string} value
*/
function validateCookieValue (value) {
let len = value.length
let i = 0
// if the value is wrapped in DQUOTE
if (value[0] === '"') {
if (len === 1 || value[len - 1] !== '"') {
throw new Error('Invalid cookie value')
}
--len
++i
}
while (i < len) {
const code = value.charCodeAt(i++)
if (
code < 0x21 || // exclude CTLs (0-31)
code > 0x7E || // non-ascii and DEL (127)
code === 0x22 || // "
code === 0x2C || // ,
code === 0x3B || // ;
code === 0x5C // \
) {
throw new Error('Invalid cookie value')
}
}
}
/**
* path-value = <any CHAR except CTLs or ";">
* @param {string} path
*/
function validateCookiePath (path) {
for (let i = 0; i < path.length; ++i) {
const code = path.charCodeAt(i)
if (
code < 0x20 || // exclude CTLs (0-31)
code > 0x7E || // exclude non-ascii and DEL
code === 0x3B // ;
) {
throw new Error('Invalid cookie path')
}
}
}
/**
* <let-dig> ::= <letter> | <digit>
*
* <letter> ::= any one of the 52 alphabetic characters A through Z in
* upper case and a through z in lower case
*
* <digit> ::= any one of the ten digits 0 through 9r
*
* @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
* @param {number} code
*/
function isLetterOrDigit (code) {
return (
(code >= 0x30 && code <= 0x39) || // 0-9
(code >= 0x41 && code <= 0x5A) || // A-Z
(code >= 0x61 && code <= 0x7A) // a-z
)
}
/**
* Validates a cookie domain against the "preferred name syntax".
*
* <domain> ::= <subdomain> | " "
* <subdomain> ::= <label> | <subdomain> "." <label>
* <label> ::= <let-dig> [ [ <ldh-str> ] <let-dig> ]
* <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
* <let-dig-hyp> ::= <let-dig> | "-"
*
* @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
* @see https://www.rfc-editor.org/rfc/rfc1123#section-2.1
* @see https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4
* @param {string} domain
*/
function validateCookieDomain (domain) {
// <domain> ::= <subdomain> | " "
if (domain === ' ') {
return
}
if (domain.length > 255) {
throw new Error('Invalid cookie domain')
}
let labelLength = 0
for (let i = 0; i < domain.length; ++i) {
const code = domain.charCodeAt(i)
if (code === 0x2E) {
if (labelLength === 0) {
throw new Error('Invalid cookie domain')
}
if (domain.charCodeAt(i - 1) === 0x2D) { // "-"
throw new Error('Invalid cookie domain')
}
labelLength = 0
continue
}
if (labelLength === 0 && !isLetterOrDigit(code)) {
throw new Error('Invalid cookie domain')
}
if (!isLetterOrDigit(code) && code !== 0x2D) { // "-"
throw new Error('Invalid cookie domain')
}
if (++labelLength > 63) {
throw new Error('Invalid cookie domain')
}
}
if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 0x2D) { // "-"
throw new Error('Invalid cookie domain')
}
}
const IMFDays = [
'Sun', 'Mon', 'Tue', 'Wed',
'Thu', 'Fri', 'Sat'
]
const IMFMonths = [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
]
const IMFPaddedNumbers = Array(61).fill(0).map((_, i) => i.toString().padStart(2, '0'))
/**
* @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
* @param {number|Date} date
IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
; fixed length/zone/capitalization subset of the format
; see Section 3.3 of [RFC5322]
day-name = %x4D.6F.6E ; "Mon", case-sensitive
/ %x54.75.65 ; "Tue", case-sensitive
/ %x57.65.64 ; "Wed", case-sensitive
/ %x54.68.75 ; "Thu", case-sensitive
/ %x46.72.69 ; "Fri", case-sensitive
/ %x53.61.74 ; "Sat", case-sensitive
/ %x53.75.6E ; "Sun", case-sensitive
date1 = day SP month SP year
; e.g., 02 Jun 1982
day = 2DIGIT
month = %x4A.61.6E ; "Jan", case-sensitive
/ %x46.65.62 ; "Feb", case-sensitive
/ %x4D.61.72 ; "Mar", case-sensitive
/ %x41.70.72 ; "Apr", case-sensitive
/ %x4D.61.79 ; "May", case-sensitive
/ %x4A.75.6E ; "Jun", case-sensitive
/ %x4A.75.6C ; "Jul", case-sensitive
/ %x41.75.67 ; "Aug", case-sensitive
/ %x53.65.70 ; "Sep", case-sensitive
/ %x4F.63.74 ; "Oct", case-sensitive
/ %x4E.6F.76 ; "Nov", case-sensitive
/ %x44.65.63 ; "Dec", case-sensitive
year = 4DIGIT
GMT = %x47.4D.54 ; "GMT", case-sensitive
time-of-day = hour ":" minute ":" second
; 00:00:00 - 23:59:60 (leap second)
hour = 2DIGIT
minute = 2DIGIT
second = 2DIGIT
*/
function toIMFDate (date) {
if (typeof date === 'number') {
date = new Date(date)
}
return `${IMFDays[date.getUTCDay()]}, ${IMFPaddedNumbers[date.getUTCDate()]} ${IMFMonths[date.getUTCMonth()]} ${date.getUTCFullYear()} ${IMFPaddedNumbers[date.getUTCHours()]}:${IMFPaddedNumbers[date.getUTCMinutes()]}:${IMFPaddedNumbers[date.getUTCSeconds()]} GMT`
}
/**
max-age-av = "Max-Age=" non-zero-digit *DIGIT
; In practice, both expires-av and max-age-av
; are limited to dates representable by the
; user agent.
* @param {number} maxAge
*/
function validateCookieMaxAge (maxAge) {
if (maxAge < 0) {
throw new Error('Invalid cookie max-age')
}
}
/**
* @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
* @param {import('./index').Cookie} cookie
*/
function stringify (cookie) {
if (cookie.name.length === 0) {
return null
}
validateCookieName(cookie.name)
validateCookieValue(cookie.value)
const out = [`${cookie.name}=${cookie.value}`]
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
if (cookie.name.startsWith('__Secure-')) {
cookie.secure = true
}
if (cookie.name.startsWith('__Host-')) {
cookie.secure = true
cookie.domain = null
cookie.path = '/'
}
if (cookie.secure) {
out.push('Secure')
}
if (cookie.httpOnly) {
out.push('HttpOnly')
}
if (typeof cookie.maxAge === 'number') {
validateCookieMaxAge(cookie.maxAge)
out.push(`Max-Age=${cookie.maxAge}`)
}
if (cookie.domain) {
validateCookieDomain(cookie.domain)
out.push(`Domain=${cookie.domain}`)
}
if (cookie.path) {
validateCookiePath(cookie.path)
out.push(`Path=${cookie.path}`)
}
// A numeric 0 is the Unix epoch, not an absent value -- the same reason the
// Max-Age check above tests the type rather than truthiness.
//
// expires is Date | number, so the "Invalid Date" check only guards the Date
// form. A number that is not a valid time value (NaN, +/-Infinity, or outside
// the Date range) would otherwise reach toIMFDate, which splices undefined and
// NaN into the header value instead of failing.
if (cookie.expires != null) {
const expiresMs = cookie.expires instanceof Date
? cookie.expires.getTime()
: cookie.expires
// The largest time value a Date can represent, in milliseconds, i.e.
// 100,000,000 days either side of the epoch (ECMA-262 Date Time Values).
// Anything within it is safe for toIMFDate to format; anything beyond it
// produces an invalid Date and must be ignored instead.
const maxTimeValue = 8640000000000000
if (typeof expiresMs === 'number' && Number.isFinite(expiresMs) && Math.abs(expiresMs) <= maxTimeValue) {
out.push(`Expires=${toIMFDate(cookie.expires)}`)
}
}
if (cookie.sameSite) {
out.push(`SameSite=${cookie.sameSite}`)
}
for (const part of cookie.unparsed) {
if (!part.includes('=')) {
throw new Error('Invalid unparsed')
}
const [key, ...value] = part.split('=')
const trimmedKey = key.trim()
const joinedValue = value.join('=')
validateCookieName(trimmedKey)
validateCookieValue(joinedValue)
out.push(`${trimmedKey}=${joinedValue}`)
}
return out.join('; ')
}
module.exports = {
isCTLExcludingHtab,
validateCookieName,
validateCookiePath,
validateCookieValue,
toIMFDate,
stringify
}
@@ -0,0 +1,18 @@
import { MethodNotAllowedError } from '../errors.js';
/**
* Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response.
*
* @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST'])
* @returns Express middleware that returns a 405 error if method not in allowed list
*/
export function allowedMethods(allowedMethods) {
return (req, res, next) => {
if (allowedMethods.includes(req.method)) {
next();
return;
}
const error = new MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`);
res.status(405).set('Allow', allowedMethods.join(', ')).json(error.toResponseObject());
};
}
//# sourceMappingURL=allowedMethods.js.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 './chart-line.js';
//# sourceMappingURL=line-chart.js.map
@@ -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 LaptopMinimalCheck = createLucideIcon("LaptopMinimalCheck", [
["path", { d: "M2 20h20", key: "owomy5" }],
["path", { d: "m9 10 2 2 4-4", key: "1gnqz4" }],
["rect", { x: "3", y: "4", width: "18", height: "12", rx: "2", key: "8ur36m" }]
]);
export { LaptopMinimalCheck as default };
//# sourceMappingURL=laptop-minimal-check.js.map
@@ -0,0 +1,220 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import { z } from "zod/v3";
import { util } from "../helpers/util.js";
test("basic catch", () => {
expect(z.string().catch("default").parse(undefined)).toBe("default");
});
test("catch fn does not run when parsing succeeds", () => {
let isCalled = false;
const cb = () => {
isCalled = true;
return "asdf";
};
expect(z.string().catch(cb).parse("test")).toBe("test");
expect(isCalled).toEqual(false);
});
test("basic catch async", async () => {
const result = await z.string().catch("default").parseAsync(1243);
expect(result).toBe("default");
});
test("catch replace wrong types", () => {
expect(z.string().catch("default").parse(true)).toBe("default");
expect(z.string().catch("default").parse(true)).toBe("default");
expect(z.string().catch("default").parse(15)).toBe("default");
expect(z.string().catch("default").parse([])).toBe("default");
expect(z.string().catch("default").parse(new Map())).toBe("default");
expect(z.string().catch("default").parse(new Set())).toBe("default");
expect(z.string().catch("default").parse({})).toBe("default");
});
test("catch with transform", () => {
const stringWithDefault = z
.string()
.transform((val) => val.toUpperCase())
.catch("default");
expect(stringWithDefault.parse(undefined)).toBe("default");
expect(stringWithDefault.parse(15)).toBe("default");
expect(stringWithDefault).toBeInstanceOf(z.ZodCatch);
expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodEffects);
expect(stringWithDefault._def.innerType._def.schema).toBeInstanceOf(z.ZodSchema);
type inp = z.input<typeof stringWithDefault>;
util.assertEqual<inp, unknown>(true);
type out = z.output<typeof stringWithDefault>;
util.assertEqual<out, string>(true);
});
test("catch on existing optional", () => {
const stringWithDefault = z.string().optional().catch("asdf");
expect(stringWithDefault.parse(undefined)).toBe(undefined);
expect(stringWithDefault.parse(15)).toBe("asdf");
expect(stringWithDefault).toBeInstanceOf(z.ZodCatch);
expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodOptional);
expect(stringWithDefault._def.innerType._def.innerType).toBeInstanceOf(z.ZodString);
type inp = z.input<typeof stringWithDefault>;
util.assertEqual<inp, unknown>(true);
type out = z.output<typeof stringWithDefault>;
util.assertEqual<out, string | undefined>(true);
});
test("optional on catch", () => {
const stringWithDefault = z.string().catch("asdf").optional();
type inp = z.input<typeof stringWithDefault>;
util.assertEqual<inp, unknown>(true);
type out = z.output<typeof stringWithDefault>;
util.assertEqual<out, string | undefined>(true);
});
test("complex chain example", () => {
const complex = z
.string()
.catch("asdf")
.transform((val) => val + "!")
.transform((val) => val.toUpperCase())
.catch("qwer")
.removeCatch()
.optional()
.catch("asdfasdf");
expect(complex.parse("qwer")).toBe("QWER!");
expect(complex.parse(15)).toBe("ASDF!");
expect(complex.parse(true)).toBe("ASDF!");
});
test("removeCatch", () => {
const stringWithRemovedDefault = z.string().catch("asdf").removeCatch();
type out = z.output<typeof stringWithRemovedDefault>;
util.assertEqual<out, string>(true);
});
test("nested", () => {
const inner = z.string().catch("asdf");
const outer = z.object({ inner }).catch({
inner: "asdf",
});
type input = z.input<typeof outer>;
util.assertEqual<input, unknown>(true);
type out = z.output<typeof outer>;
util.assertEqual<out, { inner: string }>(true);
expect(outer.parse(undefined)).toEqual({ inner: "asdf" });
expect(outer.parse({})).toEqual({ inner: "asdf" });
expect(outer.parse({ inner: undefined })).toEqual({ inner: "asdf" });
});
test("chained catch", () => {
const stringWithDefault = z.string().catch("inner").catch("outer");
const result = stringWithDefault.parse(undefined);
expect(result).toEqual("inner");
const resultDiff = stringWithDefault.parse(5);
expect(resultDiff).toEqual("inner");
});
test("factory", () => {
z.ZodCatch.create(z.string(), {
catch: "asdf",
}).parse(undefined);
});
test("native enum", () => {
enum Fruits {
apple = "apple",
orange = "orange",
}
const schema = z.object({
fruit: z.nativeEnum(Fruits).catch(Fruits.apple),
});
expect(schema.parse({})).toEqual({ fruit: Fruits.apple });
expect(schema.parse({ fruit: 15 })).toEqual({ fruit: Fruits.apple });
});
test("enum", () => {
const schema = z.object({
fruit: z.enum(["apple", "orange"]).catch("apple"),
});
expect(schema.parse({})).toEqual({ fruit: "apple" });
expect(schema.parse({ fruit: true })).toEqual({ fruit: "apple" });
expect(schema.parse({ fruit: 15 })).toEqual({ fruit: "apple" });
});
test("reported issues with nested usage", () => {
const schema = z.object({
string: z.string(),
obj: z.object({
sub: z.object({
lit: z.literal("a"),
subCatch: z.number().catch(23),
}),
midCatch: z.number().catch(42),
}),
number: z.number().catch(0),
bool: z.boolean(),
});
try {
schema.parse({
string: {},
obj: {
sub: {
lit: "b",
subCatch: "24",
},
midCatch: 444,
},
number: "",
bool: "yes",
});
} catch (error) {
const issues = (error as z.ZodError).issues;
expect(issues.length).toEqual(3);
expect(issues[0].message).toMatch("string");
expect(issues[1].message).toMatch("literal");
expect(issues[2].message).toMatch("boolean");
}
});
test("catch error", () => {
let catchError: z.ZodError | undefined = undefined;
const schema = z.object({
age: z.number(),
name: z.string().catch((ctx) => {
catchError = ctx.error;
return "John Doe";
}),
});
const result = schema.safeParse({
age: null,
name: null,
});
expect(result.success).toEqual(false);
expect(!result.success && result.error.issues.length).toEqual(1);
expect(!result.success && result.error.issues[0].message).toMatch("number");
expect(catchError).toBeInstanceOf(z.ZodError);
expect(catchError !== undefined && (catchError as z.ZodError).issues.length).toEqual(1);
expect(catchError !== undefined && (catchError as z.ZodError).issues[0].message).toMatch("string");
});
test("ctx.input", () => {
const schema = z.string().catch((ctx) => {
return String(ctx.input);
});
expect(schema.parse(123)).toEqual("123");
});
@@ -0,0 +1,61 @@
'use strict';
var _const = require('../../data/const.cjs');
var types = require('../../types.cjs');
const separatorRegex = new RegExp(`[${_const.SEPERATOR_CHARS.join('')}]`);
/*
*-------------------------------------------------------------------------------
* separators (any semi-repeated special character) -----------------------------
*-------------------------------------------------------------------------------
*/
class MatchSeparator extends types.MatcherBaseClass {
static getMostUsedSeparatorChar(password) {
const mostUsedSeperators = [...password.split('').filter(c => separatorRegex.test(c)).reduce((memo, c) => {
const m = memo.get(c);
if (m) {
memo.set(c, parseInt(m, 10) + 1);
} else {
memo.set(c, 1);
}
return memo;
}, new Map()).entries()].sort(([_a, a], [_b, b]) => b - a);
if (!mostUsedSeperators.length) return undefined;
const match = mostUsedSeperators[0];
// If the special character is only used once, don't treat it like a separator
if (match[1] < 2) return undefined;
return match[0];
}
static getSeparatorRegex(separator) {
return new RegExp(`([^${separator}\n])(${separator})(?!${separator})`, 'g');
// negative lookbehind can be added again in a few years when it is more supported by the browsers (currently 2023)
// https://github.com/zxcvbn-ts/zxcvbn/issues/202
// return new RegExp(`(?<!${separator})(${separator})(?!${separator})`, 'g')
}
match({
password
}) {
const result = [];
if (password.length === 0) return result;
const mostUsedSpecial = MatchSeparator.getMostUsedSeparatorChar(password);
if (mostUsedSpecial === undefined) return result;
const isSeparator = MatchSeparator.getSeparatorRegex(mostUsedSpecial);
for (const match of password.matchAll(isSeparator)) {
if (match.index === undefined) continue;
// add one to the index because we changed the regex from negative lookbehind to something simple.
// this simple approach uses the first character before the separater too but we only need the index of the separater
// https://github.com/zxcvbn-ts/zxcvbn/issues/202
const i = match.index + 1;
result.push({
pattern: 'separator',
token: mostUsedSpecial,
i,
j: i
});
}
return result;
}
}
module.exports = MatchSeparator;
//# sourceMappingURL=matching.cjs.map
@@ -0,0 +1,942 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
test("_values", () => {
expect(z.string()._zod.values).toEqual(undefined);
expect(z.enum(["a", "b"])._zod.values).toEqual(new Set(["a", "b"]));
expect(z.nativeEnum({ a: "A", b: "B" })._zod.values).toEqual(new Set(["A", "B"]));
expect(z.literal("test")._zod.values).toEqual(new Set(["test"]));
expect(z.literal(123)._zod.values).toEqual(new Set([123]));
expect(z.literal(true)._zod.values).toEqual(new Set([true]));
expect(z.literal(BigInt(123))._zod.values).toEqual(new Set([BigInt(123)]));
expect(z.undefined()._zod.values).toEqual(new Set([undefined]));
expect(z.null()._zod.values).toEqual(new Set([null]));
const t = z.literal("test");
expect(t.optional()._zod.values).toEqual(new Set(["test", undefined]));
expect(t.nullable()._zod.values).toEqual(new Set(["test", null]));
expect(t.default("test")._zod.values).toEqual(new Set(["test"]));
expect(t.catch("test")._zod.values).toEqual(new Set(["test"]));
const pre = z.preprocess((val) => String(val), z.string()).pipe(z.literal("test"));
expect(pre._zod.values).toEqual(undefined);
const post = z.literal("test").transform((_) => Math.random());
expect(post._zod.values).toEqual(new Set(["test"]));
// Test that readonly literals pass through their values property
expect(z.literal("test").readonly()._zod.values).toEqual(new Set(["test"]));
});
test("valid parse - object", () => {
expect(
z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.parse({ type: "a", a: "abc" })
).toEqual({ type: "a", a: "abc" });
});
test("valid - include discriminator key (deprecated)", () => {
expect(
z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.parse({ type: "a", a: "abc" })
).toEqual({ type: "a", a: "abc" });
});
test("valid - optional discriminator (object)", () => {
const schema = z.discriminatedUnion("type", [
z.object({ type: z.literal("a").optional(), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
]);
expect(schema.parse({ type: "a", a: "abc" })).toEqual({ type: "a", a: "abc" });
expect(schema.parse({ a: "abc" })).toEqual({ a: "abc" });
});
test("valid - discriminator value of various primitive types", () => {
const schema = z.discriminatedUnion("type", [
z.object({ type: z.literal("1"), val: z.string() }),
z.object({ type: z.literal(1), val: z.string() }),
z.object({ type: z.literal(BigInt(1)), val: z.string() }),
z.object({ type: z.literal("true"), val: z.string() }),
z.object({ type: z.literal(true), val: z.string() }),
z.object({ type: z.literal("null"), val: z.string() }),
z.object({ type: z.null(), val: z.string() }),
z.object({ type: z.literal("undefined"), val: z.string() }),
z.object({ type: z.undefined(), val: z.string() }),
]);
expect(schema.parse({ type: "1", val: "val" })).toEqual({ type: "1", val: "val" });
expect(schema.parse({ type: 1, val: "val" })).toEqual({ type: 1, val: "val" });
expect(schema.parse({ type: BigInt(1), val: "val" })).toEqual({
type: BigInt(1),
val: "val",
});
expect(schema.parse({ type: "true", val: "val" })).toEqual({
type: "true",
val: "val",
});
expect(schema.parse({ type: true, val: "val" })).toEqual({
type: true,
val: "val",
});
expect(schema.parse({ type: "null", val: "val" })).toEqual({
type: "null",
val: "val",
});
expect(schema.parse({ type: null, val: "val" })).toEqual({
type: null,
val: "val",
});
expect(schema.parse({ type: "undefined", val: "val" })).toEqual({
type: "undefined",
val: "val",
});
expect(schema.parse({ type: undefined, val: "val" })).toEqual({
type: undefined,
val: "val",
});
const fail = schema.safeParse({
type: "not_a_key",
val: "val",
});
expect(fail.error).toBeInstanceOf(z.ZodError);
});
test("invalid - null", () => {
try {
z.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
]).parse(null);
throw new Error();
} catch (e: any) {
// [
// {
// code: z.ZodIssueCode.invalid_type,
// expected: z.ZodParsedType.object,
// input: null,
// message: "Expected object, received null",
// received: z.ZodParsedType.null,
// path: [],
// },
// ];
expect(e.issues).toMatchInlineSnapshot(`
[
{
"code": "invalid_type",
"expected": "object",
"message": "Invalid input: expected object, received null",
"path": [],
},
]
`);
}
});
test("invalid discriminator value", () => {
const result = z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.safeParse({ type: "x", a: "abc" });
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_union",
"errors": [],
"note": "No matching discriminator",
"discriminator": "type",
"options": [
"a",
"b"
],
"path": [
"type"
],
"message": "Invalid discriminator value. Expected 'a' | 'b'"
}
]],
"success": false,
}
`);
});
test("invalid discriminator value - unionFallback", () => {
const result = z
.discriminatedUnion(
"type",
[z.object({ type: z.literal("a"), a: z.string() }), z.object({ type: z.literal("b"), b: z.string() })],
{ unionFallback: true }
)
.safeParse({ type: "x", a: "abc" });
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"a"
],
"path": [
"type"
],
"message": "Invalid input: expected \\"a\\""
}
],
[
{
"code": "invalid_value",
"values": [
"b"
],
"path": [
"type"
],
"message": "Invalid input: expected \\"b\\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"b"
],
"message": "Invalid input: expected string, received undefined"
}
]
],
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
});
test("valid discriminator value, invalid data", () => {
const result = z
.discriminatedUnion("type", [
z.object({ type: z.literal("a"), a: z.string() }),
z.object({ type: z.literal("b"), b: z.string() }),
])
.safeParse({ type: "a", b: "abc" });
// [
// {
// code: z.ZodIssueCode.invalid_type,
// expected: z.ZodParsedType.string,
// message: "Required",
// path: ["a"],
// received: z.ZodParsedType.undefined,
// },
// ];
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"a"
],
"message": "Invalid input: expected string, received undefined"
}
]],
"success": false,
}
`);
});
test("wrong schema - missing discriminator", () => {
// An option whose properties can be listed is checked when the union is constructed.
expect(() => z.discriminatedUnion("type", [z.object({ value: z.string() })])).toThrow(
/Invalid discriminated union option at index "0"/
);
expect(() =>
z.discriminatedUnion("type", [z.object({ type: z.literal("a"), a: z.string() }), z.object({ b: z.string() })])
).toThrow(/Invalid discriminated union option at index "1"/);
// An option whose shape cannot be listed without resolving it — a pipe here — is left to the lookup map, and fails on the first object parsed.
const viaPipe = z.discriminatedUnion("type", [
z.object({ value: z.literal("x") }).pipe(z.object({ value: z.literal("x") })),
]);
expect(() => viaPipe.safeParse({ value: "x" })).toThrow(/Invalid discriminated union option at index "0"/);
});
test("the construction check follows shape through both of its phases", () => {
// `shape` answers from the object the caller passed until the first read, then from a frozen copy. A key list derived at either moment would disagree with it at the other and reject an option that does carry the discriminator.
const mutatedBeforeRead: Record<string, z.ZodType> = { value: z.string() };
const A = z.object(mutatedBeforeRead);
mutatedBeforeRead.type = z.literal("a");
expect(
z.discriminatedUnion("type", [A, z.object({ type: z.literal("b") })]).parse({ type: "a", value: "x" })
).toEqual({ type: "a", value: "x" });
const mutatedAfterRead: Record<string, z.ZodType> = { type: z.literal("a"), value: z.string() };
const B = z.object(mutatedAfterRead);
B.parse({ type: "a", value: "x" });
delete mutatedAfterRead.type;
expect(() => z.discriminatedUnion("type", [B])).not.toThrow();
});
test("deriving a schema neither clobbers nor is inherited by the source", () => {
// `.describe()` and friends reuse the def by identity, so the source keeps its own check.
const A = z.object({ value: z.literal("x") });
A.describe("just documenting this");
expect(() => z.discriminatedUnion("type", [A])).toThrow(/Invalid discriminated union option/);
expect(() => z.discriminatedUnion("type", [A.describe("d")])).toThrow(/Invalid discriminated union option/);
// A def rebuilt by a builder is a different object, so it inherits nothing and is left to the lookup map.
const Base = z.object({ status: z.literal("failed"), message: z.string() });
expect(() => z.discriminatedUnion("code", [Base.extend({ code: z.literal(400) })])).not.toThrow();
});
test("mutually-recursive getter options are checked without resolving them", () => {
// `Object.keys` lists a shape's keys without invoking them, so the check sees `child` without running the getter that references the union being constructed.
const variantA = z.object({
kind: z.literal("a"),
get child() {
return tree.optional();
},
});
const variantB = z.object({
kind: z.literal("b"),
get sibling() {
return tree.optional();
},
});
const tree = z.discriminatedUnion("kind", [variantA, variantB]);
expect(tree.parse({ kind: "a", child: { kind: "b" } })).toEqual({ kind: "a", child: { kind: "b" } });
});
// removed to account for unions of unions
// test("wrong schema - duplicate discriminator values", () => {
// try {
// z.discriminatedUnion("type",[
// z.object({ type: z.literal("a"), a: z.string() }),
// z.object({ type: z.literal("a"), b: z.string() }),
// ]);
// throw new Error();
// } catch (e: any) {
// expect(e.message.includes("Duplicate discriminator value")).toEqual(true);
// }
// });
test("async - valid", async () => {
const schema = await z.discriminatedUnion("type", [
z.object({
type: z.literal("a"),
a: z
.string()
.refine(async () => true)
.transform(async (val) => Number(val)),
}),
z.object({
type: z.literal("b"),
b: z.string(),
}),
]);
const data = { type: "a", a: "1" };
const result = await schema.safeParseAsync(data);
expect(result.data).toEqual({ type: "a", a: 1 });
});
test("async - invalid", async () => {
// try {
const a = z.discriminatedUnion("type", [
z.object({
type: z.literal("a"),
a: z
.string()
.refine(async () => true)
.transform(async (val) => val),
}),
z.object({
type: z.literal("b"),
b: z.string(),
}),
]);
const result = await a.safeParseAsync({ type: "a", a: 1 });
// expect(JSON.parse(e.message)).toEqual([
// {
// code: "invalid_type",
// expected: "string",
// input: 1,
// received: "number",
// path: ["a"],
// message: "Expected string, received number",
// },
// ]);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"a"
],
"message": "Invalid input: expected string, received number"
}
]]
`);
});
test("valid - literals with .default or .pipe", () => {
const schema = z.discriminatedUnion("type", [
z.object({
type: z.literal("foo").default("foo"),
a: z.string(),
}),
z.object({
type: z.literal("custom"),
method: z.string(),
}),
z.object({
type: z.literal("bar").transform((val) => val),
c: z.string(),
}),
]);
expect(schema.parse({ type: "foo", a: "foo" })).toEqual({
type: "foo",
a: "foo",
});
});
test("enum and nativeEnum", () => {
enum MyEnum {
d = 0,
e = "e",
}
const schema = z.discriminatedUnion("key", [
z.object({
key: z.literal("a"),
// Add other properties specific to this option
}),
z.object({
key: z.enum(["b", "c"]),
// Add other properties specific to this option
}),
z.object({
key: z.nativeEnum(MyEnum),
// Add other properties specific to this option
}),
]);
type schema = z.infer<typeof schema>;
expectTypeOf<schema>().toEqualTypeOf<{ key: "a" } | { key: "b" | "c" } | { key: MyEnum.d | MyEnum.e }>();
schema.parse({ key: "a" });
schema.parse({ key: "b" });
schema.parse({ key: "c" });
schema.parse({ key: MyEnum.d });
schema.parse({ key: MyEnum.e });
schema.parse({ key: "e" });
});
test("branded", () => {
const schema = z.discriminatedUnion("key", [
z.object({
key: z.literal("a"),
// Add other properties specific to this option
}),
z.object({
key: z.literal("b").brand<"asdfasdf">(),
// Add other properties specific to this option
}),
]);
type schema = z.infer<typeof schema>;
expectTypeOf<schema>().toEqualTypeOf<{ key: "a" } | { key: "b" & z.core.$brand<"asdfasdf"> }>();
schema.parse({ key: "a" });
schema.parse({ key: "b" });
expect(() => {
schema.parse({ key: "c" });
}).toThrow();
});
test("optional and nullable", () => {
const schema = z.discriminatedUnion("key", [
z.object({
key: z.literal("a").optional(),
a: z.literal(true),
}),
z.object({
key: z.literal("b").nullable(),
b: z.literal(true),
// Add other properties specific to this option
}),
]);
type schema = z.infer<typeof schema>;
expectTypeOf<schema>().toEqualTypeOf<{ key?: "a" | undefined; a: true } | { key: "b" | null; b: true }>();
schema.parse({ key: "a", a: true });
schema.parse({ key: undefined, a: true });
schema.parse({ key: "b", b: true });
schema.parse({ key: null, b: true });
expect(() => {
schema.parse({ key: null, a: true });
}).toThrow();
expect(() => {
schema.parse({ key: "b", a: true });
}).toThrow();
const value = schema.parse({ key: null, b: true });
if (!("key" in value)) value.a;
if (value.key === undefined) value.a;
if (value.key === "a") value.a;
if (value.key === "b") value.b;
if (value.key === null) value.b;
});
test("multiple discriminators", () => {
const FreeConfig = z.object({
type: z.literal("free"),
min_cents: z.null(),
});
// console.log(FreeConfig.shape.type);
const PricedConfig = z.object({
type: z.literal("fiat-price"),
// min_cents: z.int().nullable(),
min_cents: z.null(),
});
const Config = z.discriminatedUnion("type", [FreeConfig, PricedConfig]);
Config.parse({
min_cents: null,
type: "fiat-price",
name: "Standard",
});
expect(() => {
Config.parse({
min_cents: null,
type: "not real",
name: "Standard",
});
}).toThrow();
});
test("single element union", () => {
const schema = z.object({
a: z.literal("discKey"),
b: z.enum(["apple", "banana"]),
c: z.object({ id: z.string() }),
});
const input = {
a: "discKey",
b: "apple",
c: {}, // Invalid, as schema requires `id` property
};
// Validation must fail here, but it doesn't
const u = z.discriminatedUnion("a", [schema]);
const result = u.safeParse(input);
expect(result).toMatchObject({ success: false });
expect(result).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"c",
"id"
],
"message": "Invalid input: expected string, received undefined"
}
]],
"success": false,
}
`);
expect(u.options.length).toEqual(1);
});
test("nested discriminated unions", () => {
const BaseError = z.object({ status: z.literal("failed"), message: z.string() });
const MyErrors = z.discriminatedUnion("code", [
BaseError.extend({ code: z.literal(400) }),
BaseError.extend({ code: z.literal(401) }),
BaseError.extend({ code: z.literal(500) }),
]);
const MyResult = z.discriminatedUnion("status", [
z.object({ status: z.literal("success"), data: z.string() }),
MyErrors,
]);
expect(MyErrors._zod.propValues).toMatchInlineSnapshot(`
{
"code": Set {
400,
401,
500,
},
"status": Set {
"failed",
},
}
`);
expect(MyResult._zod.propValues).toMatchInlineSnapshot(`
{
"code": Set {
400,
401,
500,
},
"status": Set {
"success",
"failed",
},
}
`);
const result = MyResult.parse({ status: "success", data: "hello" });
expect(result).toMatchInlineSnapshot(`
{
"data": "hello",
"status": "success",
}
`);
const result2 = MyResult.parse({ status: "failed", code: 400, message: "bad request" });
expect(result2).toMatchInlineSnapshot(`
{
"code": 400,
"message": "bad request",
"status": "failed",
}
`);
const result3 = MyResult.parse({ status: "failed", code: 401, message: "unauthorized" });
expect(result3).toMatchInlineSnapshot(`
{
"code": 401,
"message": "unauthorized",
"status": "failed",
}
`);
const result4 = MyResult.parse({ status: "failed", code: 500, message: "internal server error" });
expect(result4).toMatchInlineSnapshot(`
{
"code": 500,
"message": "internal server error",
"status": "failed",
}
`);
});
test("readonly literal discriminator", () => {
const discUnion = z.discriminatedUnion("type", [
z.object({ type: z.literal("a").readonly(), a: z.string() }),
z.object({ type: z.literal("b"), b: z.number() }),
]);
// Test that both discriminator values are correctly included in propValues
const propValues = discUnion._zod.propValues;
expect(propValues?.type?.has("a")).toBe(true);
expect(propValues?.type?.has("b")).toBe(true);
// Test that the discriminated union works correctly
const result1 = discUnion.parse({ type: "a", a: "hello" });
expect(result1).toEqual({ type: "a", a: "hello" });
const result2 = discUnion.parse({ type: "b", b: 42 });
expect(result2).toEqual({ type: "b", b: 42 });
// Test that invalid discriminator values are rejected
expect(() => {
discUnion.parse({ type: "c", a: "hello" });
}).toThrow();
});
test("pipes", () => {
const schema = z
.object({
type: z.literal("foo"),
})
.transform((s) => ({ ...s, v: 2 }));
expect(schema._zod.propValues).toMatchInlineSnapshot(`
{
"type": Set {
"foo",
},
}
`);
const schema2 = z.object({
type: z.literal("bar"),
});
const combinedSchema = z.discriminatedUnion("type", [schema, schema2], {
unionFallback: false,
});
combinedSchema.parse({
type: "foo",
v: 2,
});
});
test("def", () => {
const schema = z.discriminatedUnion(
"type",
[z.object({ type: z.literal("play") }), z.object({ type: z.literal("pause") })],
{ unionFallback: true }
);
expect(schema.def).toBeDefined();
expect(schema.def.discriminator).toEqual("type");
expect(schema.def.unionFallback).toEqual(true);
});
test("encode with codec discriminator", () => {
const codec1 = z.codec(z.literal(1), z.literal("one"), {
decode: () => "one" as const,
encode: () => 1 as const,
});
const codec2 = z.codec(z.literal(2), z.literal("two"), {
decode: () => "two" as const,
encode: () => 2 as const,
});
const schema = z.discriminatedUnion("type", [
z.object({ type: codec1, value: z.string() }),
z.object({ type: codec2, value: z.number() }),
]);
// decode (forward) should work
const decoded = schema.decode({ type: 1, value: "hello" });
expect(decoded).toEqual({ type: "one", value: "hello" });
// encode (backward) should also work — the discriminator values differ between forward (1, 2) and backward ("one", "two") directions
const encoded = z.encode(schema, { type: "one", value: "hello" });
expect(encoded).toEqual({ type: 1, value: "hello" });
});
test("nested encoding does not select a sibling from forward discriminator values", async () => {
const tag = (value: "a" | "b") =>
z.codec(z.literal(value).default(value), z.undefined(), {
decode: () => undefined,
encode: () => value,
});
const inner = z.discriminatedUnion("type", [
z.object({ type: tag("a"), value: z.literal("a") }),
z.object({ type: tag("b"), value: z.literal("b") }),
]);
const outer = z.discriminatedUnion("type", [inner, z.object({ type: z.undefined(), value: z.string() })]);
for (const value of ["a", "b"] as const) {
const input = { type: undefined, value };
const expected = { type: value, value };
expect(z.encode(inner, input)).toEqual(expected);
expect(z.encode(outer, input)).toEqual(expected);
expect(await z.encodeAsync(outer, input)).toEqual(expected);
}
});
test("getDiscriminatedOption", () => {
const fruit = z.object({ type: z.literal("fruit"), seeds: z.boolean() });
const veg = z.object({ type: z.literal("vegetable"), leafy: z.boolean() });
const schema = z.discriminatedUnion("type", [fruit, veg]);
expect(z.getDiscriminatedOption(schema, "fruit")).toBe(fruit);
expect(z.getDiscriminatedOption(schema, "vegetable")).toBe(veg);
// The result is narrowed to the one member, not the union of all of them.
expectTypeOf(z.getDiscriminatedOption(schema, "fruit")).toEqualTypeOf<typeof fruit>();
expectTypeOf(z.getDiscriminatedOption(schema, "vegetable")).toEqualTypeOf<typeof veg>();
// @ts-expect-error — "unknown" is not a declared discriminator value
z.getDiscriminatedOption(schema, "unknown");
});
test("getDiscriminatedOption — multi-value members and non-string discriminators", () => {
const a = z.object({ type: z.literal(["x", "y"]), payload: z.string() });
const b = z.object({ type: z.literal("z"), payload: z.number() });
const multi = z.discriminatedUnion("type", [a, b]);
expect(z.getDiscriminatedOption(multi, "x")).toBe(a);
expect(z.getDiscriminatedOption(multi, "y")).toBe(a);
expect(z.getDiscriminatedOption(multi, "z")).toBe(b);
const num = z.object({ type: z.literal(1) });
const bool = z.object({ type: z.literal(true) });
const nul = z.object({ type: z.null() });
const mixed = z.discriminatedUnion("type", [num, bool, nul]);
expect(z.getDiscriminatedOption(mixed, 1)).toBe(num);
expect(z.getDiscriminatedOption(mixed, true)).toBe(bool);
expect(z.getDiscriminatedOption(mixed, null)).toBe(nul);
// An omittable discriminator claims undefined, so it resolves like any other value.
const opt = z.object({ type: z.literal("a").optional(), a: z.string() });
const req = z.object({ type: z.literal("b"), b: z.string() });
expect(z.getDiscriminatedOption(z.discriminatedUnion("type", [opt, req]), undefined)).toBe(opt);
});
test("getDiscriminatedOption caches in the bag and costs nothing until called", () => {
const schema = z.discriminatedUnion("type", [z.object({ type: z.literal("a") }), z.object({ type: z.literal("b") })]);
expect(schema._zod.bag.optionsMap).toBeUndefined();
expect(z.getDiscriminatedOption(schema, "a")).toBe(schema.options[0]);
const map = schema._zod.bag.optionsMap;
expect(map).toBeInstanceOf(Map);
expect(z.getDiscriminatedOption(schema, "b")).toBe(schema.options[1]);
expect(schema._zod.bag.optionsMap).toBe(map);
// A clone recomputes rather than inheriting the cache.
expect(schema.clone()._zod.bag.optionsMap).toBeUndefined();
});
test.each(["__proto__", "constructor", "toString", "hasOwnProperty", "valueOf"])(
"Object.prototype discriminator name: %s",
(key) => {
const first = z.object({ [key]: z.literal("a"), value: z.string() });
const second = z.object({ [key]: z.literal("b"), value: z.number() });
const schema = z.discriminatedUnion(key, [first, second]);
expect(schema._zod.propValues?.[key]).toEqual(new Set(["a", "b"]));
const input = Object.fromEntries([
[key, "a"],
["value", "ok"],
]);
const parsed: any = schema.parse(input);
expect(Object.prototype.hasOwnProperty.call(parsed, key)).toBe(key !== "__proto__");
if (key !== "__proto__") expect(parsed[key]).toBe("a");
expect(parsed.value).toBe("ok");
}
);
test("an omittable discriminator claims undefined", () => {
const omittable = [
z.exactOptional(z.literal("a")),
z.optional(z.literal("a")),
z.literal("a").default("a"),
z.literal("a").prefault("a"),
z.literal("a").catch("a"),
];
for (const k of omittable) {
expect(z.object({ k })._zod.propValues.k).toEqual(new Set(["a", undefined]));
}
// one option omits the key: it claims undefined, so an absent key routes there and the union agrees
const options = [
z.object({ k: z.exactOptional(z.literal("a")), x: z.string() }),
z.object({ k: z.literal("b"), y: z.number() }),
] as const;
expect(z.discriminatedUnion("k", options).safeParse({ x: "s" }).success).toEqual(true);
expect(z.union(options).safeParse({ x: "s" }).success).toEqual(true);
expect(z.discriminatedUnion("k", options).safeParse({ k: "b", y: 1 }).success).toEqual(true);
// ambiguous absence does not prevent explicit tags from routing
for (const k of omittable) {
const schema = z.discriminatedUnion("k", [z.object({ k }), z.object({ k: z.exactOptional(z.literal("c")) })]);
expect(schema.parse({ k: "a" })).toEqual({ k: "a" });
expect(schema.parse({ k: "c" })).toEqual({ k: "c" });
expect(schema.safeParse({}).success).toBe(false);
}
});
test("defaulted discriminators preserve tagged parsing without guessing a member", async () => {
const a = z.object({ type: z.literal("a").default("a"), x: z.number().positive() });
const b = z.object({ type: z.literal("b").default("b"), y: z.string() });
const c = z.object({ type: z.literal("c").default("c"), z: z.boolean() });
for (const options of [
[a, b, c],
[c, b, a],
] as const) {
const schema = z.discriminatedUnion("type", options);
for (const input of [a.parse({ x: 1 }), b.parse({ y: "s" }), c.parse({ z: true })]) {
expect(schema.parse(input)).toEqual(input);
expect((await schema.safeParseAsync(input)).success).toBe(true);
}
for (const input of [{ x: 1, y: "s", z: true }, { type: undefined }, { type: "other" }, { type: "a", x: -1 }]) {
expect(schema.safeParse(input).success).toBe(false);
expect((await schema.safeParseAsync(input)).success).toBe(false);
}
const result = schema.safeParse({});
expect(result.error?.issues[0]).toMatchObject({
code: "invalid_union",
path: ["type"],
options: options.map((o) => o.shape.type.unwrap().value),
});
expect(z.getDiscriminatedOption(schema, "a")).toBe(a);
}
const unique = z.discriminatedUnion("type", [a, b.safeExtend({ type: b.shape.type.unwrap() })]);
expect(unique.parse({ x: 1 })).toEqual({ type: "a", x: 1 });
});
test("undefined collisions are value-based and discriminator lookup rejects ambiguity", () => {
const a = z.object({ type: z.literal("a").optional() });
const absent = z.object({ type: z.undefined() });
for (const options of [
[a, absent],
[absent, a],
[absent, absent, a],
] as const) {
const schema = z.discriminatedUnion("type", options);
expect(schema.parse({ type: "a" })).toEqual({ type: "a" });
expect(schema.safeParse({}).success).toBe(false);
expect(() => z.getDiscriminatedOption(schema, undefined)).toThrow('Ambiguous discriminator value "undefined"');
}
const unique = z.discriminatedUnion("type", [absent, z.object({ type: z.literal("a") })]);
expect(unique.parse({ type: undefined })).toEqual({ type: undefined });
expect(z.getDiscriminatedOption(unique, undefined)).toBe(absent);
});
test("non-undefined discriminator collisions remain schema errors", () => {
for (const tag of [z.literal("a").default("a"), z.literal(["a", "b"]), z.literal("a").nullable()]) {
const schema = z.discriminatedUnion("type", [z.object({ type: tag }), z.object({ type: tag })]);
expect(() => schema.safeParse({ type: "a" })).toThrow(/Duplicate discriminator value/);
expect(() => z.encode(schema, { type: "a" })).toThrow(/Duplicate discriminator value/);
expect(() => z.getDiscriminatedOption(schema, "a")).toThrow(/Duplicate discriminator value/);
}
const nullable = z.discriminatedUnion("type", [
z.object({ type: z.literal("a").nullable() }),
z.object({ type: z.literal("b").nullable() }),
]);
expect(() => nullable.safeParse({ type: "a" })).toThrow('Duplicate discriminator value "null"');
});
test("nested defaulted unions only advertise routable discriminator values", () => {
const a = z.object({ type: z.literal("a").default("a"), group: z.literal("inner") });
const b = z.object({ type: z.literal("b").default("b"), group: z.literal("inner") });
const inner = z.discriminatedUnion("type", [a, b]);
const c = z.object({ type: z.literal("c").default("c"), group: z.literal("outer") });
expect(inner._zod.propValues.type).toEqual(new Set(["a", "b"]));
for (const schema of [
z.discriminatedUnion("type", [z.lazy(() => inner), c]),
z.discriminatedUnion("group", [inner, c]),
]) {
expect(schema.parse({ type: "a", group: "inner" })).toEqual({ type: "a", group: "inner" });
expect(schema.parse({ group: "outer" })).toEqual({ type: "c", group: "outer" });
expect(schema.safeParse({ group: "inner" }).success).toBe(false);
}
const fallback = z.discriminatedUnion("type", [a, b], { unionFallback: true });
expect(fallback._zod.propValues.type.has(undefined)).toBe(true);
expect(fallback.parse({ group: "inner" })).toEqual({ type: "a", group: "inner" });
});
@@ -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 Mail = createLucideIcon("Mail", [
["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }]
]);
export { Mail as default };
//# sourceMappingURL=mail.js.map
@@ -0,0 +1,19 @@
/**
* @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 ScreenShareOff = createLucideIcon("ScreenShareOff", [
["path", { d: "M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3", key: "i8wdob" }],
["path", { d: "M8 21h8", key: "1ev6f3" }],
["path", { d: "M12 17v4", key: "1riwvh" }],
["path", { d: "m22 3-5 5", key: "12jva0" }],
["path", { d: "m17 3 5 5", key: "k36vhe" }]
]);
export { ScreenShareOff as default };
//# sourceMappingURL=screen-share-off.js.map
@@ -0,0 +1,19 @@
import { MatcherBaseClass, MatchOptions, SequenceMatch } from '../../types';
interface UpdateParams {
i: number;
j: number;
delta: number;
password: string;
result: any[];
}
type SequenceMatchOptions = Pick<MatchOptions, 'password'>;
declare class MatchSequence extends MatcherBaseClass {
MAX_DELTA: number;
match({ password }: SequenceMatchOptions): SequenceMatch[];
update({ i, j, delta, password, result }: UpdateParams): number | null;
getSequence(token: string): {
sequenceName: string;
sequenceSpace: number;
};
}
export default MatchSequence;
@@ -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 CreativeCommons = createLucideIcon("CreativeCommons", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
[
"path",
{ d: "M10 9.3a2.8 2.8 0 0 0-3.5 1 3.1 3.1 0 0 0 0 3.4 2.7 2.7 0 0 0 3.5 1", key: "1ss3eq" }
],
[
"path",
{ d: "M17 9.3a2.8 2.8 0 0 0-3.5 1 3.1 3.1 0 0 0 0 3.4 2.7 2.7 0 0 0 3.5 1", key: "1od56t" }
]
]);
export { CreativeCommons as default };
//# sourceMappingURL=creative-commons.js.map
@@ -0,0 +1,13 @@
import { t as CfWorkerJsonSchemaValidator } from "./cfWorkerProvider-doTkZbTr.cjs";
//#region src/shimsWorkerd.d.ts
/**
* Whether `fetch()` may throw `TypeError` due to CORS. CORS is a browser-only concept —
* in Cloudflare Workers, a `TypeError` from `fetch` is always a real network/configuration
* error, never a CORS error.
*/
declare const CORS_IS_POSSIBLE = false;
//#endregion
export { CORS_IS_POSSIBLE, CfWorkerJsonSchemaValidator as DefaultJsonSchemaValidator };
//# sourceMappingURL=shimsWorkerd.d.cts.map
@@ -0,0 +1,84 @@
import {Value} from './index';
/**
* Sass's [string type](https://sass-lang.com/documentation/values/strings).
*
* @category Custom Function
*/
export class SassString extends Value {
/**
* Creates a new string.
*
* @param text - The contents of the string. For quoted strings, this is the
* semantic content—any escape sequences that were been written in the source
* text are resolved to their Unicode values. For unquoted strings, though,
* escape sequences are preserved as literal backslashes.
*
* @param options.quotes - Whether the string is quoted. Defaults to `true`.
*/
constructor(
text: string,
options?: {
quotes?: boolean;
}
);
/**
* Creates an empty string.
*
* @param options.quotes - Whether the string is quoted. Defaults to `true`.
*/
constructor(options?: {quotes?: boolean});
/**
* The contents of the string.
*
* For quoted strings, this is the semantic content—any escape sequences that
* were been written in the source text are resolved to their Unicode values.
* For unquoted strings, though, escape sequences are preserved as literal
* backslashes.
*
* This difference allows us to distinguish between identifiers with escapes,
* such as `url\u28 http://example.com\u29`, and unquoted strings that contain
* characters that aren't valid in identifiers, such as
* `url(http://example.com)`. Unfortunately, it also means that we don't
* consider `foo` and `f\6F\6F` the same string.
*/
get text(): string;
/** Whether this string has quotes. */
get hasQuotes(): boolean;
/**
* Sass's notion of this string's length.
*
* Sass treats strings as a series of Unicode code points while JavaScript
* treats them as a series of UTF-16 code units. For example, the character
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
* JavaScript, `"n😊b".length` returns `4`, whereas in Sass
* `string.length("n😊b")` returns `3`.
*/
get sassLength(): number;
/**
* Converts `sassIndex` to a JavaScript index into {@link text}.
*
* Sass indices are one-based, while JavaScript indices are zero-based. Sass
* indices may also be negative in order to index from the end of the string.
*
* In addition, Sass indices refer to Unicode code points while JavaScript
* string indices refer to UTF-16 code units. For example, the character
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
* JavaScript, `"n😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
* `string.slice("n😊b", 1, 1)` returns `"😊"`.
*
* This function converts Sass's code point indices to JavaScript's code unit
* indices. This means it's O(n) in the length of `text`.
*
* @throws `Error` - If `sassIndex` isn't a number, if that number isn't an
* integer, or if that integer isn't a valid index for this string.
*/
sassIndexToStringIndex(sassIndex: Value, name?: string): number;
}
@@ -0,0 +1 @@
"use strict";var l={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},mauve:{50:"oklch(98.5% 0 0)",100:"oklch(96% 0.003 325.6)",200:"oklch(92.2% 0.005 325.62)",300:"oklch(86.5% 0.012 325.68)",400:"oklch(71.1% 0.019 323.02)",500:"oklch(54.2% 0.034 322.5)",600:"oklch(43.5% 0.029 321.78)",700:"oklch(36.4% 0.029 323.89)",800:"oklch(26.3% 0.024 320.12)",900:"oklch(21.2% 0.019 322.12)",950:"oklch(14.5% 0.008 326)"},olive:{50:"oklch(98.8% 0.003 106.5)",100:"oklch(96.6% 0.005 106.5)",200:"oklch(93% 0.007 106.5)",300:"oklch(88% 0.011 106.6)",400:"oklch(73.7% 0.021 106.9)",500:"oklch(58% 0.031 107.3)",600:"oklch(46.6% 0.025 107.3)",700:"oklch(39.4% 0.023 107.4)",800:"oklch(28.6% 0.016 107.4)",900:"oklch(22.8% 0.013 107.4)",950:"oklch(15.3% 0.006 107.1)"},mist:{50:"oklch(98.7% 0.002 197.1)",100:"oklch(96.3% 0.002 197.1)",200:"oklch(92.5% 0.005 214.3)",300:"oklch(87.2% 0.007 219.6)",400:"oklch(72.3% 0.014 214.4)",500:"oklch(56% 0.021 213.5)",600:"oklch(45% 0.017 213.2)",700:"oklch(37.8% 0.015 216)",800:"oklch(27.5% 0.011 216.9)",900:"oklch(21.8% 0.008 223.9)",950:"oklch(14.8% 0.004 228.8)"},taupe:{50:"oklch(98.6% 0.002 67.8)",100:"oklch(96% 0.002 17.2)",200:"oklch(92.2% 0.005 34.3)",300:"oklch(86.8% 0.007 39.5)",400:"oklch(71.4% 0.014 41.2)",500:"oklch(54.7% 0.021 43.1)",600:"oklch(43.8% 0.017 39.3)",700:"oklch(36.7% 0.016 35.7)",800:"oklch(26.8% 0.011 36.5)",900:"oklch(21.4% 0.009 43.1)",950:"oklch(14.7% 0.004 49.3)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.8Line truncated
@@ -0,0 +1,13 @@
declare namespace getSideChannelList {
type Channel<K, V> = {
assert: (key: K) => void;
has: (key: K) => boolean;
get: (key: K) => V | undefined;
set: (key: K, value: V) => void;
delete: (key: K) => boolean;
};
}
declare function getSideChannelList<V, K>(): getSideChannelList.Channel<K, V>;
export = getSideChannelList;
@@ -0,0 +1,20 @@
/**
* @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 TestTubeDiagonal = createLucideIcon("TestTubeDiagonal", [
[
"path",
{ d: "M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3", key: "1ub6xw" }
],
["path", { d: "m16 2 6 6", key: "1gw87d" }],
["path", { d: "M12 16H4", key: "1cjfip" }]
]);
export { TestTubeDiagonal as default };
//# sourceMappingURL=test-tube-diagonal.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../src/context/MotionContext/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps<Instance = unknown> {\n visualElement?: VisualElement<Instance>\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext<MotionContextProps>(\n {}\n)\n"],"names":[],"mappings":";;;AAWO;;"}
@@ -0,0 +1,26 @@
{
"name": "motion-utils",
"version": "12.36.0",
"author": "Matt Perry",
"license": "MIT",
"repository": "https://github.com/motiondivision/motion",
"main": "./dist/cjs/index.js",
"types": "./dist/index.d.ts",
"module": "./dist/es/index.mjs",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/es/index.mjs",
"default": "./dist/cjs/index.js"
}
},
"scripts": {
"clean": "rm -rf types dist lib",
"build": "yarn clean && tsc -p . && rollup -c",
"dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"",
"test": "jest --config jest.config.json --max-workers=2"
},
"gitHead": "cb86cf385a9c4a9b1202646577ba67800e72cde4"
}
@@ -0,0 +1 @@
{"version":3,"file":"is-zero-value-string.mjs","sources":["../../src/is-zero-value-string.ts"],"sourcesContent":["/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC;;;;"}
@@ -0,0 +1,42 @@
/* c8 ignore start */
import type { InputOptions } from "./validation/options.ts";
import getTargets, {
type InputTargets,
} from "@babel/helper-compilation-targets";
import type { Targets } from "@babel/helper-compilation-targets";
export function resolveBrowserslistConfigFile(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
browserslistConfigFile: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
configFilePath: string,
): string | void {
return undefined;
}
export function resolveTargets(
options: InputOptions,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
root: string,
): Targets {
const optTargets = options.targets;
let targets: InputTargets;
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
targets = { browsers: optTargets };
} else if (optTargets) {
if ("esmodules" in optTargets) {
targets = { ...optTargets, esmodules: "intersect" };
} else {
// https://github.com/microsoft/TypeScript/issues/17002
targets = optTargets as InputTargets;
}
}
return getTargets(targets, {
ignoreBrowserslistConfig: true,
browserslistEnv: options.browserslistEnv,
});
}
@@ -0,0 +1,342 @@
export default `flf2a$ 3 3 10 -1 34 0 7999 0
Author : myflix
Date : 2004/2/16 15:18:10
Version: 1.0
-------------------------------------------------
This font is a variation of double designed by Kent Nassen 11/24/94
double.flf (FIGlet font)
figlet conversion by Kent Nassen, kentn@cyberspace.org, 11/24/94
From: stuce@csv.warwick.ac.uk (Peter Weighill)
Newsgroups: alt.ascii-art
Subject: FONT: double (not .flf)
Date: 15 Mar 1994 16:20:01 -0000
Organization: Commodore 64 Services, University of Warwick, UK
Lines: 30
Message-ID: <2m4n7h$2ti@basil.csv.warwick.ac.uk>
NNTP-Posting-Host: basil.csv.warwick.ac.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Keywords: font
Status: RO
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $##
__ #
|| #
.. ##
#
// #
##
__ __ #
=||=||= #
|| || ##
$#
#
##
_ #
O // #
// O ##
&#
#
##
// #
#
##
_ #
(( #
\\\\ ##
_ #
)) #
// ##
*#
#
##
+#
#
##
#
#
// ##
-#
#
##
#
#
|| ##
/#
#
##
0#
#
##
1#
#
##
2#
#
##
3#
#
##
4#
#
##
5#
#
##
6#
#
##
7#
#
##
8#
#
##
9#
#
##
:#
#
##
;#
#
##
<#
#
##
=#
#
##
>#
#
##
____ #
'_// #
|| ##
@#
#
##
___ #
||=|| #
|| || ##
____ #
||=) #
||_)) ##
____ #
(( #
\\\\__ ##
_____ #
|| ) #
||_// ##
_____ #
||== #
||___ ##
_____ #
||== #
|| ##
____ #
(( ___ #
\\\\_|| ##
__ __ #
||==|| #
|| || ##
__ #
|| #
|| ##
__ #
|| #
|__|| ##
__ __ #
||<< #
|| \\\\ ##
__ #
|| #
||__| ##
___ __ #
|| \\/ | #
|| | ##
__ __ #
||\\\\|| #
|| \\|| ##
_____ #
(( )) #
\\\\_// ##
_____ #
||_// #
|| ##
_____ #
(( )) #
\\\\_/X| ##
_____ #
||_// #
|| \\\\ ##
__ #
(( #
\\_)) ##
_____ #
|| #
|| ##
__ __ #
|| || #
\\\\_// ##
__ __ #
\\\\ // #
\\V/ ##
__ __#
\\\\ /\\ //#
\\V/\\V/ ##
_ _ #
\\\\// #
//\\\\ ##
_ _ #
\\\\// #
// ##
____ #
// #
//__ ##
[#
#
##
\\#
#
##
]#
#
##
^#
#
##
_#
#
##
\`#
#
##
___ #
||=|| #
|| || ##
____ #
||=) #
||_)) ##
____ #
(( #
\\\\__ ##
_____ #
|| ) #
||_// ##
_____ #
||== #
||___ ##
_____ #
||== #
|| ##
____ #
(( ___ #
\\\\_|| ##
__ __ #
||==|| #
|| || ##
__ #
|| #
|| ##
__ #
|| #
|__|| ##
__ __ #
||<< #
|| \\\\ ##
__ #
|| #
||__| ##
___ __ #
|| \\/ | #
|| | ##
__ __ #
||\\\\|| #
|| \\|| ##
_____ #
(( )) #
\\\\_// ##
_____ #
||_// #
|| ##
_____ #
(( )) #
\\\\_/X| ##
_____ #
||_// #
|| \\\\ ##
__ #
(( #
\\_)) ##
_____ #
|| #
|| ##
__ __ #
|| || #
\\\\_// ##
__ __ #
\\\\ // #
\\V/ ##
__ __#
\\\\ /\\ //#
\\V/\\V/ ##
_ _ #
\\\\// #
//\\\\ ##
_ _ #
\\\\// #
// ##
____ #
// #
//__ ##
{#
#
##
|#
#
##
}#
#
##
~#
#
##
___ #
||=|| #
|| || ##
_____ #
(( )) #
\\\\_// ##
__ __ #
|| || #
\\\\_// ##
___ #
||=|| #
|| || ##
_____ #
(( )) #
\\\\_// ##
__ __ #
|| || #
\\\\_// ##
#
#
_ ##
`
@@ -0,0 +1,21 @@
/**
* @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 Book = createLucideIcon("Book", [
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
]
]);
export { Book as default };
//# sourceMappingURL=book.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Match.js","names":[],"sources":["../../src/Match.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { useStore } from '@tanstack/react-store'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n invariant,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { matchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport { useLayoutEffect } from './utils'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = React.memo(function MatchImpl({\n matchId,\n}: {\n matchId: string\n}) {\n const router = useRouter()\n\n if (isServer ?? router.isServer) {\n const match = router.stores.matchStores.get(matchId)?.get()\n if (!match) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find match for matchId \"${matchId}\". Please file an issue!`,\n )\n }\n\n invariant()\n }\n\n const routeId = match.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute).parentRoute\n ?.id\n\n return (\n <MatchView\n router={router}\n matchId={matchId}\n resetKey={router.stores.loadedAt.get()}\n matchState={{\n routeId,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n parentRouteId,\n }}\n />\n )\n }\n\n // Subscribe directly to the match store from the pool.\n // The matchId prop is stable for this component's lifetime (set by Outlet),\n // and reconcileMatchPool reuses stores for the same matchId.\n\n const matchStore = router.stores.matchStores.get(matchId)\n if (!matchStore) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find match for matchId \"${matchId}\". Please file an issue!`,\n )\n }\n\n invariant()\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const match = useStore(matchStore, (value) => value)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const matchState = React.useMemo(() => {\n const routeId = match.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute).parentRoute\n ?.id\n\n return {\n routeId,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n } satisfies MatchViewState\n }, [match._displayPending, match.routeId, match.ssr, router.routesById])\n\n return (\n <MatchView\n router={router}\n matchId={matchId}\n resetKey={resetKey}\n matchState={matchState}\n />\n )\n})\n\ntype MatchViewState = {\n routeId: string\n ssr: boolean | 'data-only' | undefined\n _displayPending: boolean | undefined\n parentRouteId: string | undefined\n}\n\nfunction MatchView({\n router,\n matchId,\n resetKey,\n matchState,\n}: {\n router: ReturnType<typeof useRouter>\n matchId: string\n resetKey: number\n matchState: MatchViewState\n}) {\n const route: AnyRoute = router.routesById[matchState.routeId]\n\n const PendingComponent =\n route.options.pendingComponent ?? router.options.defaultPendingComponent\n\n const pendingElement = PendingComponent ? <PendingComponent /> : null\n\n const routeErrorComponent =\n route.options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = route.isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route.options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route.options.notFoundComponent\n\n const resolvedNoSsr =\n matchState.ssr === false || matchState.ssr === 'data-only'\n const ResolvedSuspenseBoundary =\n // If we're on the root route, allow forcefully wrapping in suspense\n (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) &&\n (route.options.wrapInSuspense ??\n PendingComponent ??\n ((route.options.errorComponent as any)?.preload || resolvedNoSsr))\n ? React.Suspense\n : SafeFragment\n\n const ResolvedCatchBoundary = routeErrorComponent\n ? CatchBoundary\n : SafeFragment\n\n const ResolvedNotFoundBoundary = routeNotFoundComponent\nLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"url-search-params.d.ts","sourceRoot":"","sources":["../../../web/url-search-params.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB,KAkCzB,CAAC;AAEH,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,35 @@
import { HtmlEscapedString } from "../utils/html.js";
import { PropsWithChildren } from "./types.js";
import { Context } from "./context.js";
import { FC, JSXNode } from "./base.js";
//#region src/jsx/streaming.d.ts
/**
* Used to specify nonce for scripts generated by `Suspense` and `ErrorBoundary`.
*
* @example
* ```tsx
* <StreamingContext.Provider value={{ scriptNonce: 'test-nonce' }}>
* <Suspense fallback={<p>Loading...</p>}>
* <Content />
* </Suspense>
* </StreamingContext.Provider>
* ```
*/
export declare const StreamingContext: Context<{
scriptNonce: string;
} | null>;
/**
* @experimental
* `Suspense` is an experimental feature.
* The API might be changed.
*/
export declare const Suspense: FC<PropsWithChildren<{
fallback: any;
}>>;
/**
* @experimental
* `renderToReadableStream()` is an experimental feature.
* The API might be changed.
*/
export declare const renderToReadableStream: (content: HtmlEscapedString | JSXNode | Promise<HtmlEscapedString>, onError?: (e: unknown) => string | void) => ReadableStream<Uint8Array>;
//#endregion