langgraph-ui-components 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es10.js +31 -16
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +36 -3156
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +162 -33
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +203 -5
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +13 -72
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +27 -34
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +34 -5
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +3159 -2
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +5 -11
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +2 -503
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +16 -5
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es11.js +146 -120
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es110.js +13 -2
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +484 -129
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +5 -906
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +2 -282
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +148 -4
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +869 -407
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +274 -40
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +4 -24
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +437 -72
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +42 -125
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es12.js +13 -103
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es120.js +21 -48
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +77 -8
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +127 -43
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +41 -91
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +9 -52
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +44 -15
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +97 -13
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +52 -88
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +15 -2
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +87 -54
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es13.js +126 -32
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es130.js +2 -100
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +163 -190
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +2 -110
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +53 -32
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +99 -9
- package/dist/index.es134.js.map +1 -1
- package/dist/index.es135.js +190 -10
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es136.js +108 -10
- package/dist/index.es136.js.map +1 -1
- package/dist/index.es137.js +30 -86
- package/dist/index.es137.js.map +1 -1
- package/dist/index.es138.js +10 -275
- package/dist/index.es138.js.map +1 -1
- package/dist/index.es139.js +11 -2
- package/dist/index.es139.js.map +1 -1
- package/dist/index.es140.js +11 -163
- package/dist/index.es140.js.map +1 -1
- package/dist/index.es141.js +87 -47
- package/dist/index.es141.js.map +1 -1
- package/dist/index.es142.js +266 -31
- package/dist/index.es142.js.map +1 -1
- package/dist/index.es143.js +2 -35
- package/dist/index.es143.js.map +1 -1
- package/dist/index.es144.js +155 -31
- package/dist/index.es144.js.map +1 -1
- package/dist/index.es145.js +48 -21
- package/dist/index.es145.js.map +1 -1
- package/dist/index.es146.js +33 -584
- package/dist/index.es146.js.map +1 -1
- package/dist/index.es147.js +34 -124
- package/dist/index.es147.js.map +1 -1
- package/dist/index.es148.js +31 -155
- package/dist/index.es148.js.map +1 -1
- package/dist/index.es149.js +24 -2
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es15.js +15 -15
- package/dist/index.es150.js +591 -2
- package/dist/index.es150.js.map +1 -1
- package/dist/index.es151.js +125 -2
- package/dist/index.es151.js.map +1 -1
- package/dist/index.es152.js +3 -21
- package/dist/index.es152.js.map +1 -1
- package/dist/index.es153.js +2 -2
- package/dist/index.es154.js +2 -25
- package/dist/index.es154.js.map +1 -1
- package/dist/index.es155.js +22 -8
- package/dist/index.es155.js.map +1 -1
- package/dist/index.es156.js +2 -5
- package/dist/index.es156.js.map +1 -1
- package/dist/index.es157.js +24 -12
- package/dist/index.es157.js.map +1 -1
- package/dist/index.es158.js +5 -6
- package/dist/index.es158.js.map +1 -1
- package/dist/index.es159.js +12 -63
- package/dist/index.es159.js.map +1 -1
- package/dist/index.es160.js +5 -21
- package/dist/index.es160.js.map +1 -1
- package/dist/index.es161.js +8 -6
- package/dist/index.es161.js.map +1 -1
- package/dist/index.es162.js +22 -346
- package/dist/index.es162.js.map +1 -1
- package/dist/index.es163.js +12 -25
- package/dist/index.es163.js.map +1 -1
- package/dist/index.es164.js +53 -11
- package/dist/index.es164.js.map +1 -1
- package/dist/index.es165.js +59 -49
- package/dist/index.es165.js.map +1 -1
- package/dist/index.es166.js +22 -7
- package/dist/index.es166.js.map +1 -1
- package/dist/index.es167.js +5 -102
- package/dist/index.es167.js.map +1 -1
- package/dist/index.es168.js +339 -109
- package/dist/index.es168.js.map +1 -1
- package/dist/index.es169.js +7 -136
- package/dist/index.es169.js.map +1 -1
- package/dist/index.es17.js +2 -2
- package/dist/index.es170.js +97 -109
- package/dist/index.es170.js.map +1 -1
- package/dist/index.es171.js +119 -6
- package/dist/index.es171.js.map +1 -1
- package/dist/index.es172.js +136 -4
- package/dist/index.es172.js.map +1 -1
- package/dist/index.es173.js +115 -2
- package/dist/index.es173.js.map +1 -1
- package/dist/index.es174.js +6 -3737
- package/dist/index.es174.js.map +1 -1
- package/dist/index.es175.js +2 -342
- package/dist/index.es175.js.map +1 -1
- package/dist/index.es176.js +138 -105
- package/dist/index.es176.js.map +1 -1
- package/dist/index.es177.js +2 -133
- package/dist/index.es177.js.map +1 -1
- package/dist/index.es178.js +3734 -12
- package/dist/index.es178.js.map +1 -1
- package/dist/index.es179.js +326 -136
- package/dist/index.es179.js.map +1 -1
- package/dist/index.es180.js +107 -13
- package/dist/index.es180.js.map +1 -1
- package/dist/index.es181.js +131 -6
- package/dist/index.es181.js.map +1 -1
- package/dist/index.es182.js +13 -19
- package/dist/index.es182.js.map +1 -1
- package/dist/index.es183.js +139 -77
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +13 -241
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +8 -24
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +21 -6
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +90 -4
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +240 -15
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +24 -8
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es190.js +6 -142
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +4 -2
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +18 -32
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +8 -6
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +31 -105
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +6 -13
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +105 -17
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +11 -29
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +17 -3
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +30 -4
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es2.js +24 -15
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es20.js +35 -66
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es200.js +4 -5
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +4 -36
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +5 -8
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +36 -5
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +5 -4
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +5 -41
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +4 -10
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +39 -239
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +10 -48
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es209.js +239 -32
- package/dist/index.es209.js.map +1 -1
- package/dist/index.es21.js +25 -34
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es210.js +49 -11
- package/dist/index.es210.js.map +1 -1
- package/dist/index.es211.js +33 -6
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es212.js +12 -6
- package/dist/index.es212.js.map +1 -1
- package/dist/index.es213.js +7 -64
- package/dist/index.es213.js.map +1 -1
- package/dist/index.es214.js +6 -40
- package/dist/index.es214.js.map +1 -1
- package/dist/index.es215.js +63 -30
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es216.js +35 -56
- package/dist/index.es216.js.map +1 -1
- package/dist/index.es217.js +32 -15
- package/dist/index.es217.js.map +1 -1
- package/dist/index.es218.js +60 -21
- package/dist/index.es218.js.map +1 -1
- package/dist/index.es219.js +15 -5
- package/dist/index.es219.js.map +1 -1
- package/dist/index.es22.js +146 -27
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es220.js +21 -15
- package/dist/index.es220.js.map +1 -1
- package/dist/index.es221.js +4 -32
- package/dist/index.es221.js.map +1 -1
- package/dist/index.es222.js +16 -4
- package/dist/index.es222.js.map +1 -1
- package/dist/index.es223.js +32 -4
- package/dist/index.es223.js.map +1 -1
- package/dist/index.es224.js +5 -5
- package/dist/index.es224.js.map +1 -1
- package/dist/index.es225.js +4 -7
- package/dist/index.es225.js.map +1 -1
- package/dist/index.es226.js +4 -91
- package/dist/index.es226.js.map +1 -1
- package/dist/index.es227.js +7 -17
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es228.js +90 -760
- package/dist/index.es228.js.map +1 -1
- package/dist/index.es229.js +18 -66
- package/dist/index.es229.js.map +1 -1
- package/dist/index.es23.js +16 -146
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es230.js +749 -161
- package/dist/index.es230.js.map +1 -1
- package/dist/index.es231.js +66 -38
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +172 -135
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +136 -92
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +92 -32
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +32 -284
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +284 -25
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +22 -20
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +22 -13
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +12 -12
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +58 -295
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es240.js +13 -24
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +22 -42
- package/dist/index.es241.js.map +1 -1
- package/dist/index.es242.js +45 -11
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +10 -10
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +10 -10
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +11 -14
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +14 -11
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +11 -11
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +10 -10
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +11 -15
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +298 -114
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +15 -11
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +10 -10
- package/dist/index.es251.js.map +1 -1
- package/dist/index.es252.js +11 -11
- package/dist/index.es252.js.map +1 -1
- package/dist/index.es253.js +10 -10
- package/dist/index.es253.js.map +1 -1
- package/dist/index.es254.js +10 -10
- package/dist/index.es254.js.map +1 -1
- package/dist/index.es255.js +10 -10
- package/dist/index.es255.js.map +1 -1
- package/dist/index.es256.js +10 -10
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +10 -10
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +11 -56
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +53 -46
- package/dist/index.es259.js.map +1 -1
- package/dist/index.es26.js +121 -5
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es260.js +42 -112
- package/dist/index.es260.js.map +1 -1
- package/dist/index.es261.js +87 -352
- package/dist/index.es261.js.map +1 -1
- package/dist/index.es262.js +381 -15
- package/dist/index.es262.js.map +1 -1
- package/dist/index.es263.js +17 -10
- package/dist/index.es263.js.map +1 -1
- package/dist/index.es264.js +10 -30
- package/dist/index.es264.js.map +1 -1
- package/dist/index.es265.js +17 -17
- package/dist/index.es265.js.map +1 -1
- package/dist/index.es266.js +25 -56
- package/dist/index.es266.js.map +1 -1
- package/dist/index.es267.js +59 -14
- package/dist/index.es267.js.map +1 -1
- package/dist/index.es268.js +14 -74
- package/dist/index.es268.js.map +1 -1
- package/dist/index.es269.js +77 -11
- package/dist/index.es269.js.map +1 -1
- package/dist/index.es270.js +10 -10
- package/dist/index.es270.js.map +1 -1
- package/dist/index.es271.js +11 -15
- package/dist/index.es271.js.map +1 -1
- package/dist/index.es272.js +14 -51
- package/dist/index.es272.js.map +1 -1
- package/dist/index.es273.js +44 -158
- package/dist/index.es273.js.map +1 -1
- package/dist/index.es274.js +167 -2
- package/dist/index.es274.js.map +1 -1
- package/dist/index.es275.js +37 -10
- package/dist/index.es275.js.map +1 -1
- package/dist/index.es276.js +2 -20
- package/dist/index.es276.js.map +1 -1
- package/dist/index.es277.js +10 -38
- package/dist/index.es277.js.map +1 -1
- package/dist/index.es278.js +23 -0
- package/dist/index.es278.js.map +1 -0
- package/dist/index.es279.js +42 -0
- package/dist/index.es279.js.map +1 -0
- package/dist/index.es28.js +7 -7
- package/dist/index.es29.js +1 -1
- package/dist/index.es32.js +4 -4
- package/dist/index.es33.js +117 -13
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +65 -112
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +18 -71
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +260 -17
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +31 -249
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +199 -27
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +50 -198
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es40.js +120 -45
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +14 -132
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +225 -19
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +8 -229
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +1190 -7
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +6 -1191
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +146 -6
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +15 -146
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es49.js +5 -93
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es50.js +8 -4
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +91 -33
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +3 -71
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +34 -36
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +61 -295
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +38 -9
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +296 -81
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +9 -8
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +89 -13
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +6 -141
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +12 -297
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +137 -60
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +247 -160
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +63 -31
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +212 -8
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +32 -10
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +8 -186
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +11 -23
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +183 -1396
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +24 -9
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +1400 -8
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +9 -6
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +8 -163
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +6 -672
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +161 -10
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +671 -39
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +10 -32
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +31 -223
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +33 -29
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +193 -36
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +26 -72
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +70 -47
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +72 -26
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +37 -28
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +28 -55
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +43 -13
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +32 -132
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +5 -21
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +61 -170
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +31 -235
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +50 -348
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +13 -137
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +132 -65
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +21 -37
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +179 -34
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +230 -155
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +341 -189
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +136 -13
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +68 -28
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +33 -30
- package/dist/index.es99.js.map +1 -1
- package/dist/langgraph-ui-components.css +107 -0
- package/dist/styles.css +1 -1
- package/package.json +8 -11
- package/dist/index.es48.js +0 -11
- package/dist/index.es48.js.map +0 -1
package/dist/index.es120.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es120.js","sources":["../node_modules/.pnpm
|
|
1
|
+
{"version":3,"file":"index.es120.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/is-network-error/index.js"],"sourcesContent":["//#region src/utils/is-network-error/index.js\nconst objectToString = Object.prototype.toString;\nconst isError = (value) => objectToString.call(value) === \"[object Error]\";\nconst errorMessages = new Set([\n\t\"network error\",\n\t\"Failed to fetch\",\n\t\"NetworkError when attempting to fetch resource.\",\n\t\"The Internet connection appears to be offline.\",\n\t\"Network request failed\",\n\t\"fetch failed\",\n\t\"terminated\",\n\t\" A network error occurred.\",\n\t\"Network connection lost\"\n]);\nfunction isNetworkError(error) {\n\tconst isValid = error && isError(error) && error.name === \"TypeError\" && typeof error.message === \"string\";\n\tif (!isValid) return false;\n\tconst { message, stack } = error;\n\tif (message === \"Load failed\") return stack === void 0 || \"__sentry_captured__\" in error;\n\tif (message.startsWith(\"error sending request for url\")) return true;\n\treturn errorMessages.has(message);\n}\n\n//#endregion\nexport { isNetworkError };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AACA,MAAM,iBAAiB,OAAO,UAAU;AACxC,MAAM,UAAU,CAAC,UAAU,eAAe,KAAK,KAAK,MAAM;AAC1D,MAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AACD,SAAS,eAAe,OAAO;AAC9B,QAAM,UAAU,SAAS,QAAQ,KAAK,KAAK,MAAM,SAAS,eAAe,OAAO,MAAM,YAAY;AAClG,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,EAAE,SAAS,MAAK,IAAK;AAC3B,MAAI,YAAY,cAAe,QAAO,UAAU,UAAU,yBAAyB;AACnF,MAAI,QAAQ,WAAW,+BAA+B,EAAG,QAAO;AAChE,SAAO,cAAc,IAAI,OAAO;AACjC;","x_google_ignoreList":[0]}
|
package/dist/index.es121.js
CHANGED
|
@@ -1,13 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function getEnumValues(entries) {
|
|
2
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
3
|
+
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
4
|
+
return values;
|
|
5
|
+
}
|
|
6
|
+
function jsonStringifyReplacer(_, value) {
|
|
7
|
+
if (typeof value === "bigint")
|
|
8
|
+
return value.toString();
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
const EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
12
|
+
function defineLazy(object, key, getter) {
|
|
13
|
+
let value = void 0;
|
|
14
|
+
Object.defineProperty(object, key, {
|
|
15
|
+
get() {
|
|
16
|
+
if (value === EVALUATING) {
|
|
17
|
+
return void 0;
|
|
18
|
+
}
|
|
19
|
+
if (value === void 0) {
|
|
20
|
+
value = EVALUATING;
|
|
21
|
+
value = getter();
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
},
|
|
25
|
+
set(v) {
|
|
26
|
+
Object.defineProperty(object, key, {
|
|
27
|
+
value: v
|
|
28
|
+
// configurable: true,
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
configurable: true
|
|
8
32
|
});
|
|
9
33
|
}
|
|
34
|
+
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
35
|
+
};
|
|
36
|
+
function clone(inst, def, params) {
|
|
37
|
+
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
38
|
+
if (!def || params?.parent)
|
|
39
|
+
cl._zod.parent = inst;
|
|
40
|
+
return cl;
|
|
41
|
+
}
|
|
42
|
+
function normalizeParams(_params) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
function aborted(x, startIndex = 0) {
|
|
46
|
+
if (x.aborted === true)
|
|
47
|
+
return true;
|
|
48
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
49
|
+
if (x.issues[i]?.continue !== true) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
function unwrapMessage(message) {
|
|
56
|
+
return typeof message === "string" ? message : message?.message;
|
|
57
|
+
}
|
|
58
|
+
function finalizeIssue(iss, ctx, config) {
|
|
59
|
+
const full = { ...iss, path: iss.path ?? [] };
|
|
60
|
+
if (!iss.message) {
|
|
61
|
+
const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
62
|
+
full.message = message;
|
|
63
|
+
}
|
|
64
|
+
delete full.inst;
|
|
65
|
+
delete full.continue;
|
|
66
|
+
if (!ctx?.reportInput) {
|
|
67
|
+
delete full.input;
|
|
68
|
+
}
|
|
69
|
+
return full;
|
|
70
|
+
}
|
|
10
71
|
export {
|
|
11
|
-
|
|
72
|
+
aborted,
|
|
73
|
+
captureStackTrace,
|
|
74
|
+
clone,
|
|
75
|
+
defineLazy,
|
|
76
|
+
finalizeIssue,
|
|
77
|
+
getEnumValues,
|
|
78
|
+
jsonStringifyReplacer,
|
|
79
|
+
normalizeParams,
|
|
80
|
+
unwrapMessage
|
|
12
81
|
};
|
|
13
82
|
//# sourceMappingURL=index.es121.js.map
|
package/dist/index.es121.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es121.js","sources":["../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js"],"sourcesContent":["import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n"],"names":["util.normalizeParams"],"mappings":";;;AAkcO,SAAS,OAAO,OAAO,QAAQ;AAClC,SAAO,IAAI,MAAM;AAAA,IACb,MAAM;AAAA,IACN,GAAGA,gBAA2B;AAAA,EACtC,CAAK;AACL;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es121.js","sources":["../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js"],"sourcesContent":["// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n"],"names":[],"mappings":"AAYO,SAAS,cAAc,SAAS;AACnC,QAAM,gBAAgB,OAAO,OAAO,OAAO,EAAE,OAAO,CAAC,MAAM,OAAO,MAAM,QAAQ;AAChF,QAAM,SAAS,OAAO,QAAQ,OAAO,EAChC,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,cAAc,QAAQ,CAAC,CAAC,MAAM,EAAE,EACnD,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;AACtB,SAAO;AACX;AAIO,SAAS,sBAAsB,GAAG,OAAO;AAC5C,MAAI,OAAO,UAAU;AACjB,WAAO,MAAM,SAAQ;AACzB,SAAO;AACX;AAqCA,MAAM,aAAa,uBAAO,YAAY;AAC/B,SAAS,WAAW,QAAQ,KAAK,QAAQ;AAC5C,MAAI,QAAQ;AACZ,SAAO,eAAe,QAAQ,KAAK;AAAA,IAC/B,MAAM;AACF,UAAI,UAAU,YAAY;AAEtB,eAAO;AAAA,MACX;AACA,UAAI,UAAU,QAAW;AACrB,gBAAQ;AACR,gBAAQ,OAAM;AAAA,MAClB;AACA,aAAO;AAAA,IACX;AAAA,IACA,IAAI,GAAG;AACH,aAAO,eAAe,QAAQ,KAAK;AAAA,QAC/B,OAAO;AAAA;AAAA,MAEvB,CAAa;AAAA,IAEL;AAAA,IACA,cAAc;AAAA,EACtB,CAAK;AACL;AA0DY,MAAC,oBAAqB,uBAAuB,QAAQ,MAAM,oBAAoB,IAAI,UAAU;AAAE;AAwGpG,SAAS,MAAM,MAAM,KAAK,QAAQ;AACrC,QAAM,KAAK,IAAI,KAAK,KAAK,OAAO,OAAO,KAAK,KAAK,GAAG;AACpD,MAAI,CAAC,OAAO,QAAQ;AAChB,OAAG,KAAK,SAAS;AACrB,SAAO;AACX;AACO,SAAS,gBAAgB,SAAS;AAGjC,SAAO,CAAA;AAYf;AA+OO,SAAS,QAAQ,GAAG,aAAa,GAAG;AACvC,MAAI,EAAE,YAAY;AACd,WAAO;AACX,WAAS,IAAI,YAAY,IAAI,EAAE,OAAO,QAAQ,KAAK;AAC/C,QAAI,EAAE,OAAO,CAAC,GAAG,aAAa,MAAM;AAChC,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO;AACX;AASO,SAAS,cAAc,SAAS;AACnC,SAAO,OAAO,YAAY,WAAW,UAAU,SAAS;AAC5D;AACO,SAAS,cAAc,KAAK,KAAK,QAAQ;AAC5C,QAAM,OAAO,EAAE,GAAG,KAAK,MAAM,IAAI,QAAQ,GAAE;AAE3C,MAAI,CAAC,IAAI,SAAS;AACd,UAAM,UAAU,cAAc,IAAI,MAAM,KAAK,KAAK,QAAQ,GAAG,CAAC,KAC1D,cAAc,KAAK,QAAQ,GAAG,CAAC,KAC/B,cAAc,OAAO,cAAc,GAAG,CAAC,KACvC,cAAc,OAAO,cAAc,GAAG,CAAC,KACvC;AACJ,SAAK,UAAU;AAAA,EACnB;AAEA,SAAO,KAAK;AACZ,SAAO,KAAK;AACZ,MAAI,CAAC,KAAK,aAAa;AACnB,WAAO,KAAK;AAAA,EAChB;AACA,SAAO;AACX;","x_google_ignoreList":[0]}
|
package/dist/index.es122.js
CHANGED
|
@@ -1,48 +1,132 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { $constructor, $ZodAsyncError } from "./index.es165.js";
|
|
2
|
+
import { defineLazy, aborted } from "./index.es121.js";
|
|
3
|
+
import { clone } from "./index.es121.js";
|
|
4
|
+
import { safeParse, safeParseAsync } from "./index.es125.js";
|
|
5
|
+
import { version } from "./index.es167.js";
|
|
6
|
+
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
7
|
+
var _a;
|
|
8
|
+
inst ?? (inst = {});
|
|
9
|
+
inst._zod.def = def;
|
|
10
|
+
inst._zod.bag = inst._zod.bag || {};
|
|
11
|
+
inst._zod.version = version;
|
|
12
|
+
const checks = [...inst._zod.def.checks ?? []];
|
|
13
|
+
if (inst._zod.traits.has("$ZodCheck")) {
|
|
14
|
+
checks.unshift(inst);
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
19
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
20
|
-
if (result instanceof Promise) {
|
|
21
|
-
throw new $ZodAsyncError();
|
|
16
|
+
for (const ch of checks) {
|
|
17
|
+
for (const fn of ch._zod.onattach) {
|
|
18
|
+
fn(inst);
|
|
19
|
+
}
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
if (checks.length === 0) {
|
|
22
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
23
|
+
inst._zod.deferred?.push(() => {
|
|
24
|
+
inst._zod.run = inst._zod.parse;
|
|
25
|
+
});
|
|
26
|
+
} else {
|
|
27
|
+
const runChecks = (payload, checks2, ctx) => {
|
|
28
|
+
let isAborted = aborted(payload);
|
|
29
|
+
let asyncResult;
|
|
30
|
+
for (const ch of checks2) {
|
|
31
|
+
if (ch._zod.def.when) {
|
|
32
|
+
const shouldRun = ch._zod.def.when(payload);
|
|
33
|
+
if (!shouldRun)
|
|
34
|
+
continue;
|
|
35
|
+
} else if (isAborted) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const currLen = payload.issues.length;
|
|
39
|
+
const _ = ch._zod.check(payload);
|
|
40
|
+
if (_ instanceof Promise && ctx?.async === false) {
|
|
41
|
+
throw new $ZodAsyncError();
|
|
42
|
+
}
|
|
43
|
+
if (asyncResult || _ instanceof Promise) {
|
|
44
|
+
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
45
|
+
await _;
|
|
46
|
+
const nextLen = payload.issues.length;
|
|
47
|
+
if (nextLen === currLen)
|
|
48
|
+
return;
|
|
49
|
+
if (!isAborted)
|
|
50
|
+
isAborted = aborted(payload, currLen);
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
const nextLen = payload.issues.length;
|
|
54
|
+
if (nextLen === currLen)
|
|
55
|
+
continue;
|
|
56
|
+
if (!isAborted)
|
|
57
|
+
isAborted = aborted(payload, currLen);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (asyncResult) {
|
|
61
|
+
return asyncResult.then(() => {
|
|
62
|
+
return payload;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return payload;
|
|
66
|
+
};
|
|
67
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
68
|
+
if (aborted(canary)) {
|
|
69
|
+
canary.aborted = true;
|
|
70
|
+
return canary;
|
|
71
|
+
}
|
|
72
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
73
|
+
if (checkResult instanceof Promise) {
|
|
74
|
+
if (ctx.async === false)
|
|
75
|
+
throw new $ZodAsyncError();
|
|
76
|
+
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
77
|
+
}
|
|
78
|
+
return inst._zod.parse(checkResult, ctx);
|
|
79
|
+
};
|
|
80
|
+
inst._zod.run = (payload, ctx) => {
|
|
81
|
+
if (ctx.skipChecks) {
|
|
82
|
+
return inst._zod.parse(payload, ctx);
|
|
83
|
+
}
|
|
84
|
+
if (ctx.direction === "backward") {
|
|
85
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
86
|
+
if (canary instanceof Promise) {
|
|
87
|
+
return canary.then((canary2) => {
|
|
88
|
+
return handleCanaryResult(canary2, payload, ctx);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
92
|
+
}
|
|
93
|
+
const result = inst._zod.parse(payload, ctx);
|
|
94
|
+
if (result instanceof Promise) {
|
|
95
|
+
if (ctx.async === false)
|
|
96
|
+
throw new $ZodAsyncError();
|
|
97
|
+
return result.then((result2) => runChecks(result2, checks, ctx));
|
|
98
|
+
}
|
|
99
|
+
return runChecks(result, checks, ctx);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
defineLazy(inst, "~standard", () => ({
|
|
103
|
+
validate: (value) => {
|
|
104
|
+
try {
|
|
105
|
+
const r = safeParse(inst, value);
|
|
106
|
+
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
107
|
+
} catch (_) {
|
|
108
|
+
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
vendor: "zod",
|
|
112
|
+
version: 1
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
116
|
+
$ZodType.init(inst, def);
|
|
117
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
118
|
+
payload.issues.push({
|
|
119
|
+
expected: "never",
|
|
120
|
+
code: "invalid_type",
|
|
121
|
+
input: payload.value,
|
|
122
|
+
inst
|
|
123
|
+
});
|
|
124
|
+
return payload;
|
|
125
|
+
};
|
|
126
|
+
});
|
|
40
127
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
parseAsync,
|
|
45
|
-
safeParse,
|
|
46
|
-
safeParseAsync
|
|
128
|
+
$ZodNever,
|
|
129
|
+
$ZodType,
|
|
130
|
+
clone
|
|
47
131
|
};
|
|
48
132
|
//# sourceMappingURL=index.es122.js.map
|