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

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

No files matched your search

@@ -0,0 +1,754 @@
export default `flf2a$ 4 4 8 0 14 0 8256
Graceful-6x4 by Mikhael Goikhman, http://migo.n3.net/, 20/Jan/2002.
Why did I make this font? Most of the figlet fonts are ugly for my taste.
Chars ".", "'" or "|" are not as graceful as "(", ")", "/", "\\" and "_".
Also most of the fonts unlike this one are either small or good, not both.
And finally, I wanted to have a strictly sized font, this one is 6x4.
I intended to create this elegant figlet font in 1996, but only in
January 2002 actually had the time to bring it to the working state. :)
Cyrillic letters are supported, maybe somewhen I will add hebrew latters.
To get a monospaced font 6x4, use "figlet -f graceful -m -1". Enjoy!
Permission is hereby given to modify this font, as long as the
modifier's name is added to this comment.
$$ @
$$ @
$$ @
$$ @@
_ @
/ \\ @
\\_/ @
(_) @@
_ _ @
(/(/ @
@
@@
_ _ @
/ )( \\@
) (@
\\_)(_/@@
____ @
/ (__)@
\\__ \\@
(__)_/@@
_ _ @
(// ) @
/ /_ @
(_/(/ @@
___ @
( _ \\@
/ _ /@
\\__\\_)@@
_ @
(/ @
@
@@
_ @
/ ) @
( ( @
\\_) @@
_ @
( \\ @
) ) @
(_/ @@
@
(\\/\\/)@
) ( @
(/\\/\\)@@
_ @
( ) @
(_ _) @
(_) @@
@
_ @
( ) @
(/ @@
@
___ @
(___) @
@@
@
@
_ @
(_) @@
_ @
/ ) @
/ / @
(_/ @@
__ @
/ \\ @
( 0 )@
\\__/ @@
__ @
/ \\ @
(_/ / @
(__) @@
____ @
(___ \\@
/ __/@
(____)@@
____ @
( __ \\@
(__ (@
(____/@@
___ @
/ _ \\@
(__ (@
(__/@@
___ @
/ __)@
(___ \\@
(____/@@
___ @
/ __)@
( _ \\@
\\___/@@
____ @
(__ )@
/ / @
(_/ @@
____ @
/ _ \\@
) _ (@
\\____/@@
___ @
/ _ \\ @
\\__ )@
(___/ @@
_ @
(_) @
_ @
(_) @@
_ @
(_) @
( ) @
(/ @@
__ @
/ / @
( ( @
\\_\\ @@
___ @
(___) @
___ @
(___) @@
__ @
\\ \\ @
) ) @
/_/ @@
___ @
(__ \\ @
(__/ @
(_) @@
___ @
/ \\@
( (__/@
\\___)@@
__ @
/ _\\ @
/ \\@
\\_/\\_/@@
____ @
( _ \\@
) _ (@
(____/@@
___ @
/ __)@
( (__ @
\\___)@@
____ @
( \\@
) D (@
(____/@@
____ @
( __)@
) _) @
(____)@@
____ @
( __)@
) _) @
(__) @@
___ @
/ __)@
( (_ \\@
\\___/@@
_ _ @
/ )( \\@
) __ (@
\\_)(_/@@
__ @
( ) @
)( @
(__) @@
__ @
_( )@
/ \\) \\@
\\____/@@
__ _ @
( / )@
) ( @
(__\\_)@@
__ @
( ) @
/ (_/\\@
\\____/@@
_ _ @
( \\/ )@
/ \\/ \\@
\\_)(_/@@
__ _ @
( ( \\@
/ /@
\\_)__)@@
__ @
/ \\ @
( O )@
\\__/ @@
____ @
( _ \\@
) __/@
(__) @@
__ @
/ \\ @
( O )@
\\__\\)@@
____ @
( _ \\@
) /@
(__\\_)@@
____ @
/ ___)@
\\___ \\@
(____/@@
____ @
(_ _)@
)( @
(__) @@
_ _ @
/ )( \\@
) \\/ (@
\\____/@@
_ _ @
/ )( \\@
\\ \\/ /@
\\__/ @@
_ _ @
/ )( \\@
\\ /\\ /@
(_/\\_)@@
_ _ @
( \\/ )@
) ( @
(_/\\_)@@
_ _ @
( \\/ )@
) / @
(__/ @@
____ @
(__ )@
/ _/ @
(____)@@
___ @
/ _) @
) (_ @
\\___) @@
_ @
( \\ @
\\ \\ @
\\_) @@
___ @
(_ \\@
_) (@
(___/@@
__ @
/ \\ @
(_/\\_)@
@@
@
@
____ @
(____)@@
_ @
\\) @
@
@@
__ @
/ _\\ @
/ \\@
\\_/\\_/@@
____ @
( _ \\@
) _ (@
(____/@@
___ @
/ __)@
( (__ @
\\___)@@
____ @
( \\@
) D (@
(____/@@
____ @
( __)@
) _) @
(____)@@
____ @
( __)@
) _) @
(__) @@
___ @
/ __)@
( (_ \\@
\\___/@@
_ _ @
/ )( \\@
) __ (@
\\_)(_/@@
__ @
( ) @
)( @
(__) @@
__ @
_( )@
/ \\) \\@
\\____/@@
__ _ @
( / )@
) ( @
(__\\_)@@
__ @
( ) @
/ (_/\\@
\\____/@@
_ _ @
( \\/ )@
/ \\/ \\@
\\_)(_/@@
__ _ @
( ( \\@
/ /@
\\_)__)@@
__ @
/ \\ @
( O )@
\\__/ @@
____ @
( _ \\@
) __/@
(__) @@
__ @
/ \\ @
( O )@
\\__\\)@@
____ @
( _ \\@
) /@
(__\\_)@@
____ @
/ ___)@
\\___ \\@
(____/@@
____ @
(_ _)@
)( @
(__) @@
_ _ @
/ )( \\@
) \\/ (@
\\____/@@
_ _ @
/ )( \\@
\\ \\/ /@
\\__/ @@
_ _ @
/ )( \\@
\\ /\\ /@
(_/\\_)@@
_ _ @
( \\/ )@
) ( @
(_/\\_)@@
_ _ @
( \\/ )@
) / @
(__/ @@
____ @
(__ )@
/ _/ @
(____)@@
___ @
( _)@
(_ (_ @
(___)@@
_ @
( \\ @
/ / @
\\_) @@
___ @
(_ ) @
_) _)@
(___) @@
__ @
(_ \\_ @
\\__)@
@@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
$ @
$ @
$ @
$ @@
0x0401 CYRILLIC CAPITAL LETTER IO
_--_ @
( __)@
) _) @
(____)@@
0x0410 CYRILLIC CAPITAL LETTER A
__ @
/ _\\ @
/ \\@
\\_/\\_/@@
0x0411 CYRILLIC CAPITAL LETTER BE
____ @
( __)@
) _ \\@
(____/@@
0x0412 CYRILLIC CAPITAL LETTER VE
____ @
( _ \\@
) _ (@
(____/@@
0x0413 CYRILLIC CAPITAL LETTER GHE
____ @
/ __)@
) ( @
\\_/ @@
0x0414 CYRILLIC CAPITAL LETTER DE
____ @
/ __ \\@
\\_ _/@
(_)(_)@@
0x0415 CYRILLIC CAPITAL LETTER IE
____ @
( __)@
) _) @
(____)@@
0x0416 CYRILLIC CAPITAL LETTER ZHE
_ _ @
/( ( \\@
) (@
\\_)_)/@@
0x0417 CYRILLIC CAPITAL LETTER ZE
____ @
( __ \\@
(__ (@
(____/@@
0x0418 CYRILLIC CAPITAL LETTER I
_ __ @
/ ) )@
\\ \\@
(__(_/@@
0x0419 CYRILLIC CAPITAL LETTER SHORT I
_ u_ @
/ ) )@
\\ \\@
(__(_/@@
0x041A CYRILLIC CAPITAL LETTER KA
__ _ @
( / )@
) ( @
(__\\_)@@
0x041B CYRILLIC CAPITAL LETTER EL
__ @
/ \\ @
/ /\\ \\@
\\_)(_/@@
0x041C CYRILLIC CAPITAL LETTER EM
_ _ @
( \\/ )@
/ \\/ \\@
\\_)(_/@@
0x041D CYRILLIC CAPITAL LETTER EN
_ _ @
/ )( \\@
) __ (@
\\_)(_/@@
0x041E CYRILLIC CAPITAL LETTER O
__ @
/ \\ @
( O )@
\\__/ @@
0x041F CYRILLIC CAPITAL LETTER PE
____ @
/ \\@
) /\\ (@
\\_)(_/@@
0x0420 CYRILLIC CAPITAL LETTER ER
____ @
( _ \\@
) __/@
(__) @@
0x0421 CYRILLIC CAPITAL LETTER ES
___ @
/ __)@
( (__ @
\\___)@@
0x0422 CYRILLIC CAPITAL LETTER TE
____ @
(_ _)@
)( @
(__) @@
0x0423 CYRILLIC CAPITAL LETTER U
_ _ @
( \\/ )@
) / @
(__/ @@
0x0424 CYRILLIC CAPITAL LETTER EF
____ @
/ __ \\@
\\_ _/@
(__) @@
0x0425 CYRILLIC CAPITAL LETTER HA
_ _ @
( \\/ )@
) ( @
(_/\\_)@@
0x0426 CYRILLIC CAPITAL LETTER TSE
_ _ @
/ \\( \\@
) (/ (@
\\___\\/@@
0x0427 CYRILLIC CAPITAL LETTER CHE
__ _ @
/ (/ \\@
\\__ (@
(__/@@
0x0428 CYRILLIC CAPITAL LETTER SHA
_ _ @
( ) ))@
/( ( \\@
\\____/@@
0x0429 CYRILLIC CAPITAL LETTER SHCHA
_ _ @
( ) ))@
/( ( \\@
\\___\\/@@
0x042A CYRILLIC CAPITAL LETTER HARD SIGN
__ @
(_ )_ @
/ _ \\@
\\___/@@
0x042B CYRILLIC CAPITAL LETTER YERU
_ _ @
( )( )@
/ _ \\\\@
\\___//@@
0x042C CYRILLIC CAPITAL LETTER SOFT SIGN
__ @
( )_ @
) _ \\@
(____/@@
0x042D CYRILLIC CAPITAL LETTER E
___ @
(__ \\ @
(_ )@
(___/ @@
0x042E CYRILLIC CAPITAL LETTER YU
_ __ @
/ / \\@
) O(@
\\_\\__/@@
0x042F CYRILLIC CAPITAL LETTER YA
____ @
/ _ )@
\\ \\@
(_/__/@@
0x0430 CYRILLIC SMALL LETTER A
__ @
/ _\\ @
/ \\@
\\_/\\_/@@
0x0431 CYRILLIC SMALL LETTER BE
____ @
( __)@
) _ \\@
(____/@@
0x0432 CYRILLIC SMALL LETTER VE
____ @
( _ \\@
) _ (@
(____/@@
0x0433 CYRILLIC SMALL LETTER GHE
____ @
/ __)@
) ( @
\\_/ @@
0x0434 CYRILLIC SMALL LETTER DE
____ @
/ __ \\@
\\_ _/@
(_)(_)@@
0x0435 CYRILLIC SMALL LETTER IE
____ @
( __)@
) _) @
(____)@@
0x0436 CYRILLIC SMALL LETTER ZHE
_ _ @
/( ( \\@
) (@
\\_)_)/@@
0x0437 CYRILLIC SMALL LETTER ZE
____ @
( __ \\@
(__ (@
(____/@@
0x0438 CYRILLIC SMALL LETTER I
_ __ @
/ ) )@
\\ \\@
(__(_/@@
0x0439 CYRILLIC SMALL LETTER SHORT I
_ u_ @
/ ) )@
\\ \\@
(__(_/@@
0x043A CYRILLIC SMALL LETTER KA
__ _ @
( / )@
) ( @
(__\\_)@@
0x043B CYRILLIC SMALL LETTER EL
__ @
/ \\ @
/ /\\ \\@
\\_)(_/@@
0x043C CYRILLIC SMALL LETTER EM
_ _ @
( \\/ )@
/ \\/ \\@
\\_)(_/@@
0x043D CYRILLIC SMALL LETTER EN
_ _ @
/ )( \\@
) __ (@
\\_)(_/@@
0x043E CYRILLIC SMALL LETTER O
__ @
/ \\ @
( O )@
\\__/ @@
0x043F CYRILLIC SMALL LETTER PE
____ @
/ \\@
) /\\ (@
\\_)(_/@@
0x0440 CYRILLIC SMALL LETTER ER
____ @
( _ \\@
) __/@
(__) @@
0x0441 CYRILLIC SMALL LETTER ES
___ @
/ __)@
( (__ @
\\___)@@
0x0442 CYRILLIC SMALL LETTER TE
____ @
(_ _)@
)( @
(__) @@
0x0443 CYRILLIC SMALL LETTER U
_ _ @
( \\/ )@
) / @
(__/ @@
0x0444 CYRILLIC SMALL LETTER EF
____ @
/ __ \\@
\\_ _/@
(__) @@
0x0445 CYRILLIC SMALL LETTER HA
_ _ @
( \\/ )@
) ( @
(_/\\_)@@
0x0446 CYRILLIC SMALL LETTER TSE
_ _ @
/ \\( \\@
) (/ (@
\\___\\/@@
0x0447 CYRILLIC SMALL LETTER CHE
__ _ @
/ (/ \\@
\\__ (@
(__/@@
0x0448 CYRILLIC SMALL LETTER SHA
_ _ @
( ) ))@
/( ( \\@
\\____/@@
0x0449 CYRILLIC SMALL LETTER SHCHA
_ _ @
( ) ))@
/( ( \\@
\\___\\/@@
0x044A CYRILLIC SMALL LETTER HARD SIGN
__ @
(_ )_ @
/ _ \\@
\\___/@@
0x044B CYRILLIC SMALL LETTER YERU
_ _ @
( )( )@
/ _ \\\\@
\\___//@@
0x044C CYRILLIC SMALL LETTER SOFT SIGN
__ @
( )_ @
) _ \\@
(____/@@
0x044D CYRILLIC SMALL LETTER E
___ @
(__ \\ @
(_ )@
(___/ @@
0x044E CYRILLIC SMALL LETTER YU
_ __ @
/ / \\@
) O(@
\\_\\__/@@
0x044F CYRILLIC SMALL LETTER YA
____ @
/ _ )@
\\ \\@
(_/__/@@
0x0451 CYRILLIC SMALL LETTER IO
_--_ @
( __)@
) _) @
(____)@@
`
@@ -0,0 +1 @@
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../src/pack.ts"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,qEAAqE;AACrE,+BAA+B;AAC/B,yDAAyD;AACzD,8CAA8C;AAC9C,+DAA+D;AAC/D,oCAAoC;AACpC,uEAAuE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvE,4CAAmC;AACnC,qDAIyB;AAEzB,MAAa,OAAO;IAClB,IAAI,CAAQ;IACZ,QAAQ,CAAQ;IAChB,KAAK,CAA6B;IAClC,IAAI,CAAQ;IACZ,OAAO,CAAW;IAClB,OAAO,GAAY,KAAK,CAAA;IACxB,WAAW,GAAY,KAAK,CAAA;IAC5B,MAAM,GAAY,KAAK,CAAA;IACvB,KAAK,GAAY,KAAK,CAAA;IACtB,YAAY,IAAY,EAAE,QAAgB;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AAdD,0BAcC;AAED,uCAAmC;AACnC,+CAAgC;AAChC,qCAAiC;AAGjC,qDAAyE;AAEzE,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AACzC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AACjC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;AACrC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACnC,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;AACjD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AAEjC,gDAAuB;AACvB,2EAAkE;AAGlE,MAAa,IACX,SAAQ,mBAAuD;IAG/D,IAAI,GAAY,KAAK,CAAA;IACrB,GAAG,CAAY;IACf,GAAG,CAAQ;IACX,WAAW,CAAS;IACpB,aAAa,CAAS;IACtB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,MAAM,CAAQ;IACd,SAAS,CAA6C;IACtD,SAAS,CAA6C;IACtD,IAAI,CAAQ;IACZ,QAAQ,CAAS;IACjB,GAAG,CAAsD;IACzD,YAAY,CAAgD;IAC5D,YAAY,CAAS;IACrB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,KAAK,CAAO;IACZ,MAAM,CAA0C;IAChD,IAAI,CAAS;IAEb,CAAC,eAAe,CAAC,CAA2C;IAC5D,YAAY,CAA+B;IAC3C,2DAA2D;IAC3D,mEAAmE;IACnE,mEAAmE;IACnE,qEAAqE;IACrE,wEAAwE;IACxE,sEAAsE;IACtE,qEAAqE;IACrE,wDAAwD;IACxD,CAAC,KAAK,CAAC,CAAmB;IAC1B,CAAC,YAAY,CAAC,GAAG,IAAI,GAAG,EAA2B,CAAC;IACpD,CAAC,IAAI,CAAC,GAAW,CAAC,CAAC;IACnB,CAAC,UAAU,CAAC,GAAY,KAAK,CAAC;IAC9B,CAAC,KAAK,CAAC,GAAY,KAAK,CAAA;IAExB,YAAY,MAAkB,EAAE;QAC9B,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,EAAE,CAAA;QAC1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;QACnC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAA;QAClC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,CAAC,aAAa,CAAA;QACxC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAA;QAC1B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG,IAAA,gDAAoB,EAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;QACpD,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,IAAI,GAAG,EAAE,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,IAAI,GAAG,EAAE,CAAA;QAC3C,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,IAAI,IAAI,GAAG,EAAE,CAAA;QACjD,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAA;QAEpC,IAAI,CAAC,eAAe,CAAC,GAAG,2BAAU,CAAA;QAClC,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACrC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;QAC7B,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAA;QAE9B,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACvC,IACE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9D,CAAC,EACD,CAAC;gBACD,MAAM,IAAI,SAAS,CAAC,2CAA2C,CAAC,CAAA;YAClE,CAAC;YACD,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;gBACb,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACjC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAA;gBACf,CAAC;gBACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;gBAC1B,CAAC;gBACD,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACpC,CAAC;YACD,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;gBACf,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACnC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAA;gBACjB,CAAC;gBACD,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAChD,CAAC;YACD,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;gBACb,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACjC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAA;gBACf,CAAC;gBACD,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC5C,CAAC;YACD,oBAAoB;YACpB,IAAI,CAAC,IAAI,CAAC,GAAG;gBAAE,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;YAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YACpB,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAA0B,CAAC,CAAC,CAAA;YAChE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;YAChC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;YACtC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;QACvC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,EAAE,CAAC,OAAO,EALine truncated
@@ -0,0 +1 @@
{"version":3,"file":"grid-2x2-plus.js","sources":["../../../src/icons/grid-2x2-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Grid2x2Plus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM3YxN2ExIDEgMCAwIDEtMSAxSDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJoMTRhMiAyIDAgMCAxIDIgMnY2YTEgMSAwIDAgMS0xIDFIMyIgLz4KICA8cGF0aCBkPSJNMTYgMTloNiIgLz4KICA8cGF0aCBkPSJNMTkgMjJ2LTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/grid-2x2-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 Grid2x2Plus = createLucideIcon('Grid2x2Plus', [\n [\n 'path',\n {\n d: 'M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3',\n key: '11za1p',\n },\n ],\n ['path', { d: 'M16 19h6', key: 'xwg31i' }],\n ['path', { d: 'M19 22v-6', key: 'qhmiwi' }],\n]);\n\nexport default Grid2x2Plus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAClD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,3 @@
declare const URLSearchParamsPlugin: any;
export default URLSearchParamsPlugin;
//# sourceMappingURL=url-search-params.d.ts.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_z"},B:{"1":"_J"},C:{"1":"_7F","2":"_5D"},D:{"1":"_5L","2":"_uF"},E:{"1":"_QB","2":"_TB"},F:{"1":"_a","2":"_T"},G:{"1":"_BB","2":"_OB"},H:{"2":"1D"},I:{"1":"_X","2":"_W"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"B","2":"A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:6,C:"Internationalization API",D:true};
@@ -0,0 +1,79 @@
'use strict';
// do not edit .js files directly - edit src/index.jst
var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
module.exports = function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == 'object' && typeof b == 'object') {
if (a.constructor !== b.constructor) return false;
var length, i, keys;
if (Array.isArray(a)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (!equal(a[i], b[i])) return false;
return true;
}
if ((a instanceof Map) && (b instanceof Map)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
for (i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
return true;
}
if ((a instanceof Set) && (b instanceof Set)) {
if (a.size !== b.size) return false;
for (i of a.entries())
if (!b.has(i[0])) return false;
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length = a.length;
if (length != b.length) return false;
for (i = length; i-- !== 0;)
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) return false;
for (i = length; i-- !== 0;)
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = length; i-- !== 0;) {
var key = keys[i];
if (key === '_owner' && a.$$typeof) {
// React-specific: avoid traversing React elements' _owner.
// _owner contains circular references
// and is not needed when comparing the actual elements (and not their owners)
continue;
}
if (!equal(a[key], b[key])) return false;
}
return true;
}
// true if both NaN, false otherwise
return a!==a && b!==b;
};
@@ -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 FileHeart = createLucideIcon("FileHeart", [
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2", key: "17k7jt" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
[
"path",
{
d: "M10.29 10.7a2.43 2.43 0 0 0-2.66-.52c-.29.12-.56.3-.78.53l-.35.34-.35-.34a2.43 2.43 0 0 0-2.65-.53c-.3.12-.56.3-.79.53-.95.94-1 2.53.2 3.74L6.5 18l3.6-3.55c1.2-1.21 1.14-2.8.19-3.74Z",
key: "1c1fso"
}
]
]);
export { FileHeart as default };
//# sourceMappingURL=file-heart.js.map
@@ -0,0 +1,13 @@
{
"$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
"description": "Meta-schema for $data reference (JSON AnySchema extension proposal)",
"type": "object",
"required": ["$data"],
"properties": {
"$data": {
"type": "string",
"anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}]
}
},
"additionalProperties": false
}
@@ -0,0 +1,186 @@
#!/usr/bin/env python3
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import os
import subprocess
import sys
import unittest
from unittest.mock import MagicMock, patch
import gyp.common
class TestTopologicallySorted(unittest.TestCase):
def test_Valid(self):
"""Test that sorting works on a valid graph with one possible order."""
graph = {
"a": ["b", "c"],
"b": [],
"c": ["d"],
"d": ["b"],
}
def GetEdge(node):
return tuple(graph[node])
assert gyp.common.TopologicallySorted(graph.keys(), GetEdge) == [
"a",
"c",
"d",
"b",
]
def test_Cycle(self):
"""Test that an exception is thrown on a cyclic graph."""
graph = {
"a": ["b"],
"b": ["c"],
"c": ["d"],
"d": ["a"],
}
def GetEdge(node):
return tuple(graph[node])
self.assertRaises(
gyp.common.CycleError, gyp.common.TopologicallySorted, graph.keys(), GetEdge
)
class TestGetFlavor(unittest.TestCase):
"""Test that gyp.common.GetFlavor works as intended"""
original_platform = ""
def setUp(self):
self.original_platform = sys.platform
def tearDown(self):
sys.platform = self.original_platform
def assertFlavor(self, expected, argument, param):
sys.platform = argument
assert expected == gyp.common.GetFlavor(param)
def test_platform_default(self):
self.assertFlavor("freebsd", "freebsd9", {})
self.assertFlavor("freebsd", "freebsd10", {})
self.assertFlavor("openbsd", "openbsd5", {})
self.assertFlavor("solaris", "sunos5", {})
self.assertFlavor("solaris", "sunos", {})
self.assertFlavor("linux", "linux2", {})
self.assertFlavor("linux", "linux3", {})
self.assertFlavor("linux", "linux", {})
def test_param(self):
self.assertFlavor("foobar", "linux2", {"flavor": "foobar"})
class MockCommunicate:
def __init__(self, stdout):
self.stdout = stdout
def decode(self, encoding):
return self.stdout
@patch("os.close")
@patch("os.unlink")
@patch("tempfile.mkstemp")
def test_GetCompilerPredefines(self, mock_mkstemp, mock_unlink, mock_close):
mock_close.return_value = None
mock_unlink.return_value = None
mock_mkstemp.return_value = (0, "temp.c")
def mock_run(env, defines_stdout, expected_cmd, throws=False):
with patch("subprocess.run") as mock_run:
expected_input = "temp.c" if sys.platform == "win32" else "/dev/null"
if throws:
mock_run.side_effect = subprocess.CalledProcessError(
returncode=1,
cmd=[*expected_cmd, "-dM", "-E", "-x", "c", expected_input],
)
else:
mock_process = MagicMock()
mock_process.returncode = 0
mock_process.stdout = TestGetFlavor.MockCommunicate(defines_stdout)
mock_run.return_value = mock_process
with patch.dict(os.environ, env):
try:
defines = gyp.common.GetCompilerPredefines()
except Exception as e:
self.fail(f"GetCompilerPredefines raised an exception: {e}")
flavor = gyp.common.GetFlavor({})
if env.get("CC_target") or env.get("CC"):
mock_run.assert_called_with(
[*expected_cmd, "-dM", "-E", "-x", "c", expected_input],
shell=sys.platform == "win32",
capture_output=True,
check=True,
)
return [defines, flavor]
[defines0, _] = mock_run({"CC": "cl.exe"}, "", ["cl.exe"], True)
assert defines0 == {}
[defines1, _] = mock_run({}, "", [])
assert defines1 == {}
[defines2, flavor2] = mock_run(
{"CC_target": "/opt/wasi-sdk/bin/clang"},
"#define __wasm__ 1\n#define __wasi__ 1\n",
["/opt/wasi-sdk/bin/clang"],
)
assert defines2 == {"__wasm__": "1", "__wasi__": "1"}
assert flavor2 == "wasi"
[defines3, flavor3] = mock_run(
{"CC_target": "/opt/wasi-sdk/bin/clang --target=wasm32"},
"#define __wasm__ 1\n",
["/opt/wasi-sdk/bin/clang", "--target=wasm32"],
)
assert defines3 == {"__wasm__": "1"}
assert flavor3 == "wasm"
[defines4, flavor4] = mock_run(
{"CC_target": "/emsdk/upstream/emscripten/emcc"},
"#define __EMSCRIPTEN__ 1\n",
["/emsdk/upstream/emscripten/emcc"],
)
assert defines4 == {"__EMSCRIPTEN__": "1"}
assert flavor4 == "emscripten"
# Test path which include white space
[defines5, flavor5] = mock_run(
{
"CC_target": '"/Users/Toyo Li/wasi-sdk/bin/clang" -O3',
"CFLAGS": "--target=wasm32-wasi-threads -pthread",
},
"#define __wasm__ 1\n#define __wasi__ 1\n#define _REENTRANT 1\n",
[
"/Users/Toyo Li/wasi-sdk/bin/clang",
"-O3",
"--target=wasm32-wasi-threads",
"-pthread",
],
)
assert defines5 == {"__wasm__": "1", "__wasi__": "1", "_REENTRANT": "1"}
assert flavor5 == "wasi"
original_sep = os.sep
os.sep = "\\"
[defines6, flavor6] = mock_run(
{"CC_target": '"C:\\Program Files\\wasi-sdk\\clang.exe"'},
"#define __wasm__ 1\n#define __wasi__ 1\n",
["C:/Program Files/wasi-sdk/clang.exe"],
)
os.sep = original_sep
assert defines6 == {"__wasm__": "1", "__wasi__": "1"}
assert flavor6 == "wasi"
if __name__ == "__main__":
unittest.main()
@@ -0,0 +1,24 @@
/**
* @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 MailQuestion = createLucideIcon("MailQuestion", [
["path", { d: "M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5", key: "e61zoh" }],
["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }],
[
"path",
{
d: "M18 15.28c.2-.4.5-.8.9-1a2.1 2.1 0 0 1 2.6.4c.3.4.5.8.5 1.3 0 1.3-2 2-2 2",
key: "7z9rxb"
}
],
["path", { d: "M20 22v.01", key: "12bgn6" }]
]);
export { MailQuestion as default };
//# sourceMappingURL=mail-question.js.map
@@ -0,0 +1,43 @@
{
"name": "optionator",
"version": "0.9.4",
"author": "George Zahariev <z@georgezahariev.com>",
"description": "option parsing and help generation",
"homepage": "https://github.com/gkz/optionator",
"keywords": [
"options",
"flags",
"option parsing",
"cli"
],
"files": [
"lib",
"README.md",
"LICENSE"
],
"main": "./lib/",
"bugs": "https://github.com/gkz/optionator/issues",
"license": "MIT",
"engines": {
"node": ">= 0.8.0"
},
"repository": {
"type": "git",
"url": "git://github.com/gkz/optionator.git"
},
"scripts": {
"test": "make test"
},
"dependencies": {
"prelude-ls": "^1.2.1",
"deep-is": "^0.1.3",
"word-wrap": "^1.2.5",
"type-check": "^0.4.0",
"levn": "^0.4.1",
"fast-levenshtein": "^2.0.6"
},
"devDependencies": {
"livescript": "^1.6.0",
"mocha": "^10.4.0"
}
}
@@ -0,0 +1,68 @@
{
"name": "@radix-ui/react-primitive",
"version": "2.1.7",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/react-slot": "1.3.0"
},
"devDependencies": {
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"typescript": "^5.9.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git",
"directory": "packages/react/primitive"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "oxlint --max-warnings 0 src",
"clean": "rm -rf dist",
"reset": "rm -rf dist node_modules",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,25 @@
/**
* @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 Pizza = createLucideIcon("Pizza", [
["path", { d: "m12 14-1 1", key: "11onhr" }],
["path", { d: "m13.75 18.25-1.25 1.42", key: "1yisr3" }],
["path", { d: "M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12", key: "1qtqk6" }],
["path", { d: "M18.8 9.3a1 1 0 0 0 2.1 7.7", key: "fbbbr2" }],
[
"path",
{
d: "M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z",
key: "1hyfdd"
}
]
]);
export { Pizza as default };
//# sourceMappingURL=pizza.js.map
@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @internal
*/
const inverted = Symbol('inverted');
/**
* @internal
*/
const expectNull = Symbol('expectNull');
/**
* @internal
*/
const expectUndefined = Symbol('expectUndefined');
/**
* @internal
*/
const expectNumber = Symbol('expectNumber');
/**
* @internal
*/
const expectString = Symbol('expectString');
/**
* @internal
*/
const expectBoolean = Symbol('expectBoolean');
/**
* @internal
*/
const expectVoid = Symbol('expectVoid');
/**
* @internal
*/
const expectFunction = Symbol('expectFunction');
/**
* @internal
*/
const expectObject = Symbol('expectObject');
/**
* @internal
*/
const expectArray = Symbol('expectArray');
/**
* @internal
*/
const expectSymbol = Symbol('expectSymbol');
/**
* @internal
*/
const expectAny = Symbol('expectAny');
/**
* @internal
*/
const expectUnknown = Symbol('expectUnknown');
/**
* @internal
*/
const expectNever = Symbol('expectNever');
/**
* @internal
*/
const expectNullable = Symbol('expectNullable');
/**
* @internal
*/
const expectBigInt = Symbol('expectBigInt');
@@ -0,0 +1,733 @@
export default `flf2a$ 7 7 11 -1 16 0 0 0
Author :myflix
Date : 2006/4/6 7:38:43
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 May 26, 2012 by patorjk
Made modifications to the "JK" characters.
$ #
$ #
$ #
$ #
$ #
$ #
$ ##
__ #
| | #
| | #
| | #
|__| #
__ #
|__| ##
_ _ #
| || | #
|_||_| #
#
#
#
##
##
#
#
#
#
#
##
$#
#
#
#
#
#
##
%#
#
#
#
#
#
##
&#
#
#
#
#
#
##
__ #
| | #
|__| #
#
#
#
##
____ #
| | #
| _| #
| | #
| | #
| |_ #
|____| ##
____ #
| | #
|_ | #
| | #
| | #
_| | #
|____| ##
*#
#
#
#
#
#
##
_ #
_| |_ #
|_ _| #
|_| #
#
#
##
#
#
#
#
___ #
|_ | #
|_| ##
#
#
____ #
|____| #
#
#
##
#
#
#
#
___ #
| | #
|___| ##
/#
#
#
#
#
#
##
_______ #
| _ |#
| | | |#
| | | |#
| |_| |#
| |#
|_______|##
____ #
| | #
| | #
| | #
| | #
| | #
|___| ##
_______ #
| |#
|____ |#
____| |#
| ______|#
| |_____ #
|_______|##
_______ #
| |#
|___ |#
___| |#
|___ |#
___| |#
|_______|##
_ ___ #
| | | |#
| |_| |#
| |#
|___ |#
| |#
|___|##
_______ #
| |#
| ____|#
| |____ #
|_____ |#
_____| |#
|_______|##
___ #
| | #
| |___ #
| _ |#
| | | |#
| |_| |#
|_______|##
_______ #
| |#
|___ |#
| |#
| |#
| |#
|___|##
_____ #
| _ | #
| |_| | #
| _ |#
| | | |#
| |_| |#
|_______|##
_______ #
| _ |#
| | | |#
| |_| |#
|___ |#
| |#
|___|##
___ #
| | #
|___| #
___ #
| | #
|___| #
##
___ #
| | #
|___| #
___ #
|_ | #
|_| #
##
<#
#
#
#
#
#
##
____ #
|____| #
____ #
|____| #
#
#
##
>#
#
#
#
#
#
##
______ #
| | #
|___ | #
__| | #
|_____| #
__ #
|__| ##
@#
#
#
#
#
#
##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| _ |#
| |_| |#
| |#
| _ | #
| |_| |#
|_______|##
_______ #
| |#
| |#
| |#
| _|#
| |_ #
|_______|##
______ #
| | #
| _ |#
| | | |#
| |_| |#
| |#
|______| ##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| |___ #
|_______|##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| | #
|___| ##
_______ #
| |#
| ___|#
| | __ #
| || |#
| |_| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
___ #
| | #
| | #
| | #
| | #
| | #
|___| ##
___ #
| |#
| |#
| |#
___| |#
| |#
|_______|##
___ _ #
| | | |#
| |_| |#
| _|#
| |_ #
| _ |#
|___| |_|##
___ #
| | #
| | #
| | #
| |___ #
| |#
|_______|##
__ __ #
| |_| |#
| |#
| |#
| |#
| ||_|| |#
|_| |_|##
__ _ #
| | | |#
| |_| |#
| |#
| _ |#
| | | |#
|_| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
_______ #
| |#
| _ |#
| |_| |#
| ___|#
| | #
|___| ##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| | #
|____||_|##
______ #
| _ | #
| | || #
| |_||_ #
| __ |#
| | | |#
|___| |_|##
_______ #
| |#
| _____|#
| |_____ #
|_____ |#
_____| |#
|_______|##
_______ #
| |#
|_ _|#
| | #
| | #
| | #
|___| ##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| | #
|___| ##
_ _ #
| | _ | |#
| || || |#
| |#
| |#
| _ |#
|__| |__|##
__ __ #
| |_| |#
| |#
| |#
| | #
| _ |#
|__| |__|##
__ __ #
| | | |#
| |_| |#
| |#
|_ _|#
| | #
|___| ##
_______ #
| |#
|____ |#
____| |#
| ______|#
| |_____ #
|_______|##
_____ #
| | #
| _| #
| | #
| | #
| |_ #
|_____| ##
\\#
#
#
#
#
#
##
_____ #
| | #
|_ | #
| | #
| | #
_| | #
|_____| ##
___ #
| | #
| _ | #
|_| |_| #
#
#
##
#
#
#
#
#
_____ #
|_____| ##
___ #
| | #
|_ | #
|__| #
#
#
##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| _ |#
| |_| |#
| |#
| _ | #
| |_| |#
|_______|##
_______ #
| |#
| |#
| |#
| _|#
| |_ #
|_______|##
______ #
| | #
| _ |#
| | | |#
| |_| |#
| |#
|______| ##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| |___ #
|_______|##
_______ #
| |#
| ___|#
| |___ #
| ___|#
| | #
|___| ##
_______ #
| |#
| ___|#
| | __ #
| || |#
| |_| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
___ #
| | #
| | #
| | #
| | #
| | #
|___| ##
___ #
| |#
| |#
| |#
___| |#
| |#
|_______|##
___ _ #
| | | |#
| |_| |#
| _|#
| |_ #
| _ |#
|___| |_|##
___ #
| | #
| | #
| | #
| |___ #
| |#
|_______|##
__ __ #
| |_| |#
| |#
| |#
| |#
| ||_|| |#
|_| |_|##
__ _ #
| | | |#
| |_| |#
| |#
| _ |#
| | | |#
|_| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
_______ #
| |#
| _ |#
| |_| |#
| ___|#
| | #
|___| ##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| | #
|____||_|##
______ #
| _ | #
| | || #
| |_||_ #
| __ |#
| | | |#
|___| |_|##
_______ #
| |#
| _____|#
| |_____ #
|_____ |#
_____| |#
|_______|##
_______ #
| |#
|_ _|#
| | #
| | #
| | #
|___| ##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
__ __ #
| | | |#
| |_| |#
| |#
| |#
| | #
|___| ##
_ _ #
| | _ | |#
| || || |#
| |#
| |#
| _ |#
|__| |__|##
__ __ #
| |_| |#
| |#
| |#
| | #
| _ |#
|__| |__|##
__ __ #
| | | |#
| |_| |#
| |#
|_ _|#
| | #
|___| ##
_______ #
| |#
|____ |#
____| |#
| ______|#
| |_____ #
|_______|##
{#
#
#
#
#
#
##
|#
#
#
#
#
#
##
}#
#
#
#
#
#
##
~#
#
#
#
#
#
##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
_______ #
| _ |#
| |_| |#
| |#
| |#
| _ |#
|__| |__|##
_______ #
| |#
| _ |#
| | | |#
| |_| |#
| |#
|_______|##
__ __ #
| | | |#
| | | |#
| |_| |#
| |#
| |#
|_______|##
�#
#
#
#
#
#
##
`
@@ -0,0 +1,25 @@
/**
* @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 BookDashed = createLucideIcon("BookDashed", [
["path", { d: "M12 17h1.5", key: "1gkc67" }],
["path", { d: "M12 22h1.5", key: "1my7sn" }],
["path", { d: "M12 2h1.5", key: "19tvb7" }],
["path", { d: "M17.5 22H19a1 1 0 0 0 1-1", key: "10akbh" }],
["path", { d: "M17.5 2H19a1 1 0 0 1 1 1v1.5", key: "1vrfjs" }],
["path", { d: "M20 14v3h-2.5", key: "1naeju" }],
["path", { d: "M20 8.5V10", key: "1ctpfu" }],
["path", { d: "M4 10V8.5", key: "1o3zg5" }],
["path", { d: "M4 19.5V14", key: "ob81pf" }],
["path", { d: "M4 4.5A2.5 2.5 0 0 1 6.5 2H8", key: "s8vcyb" }],
["path", { d: "M8 22H6.5a1 1 0 0 1 0-5H8", key: "1cu73q" }]
]);
export { BookDashed as default };
//# sourceMappingURL=book-dashed.js.map
@@ -0,0 +1,20 @@
// Vitest resolves "vitest/browser" as a virtual module instead
// fake exports for static analysis
export const page = null
export const server = null
export const userEvent = null
export const cdp = null
export const commands = null
export const locators = null
export const utils = null
const pool = globalThis.__vitest_worker__?.ctx?.pool
throw new Error(
// eslint-disable-next-line prefer-template
'vitest/browser can be imported only inside the Browser Mode. '
+ (pool
? `Your test is running in ${pool} pool. Make sure your regular tests are excluded from the "test.include" glob pattern.`
: 'Instead, it was imported outside of Vitest.'),
)
@@ -0,0 +1,76 @@
'use strict';
var _const = require('../data/const.cjs');
var utils = require('./utils.cjs');
var scoring$8 = require('../matcher/bruteforce/scoring.cjs');
var scoring$7 = require('../matcher/date/scoring.cjs');
var scoring$6 = require('../matcher/dictionary/scoring.cjs');
var scoring$5 = require('../matcher/regex/scoring.cjs');
var scoring$4 = require('../matcher/repeat/scoring.cjs');
var scoring$3 = require('../matcher/sequence/scoring.cjs');
var scoring$2 = require('../matcher/spatial/scoring.cjs');
var scoring$1 = require('../matcher/separator/scoring.cjs');
var scoring = require('../matcher/wordSequence/scoring.cjs');
const getMinGuesses = (match, password) => {
let minGuesses = 1;
if (match.token.length < password.length) {
if (match.token.length === 1) {
minGuesses = _const.MIN_SUBMATCH_GUESSES_SINGLE_CHAR;
} else {
minGuesses = _const.MIN_SUBMATCH_GUESSES_MULTI_CHAR;
}
}
return minGuesses;
};
const matchers = {
bruteforce: scoring$8,
date: scoring$7,
dictionary: scoring$6,
regex: scoring$5,
repeat: scoring$4,
sequence: scoring$3,
spatial: scoring$2,
separator: scoring$1,
wordSequence: scoring
};
const getScoring = (options, name, match) => {
if (matchers[name]) {
return matchers[name](match, options);
}
if (options.matchers[name] && 'scoring' in options.matchers[name]) {
return options.matchers[name].scoring(match, options);
}
return 0;
};
// ------------------------------------------------------------------------------
// guess estimation -- one function per match pattern ---------------------------
// ------------------------------------------------------------------------------
var estimateGuesses = (options, match, password) => {
const extraData = {};
// a match's guess estimate doesn't change. cache it.
if ('guesses' in match && match.guesses != null) {
return match;
}
const minGuesses = getMinGuesses(match, password);
const estimationResult = getScoring(options, match.pattern, match);
let guesses = 0;
if (typeof estimationResult === 'number') {
guesses = estimationResult;
} else if (match.pattern === 'dictionary') {
guesses = estimationResult.calculation;
extraData.baseGuesses = estimationResult.baseGuesses;
extraData.uppercaseVariations = estimationResult.uppercaseVariations;
extraData.l33tVariations = estimationResult.l33tVariations;
}
const matchGuesses = Math.max(guesses, minGuesses);
return {
...match,
...extraData,
guesses: matchGuesses,
guessesLog10: utils.log10(matchGuesses)
};
};
module.exports = estimateGuesses;
//# sourceMappingURL=estimate.cjs.map
@@ -0,0 +1,140 @@
import { a as namespaces, i as enabled, n as disable, o as humanize, r as enable$1, s as selectColor, t as createDebug$1 } from "./core.js";
const colors = [
"#0000CC",
"#0000FF",
"#0033CC",
"#0033FF",
"#0066CC",
"#0066FF",
"#0099CC",
"#0099FF",
"#00CC00",
"#00CC33",
"#00CC66",
"#00CC99",
"#00CCCC",
"#00CCFF",
"#3300CC",
"#3300FF",
"#3333CC",
"#3333FF",
"#3366CC",
"#3366FF",
"#3399CC",
"#3399FF",
"#33CC00",
"#33CC33",
"#33CC66",
"#33CC99",
"#33CCCC",
"#33CCFF",
"#6600CC",
"#6600FF",
"#6633CC",
"#6633FF",
"#66CC00",
"#66CC33",
"#9900CC",
"#9900FF",
"#9933CC",
"#9933FF",
"#99CC00",
"#99CC33",
"#CC0000",
"#CC0033",
"#CC0066",
"#CC0099",
"#CC00CC",
"#CC00FF",
"#CC3300",
"#CC3333",
"#CC3366",
"#CC3399",
"#CC33CC",
"#CC33FF",
"#CC6600",
"#CC6633",
"#CC9900",
"#CC9933",
"#CCCC00",
"#CCCC33",
"#FF0000",
"#FF0033",
"#FF0066",
"#FF0099",
"#FF00CC",
"#FF00FF",
"#FF3300",
"#FF3333",
"#FF3366",
"#FF3399",
"#FF33CC",
"#FF33FF",
"#FF6600",
"#FF6633",
"#FF9900",
"#FF9933",
"#FFCC00",
"#FFCC33"
];
function formatArgs(diff, args) {
const { useColors } = this;
args[0] = `${(useColors ? "%c" : "") + this.namespace + (useColors ? " %c" : " ") + args[0] + (useColors ? "%c " : " ")}+${this.humanize(diff)}`;
if (!useColors) return;
const c = `color: ${this.color}`;
args.splice(1, 0, c, "color: inherit");
let index = 0;
let lastC = 0;
args[0].replace(/%[a-z%]/gi, (match) => {
if (match === "%%") return;
index++;
if (match === "%c") lastC = index;
});
args.splice(lastC, 0, c);
}
const log = console.debug || console.log || (() => {});
const storage = localstorage();
const defaultOptions = {
useColors: true,
formatArgs,
formatters: { j(v) {
try {
return JSON.stringify(v);
} catch (error) {
return `[UnexpectedJSONParseError]: ${error.message}`;
}
} },
inspectOpts: {},
humanize,
log
};
function createDebug(namespace, options) {
var _ref;
const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
return createDebug$1(namespace, Object.assign(defaultOptions, { color }, options));
}
function localstorage() {
try {
return localStorage;
} catch (_unused) {}
}
function load() {
let r;
try {
r = storage.getItem("debug") || storage.getItem("DEBUG");
} catch (_unused2) {}
if (!r && typeof process !== "undefined" && "env" in process) r = process.env.DEBUG;
return r || "";
}
function save(namespaces$1) {
try {
if (namespaces$1) storage.setItem("debug", namespaces$1);
else storage.removeItem("debug");
} catch (_unused3) {}
}
function enable(namespaces$1) {
save(namespaces$1);
enable$1(namespaces$1);
}
enable$1(load());
export { createDebug, disable, enable, enabled, namespaces };
@@ -0,0 +1 @@
{"version":3,"file":"ticket.js","sources":["../../../src/icons/ticket.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Ticket\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA5YTMgMyAwIDAgMSAwIDZ2MmEyIDIgMCAwIDAgMiAyaDE2YTIgMiAwIDAgMCAyLTJ2LTJhMyAzIDAgMCAxIDAtNlY3YTIgMiAwIDAgMC0yLTJINGEyIDIgMCAwIDAtMiAyWiIgLz4KICA8cGF0aCBkPSJNMTMgNXYyIiAvPgogIDxwYXRoIGQ9Ik0xMyAxN3YyIiAvPgogIDxwYXRoIGQ9Ik0xMyAxMXYyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ticket\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 Ticket = createLucideIcon('Ticket', [\n [\n 'path',\n {\n d: 'M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z',\n key: 'qn84l0',\n },\n ],\n ['path', { d: 'M13 5v2', key: 'dyzc3o' }],\n ['path', { d: 'M13 17v2', key: '1ont0d' }],\n ['path', { d: 'M13 11v2', key: '1wjjxi' }],\n]);\n\nexport default Ticket;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,87 @@
// @ts-ignore TS6133
import { test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
test("first party switch", () => {
const myType = z.string() as z.ZodFirstPartySchemaTypes;
const def = myType._def;
switch (def.typeName) {
case z.ZodFirstPartyTypeKind.ZodString:
break;
case z.ZodFirstPartyTypeKind.ZodNumber:
break;
case z.ZodFirstPartyTypeKind.ZodNaN:
break;
case z.ZodFirstPartyTypeKind.ZodBigInt:
break;
case z.ZodFirstPartyTypeKind.ZodBoolean:
break;
case z.ZodFirstPartyTypeKind.ZodDate:
break;
case z.ZodFirstPartyTypeKind.ZodUndefined:
break;
case z.ZodFirstPartyTypeKind.ZodNull:
break;
case z.ZodFirstPartyTypeKind.ZodAny:
break;
case z.ZodFirstPartyTypeKind.ZodUnknown:
break;
case z.ZodFirstPartyTypeKind.ZodNever:
break;
case z.ZodFirstPartyTypeKind.ZodVoid:
break;
case z.ZodFirstPartyTypeKind.ZodArray:
break;
case z.ZodFirstPartyTypeKind.ZodObject:
break;
case z.ZodFirstPartyTypeKind.ZodUnion:
break;
case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
break;
case z.ZodFirstPartyTypeKind.ZodIntersection:
break;
case z.ZodFirstPartyTypeKind.ZodTuple:
break;
case z.ZodFirstPartyTypeKind.ZodRecord:
break;
case z.ZodFirstPartyTypeKind.ZodMap:
break;
case z.ZodFirstPartyTypeKind.ZodSet:
break;
case z.ZodFirstPartyTypeKind.ZodFunction:
break;
case z.ZodFirstPartyTypeKind.ZodLazy:
break;
case z.ZodFirstPartyTypeKind.ZodLiteral:
break;
case z.ZodFirstPartyTypeKind.ZodEnum:
break;
case z.ZodFirstPartyTypeKind.ZodEffects:
break;
case z.ZodFirstPartyTypeKind.ZodNativeEnum:
break;
case z.ZodFirstPartyTypeKind.ZodOptional:
break;
case z.ZodFirstPartyTypeKind.ZodNullable:
break;
case z.ZodFirstPartyTypeKind.ZodDefault:
break;
case z.ZodFirstPartyTypeKind.ZodCatch:
break;
case z.ZodFirstPartyTypeKind.ZodPromise:
break;
case z.ZodFirstPartyTypeKind.ZodBranded:
break;
case z.ZodFirstPartyTypeKind.ZodPipeline:
break;
case z.ZodFirstPartyTypeKind.ZodSymbol:
break;
case z.ZodFirstPartyTypeKind.ZodReadonly:
break;
default:
util.assertNever(def);
}
});
@@ -0,0 +1 @@
module.exports={C:{"48":0.00541,"52":0.02703,"68":0.03243,"78":0.01622,"92":0.00541,"99":0.00541,"104":0.00541,"113":0.00541,"115":0.48645,"120":0.04324,"121":0.08108,"124":0.00541,"125":0.00541,"128":0.01622,"130":0.00541,"133":0.00541,"134":0.00541,"135":0.00541,"136":0.00541,"137":0.01081,"139":0.00541,"140":1.03776,"141":0.00541,"142":0.00541,"143":0.00541,"144":0.03243,"145":0.00541,"146":0.01081,"147":0.01622,"148":0.02162,"149":0.01622,"150":0.02703,"151":0.03243,"152":0.07567,"153":0.15134,"154":0.58915,"155":2.62683,"156":2.86465,"157":0.09189,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 100 101 102 103 105 106 107 108 109 110 111 112 114 116 117 118 119 122 123 126 127 129 131 132 138 158 159 160 3.5 3.6"},D:{"69":0.00541,"80":0.01081,"87":0.00541,"88":0.00541,"101":0.00541,"103":0.02703,"104":0.02162,"105":0.03243,"106":0.02162,"107":0.02162,"108":0.02162,"109":0.28106,"110":0.02162,"111":0.02703,"112":0.02162,"114":0.01081,"116":0.08648,"117":0.02162,"118":0.07567,"119":0.09189,"120":0.13513,"121":0.00541,"122":0.01622,"123":0.00541,"124":0.04324,"125":0.01081,"126":0.00541,"127":0.00541,"128":0.02162,"129":0.00541,"130":0.00541,"131":0.05405,"132":0.00541,"133":0.07567,"134":0.04324,"135":0.04324,"136":0.06486,"137":0.04865,"138":0.1081,"139":0.06486,"140":0.09189,"141":0.07567,"142":0.17837,"143":0.01622,"144":0.05946,"145":0.05405,"146":0.05405,"147":0.05405,"148":0.11891,"149":0.14053,"150":0.57293,"151":1.35666,"152":6.95624,"153":8.88042,"154":2.162,"155":0.03784,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 79 81 83 84 85 86 89 90 91 92 93 94 95 96 97 98 99 100 102 113 115 156 157"},F:{"46":0.00541,"85":0.00541,"95":0.02703,"100":0.00541,"101":0.04324,"102":0.00541,"131":0.00541,"133":0.01081,"134":0.16756,"135":2.08633,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 86 87 88 89 90 91 92 93 94 96 97 98 99 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"84":0.00541,"92":0.00541,"109":0.08108,"119":0.04324,"120":0.04324,"122":0.01081,"126":0.00541,"132":0.00541,"133":0.00541,"135":0.01622,"137":0.00541,"138":0.00541,"139":0.00541,"140":0.02703,"141":0.00541,"142":0.01081,"143":0.02162,"144":0.00541,"145":0.02162,"146":0.02703,"147":0.01622,"148":0.03784,"149":0.04324,"150":0.15675,"151":0.44862,"152":3.50244,"153":5.84821,"154":1.75663,_:"12 13 14 15 16 17 18 79 80 81 83 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 127 128 129 130 131 134 136"},E:{"14":0.01081,"15":0.01081,"27":0.35673,_:"4 5 6 7 8 9 10 11 12 13 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.1 15.2-15.3 15.5 17.0 27.1 27.2 TP","12.1":0.00541,"13.1":0.04865,"14.1":0.01081,"15.4":0.00541,"15.6":0.14053,"16.0":0.00541,"16.1":0.00541,"16.2":0.01081,"16.3":0.00541,"16.4":0.01081,"16.5":0.00541,"16.6":0.16756,"17.1":0.18377,"17.2":0.02703,"17.3":0.00541,"17.4":0.03243,"17.5":0.03784,"17.6":0.19458,"18.0":0.00541,"18.1":0.01622,"18.2":0.00541,"18.3":0.03784,"18.4":0.02162,"18.5-18.7":0.06486,"26.0":0.02703,"26.1":0.04324,"26.2":0.07027,"26.3":0.12432,"26.4":0.11351,"26.5":0.49726,"26.6":2.36739},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00169,"5.0-5.1":0.00169,"6.0-6.1":0,"7.0-7.1":0.00338,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01688,"11.0-11.2":0.00169,"11.3-11.4":0.00338,"12.0-12.1":0,"12.2-12.5":0.04388,"13.0-13.1":0,"13.2":0.00844,"13.3":0,"13.4-13.7":0.00169,"14.0-14.4":0.00675,"14.5-14.8":0.01013,"15.0-15.1":0.01013,"15.2-15.3":0.00675,"15.4":0.00844,"15.5":0.01013,"15.6-15.8":0.21941,"16.0":0.01688,"16.1":0.03038,"16.2":0.01688,"16.3":0.03713,"16.4":0.00844,"16.5":0.0135,"16.6-16.7":0.30548,"17.0":0.01181,"17.1":0.01688,"17.2":0.01688,"17.3":0.02532,"17.4":0.03544,"17.5":0.0692,"17.6-17.7":0.1789,"18.0":0.03713,"18.1":0.07426,"18.2":0.10126,"18.3":0.17553,"18.4":0.1097,"18.5-18.7":2.26664,"26.0":0.1097,"26.1":0.11139,"26.2":0.29029,"26.3":0.31392,"26.4":0.22953,"26.5":1.53753,"26.6":9.48681,"27.0":0.72742,"27.1":0,"27.2":0.01857},P:{"4":0.02753,"21":0.00918,"22":0.00918,"23":0.01836,"24":0.01836,"25":0.00918,"26":0.04589,"27":0.01836,"28":0.05507,"29":0.14685,"30":3.1205,_:"20 5.0-5.4 6.2-6.4 7.2-7.4 8.2 10.1 11.1-11.2 12.0 13.0 14.0 16.0 17.0 18.0 19.0","9.2":0.00918,"15.0":0.00918},I:{"0":0.01378,"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"Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"pin.js","sources":["../../../src/icons/pin.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Pin\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTd2NSIgLz4KICA8cGF0aCBkPSJNOSAxMC43NmEyIDIgMCAwIDEtMS4xMSAxLjc5bC0xLjc4LjlBMiAyIDAgMCAwIDUgMTUuMjRWMTZhMSAxIDAgMCAwIDEgMWgxMmExIDEgMCAwIDAgMS0xdi0uNzZhMiAyIDAgMCAwLTEuMTEtMS43OWwtMS43OC0uOUEyIDIgMCAwIDEgMTUgMTAuNzZWN2ExIDEgMCAwIDEgMS0xIDIgMiAwIDAgMCAwLTRIOGEyIDIgMCAwIDAgMCA0IDEgMSAwIDAgMSAxIDF6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/pin\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 Pin = createLucideIcon('Pin', [\n ['path', { d: 'M12 17v5', key: 'bb1du9' }],\n [\n 'path',\n {\n d: 'M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z',\n key: '1nkz8b',\n },\n ],\n]);\n\nexport default Pin;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,92 @@
import { MiddlewareHandler } from "../../types.js";
//#region src/middleware/trailing-slash/index.d.ts
type TrimTrailingSlashOptions = {
/**
* If `true`, the middleware will always redirect requests with a trailing slash
* before executing handlers.
* This is useful for routes with wildcards (`*`).
* If `false` (default), it will only redirect when the route is not found (404).
* @default false
*/
alwaysRedirect?: boolean;
};
/**
* Trailing Slash Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash}
*
* @param {TrimTrailingSlashOptions} options - The options for the middleware.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use(trimTrailingSlash())
* app.get('/about/me/', (c) => c.text('With Trailing Slash'))
* ```
*
* @example
* ```ts
* // With alwaysRedirect option for wildcard routes
* const app = new Hono()
*
* app.use(trimTrailingSlash({ alwaysRedirect: true }))
* app.get('/my-path/*', (c) => c.text('Wildcard route'))
* ```
*/
export declare const trimTrailingSlash: (options?: TrimTrailingSlashOptions) => MiddlewareHandler;
type AppendTrailingSlashOptions = {
/**
* If `true`, the middleware will always redirect requests without a trailing slash
* before executing handlers.
* This is useful for routes with wildcards (`*`).
* If `false` (default), it will only redirect when the route is not found (404).
* @default false
*/
alwaysRedirect?: boolean;
/**
* A function that determines whether to skip the redirect for a given path.
* If the function returns `true`, the redirect will be skipped.
* @param path - The request path
* @returns `true` to skip the redirect
*
* @example
* ```ts
* // Skip redirect for paths with file extensions
* app.use(appendTrailingSlash({
* alwaysRedirect: true,
* skip: (path) => /\.\w+$/.test(path),
* }))
* ```
*/
skip?: (path: string) => boolean;
};
/**
* Append trailing slash middleware for Hono.
* Append a trailing slash to the URL if it doesn't have one. For example, `/path/to/page` will be redirected to `/path/to/page/`.
*
* @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash}
*
* @param {AppendTrailingSlashOptions} options - The options for the middleware.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use(appendTrailingSlash())
* ```
*
* @example
* ```ts
* // With alwaysRedirect option for wildcard routes
* const app = new Hono()
*
* app.use(appendTrailingSlash({ alwaysRedirect: true }))
* app.get('/my-path/*', (c) => c.text('Wildcard route'))
* ```
*/
export declare const appendTrailingSlash: (options?: AppendTrailingSlashOptions) => MiddlewareHandler;
//#endregion
export {};
@@ -0,0 +1,4 @@
const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
export { cubicBezierAsString };
//# sourceMappingURL=cubic-bezier.mjs.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_decorators: LibDefinition;
@@ -0,0 +1,77 @@
# flat-cache
> A stupidly simple key/value storage using files to persist the data
[![NPM Version](https://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache)
[![tests](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/github/jaredwray/flat-cache/branch/master/graph/badge.svg?token=KxR95XT3NF)](https://codecov.io/github/jaredwray/flat-cache)
[![npm](https://img.shields.io/npm/dm/flat-cache)](https://npmjs.com/package/flat-cache)
## install
```bash
npm i --save flat-cache
```
## Usage
```js
const flatCache = require('flat-cache');
// loads the cache, if one does not exists for the given
// Id a new one will be prepared to be created
const cache = flatCache.load('cacheId');
// sets a key on the cache
cache.setKey('key', { foo: 'var' });
// get a key from the cache
cache.getKey('key'); // { foo: 'var' }
// fetch the entire persisted object
cache.all(); // { 'key': { foo: 'var' } }
// remove a key
cache.removeKey('key'); // removes a key from the cache
// save it to disk
cache.save(); // very important, if you don't save no changes will be persisted.
// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys
// loads the cache from a given directory, if one does
// not exists for the given Id a new one will be prepared to be created
const cache = flatCache.load('cacheId', path.resolve('./path/to/folder'));
// The following methods are useful to clear the cache
// delete a given cache
flatCache.clearCacheById('cacheId'); // removes the cacheId document if one exists.
// delete all cache
flatCache.clearAll(); // remove the cache directory
```
## Motivation for this module
I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make
a script that will beutify files with `esformatter` only execute on the files that were changed since the last run.
To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value`
storage was needed and Bam! this module was born.
## Important notes
- If no directory is especified when the `load` method is called, a folder named `.cache` will be created
inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you
might want to ignore the default `.cache` folder, or specify a custom directory.
- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references
- All the changes to the cache state are done to memory
- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module
intentionally dumb and simple
- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call
like: `cache.save( true /* noPrune */ )`.
## License
MIT
## Changelog
[changelog](./changelog.md)
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_eJ","2":"_H _eU _nC _nD _zE","132":"_wL _BE","164":"_vL"},D:{"1":"_4J","2":"_9J","66":"uB"},E:{"2":"_R"},F:{"1":"_3G","2":"_YI"},G:{"2":"_M"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"LE","2":"ME"}},B:4,C:"Battery Status API",D:true};
@@ -0,0 +1,10 @@
import { M as ModuleMockerServerInterceptor } from './chunk-interceptor-native.js';
import { registerModuleMocker } from './register.js';
import './chunk-mocker.js';
import './chunk-helpers.js';
import './index.js';
import './chunk-registry.js';
import './chunk-pathe.M-eThtNZ.js';
import '@vitest/spy';
registerModuleMocker(() => new ModuleMockerServerInterceptor());
@@ -0,0 +1 @@
{"version":3,"file":"dice-3.js","sources":["../../../src/icons/dice-3.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dice3\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNMTYgOGguMDEiIC8+CiAgPHBhdGggZD0iTTEyIDEyaC4wMSIgLz4KICA8cGF0aCBkPSJNOCAxNmguMDEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/dice-3\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 Dice3 = createLucideIcon('Dice3', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['path', { d: 'M16 8h.01', key: 'cr5u4v' }],\n ['path', { d: 'M12 12h.01', key: '1mp3jc' }],\n ['path', { d: 'M8 16h.01', key: '18s6g9' }],\n]);\n\nexport default Dice3;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAA;AAAA,CAAA,CACvF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,46 @@
import { transformProps } from '../utils/keys-transform.mjs';
import { getDefaultValueType } from '../../value/types/maps/defaults.mjs';
import { createBox } from '../../projection/geometry/models.mjs';
import { DOMVisualElement } from '../dom/DOMVisualElement.mjs';
import { camelToDash } from '../dom/utils/camel-to-dash.mjs';
import { buildSVGAttrs } from './utils/build-attrs.mjs';
import { camelCaseAttributes } from './utils/camel-case-attrs.mjs';
import { isSVGTag } from './utils/is-svg-tag.mjs';
import { renderSVG } from './utils/render.mjs';
import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';
class SVGVisualElement extends DOMVisualElement {
constructor() {
super(...arguments);
this.type = "svg";
this.isSVGTag = false;
this.measureInstanceViewportBox = createBox;
}
getBaseTargetFromProps(props, key) {
return props[key];
}
readValueFromInstance(instance, key) {
if (transformProps.has(key)) {
const defaultType = getDefaultValueType(key);
return defaultType ? defaultType.default || 0 : 0;
}
key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
return instance.getAttribute(key);
}
scrapeMotionValuesFromProps(props, prevProps, visualElement) {
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
}
build(renderState, latestValues, props) {
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);
}
renderInstance(instance, renderState, styleProp, projection) {
renderSVG(instance, renderState, styleProp, projection);
}
mount(instance) {
this.isSVGTag = isSVGTag(instance.tagName);
super.mount(instance);
}
}
export { SVGVisualElement };
//# sourceMappingURL=SVGVisualElement.mjs.map
@@ -0,0 +1,14 @@
import { getScrollRestorationScriptForRouter } from '@tanstack/router-core/scroll-restoration-script'
import { useRouter } from './useRouter'
import { ScriptOnce } from './ScriptOnce'
export function ScrollRestoration() {
const router = useRouter()
const script = getScrollRestorationScriptForRouter(router)
if (!script) {
return null
}
return <ScriptOnce children={script} />
}
@@ -0,0 +1,63 @@
{
"name": "tinyexec",
"version": "1.1.1",
"type": "module",
"description": "A minimal library for executing processes in Node",
"main": "./dist/main.mjs",
"engines": {
"node": ">=18"
},
"files": [
"dist"
],
"scripts": {
"build": "tsdown",
"build:types": "tsc",
"dev": "tsdown --watch",
"format": "prettier --write src",
"format:check": "prettier --check src",
"lint": "eslint src && publint",
"prepare": "npm run build",
"test": "npm run build && vitest run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tinylibs/tinyexec.git"
},
"keywords": [
"execa",
"exec",
"tiny",
"child_process",
"spawn"
],
"author": "James Garbutt (https://github.com/43081j)",
"license": "MIT",
"bugs": {
"url": "https://github.com/tinylibs/tinyexec/issues"
},
"homepage": "https://github.com/tinylibs/tinyexec#readme",
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/cross-spawn": "^6.0.6",
"@types/node": "^25.5.2",
"@vitest/coverage-v8": "^4.1.2",
"cross-spawn": "^7.0.6",
"eslint": "^10.2.0",
"prettier": "^3.8.1",
"publint": "^0.3.18",
"rollup-plugin-license": "^3.7.0",
"tsdown": "^0.21.7",
"typescript": "^6.0.2",
"typescript-eslint": "^8.58.0",
"vitest": "^4.0.7"
},
"exports": {
".": {
"types": "./dist/main.d.mts",
"default": "./dist/main.mjs"
},
"./package.json": "./package.json"
},
"types": "./dist/main.d.mts"
}
@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var client = require('framer-motion/client');
Object.keys(client).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function () { return client[k]; }
});
});
@@ -0,0 +1,154 @@
/**
* @fileoverview restrict values that can be used as Promise rejection reasons
* @author Teddy Katz
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
allowEmptyReject: false,
},
],
docs: {
description:
"Require using Error objects as Promise rejection reasons",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-promise-reject-errors",
},
fixable: null,
schema: [
{
type: "object",
properties: {
allowEmptyReject: { type: "boolean" },
},
additionalProperties: false,
},
],
messages: {
rejectAnError:
"Expected the Promise rejection reason to be an Error.",
},
},
create(context) {
const [{ allowEmptyReject }] = context.options;
const sourceCode = context.sourceCode;
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
/**
* Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error
* @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise
* @returns {void}
*/
function checkRejectCall(callExpression) {
if (!callExpression.arguments.length && allowEmptyReject) {
return;
}
if (
!callExpression.arguments.length ||
!astUtils.couldBeError(callExpression.arguments[0]) ||
(callExpression.arguments[0].type === "Identifier" &&
callExpression.arguments[0].name === "undefined")
) {
context.report({
node: callExpression,
messageId: "rejectAnError",
});
}
}
/**
* Determines whether a function call is a Promise.reject() call
* @param {ASTNode} node A CallExpression node
* @returns {boolean} `true` if the call is a Promise.reject() call
*/
function isPromiseRejectCall(node) {
return astUtils.isSpecificMemberAccess(
node.callee,
"Promise",
"reject",
);
}
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
return {
// Check `Promise.reject(value)` calls.
CallExpression(node) {
if (isPromiseRejectCall(node)) {
checkRejectCall(node);
}
},
/*
* Check for `new Promise((resolve, reject) => {})`, and check for reject() calls.
* This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that
* the nodes in the expression already have the `parent` property.
*/
"NewExpression:exit"(node) {
if (
node.callee.type === "Identifier" &&
node.callee.name === "Promise" &&
node.arguments.length &&
astUtils.isFunction(node.arguments[0]) &&
node.arguments[0].params.length > 1 &&
node.arguments[0].params[1].type === "Identifier"
) {
sourceCode
.getDeclaredVariables(node.arguments[0])
/*
* Find the first variable that matches the second parameter's name.
* If the first parameter has the same name as the second parameter, then the variable will actually
* be "declared" when the first parameter is evaluated, but then it will be immediately overwritten
* by the second parameter. It's not possible for an expression with the variable to be evaluated before
* the variable is overwritten, because functions with duplicate parameters cannot have destructuring or
* default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for
* this case.
*/
.find(
variable =>
variable.name ===
node.arguments[0].params[1].name,
)
// Get the references to that variable.
.references // Only check the references that read the parameter's value.
.filter(ref => ref.isRead())
// Only check the references that are used as the callee in a function call, e.g. `reject(foo)`.
.filter(
ref =>
ref.identifier.parent.type ===
"CallExpression" &&
ref.identifier === ref.identifier.parent.callee,
)
// Check the argument of the function call to determine whether it's an Error.
.forEach(ref => checkRejectCall(ref.identifier.parent));
}
},
};
},
};
@@ -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 './tree-palm.js';
//# sourceMappingURL=palmtree.js.map
@@ -0,0 +1,742 @@
export default `flf2a$ 7 7 15 0 19 0 24447 0
Author : myflix
Date : 2004/6/9 7:40:40
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
- Widened the space character.
Font modified May 26, 2012 by patorjk
- Added the 0xCA0 character.
$ $#
$ $#
$ $#
$ $#
$ $#
$ $#
$ $##
,---. #
| | #
| .' #
| | #
\`--' #
.--. #
'--' ##
#
,--. ,--. #
| | | | #
\`-' \`-' #
#
#
##
,--. ,--. #
,-| |-| |-.#
'-| |-| |-'#
,-| |-| |-.#
'-| |-| |-'#
\`--' \`--' #
##
,--. #
,-| |-. #
| | |-' #
'-| |\`\\ #
.--| | / #
\`--| |' #
\`--' ##
,--. #
.-. / / #
'-'/ / #
/ / #
/ /.-. #
/ / '-' #
\`--' ##
#
,---. #
| o ,-. #
.' /_ #
| o .__) #
\`---' #
##
#
,--. #
| | #
\`-' #
#
#
##
#
,-. #
/ .' #
| | #
| | #
\\ '. #
\`-' ##
#
,-. #
'. \\ #
| | #
| | #
.' / #
\`-' ##
,--. #
.-,| |,-. #
_\\ ' ' /_ #
(__ __) #
/ . . \\ #
\`-'| |\`-' #
\`--' ##
,--. #
| | #
,---| |---. #
'---| |---' #
| | #
\`--' #
##
#
#
#
#
,--. #
'-,/ #
##
#
#
,-----. #
'-----' #
#
#
##
#
#
#
#
.--. #
'--' #
##
,--. #
/ / #
/ / #
/ / #
/ / #
/ / #
\`--' ##
#
,--. #
/ \\ #
| () | #
\\ / #
\`--' #
##
#
,--. #
/ | #
\`| | #
| | #
\`--' #
##
#
,---. #
'.-. \\ #
.-' .' #
/ '-. #
'-----' #
##
#
,----. #
'.-. | #
.' < #
/'-' | #
\`----' #
##
#
,---. #
/ | #
/ ' | #
'--| | #
\`--' #
##
#
,-----. #
| .--' #
'--. \`\\ #
.--' / #
\`----' #
##
#
,--. #
/ .' #
| .-. #
\\ o | #
\`---' #
##
#
,-----. #
'--, / #
.' / #
/ / #
\`--' #
##
#
,---. #
| o | #
.' '. #
| o | #
\`---' #
##
#
,---. #
| o \\ #
\`..' | #
.' / #
\`--' #
##
#
#
.--. #
'--' #
.--. #
'--' #
##
#
#
.--. #
'--' #
.--. #
'-,/ #
##
#
,-. #
/ / #
/ / #
\\ \\ #
\\ \\ #
\`-' ##
#
#
,---. #
'---' #
,---. #
'---' #
##
#
,-. #
\\ \\ #
\\ \\ #
/ / #
/ / #
\`-' ##
,------. #
' .--. ' #
'--' _| | #
.--' __' #
\`---' #
.---. #
'---' ##
#
,----. #
' , | #
| | / #
' '--'| #
\`----' #
##
#
,---. #
/ O \\ #
| .-. | #
| | | | #
\`--' \`--' #
##
#
,-----. #
| |) /_ #
| .-. \\ #
| '--' / #
\`------' #
##
#
,-----. #
' .--./ #
| | #
' '--'\\ #
\`-----' #
##
#
,------. #
| .-. \\ #
| | \\ : #
| '--' / #
\`-------' #
##
#
,------. #
| .---' #
| \`--, #
| \`---. #
\`------' #
##
#
,------. #
| .---' #
| \`--, #
| |\` #
\`--' #
##
#
,----. #
' .-./ #
| | .---. #
' '--' | #
\`------' #
##
#
,--. ,--. #
| '--' | #
| .--. | #
| | | | #
\`--' \`--' #
##
#
,--. #
| | #
| | #
| | #
\`--' #
##
#
,--. #
| | #
,--. | | #
| '-' / #
\`-----' #
##
#
,--. ,--. #
| .' / #
| . ' #
| |\\ \\ #
\`--' '--' #
##
#
,--. #
| | #
| | #
| '--. #
\`-----' #
##
#
,--. ,--. #
| \`.' | #
| |'.'| | #
| | | | #
\`--' \`--' #
##
#
,--. ,--. #
| ,'.| | #
| |' ' | #
| | \` | #
\`--' \`--' #
##
#
,-----. #
' .-. ' #
| | | | #
' '-' ' #
\`-----' #
##
#
,------. #
| .--. ' #
| '--' | #
| | --' #
\`--' #
##
#
,-----. #
' .-. ' #
| | | | #
' '-' '-. #
\`-----'--' #
##
#
,------. #
| .--. ' #
| '--'.' #
| |\\ \\ #
\`--' '--' #
##
#
,---. #
' .-' #
\`. \`-. #
.-' | #
\`-----' #
##
#
,--------. #
'--. .--' #
| | #
| | #
\`--' #
##
#
,--. ,--. #
| | | | #
| | | | #
' '-' ' #
\`-----' #
##
#
,--. ,--. #
\\ \`.' / #
\\ / #
\\ / #
\`-' #
##
#
,--. ,--. #
| | | | #
| |.'.| | #
| ,'. | #
'--' '--' #
##
#
,--. ,--. #
\\ \`.' / #
.' \\ #
/ .'. \\ #
'--' '--' #
##
#
,--. ,--. #
\\ \`.' / #
'. / #
| | #
\`--' #
##
#
,-------. #
\`--. / #
/ / #
/ \`--. #
\`-------' #
##
#
,----. #
| .-' #
| | #
| | #
| '-. #
\`----' ##
,--. #
\\ \\ #
\\ \\ #
\\ \\ #
\\ \\ #
\\ \\ #
\`--' ##
#
,----. #
\`-. | #
| | #
| | #
.-' | #
\`----' ##
#
,---. #
/ \\ \\ #
\`--' \`--' #
#
#
##
#
#
#
#
,----. #
'----' #
##
#
,--. #
'. \\ #
\`--' #
#
#
##
#
#
,--,--. #
' ,-. | #
\\ '-' | #
\`--\`--' #
##
#
,--. #
| |-. #
| .-. ' #
| \`-' | #
\`---' #
##
#
#
,---. #
| .--' #
\\ \`--. #
\`---' #
##
#
,--. #
,-| | #
' .-. | #
\\ \`-' | #
\`---' #
##
#
#
,---. #
| .-. : #
\\ --. #
\`----' #
##
#
,---. #
/ .-' #
| \`-, #
| .-' #
\`--' #
##
#
#
,---. #
| .-. | #
' '-' ' #
.\`- / #
\`---' ##
#
,--. #
| ,---. #
| .-. | #
| | | | #
\`--' \`--' #
##
#
,--. #
\`--' #
,--. #
| | #
\`--' #
##
#
,--. #
\`--' #
,--. #
| | #
.-' / #
'---' ##
#
,--. #
| |,-. #
| / #
| \\ \\ #
\`--'\`--' #
##
#
,--. #
| | #
| | #
| | #
\`--' #
##
#
#
,--,--,--. #
| | #
| | | | #
\`--\`--\`--' #
##
#
#
,--,--, #
| \\ #
| || | #
\`--''--' #
##
#
#
,---. #
| .-. | #
' '-' ' #
\`---' #
##
#
#
,---. #
| .-. | #
| '-' ' #
| |-' #
\`--' ##
#
#
,---. #
| .-. | #
' '-' | #
\`-| | #
\`--' ##
#
#
,--.--. #
| .--' #
| | #
\`--' #
##
#
#
,---. #
( .-' #
.-' \`) #
\`----' #
##
#
,--. #
,-' '-. #
'-. .-' #
| | #
\`--' #
##
#
#
,--.,--. #
| || | #
' '' ' #
\`----' #
##
#
#
,--. ,--. #
\\ \`' / #
\\ / #
\`--' #
##
#
#
,--. ,--. #
| |.'.| | #
| .'. | #
'--' '--' #
##
#
#
,--. ,--. #
\\ \`' / #
/ /. \\ #
'--' '--' #
##
#
#
,--. ,--. #
\\ ' / #
\\ ' #
.-' / #
\`---' ##
#
#
,-----. #
\`-. / #
/ \`-. #
\`-----' #
##
#
,--. #
| .' #
.' / #
'. \\ #
| '. #
\`--' ##
,--. #
| | #
| | #
| | #
| | #
| | #
\`--' ##
#
,--. #
'. | #
\\ \`. #
/ .' #
.' | #
'--' ##
#
.--, #
.--' / #
/ ---\` #
\`--' #
#
##
#
,---. #
/ O \\ #
| .-. | #
| | | | #
\`--' \`--' #
##
#
,-----. #
' .-. ' #
| | | | #
' '-' ' #
\`-----' #
##
#
,--. ,--. #
| | | | #
| | | | #
' '-' ' #
\`-----' #
##
#
#
,--,--. #
' ,-. | #
\\ '-' | #
\`--\`--' #
##
#
#
,---. #
| .-. | #
' '-' ' #
\`---' #
##
#
#
,--.,--. #
| || | #
' '' ' #
\`----' #
##
�#
#
#
#
#
#
##
0xCA0 KANNADA LETTER TTHA
_____)#
|____/ #
,---. #
' .-. ' #
' '-' ' #
\`---' #
##`
@@ -0,0 +1,717 @@
flf2a$ 7 7 16 -1 2
Relief2 by Merlin Greywolf merlin@brahms.udel.edu
August 1994
\\\\\#
\\\\\#
\\\\\#
\\\\\#
\\\\\#
\\\\\#
\\\\\##
\\\\\#
/// \#
/// \#
/// \#
\\\\\#
/// \#
\\\\\##
\\\\\\\\#
// \// \#
// \// \#
\\\\\\\\#
\\\\\\\\#
\\\\\\\\#
\\\\\\\\##
\\\\\\\\\\\\#
\\// \// \\\#
////////// \#
\\// \// \\\#
////////// \#
\\// \// \\\#
\\\\\\\\\\\\##
\\\\\\\\\\#
\\\///// \#
\\/// \\\\#
////// \\\#
\\/// \\\\#
//////// \#
\\\\\\\\\\##
\\\\\\\\\#
// \/// \#
\\\/// \\#
\\/// \\\#
\/// \\\\#
/// \// \#
\\\\\\\\\##
\\\\\\\\\\#
\////// \\#
/// \\\\\\#
\//////// #
/// /// \\#
\////// \\#
\\\\\\\\\\##
\\\\#
// \#
/ \\#
\\\\#
\\\\#
\\\\#
\\\\##
\\\\\\#
\/// \#
/// \\#
/// \\#
/// \\#
\/// \#
\\\\\\##
\\\\\\#
/// \\#
\/// \#
\/// \#
\/// \#
/// \\#
\\\\\\##
\\\\\\\\\\#
\\\/// \\\#
// /// // #
\/////// \#
// /// // #
\\\/// \\\#
\\\\\\\\\\##
\\\\\\\\\\\#
\\\/// \\\\#
\\\/// \\\\#
///////// \#
\\\/// \\\\#
\\\/// \\\\#
\\\\\\\\\\\##
\\\\\#
\\\\\#
\\\\\#
\\\\\#
\\\\\#
/// \#
// \\##
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\#
//////// \#
\\\\\\\\\\#
\\\\\\\\\\#
\\\\\\\\\\##
\\\\\#
\\\\\#
\\\\\#
\\\\\#
\\\\\#
/// \#
\\\\\##
\\\\\\\\\#
\\\\/// \#
\\\/// \\#
\\/// \\\#
\/// \\\\#
/// \\\\\#
\\\\\\\\\##
\\\\\\\\\\\\#
\\////// \\\#
\/// \/// \\#
/// \\\/// \#
\/// \/// \\#
\\////// \\\#
\\\\\\\\\\\\##
\\\\\\\\\#
\\/// \\\#
\//// \\\#
\\/// \\\#
\\/// \\\#
/////// \#
\\\\\\\\\##
\\\\\\\\\\#
\/////// \#
/// \/// \#
\\\/// \\\#
\/// \\\\\#
//////// \#
\\\\\\\\\\##
\\\\\\\\\\#
\/////// \#
/// \/// \#
\\\//// \\#
/// \/// \#
\/////// \#
\\\\\\\\\\##
\\\\\\\\\\\#
\\////// \\#
\/// /// \\#
/// \/// \\#
///////// \#
\\\\\/// \\#
\\\\\\\\\\\##
\\\\\\\\\#
/////// \#
/// \\\\\#
////// \\#
\\\\/// \#
////// \\#
\\\\\\\\\##
\\\\\\\\\\#
\\\/// \\\#
\\/// \\\\#
\////// \\#
/// \/// \#
\////// \\#
\\\\\\\\\\##
\\\\\\\\\#
/////// \#
\\\/// \\#
\\/// \\\#
\/// \\\\#
/// \\\\\#
\\\\\\\\\##
\\\\\\\\\\#
\////// \\#
/// \/// \#
\////// \\#
/// \/// \#
\////// \\#
\\\\\\\\\\##
\\\\\\\\\\#
\////// \\#
/// \/// \#
\////// \\#
\\\/// \\\#
\\/// \\\\#
\\\\\\\\\\##
\\\\\#
\\\\\#
\\\\\#
\/// #
\\\\\#
\/// #
\\\\\##
\\\\\#
\\\\\#
\\\\\#
\/// #
\\\\\#
\/// #
\// \##
\\\\\\\#
\\/// \#
\/// \\#
/// \\\#
\/// \\#
\\/// \#
\\\\\\\##
\\\\\\\\\\#
\\\\\\\\\\#
//////// \#
\\\\\\\\\\#
//////// \#
\\\\\\\\\\#
\\\\\\\\\\##
\\\\\\\#
\/// \\#
\\/// \#
\\/// \#
\/// \\#
/// \\\#
\\\\\\\##
\\\\\\\\\#
\///// \\#
\\\\/// \#
\\\/// \\#
\\\\\\\\\#
\\\/// \\#
\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// ///// \#
/// \\\\\\\#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
///////// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
//////// \\#
/// \\/// \#
//////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\\\\\\#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
//////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
/// \\\\\\\#
/////// \\\#
/// \\\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
/// \\\\\\\#
/////// \\\#
/// \\\\\\\#
/// \\\\\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\\\\\\#
/// \\/// \#
\//////// \#
\\\\\\/// \##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
///////// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\#
///// \#
\/// \\#
\/// \\#
\/// \\#
///// \#
\\\\\\\##
\\\\\\\\\#
\\///// \#
\\\/// \\#
\\\/// \\#
\\\/// \\#
///// \\\#
\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \/// \\#
////// \\\\#
/// \/// \\#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\\\\\\#
/// \\\\\\\#
/// \\\\\\\#
/// \\\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
//// //// \#
/// / /// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
///// /// \#
///////// \#
/// ///// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
//////// \\#
/// \\\\\\\#
/// \\\\\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\/// \#
/// \/// \\#
\//// /// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
//////// \\#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\\\\\\#
\/////// \\#
\\\\\\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
\\\/// \\\\#
\\\/// \\\\#
\\\/// \\\\#
\\\/// \\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/// /// \\#
\\///// \\\#
\\\\\\\\\\\##
\\\\\\\\\\\\\#
/// /// /// \#
/// /// /// \#
/// /// /// \#
/// /// /// \#
\///////// \\#
\\\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
\/// /// \\#
\\///// \\\#
\/// /// \\#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
\/// /// \\#
\\///// \\\#
\\\/// \\\\#
\\\/// \\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
\\\\\/// \\#
\\\/// \\\\#
\/// \\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\\\\#
///// \#
/// \\\#
/// \\\#
/// \\\#
///// \#
\\\\\\\##
\\\\\\\\\#
/// \\\\\#
\/// \\\\#
\\/// \\\#
\\\/// \\#
\\\\/// \#
\\\\\\\\\##
\\\\\\\#
///// \#
\\/// \#
\\/// \#
\\/// \#
///// \#
\\\\\\\##
\\\\\\\\\\\#
\\\\/ \\\\\#
\\///// \\\#
/// \\/// \#
\\\\\\\\\\\#
\\\\\\\\\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\\\\\\\\\\\#
\\\\\\\\\\\#
\\\\\\\\\\\#
\\\\\\\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\#
// \#
\/ \#
\\\\#
\\\\#
\\\\#
\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
///////// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
//////// \\#
/// \\/// \#
//////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\\\\\\#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
//////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
/// \\\\\\\#
/////// \\\#
/// \\\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
/// \\\\\\\#
/////// \\\#
/// \\\\\\\#
/// \\\\\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\\\\\\#
/// \\/// \#
\//////// \#
\\\\\\/// \##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
///////// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\#
///// \#
\/// \\#
\/// \\#
\/// \\#
///// \#
\\\\\\\##
\\\\\\\\\#
\\///// \#
\\\/// \\#
\\\/// \\#
\\\/// \\#
\//// \\\#
\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \/// \\#
////// \\\\#
/// \/// \\#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\\\\\\#
/// \\\\\\\#
/// \\\\\\\#
/// \\\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
//// //// \#
/// / /// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
///// /// \#
///////// \#
/// ///// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
//////// \\#
/// \\\\\\\#
/// \\\\\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\/// \#
/// \/// \\#
\//// /// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
//////// \\#
/// \\/// \#
//////// \\#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\\\\\\#
\/////// \\#
\\\\\\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
\\\/// \\\\#
\\\/// \\\\#
\\\/// \\\\#
\\\/// \\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/// /// \\#
\\///// \\\#
\\\\\\\\\\\##
\\\\\\\\\\\\\#
/// /// /// \#
/// /// /// \#
/// /// /// \#
/// /// /// \#
\///////// \\#
\\\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
\/// /// \\#
\\///// \\\#
\/// /// \\#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
\/// /// \\#
\\///// \\\#
\\\/// \\\\#
\\\/// \\\\#
\\\\\\\\\\\##
\\\\\\\\\\\#
///////// \#
\\\\\/// \\#
\\\/// \\\\#
\/// \\\\\\#
///////// \#
\\\\\\\\\\\##
\\\\\\\\\#
\\///// \#
\\/// \\\#
///// \\\#
\\/// \\\#
\\///// \#
\\\\\\\\\##
\\\\\#
/// \#
/// \#
/// \#
/// \#
/// \#
\\\\\##
\\\\\\\\\#
///// \\\#
\\/// \\\#
\\///// \#
\\/// \\\#
///// \\\#
\\\\\\\\\##
\\\\\\\\\\\\\\#
\\//// \\/// \#
\////////// \\#
/// \\//// \\\#
\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\#
\\\\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
///////// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
///////// \#
/// \\/// \#
/// \\/// \#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
/// \\/// \#
/// \\/// \#
/// \\/// \#
/// \\/// \#
\/////// \\#
\\\\\\\\\\\##
\\\\\\\\\\\#
\/////// \\#
/// \\/// \#
/// \/// \\#
/// \\/// \#
/// \/// \\#
\\\\\\\\\\\##
@@ -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 SquareArrowRight = createLucideIcon("SquareArrowRight", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M8 12h8", key: "1wcyev" }],
["path", { d: "m12 16 4-4-4-4", key: "1i9zcv" }]
]);
export { SquareArrowRight as default };
//# sourceMappingURL=square-arrow-right.js.map
@@ -0,0 +1 @@
"use strict";require("../../get-pipe-path-BoR10qr8.cjs");var r=require("../../register-D46fvsV_.cjs"),e=require("../../require-D4F1Lv60.cjs");require("module"),require("node:path"),require("../../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:module"),require("node:url"),require("get-tsconfig"),require("node:fs"),require("../../index-gckBtVBf.cjs"),require("esbuild"),require("node:crypto"),require("../../client-D6NvIMSC.cjs"),require("node:net"),require("node:util"),require("../../index-BWFBUo6r.cjs"),exports.register=r.register,exports.require=e.tsxRequire;
@@ -0,0 +1,134 @@
<p align="center">
<a href="https://rollupjs.org/"><img src="https://rollupjs.org/rollup-logo.svg" width="150" /></a>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/rollup">
<img src="https://img.shields.io/npm/v/rollup.svg" alt="npm version" >
</a>
<a href="https://nodejs.org/en/about/previous-releases">
<img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
</a>
<a href="https://packagephobia.com/result?p=rollup">
<img src="https://packagephobia.com/badge?p=rollup" alt="install size" >
</a>
<a href="https://codecov.io/gh/rollup/rollup">
<img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
</a>
<a href="#backers" alt="sponsors on Open Collective">
<img src="https://opencollective.com/rollup/backers/badge.svg" alt="backers" >
</a>
<a href="#sponsors" alt="Sponsors on Open Collective">
<img src="https://opencollective.com/rollup/sponsors/badge.svg" alt="sponsors" >
</a>
<a href="https://github.com/rollup/rollup/blob/master/LICENSE.md">
<img src="https://img.shields.io/npm/l/rollup.svg" alt="license">
</a>
<a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'>
<img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'>
</a>
</p>
<h1 align="center">Rollup</h1>
## Overview
Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the standardized ES module format for code, instead of previous idiosyncratic solutions such as CommonJS and AMD. ES modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries. Rollup can optimize ES modules for faster native loading in modern browsers, or output a legacy module format allowing ES module workflows today.
## Quick Start Guide
Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/command-line-interface/) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/javascript-api/). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/introduction/).
### Commands
These commands assume the entry point to your application is named main.js, and that you'd like all imports compiled into a single file named bundle.js.
For browsers:
```bash
# compile to a <script> containing a self-executing function
rollup main.js --format iife --name "myBundle" --file bundle.js
```
For Node.js:
```bash
# compile to a CommonJS module
rollup main.js --format cjs --file bundle.js
```
For both browsers and Node.js:
```bash
# UMD format requires a bundle name
rollup main.js --format umd --name "myBundle" --file bundle.js
```
## Why
Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language.
This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. Most browsers and Node.js support ES modules. However, Node.js releases before 12.17 support ES modules only behind the `--experimental-modules` flag, and older browsers like Internet Explorer do not support ES modules at all. Rollup allows you to write your code using ES modules, and run your application even in environments that do not support ES modules natively. For environments that support them, Rollup can output optimized ES modules; for environments that don't, Rollup can compile your code to other formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to _write future-proof code_, and you also get the tremendous benefits of...
## Tree Shaking
In addition to enabling the use of ES modules, Rollup also statically analyzes and optimizes the code you are importing, and will exclude anything that isn't actually used. This allows you to build on top of existing tools and modules without adding extra dependencies or bloating the size of your project.
For example, with CommonJS, the _entire tool or library must be imported_.
```js
// import the entire utils object with CommonJS
var utils = require('node:utils');
var query = 'Rollup';
// use the ajax method of the utils object
utils.ajax('https://api.example.com?search=' + query).then(handleResponse);
```
But with ES modules, instead of importing the whole `utils` object, we can just import the one `ajax` function we need:
```js
// import the ajax function with an ES import statement
import { ajax } from 'node:utils';
var query = 'Rollup';
// call the ajax function
ajax('https://api.example.com?search=' + query).then(handleResponse);
```
Because Rollup includes the bare minimum, it results in lighter, faster, and less complicated libraries and applications. Since this approach is based on explicit `import` and `export` statements, it is vastly more effective than simply running an automated minifier to detect unused variables in the compiled output code.
## Compatibility
### Importing CommonJS
Rollup can import existing CommonJS modules [through a plugin](https://github.com/rollup/plugins/tree/master/packages/commonjs).
### Publishing ES Modules
To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the `main` property in your `package.json` file. If your `package.json` file also has a `module` field, ES-module-aware tools like Rollup and [webpack](https://webpack.js.org/) will [import the ES module version](https://github.com/rollup/rollup/wiki/pkg.module) directly.
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. <a href="https://github.com/rollup/rollup/graphs/contributors"><img src="https://opencollective.com/rollup/contributors.svg?width=890" /></a>. If you want to contribute yourself, head over to the [contribution guidelines](CONTRIBUTING.md).
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/rollup#backer)]
<a href="https://opencollective.com/rollup#backers" target="_blank"><img src="https://opencollective.com/rollup/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/rollup#sponsor)]
<a href="https://opencollective.com/rollup/sponsor/0/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/1/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/2/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/3/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/4/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/5/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/6/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/7/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/8/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/9/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/10/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/10/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/11/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/11/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/12/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/12/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/13/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/13/avatar.svg"></a> <a href="https://opencollective.com/rollup/sponsor/14/website" target="_blank"><img src="https://opencollective.com/rollup/sponsor/14/avatar.svg"></a>
## Special Sponsor
<a href="https://www.tngtech.com/en/index.html" target="_blank"><img src="https://avatars.githubusercontent.com/u/432256?s=200&v=4" alt="TNG Logo"/></a>
TNG has been supporting the work of [Lukas Taegert-Atkinson](https://github.com/lukastaegert) on Rollup since 2017.
## License
[MIT](https://github.com/rollup/rollup/blob/master/LICENSE.md)
@@ -0,0 +1,90 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
@@ -0,0 +1,7 @@
import { GetConnInfo } from "../../helper/conninfo/types.js";
//#region src/adapter/lambda-edge/conninfo.d.ts
/**
* @deprecated `hono/lambda-edge` will be removed in v5. Install `@hono/lambda-edge` and import from there instead.
*/
export declare const getConnInfo: GetConnInfo;
//#endregion
@@ -0,0 +1,65 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_jsx_constants = require("../../constants.js");
const require_jsx_dom_context = require("../context.js");
const require_jsx_context = require("../../context.js");
const require_jsx_hooks_index = require("../../hooks/index.js");
//#region src/jsx/dom/hooks/index.ts
/**
* Provide hooks used only in jsx/dom
*/
const FormContext = require_jsx_dom_context.createContext({
pending: false,
data: null,
method: null,
action: null
});
const actions = /* @__PURE__ */ new Set();
const registerAction = (action) => {
actions.add(action);
action.finally(() => actions.delete(action));
};
/**
* This hook returns the current form status
* @returns FormStatus
*/
const useFormStatus = () => {
return require_jsx_context.useContext(FormContext);
};
/**
* This hook returns the current state and a function to update the state optimistically
* The current state is updated optimistically and then reverted to the original state when all actions are resolved
* @param state
* @param updateState
* @returns [T, (action: N) => void]
*/
const useOptimistic = (state, updateState) => {
const [optimisticState, setOptimisticState] = require_jsx_hooks_index.useState(state);
if (actions.size > 0) Promise.all(actions).finally(() => {
setOptimisticState(state);
});
else setOptimisticState(state);
return [optimisticState, require_jsx_hooks_index.useCallback((newData) => {
setOptimisticState((currentState) => updateState(currentState, newData));
}, [])];
};
/**
* This hook returns the current state and a function to update the state by form action
* @param fn
* @param initialState
* @param permalink
* @returns [T, (data: FormData) => void]
*/
const useActionState = (fn, initialState, permalink) => {
const [state, setState] = require_jsx_hooks_index.useState(initialState);
const actionState = async (data) => {
setState(await fn(state, data));
};
actionState[require_jsx_constants.PERMALINK] = permalink;
return [state, actionState];
};
//#endregion
exports.FormContext = FormContext;
exports.registerAction = registerAction;
exports.useActionState = useActionState;
exports.useFormStatus = useFormStatus;
exports.useOptimistic = useOptimistic;
@@ -0,0 +1 @@
{"version":3,"names":["mergeOptions","target","source","k","Object","keys","parserOpts","targetObj","mergeDefaultFields","val","undefined","isIterableIterator","value","next","Symbol","iterator"],"sources":["../../src/config/util.ts"],"sourcesContent":["import type { InputOptions, ResolvedOptions } from \"./validation/options.ts\";\n\nexport function mergeOptions(\n target: InputOptions | ResolvedOptions,\n source: InputOptions,\n): void {\n for (const k of Object.keys(source)) {\n if (\n (k === \"parserOpts\" || k === \"generatorOpts\" || k === \"assumptions\") &&\n source[k]\n ) {\n const parserOpts = source[k];\n const targetObj = target[k] || (target[k] = {});\n mergeDefaultFields(targetObj, parserOpts);\n } else {\n //@ts-expect-error k must index source\n const val = source[k];\n //@ts-expect-error assigning source to target\n if (val !== undefined) target[k] = val as any;\n }\n }\n}\n\nfunction mergeDefaultFields<T extends object>(target: T, source: T) {\n for (const k of Object.keys(source) as (keyof T)[]) {\n const val = source[k];\n if (val !== undefined) target[k] = val;\n }\n}\n\nexport function isIterableIterator(value: any): value is IterableIterator<any> {\n return (\n !!value &&\n typeof value.next === \"function\" &&\n typeof value[Symbol.iterator] === \"function\"\n );\n}\n"],"mappings":";;;;;;;AAEO,SAASA,YAAYA,CAC1BC,MAAsC,EACtCC,MAAoB,EACd;EACN,KAAK,MAAMC,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IACnC,IACE,CAACC,CAAC,KAAK,YAAY,IAAIA,CAAC,KAAK,eAAe,IAAIA,CAAC,KAAK,aAAa,KACnED,MAAM,CAACC,CAAC,CAAC,EACT;MACA,MAAMG,UAAU,GAAGJ,MAAM,CAACC,CAAC,CAAC;MAC5B,MAAMI,SAAS,GAAGN,MAAM,CAACE,CAAC,CAAC,KAAKF,MAAM,CAACE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/CK,kBAAkB,CAACD,SAAS,EAAED,UAAU,CAAC;IAC3C,CAAC,MAAM;MAEL,MAAMG,GAAG,GAAGP,MAAM,CAACC,CAAC,CAAC;MAErB,IAAIM,GAAG,KAAKC,SAAS,EAAET,MAAM,CAACE,CAAC,CAAC,GAAGM,GAAU;IAC/C;EACF;AACF;AAEA,SAASD,kBAAkBA,CAAmBP,MAAS,EAAEC,MAAS,EAAE;EAClE,KAAK,MAAMC,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,EAAiB;IAClD,MAAMO,GAAG,GAAGP,MAAM,CAACC,CAAC,CAAC;IACrB,IAAIM,GAAG,KAAKC,SAAS,EAAET,MAAM,CAACE,CAAC,CAAC,GAAGM,GAAG;EACxC;AACF;AAEO,SAASE,kBAAkBA,CAACC,KAAU,EAAkC;EAC7E,OACE,CAAC,CAACA,KAAK,IACP,OAAOA,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOD,KAAK,CAACE,MAAM,CAACC,QAAQ,CAAC,KAAK,UAAU;AAEhD;AAAC","ignoreList":[]}
@@ -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 LoaderPinwheel = createLucideIcon("LoaderPinwheel", [
["path", { d: "M22 12a1 1 0 0 1-10 0 1 1 0 0 0-10 0", key: "1lzz15" }],
["path", { d: "M7 20.7a1 1 0 1 1 5-8.7 1 1 0 1 0 5-8.6", key: "1gnrpi" }],
["path", { d: "M7 3.3a1 1 0 1 1 5 8.6 1 1 0 1 0 5 8.6", key: "u9yy5q" }],
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
]);
export { LoaderPinwheel as default };
//# sourceMappingURL=loader-pinwheel.js.map
@@ -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 Fence = createLucideIcon("Fence", [
["path", { d: "M4 3 2 5v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z", key: "1n2rgs" }],
["path", { d: "M6 8h4", key: "utf9t1" }],
["path", { d: "M6 18h4", key: "12yh4b" }],
["path", { d: "m12 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z", key: "3ha7mj" }],
["path", { d: "M14 8h4", key: "1r8wg2" }],
["path", { d: "M14 18h4", key: "1t3kbu" }],
["path", { d: "m20 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z", key: "dfd4e2" }]
]);
export { Fence as default };
//# sourceMappingURL=fence.js.map
@@ -0,0 +1,314 @@
"use strict"
var Buffer = require("safer-buffer").Buffer
// == UTF32-LE/BE codec. ==========================================================
exports._utf32 = Utf32Codec
function Utf32Codec (codecOptions, iconv) {
this.iconv = iconv
this.bomAware = true
this.isLE = codecOptions.isLE
}
exports.utf32le = { type: "_utf32", isLE: true }
exports.utf32be = { type: "_utf32", isLE: false }
// Aliases
exports.ucs4le = "utf32le"
exports.ucs4be = "utf32be"
Utf32Codec.prototype.encoder = Utf32Encoder
Utf32Codec.prototype.decoder = Utf32Decoder
// -- Encoding
function Utf32Encoder (options, codec) {
this.isLE = codec.isLE
this.highSurrogate = 0
}
Utf32Encoder.prototype.write = function (str) {
var src = Buffer.from(str, "ucs2")
// src.length * 2 covers this chunk's code units (4 bytes each); the extra 4 bytes leave room for a
// high surrogate held over from a previous chunk, which is flushed ahead of this chunk's units.
var dst = Buffer.alloc(src.length * 2 + 4)
var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE
var offset = 0
for (var i = 0; i < src.length; i += 2) {
var code = src.readUInt16LE(i)
var isHighSurrogate = (code >= 0xD800 && code < 0xDC00)
var isLowSurrogate = (code >= 0xDC00 && code < 0xE000)
if (this.highSurrogate) {
if (isHighSurrogate || !isLowSurrogate) {
// There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low
// surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character
// (technically wrong, but expected by some applications, like Windows file names).
write32.call(dst, this.highSurrogate, offset)
offset += 4
} else {
// Create 32-bit value from high and low surrogates;
var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000
write32.call(dst, codepoint, offset)
offset += 4
this.highSurrogate = 0
continue
}
}
if (isHighSurrogate) { this.highSurrogate = code } else {
// Even if the current character is a low surrogate, with no previous high surrogate, we'll
// encode it as a semi-invalid stand-alone character for the same reasons expressed above for
// unpaired high surrogates.
write32.call(dst, code, offset)
offset += 4
this.highSurrogate = 0
}
}
if (offset < dst.length) { dst = dst.slice(0, offset) }
return dst
}
Utf32Encoder.prototype.end = function () {
// Treat any leftover high surrogate as a semi-valid independent character.
if (!this.highSurrogate) { return }
var buf = Buffer.alloc(4)
if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) }
this.highSurrogate = 0
return buf
}
// -- Decoding
function Utf32Decoder (options, codec) {
this.isLE = codec.isLE
this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0)
this.overflow = []
}
Utf32Decoder.prototype.write = function (src) {
if (src.length === 0) { return "" }
var i = 0
var codepoint = 0
var dst = Buffer.alloc(src.length + 4)
var offset = 0
var isLE = this.isLE
var overflow = this.overflow
var badChar = this.badChar
if (overflow.length > 0) {
for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) }
if (overflow.length === 4) {
// NOTE: codepoint is a signed int32 and can be negative.
// NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer).
if (isLE) {
codepoint = overflow[0] | (overflow[1] << 8) | (overflow[2] << 16) | (overflow[3] << 24)
} else {
codepoint = overflow[3] | (overflow[2] << 8) | (overflow[1] << 16) | (overflow[0] << 24)
}
overflow.length = 0
offset = _writeCodepoint(dst, offset, codepoint, badChar)
}
}
// Main loop. Should be as optimized as possible.
for (; i < src.length - 3; i += 4) {
// NOTE: codepoint is a signed int32 and can be negative.
if (isLE) {
codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24)
} else {
codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24)
}
offset = _writeCodepoint(dst, offset, codepoint, badChar)
}
// Keep overflowing bytes.
for (; i < src.length; i++) {
overflow.push(src[i])
}
return dst.slice(0, offset).toString("ucs2")
}
function _writeCodepoint (dst, offset, codepoint, badChar) {
// NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations.
if (codepoint < 0 || codepoint > 0x10FFFF) {
// Not a valid Unicode codepoint
codepoint = badChar
}
// Ephemeral Planes: Write high surrogate.
if (codepoint >= 0x10000) {
codepoint -= 0x10000
var high = 0xD800 | (codepoint >> 10)
dst[offset++] = high & 0xff
dst[offset++] = high >> 8
// Low surrogate is written below.
var codepoint = 0xDC00 | (codepoint & 0x3FF)
}
// Write BMP char or low surrogate.
dst[offset++] = codepoint & 0xff
dst[offset++] = codepoint >> 8
return offset
};
Utf32Decoder.prototype.end = function () {
if (this.overflow.length === 0) { return }
// A leftover, incomplete 4-byte code unit at the end of the input is ill-formed. Substitute a
// single U+FFFD (Unicode Standard conformance clause C10) instead of silently dropping the bytes.
this.overflow.length = 0
return String.fromCharCode(this.badChar)
}
// == UTF-32 Auto codec =============================================================
// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic.
// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32
// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'});
// Encoder prepends BOM (which can be overridden with (addBOM: false}).
exports.utf32 = Utf32AutoCodec
exports.ucs4 = "utf32"
function Utf32AutoCodec (options, iconv) {
this.iconv = iconv
}
Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder
Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder
// -- Encoding
function Utf32AutoEncoder (options, codec) {
options = options || {}
if (options.addBOM === undefined) {
options.addBOM = true
}
this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options)
}
Utf32AutoEncoder.prototype.write = function (str) {
return this.encoder.write(str)
}
Utf32AutoEncoder.prototype.end = function () {
return this.encoder.end()
}
// -- Decoding
function Utf32AutoDecoder (options, codec) {
this.decoder = null
this.initialBufs = []
this.initialBufsLen = 0
this.options = options || {}
this.iconv = codec.iconv
}
Utf32AutoDecoder.prototype.write = function (buf) {
if (!this.decoder) {
// Codec is not chosen yet. Accumulate initial bytes.
this.initialBufs.push(buf)
this.initialBufsLen += buf.length
if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below)
{ return "" }
// We have enough bytes -> detect endianness.
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding)
this.decoder = this.iconv.getDecoder(encoding, this.options)
var resStr = ""
for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) }
this.initialBufs.length = this.initialBufsLen = 0
return resStr
}
return this.decoder.write(buf)
}
Utf32AutoDecoder.prototype.end = function () {
if (!this.decoder) {
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding)
this.decoder = this.iconv.getDecoder(encoding, this.options)
var resStr = ""
for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) }
var trail = this.decoder.end()
if (trail) { resStr += trail }
this.initialBufs.length = this.initialBufsLen = 0
return resStr
}
return this.decoder.end()
}
function detectEncoding (bufs, defaultEncoding) {
var b = []
var charsProcessed = 0
var invalidLE = 0; var invalidBE = 0 // Number of invalid chars when decoded as LE or BE.
var bmpCharsLE = 0; var bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE.
outerLoop:
for (var i = 0; i < bufs.length; i++) {
var buf = bufs[i]
for (var j = 0; j < buf.length; j++) {
b.push(buf[j])
if (b.length === 4) {
if (charsProcessed === 0) {
// Check BOM first.
if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) {
return "utf-32le"
}
if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) {
return "utf-32be"
}
}
if (b[0] !== 0 || b[1] > 0x10) invalidBE++
if (b[3] !== 0 || b[2] > 0x10) invalidLE++
if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++
if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++
b.length = 0
charsProcessed++
if (charsProcessed >= 100) {
break outerLoop
}
}
}
}
// Make decisions.
if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be"
if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le"
// Couldn't decide (likely all zeros or not enough data).
return defaultEncoding || "utf-32le"
}
@@ -0,0 +1,964 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CONSTANT_CATCH = exports.Class = exports.BIGINT_FORMAT_RANGES = exports.NUMBER_FORMAT_RANGES = exports.primitiveTypes = exports.propertyKeyTypes = exports.getParsedType = exports.allowsEval = exports.captureStackTrace = void 0;
exports.assertEqual = assertEqual;
exports.assertNotEqual = assertNotEqual;
exports.toZod = toZod;
exports.assertIs = assertIs;
exports.assertNever = assertNever;
exports.assert = assert;
exports.getEnumValues = getEnumValues;
exports.joinValues = joinValues;
exports.jsonStringifyReplacer = jsonStringifyReplacer;
exports.cached = cached;
exports.nullish = nullish;
exports.cleanRegex = cleanRegex;
exports.floatSafeRemainder = floatSafeRemainder;
exports.defineLazy = defineLazy;
exports.objectClone = objectClone;
exports.assignProp = assignProp;
exports.rawShape = rawShape;
exports.mergeDefs = mergeDefs;
exports.cloneDef = cloneDef;
exports.getElementAtPath = getElementAtPath;
exports.promiseAllObject = promiseAllObject;
exports.randomString = randomString;
exports.esc = esc;
exports.slugify = slugify;
exports.isObject = isObject;
exports.isPlainObject = isPlainObject;
exports.shallowClone = shallowClone;
exports.numKeys = numKeys;
exports.escapeRegex = escapeRegex;
exports.clone = clone;
exports.normalizeParams = normalizeParams;
exports.createTransparentProxy = createTransparentProxy;
exports.stringifyPrimitive = stringifyPrimitive;
exports.optionalKeys = optionalKeys;
exports.pick = pick;
exports.omit = omit;
exports.extend = extend;
exports.safeExtend = safeExtend;
exports.merge = merge;
exports.partial = partial;
exports.required = required;
exports.aborted = aborted;
exports.explicitlyAborted = explicitlyAborted;
exports.prefixIssues = prefixIssues;
exports.unwrapMessage = unwrapMessage;
exports.sizeCaps = sizeCaps;
exports.attachSchema = attachSchema;
exports.finalizeIssue = finalizeIssue;
exports.getSizableOrigin = getSizableOrigin;
exports.codePointLength = codePointLength;
exports.getLengthableOrigin = getLengthableOrigin;
exports.parsedType = parsedType;
exports.issue = issue;
exports.cleanEnum = cleanEnum;
exports.base64ToUint8Array = base64ToUint8Array;
exports.uint8ArrayToBase64 = uint8ArrayToBase64;
exports.base64urlToUint8Array = base64urlToUint8Array;
exports.uint8ArrayToBase64url = uint8ArrayToBase64url;
exports.hexToUint8Array = hexToUint8Array;
exports.uint8ArrayToHex = uint8ArrayToHex;
exports.members = members;
exports.own = own;
exports.hide = hide;
exports.derived = derived;
exports.defineLazyInternal = defineLazyInternal;
exports.installLazyProp = installLazyProp;
exports.constantCatch = constantCatch;
const core_js_1 = require("./core.cjs");
// functions
function assertEqual(val) {
return val;
}
function assertNotEqual(val) {
return val;
}
function toZod() {
return (schema) => schema;
}
function assertIs(_arg) { }
function assertNever(_x) {
throw new Error("Unexpected value in exhaustive check");
}
function assert(_) { }
function getEnumValues(entries) {
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
const values = Object.entries(entries)
.filter(([k, _]) => numericValues.indexOf(+k) === -1)
.map(([_, v]) => v);
return values;
}
function joinValues(array, separator = "|") {
return array.map((val) => stringifyPrimitive(val)).join(separator);
}
function jsonStringifyReplacer(_, value) {
if (typeof value === "bigint")
return value.toString();
return value;
}
// the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)
class Cached {
constructor(getter) {
this._getter = getter;
this._value = undefined;
}
get value() {
const getter = this._getter;
if (getter !== undefined) {
this._value = getter();
this._getter = undefined;
}
return this._value;
}
}
function cached(getter) {
return new Cached(getter);
}
function nullish(input) {
return input === null || input === undefined;
}
function cleanRegex(source) {
const start = source.startsWith("^") ? 1 : 0;
const end = source.endsWith("$") ? source.length - 1 : source.length;
return source.slice(start, end);
}
function floatSafeRemainder(val, step) {
const ratio = val / step;
const roundedRatio = Math.round(ratio);
// `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
if (Math.abs(ratio - roundedRatio) < tolerance)
return 0;
return ratio - roundedRatio;
}
const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
function defineLazy(object, key, getter) {
let value = undefined;
Object.defineProperty(object, key, {
get() {
if (value === EVALUATING) {
// Circular reference detected, return undefined to break the cycle
return undefined;
}
if (value === undefined) {
value = EVALUATING;
value = getter();
}
return value;
},
set(v) {
Object.defineProperty(object, key, {
value: v,
// configurable: true,
});
// object[key] = v;
},
configurable: true,
});
}
function objectClone(obj) {
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
}
function assignProp(target, prop, value) {
Object.defineProperty(target, prop, {
value,
writable: true,
enumerable: true,
configurable: true,
});
}
/**
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
*
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
*/
function rawShape(def) {
const desc = Object.getOwnPropertyDescriptor(def, "shape");
return desc?.get ? desc.get.raw : desc?.value;
}
// where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.
function sourceShape(schema) {
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
}
// a key whose value is not settled yet, self-caching so every read after the first gets the same one
function deferProp(target, key, getter) {
Object.defineProperty(target, key, {
get() {
const value = getter();
assignProp(this, key, value);
return value;
},
enumerable: true,
configurable: true,
});
}
// Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.
function putProp(target, key, value) {
if (key in target)
assignProp(target, key, value);
else
target[key] = value;
}
/**
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
*
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
*/
function mirrorShape(target, source, keys, wrap) {
const raw = sourceShape(source);
for (const key of keys) {
const desc = Object.getOwnPropertyDescriptor(raw, key);
if (!desc.enumerable)
continue;
if (desc.get) {
deferProp(target, key, () => {
const value = source._zod.def.shape[key];
return wrap ? wrap(value, key) : value;
});
}
else
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
}
}
// same, for a plain shape a caller passed rather than a schema's
function mirrorProps(target, source) {
for (const key of Reflect.ownKeys(source)) {
const desc = Object.getOwnPropertyDescriptor(source, key);
if (!desc.enumerable)
continue;
if (desc.get)
deferProp(target, key, () => source[key]);
else
putProp(target, key, desc.value);
}
}
function mergeDefs(...defs) {
const mergedDescriptors = {};
for (const def of defs) {
const descriptors = Object.getOwnPropertyDescriptors(def);
Object.assign(mergedDescriptors, descriptors);
}
return Object.defineProperties({}, mergedDescriptors);
}
function cloneDef(schema) {
return mergeDefs(schema._zod.def);
}
function getElementAtPath(obj, path) {
if (!path)
return obj;
return path.reduce((acc, key) => acc?.[key], obj);
}
function promiseAllObject(promisesObj) {
const keys = Object.keys(promisesObj);
const promises = keys.map((key) => promisesObj[key]);
return Promise.all(promises).then((results) => {
const resolvedObj = {};
for (let i = 0; i < keys.length; i++) {
resolvedObj[keys[i]] = results[i];
}
return resolvedObj;
});
}
function randomString(length = 10) {
const chars = "abcdefghijklmnopqrstuvwxyz";
let str = "";
for (let i = 0; i < length; i++) {
str += chars[Math.floor(Math.random() * chars.length)];
}
return str;
}
function esc(str) {
return JSON.stringify(str);
}
function slugify(input) {
return input
.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, "")
.replace(/[\s_-]+/g, "-")
.replace(/^-+|-+$/g, "");
}
exports.captureStackTrace = ("captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { });
function isObject(data) {
return typeof data === "object" && data !== null && !Array.isArray(data);
}
exports.allowsEval = cached(() => {
// Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.
if (core_js_1.globalConfig.jitless) {
return false;
}
// @ts-ignore
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
return false;
}
try {
const F = Function;
new F("");
return true;
}
catch (_) {
return false;
}
});
function isPlainObject(o) {
if (isObject(o) === false)
return false;
// modified constructor
const ctor = o.constructor;
if (ctor === undefined)
return true;
if (typeof ctor !== "function")
return true;
// modified prototype
const prot = ctor.prototype;
if (isObject(prot) === false)
return false;
// ctor doesn't have static `isPrototypeOf`
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
return false;
}
return true;
}
function shallowClone(o) {
if (isPlainObject(o))
return { ...o };
if (Array.isArray(o))
return [...o];
if (o instanceof Map)
return new Map(o);
if (o instanceof Set)
return new Set(o);
return o;
}
function numKeys(data) {
let keyCount = 0;
for (const key in data) {
if (Object.prototype.hasOwnProperty.call(data, key)) {
keyCount++;
}
}
return keyCount;
}
const getParsedType = (data) => {
const t = typeof data;
switch (t) {
case "undefined":
return "undefined";
case "string":
return "string";
case "number":
return Number.isNaN(data) ? "nan" : "number";
case "boolean":
return "boolean";
case "function":
return "function";
case "bigint":
return "bigint";
case "symbol":
return "symbol";
case "object":
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
return "promise";
}
if (typeof Map !== "undefined" && data instanceof Map) {
return "map";
}
if (typeof Set !== "undefined" && data instanceof Set) {
return "set";
}
if (typeof Date !== "undefined" && data instanceof Date) {
return "date";
}
// @ts-ignore
if (typeof File !== "undefined" && data instanceof File) {
return "file";
}
return "object";
default:
throw new Error(`Unknown data type: ${t}`);
}
};
exports.getParsedType = getParsedType;
exports.propertyKeyTypes = new Set(["string", "number", "symbol"]);
exports.primitiveTypes = new Set([
"string",
"number",
"bigint",
"boolean",
"symbol",
"undefined",
]);
function escapeRegex(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
// zod-specific utils
function clone(inst, def, params) {
const cl = new inst._zod.constr(def ?? inst._zod.def);
if (!def || params?.parent)
cl._zod.parent = inst;
return cl;
}
function normalizeParams(_params) {
const params = _params;
if (!params)
return {};
if (typeof params === "string")
return { error: () => params };
if (params?.message !== undefined) {
if (params?.error !== undefined)
throw new Error("Cannot specify both `message` and `error` params");
params.error = params.message;
}
delete params.message;
if (typeof params.error === "string")
return { ...params, error: () => params.error };
return params;
}
function createTransparentProxy(getter) {
let target;
return new Proxy({}, {
get(_, prop, receiver) {
target ?? (target = getter());
return Reflect.get(target, prop, receiver);
},
set(_, prop, value, receiver) {
target ?? (target = getter());
return Reflect.set(target, prop, value, receiver);
},
has(_, prop) {
target ?? (target = getter());
return Reflect.has(target, prop);
},
deleteProperty(_, prop) {
target ?? (target = getter());
return Reflect.deleteProperty(target, prop);
},
ownKeys(_) {
target ?? (target = getter());
return Reflect.ownKeys(target);
},
getOwnPropertyDescriptor(_, prop) {
target ?? (target = getter());
return Reflect.getOwnPropertyDescriptor(target, prop);
},
defineProperty(_, prop, descriptor) {
target ?? (target = getter());
return Reflect.defineProperty(target, prop, descriptor);
},
});
}
function stringifyPrimitive(value) {
if (typeof value === "bigint")
return value.toString() + "n";
if (typeof value === "string")
return `"${value}"`;
return `${value}`;
}
function optionalKeys(shape) {
return Object.keys(shape).filter((k) => {
return shape[k]._zod.optin !== undefined && shape[k]._zod.optout === "optional";
});
}
// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.
exports.NUMBER_FORMAT_RANGES = (() => ({
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
int32: [-2147483648, 2147483647],
uint32: [0, 4294967295],
float32: [-3.4028234663852886e38, 3.4028234663852886e38],
float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
}))();
exports.BIGINT_FORMAT_RANGES = {
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")],
};
function pick(schema, mask) {
const currDef = schema._zod.def;
const checks = currDef.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
throw new Error(".pick() cannot be used on object schemas containing refinements");
}
const newShape = {};
mirrorShape(newShape, schema, maskedKeys(schema, mask));
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
}
// the mask keys that select something, checked against the source's shape without resolving it
function maskedKeys(schema, mask) {
const raw = sourceShape(schema);
const keys = [];
// `for...in` skips symbols, so a symbol in the mask would select nothing
for (const key of Reflect.ownKeys(mask)) {
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
throw new Error(`Unrecognized key: "${String(key)}"`);
}
if (mask[key])
keys.push(key);
}
return keys;
}
function omit(schema, mask) {
const currDef = schema._zod.def;
const checks = currDef.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
throw new Error(".omit() cannot be used on object schemas containing refinements");
}
const omitted = new Set(maskedKeys(schema, mask));
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
}
function extend(schema, shape) {
if (!isPlainObject(shape)) {
throw new Error("Invalid input to extend: expected a plain object");
}
const checks = schema._zod.def.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
// Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values
const existingShape = sourceShape(schema);
for (const key of Reflect.ownKeys(shape)) {
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
}
}
}
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
}
// the source's keys, then the caller's overlaid on top
function extended(schema, shape) {
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
mirrorProps(newShape, shape);
return newShape;
}
function safeExtend(schema, shape) {
if (!isPlainObject(shape)) {
throw new Error("Invalid input to safeExtend: expected a plain object");
}
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
}
function merge(a, b) {
if (!b?._zod?.def) {
throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
}
if (a._zod.def.checks?.length) {
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
}
const newShape = {};
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
const def = mergeDefs(a._zod.def, {
shape: newShape,
get catchall() {
return b._zod.def.catchall;
},
checks: b._zod.def.checks ?? [],
});
return clone(a, def);
}
function partial(Class, schema, mask, name = "partial") {
const currDef = schema._zod.def;
const checks = currDef.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
}
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class &&
((value, key) => (selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value }))));
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
}
function required(Class, schema, mask) {
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) =>
// overwrite with non-optional
selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
}
// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom
function aborted(x, startIndex = 0) {
if (x.aborted === true)
return true;
for (let i = startIndex; i < x.issues.length; i++) {
if (x.issues[i]?.continue !== true) {
return true;
}
}
return false;
}
// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.
function explicitlyAborted(x, startIndex = 0) {
if (x.aborted === true)
return true;
for (let i = startIndex; i < x.issues.length; i++) {
if (x.issues[i]?.continue === false) {
return true;
}
}
return false;
}
function prefixIssues(path, issues) {
return issues.map((iss) => {
var _a;
(_a = iss).path ?? (_a.path = []);
iss.path.unshift(path);
return iss;
});
}
function unwrapMessage(message) {
return typeof message === "string" ? message : message?.message;
}
/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
function sizeCaps(defChecks) {
const caps = [];
for (const ch of defChecks ?? []) {
const d = ch._zod.def;
// a later check may rewrite the value
if (!/_(length|size)$|_equals$/.test(d.check))
break;
const max = d.maximum ?? d.length ?? d.size;
if (max >= 0)
caps.push([max, ch]);
}
return caps;
}
function attachSchema(issues, start, inst) {
var _a;
for (let i = start; i < issues.length; i++) {
(_a = issues[i]).schema ?? (_a.schema = inst);
}
}
function finalizeIssue(iss, ctx, config) {
var _a;
// A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.
const traits = iss.inst?._zod?.traits;
if (traits?.has("$ZodType")) {
if (traits.has("$ZodCheck"))
(_a = iss).schema ?? (_a.schema = iss.inst);
else
iss.schema = iss.inst;
}
// Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
const message = iss.message
? iss.message
: (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??
unwrapMessage(schemaError?.(iss)) ??
unwrapMessage(ctx?.error?.(iss)) ??
unwrapMessage(config.customError?.(iss)) ??
unwrapMessage(config.localeError?.(iss)) ??
"Invalid input");
// an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter
const full = {};
for (const k of Object.keys(iss)) {
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
continue;
full[k] = iss[k];
}
full.path ?? (full.path = []);
full.message = message;
if (ctx?.reportInput) {
full.input = iss.input;
}
return full;
}
function getSizableOrigin(input) {
if (input instanceof Set)
return "set";
if (input instanceof Map)
return "map";
// @ts-ignore
if (input instanceof File)
return "file";
return "unknown";
}
const highSurrogate = /[\uD800-\uDBFF]/;
// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.
function codePointLength(str) {
const units = str.length;
if (!highSurrogate.test(str))
return units;
let count = units;
for (let i = 0; i < units - 1; i++) {
if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
count--;
i++;
}
}
return count;
}
function getLengthableOrigin(input) {
if (Array.isArray(input))
return "array";
if (typeof input === "string")
return "string";
return "unknown";
}
function parsedType(data) {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "nan" : "number";
}
case "object": {
if (data === null) {
return "null";
}
if (Array.isArray(data)) {
return "array";
}
const obj = data;
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
return obj.constructor.name;
}
}
}
return t;
}
function issue(...args) {
const [iss, input, inst] = args;
if (typeof iss === "string") {
return {
message: iss,
code: "custom",
input,
inst,
};
}
return { ...iss };
}
function cleanEnum(obj) {
return Object.entries(obj)
.filter(([k, _]) => {
// return true if NaN, meaning it's not a number, thus a string key
return Number.isNaN(Number.parseInt(k, 10));
})
.map((el) => el[1]);
}
// Codec utility functions
function base64ToUint8Array(base64) {
const binaryString = atob(base64);
const bytes = new Uint8Array(binaryString.length);
for (let i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
return bytes;
}
function uint8ArrayToBase64(bytes) {
let binaryString = "";
for (let i = 0; i < bytes.length; i++) {
binaryString += String.fromCharCode(bytes[i]);
}
return btoa(binaryString);
}
function base64urlToUint8Array(base64url) {
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
const padding = "=".repeat((4 - (base64.length % 4)) % 4);
return base64ToUint8Array(base64 + padding);
}
function uint8ArrayToBase64url(bytes) {
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
}
function hexToUint8Array(hex) {
const cleanHex = hex.replace(/^0x/, "");
if (cleanHex.length % 2 !== 0) {
throw new Error("Invalid hex string length");
}
const bytes = new Uint8Array(cleanHex.length / 2);
for (let i = 0; i < cleanHex.length; i += 2) {
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
}
return bytes;
}
function uint8ArrayToHex(bytes) {
return Array.from(bytes)
.map((b) => b.toString(16).padStart(2, "0"))
.join("");
}
// instanceof
class Class {
constructor(..._args) { }
}
exports.Class = Class;
////////// PROTOTYPE INSTALLERS //////////
//
// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see "The three axes" in AGENTS.md.
/**
* Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
*
* Call this from a `proto` initializer, which runs once per prototype — never per instance.
*/
function members(proto, table) {
for (const key in table) {
const desc = Object.getOwnPropertyDescriptor(table, key);
// a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was
if (desc.get)
Object.defineProperty(proto, key, { ...desc, enumerable: false });
// a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`
else
defineBound(proto, key, desc.value);
}
}
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
function own(inst, key, value, enumerable = true) {
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
return value;
}
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
function hide(inst, key, value) {
return own(inst, key, value, false);
}
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
function derived(computes, table) {
for (const key in computes) {
const compute = computes[key];
// an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written
Object.defineProperty(table, key, {
configurable: true,
enumerable: true,
get() {
return own(this, key, compute(this));
},
set(value) {
own(this, key, value);
},
});
}
return table;
}
function defineBound(proto, key, fn) {
Object.defineProperty(proto, key, {
configurable: true,
get() {
// vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method
return this == null ? fn : own(this, key, fn.bind(this));
},
set(value) {
own(this, key, value);
},
});
}
/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
function claim(inst, sentinel) {
const proto = Object.getPrototypeOf(inst);
// Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.
return sentinel in proto ? undefined : proto;
}
// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.
let installing;
// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.
let broke = false;
const breaker = {
configurable: true,
get() {
broke = true;
return undefined;
},
};
/**
* Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
* constructor, computed from the internals object itself and cached there on
* first read. One accessor per constructor rather than one per instance.
*/
function defineLazyInternal(inst, key, compute) {
const proto = Object.getPrototypeOf(inst._zod);
if (key in proto && installing !== inst._zod) {
// A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.
installing = undefined;
return;
}
installing = inst._zod;
Object.defineProperty(proto, key, {
configurable: true,
get() {
// Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.
Object.defineProperty(this, key, breaker);
const outer = broke;
broke = false;
try {
const value = compute(this);
// A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.
if (broke)
delete this[key];
else
Object.defineProperty(this, key, { configurable: true, writable: true, value });
broke = broke || outer;
return value;
}
catch (err) {
// A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.
delete this[key];
broke = broke || outer;
throw err;
}
},
set(value) {
Object.defineProperty(this, key, { configurable: true, writable: true, value });
},
});
}
/**
* Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
* data property. One accessor per constructor rather than one per instance, because an own accessor
* puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
*/
function installLazyProp(inst, key, make, enumerable) {
const proto = claim(inst, key);
if (!proto)
return;
Object.defineProperty(proto, key, {
configurable: true,
get() {
// Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.
const desc = { configurable: true, writable: true, enumerable, value: undefined };
Object.defineProperty(this, key, desc);
// a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches
desc.value = make(this);
Object.defineProperty(this, key, desc);
return desc.value;
},
set(value) {
Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
},
});
}
/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
exports.CONSTANT_CATCH = "~constantCatch";
/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
function constantCatch(value) {
const fn = () => value;
fn[exports.CONSTANT_CATCH] = true;
return fn;
}
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1 @@
{"version":3,"file":"get-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/get-timeline.ts"],"sourcesContent":["import { ProgressTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\"\nimport { offsetToViewTimelineRange } from \"./offset-to-range\"\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\ndeclare class ViewTimeline implements ProgressTimeline {\n constructor(options: { subject: Element; axis?: string })\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n Element,\n Map<Element | \"self\", Record<string, ProgressTimeline>>\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n const currentTime = { value: 0 }\n\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis!].progress * 100\n }, options)\n\n return { currentTime, cancel }\n}\n\nexport function getTimeline({\n source,\n container,\n ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n const { axis } = options\n\n if (source) container = source\n\n let containerCache = timelineCache.get(container)\n if (!containerCache) {\n containerCache = new Map()\n timelineCache.set(container, containerCache)\n }\n\n const targetKey = options.target ?? \"self\"\n let targetCache = containerCache.get(targetKey)\n if (!targetCache) {\n targetCache = {}\n containerCache.set(targetKey, targetCache)\n }\n\n const axisKey = axis + (options.offset ?? []).join(\",\")\n\n if (!targetCache[axisKey]) {\n if (options.target && canUseNativeTimeline(options.target)) {\n const range = offsetToViewTimelineRange(options.offset)\n if (range) {\n targetCache[axisKey] = new ViewTimeline({\n subject: options.target,\n axis,\n })\n } else {\n targetCache[axisKey] = scrollTimelineFallback({\n container,\n ...options,\n })\n }\n } else if (canUseNativeTimeline()) {\n targetCache[axisKey] = new ScrollTimeline({\n source: container,\n axis,\n } as any)\n } else {\n targetCache[axisKey] = scrollTimelineFallback({\n container,\n ...options,\n })\n }\n }\n\n return targetCache[axisKey]!\n}\n"],"names":[],"mappings":";;;;AAsBA,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B;AAEH,SAAS,sBAAsB,CAAC,OAAkC,EAAA;AAC9D,IAAA,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE;AAEhC,IAAA,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,IAAI,KAAI;AAC/B,QAAA,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,QAAQ,GAAG,GAAG;IAC1D,CAAC,EAAE,OAAO,CAAC;AAEX,IAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE;AAClC;AAEM,SAAU,WAAW,CAAC,EACxB,MAAM,EACN,SAAS,EACT,GAAG,OAAO,EACc,EAAA;AACxB,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO;AAExB,IAAA,IAAI,MAAM;QAAE,SAAS,GAAG,MAAM;IAE9B,IAAI,cAAc,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC;IACjD,IAAI,CAAC,cAAc,EAAE;AACjB,QAAA,cAAc,GAAG,IAAI,GAAG,EAAE;AAC1B,QAAA,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,CAAC;IAChD;AAEA,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM;IAC1C,IAAI,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC;IAC/C,IAAI,CAAC,WAAW,EAAE;QACd,WAAW,GAAG,EAAE;AAChB,QAAA,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC;IAC9C;AAEA,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC;AAEvD,IAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QACvB,IAAI,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACxD,MAAM,KAAK,GAAG,yBAAyB,CAAC,OAAO,CAAC,MAAM,CAAC;YACvD,IAAI,KAAK,EAAE;AACP,gBAAA,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,YAAY,CAAC;oBACpC,OAAO,EAAE,OAAO,CAAC,MAAM;oBACvB,IAAI;AACP,iBAAA,CAAC;YACN;iBAAO;AACH,gBAAA,WAAW,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC;oBAC1C,SAAS;AACT,oBAAA,GAAG,OAAO;AACb,iBAAA,CAAC;YACN;QACJ;aAAO,IAAI,oBAAoB,EAAE,EAAE;AAC/B,YAAA,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,cAAc,CAAC;AACtC,gBAAA,MAAM,EAAE,SAAS;gBACjB,IAAI;AACA,aAAA,CAAC;QACb;aAAO;AACH,YAAA,WAAW,CAAC,OAAO,CAAC,GAAG,sBAAsB,CAAC;gBAC1C,SAAS;AACT,gBAAA,GAAG,OAAO;AACb,aAAA,CAAC;QACN;IACJ;AAEA,IAAA,OAAO,WAAW,CAAC,OAAO,CAAE;AAChC;;;;"}
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var UI_1 = require("./UI");
var sidecar_1 = tslib_1.__importDefault(require("./sidecar"));
var ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(UI_1.RemoveScroll, tslib_1.__assign({}, props, { ref: ref, sideCar: sidecar_1.default }))); });
ReactRemoveScroll.classNames = UI_1.RemoveScroll.classNames;
exports.default = ReactRemoveScroll;
@@ -0,0 +1,10 @@
import { cubicBezier } from './cubic-bezier.mjs';
import { mirrorEasing } from './modifiers/mirror.mjs';
import { reverseEasing } from './modifiers/reverse.mjs';
const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);
const backIn = /*@__PURE__*/ reverseEasing(backOut);
const backInOut = /*@__PURE__*/ mirrorEasing(backIn);
export { backIn, backInOut, backOut };
//# sourceMappingURL=back.mjs.map
@@ -0,0 +1,24 @@
/**
* @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 ImagePlay = createLucideIcon("ImagePlay", [
["path", { d: "m11 16-5 5", key: "j5f7ct" }],
["path", { d: "M11 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6.5", key: "7s81lt" }],
[
"path",
{
d: "M15.765 22a.5.5 0 0 1-.765-.424V13.38a.5.5 0 0 1 .765-.424l5.878 3.674a1 1 0 0 1 0 1.696z",
key: "1omb6s"
}
],
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
]);
export { ImagePlay as default };
//# sourceMappingURL=image-play.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_vN _XC","2":"_g _OG _L"},D:{"1":"_5F","2":"_8H"},E:{"1":"_pB","2":"_qB"},F:{"1":"_OI","2":"_RK"},G:{"1":"_9","2":"_iB"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"CSS font-stretch",D:true};
@@ -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 PilcrowRight = createLucideIcon("PilcrowRight", [
["path", { d: "M10 3v11", key: "o3l5kj" }],
["path", { d: "M10 9H7a1 1 0 0 1 0-6h8", key: "1wb1nc" }],
["path", { d: "M14 3v11", key: "mlfb7b" }],
["path", { d: "m18 14 4 4H2", key: "4r8io1" }],
["path", { d: "m22 18-4 4", key: "1hjjrd" }]
]);
export { PilcrowRight as default };
//# sourceMappingURL=pilcrow-right.js.map
@@ -0,0 +1 @@
{"version":3,"file":"clipboard-paste.js","sources":["../../../src/icons/clipboard-paste.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ClipboardPaste\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg5YTEgMSAwIDAgMC0xIDF2MmMwIC42LjQgMSAxIDFoNmMuNiAwIDEtLjQgMS0xVjNjMC0uNi0uNC0xLTEtMVoiIC8+CiAgPHBhdGggZD0iTTggNEg2YTIgMiAwIDAgMC0yIDJ2MTRhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yTTE2IDRoMmEyIDIgMCAwIDEgMiAydjJNMTEgMTRoMTAiIC8+CiAgPHBhdGggZD0ibTE3IDEwIDQgNC00IDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/clipboard-paste\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 ClipboardPaste = createLucideIcon('ClipboardPaste', [\n [\n 'path',\n { d: 'M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z', key: '1pp7kr' },\n ],\n [\n 'path',\n {\n d: 'M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10',\n key: '2ik1ml',\n },\n ],\n ['path', { d: 'm17 10 4 4-4 4', key: 'vp2hj1' }],\n]);\n\nexport default ClipboardPaste;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC9F,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,203 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @generated
*/
/*
* !!! GENERATED FILE !!!
*
* Any manual changes to this file will be overwritten. To regenerate run `yarn build`.
*/
// lint directives to let us do some basic validation of generated files
/* eslint no-undef: 'error', no-unused-vars: ['error', {vars: "local"}], no-redeclare: 'error' */
/* global $NonMaybeType, Partial, $ReadOnly, $ReadOnlyArray, $FlowFixMe */
'use strict';
module.exports = {
AnyTypeAnnotation: [],
ArrayExpression: ['elements'],
ArrayPattern: ['elements', 'typeAnnotation'],
ArrayTypeAnnotation: ['elementType'],
ArrowFunctionExpression: ['id', 'params', 'body', 'typeParameters', 'returnType', 'predicate'],
AsConstExpression: ['expression'],
AsExpression: ['expression', 'typeAnnotation'],
AssignmentExpression: ['left', 'right'],
AssignmentPattern: ['left', 'right'],
AwaitExpression: ['argument'],
BigIntLiteralTypeAnnotation: [],
BigIntTypeAnnotation: [],
BinaryExpression: ['left', 'right'],
BlockStatement: ['body'],
BooleanLiteralTypeAnnotation: [],
BooleanTypeAnnotation: [],
BreakStatement: ['label'],
CallExpression: ['callee', 'typeArguments', 'arguments'],
CatchClause: ['param', 'body'],
ChainExpression: ['expression'],
ClassBody: ['body'],
ClassDeclaration: ['id', 'typeParameters', 'superClass', 'superTypeParameters', 'implements', 'decorators', 'body'],
ClassExpression: ['id', 'typeParameters', 'superClass', 'superTypeParameters', 'implements', 'decorators', 'body'],
ClassImplements: ['id', 'typeParameters'],
ComponentDeclaration: ['id', 'params', 'body', 'typeParameters', 'rendersType'],
ComponentParameter: ['name', 'local'],
ComponentTypeAnnotation: ['params', 'rest', 'typeParameters', 'rendersType'],
ComponentTypeParameter: ['name', 'typeAnnotation'],
ConditionalExpression: ['test', 'consequent', 'alternate'],
ConditionalTypeAnnotation: ['checkType', 'extendsType', 'trueType', 'falseType'],
ContinueStatement: ['label'],
DebuggerStatement: [],
DeclareClass: ['id', 'typeParameters', 'extends', 'implements', 'mixins', 'body'],
DeclareComponent: ['id', 'params', 'rest', 'typeParameters', 'rendersType'],
DeclaredPredicate: ['value'],
DeclareEnum: ['id', 'body'],
DeclareExportAllDeclaration: ['source'],
DeclareExportDeclaration: ['declaration', 'specifiers', 'source'],
DeclareFunction: ['id', 'predicate'],
DeclareHook: ['id'],
DeclareInterface: ['id', 'typeParameters', 'extends', 'body'],
DeclareModule: ['id', 'body'],
DeclareModuleExports: ['typeAnnotation'],
DeclareNamespace: ['id', 'body'],
DeclareOpaqueType: ['id', 'typeParameters', 'impltype', 'supertype'],
DeclareTypeAlias: ['id', 'typeParameters', 'right'],
DeclareVariable: ['id'],
DoWhileStatement: ['body', 'test'],
EmptyStatement: [],
EmptyTypeAnnotation: [],
EnumBigIntBody: ['members'],
EnumBigIntMember: ['id', 'init'],
EnumBooleanBody: ['members'],
EnumBooleanMember: ['id', 'init'],
EnumDeclaration: ['id', 'body'],
EnumDefaultedMember: ['id'],
EnumNumberBody: ['members'],
EnumNumberMember: ['id', 'init'],
EnumStringBody: ['members'],
EnumStringMember: ['id', 'init'],
EnumSymbolBody: ['members'],
ExistsTypeAnnotation: [],
ExportAllDeclaration: ['exported', 'source'],
ExportDefaultDeclaration: ['declaration'],
ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
ExportSpecifier: ['exported', 'local'],
ExpressionStatement: ['expression'],
ForInStatement: ['left', 'right', 'body'],
ForOfStatement: ['left', 'right', 'body'],
ForStatement: ['init', 'test', 'update', 'body'],
FunctionDeclaration: ['id', 'params', 'body', 'typeParameters', 'returnType', 'predicate'],
FunctionExpression: ['id', 'params', 'body', 'typeParameters', 'returnType', 'predicate'],
FunctionTypeAnnotation: ['params', 'this', 'returnType', 'rest', 'typeParameters'],
FunctionTypeParam: ['name', 'typeAnnotation'],
GenericTypeAnnotation: ['id', 'typeParameters'],
HookDeclaration: ['id', 'params', 'body', 'typeParameters', 'returnType'],
HookTypeAnnotation: ['params', 'returnType', 'rest', 'typeParameters'],
Identifier: ['typeAnnotation'],
IfStatement: ['test', 'consequent', 'alternate'],
ImportAttribute: ['key', 'value'],
ImportDeclaration: ['specifiers', 'source', 'assertions'],
ImportDefaultSpecifier: ['local'],
ImportExpression: ['source', 'attributes'],
ImportNamespaceSpecifier: ['local'],
ImportSpecifier: ['imported', 'local'],
IndexedAccessType: ['objectType', 'indexType'],
InferredPredicate: [],
InferTypeAnnotation: ['typeParameter'],
InterfaceDeclaration: ['id', 'typeParameters', 'extends', 'body'],
InterfaceExtends: ['id', 'typeParameters'],
InterfaceTypeAnnotation: ['extends', 'body'],
IntersectionTypeAnnotation: ['types'],
JSXAttribute: ['name', 'value'],
JSXClosingElement: ['name'],
JSXClosingFragment: [],
JSXElement: ['openingElement', 'children', 'closingElement'],
JSXEmptyExpression: [],
JSXExpressionContainer: ['expression'],
JSXFragment: ['openingFragment', 'children', 'closingFragment'],
JSXIdentifier: [],
JSXMemberExpression: ['object', 'property'],
JSXNamespacedName: ['namespace', 'name'],
JSXOpeningElement: ['name', 'attributes', 'typeArguments'],
JSXOpeningFragment: [],
JSXSpreadAttribute: ['argument'],
JSXSpreadChild: ['expression'],
JSXText: [],
KeyofTypeAnnotation: ['argument'],
LabeledStatement: ['label', 'body'],
LogicalExpression: ['left', 'right'],
MemberExpression: ['object', 'property'],
MetaProperty: ['meta', 'property'],
MethodDefinition: ['key', 'value'],
MixedTypeAnnotation: [],
NewExpression: ['callee', 'typeArguments', 'arguments'],
NullableTypeAnnotation: ['typeAnnotation'],
NullLiteralTypeAnnotation: [],
NumberLiteralTypeAnnotation: [],
NumberTypeAnnotation: [],
ObjectExpression: ['properties'],
ObjectPattern: ['properties', 'typeAnnotation'],
ObjectTypeAnnotation: ['properties', 'indexers', 'callProperties', 'internalSlots'],
ObjectTypeCallProperty: ['value'],
ObjectTypeIndexer: ['id', 'key', 'value', 'variance'],
ObjectTypeInternalSlot: ['id', 'value'],
ObjectTypeMappedTypeProperty: ['keyTparam', 'propType', 'sourceType', 'variance'],
ObjectTypeProperty: ['key', 'value', 'variance'],
ObjectTypeSpreadProperty: ['argument'],
OpaqueType: ['id', 'typeParameters', 'impltype', 'supertype'],
OptionalIndexedAccessType: ['objectType', 'indexType'],
PrivateIdentifier: [],
Program: ['body'],
Property: ['key', 'value'],
PropertyDefinition: ['key', 'value', 'variance', 'typeAnnotation'],
QualifiedTypeIdentifier: ['qualification', 'id'],
QualifiedTypeofIdentifier: ['qualification', 'id'],
RestElement: ['argument'],
ReturnStatement: ['argument'],
SequenceExpression: ['expressions'],
SpreadElement: ['argument'],
StringLiteralTypeAnnotation: [],
StringTypeAnnotation: [],
Super: [],
SwitchCase: ['test', 'consequent'],
SwitchStatement: ['discriminant', 'cases'],
SymbolTypeAnnotation: [],
TaggedTemplateExpression: ['tag', 'quasi'],
TemplateElement: [],
TemplateLiteral: ['quasis', 'expressions'],
ThisExpression: [],
ThisTypeAnnotation: [],
ThrowStatement: ['argument'],
TryStatement: ['block', 'handler', 'finalizer'],
TupleTypeAnnotation: ['types'],
TupleTypeLabeledElement: ['label', 'elementType', 'variance'],
TupleTypeSpreadElement: ['label', 'typeAnnotation'],
TypeAlias: ['id', 'typeParameters', 'right'],
TypeAnnotation: ['typeAnnotation'],
TypeCastExpression: ['expression', 'typeAnnotation'],
TypeofTypeAnnotation: ['argument', 'typeArguments'],
TypeOperator: ['typeAnnotation'],
TypeParameter: ['bound', 'variance', 'default'],
TypeParameterDeclaration: ['params'],
TypeParameterInstantiation: ['params'],
TypePredicate: ['parameterName', 'typeAnnotation'],
UnaryExpression: ['argument'],
UnionTypeAnnotation: ['types'],
UpdateExpression: ['argument'],
VariableDeclaration: ['declarations'],
VariableDeclarator: ['id', 'init'],
Variance: [],
VoidTypeAnnotation: [],
WhileStatement: ['test', 'body'],
WithStatement: ['object', 'body'],
YieldExpression: ['argument'],
OptionalMemberExpression: ['object', 'property'],
OptionalCallExpression: ['callee', 'typeArguments', 'arguments'],
Literal: []
};
@@ -0,0 +1,24 @@
//#region src/adapter/netlify/conninfo.ts
/**
* Get connection information from Netlify
* @param c - Context
* @returns Connection information including remote address
* @example
* ```ts
* import { Hono } from 'hono'
* import { handle, getConnInfo } from 'hono/netlify'
*
* const app = new Hono()
*
* app.get('/', (c) => {
* const info = getConnInfo(c)
* return c.text(`Your IP: ${info.remote.address}`)
* })
*
* export default handle(app)
* ```
* @deprecated `hono/netlify` will be removed in v5. Install `@hono/netlify` and import from there instead.
*/
const getConnInfo = (c) => ({ remote: { address: c.env.context?.ip } });
//#endregion
export { getConnInfo };
@@ -0,0 +1,41 @@
import { addUniqueItem, removeItem } from './array.mjs';
class SubscriptionManager {
constructor() {
this.subscriptions = [];
}
add(handler) {
addUniqueItem(this.subscriptions, handler);
return () => removeItem(this.subscriptions, handler);
}
notify(a, b, c) {
const numSubscriptions = this.subscriptions.length;
if (!numSubscriptions)
return;
if (numSubscriptions === 1) {
/**
* If there's only a single handler we can just call it without invoking a loop.
*/
this.subscriptions[0](a, b, c);
}
else {
for (let i = 0; i < numSubscriptions; i++) {
/**
* Check whether the handler exists before firing as it's possible
* the subscriptions were modified during this loop running.
*/
const handler = this.subscriptions[i];
handler && handler(a, b, c);
}
}
}
getSize() {
return this.subscriptions.length;
}
clear() {
this.subscriptions.length = 0;
}
}
export { SubscriptionManager };
//# sourceMappingURL=subscription-manager.mjs.map
@@ -0,0 +1,793 @@
# undici
<!--type=misc-->
[![Node CI](https://github.com/nodejs/undici/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [![neostandard javascript style](https://img.shields.io/badge/neo-standard-7fffff?style=flat\&labelColor=ff80ff)](https://github.com/neostandard/neostandard) [![npm version](https://badge.fury.io/js/undici.svg)](https://badge.fury.io/js/undici) [![codecov](https://codecov.io/gh/nodejs/undici/branch/main/graph/badge.svg?token=yZL6LtXkOA)](https://codecov.io/gh/nodejs/undici)
An HTTP/1.1 client, written from scratch for Node.js.
> Undici means eleven in Italian. 1.1 -> 11 -> Eleven -> Undici.
It is also a Stranger Things reference.
## How to get involved
Have a question about using Undici? Open a [Q&A Discussion](https://github.com/nodejs/undici/discussions/new) or join our official OpenJS [Slack](https://openjs-foundation.slack.com/archives/C01QF9Q31QD) channel.
Looking to contribute? Start by reading the [contributing guide](https://github.com/nodejs/undici/blob/main/CONTRIBUTING.md)
## Install
```bash
npm i undici
```
## Benchmarks
The benchmark is a simple getting data [example](https://github.com/nodejs/undici/blob/main/benchmarks/benchmark.js) using
50 TCP connections with a pipelining depth of 10 running on Node 24.14.1.
### HTTP/1.1
```text
┌────────────────────────┬─────────┬────────────────────┬────────────┬─────────────────────────┐
│ Tests │ Samples │ Result │ Tolerance │ Difference with slowest │
├────────────────────────┼─────────┼────────────────────┼────────────┼─────────────────────────┤
│ 'node-fetch' │ 50 │ '4711.86 req/sec' │ '± 2.92 %' │ '-' │
│ 'undici - fetch' │ 75 │ '5438.50 req/sec' │ '± 2.97 %' │ '+ 15.42 %' │
│ 'axios' │ 45 │ '5448.08 req/sec' │ '± 2.98 %' │ '+ 15.62 %' │
│ 'request' │ 65 │ '5809.63 req/sec' │ '± 2.90 %' │ '+ 23.30 %' │
│ 'http - no keepalive' │ 35 │ '5910.77 req/sec' │ '± 2.87 %' │ '+ 25.44 %' │
│ 'got' │ 50 │ '6047.80 req/sec' │ '± 2.91 %' │ '+ 28.35 %' │
│ 'superagent' │ 60 │ '7534.53 req/sec' │ '± 2.97 %' │ '+ 59.91 %' │
│ 'http - keepalive' │ 75 │ '9343.41 req/sec' │ '± 2.90 %' │ '+ 98.30 %' │
│ 'undici - pipeline' │ 65 │ '13470.70 req/sec' │ '± 2.93 %' │ '+ 185.89 %' │
│ 'undici - request' │ 80 │ '16850.87 req/sec' │ '± 2.93 %' │ '+ 257.63 %' │
│ 'undici - stream' │ 101 │ '18488.56 req/sec' │ '± 3.81 %' │ '+ 292.38 %' │
│ 'undici - dispatch' │ 101 │ '20786.44 req/sec' │ '± 3.08 %' │ '+ 341.15 %' │
└────────────────────────┴─────────┴────────────────────┴────────────┴─────────────────────────┘
```
### HTTP/1.1 over HTTPS
Using [benchmark-https.js](https://github.com/nodejs/undici/blob/main/benchmarks/benchmark-https.js) against an h1-over-TLS server (50 connections, pipelining depth 10, Node 24.14.1).
```text
┌────────────────────────┬─────────┬───────────────────┬────────────┬─────────────────────────┐
│ Tests │ Samples │ Result │ Tolerance │ Difference with slowest │
├────────────────────────┼─────────┼───────────────────┼────────────┼─────────────────────────┤
│ 'https - no keepalive'│ 10 │ '1358.40 req/sec' │ '± 1.99 %' │ '-' │
│ 'undici - fetch' │ 30 │ '3721.76 req/sec' │ '± 2.97 %' │ '+ 173.98 %' │
│ 'https - keepalive' │ 35 │ '5633.91 req/sec' │ '± 2.84 %' │ '+ 314.75 %' │
│ 'undici - pipeline' │ 15 │ '6254.05 req/sec' │ '± 2.80 %' │ '+ 360.40 %' │
│ 'undici - request' │ 25 │ '6669.80 req/sec' │ '± 2.73 %' │ '+ 391.01 %' │
│ 'undici - stream' │ 25 │ '7019.04 req/sec' │ '± 2.77 %' │ '+ 416.71 %' │
│ 'undici - dispatch' │ 20 │ '7361.85 req/sec' │ '± 2.90 %' │ '+ 441.95 %' │
└────────────────────────┴─────────┴───────────────────┴────────────┴─────────────────────────┘
```
### HTTP/2
Using [benchmark-http2.js](https://github.com/nodejs/undici/blob/main/benchmarks/benchmark-http2.js) against an h2 server (50 connections, pipelining depth 10, Node 24.14.1).
```text
┌────────────────────────┬─────────┬───────────────────┬────────────┬─────────────────────────┐
│ Tests │ Samples │ Result │ Tolerance │ Difference with slowest │
├────────────────────────┼─────────┼───────────────────┼────────────┼─────────────────────────┤
│ 'undici - fetch' │ 45 │ '3499.03 req/sec' │ '± 2.93 %' │ '-' │
│ 'native - http2' │ 25 │ '4904.58 req/sec' │ '± 2.81 %' │ '+ 40.17 %' │
│ 'undici - pipeline' │ 60 │ '5836.82 req/sec' │ '± 2.99 %' │ '+ 66.81 %' │
│ 'undici - request' │ 65 │ '6831.25 req/sec' │ '± 2.83 %' │ '+ 95.23 %' │
│ 'undici - stream' │ 55 │ '6874.30 req/sec' │ '± 2.91 %' │ '+ 96.46 %' │
│ 'undici - dispatch' │ 55 │ '7791.23 req/sec' │ '± 2.96 %' │ '+ 122.67 %' │
└────────────────────────┴─────────┴───────────────────┴────────────┴─────────────────────────┘
```
## Undici vs. Fetch
### Overview
Node.js includes a built-in `fetch()` implementation powered by undici starting from Node.js v18. However, there are important differences between using the built-in fetch and installing undici as a separate module.
### Built-in Fetch (Node.js v18+)
Node.js's built-in fetch is powered by a bundled version of undici:
```js
// Available globally in Node.js v18+
const response = await fetch('https://api.example.com/data');
const data = await response.json();
// Check the bundled undici version
console.log(process.versions.undici); // e.g., "5.28.4"
```
**Pros:**
- No additional dependencies required
- Works across different JavaScript runtimes
- Automatic compression handling (gzip, deflate, br)
- Built-in caching support (in development)
**Cons:**
- Limited to the undici version bundled with your Node.js version
- Less control over connection pooling and advanced features
- Error handling follows Web API standards (errors wrapped in `TypeError`)
- Performance overhead due to Web Streams implementation
### Undici Module
Installing undici as a separate module gives you access to the latest features and APIs:
```bash
npm install undici
```
```js
import { request, fetch, Agent, setGlobalDispatcher } from 'undici';
// Use undici.request for maximum performance
const { statusCode, headers, body } = await request('https://api.example.com/data');
const data = await body.json();
// Or use undici.fetch with custom configuration
const agent = new Agent({ keepAliveTimeout: 10000 });
setGlobalDispatcher(agent);
const response = await fetch('https://api.example.com/data');
```
**Pros:**
- Latest undici features and bug fixes
- Access to advanced APIs (`request`, `stream`, `pipeline`)
- Fine-grained control over connection pooling
- Better error handling with clearer error messages
- Superior performance, especially with `undici.request`
- HTTP/1.1 pipelining support
- Custom interceptors and middleware
- Advanced features like `ProxyAgent`, `Socks5Agent`, `MockAgent`
**Cons:**
- Additional dependency to manage
- Larger bundle size
### When to Use Each
#### Use Built-in Fetch When:
- You want zero dependencies
- Building isomorphic code that runs in browsers and Node.js
- Publishing to npm and want to maximize compatibility with JS runtimes
- Simple HTTP requests without advanced configuration
- You're publishing to npm and you want to maximize compatiblity
- You don't depend on features from a specific version of undici
#### Use Undici Module When:
- You need the latest undici features and performance improvements
- You require advanced connection pooling configuration
- You need APIs not available in the built-in fetch (`ProxyAgent`, `Socks5Agent`, `MockAgent`, etc.)
- Performance is critical (use `undici.request` for maximum speed)
- You want better error handling and debugging capabilities
- You need HTTP/1.1 pipelining or advanced interceptors
- You prefer decoupled protocol and API interfaces
### Performance Comparison
Based on benchmarks, here's the typical performance hierarchy:
1. **`undici.request()`** - Fastest, most efficient
2. **`undici.fetch()`** - Good performance, standard compliance
3. **Node.js `http`/`https`** - Baseline performance
### Migration Guide
If you're currently using built-in fetch and want to migrate to undici:
```js
// Before: Built-in fetch
const response = await fetch('https://api.example.com/data');
// After: Undici fetch (drop-in replacement)
import { fetch } from 'undici';
const response = await fetch('https://api.example.com/data');
// Or: Undici request (better performance)
import { request } from 'undici';
const { statusCode, body } = await request('https://api.example.com/data');
const data = await body.json();
```
### Keep `fetch` and `FormData` together
When you send a `FormData` body, keep `fetch` and `FormData` from the same
implementation.
Use one of these patterns:
```js
// Built-in globals
const body = new FormData()
body.set('name', 'some')
await fetch('https://example.com', {
method: 'POST',
body
})
```
```js
// undici module imports
import { fetch, FormData } from 'undici'
const body = new FormData()
body.set('name', 'some')
await fetch('https://example.com', {
method: 'POST',
body
})
```
If you want the installed `undici` package to provide the globals, call
`install()` first:
```js
import { install } from 'undici'
install()
const body = new FormData()
body.set('name', 'some')
await fetch('https://example.com', {
method: 'POST',
body
})
```
`install()` replaces the global `fetch`, `Headers`, `Response`, `Request`, and
`FormData` implementations with undici's versions, so they all match. It also
installs undici's `WebSocket`, `CloseEvent`, `ErrorEvent`, `MessageEvent`, and
`EventSource` globals.
Avoid mixing a global `FormData` with `undici.fetch()`, or `undici.FormData`
with the built-in global `fetch()`.
### Version Compatibility
You can check which version of undici is bundled with your Node.js version:
```js
console.log(process.versions.undici);
```
Installing undici as a module allows you to use a newer version than what's bundled with Node.js, giving you access to the latest features and performance improvements.
## Quick Start
### Basic Request
```js
import { request } from 'undici'
const {
statusCode,
headers,
trailers,
body
} = await request('http://localhost:3000/foo')
console.log('response received', statusCode)
console.log('headers', headers)
for await (const data of body) { console.log('data', data) }
console.log('trailers', trailers)
```
### Using Cache Interceptor
Undici provides a powerful HTTP caching interceptor that follows HTTP caching best practices. Here's how to use it:
```js
import { fetch, Agent, interceptors, cacheStores } from 'undici';
// Create a client with cache interceptor
const client = new Agent().compose(interceptors.cache({
// Optional: Configure cache store (defaults to MemoryCacheStore)
store: new cacheStores.MemoryCacheStore({
maxSize: 100 * 1024 * 1024, // 100MB
maxCount: 1000,
maxEntrySize: 5 * 1024 * 1024 // 5MB
}),
// Optional: Specify which HTTP methods to cache (default: ['GET', 'HEAD'])
methods: ['GET', 'HEAD']
}));
// Set the global dispatcher to use our caching client
setGlobalDispatcher(client);
// Now all fetch requests will use the cache
async function getData() {
const response = await fetch('https://api.example.com/data');
// The server should set appropriate Cache-Control headers in the response
// which the cache will respect based on the cache policy
return response.json();
}
// First request - fetches from origin
const data1 = await getData();
// Second request - served from cache if within max-age
const data2 = await getData();
```
#### Key Features:
- **Automatic Caching**: Respects `Cache-Control` and `Expires` headers
- **Validation**: Supports `ETag` and `Last-Modified` validation
- **Storage Options**: In-memory or persistent SQLite storage
- **Flexible**: Configure cache size, TTL, and more
## Global Installation
Undici provides an `install()` function to add fetch-related and other web API classes to `globalThis`, making them available globally:
```js
import { install } from 'undici'
// Install undici's global web APIs
install()
// Now you can use fetch classes globally without importing
const response = await fetch('https://api.example.com/data')
const data = await response.json()
// All classes are available globally:
const headers = new Headers([['content-type', 'application/json']])
const request = new Request('https://example.com')
const formData = new FormData()
const ws = new WebSocket('wss://example.com')
const eventSource = new EventSource('https://example.com/events')
```
The `install()` function adds the following classes to `globalThis`:
- `fetch` - The fetch function
- `Headers` - HTTP headers management
- `Response` - HTTP response representation
- `Request` - HTTP request representation
- `FormData` - Form data handling
- `WebSocket` - WebSocket client
- `CloseEvent`, `ErrorEvent`, `MessageEvent` - WebSocket events
- `EventSource` - Server-sent events client
When you call `install()`, these globals come from the same undici
implementation. For example, global `fetch` and global `FormData` will both be
undici's versions, and `WebSocket` and `EventSource` will also come from
undici, which is the recommended setup if you want to use undici through
globals.
This is useful for:
- Polyfilling environments that don't have fetch
- Ensuring consistent fetch behavior across different Node.js versions
- Making undici's implementations available globally for libraries that expect them
## Body Mixins
The `body` mixins are the most common way to format the request/response body. Mixins include:
- [`.arrayBuffer()`](https://fetch.spec.whatwg.org/#dom-body-arraybuffer)
- [`.blob()`](https://fetch.spec.whatwg.org/#dom-body-blob)
- [`.bytes()`](https://fetch.spec.whatwg.org/#dom-body-bytes)
- [`.json()`](https://fetch.spec.whatwg.org/#dom-body-json)
- [`.text()`](https://fetch.spec.whatwg.org/#dom-body-text)
> [!NOTE]
> The body returned from `undici.request` does not implement `.formData()`.
> [!WARNING]
> The body mixins `.arrayBuffer()`, `.blob()`, `.bytes()`, `.json()`, `.text()`,
> and `.formData()` buffer the entire body in memory before returning. Where
> applicable, they also decode or parse the payload and retain that
> representation in memory. Calling these methods therefore means trusting that
> the response body is small enough to fit in the available memory. Do not use
> them for responses from untrusted or user-controlled sources. Instead, consume
> the response body as a stream and enforce an application-specific size limit:
> use `response.body` for fetch responses or the `body` returned by
> `undici.request()`. For streaming decoded text, use `body.textStream()` on a
> fetch `Request` or `Response`.
Example usage:
```js
import { request } from 'undici'
const {
statusCode,
headers,
trailers,
body
} = await request('http://localhost:3000/foo')
console.log('response received', statusCode)
console.log('headers', headers)
console.log('data', await body.json())
console.log('trailers', trailers)
```
_Note: Once a mixin has been called then the body cannot be reused, thus calling additional mixins on `.body`, e.g. `.body.json(); .body.text()` will result in an error `TypeError: unusable` being thrown and returned through the `Promise` rejection._
Should you need to access the `body` in plain-text after using a mixin, the best practice is to use the `.text()` mixin first and then manually parse the text to the desired format.
For more information about their behavior, please reference the body mixin from the [Fetch Standard](https://fetch.spec.whatwg.org/#body-mixin).
## Common API Methods
This section documents our most commonly used API methods. Additional APIs are documented in their own files within the [`api`](./api/) folder and are accessible via the navigation list on the left side of the docs site.
For the top-level APIs below, the `url` argument supplies the request origin and
path. Do not pass `origin` or `path` in the second `options` argument. The linked
`Dispatcher` option types include those fields because dispatcher methods are
lower-level APIs that do not receive a separate `url` argument.
### `undici.request([url, options])`
* `url` {string|URL|UrlObject}
* `options` {RequestOptions} See [`RequestOptions`](./api/Dispatcher.md#parameter-requestoptions).
* `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
* `method` {string} **Default:** `PUT` if `options.body`, otherwise `GET`.
* Returns: {Promise} A promise with the result of the `Dispatcher.request` method.
Calls `options.dispatcher.request(options)`.
See [Dispatcher.request](./api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](https://github.com/nodejs/undici/blob/main/docs/examples/README.md) for examples.
### `undici.stream([url, options, ]factory)`
* `url` {string|URL|UrlObject}
* `options` {StreamOptions} See [`StreamOptions`](./api/Dispatcher.md#parameter-streamoptions).
* `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
* `method` {string} **Default:** `PUT` if `options.body`, otherwise `GET`.
* `factory` {Function} `Dispatcher.stream.factory`.
* Returns: {Promise} A promise with the result of the `Dispatcher.stream` method.
Calls `options.dispatcher.stream(options, factory)`.
See [Dispatcher.stream](./api/Dispatcher.md#dispatcherstreamoptions-factory-callback) for more details.
### `undici.pipeline([url, options, ]handler)`
* `url` {string|URL|UrlObject}
* `options` {PipelineOptions} See [`PipelineOptions`](./api/Dispatcher.md#parameter-pipelineoptions).
* `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
* `method` {string} **Default:** `PUT` if `options.body`, otherwise `GET`.
* `handler` {Function} `Dispatcher.pipeline.handler`.
* Returns: {Duplex} A `stream.Duplex`.
Calls `options.dispatch.pipeline(options, handler)`.
See [Dispatcher.pipeline](./api/Dispatcher.md#dispatcherpipelineoptions-handler) for more details.
### `undici.connect([url, options])`
Starts two-way communications with the requested resource using [HTTP CONNECT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT).
* `url` {string|URL|UrlObject}
* `options` {ConnectOptions} See [`ConnectOptions`](./api/Dispatcher.md#parameter-connectoptions).
* `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
* `callback` {Function} (optional) — `(err, data) => void`.
* Returns: {Promise} A promise with the result of the `Dispatcher.connect` method.
Calls `options.dispatch.connect(options)`.
See [Dispatcher.connect](./api/Dispatcher.md#dispatcherconnectoptions-callback) for more details.
### `undici.fetch(input[, init])`
Implements [fetch](https://fetch.spec.whatwg.org/#fetch-method).
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
* https://fetch.spec.whatwg.org/#fetch-method
Basic usage example:
```js
import { fetch } from 'undici'
const res = await fetch('https://example.com')
const json = await res.json()
console.log(json)
```
You can pass an optional dispatcher to `fetch` as:
```js
import { fetch, Agent } from 'undici'
const res = await fetch('https://example.com', {
// Mocks are also supported
dispatcher: new Agent({
keepAliveTimeout: 10,
keepAliveMaxTimeout: 10
})
})
const json = await res.json()
console.log(json)
```
#### `request.body`
A body can be of the following types:
- ArrayBuffer
- ArrayBufferView
- AsyncIterables
- Blob
- Iterables
- String
- URLSearchParams
- FormData
In this implementation of fetch, ```request.body``` now accepts ```Async Iterables```. It is not present in the [Fetch Standard](https://fetch.spec.whatwg.org).
```js
import { fetch } from 'undici'
const data = {
async *[Symbol.asyncIterator]() {
yield 'hello'
yield 'world'
},
}
await fetch('https://example.com', { body: data, method: 'POST', duplex: 'half' })
```
[FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) besides text data and buffers can also utilize streams via [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects:
```js
import { openAsBlob } from 'node:fs'
const file = await openAsBlob('./big.csv')
const body = new FormData()
body.set('file', file, 'big.csv')
await fetch('http://example.com', { method: 'POST', body })
```
#### `request.duplex`
- `'half'`
In this implementation of fetch, `request.duplex` must be set if `request.body` is `ReadableStream` or `Async Iterables`, however, even though the value must be set to `'half'`, it is actually a _full_ duplex. For more detail refer to the [Fetch Standard](https://fetch.spec.whatwg.org/#dom-requestinit-duplex).
#### `response.body`
Nodejs has two kinds of streams: [web streams](https://nodejs.org/api/webstreams.html), which follow the API of the WHATWG web standard found in browsers, and an older Node-specific [streams API](https://nodejs.org/api/stream.html). `response.body` returns a readable web stream. If you would prefer to work with a Node stream you can convert a web stream using `.fromWeb()`.
```js
import { fetch } from 'undici'
import { Readable } from 'node:stream'
const response = await fetch('https://example.com')
const readableWebStream = response.body
const readableNodeStream = Readable.fromWeb(readableWebStream)
```
## Specification Compliance
This section documents parts of the [HTTP/1.1](https://www.rfc-editor.org/rfc/rfc9110.html) and [Fetch Standard](https://fetch.spec.whatwg.org) that Undici does
not support or does not fully implement.
#### CORS
Unlike browsers, Undici does not implement CORS (Cross-Origin Resource Sharing) checks by default. This means:
- No preflight requests are automatically sent for cross-origin requests
- No validation of `Access-Control-Allow-Origin` headers is performed
- Requests to any origin are allowed regardless of the source
This behavior is intentional for server-side environments where CORS restrictions are typically unnecessary. If your application requires CORS-like protections, you will need to implement these checks manually.
#### Garbage Collection
* https://fetch.spec.whatwg.org/#garbage-collection
The [Fetch Standard](https://fetch.spec.whatwg.org) allows users to skip consuming the response body by relying on
[garbage collection](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management#garbage_collection) to release connection resources.
Garbage collection in Node is less aggressive and deterministic
(due to the lack of clear idle periods that browsers have through the rendering refresh rate)
which means that leaving the release of connection resources to the garbage collector can lead
to excessive connection usage, reduced performance (due to less connection re-use), and even
stalls or deadlocks when running out of connections.
Therefore, __it is important to always either consume or cancel the response body anyway__.
```js
// Do
const { body, headers } = await fetch(url);
for await (const chunk of body) {
// force consumption of body
}
// Do not
const { headers } = await fetch(url);
```
However, if you want to get only headers, it might be better to use `HEAD` request method. Usage of this method will obviate the need for consumption or cancelling of the response body. See [MDN - HTTP - HTTP request methods - HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) for more details.
```js
const headers = await fetch(url, { method: 'HEAD' })
.then(res => res.headers)
```
Note that consuming the response body is _mandatory_ for `request`:
```js
// Do
const { body, headers } = await request(url);
await body.dump(); // force consumption of body
// Do not
const { headers } = await request(url);
```
#### Forbidden and Safelisted Header Names
* https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name
* https://fetch.spec.whatwg.org/#forbidden-header-name
* https://fetch.spec.whatwg.org/#forbidden-response-header-name
* https://github.com/wintercg/fetch/issues/6
The [Fetch Standard](https://fetch.spec.whatwg.org) requires implementations to exclude certain headers from requests and responses. In browser environments, some headers are forbidden so the user agent remains in full control over them. In Undici, these constraints are removed to give more control to the user.
#### Content-Encoding
* https://www.rfc-editor.org/rfc/rfc9110#field.content-encoding
Undici limits the number of `Content-Encoding` layers in a response to **5** to prevent resource exhaustion attacks. If a server responds with more than 5 content-encodings (e.g., `Content-Encoding: gzip, gzip, gzip, gzip, gzip, gzip`), the fetch will be rejected with an error. This limit matches the approach taken by [curl](https://curl.se/docs/CVE-2022-32206.html) and [urllib3](https://github.com/advisories/GHSA-gm62-xv2j-4rw9).
#### `undici.upgrade([url, options])`
Upgrade to a different protocol. See [MDN - HTTP - Protocol upgrade mechanism](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism) for more details.
* `url` {string|URL|UrlObject}
* `options` {UpgradeOptions} See [`UpgradeOptions`](./api/Dispatcher.md#parameter-upgradeoptions).
* `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
* `callback` {Function} (optional) — `(error, data) => void`.
* Returns: {Promise} A promise with the result of the `Dispatcher.upgrade` method.
Calls `options.dispatcher.upgrade(options)`.
See [Dispatcher.upgrade](./api/Dispatcher.md#dispatcherupgradeoptions-callback) for more details.
### `undici.setGlobalDispatcher(dispatcher)`
* `dispatcher` {Dispatcher}
Sets the global dispatcher used by Common API Methods. Global dispatcher is shared among compatible undici modules,
including undici that is bundled internally with node.js.
Undici stores this dispatcher under `Symbol.for('undici.globalDispatcher.2')`.
`setGlobalDispatcher()` also mirrors the configured dispatcher to
`Symbol.for('undici.globalDispatcher.1')` using `Dispatcher1Wrapper`, so Node.js built-in `fetch`
can keep using the legacy handler contract while Undici uses the new handler API.
### `undici.getGlobalDispatcher()`
Gets the global dispatcher used by Common API Methods.
* Returns: {Dispatcher}
### `undici.setGlobalOrigin(origin)`
* `origin` {string|URL|undefined}
Sets the global origin used in `fetch`.
If `undefined` is passed, the global origin will be reset. This will cause `Response.redirect`, `new Request()`, and `fetch` to throw an error when a relative path is passed.
```js
setGlobalOrigin('http://localhost:3000')
const response = await fetch('/api/ping')
console.log(response.url) // http://localhost:3000/api/ping
```
### `undici.getGlobalOrigin()`
Gets the global origin used in `fetch`.
* Returns: {URL}
### `UrlObject`
* `port` {string|number} (optional)
* `path` {string} (optional)
* `pathname` {string} (optional)
* `hostname` {string} (optional)
* `origin` {string} (optional)
* `protocol` {string} (optional)
* `search` {string} (optional)
#### Expect
Undici does not support the `Expect` request header field. The request
body is always immediately sent and the `100 Continue` response will be
ignored.
Refs: https://tools.ietf.org/html/rfc7231#section-5.1.1
#### Pipelining
Undici will only use pipelining if configured with a `pipelining` factor
greater than `1`. Only enable pipelining when the remote server is trusted.
Also it is important to pass `blocking: false` to the request options to
properly pipeline requests.
Undici always assumes that connections are persistent and will immediately
pipeline requests, without checking whether the connection is persistent.
Hence, automatic fallback to HTTP/1.0 or HTTP/1.1 without pipelining is
not supported.
Undici will immediately pipeline when retrying requests after a failed
connection. However, Undici will not retry the first remaining requests in
the prior pipeline and instead error the corresponding callback/promise/stream.
Undici will abort all running requests in the pipeline when any of them are
aborted.
* Refs: https://tools.ietf.org/html/rfc2616#section-8.1.2.2
* Refs: https://tools.ietf.org/html/rfc7230#section-6.3.2
#### Manual Redirect
Since it is not possible to manually follow an HTTP redirect on the server-side,
Undici returns the actual response instead of an `opaqueredirect` filtered one
when invoked with a `manual` redirect. This aligns `fetch()` with the other
implementations in Deno and Cloudflare Workers.
Refs: https://fetch.spec.whatwg.org/#atomic-http-redirect-handling
### Workarounds
#### Network address family autoselection.
If you experience problem when connecting to a remote server that is resolved by your DNS servers to a IPv6 (AAAA record)
first, there are chances that your local router or ISP might have problem connecting to IPv6 networks. In that case
undici will throw an error with code `UND_ERR_CONNECT_TIMEOUT`.
If the target server resolves to both a IPv6 and IPv4 (A records) address and you are using a compatible Node version
(18.3.0 and above), you can fix the problem by providing the `autoSelectFamily` option (support by both `undici.request`
and `undici.Agent`) which will enable the family autoselection algorithm when establishing the connection.
## Collaborators
* [__Daniele Belardi__](https://github.com/dnlup), <https://www.npmjs.com/~dnlup>
* [__Ethan Arrowood__](https://github.com/ethan-arrowood), <https://www.npmjs.com/~ethan_arrowood>
* [__Matteo Collina__](https://github.com/mcollina), <https://www.npmjs.com/~matteo.collina>
* [__Matthew Aitken__](https://github.com/KhafraDev), <https://www.npmjs.com/~khaf>
* [__Robert Nagy__](https://github.com/ronag), <https://www.npmjs.com/~ronag>
* [__Szymon Marczak__](https://github.com/szmarczak), <https://www.npmjs.com/~szmarczak>
## Past Collaborators
* [__Tomas Della Vedova__](https://github.com/delvedor), <https://www.npmjs.com/~delvedor>
### Releasers
* [__Ethan Arrowood__](https://github.com/ethan-arrowood), <https://www.npmjs.com/~ethan_arrowood>
* [__Matteo Collina__](https://github.com/mcollina), <https://www.npmjs.com/~matteo.collina>
* [__Robert Nagy__](https://github.com/ronag), <https://www.npmjs.com/~ronag>
* [__Matthew Aitken__](https://github.com/KhafraDev), <https://www.npmjs.com/~khaf>
## Long Term Support
Undici aligns with the Node.js LTS schedule. The following table shows the supported versions:
| Undici Version | Bundled in Node.js | Node.js Versions Supported | End of Life |
|----------------|--------------------|----------------------------|-------------|
| 5.x | 18.x | ≥14.0 (tested: 14, 16, 18) | 2024-04-30 |
| 6.x | 20.x, 22.x | ≥18.17 (tested: 18, 20, 21, 22) | 2027-04-30 |
| 7.x | 24.x | ≥20.18.1 (tested: 20, 22, 24) | 2028-04-30 |
| 8.x | 26.x | ≥22.19.0 (tested: 22, 24, 26) | 2029-04-30 |
## License
MIT
@@ -0,0 +1,13 @@
import { ErrorHandler, FallbackRender } from "../components.js";
import { PropsWithChildren } from "../types.js";
import { Child, FC } from "../base.js";
//#region src/jsx/dom/components.d.ts
export declare const ErrorBoundary: FC<PropsWithChildren<{
fallback?: Child;
fallbackRender?: FallbackRender;
onError?: ErrorHandler;
}>>;
export declare const Suspense: FC<PropsWithChildren<{
fallback: any;
}>>;
//#endregion
@@ -0,0 +1 @@
{"version":3,"file":"link-2-off.js","sources":["../../../src/icons/link-2-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Link2Off\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAxN0g3QTUgNSAwIDAgMSA3IDciIC8+CiAgPHBhdGggZD0iTTE1IDdoMmE1IDUgMCAwIDEgNCA4IiAvPgogIDxsaW5lIHgxPSI4IiB4Mj0iMTIiIHkxPSIxMiIgeTI9IjEyIiAvPgogIDxsaW5lIHgxPSIyIiB4Mj0iMjIiIHkxPSIyIiB5Mj0iMjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/link-2-off\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 Link2Off = createLucideIcon('Link2Off', [\n ['path', { d: 'M9 17H7A5 5 0 0 1 7 7', key: '10o201' }],\n ['path', { d: 'M15 7h2a5 5 0 0 1 4 8', key: '1d3206' }],\n ['line', { x1: '8', x2: '12', y1: '12', y2: '12', key: 'rvw6j4' }],\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n]);\n\nexport default Link2Off;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyB,CAAA,CAAA,CAAA,CAAA,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,CACtD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dependentRequired_1 = require("./validation/dependentRequired");
const dependentSchemas_1 = require("./applicator/dependentSchemas");
const limitContains_1 = require("./validation/limitContains");
const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
exports.default = next;
//# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
{"version":3,"file":"folder-input.js","sources":["../../../src/icons/folder-input.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderInput\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA5VjVhMiAyIDAgMCAxIDItMmgzLjlhMiAyIDAgMCAxIDEuNjkuOWwuODEgMS4yYTIgMiAwIDAgMCAxLjY3LjlIMjBhMiAyIDAgMCAxIDIgMnYxMGEyIDIgMCAwIDEtMiAySDRhMiAyIDAgMCAxLTItMnYtMSIgLz4KICA8cGF0aCBkPSJNMiAxM2gxMCIgLz4KICA8cGF0aCBkPSJtOSAxNiAzLTMtMy0zIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/folder-input\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 FolderInput = createLucideIcon('FolderInput', [\n [\n 'path',\n {\n d: 'M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1',\n key: 'fm4g5t',\n },\n ],\n ['path', { d: 'M2 13h10', key: 'pgb2dq' }],\n ['path', { d: 'm9 16 3-3-3-3', key: '6m91ic' }],\n]);\n\nexport default FolderInput;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAClD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,67 @@
{
"name": "magic-string",
"version": "0.30.21",
"type": "commonjs",
"description": "Modify strings, generate sourcemaps",
"keywords": [
"string",
"string manipulation",
"sourcemap",
"templating",
"transpilation"
],
"repository": {
"type": "git",
"url": "git+https://github.com/Rich-Harris/magic-string.git"
},
"license": "MIT",
"author": "Rich Harris",
"main": "./dist/magic-string.cjs.js",
"module": "./dist/magic-string.es.mjs",
"sideEffects": false,
"jsnext:main": "./dist/magic-string.es.mjs",
"types": "./dist/magic-string.cjs.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/magic-string.es.mjs",
"require": "./dist/magic-string.cjs.js"
}
},
"files": [
"dist/*",
"index.d.ts",
"README.md"
],
"devDependencies": {
"@eslint/js": "^9.38.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.2",
"benchmark": "^2.1.4",
"bumpp": "^10.3.1",
"conventional-changelog-cli": "^5.0.0",
"eslint": "^9.38.0",
"prettier": "^3.6.2",
"publint": "^0.3.15",
"rollup": "^4.52.5",
"source-map-js": "^1.2.1",
"source-map-support": "^0.5.21",
"vitest": "^4.0.2"
},
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.5"
},
"scripts": {
"build": "rollup -c",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"format": "prettier --single-quote --print-width 100 --use-tabs --write .",
"lint": "eslint src test && publint",
"lint:fix": "eslint src test --fix",
"release": "bumpp -x \"pnpm run changelog\" --all",
"pretest": "pnpm run build",
"test": "vitest run",
"test:dev": "vitest",
"bench": "pnpm run build && node benchmark/index.mjs",
"watch": "rollup -cw"
}
}
@@ -0,0 +1,301 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const path = require('path');
const args = process.argv.slice(2);
const dir = args[0];
if (!dir) {
console.log('Usage: node ' + path.basename(__filename) + ' <target-dir>');
process.exit(1);
}
const NodeApiVersion = require('../package.json').version;
const disable = args[1];
let ConfigFileOperations;
if (disable !== '--disable' && dir !== '--disable') {
ConfigFileOperations = {
'package.json': [
[/([ ]*)"dependencies": {/g, '$1"dependencies": {\n$1 "node-addon-api": "' + NodeApiVersion + '",'],
[/[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, '']
],
'binding.gyp': [
[/([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').include_dir")\','],
[/([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "<!(node -p \\"require(\'node-addon-api\').include_dir\\")",'],
[/[ ]*("|')<!\(node -e ("|'|\\"|\\')require\(("|'|\\"|\\')nan("|'|\\"|\\')\)("|'|\\"|\\')\)("|')(,|)[\r\n]/g, ''],
[/([ ]*)("|')target_name("|'): ("|')(.+?)("|'),/g, '$1$2target_name$2: $4$5$6,\n $2cflags!$2: [ $2-fno-exceptions$2 ],\n $2cflags_cc!$2: [ $2-fno-exceptions$2 ],\n $2xcode_settings$2: { $2GCC_ENABLE_CPP_EXCEPTIONS$2: $2YES$2,\n $2CLANG_CXX_LIBRARY$2: $2libc++$2,\n $2MACOSX_DEPLOYMENT_TARGET$2: $210.7$2,\n },\n $2msvs_settings$2: {\n $2VCCLCompilerTool$2: { $2ExceptionHandling$2: 1 },\n },']
]
};
} else {
ConfigFileOperations = {
'package.json': [
[/([ ]*)"dependencies": {/g, '$1"dependencies": {\n$1 "node-addon-api": "' + NodeApiVersion + '",'],
[/[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, '']
],
'binding.gyp': [
[/([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').include_dir")\','],
[/([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "<!(node -p \'require(\\"node-addon-api\\").include_dir\')",'],
[/[ ]*("|')<!\(node -e ("|'|\\"|\\')require\(("|'|\\"|\\')nan("|'|\\"|\\')\)("|'|\\"|\\')\)("|')(,|)[\r\n]/g, ''],
[/([ ]*)("|')target_name("|'): ("|')(.+?)("|'),/g, '$1$2target_name$2: $4$5$6,\n $2cflags!$2: [ $2-fno-exceptions$2 ],\n $2cflags_cc!$2: [ $2-fno-exceptions$2 ],\n $2defines$2: [ $2NAPI_DISABLE_CPP_EXCEPTIONS$2 ],\n $2conditions$2: [\n [\'OS=="win"\', { $2defines$2: [ $2_HAS_EXCEPTIONS=1$2 ] }]\n ]']
]
};
}
const SourceFileOperations = [
[/Nan::SetMethod\(target,[\s]*"(.*)"[\s]*,[\s]*([^)]+)\)/g, 'exports.Set(Napi::String::New(env, "$1"), Napi::Function::New(env, $2))'],
[/v8::Local<v8::FunctionTemplate>\s+(\w+)\s*=\s*Nan::New<FunctionTemplate>\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'],
[/Local<FunctionTemplate>\s+(\w+)\s*=\s*Nan::New<FunctionTemplate>\([\w\d:]+\);\s+(\w+)\.Reset\((\1)\);\s+\1->SetClassName\((Nan::String::New|Nan::New<(v8::)*String>)\("(.+?)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$6", {'],
[/Local<FunctionTemplate>\s+(\w+)\s*=\s*Nan::New<FunctionTemplate>\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'],
[/Nan::New<v8::FunctionTemplate>\(([\w\d:]+)\)->GetFunction\(\)/g, 'Napi::Function::New(env, $1)'],
[/Nan::New<FunctionTemplate>\(([\w\d:]+)\)->GetFunction()/g, 'Napi::Function::New(env, $1);'],
[/Nan::New<v8::FunctionTemplate>\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'],
[/Nan::New<FunctionTemplate>\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'],
// FunctionTemplate to FunctionReference
[/Nan::Persistent<(v8::)*FunctionTemplate>/g, 'Napi::FunctionReference'],
[/Nan::Persistent<(v8::)*Function>/g, 'Napi::FunctionReference'],
[/v8::Local<v8::FunctionTemplate>/g, 'Napi::FunctionReference'],
[/Local<FunctionTemplate>/g, 'Napi::FunctionReference'],
[/v8::FunctionTemplate/g, 'Napi::FunctionReference'],
[/FunctionTemplate/g, 'Napi::FunctionReference'],
[/([ ]*)Nan::SetPrototypeMethod\(\w+, "(\w+)", (\w+)\);/g, '$1InstanceMethod("$2", &$3),'],
[/([ ]*)(?:\w+\.Reset\(\w+\);\s+)?\(target\)\.Set\("(\w+)",\s*Nan::GetFunction\((\w+)\)\);/gm,
'});\n\n' +
'$1constructor = Napi::Persistent($3);\n' +
'$1constructor.SuppressDestruct();\n' +
'$1target.Set("$2", $3);'],
// TODO: Other attribute combinations
[/static_cast<PropertyAttribute>\(ReadOnly\s*\|\s*DontDelete\)/gm,
'static_cast<napi_property_attributes>(napi_enumerable | napi_configurable)'],
[/([\w\d:<>]+?)::Cast\((.+?)\)/g, '$2.As<$1>()'],
[/\*Nan::Utf8String\(([^)]+)\)/g, '$1->As<Napi::String>().Utf8Value().c_str()'],
[/Nan::Utf8String +(\w+)\(([^)]+)\)/g, 'std::string $1 = $2.As<Napi::String>()'],
[/Nan::Utf8String/g, 'std::string'],
[/v8::String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'],
[/String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'],
[/\.length\(\)/g, '.Length()'],
[/Nan::MakeCallback\(([^,]+),[\s\\]+([^,]+),/gm, '$2.MakeCallback($1,'],
[/class\s+(\w+)\s*:\s*public\s+Nan::ObjectWrap/g, 'class $1 : public Napi::ObjectWrap<$1>'],
[/(\w+)\(([^)]*)\)\s*:\s*Nan::ObjectWrap\(\)\s*(,)?/gm, '$1($2) : Napi::ObjectWrap<$1>()$3'],
// HandleOKCallback to OnOK
[/HandleOKCallback/g, 'OnOK'],
// HandleErrorCallback to OnError
[/HandleErrorCallback/g, 'OnError'],
// ex. .As<Function>() to .As<Napi::Object>()
[/\.As<v8::(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>\(\)/g, '.As<Napi::$1>()'],
[/\.As<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>\(\)/g, '.As<Napi::$1>()'],
// ex. Nan::New<Number>(info[0]) to Napi::Number::New(info[0])
[/Nan::New<(v8::)*Integer>\((.+?)\)/g, 'Napi::Number::New(env, $2)'],
[/Nan::New\(([0-9.]+)\)/g, 'Napi::Number::New(env, $1)'],
[/Nan::New<(v8::)*String>\("(.+?)"\)/g, 'Napi::String::New(env, "$2")'],
[/Nan::New\("(.+?)"\)/g, 'Napi::String::New(env, "$1")'],
[/Nan::New<(v8::)*(.+?)>\(\)/g, 'Napi::$2::New(env)'],
[/Nan::New<(.+?)>\(\)/g, 'Napi::$1::New(env)'],
[/Nan::New<(v8::)*(.+?)>\(/g, 'Napi::$2::New(env, '],
[/Nan::New<(.+?)>\(/g, 'Napi::$1::New(env, '],
[/Nan::NewBuffer\(/g, 'Napi::Buffer<char>::New(env, '],
// TODO: Properly handle this
[/Nan::New\(/g, 'Napi::New(env, '],
[/\.IsInt32\(\)/g, '.IsNumber()'],
[/->IsInt32\(\)/g, '.IsNumber()'],
[/(.+?)->BooleanValue\(\)/g, '$1.As<Napi::Boolean>().Value()'],
[/(.+?)->Int32Value\(\)/g, '$1.As<Napi::Number>().Int32Value()'],
[/(.+?)->Uint32Value\(\)/g, '$1.As<Napi::Number>().Uint32Value()'],
[/(.+?)->IntegerValue\(\)/g, '$1.As<Napi::Number>().Int64Value()'],
[/(.+?)->NumberValue\(\)/g, '$1.As<Napi::Number>().DoubleValue()'],
// ex. Nan::To<bool>(info[0]) to info[0].Value()
[/Nan::To<v8::(Boolean|String|Number|Object|Array|Symbol|Function)>\((.+?)\)/g, '$2.To<Napi::$1>()'],
[/Nan::To<(Boolean|String|Number|Object|Array|Symbol|Function)>\((.+?)\)/g, '$2.To<Napi::$1>()'],
// ex. Nan::To<bool>(info[0]) to info[0].As<Napi::Boolean>().Value()
[/Nan::To<bool>\((.+?)\)/g, '$1.As<Napi::Boolean>().Value()'],
// ex. Nan::To<int>(info[0]) to info[0].As<Napi::Number>().Int32Value()
[/Nan::To<int>\((.+?)\)/g, '$1.As<Napi::Number>().Int32Value()'],
// ex. Nan::To<int32_t>(info[0]) to info[0].As<Napi::Number>().Int32Value()
[/Nan::To<int32_t>\((.+?)\)/g, '$1.As<Napi::Number>().Int32Value()'],
// ex. Nan::To<uint32_t>(info[0]) to info[0].As<Napi::Number>().Uint32Value()
[/Nan::To<uint32_t>\((.+?)\)/g, '$1.As<Napi::Number>().Uint32Value()'],
// ex. Nan::To<int64_t>(info[0]) to info[0].As<Napi::Number>().Int64Value()
[/Nan::To<int64_t>\((.+?)\)/g, '$1.As<Napi::Number>().Int64Value()'],
// ex. Nan::To<float>(info[0]) to info[0].As<Napi::Number>().FloatValue()
[/Nan::To<float>\((.+?)\)/g, '$1.As<Napi::Number>().FloatValue()'],
// ex. Nan::To<double>(info[0]) to info[0].As<Napi::Number>().DoubleValue()
[/Nan::To<double>\((.+?)\)/g, '$1.As<Napi::Number>().DoubleValue()'],
[/Nan::New\((\w+)\)->HasInstance\((\w+)\)/g, '$2.InstanceOf($1.Value())'],
[/Nan::Has\(([^,]+),\s*/gm, '($1).Has('],
[/\.Has\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Has($1)'],
[/\.Has\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Has($1)'],
[/Nan::Get\(([^,]+),\s*/gm, '($1).Get('],
[/\.Get\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Get($1)'],
[/\.Get\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Get($1)'],
[/Nan::Set\(([^,]+),\s*/gm, '($1).Set('],
[/\.Set\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\s*,/gm, '.Set($1,'],
[/\.Set\([\s|\\]*Nan::New\(([^)]+)\)\s*,/gm, '.Set($1,'],
// ex. node::Buffer::HasInstance(info[0]) to info[0].IsBuffer()
[/node::Buffer::HasInstance\((.+?)\)/g, '$1.IsBuffer()'],
// ex. node::Buffer::Length(info[0]) to info[0].Length()
[/node::Buffer::Length\((.+?)\)/g, '$1.As<Napi::Buffer<char>>().Length()'],
// ex. node::Buffer::Data(info[0]) to info[0].Data()
[/node::Buffer::Data\((.+?)\)/g, '$1.As<Napi::Buffer<char>>().Data()'],
[/Nan::CopyBuffer\(/g, 'Napi::Buffer::Copy(env, '],
// Nan::AsyncQueueWorker(worker)
[/Nan::AsyncQueueWorker\((.+)\);/g, '$1.Queue();'],
[/Nan::(Undefined|Null|True|False)\(\)/g, 'env.$1()'],
// Nan::ThrowError(error) to Napi::Error::New(env, error).ThrowAsJavaScriptException()
[/([ ]*)return Nan::Throw(\w*?)Error\((.+?)\);/g, '$1Napi::$2Error::New(env, $3).ThrowAsJavaScriptException();\n$1return env.Null();'],
[/Nan::Throw(\w*?)Error\((.+?)\);\n(\s*)return;/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n$3return env.Null();'],
[/Nan::Throw(\w*?)Error\((.+?)\);/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n'],
// Nan::RangeError(error) to Napi::RangeError::New(env, error)
[/Nan::(\w*?)Error\((.+)\)/g, 'Napi::$1Error::New(env, $2)'],
[/Nan::Set\((.+?),\n* *(.+?),\n* *(.+?),\n* *(.+?)\)/g, '$1.Set($2, $3, $4)'],
[/Nan::(Escapable)?HandleScope\s+(\w+)\s*;/g, 'Napi::$1HandleScope $2(env);'],
[/Nan::(Escapable)?HandleScope/g, 'Napi::$1HandleScope'],
[/Nan::ForceSet\(([^,]+), ?/g, '$1->DefineProperty('],
[/\.ForceSet\(Napi::String::New\(env, "(\w+)"\),\s*?/g, '.DefineProperty("$1", '],
// [ /Nan::GetPropertyNames\(([^,]+)\)/, '$1->GetPropertyNames()' ],
[/Nan::Equals\(([^,]+),/g, '$1.StrictEquals('],
[/(.+)->Set\(/g, '$1.Set('],
[/Nan::Callback/g, 'Napi::FunctionReference'],
[/Nan::Persistent<Object>/g, 'Napi::ObjectReference'],
[/Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target/g, 'Napi::Env& env, Napi::Object& target'],
[/(\w+)\*\s+(\w+)\s*=\s*Nan::ObjectWrap::Unwrap<\w+>\(info\.This\(\)\);/g, '$1* $2 = this;'],
[/Nan::ObjectWrap::Unwrap<(\w+)>\((.*)\);/g, '$2.Unwrap<$1>();'],
[/Nan::NAN_METHOD_RETURN_TYPE/g, 'void'],
[/NAN_INLINE/g, 'inline'],
[/Nan::NAN_METHOD_ARGS_TYPE/g, 'const Napi::CallbackInfo&'],
[/NAN_METHOD\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'],
[/static\s*NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'],
[/NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'],
[/static\s*NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'],
[/NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'],
[/void Init\((v8::)*Local<(v8::)*Object> exports\)/g, 'Napi::Object Init(Napi::Env env, Napi::Object exports)'],
[/NAN_MODULE_INIT\(([\w\d:]+?)\);/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports);'],
[/NAN_MODULE_INIT\(([\w\d:]+?)\)/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports)'],
[/::(Init(?:ialize)?)\(target\)/g, '::$1(env, target, module)'],
[/constructor_template/g, 'constructor'],
[/Nan::FunctionCallbackInfo<(v8::)?Value>[ ]*& [ ]*info\)[ ]*{\n*([ ]*)/gm, 'Napi::CallbackInfo& info) {\n$2Napi::Env env = info.Env();\n$2'],
[/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&\s*info\);/g, 'Napi::CallbackInfo& info);'],
[/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&/g, 'Napi::CallbackInfo&'],
[/Buffer::HasInstance\(([^)]+)\)/g, '$1.IsBuffer()'],
[/info\[(\d+)\]->/g, 'info[$1].'],
[/info\[([\w\d]+)\]->/g, 'info[$1].'],
[/info\.This\(\)->/g, 'info.This().'],
[/->Is(Object|String|Int32|Number)\(\)/g, '.Is$1()'],
[/info.GetReturnValue\(\).SetUndefined\(\)/g, 'return env.Undefined()'],
[/info\.GetReturnValue\(\)\.Set\(((\n|.)+?)\);/g, 'return $1;'],
// ex. Local<Value> to Napi::Value
[/v8::Local<v8::(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>/g, 'Napi::$1'],
[/Local<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>/g, 'Napi::$1'],
// Declare an env in helper functions that take a Napi::Value
[/(\w+)\(Napi::Value (\w+)(,\s*[^()]+)?\)\s*{\n*([ ]*)/gm, '$1(Napi::Value $2$3) {\n$4Napi::Env env = $2.Env();\n$4'],
// delete #include <node.h> and/or <v8.h>
[/#include +(<|")(?:node|nan).h("|>)/g, '#include $1napi.h$2\n#include $1uv.h$2'],
// NODE_MODULE to NODE_API_MODULE
[/NODE_MODULE/g, 'NODE_API_MODULE'],
[/Nan::/g, 'Napi::'],
[/nan.h/g, 'napi.h'],
// delete .FromJust()
[/\.FromJust\(\)/g, ''],
// delete .ToLocalCheck()
[/\.ToLocalChecked\(\)/g, ''],
[/^.*->SetInternalFieldCount\(.*$/gm, ''],
// replace using node; and/or using v8; to using Napi;
[/using (node|v8);/g, 'using Napi;'],
[/using namespace (node|Nan|v8);/g, 'using namespace Napi;'],
// delete using v8::Local;
[/using v8::Local;\n/g, ''],
// replace using v8::XXX; with using Napi::XXX
[/using v8::([A-Za-z]+);/g, 'using Napi::$1;']
];
const paths = listFiles(dir);
paths.forEach(function (dirEntry) {
const filename = dirEntry.split('\\').pop().split('/').pop();
// Check whether the file is a source file or a config file
// then execute function accordingly
const sourcePattern = /.+\.h|.+\.cc|.+\.cpp/;
if (sourcePattern.test(filename)) {
convertFile(dirEntry, SourceFileOperations);
} else if (ConfigFileOperations[filename] != null) {
convertFile(dirEntry, ConfigFileOperations[filename]);
}
});
function listFiles (dir, filelist) {
const files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function (file) {
if (file === 'node_modules') {
return;
}
if (fs.statSync(path.join(dir, file)).isDirectory()) {
filelist = listFiles(path.join(dir, file), filelist);
} else {
filelist.push(path.join(dir, file));
}
});
return filelist;
}
function convert (content, operations) {
for (let i = 0; i < operations.length; i++) {
const operation = operations[i];
content = content.replace(operation[0], operation[1]);
}
return content;
}
function convertFile (fileName, operations) {
fs.readFile(fileName, 'utf-8', function (err, file) {
if (err) throw err;
file = convert(file, operations);
fs.writeFile(fileName, file, function (err) {
if (err) throw err;
});
});
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_x","4100":"_VB"},C:{"1":"_LN _2E","2":"_qL","132":"_7H","260":"sB","516":"_dC _bC"},D:{"1":"_OJ _KE","2":"_8E","1028":"_yQ","2052":"wB"},E:{"1":"_QB","2":"_TB"},F:{"1":"_7R","2":"_GP","1028":"_GH MB","2052":"NB"},G:{"1":"_BB","2":"_OB"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"Content Security Policy Level 2",D:true};
@@ -0,0 +1,43 @@
import * as React from 'react';
import { assignRef } from './assignRef';
import { useCallbackRef } from './useRef';
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
const currentValues = new WeakMap();
/**
* Merges two or more refs together providing a single interface to set their value
* @param {RefObject|Ref} refs
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
*
* @see {@link mergeRefs} a version without buit-in memoization
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
* @example
* const Component = React.forwardRef((props, ref) => {
* const ownRef = useRef();
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
* return <div ref={domRef}>...</div>
* }
*/
export function useMergeRefs(refs, defaultValue) {
const callbackRef = useCallbackRef(defaultValue || null, (newValue) => refs.forEach((ref) => assignRef(ref, newValue)));
// handle refs changes - added or removed
useIsomorphicLayoutEffect(() => {
const oldValue = currentValues.get(callbackRef);
if (oldValue) {
const prevRefs = new Set(oldValue);
const nextRefs = new Set(refs);
const current = callbackRef.current;
prevRefs.forEach((ref) => {
if (!nextRefs.has(ref)) {
assignRef(ref, null);
}
});
nextRefs.forEach((ref) => {
if (!prevRefs.has(ref)) {
assignRef(ref, current);
}
});
}
currentValues.set(callbackRef, refs);
}, [refs]);
return callbackRef;
}