token-goat 2.9.21 → 2.9.23
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/THIRD_PARTY_NOTICES.md +2 -2
- package/dist/{token-goat-chunk-DISVHOW6.mjs → token-goat-chunk-2KNXKM4P.mjs} +4 -4
- package/dist/{token-goat-chunk-MEKVJZUN.mjs → token-goat-chunk-3DFULEOA.mjs} +2 -2
- package/dist/{token-goat-chunk-QCQUIPIP.mjs → token-goat-chunk-3U6ZYVX5.mjs} +1582 -773
- package/dist/{token-goat-chunk-KRPJIXCT.mjs → token-goat-chunk-45JI3MB7.mjs} +2 -2
- package/dist/{token-goat-chunk-ZJWPJL7O.mjs → token-goat-chunk-4BTOJTZD.mjs} +3 -3
- package/dist/{token-goat-chunk-FZN77SZD.mjs → token-goat-chunk-4NEYQA2B.mjs} +27 -27
- package/dist/{token-goat-chunk-M43UJVYQ.mjs → token-goat-chunk-5IID4N52.mjs} +5 -5
- package/dist/{token-goat-chunk-IAMIQLCV.mjs → token-goat-chunk-6AMDBNXA.mjs} +200 -207
- package/dist/{token-goat-chunk-XQSSPX3X.mjs → token-goat-chunk-7SPQ6IIS.mjs} +2 -2
- package/dist/{token-goat-chunk-PDYQA3AP.mjs → token-goat-chunk-7ZJCWBZI.mjs} +4 -4
- package/dist/{token-goat-chunk-KQI24O4B.mjs → token-goat-chunk-AIXKS6UY.mjs} +2 -2
- package/dist/{token-goat-chunk-T6M7DAW3.mjs → token-goat-chunk-CHLHM42P.mjs} +13 -1
- package/dist/{token-goat-chunk-PPYZS7TI.mjs → token-goat-chunk-DN5TDA7X.mjs} +3 -3
- package/dist/{token-goat-chunk-VXKT3W4C.mjs → token-goat-chunk-EYYDRFKA.mjs} +3 -3
- package/dist/{token-goat-chunk-ORRDWKLA.mjs → token-goat-chunk-F66GO3BZ.mjs} +1 -1
- package/dist/{token-goat-chunk-SMUYPBF5.mjs → token-goat-chunk-FIBB6HUJ.mjs} +51 -17
- package/dist/{token-goat-chunk-SHV6QQAS.mjs → token-goat-chunk-FZ7QU7BN.mjs} +1 -1
- package/dist/{token-goat-chunk-4V4OZHHV.mjs → token-goat-chunk-GE5FV4K4.mjs} +8 -8
- package/dist/{token-goat-chunk-QTIRVK3M.mjs → token-goat-chunk-GEYF6V37.mjs} +1 -1
- package/dist/{token-goat-chunk-MZQORUX5.mjs → token-goat-chunk-GUPX2MSL.mjs} +1 -1
- package/dist/{token-goat-chunk-IJUHQX2M.mjs → token-goat-chunk-J3WHKFP2.mjs} +1 -1
- package/dist/{token-goat-chunk-CMAJGP3E.mjs → token-goat-chunk-JIWV3M7J.mjs} +4 -4
- package/dist/{token-goat-chunk-PCR43MCM.mjs → token-goat-chunk-K2WEBYUH.mjs} +2 -2
- package/dist/{token-goat-chunk-6AQLZMCO.mjs → token-goat-chunk-K6B5REAF.mjs} +10 -14
- package/dist/{token-goat-chunk-M6CDVASA.mjs → token-goat-chunk-P2OWJWPJ.mjs} +1 -1
- package/dist/{token-goat-chunk-2ZHD3XCD.mjs → token-goat-chunk-P5DTTFWQ.mjs} +16 -2
- package/dist/{token-goat-chunk-KVAXTA2W.mjs → token-goat-chunk-PLIZZDYM.mjs} +10 -10
- package/dist/{token-goat-chunk-MQACN7VG.mjs → token-goat-chunk-QGBQOANR.mjs} +3 -3
- package/dist/{token-goat-chunk-BKHJRFDE.mjs → token-goat-chunk-R7SWCKV2.mjs} +14 -14
- package/dist/{token-goat-chunk-XJUPKJF5.mjs → token-goat-chunk-RZ5V2RJ6.mjs} +40 -32
- package/dist/{token-goat-chunk-MECDAPXB.mjs → token-goat-chunk-SM3XG5YA.mjs} +4 -4
- package/dist/{token-goat-chunk-64OEF3UN.mjs → token-goat-chunk-SVFSQRFS.mjs} +6 -6
- package/dist/{token-goat-chunk-BIEDTF6V.mjs → token-goat-chunk-TETLHLL4.mjs} +3 -3
- package/dist/{token-goat-chunk-LK3YOKDF.mjs → token-goat-chunk-UN6R6DKG.mjs} +2 -2
- package/dist/{token-goat-chunk-PHDNWISV.mjs → token-goat-chunk-UUCJI7X3.mjs} +3 -3
- package/dist/token-goat-chunk-V3CHCE6G.mjs +41 -0
- package/dist/{token-goat-chunk-QUM3UNWS.mjs → token-goat-chunk-VMJWBG3B.mjs} +5 -5
- package/dist/{token-goat-chunk-TGBSMHPM.mjs → token-goat-chunk-VVCGXBVQ.mjs} +1 -1
- package/dist/{token-goat-chunk-4IIU3GNS.mjs → token-goat-chunk-W3EV7NRO.mjs} +8 -8
- package/dist/{token-goat-chunk-OMNQUUIT.mjs → token-goat-chunk-XBESNWEX.mjs} +1 -1
- package/dist/{token-goat-chunk-GO7OWONJ.mjs → token-goat-chunk-XJRKKQYI.mjs} +17 -17
- package/dist/{token-goat-chunk-DDP64XR7.mjs → token-goat-chunk-Y4FGECX5.mjs} +3 -3
- package/dist/{token-goat-chunk-CZ5ZFJSN.mjs → token-goat-chunk-YBG7SMAK.mjs} +24 -22
- package/dist/{token-goat-chunk-CAHN4QU7.mjs → token-goat-chunk-ZVYT6SOT.mjs} +10 -10
- package/dist/token-goat-hook.mjs +17 -17
- package/dist/token-goat.core.mjs +27 -27
- package/package.json +1 -1
- package/dist/token-goat-chunk-CMHBTXMY.mjs +0 -41
|
@@ -14,6 +14,7 @@ __export(external_exports, {
|
|
|
14
14
|
$brand: () => $brand,
|
|
15
15
|
$input: () => $input,
|
|
16
16
|
$output: () => $output,
|
|
17
|
+
INVALID: () => INVALID,
|
|
17
18
|
NEVER: () => NEVER,
|
|
18
19
|
TimePrecision: () => TimePrecision,
|
|
19
20
|
ZodAny: () => ZodAny,
|
|
@@ -47,12 +48,14 @@ __export(external_exports, {
|
|
|
47
48
|
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
48
49
|
ZodFunction: () => ZodFunction,
|
|
49
50
|
ZodGUID: () => ZodGUID,
|
|
51
|
+
ZodIBAN: () => ZodIBAN,
|
|
50
52
|
ZodIPv4: () => ZodIPv4,
|
|
51
53
|
ZodIPv6: () => ZodIPv6,
|
|
52
54
|
ZodISODate: () => ZodISODate,
|
|
53
55
|
ZodISODateTime: () => ZodISODateTime,
|
|
54
56
|
ZodISODuration: () => ZodISODuration,
|
|
55
57
|
ZodISOTime: () => ZodISOTime,
|
|
58
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
56
59
|
ZodIntersection: () => ZodIntersection,
|
|
57
60
|
ZodIssueCode: () => ZodIssueCode,
|
|
58
61
|
ZodJWT: () => ZodJWT,
|
|
@@ -118,6 +121,7 @@ __export(external_exports, {
|
|
|
118
121
|
creditCard: () => creditCard2,
|
|
119
122
|
cuid: () => cuid3,
|
|
120
123
|
cuid2: () => cuid22,
|
|
124
|
+
currencyCode: () => currencyCode2,
|
|
121
125
|
custom: () => custom,
|
|
122
126
|
date: () => date2,
|
|
123
127
|
decode: () => decode2,
|
|
@@ -150,6 +154,7 @@ __export(external_exports, {
|
|
|
150
154
|
hex: () => hex2,
|
|
151
155
|
hostname: () => hostname2,
|
|
152
156
|
httpUrl: () => httpUrl,
|
|
157
|
+
iban: () => iban2,
|
|
153
158
|
includes: () => _includes,
|
|
154
159
|
input: () => input,
|
|
155
160
|
instanceof: () => _instanceof,
|
|
@@ -261,6 +266,7 @@ __export(external_exports, {
|
|
|
261
266
|
validate: () => validate,
|
|
262
267
|
validateAsync: () => validateAsync,
|
|
263
268
|
void: () => _void2,
|
|
269
|
+
withParser: () => withParser,
|
|
264
270
|
xid: () => xid2,
|
|
265
271
|
xor: () => xor
|
|
266
272
|
});
|
|
@@ -298,6 +304,7 @@ __export(core_exports2, {
|
|
|
298
304
|
$ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
|
|
299
305
|
$ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
|
|
300
306
|
$ZodCheckOverwrite: () => $ZodCheckOverwrite,
|
|
307
|
+
$ZodCheckProperties: () => $ZodCheckProperties,
|
|
301
308
|
$ZodCheckProperty: () => $ZodCheckProperty,
|
|
302
309
|
$ZodCheckRegex: () => $ZodCheckRegex,
|
|
303
310
|
$ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
|
|
@@ -322,6 +329,7 @@ __export(core_exports2, {
|
|
|
322
329
|
$ZodFile: () => $ZodFile,
|
|
323
330
|
$ZodFunction: () => $ZodFunction,
|
|
324
331
|
$ZodGUID: () => $ZodGUID,
|
|
332
|
+
$ZodIBAN: () => $ZodIBAN,
|
|
325
333
|
$ZodIPv4: () => $ZodIPv4,
|
|
326
334
|
$ZodIPv6: () => $ZodIPv6,
|
|
327
335
|
$ZodISODate: () => $ZodISODate,
|
|
@@ -423,6 +431,7 @@ __export(core_exports2, {
|
|
|
423
431
|
_gt: () => _gt,
|
|
424
432
|
_gte: () => _gte,
|
|
425
433
|
_guid: () => _guid,
|
|
434
|
+
_iban: () => _iban,
|
|
426
435
|
_includes: () => _includes,
|
|
427
436
|
_int: () => _int,
|
|
428
437
|
_int32: () => _int32,
|
|
@@ -514,6 +523,9 @@ __export(core_exports2, {
|
|
|
514
523
|
_void: () => _void,
|
|
515
524
|
_xid: () => _xid,
|
|
516
525
|
_xor: () => _xor,
|
|
526
|
+
base64Charset: () => base64Charset,
|
|
527
|
+
base64urlCharset: () => base64urlCharset,
|
|
528
|
+
canParseURL: () => canParseURL,
|
|
517
529
|
clone: () => clone,
|
|
518
530
|
compile: () => compile,
|
|
519
531
|
compileFn: () => compileFn,
|
|
@@ -540,6 +552,7 @@ __export(core_exports2, {
|
|
|
540
552
|
isValidBase64URL: () => isValidBase64URL,
|
|
541
553
|
isValidCIDRv6: () => isValidCIDRv6,
|
|
542
554
|
isValidCreditCard: () => isValidCreditCard,
|
|
555
|
+
isValidIBAN: () => isValidIBAN,
|
|
543
556
|
isValidIPv6: () => isValidIPv6,
|
|
544
557
|
isValidJWT: () => isValidJWT,
|
|
545
558
|
locales: () => locales_exports,
|
|
@@ -550,7 +563,8 @@ __export(core_exports2, {
|
|
|
550
563
|
parseAsync: () => parseAsync,
|
|
551
564
|
parseURLObject: () => parseURLObject,
|
|
552
565
|
prettifyError: () => prettifyError,
|
|
553
|
-
process: () =>
|
|
566
|
+
process: () => processSchema,
|
|
567
|
+
processSchema: () => processSchema,
|
|
554
568
|
regexes: () => regexes_exports,
|
|
555
569
|
registry: () => registry,
|
|
556
570
|
safeDecode: () => safeDecode,
|
|
@@ -570,7 +584,9 @@ __export(core_exports2, {
|
|
|
570
584
|
util: () => util_exports,
|
|
571
585
|
validate: () => validate,
|
|
572
586
|
validateAsync: () => validateAsync,
|
|
573
|
-
|
|
587
|
+
validateURL: () => validateURL,
|
|
588
|
+
version: () => version,
|
|
589
|
+
withParser: () => withParser
|
|
574
590
|
});
|
|
575
591
|
init_define_import_meta_env();
|
|
576
592
|
|
|
@@ -606,6 +622,7 @@ __export(util_exports, {
|
|
|
606
622
|
createTransparentProxy: () => createTransparentProxy,
|
|
607
623
|
defineLazy: () => defineLazy,
|
|
608
624
|
defineLazyInternal: () => defineLazyInternal,
|
|
625
|
+
derived: () => derived,
|
|
609
626
|
esc: () => esc,
|
|
610
627
|
escapeRegex: () => escapeRegex,
|
|
611
628
|
explicitlyAborted: () => explicitlyAborted,
|
|
@@ -643,6 +660,7 @@ __export(util_exports, {
|
|
|
643
660
|
promiseAllObject: () => promiseAllObject,
|
|
644
661
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
645
662
|
randomString: () => randomString,
|
|
663
|
+
rawShape: () => rawShape,
|
|
646
664
|
required: () => required,
|
|
647
665
|
safeExtend: () => safeExtend,
|
|
648
666
|
shallowClone: () => shallowClone,
|
|
@@ -684,18 +702,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
684
702
|
return value.toString();
|
|
685
703
|
return value;
|
|
686
704
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
705
|
+
var Cached = class {
|
|
706
|
+
constructor(getter) {
|
|
707
|
+
this._getter = getter;
|
|
708
|
+
this._value = void 0;
|
|
709
|
+
}
|
|
710
|
+
get value() {
|
|
711
|
+
const getter = this._getter;
|
|
712
|
+
if (getter !== void 0) {
|
|
713
|
+
this._value = getter();
|
|
714
|
+
this._getter = void 0;
|
|
697
715
|
}
|
|
698
|
-
|
|
716
|
+
return this._value;
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
function cached(getter) {
|
|
720
|
+
return new Cached(getter);
|
|
699
721
|
}
|
|
700
722
|
function nullish(input2) {
|
|
701
723
|
return input2 === null || input2 === void 0;
|
|
@@ -747,6 +769,56 @@ function assignProp(target, prop, value) {
|
|
|
747
769
|
configurable: true
|
|
748
770
|
});
|
|
749
771
|
}
|
|
772
|
+
function rawShape(def) {
|
|
773
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
774
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
775
|
+
}
|
|
776
|
+
function sourceShape(schema) {
|
|
777
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
778
|
+
}
|
|
779
|
+
function deferProp(target, key, getter) {
|
|
780
|
+
Object.defineProperty(target, key, {
|
|
781
|
+
get() {
|
|
782
|
+
const value = getter();
|
|
783
|
+
assignProp(this, key, value);
|
|
784
|
+
return value;
|
|
785
|
+
},
|
|
786
|
+
enumerable: true,
|
|
787
|
+
configurable: true
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
function putProp(target, key, value) {
|
|
791
|
+
if (key in target)
|
|
792
|
+
assignProp(target, key, value);
|
|
793
|
+
else
|
|
794
|
+
target[key] = value;
|
|
795
|
+
}
|
|
796
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
797
|
+
const raw = sourceShape(source);
|
|
798
|
+
for (const key of keys) {
|
|
799
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
800
|
+
if (!desc.enumerable)
|
|
801
|
+
continue;
|
|
802
|
+
if (desc.get) {
|
|
803
|
+
deferProp(target, key, () => {
|
|
804
|
+
const value = source._zod.def.shape[key];
|
|
805
|
+
return wrap ? wrap(value, key) : value;
|
|
806
|
+
});
|
|
807
|
+
} else
|
|
808
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
function mirrorProps(target, source) {
|
|
812
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
813
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
814
|
+
if (!desc.enumerable)
|
|
815
|
+
continue;
|
|
816
|
+
if (desc.get)
|
|
817
|
+
deferProp(target, key, () => source[key]);
|
|
818
|
+
else
|
|
819
|
+
putProp(target, key, desc.value);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
750
822
|
function mergeDefs(...defs) {
|
|
751
823
|
const mergedDescriptors = {};
|
|
752
824
|
for (const def of defs) {
|
|
@@ -985,23 +1057,21 @@ function pick(schema, mask) {
|
|
|
985
1057
|
if (hasChecks) {
|
|
986
1058
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
987
1059
|
}
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
});
|
|
1004
|
-
return clone(schema, def);
|
|
1060
|
+
const newShape = {};
|
|
1061
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
1062
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1063
|
+
}
|
|
1064
|
+
function maskedKeys(schema, mask) {
|
|
1065
|
+
const raw = sourceShape(schema);
|
|
1066
|
+
const keys = [];
|
|
1067
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
1068
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
1069
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1070
|
+
}
|
|
1071
|
+
if (mask[key])
|
|
1072
|
+
keys.push(key);
|
|
1073
|
+
}
|
|
1074
|
+
return keys;
|
|
1005
1075
|
}
|
|
1006
1076
|
function omit(schema, mask) {
|
|
1007
1077
|
const currDef = schema._zod.def;
|
|
@@ -1010,23 +1080,10 @@ function omit(schema, mask) {
|
|
|
1010
1080
|
if (hasChecks) {
|
|
1011
1081
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
1012
1082
|
}
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
1018
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1019
|
-
}
|
|
1020
|
-
if (!mask[key])
|
|
1021
|
-
continue;
|
|
1022
|
-
delete newShape[key];
|
|
1023
|
-
}
|
|
1024
|
-
assignProp(this, "shape", newShape);
|
|
1025
|
-
return newShape;
|
|
1026
|
-
},
|
|
1027
|
-
checks: []
|
|
1028
|
-
});
|
|
1029
|
-
return clone(schema, def);
|
|
1083
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
1084
|
+
const newShape = {};
|
|
1085
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
1086
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1030
1087
|
}
|
|
1031
1088
|
function extend(schema, shape) {
|
|
1032
1089
|
if (!isPlainObject(shape)) {
|
|
@@ -1035,34 +1092,26 @@ function extend(schema, shape) {
|
|
|
1035
1092
|
const checks = schema._zod.def.checks;
|
|
1036
1093
|
const hasChecks = checks && checks.length > 0;
|
|
1037
1094
|
if (hasChecks) {
|
|
1038
|
-
const existingShape = schema
|
|
1095
|
+
const existingShape = sourceShape(schema);
|
|
1039
1096
|
for (const key of Reflect.ownKeys(shape)) {
|
|
1040
1097
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
1041
1098
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
1042
1099
|
}
|
|
1043
1100
|
}
|
|
1044
1101
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
return clone(schema, def);
|
|
1102
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
1103
|
+
}
|
|
1104
|
+
function extended(schema, shape) {
|
|
1105
|
+
const newShape = {};
|
|
1106
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
1107
|
+
mirrorProps(newShape, shape);
|
|
1108
|
+
return newShape;
|
|
1053
1109
|
}
|
|
1054
1110
|
function safeExtend(schema, shape) {
|
|
1055
1111
|
if (!isPlainObject(shape)) {
|
|
1056
1112
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1057
1113
|
}
|
|
1058
|
-
|
|
1059
|
-
get shape() {
|
|
1060
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1061
|
-
assignProp(this, "shape", _shape);
|
|
1062
|
-
return _shape;
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
return clone(schema, def);
|
|
1114
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
1066
1115
|
}
|
|
1067
1116
|
function merge(a, b) {
|
|
1068
1117
|
if (!b?._zod?.def) {
|
|
@@ -1071,12 +1120,11 @@ function merge(a, b) {
|
|
|
1071
1120
|
if (a._zod.def.checks?.length) {
|
|
1072
1121
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
1073
1122
|
}
|
|
1123
|
+
const newShape = {};
|
|
1124
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
1125
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
1074
1126
|
const def = mergeDefs(a._zod.def, {
|
|
1075
|
-
|
|
1076
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
1077
|
-
assignProp(this, "shape", _shape);
|
|
1078
|
-
return _shape;
|
|
1079
|
-
},
|
|
1127
|
+
shape: newShape,
|
|
1080
1128
|
get catchall() {
|
|
1081
1129
|
return b._zod.def.catchall;
|
|
1082
1130
|
},
|
|
@@ -1091,67 +1139,19 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
1091
1139
|
if (hasChecks) {
|
|
1092
1140
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
1093
1141
|
}
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
if (mask) {
|
|
1099
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
1100
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
1101
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1102
|
-
}
|
|
1103
|
-
if (!mask[key])
|
|
1104
|
-
continue;
|
|
1105
|
-
shape[key] = Class2 ? new Class2({
|
|
1106
|
-
type: "optional",
|
|
1107
|
-
innerType: oldShape[key]
|
|
1108
|
-
}) : oldShape[key];
|
|
1109
|
-
}
|
|
1110
|
-
} else {
|
|
1111
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
1112
|
-
shape[key] = Class2 ? new Class2({
|
|
1113
|
-
type: "optional",
|
|
1114
|
-
innerType: oldShape[key]
|
|
1115
|
-
}) : oldShape[key];
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
assignProp(this, "shape", shape);
|
|
1119
|
-
return shape;
|
|
1120
|
-
},
|
|
1121
|
-
checks: []
|
|
1122
|
-
});
|
|
1123
|
-
return clone(schema, def);
|
|
1142
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
1143
|
+
const newShape = {};
|
|
1144
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
|
|
1145
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
1124
1146
|
}
|
|
1125
1147
|
function required(Class2, schema, mask) {
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1134
|
-
}
|
|
1135
|
-
if (!mask[key])
|
|
1136
|
-
continue;
|
|
1137
|
-
shape[key] = new Class2({
|
|
1138
|
-
type: "nonoptional",
|
|
1139
|
-
innerType: oldShape[key]
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
} else {
|
|
1143
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
1144
|
-
shape[key] = new Class2({
|
|
1145
|
-
type: "nonoptional",
|
|
1146
|
-
innerType: oldShape[key]
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
assignProp(this, "shape", shape);
|
|
1151
|
-
return shape;
|
|
1152
|
-
}
|
|
1153
|
-
});
|
|
1154
|
-
return clone(schema, def);
|
|
1148
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
1149
|
+
const newShape = {};
|
|
1150
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
|
|
1151
|
+
// overwrite with non-optional
|
|
1152
|
+
selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
1153
|
+
));
|
|
1154
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
1155
1155
|
}
|
|
1156
1156
|
function aborted(x, startIndex = 0) {
|
|
1157
1157
|
if (x.aborted === true)
|
|
@@ -1201,13 +1201,18 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
1203
1203
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
|
|
1204
|
+
const full = {};
|
|
1205
|
+
for (const k of Object.keys(iss)) {
|
|
1206
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
1207
|
+
continue;
|
|
1208
|
+
full[k] = iss[k];
|
|
1209
|
+
}
|
|
1210
|
+
full.path ?? (full.path = []);
|
|
1211
|
+
full.message = message;
|
|
1207
1212
|
if (ctx?.reportInput) {
|
|
1208
|
-
|
|
1213
|
+
full.input = iss.input;
|
|
1209
1214
|
}
|
|
1210
|
-
return
|
|
1215
|
+
return full;
|
|
1211
1216
|
}
|
|
1212
1217
|
function getSizableOrigin(input2) {
|
|
1213
1218
|
if (input2 instanceof Set)
|
|
@@ -1334,6 +1339,23 @@ function own(inst, key, value, enumerable = true) {
|
|
|
1334
1339
|
function hide(inst, key, value) {
|
|
1335
1340
|
return own(inst, key, value, false);
|
|
1336
1341
|
}
|
|
1342
|
+
// @__NO_SIDE_EFFECTS__
|
|
1343
|
+
function derived(computes, table) {
|
|
1344
|
+
for (const key in computes) {
|
|
1345
|
+
const compute = computes[key];
|
|
1346
|
+
Object.defineProperty(table, key, {
|
|
1347
|
+
configurable: true,
|
|
1348
|
+
enumerable: true,
|
|
1349
|
+
get() {
|
|
1350
|
+
return own(this, key, compute(this));
|
|
1351
|
+
},
|
|
1352
|
+
set(value) {
|
|
1353
|
+
own(this, key, value);
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
return table;
|
|
1358
|
+
}
|
|
1337
1359
|
function defineBound(proto, key, fn) {
|
|
1338
1360
|
Object.defineProperty(proto, key, {
|
|
1339
1361
|
configurable: true,
|
|
@@ -1461,8 +1483,7 @@ function $constructor(name, initializer3, proto, params) {
|
|
|
1461
1483
|
} finally {
|
|
1462
1484
|
_zodDesc.value = void 0;
|
|
1463
1485
|
}
|
|
1464
|
-
}
|
|
1465
|
-
if (inst._zod.traits.has(name)) {
|
|
1486
|
+
} else if (inst._zod.traits.has(name)) {
|
|
1466
1487
|
return;
|
|
1467
1488
|
}
|
|
1468
1489
|
inst._zod.traits.add(name);
|
|
@@ -1557,16 +1578,12 @@ var _messageDesc = {
|
|
|
1557
1578
|
enumerable: true,
|
|
1558
1579
|
configurable: true
|
|
1559
1580
|
};
|
|
1560
|
-
var _zodDesc2 = { value: void 0, enumerable: false };
|
|
1561
1581
|
var _issuesDesc = { value: void 0, enumerable: false };
|
|
1562
1582
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
1563
1583
|
var initializer = (inst, def) => {
|
|
1564
1584
|
inst.name = "$ZodError";
|
|
1565
|
-
_zodDesc2.value = inst._zod;
|
|
1566
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
1567
1585
|
_issuesDesc.value = def;
|
|
1568
1586
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
1569
|
-
_zodDesc2.value = void 0;
|
|
1570
1587
|
_issuesDesc.value = void 0;
|
|
1571
1588
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
1572
1589
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -1600,10 +1617,10 @@ function node(obj, key, make) {
|
|
|
1600
1617
|
}
|
|
1601
1618
|
return obj[key];
|
|
1602
1619
|
}
|
|
1603
|
-
function flattenError(
|
|
1620
|
+
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
1604
1621
|
const fieldErrors = {};
|
|
1605
1622
|
const formErrors = [];
|
|
1606
|
-
for (const sub of
|
|
1623
|
+
for (const sub of error62.issues) {
|
|
1607
1624
|
if (sub.path.length > 0) {
|
|
1608
1625
|
node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
1609
1626
|
} else {
|
|
@@ -1612,10 +1629,10 @@ function flattenError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1612
1629
|
}
|
|
1613
1630
|
return { formErrors, fieldErrors };
|
|
1614
1631
|
}
|
|
1615
|
-
function formatError(
|
|
1632
|
+
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
1616
1633
|
const fieldErrors = { _errors: [] };
|
|
1617
|
-
const processError = (
|
|
1618
|
-
for (const issue2 of
|
|
1634
|
+
const processError = (error63, path = []) => {
|
|
1635
|
+
for (const issue2 of error63.issues) {
|
|
1619
1636
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1620
1637
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
1621
1638
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -1657,14 +1674,14 @@ function formatError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1657
1674
|
}
|
|
1658
1675
|
}
|
|
1659
1676
|
};
|
|
1660
|
-
processError(
|
|
1677
|
+
processError(error62);
|
|
1661
1678
|
return fieldErrors;
|
|
1662
1679
|
}
|
|
1663
|
-
function treeifyError(
|
|
1680
|
+
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
1664
1681
|
const result = { errors: [] };
|
|
1665
|
-
const processError = (
|
|
1682
|
+
const processError = (error63, path = []) => {
|
|
1666
1683
|
var _a3;
|
|
1667
|
-
for (const issue2 of
|
|
1684
|
+
for (const issue2 of error63.issues) {
|
|
1668
1685
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1669
1686
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
1670
1687
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -1706,7 +1723,7 @@ function treeifyError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1706
1723
|
}
|
|
1707
1724
|
}
|
|
1708
1725
|
};
|
|
1709
|
-
processError(
|
|
1726
|
+
processError(error62);
|
|
1710
1727
|
return result;
|
|
1711
1728
|
}
|
|
1712
1729
|
function toDotPath(_path) {
|
|
@@ -1727,9 +1744,9 @@ function toDotPath(_path) {
|
|
|
1727
1744
|
}
|
|
1728
1745
|
return segs.join("");
|
|
1729
1746
|
}
|
|
1730
|
-
function prettifyError(
|
|
1747
|
+
function prettifyError(error62) {
|
|
1731
1748
|
const lines = [];
|
|
1732
|
-
const issues = [...
|
|
1749
|
+
const issues = [...error62.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
1733
1750
|
for (const issue2 of issues) {
|
|
1734
1751
|
lines.push(`\u2716 ${issue2.message}`);
|
|
1735
1752
|
if (issue2.path?.length)
|
|
@@ -1781,33 +1798,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
1781
1798
|
if (result instanceof Promise) {
|
|
1782
1799
|
throw new $ZodAsyncError();
|
|
1783
1800
|
}
|
|
1784
|
-
return result.issues.length ? {
|
|
1785
|
-
success: false,
|
|
1786
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1787
|
-
} : { success: true, data: result.value };
|
|
1801
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
1788
1802
|
};
|
|
1789
1803
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
1804
|
+
function failure(Err, issues, ctx) {
|
|
1805
|
+
let error62;
|
|
1806
|
+
return {
|
|
1807
|
+
success: false,
|
|
1808
|
+
get error() {
|
|
1809
|
+
if (!error62) {
|
|
1810
|
+
error62 = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1811
|
+
issues = void 0;
|
|
1812
|
+
ctx = void 0;
|
|
1813
|
+
}
|
|
1814
|
+
return error62;
|
|
1815
|
+
},
|
|
1816
|
+
set error(e) {
|
|
1817
|
+
error62 = e;
|
|
1818
|
+
issues = void 0;
|
|
1819
|
+
ctx = void 0;
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1790
1823
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1791
1824
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
1792
1825
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1793
1826
|
if (result instanceof Promise)
|
|
1794
1827
|
result = await result;
|
|
1795
|
-
return result.issues.length ? {
|
|
1796
|
-
success: false,
|
|
1797
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1798
|
-
} : { success: true, data: result.value };
|
|
1828
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
1799
1829
|
};
|
|
1800
1830
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
1801
1831
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
1802
1832
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
1803
1833
|
var validate = ((schema, value, _ctx) => {
|
|
1804
1834
|
const validator = schema._zod.bag.validator;
|
|
1805
|
-
if (validator !== void 0
|
|
1806
|
-
|
|
1835
|
+
if (validator !== void 0) {
|
|
1836
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
1837
|
+
return true;
|
|
1838
|
+
if (validator.definite === true && _ctx === void 0)
|
|
1839
|
+
return false;
|
|
1840
|
+
}
|
|
1807
1841
|
return validateFallback(schema, value, _ctx);
|
|
1808
1842
|
});
|
|
1809
1843
|
function validateFallback(schema, value, _ctx) {
|
|
1810
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
1844
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
1811
1845
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
1812
1846
|
let result;
|
|
1813
1847
|
if (fallbackRun) {
|
|
@@ -1822,7 +1856,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
1822
1856
|
return result.issues.length === 0;
|
|
1823
1857
|
}
|
|
1824
1858
|
var validateAsync = async (schema, value, _ctx) => {
|
|
1825
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
1859
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
1826
1860
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1827
1861
|
if (result instanceof Promise)
|
|
1828
1862
|
result = await result;
|
|
@@ -1890,6 +1924,7 @@ init_define_import_meta_env();
|
|
|
1890
1924
|
// node_modules/zod/v4/core/regexes.js
|
|
1891
1925
|
var regexes_exports = {};
|
|
1892
1926
|
__export(regexes_exports, {
|
|
1927
|
+
anyString: () => anyString,
|
|
1893
1928
|
base64: () => base64,
|
|
1894
1929
|
base64url: () => base64url,
|
|
1895
1930
|
bigint: () => bigint,
|
|
@@ -1900,6 +1935,7 @@ __export(regexes_exports, {
|
|
|
1900
1935
|
creditCard: () => creditCard,
|
|
1901
1936
|
cuid: () => cuid,
|
|
1902
1937
|
cuid2: () => cuid2,
|
|
1938
|
+
currencyCode: () => currencyCode,
|
|
1903
1939
|
date: () => date,
|
|
1904
1940
|
datetime: () => datetime,
|
|
1905
1941
|
domain: () => domain,
|
|
@@ -1913,6 +1949,7 @@ __export(regexes_exports, {
|
|
|
1913
1949
|
hostname: () => hostname,
|
|
1914
1950
|
html5Email: () => html5Email,
|
|
1915
1951
|
httpProtocol: () => httpProtocol,
|
|
1952
|
+
iban: () => iban,
|
|
1916
1953
|
idnEmail: () => idnEmail,
|
|
1917
1954
|
integer: () => integer,
|
|
1918
1955
|
ipv4: () => ipv4,
|
|
@@ -1973,13 +2010,13 @@ var uuid = (version2) => {
|
|
|
1973
2010
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
1974
2011
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
1975
2012
|
var uuid7 = /* @__PURE__ */ uuid(7);
|
|
1976
|
-
var email = /^(
|
|
2013
|
+
var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1977
2014
|
var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1978
2015
|
var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
1979
2016
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
1980
2017
|
var idnEmail = unicodeEmail;
|
|
1981
2018
|
var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1982
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
2019
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1983
2020
|
function emoji() {
|
|
1984
2021
|
return new RegExp(_emoji, "u");
|
|
1985
2022
|
}
|
|
@@ -1992,12 +2029,14 @@ var mac = (delimiter) => {
|
|
|
1992
2029
|
var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
1993
2030
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
1994
2031
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
1995
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
2032
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
1996
2033
|
var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
1997
2034
|
var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
1998
2035
|
var httpProtocol = /^https?$/;
|
|
1999
2036
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
2000
2037
|
var creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
2038
|
+
var currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
|
|
2039
|
+
var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
2001
2040
|
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
2002
2041
|
function anchor(source) {
|
|
2003
2042
|
return new RegExp(`^${source}$`);
|
|
@@ -2019,6 +2058,7 @@ function datetime(args) {
|
|
|
2019
2058
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
2020
2059
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
2021
2060
|
}
|
|
2061
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
2022
2062
|
var string = (params) => {
|
|
2023
2063
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
2024
2064
|
return new RegExp(`^${regex}$`);
|
|
@@ -2077,16 +2117,6 @@ var numericOriginMap = {
|
|
|
2077
2117
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
2078
2118
|
$ZodCheck.init(inst, def);
|
|
2079
2119
|
const origin = numericOriginMap[typeof def.value];
|
|
2080
|
-
inst._zod.onattach.push((inst2) => {
|
|
2081
|
-
const bag = inst2._zod.bag;
|
|
2082
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
2083
|
-
if (def.value < curr) {
|
|
2084
|
-
if (def.inclusive)
|
|
2085
|
-
bag.maximum = def.value;
|
|
2086
|
-
else
|
|
2087
|
-
bag.exclusiveMaximum = def.value;
|
|
2088
|
-
}
|
|
2089
|
-
});
|
|
2090
2120
|
inst._zod.check = (payload) => {
|
|
2091
2121
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
2092
2122
|
return;
|
|
@@ -2105,16 +2135,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
2105
2135
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
2106
2136
|
$ZodCheck.init(inst, def);
|
|
2107
2137
|
const origin = numericOriginMap[typeof def.value];
|
|
2108
|
-
inst._zod.onattach.push((inst2) => {
|
|
2109
|
-
const bag = inst2._zod.bag;
|
|
2110
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
2111
|
-
if (def.value > curr) {
|
|
2112
|
-
if (def.inclusive)
|
|
2113
|
-
bag.minimum = def.value;
|
|
2114
|
-
else
|
|
2115
|
-
bag.exclusiveMinimum = def.value;
|
|
2116
|
-
}
|
|
2117
|
-
});
|
|
2118
2138
|
inst._zod.check = (payload) => {
|
|
2119
2139
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
2120
2140
|
return;
|
|
@@ -2132,10 +2152,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
2132
2152
|
});
|
|
2133
2153
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
2134
2154
|
$ZodCheck.init(inst, def);
|
|
2135
|
-
inst._zod.onattach.push((inst2) => {
|
|
2136
|
-
var _a3;
|
|
2137
|
-
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
2138
|
-
});
|
|
2139
2155
|
inst._zod.check = (payload) => {
|
|
2140
2156
|
if (typeof payload.value !== typeof def.value)
|
|
2141
2157
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -2161,14 +2177,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2161
2177
|
const isInt = def.format?.includes("int");
|
|
2162
2178
|
const origin = isInt ? "int" : "number";
|
|
2163
2179
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
2164
|
-
inst._zod.onattach.push((inst2) => {
|
|
2165
|
-
const bag = inst2._zod.bag;
|
|
2166
|
-
bag.format = def.format;
|
|
2167
|
-
bag.minimum = minimum;
|
|
2168
|
-
bag.maximum = maximum;
|
|
2169
|
-
if (isInt)
|
|
2170
|
-
bag.pattern = integer;
|
|
2171
|
-
});
|
|
2172
2180
|
inst._zod.check = (payload) => {
|
|
2173
2181
|
const input2 = payload.value;
|
|
2174
2182
|
if (isInt) {
|
|
@@ -2237,12 +2245,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2237
2245
|
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
2238
2246
|
$ZodCheck.init(inst, def);
|
|
2239
2247
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
2240
|
-
inst._zod.onattach.push((inst2) => {
|
|
2241
|
-
const bag = inst2._zod.bag;
|
|
2242
|
-
bag.format = def.format;
|
|
2243
|
-
bag.minimum = minimum;
|
|
2244
|
-
bag.maximum = maximum;
|
|
2245
|
-
});
|
|
2246
2248
|
inst._zod.check = (payload) => {
|
|
2247
2249
|
const input2 = payload.value;
|
|
2248
2250
|
if (input2 < minimum) {
|
|
@@ -2273,11 +2275,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
2273
2275
|
var _a3;
|
|
2274
2276
|
$ZodCheck.init(inst, def);
|
|
2275
2277
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2276
|
-
inst._zod.onattach.push((inst2) => {
|
|
2277
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2278
|
-
if (def.maximum < curr)
|
|
2279
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
2280
|
-
});
|
|
2281
2278
|
inst._zod.check = (payload) => {
|
|
2282
2279
|
const input2 = payload.value;
|
|
2283
2280
|
const size = input2.size;
|
|
@@ -2298,11 +2295,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
2298
2295
|
var _a3;
|
|
2299
2296
|
$ZodCheck.init(inst, def);
|
|
2300
2297
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2301
|
-
inst._zod.onattach.push((inst2) => {
|
|
2302
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2303
|
-
if (def.minimum > curr)
|
|
2304
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
2305
|
-
});
|
|
2306
2298
|
inst._zod.check = (payload) => {
|
|
2307
2299
|
const input2 = payload.value;
|
|
2308
2300
|
const size = input2.size;
|
|
@@ -2323,12 +2315,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
2323
2315
|
var _a3;
|
|
2324
2316
|
$ZodCheck.init(inst, def);
|
|
2325
2317
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2326
|
-
inst._zod.onattach.push((inst2) => {
|
|
2327
|
-
const bag = inst2._zod.bag;
|
|
2328
|
-
bag.minimum = def.size;
|
|
2329
|
-
bag.maximum = def.size;
|
|
2330
|
-
bag.size = def.size;
|
|
2331
|
-
});
|
|
2332
2318
|
inst._zod.check = (payload) => {
|
|
2333
2319
|
const input2 = payload.value;
|
|
2334
2320
|
const size = input2.size;
|
|
@@ -2350,11 +2336,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2350
2336
|
var _a3;
|
|
2351
2337
|
$ZodCheck.init(inst, def);
|
|
2352
2338
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2353
|
-
inst._zod.onattach.push((inst2) => {
|
|
2354
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2355
|
-
if (def.maximum < curr)
|
|
2356
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
2357
|
-
});
|
|
2358
2339
|
inst._zod.check = (payload) => {
|
|
2359
2340
|
const input2 = payload.value;
|
|
2360
2341
|
const units = input2.length;
|
|
@@ -2377,11 +2358,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2377
2358
|
var _a3;
|
|
2378
2359
|
$ZodCheck.init(inst, def);
|
|
2379
2360
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2380
|
-
inst._zod.onattach.push((inst2) => {
|
|
2381
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2382
|
-
if (def.minimum > curr)
|
|
2383
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
2384
|
-
});
|
|
2385
2361
|
inst._zod.check = (payload) => {
|
|
2386
2362
|
const input2 = payload.value;
|
|
2387
2363
|
const units = input2.length;
|
|
@@ -2404,12 +2380,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2404
2380
|
var _a3;
|
|
2405
2381
|
$ZodCheck.init(inst, def);
|
|
2406
2382
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2407
|
-
inst._zod.onattach.push((inst2) => {
|
|
2408
|
-
const bag = inst2._zod.bag;
|
|
2409
|
-
bag.minimum = def.length;
|
|
2410
|
-
bag.maximum = def.length;
|
|
2411
|
-
bag.length = def.length;
|
|
2412
|
-
});
|
|
2413
2383
|
inst._zod.check = (payload) => {
|
|
2414
2384
|
const input2 = payload.value;
|
|
2415
2385
|
const units = input2.length;
|
|
@@ -2432,14 +2402,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2432
2402
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
2433
2403
|
var _a3, _b;
|
|
2434
2404
|
$ZodCheck.init(inst, def);
|
|
2435
|
-
inst._zod.onattach.push((inst2) => {
|
|
2436
|
-
const bag = inst2._zod.bag;
|
|
2437
|
-
bag.format = def.format;
|
|
2438
|
-
if (def.pattern) {
|
|
2439
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2440
|
-
bag.patterns.add(def.pattern);
|
|
2441
|
-
}
|
|
2442
|
-
});
|
|
2443
2405
|
if (def.pattern)
|
|
2444
2406
|
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
2445
2407
|
def.pattern.lastIndex = 0;
|
|
@@ -2489,11 +2451,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
2489
2451
|
const escapedRegex = escapeRegex(def.includes);
|
|
2490
2452
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
2491
2453
|
def.pattern = pattern;
|
|
2492
|
-
inst._zod.onattach.push((inst2) => {
|
|
2493
|
-
const bag = inst2._zod.bag;
|
|
2494
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2495
|
-
bag.patterns.add(pattern);
|
|
2496
|
-
});
|
|
2497
2454
|
inst._zod.check = (payload) => {
|
|
2498
2455
|
if (payload.value.includes(def.includes, def.position))
|
|
2499
2456
|
return;
|
|
@@ -2512,11 +2469,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
2512
2469
|
$ZodCheck.init(inst, def);
|
|
2513
2470
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
2514
2471
|
def.pattern ?? (def.pattern = pattern);
|
|
2515
|
-
inst._zod.onattach.push((inst2) => {
|
|
2516
|
-
const bag = inst2._zod.bag;
|
|
2517
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2518
|
-
bag.patterns.add(pattern);
|
|
2519
|
-
});
|
|
2520
2472
|
inst._zod.check = (payload) => {
|
|
2521
2473
|
if (payload.value.startsWith(def.prefix))
|
|
2522
2474
|
return;
|
|
@@ -2535,11 +2487,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
2535
2487
|
$ZodCheck.init(inst, def);
|
|
2536
2488
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
2537
2489
|
def.pattern ?? (def.pattern = pattern);
|
|
2538
|
-
inst._zod.onattach.push((inst2) => {
|
|
2539
|
-
const bag = inst2._zod.bag;
|
|
2540
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2541
|
-
bag.patterns.add(pattern);
|
|
2542
|
-
});
|
|
2543
2490
|
inst._zod.check = (payload) => {
|
|
2544
2491
|
if (payload.value.endsWith(def.suffix))
|
|
2545
2492
|
return;
|
|
@@ -2573,12 +2520,37 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
|
|
|
2573
2520
|
return;
|
|
2574
2521
|
};
|
|
2575
2522
|
});
|
|
2523
|
+
var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
|
|
2524
|
+
$ZodCheck.init(inst, def);
|
|
2525
|
+
hide(inst, Symbol.iterator, function* () {
|
|
2526
|
+
yield inst;
|
|
2527
|
+
});
|
|
2528
|
+
let entries;
|
|
2529
|
+
inst._zod.check = (payload) => {
|
|
2530
|
+
if (payload.value == null) {
|
|
2531
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
2532
|
+
return void 0;
|
|
2533
|
+
}
|
|
2534
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
2535
|
+
const input2 = payload.value;
|
|
2536
|
+
let proms;
|
|
2537
|
+
for (const [key, schema] of entries) {
|
|
2538
|
+
const result = schema._zod.run({ value: input2[key], issues: [] }, {});
|
|
2539
|
+
if (result instanceof Promise) {
|
|
2540
|
+
proms ?? (proms = []);
|
|
2541
|
+
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
|
|
2542
|
+
} else {
|
|
2543
|
+
handleCheckPropertyResult(result, payload, key);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
if (proms)
|
|
2547
|
+
return Promise.all(proms).then(() => void 0);
|
|
2548
|
+
return void 0;
|
|
2549
|
+
};
|
|
2550
|
+
});
|
|
2576
2551
|
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
2577
2552
|
$ZodCheck.init(inst, def);
|
|
2578
2553
|
const mimeSet = new Set(def.mime);
|
|
2579
|
-
inst._zod.onattach.push((inst2) => {
|
|
2580
|
-
inst2._zod.bag.mime = def.mime;
|
|
2581
|
-
});
|
|
2582
2554
|
inst._zod.check = (payload) => {
|
|
2583
2555
|
if (mimeSet.has(payload.value.type))
|
|
2584
2556
|
return;
|
|
@@ -2607,10 +2579,14 @@ var Doc = class {
|
|
|
2607
2579
|
this.args = args;
|
|
2608
2580
|
this.closed = closed;
|
|
2609
2581
|
}
|
|
2582
|
+
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
|
|
2610
2583
|
indented(fn) {
|
|
2611
2584
|
this.indent += 1;
|
|
2612
|
-
|
|
2613
|
-
|
|
2585
|
+
try {
|
|
2586
|
+
fn(this);
|
|
2587
|
+
} finally {
|
|
2588
|
+
this.indent -= 1;
|
|
2589
|
+
}
|
|
2614
2590
|
}
|
|
2615
2591
|
write(arg) {
|
|
2616
2592
|
if (typeof arg === "function") {
|
|
@@ -2640,8 +2616,8 @@ ${content.join("\n")}
|
|
|
2640
2616
|
init_define_import_meta_env();
|
|
2641
2617
|
var version = {
|
|
2642
2618
|
major: 4,
|
|
2643
|
-
minor:
|
|
2644
|
-
patch:
|
|
2619
|
+
minor: 6,
|
|
2620
|
+
patch: 5
|
|
2645
2621
|
};
|
|
2646
2622
|
|
|
2647
2623
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -2754,15 +2730,22 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
2754
2730
|
own(this, "~standard", value);
|
|
2755
2731
|
}
|
|
2756
2732
|
});
|
|
2757
|
-
var toStandardResult = (r) => r.
|
|
2733
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
2734
|
+
async function validateAsync2(inst, value) {
|
|
2735
|
+
const ctx = { async: true };
|
|
2736
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
2737
|
+
}
|
|
2758
2738
|
function standardProps(inst) {
|
|
2759
2739
|
return {
|
|
2760
2740
|
validate: (value) => {
|
|
2741
|
+
const ctx = { async: false };
|
|
2761
2742
|
try {
|
|
2762
|
-
|
|
2743
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
2744
|
+
if (!(r instanceof Promise))
|
|
2745
|
+
return toStandardResult(r, ctx);
|
|
2763
2746
|
} catch (_) {
|
|
2764
|
-
return safeParseAsync(inst, value).then(toStandardResult);
|
|
2765
2747
|
}
|
|
2748
|
+
return validateAsync2(inst, value);
|
|
2766
2749
|
},
|
|
2767
2750
|
vendor: "zod",
|
|
2768
2751
|
version: 1
|
|
@@ -2770,7 +2753,7 @@ function standardProps(inst) {
|
|
|
2770
2753
|
}
|
|
2771
2754
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
2772
2755
|
$ZodType.init(inst, def);
|
|
2773
|
-
inst._zod.pattern =
|
|
2756
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
2774
2757
|
inst._zod.parse = (payload, _) => {
|
|
2775
2758
|
if (def.coerce)
|
|
2776
2759
|
try {
|
|
@@ -2822,11 +2805,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
|
2822
2805
|
});
|
|
2823
2806
|
var URL_BAD_FORMAT = 1;
|
|
2824
2807
|
var URL_UNPARSEABLE = 2;
|
|
2808
|
+
function canParseURL(input2) {
|
|
2809
|
+
try {
|
|
2810
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function")
|
|
2811
|
+
return URL.canParse(input2);
|
|
2812
|
+
new URL(input2);
|
|
2813
|
+
return true;
|
|
2814
|
+
} catch {
|
|
2815
|
+
return false;
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
function validateURL(trimmed, def) {
|
|
2819
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
|
|
2820
|
+
return canParseURL(trimmed) || URL_UNPARSEABLE;
|
|
2821
|
+
}
|
|
2822
|
+
return parseURLObject(trimmed, def);
|
|
2823
|
+
}
|
|
2825
2824
|
function parseURLObject(trimmed, def) {
|
|
2826
2825
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
2827
2826
|
return URL_BAD_FORMAT;
|
|
2828
2827
|
}
|
|
2829
2828
|
try {
|
|
2829
|
+
if (typeof URL !== "undefined") {
|
|
2830
|
+
const URLStatic = URL;
|
|
2831
|
+
if (typeof URLStatic.parse === "function")
|
|
2832
|
+
return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
|
|
2833
|
+
}
|
|
2830
2834
|
return new URL(trimmed);
|
|
2831
2835
|
} catch {
|
|
2832
2836
|
return URL_UNPARSEABLE;
|
|
@@ -2849,7 +2853,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
2849
2853
|
inst._zod.check = (payload) => {
|
|
2850
2854
|
try {
|
|
2851
2855
|
const trimmed = payload.value.trim();
|
|
2852
|
-
const url2 =
|
|
2856
|
+
const url2 = validateURL(trimmed, def);
|
|
2853
2857
|
if (url2 === URL_BAD_FORMAT) {
|
|
2854
2858
|
payload.issues.push({
|
|
2855
2859
|
code: "invalid_format",
|
|
@@ -2871,6 +2875,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
2871
2875
|
});
|
|
2872
2876
|
return;
|
|
2873
2877
|
}
|
|
2878
|
+
if (url2 === true) {
|
|
2879
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
2880
|
+
return;
|
|
2881
|
+
}
|
|
2874
2882
|
if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
|
|
2875
2883
|
payload.issues.push({
|
|
2876
2884
|
code: "invalid_format",
|
|
@@ -2939,12 +2947,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
2939
2947
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
2940
2948
|
def.pattern ?? (def.pattern = datetime(def));
|
|
2941
2949
|
$ZodStringFormat.init(inst, def);
|
|
2942
|
-
if (def.local || def.precision === -1) {
|
|
2943
|
-
inst._zod.bag.laxFormat = true;
|
|
2944
|
-
inst._zod.onattach.push((s) => {
|
|
2945
|
-
s._zod.bag.laxFormat = true;
|
|
2946
|
-
});
|
|
2947
|
-
}
|
|
2948
2950
|
});
|
|
2949
2951
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
2950
2952
|
def.pattern ?? (def.pattern = date);
|
|
@@ -2961,23 +2963,16 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
2961
2963
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
2962
2964
|
def.pattern ?? (def.pattern = ipv4);
|
|
2963
2965
|
$ZodStringFormat.init(inst, def);
|
|
2964
|
-
inst._zod.bag.format = `ipv4`;
|
|
2965
2966
|
});
|
|
2966
2967
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
2967
2968
|
function isValidIPv6(value) {
|
|
2968
2969
|
if (!ipv6Alphabet.test(value))
|
|
2969
2970
|
return false;
|
|
2970
|
-
|
|
2971
|
-
new URL(`http://[${value}]`);
|
|
2972
|
-
return true;
|
|
2973
|
-
} catch {
|
|
2974
|
-
return false;
|
|
2975
|
-
}
|
|
2971
|
+
return canParseURL(`http://[${value}]`);
|
|
2976
2972
|
}
|
|
2977
2973
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
2978
2974
|
def.pattern ?? (def.pattern = ipv6);
|
|
2979
2975
|
$ZodStringFormat.init(inst, def);
|
|
2980
|
-
inst._zod.bag.format = `ipv6`;
|
|
2981
2976
|
inst._zod.check = (payload) => {
|
|
2982
2977
|
if (!isValidIPv6(payload.value)) {
|
|
2983
2978
|
payload.issues.push({
|
|
@@ -2993,7 +2988,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
2993
2988
|
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
|
|
2994
2989
|
def.pattern ?? (def.pattern = mac(def.delimiter));
|
|
2995
2990
|
$ZodStringFormat.init(inst, def);
|
|
2996
|
-
inst._zod.bag.format = `mac`;
|
|
2997
2991
|
});
|
|
2998
2992
|
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
2999
2993
|
def.pattern ?? (def.pattern = cidrv4);
|
|
@@ -3042,10 +3036,10 @@ function isValidBase64(data) {
|
|
|
3042
3036
|
return false;
|
|
3043
3037
|
}
|
|
3044
3038
|
}
|
|
3039
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
3045
3040
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
3046
|
-
def.pattern ?? (def.pattern =
|
|
3041
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
3047
3042
|
$ZodStringFormat.init(inst, def);
|
|
3048
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
3049
3043
|
inst._zod.check = (payload) => {
|
|
3050
3044
|
if (isValidBase64(payload.value))
|
|
3051
3045
|
return;
|
|
@@ -3058,17 +3052,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
3058
3052
|
});
|
|
3059
3053
|
};
|
|
3060
3054
|
});
|
|
3055
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
3061
3056
|
function isValidBase64URL(data) {
|
|
3062
|
-
if (!
|
|
3057
|
+
if (!base64urlCharset.test(data))
|
|
3063
3058
|
return false;
|
|
3064
3059
|
const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
3065
3060
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
3066
3061
|
return isValidBase64(padded);
|
|
3067
3062
|
}
|
|
3068
3063
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
3069
|
-
def.pattern ?? (def.pattern =
|
|
3064
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
3070
3065
|
$ZodStringFormat.init(inst, def);
|
|
3071
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
3072
3066
|
inst._zod.check = (payload) => {
|
|
3073
3067
|
if (isValidBase64URL(payload.value))
|
|
3074
3068
|
return;
|
|
@@ -3091,7 +3085,7 @@ function isLuhnAlgo(digits) {
|
|
|
3091
3085
|
let bit = 1;
|
|
3092
3086
|
let sum = 0;
|
|
3093
3087
|
while (length) {
|
|
3094
|
-
const value =
|
|
3088
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
3095
3089
|
bit ^= 1;
|
|
3096
3090
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
3097
3091
|
}
|
|
@@ -3117,6 +3111,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
|
|
|
3117
3111
|
});
|
|
3118
3112
|
};
|
|
3119
3113
|
});
|
|
3114
|
+
function isIso7064Mod97(iban3) {
|
|
3115
|
+
let remainder = 0;
|
|
3116
|
+
const len = iban3.length;
|
|
3117
|
+
for (let i = 4; i < len; i++) {
|
|
3118
|
+
const code = iban3.charCodeAt(i);
|
|
3119
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
3120
|
+
}
|
|
3121
|
+
for (let i = 0; i < 4; i++) {
|
|
3122
|
+
const code = iban3.charCodeAt(i);
|
|
3123
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
3124
|
+
}
|
|
3125
|
+
return remainder === 1;
|
|
3126
|
+
}
|
|
3127
|
+
function isValidIBAN(input2) {
|
|
3128
|
+
if (!iban.test(input2))
|
|
3129
|
+
return false;
|
|
3130
|
+
return isIso7064Mod97(input2);
|
|
3131
|
+
}
|
|
3132
|
+
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
3133
|
+
def.pattern ?? (def.pattern = iban);
|
|
3134
|
+
$ZodStringFormat.init(inst, def);
|
|
3135
|
+
inst._zod.check = (payload) => {
|
|
3136
|
+
if (isValidIBAN(payload.value))
|
|
3137
|
+
return;
|
|
3138
|
+
payload.issues.push({
|
|
3139
|
+
code: "invalid_format",
|
|
3140
|
+
format: "iban",
|
|
3141
|
+
input: payload.value,
|
|
3142
|
+
inst,
|
|
3143
|
+
continue: !def.abort
|
|
3144
|
+
});
|
|
3145
|
+
};
|
|
3146
|
+
});
|
|
3120
3147
|
function isValidJWT(token, algorithm = null) {
|
|
3121
3148
|
try {
|
|
3122
3149
|
const tokensParts = token.split(".");
|
|
@@ -3167,7 +3194,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
|
|
|
3167
3194
|
});
|
|
3168
3195
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
3169
3196
|
$ZodType.init(inst, def);
|
|
3170
|
-
inst._zod.pattern =
|
|
3197
|
+
inst._zod.pattern = number;
|
|
3171
3198
|
inst._zod.parse = (payload, _ctx) => {
|
|
3172
3199
|
if (def.coerce)
|
|
3173
3200
|
try {
|
|
@@ -3369,6 +3396,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3369
3396
|
}
|
|
3370
3397
|
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input2.length), ctx) : Array(input2.length);
|
|
3371
3398
|
const proms = [];
|
|
3399
|
+
const abortEarly = ctx?.abortEarly;
|
|
3372
3400
|
for (let i = 0; i < input2.length; i++) {
|
|
3373
3401
|
const item = input2[i];
|
|
3374
3402
|
const result = def.element._zod.run({
|
|
@@ -3379,6 +3407,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3379
3407
|
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
3380
3408
|
} else {
|
|
3381
3409
|
handleArrayResult(result, payload, i);
|
|
3410
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
3411
|
+
break;
|
|
3382
3412
|
}
|
|
3383
3413
|
}
|
|
3384
3414
|
if (proms.length) {
|
|
@@ -3411,7 +3441,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
|
3411
3441
|
return;
|
|
3412
3442
|
}
|
|
3413
3443
|
if (result.value === void 0) {
|
|
3414
|
-
if (isPresent) {
|
|
3444
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
3415
3445
|
final.value[key] = void 0;
|
|
3416
3446
|
}
|
|
3417
3447
|
} else {
|
|
@@ -3440,14 +3470,20 @@ function normalizeDef(def) {
|
|
|
3440
3470
|
optionalKeys: new Set(okeys)
|
|
3441
3471
|
};
|
|
3442
3472
|
}
|
|
3443
|
-
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
3473
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
3444
3474
|
const unrecognized = [];
|
|
3445
3475
|
const keySet = def.keySet;
|
|
3446
3476
|
const _catchall = def.catchall._zod;
|
|
3447
3477
|
const t = _catchall.def.type;
|
|
3448
3478
|
const optin = _catchall.optin;
|
|
3449
3479
|
const optout = _catchall.optout;
|
|
3480
|
+
let seen = 0;
|
|
3450
3481
|
for (const key in input2) {
|
|
3482
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3483
|
+
if (aborted(payload, seen))
|
|
3484
|
+
break;
|
|
3485
|
+
seen = payload.issues.length;
|
|
3486
|
+
}
|
|
3451
3487
|
if (keySet.has(key))
|
|
3452
3488
|
continue;
|
|
3453
3489
|
if (key === "__proto__") {
|
|
@@ -3482,23 +3518,19 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
|
3482
3518
|
return payload;
|
|
3483
3519
|
});
|
|
3484
3520
|
}
|
|
3485
|
-
var propShapes = /* @__PURE__ */ new WeakMap();
|
|
3486
3521
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
3487
3522
|
$ZodType.init(inst, def);
|
|
3488
3523
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
return newSh;
|
|
3500
|
-
}
|
|
3501
|
-
});
|
|
3524
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
3525
|
+
if (sh) {
|
|
3526
|
+
const get = () => {
|
|
3527
|
+
const newSh = { ...sh };
|
|
3528
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
3529
|
+
get.raw = newSh;
|
|
3530
|
+
return newSh;
|
|
3531
|
+
};
|
|
3532
|
+
get.raw = sh;
|
|
3533
|
+
Object.defineProperty(def, "shape", { get });
|
|
3502
3534
|
}
|
|
3503
3535
|
const _normalized = cached(() => normalizeDef(def));
|
|
3504
3536
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -3538,7 +3570,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3538
3570
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
3539
3571
|
const proms = [];
|
|
3540
3572
|
const shape = value.shape;
|
|
3573
|
+
const abortEarly = ctx?.abortEarly;
|
|
3574
|
+
let seen = payload.issues.length;
|
|
3541
3575
|
for (const key of value.allKeys) {
|
|
3576
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3577
|
+
if (aborted(payload, seen))
|
|
3578
|
+
break;
|
|
3579
|
+
seen = payload.issues.length;
|
|
3580
|
+
}
|
|
3542
3581
|
if (key === "__proto__")
|
|
3543
3582
|
continue;
|
|
3544
3583
|
const el = shape[key];
|
|
@@ -3554,7 +3593,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3554
3593
|
if (!catchall) {
|
|
3555
3594
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3556
3595
|
}
|
|
3557
|
-
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3596
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
3558
3597
|
};
|
|
3559
3598
|
});
|
|
3560
3599
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3568,10 +3607,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3568
3607
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
3569
3608
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
3570
3609
|
const prefixStr = (id, k) => `
|
|
3610
|
+
let ${id}_ab = false;
|
|
3571
3611
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
3572
3612
|
const iss = ${id}.issues[i];
|
|
3573
3613
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
3574
3614
|
payload.issues.push(iss);
|
|
3615
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
3616
|
+
}
|
|
3617
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
3618
|
+
payload.value = newResult;
|
|
3619
|
+
return payload;
|
|
3575
3620
|
}`;
|
|
3576
3621
|
doc.write(`const input = payload.value;`);
|
|
3577
3622
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -3617,6 +3662,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3617
3662
|
input: undefined,
|
|
3618
3663
|
path: [${k}]
|
|
3619
3664
|
});
|
|
3665
|
+
if (ctx && ctx.abortEarly) {
|
|
3666
|
+
payload.value = newResult;
|
|
3667
|
+
return payload;
|
|
3668
|
+
}
|
|
3620
3669
|
}
|
|
3621
3670
|
|
|
3622
3671
|
if (${id}_present) {
|
|
@@ -3628,16 +3677,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3628
3677
|
doc.write(`
|
|
3629
3678
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
3630
3679
|
}
|
|
3631
|
-
|
|
3632
|
-
if (
|
|
3633
|
-
|
|
3634
|
-
newResult[${k}] = undefined;
|
|
3635
|
-
}
|
|
3680
|
+
`);
|
|
3681
|
+
if (optin === "defaulted") {
|
|
3682
|
+
doc.write(`newResult[${k}] = ${id}.value;`);
|
|
3636
3683
|
} else {
|
|
3684
|
+
doc.write(`
|
|
3685
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
3637
3686
|
newResult[${k}] = ${id}.value;
|
|
3638
3687
|
}
|
|
3639
|
-
|
|
3640
3688
|
`);
|
|
3689
|
+
}
|
|
3641
3690
|
}
|
|
3642
3691
|
}
|
|
3643
3692
|
doc.write(`payload.value = newResult;`);
|
|
@@ -3669,7 +3718,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3669
3718
|
payload = fastpass(payload, ctx);
|
|
3670
3719
|
if (!catchall)
|
|
3671
3720
|
return payload;
|
|
3672
|
-
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3721
|
+
return handleCatchall([], input2, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
3673
3722
|
}
|
|
3674
3723
|
return superParse(payload, ctx);
|
|
3675
3724
|
};
|
|
@@ -3801,16 +3850,31 @@ function getDiscriminatedOption(union2, value) {
|
|
|
3801
3850
|
const internals = union2._zod;
|
|
3802
3851
|
let map2 = internals.bag.optionsMap;
|
|
3803
3852
|
if (!map2) {
|
|
3804
|
-
map2 =
|
|
3805
|
-
const { options, discriminator } = internals.def;
|
|
3806
|
-
for (const option of options) {
|
|
3807
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
3808
|
-
if (!map2.has(v))
|
|
3809
|
-
map2.set(v, option);
|
|
3810
|
-
}
|
|
3853
|
+
map2 = discriminatorMap(internals.def);
|
|
3811
3854
|
internals.bag.optionsMap = map2;
|
|
3812
3855
|
}
|
|
3813
|
-
|
|
3856
|
+
const option = map2.get(value);
|
|
3857
|
+
if (option === null)
|
|
3858
|
+
throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
3859
|
+
return option;
|
|
3860
|
+
}
|
|
3861
|
+
function discriminatorMap(def) {
|
|
3862
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
3863
|
+
for (const option of def.options) {
|
|
3864
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
3865
|
+
if (!values || values.size === 0)
|
|
3866
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
3867
|
+
for (const value of values) {
|
|
3868
|
+
if (map2.has(value)) {
|
|
3869
|
+
if (value !== void 0)
|
|
3870
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
3871
|
+
map2.set(value, null);
|
|
3872
|
+
} else {
|
|
3873
|
+
map2.set(value, option);
|
|
3874
|
+
}
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
return map2;
|
|
3814
3878
|
}
|
|
3815
3879
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
3816
3880
|
def.inclusive = false;
|
|
@@ -3818,10 +3882,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3818
3882
|
const _super = inst._zod.parse;
|
|
3819
3883
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
3820
3884
|
const propValues = {};
|
|
3885
|
+
let undefinedCount = 0;
|
|
3821
3886
|
for (const option of zod.def.options) {
|
|
3822
3887
|
const pv = option._zod.propValues;
|
|
3823
3888
|
if (!pv || Object.keys(pv).length === 0)
|
|
3824
3889
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
3890
|
+
if (pv[zod.def.discriminator]?.has(void 0))
|
|
3891
|
+
undefinedCount++;
|
|
3825
3892
|
for (const [k, v] of Object.entries(pv)) {
|
|
3826
3893
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
3827
3894
|
assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
@@ -3831,30 +3898,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3831
3898
|
}
|
|
3832
3899
|
}
|
|
3833
3900
|
}
|
|
3901
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
3902
|
+
propValues[zod.def.discriminator]?.delete(void 0);
|
|
3834
3903
|
return propValues;
|
|
3835
3904
|
});
|
|
3836
3905
|
def.options.forEach((option, i) => {
|
|
3837
|
-
const propShape =
|
|
3906
|
+
const propShape = rawShape(option._zod.def);
|
|
3838
3907
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
3839
3908
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
3840
3909
|
}
|
|
3841
3910
|
});
|
|
3842
|
-
const disc = cached(() =>
|
|
3843
|
-
const opts = def.options;
|
|
3844
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
3845
|
-
for (const o of opts) {
|
|
3846
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
3847
|
-
if (!values || values.size === 0)
|
|
3848
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
3849
|
-
for (const v of values) {
|
|
3850
|
-
if (map2.has(v)) {
|
|
3851
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
3852
|
-
}
|
|
3853
|
-
map2.set(v, o);
|
|
3854
|
-
}
|
|
3855
|
-
}
|
|
3856
|
-
return map2;
|
|
3857
|
-
});
|
|
3911
|
+
const disc = cached(() => discriminatorMap(def));
|
|
3858
3912
|
inst._zod.parse = (payload, ctx) => {
|
|
3859
3913
|
const input2 = payload.value;
|
|
3860
3914
|
if (!isObject(input2)) {
|
|
@@ -3866,8 +3920,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3866
3920
|
});
|
|
3867
3921
|
return payload;
|
|
3868
3922
|
}
|
|
3869
|
-
const
|
|
3870
|
-
|
|
3923
|
+
const value = input2?.[def.discriminator];
|
|
3924
|
+
const opt = disc.value.get(value);
|
|
3925
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) {
|
|
3871
3926
|
return opt._zod.run(payload, ctx);
|
|
3872
3927
|
}
|
|
3873
3928
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -3878,7 +3933,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3878
3933
|
errors: [],
|
|
3879
3934
|
note: "No matching discriminator",
|
|
3880
3935
|
discriminator: def.discriminator,
|
|
3881
|
-
options: Array.from(disc.value.keys()),
|
|
3936
|
+
options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
|
|
3882
3937
|
input: input2,
|
|
3883
3938
|
path: [def.discriminator],
|
|
3884
3939
|
inst
|
|
@@ -4044,6 +4099,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4044
4099
|
}
|
|
4045
4100
|
}
|
|
4046
4101
|
const itemResults = new Array(items.length);
|
|
4102
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
4103
|
+
let itemAborted = false;
|
|
4047
4104
|
for (let i = 0; i < items.length; i++) {
|
|
4048
4105
|
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
4049
4106
|
if (r instanceof Promise) {
|
|
@@ -4052,12 +4109,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4052
4109
|
}));
|
|
4053
4110
|
} else {
|
|
4054
4111
|
itemResults[i] = r;
|
|
4112
|
+
if (abortEarly && !itemAborted && r.issues.length)
|
|
4113
|
+
itemAborted = aborted(r);
|
|
4055
4114
|
}
|
|
4056
4115
|
}
|
|
4057
|
-
if (def.rest) {
|
|
4116
|
+
if (def.rest && !itemAborted) {
|
|
4058
4117
|
let i = items.length - 1;
|
|
4059
4118
|
const rest = input2.slice(items.length);
|
|
4119
|
+
let seen = payload.issues.length;
|
|
4060
4120
|
for (const el of rest) {
|
|
4121
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4122
|
+
if (aborted(payload, seen))
|
|
4123
|
+
break;
|
|
4124
|
+
seen = payload.issues.length;
|
|
4125
|
+
}
|
|
4061
4126
|
i++;
|
|
4062
4127
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
4063
4128
|
if (result instanceof Promise) {
|
|
@@ -4285,7 +4350,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4285
4350
|
}
|
|
4286
4351
|
const proms = [];
|
|
4287
4352
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
4353
|
+
const abortEarly = ctx?.abortEarly;
|
|
4354
|
+
let seen = payload.issues.length;
|
|
4288
4355
|
for (const [key, value] of input2) {
|
|
4356
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4357
|
+
if (aborted(payload, seen))
|
|
4358
|
+
break;
|
|
4359
|
+
seen = payload.issues.length;
|
|
4360
|
+
}
|
|
4289
4361
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4290
4362
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
4291
4363
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
@@ -4348,7 +4420,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4348
4420
|
}
|
|
4349
4421
|
const proms = [];
|
|
4350
4422
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
4423
|
+
const abortEarly = ctx?.abortEarly;
|
|
4424
|
+
let seen = payload.issues.length;
|
|
4351
4425
|
for (const item of input2) {
|
|
4426
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4427
|
+
if (aborted(payload, seen))
|
|
4428
|
+
break;
|
|
4429
|
+
seen = payload.issues.length;
|
|
4430
|
+
}
|
|
4352
4431
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
4353
4432
|
if (result instanceof Promise) {
|
|
4354
4433
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -4371,8 +4450,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
4371
4450
|
const values = getEnumValues(def.entries);
|
|
4372
4451
|
const valuesSet = new Set(values);
|
|
4373
4452
|
inst._zod.values = valuesSet;
|
|
4374
|
-
|
|
4375
|
-
|
|
4453
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4454
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
4455
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
4456
|
+
});
|
|
4376
4457
|
inst._zod.parse = (payload, _ctx) => {
|
|
4377
4458
|
const input2 = payload.value;
|
|
4378
4459
|
if (valuesSet.has(input2)) {
|
|
@@ -4391,7 +4472,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4391
4472
|
$ZodType.init(inst, def);
|
|
4392
4473
|
const values = new Set(def.values);
|
|
4393
4474
|
inst._zod.values = values;
|
|
4394
|
-
inst
|
|
4475
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4476
|
+
const vals = zod.def.values;
|
|
4477
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
4478
|
+
});
|
|
4395
4479
|
inst._zod.parse = (payload, _ctx) => {
|
|
4396
4480
|
const input2 = payload.value;
|
|
4397
4481
|
if (values.has(input2)) {
|
|
@@ -4729,20 +4813,62 @@ function handleReadonlyResult(payload) {
|
|
|
4729
4813
|
payload.value = Object.freeze(payload.value);
|
|
4730
4814
|
return payload;
|
|
4731
4815
|
}
|
|
4816
|
+
function leafPattern(schema) {
|
|
4817
|
+
const def = schema._zod.def;
|
|
4818
|
+
let pattern = def.pattern;
|
|
4819
|
+
let isInt = !!def.format?.includes("int");
|
|
4820
|
+
let minimum;
|
|
4821
|
+
let maximum;
|
|
4822
|
+
for (const ch of def.checks ?? []) {
|
|
4823
|
+
const d = ch._zod.def;
|
|
4824
|
+
if (d.pattern)
|
|
4825
|
+
pattern = d.pattern;
|
|
4826
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
4827
|
+
const lo = d.minimum ?? d.length;
|
|
4828
|
+
const hi = d.maximum ?? d.length;
|
|
4829
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum))
|
|
4830
|
+
minimum = lo;
|
|
4831
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum))
|
|
4832
|
+
maximum = hi;
|
|
4833
|
+
}
|
|
4834
|
+
if (pattern)
|
|
4835
|
+
return pattern.source;
|
|
4836
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum)
|
|
4837
|
+
return "(?!)";
|
|
4838
|
+
if (minimum !== void 0 || maximum !== void 0)
|
|
4839
|
+
return string({ minimum, maximum }).source;
|
|
4840
|
+
const own2 = schema._zod.pattern;
|
|
4841
|
+
return (isInt && own2 === number ? integer : own2)?.source;
|
|
4842
|
+
}
|
|
4843
|
+
function partPattern(schema) {
|
|
4844
|
+
const def = schema._zod.def;
|
|
4845
|
+
const own2 = schema._zod.pattern?.source;
|
|
4846
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
4847
|
+
if (inner) {
|
|
4848
|
+
const before = inner._zod.pattern?.source;
|
|
4849
|
+
const after = partPattern(inner);
|
|
4850
|
+
if (own2 && before && after && after !== before) {
|
|
4851
|
+
return own2.replace(cleanRegex(before), () => cleanRegex(after));
|
|
4852
|
+
}
|
|
4853
|
+
return own2;
|
|
4854
|
+
}
|
|
4855
|
+
if (def.options) {
|
|
4856
|
+
const sources = def.options.map(partPattern);
|
|
4857
|
+
if (sources.every(Boolean))
|
|
4858
|
+
return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
4859
|
+
}
|
|
4860
|
+
return leafPattern(schema);
|
|
4861
|
+
}
|
|
4732
4862
|
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
4733
4863
|
$ZodType.init(inst, def);
|
|
4734
4864
|
const regexParts = [];
|
|
4735
4865
|
for (const part of def.parts) {
|
|
4736
4866
|
if (typeof part === "object" && part !== null) {
|
|
4737
|
-
|
|
4867
|
+
const source = partPattern(part);
|
|
4868
|
+
if (!source) {
|
|
4738
4869
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
4739
4870
|
}
|
|
4740
|
-
|
|
4741
|
-
if (!source)
|
|
4742
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
4743
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
4744
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
4745
|
-
regexParts.push(source.slice(start, end));
|
|
4871
|
+
regexParts.push(cleanRegex(source));
|
|
4746
4872
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
4747
4873
|
regexParts.push(escapeRegex(`${part}`));
|
|
4748
4874
|
} else {
|
|
@@ -4918,28 +5044,53 @@ var $ZodCyclicError = class extends Error {
|
|
|
4918
5044
|
};
|
|
4919
5045
|
var STATE = "~memo";
|
|
4920
5046
|
var NO_ISSUES = [];
|
|
5047
|
+
function isRef(value) {
|
|
5048
|
+
return value !== null && typeof value === "object";
|
|
5049
|
+
}
|
|
4921
5050
|
function cloneIssues(issues) {
|
|
4922
5051
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
4923
5052
|
}
|
|
4924
5053
|
var recursive = /* @__PURE__ */ new WeakMap();
|
|
4925
|
-
|
|
5054
|
+
var NONE = 0;
|
|
5055
|
+
var ASSUMED = 1;
|
|
5056
|
+
var PROVEN = 2;
|
|
5057
|
+
function isRecursive(inst, stack, resolve) {
|
|
4926
5058
|
const cached2 = recursive.get(inst);
|
|
4927
5059
|
if (cached2 !== void 0)
|
|
4928
|
-
return cached2;
|
|
5060
|
+
return cached2 ? PROVEN : NONE;
|
|
4929
5061
|
if (stack.has(inst))
|
|
4930
|
-
return
|
|
5062
|
+
return PROVEN;
|
|
4931
5063
|
stack.add(inst);
|
|
4932
|
-
let result =
|
|
5064
|
+
let result = NONE;
|
|
4933
5065
|
const check2 = (child) => {
|
|
4934
|
-
if (
|
|
4935
|
-
|
|
5066
|
+
if (result !== PROVEN && child?._zod) {
|
|
5067
|
+
const answer = isRecursive(child, stack, resolve);
|
|
5068
|
+
if (answer > result)
|
|
5069
|
+
result = answer;
|
|
5070
|
+
}
|
|
5071
|
+
};
|
|
5072
|
+
const shape = (sh, spread) => {
|
|
5073
|
+
let answer = NONE;
|
|
5074
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
5075
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
5076
|
+
if (spread && !desc.enumerable)
|
|
5077
|
+
continue;
|
|
5078
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
5079
|
+
if (child > answer)
|
|
5080
|
+
answer = child;
|
|
5081
|
+
}
|
|
5082
|
+
return answer;
|
|
5083
|
+
};
|
|
5084
|
+
const merge2 = (answer) => {
|
|
5085
|
+
if (answer > result)
|
|
5086
|
+
result = answer;
|
|
4936
5087
|
};
|
|
4937
5088
|
const def = inst._zod.def;
|
|
4938
5089
|
const kind = def.type;
|
|
4939
5090
|
switch (kind) {
|
|
4940
5091
|
case "object": {
|
|
4941
|
-
|
|
4942
|
-
|
|
5092
|
+
const raw = rawShape(def);
|
|
5093
|
+
merge2(raw ? shape(raw, true) : ASSUMED);
|
|
4943
5094
|
check2(def.catchall);
|
|
4944
5095
|
break;
|
|
4945
5096
|
}
|
|
@@ -4986,10 +5137,12 @@ function isRecursive(inst, stack) {
|
|
|
4986
5137
|
check2(def.input);
|
|
4987
5138
|
check2(def.output);
|
|
4988
5139
|
break;
|
|
4989
|
-
//
|
|
4990
|
-
case "lazy":
|
|
4991
|
-
|
|
5140
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
5141
|
+
case "lazy": {
|
|
5142
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
5143
|
+
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
4992
5144
|
break;
|
|
5145
|
+
}
|
|
4993
5146
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
4994
5147
|
case "template_literal":
|
|
4995
5148
|
// leaves
|
|
@@ -5031,16 +5184,20 @@ function isRecursive(inst, stack) {
|
|
|
5031
5184
|
}
|
|
5032
5185
|
}
|
|
5033
5186
|
stack.delete(inst);
|
|
5034
|
-
|
|
5035
|
-
|
|
5187
|
+
return settle(inst, result);
|
|
5188
|
+
}
|
|
5189
|
+
function settle(inst, answer) {
|
|
5190
|
+
if (answer !== ASSUMED)
|
|
5191
|
+
recursive.set(inst, answer === PROVEN);
|
|
5192
|
+
return answer;
|
|
5036
5193
|
}
|
|
5037
5194
|
function isRecursiveSchema(inst) {
|
|
5038
|
-
return isRecursive(inst, /* @__PURE__ */ new Set());
|
|
5195
|
+
return isRecursive(inst, /* @__PURE__ */ new Set(), true) !== NONE;
|
|
5039
5196
|
}
|
|
5040
5197
|
function bucketFor(state, inst) {
|
|
5041
5198
|
let bucket = state.buckets.get(inst);
|
|
5042
5199
|
if (!bucket) {
|
|
5043
|
-
bucket = /* @__PURE__ */ new
|
|
5200
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
5044
5201
|
state.buckets.set(inst, bucket);
|
|
5045
5202
|
}
|
|
5046
5203
|
return bucket;
|
|
@@ -5076,6 +5233,7 @@ var memo = {
|
|
|
5076
5233
|
attach(inst) {
|
|
5077
5234
|
var _a3;
|
|
5078
5235
|
let isRecursiveInst;
|
|
5236
|
+
let rechecked = false;
|
|
5079
5237
|
let lastCtx;
|
|
5080
5238
|
let lastBucket;
|
|
5081
5239
|
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
@@ -5083,20 +5241,24 @@ var memo = {
|
|
|
5083
5241
|
const base = inst._zod.parse;
|
|
5084
5242
|
const wrapped = (payload, ctx) => {
|
|
5085
5243
|
if (isRecursiveInst === void 0) {
|
|
5086
|
-
|
|
5087
|
-
if (
|
|
5244
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
5245
|
+
if (walked === NONE) {
|
|
5088
5246
|
inst._zod.parse = base;
|
|
5089
5247
|
if (inst._zod.run === wrapped)
|
|
5090
5248
|
inst._zod.run = base;
|
|
5091
5249
|
return base(payload, ctx);
|
|
5092
5250
|
}
|
|
5251
|
+
if (walked === PROVEN || rechecked)
|
|
5252
|
+
isRecursiveInst = true;
|
|
5253
|
+
else
|
|
5254
|
+
rechecked = true;
|
|
5093
5255
|
}
|
|
5094
5256
|
const input2 = payload.value;
|
|
5095
|
-
if (input2
|
|
5257
|
+
if (!isRef(input2))
|
|
5096
5258
|
return base(payload, ctx);
|
|
5097
5259
|
let state = ctx[STATE];
|
|
5098
5260
|
if (!state) {
|
|
5099
|
-
state = { buckets: /* @__PURE__ */ new
|
|
5261
|
+
state = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 };
|
|
5100
5262
|
ctx[STATE] = state;
|
|
5101
5263
|
}
|
|
5102
5264
|
let bucket;
|
|
@@ -5115,7 +5277,7 @@ var memo = {
|
|
|
5115
5277
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
5116
5278
|
} else {
|
|
5117
5279
|
payload.memo = true;
|
|
5118
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
5280
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
5119
5281
|
state.backEdges.add(hit.value);
|
|
5120
5282
|
}
|
|
5121
5283
|
return payload;
|
|
@@ -5147,7 +5309,7 @@ function memoizer() {
|
|
|
5147
5309
|
}
|
|
5148
5310
|
function isBackEdge(ctx, value) {
|
|
5149
5311
|
const backEdges = ctx[STATE]?.backEdges;
|
|
5150
|
-
return backEdges !== void 0 && value
|
|
5312
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
5151
5313
|
}
|
|
5152
5314
|
|
|
5153
5315
|
// node_modules/zod/v4/locales/index.js
|
|
@@ -5204,6 +5366,7 @@ __export(locales_exports, {
|
|
|
5204
5366
|
sl: () => sl_default,
|
|
5205
5367
|
sv: () => sv_default,
|
|
5206
5368
|
ta: () => ta_default,
|
|
5369
|
+
tg: () => tg_default,
|
|
5207
5370
|
th: () => th_default,
|
|
5208
5371
|
tk: () => tk_default,
|
|
5209
5372
|
tr: () => tr_default,
|
|
@@ -5260,6 +5423,8 @@ var error = () => {
|
|
|
5260
5423
|
json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
|
|
5261
5424
|
e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
|
|
5262
5425
|
credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
|
|
5426
|
+
currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
|
|
5427
|
+
iban: "IBAN",
|
|
5263
5428
|
jwt: "JWT",
|
|
5264
5429
|
template_literal: "\u0645\u062F\u062E\u0644"
|
|
5265
5430
|
};
|
|
@@ -5371,6 +5536,8 @@ var error2 = () => {
|
|
|
5371
5536
|
json_string: "JSON string",
|
|
5372
5537
|
e164: "E.164 number",
|
|
5373
5538
|
credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
|
|
5539
|
+
currency_code: "valyuta kodu",
|
|
5540
|
+
iban: "IBAN",
|
|
5374
5541
|
jwt: "JWT",
|
|
5375
5542
|
template_literal: "input"
|
|
5376
5543
|
};
|
|
@@ -5531,6 +5698,8 @@ var error3 = () => {
|
|
|
5531
5698
|
json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
|
|
5532
5699
|
e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
|
|
5533
5700
|
credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
5701
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
5702
|
+
iban: "IBAN",
|
|
5534
5703
|
jwt: "JWT",
|
|
5535
5704
|
template_literal: "\u0443\u0432\u043E\u0434"
|
|
5536
5705
|
};
|
|
@@ -5649,6 +5818,8 @@ var error4 = () => {
|
|
|
5649
5818
|
json_string: "JSON \u043D\u0438\u0437",
|
|
5650
5819
|
e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
|
|
5651
5820
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
|
|
5821
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
5822
|
+
iban: "IBAN",
|
|
5652
5823
|
jwt: "JWT",
|
|
5653
5824
|
template_literal: "\u0432\u0445\u043E\u0434"
|
|
5654
5825
|
};
|
|
@@ -5774,6 +5945,8 @@ var error5 = () => {
|
|
|
5774
5945
|
json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
|
|
5775
5946
|
e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
5776
5947
|
credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
5948
|
+
currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
|
|
5949
|
+
iban: "IBAN",
|
|
5777
5950
|
jwt: "JWT",
|
|
5778
5951
|
template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
|
|
5779
5952
|
};
|
|
@@ -5887,6 +6060,8 @@ var error6 = () => {
|
|
|
5887
6060
|
json_string: "cadena JSON",
|
|
5888
6061
|
e164: "n\xFAmero E.164",
|
|
5889
6062
|
credit_card: "n\xFAmero de targeta de cr\xE8dit",
|
|
6063
|
+
currency_code: "codi de moneda",
|
|
6064
|
+
iban: "IBAN",
|
|
5890
6065
|
jwt: "JWT",
|
|
5891
6066
|
template_literal: "entrada"
|
|
5892
6067
|
};
|
|
@@ -6000,6 +6175,8 @@ var error7 = () => {
|
|
|
6000
6175
|
json_string: "\u062F\u06D5\u0642\u06CC JSON",
|
|
6001
6176
|
e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
|
|
6002
6177
|
credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
|
|
6178
|
+
currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
|
|
6179
|
+
iban: "IBAN",
|
|
6003
6180
|
jwt: "JWT",
|
|
6004
6181
|
template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
|
|
6005
6182
|
};
|
|
@@ -6132,6 +6309,8 @@ var error8 = () => {
|
|
|
6132
6309
|
json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
|
|
6133
6310
|
e164: "\u010D\xEDslo E.164",
|
|
6134
6311
|
credit_card: "\u010D\xEDslo kreditn\xED karty",
|
|
6312
|
+
currency_code: "k\xF3d m\u011Bny",
|
|
6313
|
+
iban: "IBAN",
|
|
6135
6314
|
jwt: "JWT",
|
|
6136
6315
|
template_literal: "vstup"
|
|
6137
6316
|
};
|
|
@@ -6248,6 +6427,8 @@ var error9 = () => {
|
|
|
6248
6427
|
json_string: "JSON-streng",
|
|
6249
6428
|
e164: "E.164-nummer",
|
|
6250
6429
|
credit_card: "kreditkortnummer",
|
|
6430
|
+
currency_code: "valutakode",
|
|
6431
|
+
iban: "IBAN",
|
|
6251
6432
|
jwt: "JWT",
|
|
6252
6433
|
template_literal: "input"
|
|
6253
6434
|
};
|
|
@@ -6368,6 +6549,8 @@ var error10 = () => {
|
|
|
6368
6549
|
json_string: "JSON-String",
|
|
6369
6550
|
e164: "E.164-Nummer",
|
|
6370
6551
|
credit_card: "Kreditkartennummer",
|
|
6552
|
+
currency_code: "W\xE4hrungscode",
|
|
6553
|
+
iban: "IBAN",
|
|
6371
6554
|
jwt: "JWT",
|
|
6372
6555
|
template_literal: "Eingabe"
|
|
6373
6556
|
};
|
|
@@ -6481,6 +6664,8 @@ var error11 = () => {
|
|
|
6481
6664
|
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
6482
6665
|
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
6483
6666
|
credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
|
|
6667
|
+
currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
|
|
6668
|
+
iban: "IBAN",
|
|
6484
6669
|
jwt: "JWT",
|
|
6485
6670
|
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
6486
6671
|
};
|
|
@@ -6592,7 +6777,9 @@ var error12 = () => {
|
|
|
6592
6777
|
base64url: "base64url-encoded string",
|
|
6593
6778
|
json_string: "JSON string",
|
|
6594
6779
|
e164: "E.164 number",
|
|
6780
|
+
currency_code: "currency code",
|
|
6595
6781
|
credit_card: "credit card number",
|
|
6782
|
+
iban: "IBAN",
|
|
6596
6783
|
jwt: "JWT",
|
|
6597
6784
|
template_literal: "input"
|
|
6598
6785
|
};
|
|
@@ -6717,6 +6904,8 @@ var error13 = () => {
|
|
|
6717
6904
|
json_string: "JSON-karaktraro",
|
|
6718
6905
|
e164: "E.164-nombro",
|
|
6719
6906
|
credit_card: "kreditkarta numero",
|
|
6907
|
+
currency_code: "valuta kodo",
|
|
6908
|
+
iban: "IBAN",
|
|
6720
6909
|
jwt: "JWT",
|
|
6721
6910
|
template_literal: "enigo"
|
|
6722
6911
|
};
|
|
@@ -6830,6 +7019,8 @@ var error14 = () => {
|
|
|
6830
7019
|
json_string: "cadena JSON",
|
|
6831
7020
|
e164: "n\xFAmero E.164",
|
|
6832
7021
|
credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
|
|
7022
|
+
currency_code: "c\xF3digo de moneda",
|
|
7023
|
+
iban: "IBAN",
|
|
6833
7024
|
jwt: "JWT",
|
|
6834
7025
|
template_literal: "entrada"
|
|
6835
7026
|
};
|
|
@@ -6967,6 +7158,8 @@ var error15 = () => {
|
|
|
6967
7158
|
json_string: "JSON \u0631\u0634\u062A\u0647",
|
|
6968
7159
|
e164: "E.164 \u0639\u062F\u062F",
|
|
6969
7160
|
credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
|
|
7161
|
+
currency_code: "\u06A9\u062F \u0627\u0631\u0632",
|
|
7162
|
+
iban: "IBAN",
|
|
6970
7163
|
jwt: "JWT",
|
|
6971
7164
|
template_literal: "\u0648\u0631\u0648\u062F\u06CC"
|
|
6972
7165
|
};
|
|
@@ -7090,6 +7283,8 @@ var error16 = () => {
|
|
|
7090
7283
|
json_string: "JSON-merkkijono",
|
|
7091
7284
|
e164: "E.164-luku",
|
|
7092
7285
|
credit_card: "luottokortin numero",
|
|
7286
|
+
currency_code: "valuuttakoodi",
|
|
7287
|
+
iban: "IBAN",
|
|
7093
7288
|
jwt: "JWT",
|
|
7094
7289
|
template_literal: "templaattimerkkijono"
|
|
7095
7290
|
};
|
|
@@ -7202,6 +7397,8 @@ var error17 = () => {
|
|
|
7202
7397
|
json_string: "cha\xEEne de caract\xE8res JSON",
|
|
7203
7398
|
e164: "num\xE9ro au format E.164",
|
|
7204
7399
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
7400
|
+
currency_code: "code de devise",
|
|
7401
|
+
iban: "IBAN",
|
|
7205
7402
|
jwt: "JWT",
|
|
7206
7403
|
template_literal: "entr\xE9e"
|
|
7207
7404
|
};
|
|
@@ -7332,6 +7529,8 @@ var error18 = () => {
|
|
|
7332
7529
|
json_string: "cha\xEEne JSON",
|
|
7333
7530
|
e164: "num\xE9ro E.164",
|
|
7334
7531
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
7532
|
+
currency_code: "code de devise",
|
|
7533
|
+
iban: "IBAN",
|
|
7335
7534
|
jwt: "JWT",
|
|
7336
7535
|
template_literal: "entr\xE9e"
|
|
7337
7536
|
};
|
|
@@ -7444,6 +7643,8 @@ var error19 = () => {
|
|
|
7444
7643
|
json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
|
|
7445
7644
|
e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
7446
7645
|
credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
7646
|
+
currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
|
|
7647
|
+
iban: "IBAN",
|
|
7447
7648
|
jwt: "JWT",
|
|
7448
7649
|
template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
|
|
7449
7650
|
};
|
|
@@ -7593,6 +7794,8 @@ var error20 = () => {
|
|
|
7593
7794
|
json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
|
|
7594
7795
|
e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
|
|
7595
7796
|
credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
|
|
7797
|
+
currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
|
|
7798
|
+
iban: { label: "IBAN", gender: "m" },
|
|
7596
7799
|
jwt: { label: "JWT", gender: "m" },
|
|
7597
7800
|
template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
7598
7801
|
ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
@@ -7758,6 +7961,8 @@ var error21 = () => {
|
|
|
7758
7961
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
|
|
7759
7962
|
e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
7760
7963
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
7964
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
7965
|
+
iban: "IBAN",
|
|
7761
7966
|
jwt: "JWT",
|
|
7762
7967
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
7763
7968
|
};
|
|
@@ -7868,6 +8073,8 @@ var error22 = () => {
|
|
|
7868
8073
|
json_string: "JSON tekst",
|
|
7869
8074
|
e164: "E.164 broj",
|
|
7870
8075
|
credit_card: "broj kreditne kartice",
|
|
8076
|
+
currency_code: "kod valute",
|
|
8077
|
+
iban: "IBAN",
|
|
7871
8078
|
jwt: "JWT",
|
|
7872
8079
|
template_literal: "unos"
|
|
7873
8080
|
};
|
|
@@ -7995,6 +8202,8 @@ var error23 = () => {
|
|
|
7995
8202
|
json_string: "JSON string",
|
|
7996
8203
|
e164: "E.164 sz\xE1m",
|
|
7997
8204
|
credit_card: "hitelk\xE1rtyasz\xE1m",
|
|
8205
|
+
currency_code: "p\xE9nznemk\xF3d",
|
|
8206
|
+
iban: "IBAN",
|
|
7998
8207
|
jwt: "JWT",
|
|
7999
8208
|
template_literal: "bemenet"
|
|
8000
8209
|
};
|
|
@@ -8148,6 +8357,8 @@ var error24 = () => {
|
|
|
8148
8357
|
json_string: "JSON \u057F\u0578\u0572",
|
|
8149
8358
|
e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
|
|
8150
8359
|
credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
|
|
8360
|
+
currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
|
|
8361
|
+
iban: "IBAN",
|
|
8151
8362
|
jwt: "JWT",
|
|
8152
8363
|
template_literal: "\u0574\u0578\u0582\u057F\u0584"
|
|
8153
8364
|
};
|
|
@@ -8266,6 +8477,8 @@ var error25 = () => {
|
|
|
8266
8477
|
json_string: "string JSON",
|
|
8267
8478
|
e164: "angka E.164",
|
|
8268
8479
|
credit_card: "nomor kartu kredit",
|
|
8480
|
+
currency_code: "kode mata uang",
|
|
8481
|
+
iban: "IBAN",
|
|
8269
8482
|
jwt: "JWT",
|
|
8270
8483
|
template_literal: "input"
|
|
8271
8484
|
};
|
|
@@ -8377,6 +8590,8 @@ var error26 = () => {
|
|
|
8377
8590
|
json_string: "JSON strengur",
|
|
8378
8591
|
e164: "E.164 t\xF6lugildi",
|
|
8379
8592
|
credit_card: "kreditkortan\xFAmer",
|
|
8593
|
+
currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
|
|
8594
|
+
iban: "IBAN",
|
|
8380
8595
|
jwt: "JWT",
|
|
8381
8596
|
template_literal: "gildi"
|
|
8382
8597
|
};
|
|
@@ -8491,6 +8706,8 @@ var error27 = () => {
|
|
|
8491
8706
|
json_string: "stringa JSON",
|
|
8492
8707
|
e164: "numero E.164",
|
|
8493
8708
|
credit_card: "numero di carta di credito",
|
|
8709
|
+
currency_code: "codice valuta",
|
|
8710
|
+
iban: "IBAN",
|
|
8494
8711
|
jwt: "JWT",
|
|
8495
8712
|
template_literal: "input"
|
|
8496
8713
|
};
|
|
@@ -8604,6 +8821,8 @@ var error28 = () => {
|
|
|
8604
8821
|
json_string: "JSON\u6587\u5B57\u5217",
|
|
8605
8822
|
e164: "E.164\u756A\u53F7",
|
|
8606
8823
|
credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
|
|
8824
|
+
currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
|
|
8825
|
+
iban: "IBAN",
|
|
8607
8826
|
jwt: "JWT",
|
|
8608
8827
|
template_literal: "\u5165\u529B\u5024"
|
|
8609
8828
|
};
|
|
@@ -8716,6 +8935,8 @@ var error29 = () => {
|
|
|
8716
8935
|
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
8717
8936
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
8718
8937
|
credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
8938
|
+
currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
|
|
8939
|
+
iban: "IBAN",
|
|
8719
8940
|
jwt: "JWT",
|
|
8720
8941
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
8721
8942
|
};
|
|
@@ -8836,6 +9057,8 @@ var error30 = () => {
|
|
|
8836
9057
|
json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
|
|
8837
9058
|
e164: "\u179B\u17C1\u1781 E.164",
|
|
8838
9059
|
credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
|
|
9060
|
+
currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
|
|
9061
|
+
iban: "IBAN",
|
|
8839
9062
|
jwt: "JWT",
|
|
8840
9063
|
template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
|
|
8841
9064
|
};
|
|
@@ -8956,6 +9179,8 @@ var error31 = () => {
|
|
|
8956
9179
|
json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
|
|
8957
9180
|
e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
8958
9181
|
credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
9182
|
+
currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
|
|
9183
|
+
iban: "IBAN",
|
|
8959
9184
|
jwt: "JWT",
|
|
8960
9185
|
template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
|
|
8961
9186
|
};
|
|
@@ -9071,6 +9296,8 @@ var error32 = () => {
|
|
|
9071
9296
|
json_string: "JSON \uBB38\uC790\uC5F4",
|
|
9072
9297
|
e164: "E.164 \uBC88\uD638",
|
|
9073
9298
|
credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
|
|
9299
|
+
currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
|
|
9300
|
+
iban: "IBAN",
|
|
9074
9301
|
jwt: "JWT",
|
|
9075
9302
|
template_literal: "\uC785\uB825"
|
|
9076
9303
|
};
|
|
@@ -9269,6 +9496,8 @@ var error33 = () => {
|
|
|
9269
9496
|
json_string: "JSON eilut\u0117",
|
|
9270
9497
|
e164: "E.164 numeris",
|
|
9271
9498
|
credit_card: "kredito kortel\u0117s numeris",
|
|
9499
|
+
currency_code: "valiutos kodas",
|
|
9500
|
+
iban: "IBAN",
|
|
9272
9501
|
jwt: "JWT",
|
|
9273
9502
|
template_literal: "\u012Fvestis"
|
|
9274
9503
|
};
|
|
@@ -9394,6 +9623,8 @@ var error34 = () => {
|
|
|
9394
9623
|
json_string: "JSON \u043D\u0438\u0437\u0430",
|
|
9395
9624
|
e164: "E.164 \u0431\u0440\u043E\u0458",
|
|
9396
9625
|
credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
|
|
9626
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
9627
|
+
iban: "IBAN",
|
|
9397
9628
|
jwt: "JWT",
|
|
9398
9629
|
template_literal: "\u0432\u043D\u0435\u0441"
|
|
9399
9630
|
};
|
|
@@ -9508,6 +9739,8 @@ var error35 = () => {
|
|
|
9508
9739
|
json_string: "string JSON",
|
|
9509
9740
|
e164: "nombor E.164",
|
|
9510
9741
|
credit_card: "nombor kad kredit",
|
|
9742
|
+
currency_code: "kod mata wang",
|
|
9743
|
+
iban: "IBAN",
|
|
9511
9744
|
jwt: "JWT",
|
|
9512
9745
|
template_literal: "input"
|
|
9513
9746
|
};
|
|
@@ -9620,6 +9853,8 @@ var error36 = () => {
|
|
|
9620
9853
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
|
|
9621
9854
|
e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
|
|
9622
9855
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
|
|
9856
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
9857
|
+
iban: "IBAN",
|
|
9623
9858
|
jwt: "JWT",
|
|
9624
9859
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
9625
9860
|
};
|
|
@@ -9731,6 +9966,8 @@ var error37 = () => {
|
|
|
9731
9966
|
json_string: "JSON string",
|
|
9732
9967
|
e164: "E.164-nummer",
|
|
9733
9968
|
credit_card: "creditcardnummer",
|
|
9969
|
+
currency_code: "valutacode",
|
|
9970
|
+
iban: "IBAN",
|
|
9734
9971
|
jwt: "JWT",
|
|
9735
9972
|
template_literal: "invoer"
|
|
9736
9973
|
};
|
|
@@ -9846,6 +10083,8 @@ var error38 = () => {
|
|
|
9846
10083
|
json_string: "JSON-streng",
|
|
9847
10084
|
e164: "E.164-nummer",
|
|
9848
10085
|
credit_card: "kredittkortnummer",
|
|
10086
|
+
currency_code: "valutakode",
|
|
10087
|
+
iban: "IBAN",
|
|
9849
10088
|
jwt: "JWT",
|
|
9850
10089
|
template_literal: "input"
|
|
9851
10090
|
};
|
|
@@ -9959,6 +10198,8 @@ var error39 = () => {
|
|
|
9959
10198
|
json_string: "JSON-streng",
|
|
9960
10199
|
e164: "E.164-nummer",
|
|
9961
10200
|
credit_card: "kredittkortnummer",
|
|
10201
|
+
currency_code: "valutakode",
|
|
10202
|
+
iban: "IBAN",
|
|
9962
10203
|
jwt: "JWT",
|
|
9963
10204
|
template_literal: "input"
|
|
9964
10205
|
};
|
|
@@ -10072,6 +10313,8 @@ var error40 = () => {
|
|
|
10072
10313
|
json_string: "JSON metin",
|
|
10073
10314
|
e164: "E.164 say\u0131s\u0131",
|
|
10074
10315
|
credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
|
|
10316
|
+
currency_code: "para birimi kodu",
|
|
10317
|
+
iban: "IBAN",
|
|
10075
10318
|
jwt: "JWT",
|
|
10076
10319
|
template_literal: "giren"
|
|
10077
10320
|
};
|
|
@@ -10186,6 +10429,8 @@ var error41 = () => {
|
|
|
10186
10429
|
json_string: "JSON \u0645\u062A\u0646",
|
|
10187
10430
|
e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
|
|
10188
10431
|
credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
|
|
10432
|
+
currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
|
|
10433
|
+
iban: "IBAN",
|
|
10189
10434
|
jwt: "JWT",
|
|
10190
10435
|
template_literal: "\u0648\u0631\u0648\u062F\u064A"
|
|
10191
10436
|
};
|
|
@@ -10305,6 +10550,8 @@ var error42 = () => {
|
|
|
10305
10550
|
json_string: "ci\u0105g znak\xF3w w formacie JSON",
|
|
10306
10551
|
e164: "liczba E.164",
|
|
10307
10552
|
credit_card: "numer karty kredytowej",
|
|
10553
|
+
currency_code: "kod waluty",
|
|
10554
|
+
iban: "IBAN",
|
|
10308
10555
|
jwt: "JWT",
|
|
10309
10556
|
template_literal: "wej\u015Bcie"
|
|
10310
10557
|
};
|
|
@@ -10419,6 +10666,8 @@ var error43 = () => {
|
|
|
10419
10666
|
json_string: "o texto JSON",
|
|
10420
10667
|
e164: "o n\xFAmero E.164",
|
|
10421
10668
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
10669
|
+
currency_code: "o c\xF3digo de moeda",
|
|
10670
|
+
iban: "o IBAN",
|
|
10422
10671
|
jwt: "o JWT",
|
|
10423
10672
|
template_literal: "a entrada"
|
|
10424
10673
|
};
|
|
@@ -10496,8 +10745,8 @@ var error43 = () => {
|
|
|
10496
10745
|
case "not_multiple_of":
|
|
10497
10746
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
10498
10747
|
case "unrecognized_keys": {
|
|
10499
|
-
const
|
|
10500
|
-
return `Chave${
|
|
10748
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
10749
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
10501
10750
|
}
|
|
10502
10751
|
case "invalid_key":
|
|
10503
10752
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -10562,6 +10811,8 @@ var error44 = () => {
|
|
|
10562
10811
|
json_string: "o texto JSON",
|
|
10563
10812
|
e164: "o n\xFAmero E.164",
|
|
10564
10813
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
10814
|
+
currency_code: "o c\xF3digo de moeda",
|
|
10815
|
+
iban: "o IBAN",
|
|
10565
10816
|
jwt: "o JWT",
|
|
10566
10817
|
template_literal: "a entrada"
|
|
10567
10818
|
};
|
|
@@ -10640,8 +10891,8 @@ var error44 = () => {
|
|
|
10640
10891
|
case "not_multiple_of":
|
|
10641
10892
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
10642
10893
|
case "unrecognized_keys": {
|
|
10643
|
-
const
|
|
10644
|
-
return `Chave${
|
|
10894
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
10895
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
10645
10896
|
}
|
|
10646
10897
|
case "invalid_key":
|
|
10647
10898
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -10706,6 +10957,8 @@ var error45 = () => {
|
|
|
10706
10957
|
json_string: "\u0219ir JSON",
|
|
10707
10958
|
e164: "num\u0103r E.164",
|
|
10708
10959
|
credit_card: "num\u0103r de card de credit",
|
|
10960
|
+
currency_code: "cod valutar",
|
|
10961
|
+
iban: "IBAN",
|
|
10709
10962
|
jwt: "JWT",
|
|
10710
10963
|
template_literal: "intrare"
|
|
10711
10964
|
};
|
|
@@ -10878,6 +11131,8 @@ var error46 = () => {
|
|
|
10878
11131
|
json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
|
|
10879
11132
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
10880
11133
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
11134
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
11135
|
+
iban: "IBAN",
|
|
10881
11136
|
jwt: "JWT",
|
|
10882
11137
|
template_literal: "\u0432\u0432\u043E\u0434"
|
|
10883
11138
|
};
|
|
@@ -10996,6 +11251,8 @@ var error47 = () => {
|
|
|
10996
11251
|
json_string: "re\u0165azec vo form\xE1te JSON",
|
|
10997
11252
|
e164: "\u010D\xEDslo E.164",
|
|
10998
11253
|
credit_card: "\u010D\xEDslo kreditnej karty",
|
|
11254
|
+
currency_code: "k\xF3d meny",
|
|
11255
|
+
iban: "IBAN",
|
|
10999
11256
|
jwt: "JWT",
|
|
11000
11257
|
template_literal: "vstup"
|
|
11001
11258
|
};
|
|
@@ -11112,6 +11369,8 @@ var error48 = () => {
|
|
|
11112
11369
|
json_string: "JSON niz",
|
|
11113
11370
|
e164: "E.164 \u0161tevilka",
|
|
11114
11371
|
credit_card: "\u0161tevilka kreditne kartice",
|
|
11372
|
+
currency_code: "koda valute",
|
|
11373
|
+
iban: "IBAN",
|
|
11115
11374
|
jwt: "JWT",
|
|
11116
11375
|
template_literal: "vnos"
|
|
11117
11376
|
};
|
|
@@ -11226,6 +11485,8 @@ var error49 = () => {
|
|
|
11226
11485
|
json_string: "JSON-str\xE4ng",
|
|
11227
11486
|
e164: "E.164-nummer",
|
|
11228
11487
|
credit_card: "kreditkortsnummer",
|
|
11488
|
+
currency_code: "valutakod",
|
|
11489
|
+
iban: "IBAN",
|
|
11229
11490
|
jwt: "JWT",
|
|
11230
11491
|
template_literal: "mall-literal"
|
|
11231
11492
|
};
|
|
@@ -11341,6 +11602,8 @@ var error50 = () => {
|
|
|
11341
11602
|
json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
|
|
11342
11603
|
e164: "E.164 \u0B8E\u0BA3\u0BCD",
|
|
11343
11604
|
credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
|
|
11605
|
+
currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
|
|
11606
|
+
iban: "IBAN",
|
|
11344
11607
|
jwt: "JWT",
|
|
11345
11608
|
template_literal: "input"
|
|
11346
11609
|
};
|
|
@@ -11414,24 +11677,24 @@ function ta_default() {
|
|
|
11414
11677
|
};
|
|
11415
11678
|
}
|
|
11416
11679
|
|
|
11417
|
-
// node_modules/zod/v4/locales/
|
|
11680
|
+
// node_modules/zod/v4/locales/tg.js
|
|
11418
11681
|
init_define_import_meta_env();
|
|
11419
11682
|
var error51 = () => {
|
|
11420
11683
|
const Sizable = {
|
|
11421
|
-
string: { unit: "\
|
|
11422
|
-
file: { unit: "\
|
|
11423
|
-
array: { unit: "\
|
|
11424
|
-
set: { unit: "\
|
|
11425
|
-
map: { unit: "\
|
|
11684
|
+
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11685
|
+
file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11686
|
+
array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11687
|
+
set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11688
|
+
map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
|
|
11426
11689
|
};
|
|
11427
11690
|
function getSizing(origin) {
|
|
11428
11691
|
return Sizable[origin] ?? null;
|
|
11429
11692
|
}
|
|
11430
11693
|
const FormatDictionary = {
|
|
11431
|
-
regex: "\
|
|
11432
|
-
email: "\
|
|
11694
|
+
regex: "\u0432\u0443\u0440\u0443\u0434",
|
|
11695
|
+
email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
|
|
11433
11696
|
url: "URL",
|
|
11434
|
-
emoji: "\
|
|
11697
|
+
emoji: "\u044D\u043C\u043E\u04B7\u0438",
|
|
11435
11698
|
uuid: "UUID",
|
|
11436
11699
|
uuidv4: "UUIDv4",
|
|
11437
11700
|
uuidv6: "UUIDv6",
|
|
@@ -11442,28 +11705,32 @@ var error51 = () => {
|
|
|
11442
11705
|
ulid: "ULID",
|
|
11443
11706
|
xid: "XID",
|
|
11444
11707
|
ksuid: "KSUID",
|
|
11445
|
-
datetime: "\
|
|
11446
|
-
date: "\
|
|
11447
|
-
time: "\
|
|
11448
|
-
duration: "\
|
|
11449
|
-
ipv4: "\
|
|
11450
|
-
ipv6: "\
|
|
11451
|
-
mac: "\
|
|
11452
|
-
cidrv4: "\
|
|
11453
|
-
cidrv6: "\
|
|
11454
|
-
base64: "\
|
|
11455
|
-
base64url: "\
|
|
11456
|
-
json_string: "\
|
|
11457
|
-
e164: "\
|
|
11458
|
-
credit_card: "\
|
|
11459
|
-
|
|
11460
|
-
|
|
11708
|
+
datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
|
|
11709
|
+
date: "\u0441\u0430\u043D\u0430\u0438 ISO",
|
|
11710
|
+
time: "\u0432\u0430\u049B\u0442\u0438 ISO",
|
|
11711
|
+
duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
|
|
11712
|
+
ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
|
|
11713
|
+
ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
|
|
11714
|
+
mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
|
|
11715
|
+
cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
|
|
11716
|
+
cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
|
|
11717
|
+
base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
|
|
11718
|
+
base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
|
|
11719
|
+
json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
|
|
11720
|
+
e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
|
|
11721
|
+
credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
|
|
11722
|
+
currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
|
|
11723
|
+
iban: "IBAN",
|
|
11724
|
+
jwt: "JWT",
|
|
11725
|
+
template_literal: "\u0432\u0443\u0440\u0443\u0434"
|
|
11461
11726
|
};
|
|
11462
11727
|
const TypeDictionary = {
|
|
11463
11728
|
nan: "NaN",
|
|
11464
|
-
number: "\
|
|
11465
|
-
|
|
11466
|
-
|
|
11729
|
+
number: "\u0440\u0430\u049B\u0430\u043C",
|
|
11730
|
+
string: "\u0441\u0430\u0442\u0440",
|
|
11731
|
+
array: "\u043C\u0430\u0441\u0441\u0438\u0432",
|
|
11732
|
+
object: "\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
11733
|
+
date: "\u0441\u0430\u043D\u0430"
|
|
11467
11734
|
};
|
|
11468
11735
|
return (issue2) => {
|
|
11469
11736
|
switch (issue2.code) {
|
|
@@ -11471,20 +11738,136 @@ var error51 = () => {
|
|
|
11471
11738
|
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
11472
11739
|
const receivedType = parsedType(issue2.input);
|
|
11473
11740
|
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
11474
|
-
|
|
11475
|
-
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue2.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
11476
|
-
}
|
|
11477
|
-
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
11741
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${expected} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${received} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`;
|
|
11478
11742
|
}
|
|
11479
11743
|
case "invalid_value":
|
|
11480
11744
|
if (issue2.values.length === 1)
|
|
11481
|
-
return `\
|
|
11482
|
-
return `\
|
|
11745
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${stringifyPrimitive(issue2.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
11746
|
+
return `\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${joinValues(issue2.values, "|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
11483
11747
|
case "too_big": {
|
|
11484
|
-
const adj = issue2.inclusive ? "
|
|
11748
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
11485
11749
|
const sizing = getSizing(issue2.origin);
|
|
11486
11750
|
if (sizing)
|
|
11487
|
-
return `\
|
|
11751
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
11752
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
11753
|
+
}
|
|
11754
|
+
case "too_small": {
|
|
11755
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
11756
|
+
const sizing = getSizing(issue2.origin);
|
|
11757
|
+
if (sizing)
|
|
11758
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
11759
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
11760
|
+
}
|
|
11761
|
+
case "invalid_format": {
|
|
11762
|
+
const _issue = issue2;
|
|
11763
|
+
if (_issue.format === "starts_with")
|
|
11764
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`;
|
|
11765
|
+
if (_issue.format === "ends_with")
|
|
11766
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`;
|
|
11767
|
+
if (_issue.format === "includes")
|
|
11768
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${_issue.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`;
|
|
11769
|
+
if (_issue.format === "regex")
|
|
11770
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${_issue.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`;
|
|
11771
|
+
return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
11772
|
+
}
|
|
11773
|
+
case "not_multiple_of":
|
|
11774
|
+
return `\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${issue2.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;
|
|
11775
|
+
case "unrecognized_keys":
|
|
11776
|
+
return `\u041A\u0430\u043B\u0438\u0434${issue2.keys.length > 1 ? "\u04B3\u043E\u0438" : "\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${joinValues(issue2.keys, ", ")}`;
|
|
11777
|
+
case "invalid_key":
|
|
11778
|
+
return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
11779
|
+
case "invalid_union":
|
|
11780
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
11781
|
+
const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
|
|
11782
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${opts} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
11783
|
+
}
|
|
11784
|
+
return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
|
|
11785
|
+
case "invalid_element":
|
|
11786
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
11787
|
+
default:
|
|
11788
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
11789
|
+
}
|
|
11790
|
+
};
|
|
11791
|
+
};
|
|
11792
|
+
function tg_default() {
|
|
11793
|
+
return {
|
|
11794
|
+
localeError: error51()
|
|
11795
|
+
};
|
|
11796
|
+
}
|
|
11797
|
+
|
|
11798
|
+
// node_modules/zod/v4/locales/th.js
|
|
11799
|
+
init_define_import_meta_env();
|
|
11800
|
+
var error52 = () => {
|
|
11801
|
+
const Sizable = {
|
|
11802
|
+
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11803
|
+
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11804
|
+
array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11805
|
+
set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11806
|
+
map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
|
|
11807
|
+
};
|
|
11808
|
+
function getSizing(origin) {
|
|
11809
|
+
return Sizable[origin] ?? null;
|
|
11810
|
+
}
|
|
11811
|
+
const FormatDictionary = {
|
|
11812
|
+
regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
|
|
11813
|
+
email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
|
|
11814
|
+
url: "URL",
|
|
11815
|
+
emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
|
|
11816
|
+
uuid: "UUID",
|
|
11817
|
+
uuidv4: "UUIDv4",
|
|
11818
|
+
uuidv6: "UUIDv6",
|
|
11819
|
+
nanoid: "nanoid",
|
|
11820
|
+
guid: "GUID",
|
|
11821
|
+
cuid: "cuid",
|
|
11822
|
+
cuid2: "cuid2",
|
|
11823
|
+
ulid: "ULID",
|
|
11824
|
+
xid: "XID",
|
|
11825
|
+
ksuid: "KSUID",
|
|
11826
|
+
datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
11827
|
+
date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
|
|
11828
|
+
time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
11829
|
+
duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
11830
|
+
ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
|
|
11831
|
+
ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
|
|
11832
|
+
mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
|
|
11833
|
+
cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
|
|
11834
|
+
cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
|
|
11835
|
+
base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
|
|
11836
|
+
base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
|
|
11837
|
+
json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
|
|
11838
|
+
e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
|
|
11839
|
+
credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
|
|
11840
|
+
currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
|
|
11841
|
+
iban: "IBAN",
|
|
11842
|
+
jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
|
|
11843
|
+
template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
|
|
11844
|
+
};
|
|
11845
|
+
const TypeDictionary = {
|
|
11846
|
+
nan: "NaN",
|
|
11847
|
+
number: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
|
|
11848
|
+
array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",
|
|
11849
|
+
null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"
|
|
11850
|
+
};
|
|
11851
|
+
return (issue2) => {
|
|
11852
|
+
switch (issue2.code) {
|
|
11853
|
+
case "invalid_type": {
|
|
11854
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
11855
|
+
const receivedType = parsedType(issue2.input);
|
|
11856
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
11857
|
+
if (/^[A-Z]/.test(issue2.expected)) {
|
|
11858
|
+
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${issue2.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
11859
|
+
}
|
|
11860
|
+
return `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${received}`;
|
|
11861
|
+
}
|
|
11862
|
+
case "invalid_value":
|
|
11863
|
+
if (issue2.values.length === 1)
|
|
11864
|
+
return `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${stringifyPrimitive(issue2.values[0])}`;
|
|
11865
|
+
return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${joinValues(issue2.values, "|")}`;
|
|
11866
|
+
case "too_big": {
|
|
11867
|
+
const adj = issue2.inclusive ? "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19" : "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32";
|
|
11868
|
+
const sizing = getSizing(issue2.origin);
|
|
11869
|
+
if (sizing)
|
|
11870
|
+
return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;
|
|
11488
11871
|
return `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${issue2.origin ?? "\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${adj} ${issue2.maximum.toString()}`;
|
|
11489
11872
|
}
|
|
11490
11873
|
case "too_small": {
|
|
@@ -11525,13 +11908,13 @@ var error51 = () => {
|
|
|
11525
11908
|
};
|
|
11526
11909
|
function th_default() {
|
|
11527
11910
|
return {
|
|
11528
|
-
localeError:
|
|
11911
|
+
localeError: error52()
|
|
11529
11912
|
};
|
|
11530
11913
|
}
|
|
11531
11914
|
|
|
11532
11915
|
// node_modules/zod/v4/locales/tk.js
|
|
11533
11916
|
init_define_import_meta_env();
|
|
11534
|
-
var
|
|
11917
|
+
var error53 = () => {
|
|
11535
11918
|
const Sizable = {
|
|
11536
11919
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
11537
11920
|
file: { unit: "ba\xFDt", verb: "bolmaly" },
|
|
@@ -11571,6 +11954,8 @@ var error52 = () => {
|
|
|
11571
11954
|
json_string: "JSON setiri",
|
|
11572
11955
|
e164: "E.164 nomeri",
|
|
11573
11956
|
credit_card: "kredit kartyny\u0148 nomeri",
|
|
11957
|
+
currency_code: "wal\xFDuta kody",
|
|
11958
|
+
iban: "IBAN",
|
|
11574
11959
|
jwt: "JWT",
|
|
11575
11960
|
template_literal: "\u015Fablon"
|
|
11576
11961
|
};
|
|
@@ -11632,13 +12017,13 @@ var error52 = () => {
|
|
|
11632
12017
|
};
|
|
11633
12018
|
function tk_default() {
|
|
11634
12019
|
return {
|
|
11635
|
-
localeError:
|
|
12020
|
+
localeError: error53()
|
|
11636
12021
|
};
|
|
11637
12022
|
}
|
|
11638
12023
|
|
|
11639
12024
|
// node_modules/zod/v4/locales/tr.js
|
|
11640
12025
|
init_define_import_meta_env();
|
|
11641
|
-
var
|
|
12026
|
+
var error54 = () => {
|
|
11642
12027
|
const Sizable = {
|
|
11643
12028
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
11644
12029
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -11678,6 +12063,8 @@ var error53 = () => {
|
|
|
11678
12063
|
json_string: "JSON dizesi",
|
|
11679
12064
|
e164: "E.164 say\u0131s\u0131",
|
|
11680
12065
|
credit_card: "kredi kart\u0131 numaras\u0131",
|
|
12066
|
+
currency_code: "para birimi kodu",
|
|
12067
|
+
iban: "IBAN",
|
|
11681
12068
|
jwt: "JWT",
|
|
11682
12069
|
template_literal: "\u015Eablon dizesi"
|
|
11683
12070
|
};
|
|
@@ -11742,7 +12129,7 @@ var error53 = () => {
|
|
|
11742
12129
|
};
|
|
11743
12130
|
function tr_default() {
|
|
11744
12131
|
return {
|
|
11745
|
-
localeError:
|
|
12132
|
+
localeError: error54()
|
|
11746
12133
|
};
|
|
11747
12134
|
}
|
|
11748
12135
|
|
|
@@ -11751,7 +12138,7 @@ init_define_import_meta_env();
|
|
|
11751
12138
|
|
|
11752
12139
|
// node_modules/zod/v4/locales/uk.js
|
|
11753
12140
|
init_define_import_meta_env();
|
|
11754
|
-
var
|
|
12141
|
+
var error55 = () => {
|
|
11755
12142
|
const Sizable = {
|
|
11756
12143
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
11757
12144
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -11791,6 +12178,8 @@ var error54 = () => {
|
|
|
11791
12178
|
json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
|
|
11792
12179
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
11793
12180
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
|
|
12181
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
|
|
12182
|
+
iban: "IBAN",
|
|
11794
12183
|
jwt: "JWT",
|
|
11795
12184
|
template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
|
|
11796
12185
|
};
|
|
@@ -11858,7 +12247,7 @@ var error54 = () => {
|
|
|
11858
12247
|
};
|
|
11859
12248
|
function uk_default() {
|
|
11860
12249
|
return {
|
|
11861
|
-
localeError:
|
|
12250
|
+
localeError: error55()
|
|
11862
12251
|
};
|
|
11863
12252
|
}
|
|
11864
12253
|
|
|
@@ -11869,7 +12258,7 @@ function ua_default() {
|
|
|
11869
12258
|
|
|
11870
12259
|
// node_modules/zod/v4/locales/ur.js
|
|
11871
12260
|
init_define_import_meta_env();
|
|
11872
|
-
var
|
|
12261
|
+
var error56 = () => {
|
|
11873
12262
|
const Sizable = {
|
|
11874
12263
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
11875
12264
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -11909,6 +12298,8 @@ var error55 = () => {
|
|
|
11909
12298
|
json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
|
|
11910
12299
|
e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
|
|
11911
12300
|
credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
|
|
12301
|
+
currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
|
|
12302
|
+
iban: "IBAN",
|
|
11912
12303
|
jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
|
|
11913
12304
|
template_literal: "\u0627\u0646 \u067E\u0679"
|
|
11914
12305
|
};
|
|
@@ -11978,13 +12369,13 @@ var error55 = () => {
|
|
|
11978
12369
|
};
|
|
11979
12370
|
function ur_default() {
|
|
11980
12371
|
return {
|
|
11981
|
-
localeError:
|
|
12372
|
+
localeError: error56()
|
|
11982
12373
|
};
|
|
11983
12374
|
}
|
|
11984
12375
|
|
|
11985
12376
|
// node_modules/zod/v4/locales/uz.js
|
|
11986
12377
|
init_define_import_meta_env();
|
|
11987
|
-
var
|
|
12378
|
+
var error57 = () => {
|
|
11988
12379
|
const Sizable = {
|
|
11989
12380
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
11990
12381
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -12024,6 +12415,8 @@ var error56 = () => {
|
|
|
12024
12415
|
json_string: "JSON satr",
|
|
12025
12416
|
e164: "E.164 raqam",
|
|
12026
12417
|
credit_card: "kredit karta raqami",
|
|
12418
|
+
currency_code: "valyuta kodi",
|
|
12419
|
+
iban: "IBAN",
|
|
12027
12420
|
jwt: "JWT",
|
|
12028
12421
|
template_literal: "kirish"
|
|
12029
12422
|
};
|
|
@@ -12091,13 +12484,13 @@ var error56 = () => {
|
|
|
12091
12484
|
};
|
|
12092
12485
|
function uz_default() {
|
|
12093
12486
|
return {
|
|
12094
|
-
localeError:
|
|
12487
|
+
localeError: error57()
|
|
12095
12488
|
};
|
|
12096
12489
|
}
|
|
12097
12490
|
|
|
12098
12491
|
// node_modules/zod/v4/locales/vi.js
|
|
12099
12492
|
init_define_import_meta_env();
|
|
12100
|
-
var
|
|
12493
|
+
var error58 = () => {
|
|
12101
12494
|
const Sizable = {
|
|
12102
12495
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
12103
12496
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -12137,6 +12530,8 @@ var error57 = () => {
|
|
|
12137
12530
|
json_string: "chu\u1ED7i JSON",
|
|
12138
12531
|
e164: "s\u1ED1 E.164",
|
|
12139
12532
|
credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
|
|
12533
|
+
currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
|
|
12534
|
+
iban: "IBAN",
|
|
12140
12535
|
jwt: "JWT",
|
|
12141
12536
|
template_literal: "\u0111\u1EA7u v\xE0o"
|
|
12142
12537
|
};
|
|
@@ -12204,13 +12599,13 @@ var error57 = () => {
|
|
|
12204
12599
|
};
|
|
12205
12600
|
function vi_default() {
|
|
12206
12601
|
return {
|
|
12207
|
-
localeError:
|
|
12602
|
+
localeError: error58()
|
|
12208
12603
|
};
|
|
12209
12604
|
}
|
|
12210
12605
|
|
|
12211
12606
|
// node_modules/zod/v4/locales/zh-CN.js
|
|
12212
12607
|
init_define_import_meta_env();
|
|
12213
|
-
var
|
|
12608
|
+
var error59 = () => {
|
|
12214
12609
|
const Sizable = {
|
|
12215
12610
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
12216
12611
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -12250,6 +12645,8 @@ var error58 = () => {
|
|
|
12250
12645
|
json_string: "JSON\u5B57\u7B26\u4E32",
|
|
12251
12646
|
e164: "E.164\u53F7\u7801",
|
|
12252
12647
|
credit_card: "\u4FE1\u7528\u5361\u53F7",
|
|
12648
|
+
currency_code: "\u8D27\u5E01\u4EE3\u7801",
|
|
12649
|
+
iban: "IBAN",
|
|
12253
12650
|
jwt: "JWT",
|
|
12254
12651
|
template_literal: "\u8F93\u5165"
|
|
12255
12652
|
};
|
|
@@ -12318,13 +12715,13 @@ var error58 = () => {
|
|
|
12318
12715
|
};
|
|
12319
12716
|
function zh_CN_default() {
|
|
12320
12717
|
return {
|
|
12321
|
-
localeError:
|
|
12718
|
+
localeError: error59()
|
|
12322
12719
|
};
|
|
12323
12720
|
}
|
|
12324
12721
|
|
|
12325
12722
|
// node_modules/zod/v4/locales/zh-TW.js
|
|
12326
12723
|
init_define_import_meta_env();
|
|
12327
|
-
var
|
|
12724
|
+
var error60 = () => {
|
|
12328
12725
|
const Sizable = {
|
|
12329
12726
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
12330
12727
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -12364,6 +12761,8 @@ var error59 = () => {
|
|
|
12364
12761
|
json_string: "JSON \u5B57\u4E32",
|
|
12365
12762
|
e164: "E.164 \u6578\u503C",
|
|
12366
12763
|
credit_card: "\u4FE1\u7528\u5361\u865F",
|
|
12764
|
+
currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
|
|
12765
|
+
iban: "IBAN",
|
|
12367
12766
|
jwt: "JWT",
|
|
12368
12767
|
template_literal: "\u8F38\u5165"
|
|
12369
12768
|
};
|
|
@@ -12430,13 +12829,13 @@ var error59 = () => {
|
|
|
12430
12829
|
};
|
|
12431
12830
|
function zh_TW_default() {
|
|
12432
12831
|
return {
|
|
12433
|
-
localeError:
|
|
12832
|
+
localeError: error60()
|
|
12434
12833
|
};
|
|
12435
12834
|
}
|
|
12436
12835
|
|
|
12437
12836
|
// node_modules/zod/v4/locales/yo.js
|
|
12438
12837
|
init_define_import_meta_env();
|
|
12439
|
-
var
|
|
12838
|
+
var error61 = () => {
|
|
12440
12839
|
const Sizable = {
|
|
12441
12840
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
12442
12841
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -12476,6 +12875,8 @@ var error60 = () => {
|
|
|
12476
12875
|
json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
|
|
12477
12876
|
e164: "n\u1ECD\u0301mb\xE0 E.164",
|
|
12478
12877
|
credit_card: "n\u1ECDmba kaadi gbese",
|
|
12878
|
+
currency_code: "koodu ow\xF3",
|
|
12879
|
+
iban: "IBAN",
|
|
12479
12880
|
jwt: "JWT",
|
|
12480
12881
|
template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
|
|
12481
12882
|
};
|
|
@@ -12542,7 +12943,7 @@ var error60 = () => {
|
|
|
12542
12943
|
};
|
|
12543
12944
|
function yo_default() {
|
|
12544
12945
|
return {
|
|
12545
|
-
localeError:
|
|
12946
|
+
localeError: error61()
|
|
12546
12947
|
};
|
|
12547
12948
|
}
|
|
12548
12949
|
|
|
@@ -12624,31 +13025,8 @@ function compileValidator(schema, parser) {
|
|
|
12624
13025
|
function compile(schema, options) {
|
|
12625
13026
|
try {
|
|
12626
13027
|
const parser = compileFn(schema);
|
|
12627
|
-
const clone2 =
|
|
12628
|
-
const liveRun = schema._zod.run;
|
|
12629
|
-
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
12630
|
-
const wrapped = (payload, ctx) => {
|
|
12631
|
-
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
12632
|
-
return originalRun(payload, ctx);
|
|
12633
|
-
}
|
|
12634
|
-
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
12635
|
-
return originalRun(payload, ctx);
|
|
12636
|
-
}
|
|
12637
|
-
const out = parser(payload.value);
|
|
12638
|
-
if (out !== INVALID) {
|
|
12639
|
-
payload.value = out;
|
|
12640
|
-
return payload;
|
|
12641
|
-
}
|
|
12642
|
-
if (ctx)
|
|
12643
|
-
ctx[FALLBACK_FLAG] = true;
|
|
12644
|
-
return originalRun(payload, ctx);
|
|
12645
|
-
};
|
|
12646
|
-
wrapped.__originalRun = originalRun;
|
|
12647
|
-
clone2._zod.bag.fallbackRun = originalRun;
|
|
13028
|
+
const clone2 = withParser(schema, parser);
|
|
12648
13029
|
clone2._zod.bag.validator = compileValidator(schema, parser);
|
|
12649
|
-
clone2._zod.run = wrapped;
|
|
12650
|
-
if (!liveRun.__originalRun)
|
|
12651
|
-
installCompiledUserMethods(clone2, schema, parser);
|
|
12652
13030
|
return clone2;
|
|
12653
13031
|
} catch (err) {
|
|
12654
13032
|
if (options?.strict)
|
|
@@ -12656,6 +13034,37 @@ function compile(schema, options) {
|
|
|
12656
13034
|
return schema;
|
|
12657
13035
|
}
|
|
12658
13036
|
}
|
|
13037
|
+
function withParser(schema, parser) {
|
|
13038
|
+
if (isRecursiveSchema(schema)) {
|
|
13039
|
+
throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
|
|
13040
|
+
}
|
|
13041
|
+
const clone2 = clone(schema);
|
|
13042
|
+
const liveRun = schema._zod.run;
|
|
13043
|
+
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
13044
|
+
const wrapped = (payload, ctx) => {
|
|
13045
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
13046
|
+
return originalRun(payload, ctx);
|
|
13047
|
+
}
|
|
13048
|
+
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
13049
|
+
return originalRun(payload, ctx);
|
|
13050
|
+
}
|
|
13051
|
+
const out = parser(payload.value);
|
|
13052
|
+
if (out !== INVALID) {
|
|
13053
|
+
payload.value = out;
|
|
13054
|
+
return payload;
|
|
13055
|
+
}
|
|
13056
|
+
if (ctx)
|
|
13057
|
+
ctx[FALLBACK_FLAG] = true;
|
|
13058
|
+
return originalRun(payload, ctx);
|
|
13059
|
+
};
|
|
13060
|
+
wrapped.__originalRun = originalRun;
|
|
13061
|
+
clone2._zod.bag.fallbackRun = originalRun;
|
|
13062
|
+
clone2._zod.bag.validator = parser;
|
|
13063
|
+
clone2._zod.run = wrapped;
|
|
13064
|
+
if (!liveRun.__originalRun)
|
|
13065
|
+
installCompiledUserMethods(clone2, schema, parser);
|
|
13066
|
+
return clone2;
|
|
13067
|
+
}
|
|
12659
13068
|
function installCompiledUserMethods(target, source, parser) {
|
|
12660
13069
|
const targetAny = target;
|
|
12661
13070
|
const sourceAny = source;
|
|
@@ -12692,7 +13101,8 @@ function compileFn(schema, options) {
|
|
|
12692
13101
|
const ctx = {
|
|
12693
13102
|
constants: /* @__PURE__ */ new Map(),
|
|
12694
13103
|
constantCounter: 0,
|
|
12695
|
-
varCounter: 0
|
|
13104
|
+
varCounter: 0,
|
|
13105
|
+
definite: true
|
|
12696
13106
|
};
|
|
12697
13107
|
const doc = new Doc(["input"]);
|
|
12698
13108
|
const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
|
|
@@ -12716,6 +13126,7 @@ ${code}
|
|
|
12716
13126
|
if (options?.debug) {
|
|
12717
13127
|
fn.code = fullCode;
|
|
12718
13128
|
}
|
|
13129
|
+
fn.definite = ctx.definite;
|
|
12719
13130
|
return fn;
|
|
12720
13131
|
}
|
|
12721
13132
|
function addConstant(ctx, value) {
|
|
@@ -12727,6 +13138,10 @@ function addConstant(ctx, value) {
|
|
|
12727
13138
|
ctx.constants.set(name, value);
|
|
12728
13139
|
return name;
|
|
12729
13140
|
}
|
|
13141
|
+
function addUserConstant(ctx, fn) {
|
|
13142
|
+
ctx.definite = false;
|
|
13143
|
+
return addConstant(ctx, fn);
|
|
13144
|
+
}
|
|
12730
13145
|
function newVar(ctx) {
|
|
12731
13146
|
return `v${ctx.varCounter++}`;
|
|
12732
13147
|
}
|
|
@@ -12759,6 +13174,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
12759
13174
|
}
|
|
12760
13175
|
}
|
|
12761
13176
|
function emitRuntimeIsland(doc, ctx, schema, accessor) {
|
|
13177
|
+
ctx.definite = false;
|
|
12762
13178
|
const schemaConst = addConstant(ctx, schema);
|
|
12763
13179
|
const runConst = addConstant(ctx, runtimeRun);
|
|
12764
13180
|
const outVar = newVar(ctx);
|
|
@@ -12839,6 +13255,9 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
12839
13255
|
case "property":
|
|
12840
13256
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
12841
13257
|
break;
|
|
13258
|
+
case "properties":
|
|
13259
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
13260
|
+
break;
|
|
12842
13261
|
case "overwrite": {
|
|
12843
13262
|
const newAccessor = newVar(ctx);
|
|
12844
13263
|
generateOverwriteCheck(doc, ctx, check2, currentAccessor, newAccessor);
|
|
@@ -12947,6 +13366,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
12947
13366
|
doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
|
|
12948
13367
|
}
|
|
12949
13368
|
}
|
|
13369
|
+
function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
13370
|
+
if (def.when) {
|
|
13371
|
+
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
13372
|
+
}
|
|
13373
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
13374
|
+
const shape = def.shape;
|
|
13375
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
13376
|
+
const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
|
|
13377
|
+
const inputVar = newVar(ctx);
|
|
13378
|
+
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
13379
|
+
compileChild(doc, ctx, shape[key], inputVar, false);
|
|
13380
|
+
}
|
|
13381
|
+
}
|
|
12950
13382
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
12951
13383
|
const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
|
|
12952
13384
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
@@ -12974,7 +13406,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
12974
13406
|
if (isAsyncFunction(def.fn)) {
|
|
12975
13407
|
throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
|
|
12976
13408
|
}
|
|
12977
|
-
const fnConst =
|
|
13409
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
12978
13410
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
12979
13411
|
const resVar = newVar(ctx);
|
|
12980
13412
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -12994,7 +13426,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
12994
13426
|
throwAsync();
|
|
12995
13427
|
return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
|
|
12996
13428
|
};
|
|
12997
|
-
const helperConst =
|
|
13429
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
12998
13430
|
const outVar = newVar(ctx);
|
|
12999
13431
|
doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
|
|
13000
13432
|
doc.write(`if (${outVar} === INVALID) return INVALID;`);
|
|
@@ -13028,7 +13460,7 @@ var PATTERN_IS_COMPLETE = /* @__PURE__ */ new Set([
|
|
|
13028
13460
|
"uuid",
|
|
13029
13461
|
"xid"
|
|
13030
13462
|
]);
|
|
13031
|
-
function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
13463
|
+
function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
|
|
13032
13464
|
const fmt = def.format;
|
|
13033
13465
|
if (fmt === "base64") {
|
|
13034
13466
|
const validator = addConstant(ctx, isValidBase64);
|
|
@@ -13061,9 +13493,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
13061
13493
|
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
13062
13494
|
return accessor;
|
|
13063
13495
|
}
|
|
13496
|
+
if (fmt === "iban") {
|
|
13497
|
+
const validator = addConstant(ctx, isValidIBAN);
|
|
13498
|
+
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
13499
|
+
return accessor;
|
|
13500
|
+
}
|
|
13064
13501
|
const formatDef = def;
|
|
13065
13502
|
if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
|
|
13066
|
-
const parseConst = addConstant(ctx,
|
|
13503
|
+
const parseConst = addConstant(ctx, validateURL);
|
|
13067
13504
|
const defConst = addConstant(ctx, def);
|
|
13068
13505
|
const trimVar = newVar(ctx);
|
|
13069
13506
|
const urlVar = newVar(ctx);
|
|
@@ -13078,6 +13515,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
13078
13515
|
const protocolConst = addConstant(ctx, urlProtocolOk);
|
|
13079
13516
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
13080
13517
|
}
|
|
13518
|
+
if (!needsValue)
|
|
13519
|
+
return null;
|
|
13081
13520
|
const outputVar = newVar(ctx);
|
|
13082
13521
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
|
|
13083
13522
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -13137,7 +13576,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
13137
13576
|
let typeAccessor;
|
|
13138
13577
|
switch (type) {
|
|
13139
13578
|
case "string":
|
|
13140
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
13579
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
13141
13580
|
break;
|
|
13142
13581
|
case "number":
|
|
13143
13582
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -13258,12 +13697,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
13258
13697
|
return null;
|
|
13259
13698
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
13260
13699
|
}
|
|
13261
|
-
function generateStringCheck(doc, ctx, schema, accessor) {
|
|
13700
|
+
function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
13262
13701
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
13263
13702
|
const def = schema._zod.def;
|
|
13264
13703
|
if (def.format === void 0)
|
|
13265
13704
|
return accessor;
|
|
13266
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
13705
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
13267
13706
|
}
|
|
13268
13707
|
function generateNumberCheck(doc, schema, accessor) {
|
|
13269
13708
|
doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
|
|
@@ -13381,7 +13820,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13381
13820
|
}
|
|
13382
13821
|
}
|
|
13383
13822
|
const outputVar = newVar(ctx);
|
|
13384
|
-
const hasConditionalKeys = allKeys.some((k) =>
|
|
13823
|
+
const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
|
|
13385
13824
|
if (!buildsValue) {
|
|
13386
13825
|
if (unknownKeysMode === "schema") {
|
|
13387
13826
|
const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
|
|
@@ -13408,7 +13847,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13408
13847
|
const out = propOutputs.get(k);
|
|
13409
13848
|
if (dropsWhenAbsent(propShape[k])) {
|
|
13410
13849
|
doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
13411
|
-
} else if (
|
|
13850
|
+
} else if (mayOmitUndefined(propShape[k])) {
|
|
13412
13851
|
doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
13413
13852
|
} else {
|
|
13414
13853
|
doc.write(`${outputVar}[${kx}] = ${out};`);
|
|
@@ -13541,6 +13980,9 @@ function fastPathAcceptsAbsence(schema) {
|
|
|
13541
13980
|
function dropsWhenAbsent(schema) {
|
|
13542
13981
|
return schema._zod.optin === "optional" && schema._zod.optout === "optional";
|
|
13543
13982
|
}
|
|
13983
|
+
function mayOmitUndefined(schema) {
|
|
13984
|
+
return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
|
|
13985
|
+
}
|
|
13544
13986
|
function mayOutputUndefined(schema) {
|
|
13545
13987
|
const def = schema._zod.def;
|
|
13546
13988
|
switch (def.type) {
|
|
@@ -13883,6 +14325,7 @@ function literalEquality(ctx, accessor, value) {
|
|
|
13883
14325
|
}
|
|
13884
14326
|
function generateIntersectionCheck(doc, ctx, schema, accessor) {
|
|
13885
14327
|
const def = schema._zod.def;
|
|
14328
|
+
ctx.definite = false;
|
|
13886
14329
|
const leftOutput = compileChild(doc, ctx, def.left, accessor);
|
|
13887
14330
|
const rightOutput = compileChild(doc, ctx, def.right, accessor);
|
|
13888
14331
|
const mergeConst = addConstant(ctx, mergeValues);
|
|
@@ -13936,14 +14379,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
13936
14379
|
const keyIsBareString = keyDef.type === "string" && keyDef.format === void 0 && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
|
|
13937
14380
|
if (!keyIsBareString) {
|
|
13938
14381
|
const isLoose = def.mode === "loose";
|
|
13939
|
-
const
|
|
14382
|
+
const keyFn = compileFn(def.keyType);
|
|
14383
|
+
if (keyFn.definite === false)
|
|
14384
|
+
ctx.definite = false;
|
|
14385
|
+
const keyFast = addConstant(ctx, keyFn);
|
|
13940
14386
|
const numericConst = addConstant(ctx, number);
|
|
13941
|
-
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
13942
14387
|
const outKeyVar = newVar(ctx);
|
|
13943
|
-
doc
|
|
13944
|
-
doc.indented((d) => {
|
|
13945
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
13946
|
-
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14388
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
13947
14389
|
d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
|
|
13948
14390
|
d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
|
|
13949
14391
|
if (isLoose) {
|
|
@@ -13957,21 +14399,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
13957
14399
|
const valOutput = compileChild(d, ctx, def.valueType, valueVar);
|
|
13958
14400
|
d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
|
|
13959
14401
|
});
|
|
13960
|
-
doc.write(`}`);
|
|
13961
14402
|
return outputVar;
|
|
13962
14403
|
}
|
|
13963
|
-
|
|
13964
|
-
doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
|
|
13965
|
-
doc.indented((d) => {
|
|
13966
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
13967
|
-
d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
|
|
13968
|
-
d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
|
|
14404
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
13969
14405
|
d.write(`const ${valVar} = ${accessor}[${kVar}];`);
|
|
13970
14406
|
const valOutput = compileChild(d, ctx, def.valueType, valVar);
|
|
13971
14407
|
d.write(`${outputVar}[${kVar}] = ${valOutput};`);
|
|
14408
|
+
}, `return INVALID;`);
|
|
14409
|
+
return outputVar;
|
|
14410
|
+
}
|
|
14411
|
+
function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
14412
|
+
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
14413
|
+
const symsVar = newVar(ctx);
|
|
14414
|
+
const keysVar = newVar(ctx);
|
|
14415
|
+
const iVar = newVar(ctx);
|
|
14416
|
+
doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
|
|
14417
|
+
doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
|
|
14418
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
|
|
14419
|
+
doc.indented((d) => {
|
|
14420
|
+
d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
|
|
14421
|
+
d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14422
|
+
body(d);
|
|
14423
|
+
});
|
|
14424
|
+
doc.write(`}`);
|
|
14425
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
|
|
14426
|
+
doc.indented((d) => {
|
|
14427
|
+
d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
|
|
14428
|
+
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14429
|
+
if (onSymbol)
|
|
14430
|
+
d.write(onSymbol);
|
|
14431
|
+
else
|
|
14432
|
+
body(d);
|
|
13972
14433
|
});
|
|
13973
14434
|
doc.write(`}`);
|
|
13974
|
-
return outputVar;
|
|
13975
14435
|
}
|
|
13976
14436
|
function literalPropertyKey(ctx, key) {
|
|
13977
14437
|
if (typeof key === "string")
|
|
@@ -14024,7 +14484,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
|
|
|
14024
14484
|
}
|
|
14025
14485
|
function generateLazyCheck(doc, ctx, schema, accessor) {
|
|
14026
14486
|
const def = schema._zod.def;
|
|
14027
|
-
const getterConst =
|
|
14487
|
+
const getterConst = addUserConstant(ctx, def.getter);
|
|
14028
14488
|
const cacheConst = addConstant(ctx, { parser: null });
|
|
14029
14489
|
doc.write(`if (!${cacheConst}.parser) {`);
|
|
14030
14490
|
doc.indented((d) => {
|
|
@@ -14057,7 +14517,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
|
|
|
14057
14517
|
return INVALID;
|
|
14058
14518
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
14059
14519
|
};
|
|
14060
|
-
const helperConst =
|
|
14520
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
14061
14521
|
const transformedVar = newVar(ctx);
|
|
14062
14522
|
doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
|
|
14063
14523
|
doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
|
|
@@ -14075,7 +14535,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
|
|
|
14075
14535
|
if (isAsyncFunction(def.fn)) {
|
|
14076
14536
|
throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
|
|
14077
14537
|
}
|
|
14078
|
-
const fnConst =
|
|
14538
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
14079
14539
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
14080
14540
|
const resVar = newVar(ctx);
|
|
14081
14541
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -14108,7 +14568,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
|
|
|
14108
14568
|
});
|
|
14109
14569
|
doc.write(`})();`);
|
|
14110
14570
|
const innerConst = addConstant(ctx, def.innerType);
|
|
14111
|
-
const catchConst =
|
|
14571
|
+
const catchConst = addUserConstant(ctx, def.catchValue);
|
|
14112
14572
|
const catchHelperConst = addConstant(ctx, runtimeCatch);
|
|
14113
14573
|
doc.write(`if (${outputVar} === INVALID) {`);
|
|
14114
14574
|
doc.indented((d) => {
|
|
@@ -14132,7 +14592,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
14132
14592
|
return INVALID;
|
|
14133
14593
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
14134
14594
|
};
|
|
14135
|
-
const helperConst =
|
|
14595
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
14136
14596
|
const outputVar = newVar(ctx);
|
|
14137
14597
|
doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
|
|
14138
14598
|
doc.write(`if (${outputVar} === INVALID) return INVALID;`);
|
|
@@ -14143,20 +14603,18 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
14143
14603
|
|
|
14144
14604
|
// node_modules/zod/v4/core/api.js
|
|
14145
14605
|
init_define_import_meta_env();
|
|
14606
|
+
function snapshotChecks(def) {
|
|
14607
|
+
if (def.checks)
|
|
14608
|
+
def.checks = [...def.checks];
|
|
14609
|
+
return def;
|
|
14610
|
+
}
|
|
14146
14611
|
// @__NO_SIDE_EFFECTS__
|
|
14147
14612
|
function _string(Class2, params) {
|
|
14148
|
-
return new Class2({
|
|
14149
|
-
type: "string",
|
|
14150
|
-
...normalizeParams(params)
|
|
14151
|
-
});
|
|
14613
|
+
return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
|
|
14152
14614
|
}
|
|
14153
14615
|
// @__NO_SIDE_EFFECTS__
|
|
14154
14616
|
function _coercedString(Class2, params) {
|
|
14155
|
-
return new Class2({
|
|
14156
|
-
type: "string",
|
|
14157
|
-
coerce: true,
|
|
14158
|
-
...normalizeParams(params)
|
|
14159
|
-
});
|
|
14617
|
+
return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
|
|
14160
14618
|
}
|
|
14161
14619
|
// @__NO_SIDE_EFFECTS__
|
|
14162
14620
|
function _email(Class2, params) {
|
|
@@ -14392,6 +14850,16 @@ function _creditCard(Class2, params) {
|
|
|
14392
14850
|
});
|
|
14393
14851
|
}
|
|
14394
14852
|
// @__NO_SIDE_EFFECTS__
|
|
14853
|
+
function _iban(Class2, params) {
|
|
14854
|
+
return new Class2({
|
|
14855
|
+
type: "string",
|
|
14856
|
+
format: "iban",
|
|
14857
|
+
check: "string_format",
|
|
14858
|
+
abort: false,
|
|
14859
|
+
...normalizeParams(params)
|
|
14860
|
+
});
|
|
14861
|
+
}
|
|
14862
|
+
// @__NO_SIDE_EFFECTS__
|
|
14395
14863
|
function _jwt(Class2, params) {
|
|
14396
14864
|
return new Class2({
|
|
14397
14865
|
type: "string",
|
|
@@ -14450,20 +14918,11 @@ function _isoDuration(Class2, params) {
|
|
|
14450
14918
|
}
|
|
14451
14919
|
// @__NO_SIDE_EFFECTS__
|
|
14452
14920
|
function _number(Class2, params) {
|
|
14453
|
-
return new Class2({
|
|
14454
|
-
type: "number",
|
|
14455
|
-
checks: [],
|
|
14456
|
-
...normalizeParams(params)
|
|
14457
|
-
});
|
|
14921
|
+
return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
|
|
14458
14922
|
}
|
|
14459
14923
|
// @__NO_SIDE_EFFECTS__
|
|
14460
14924
|
function _coercedNumber(Class2, params) {
|
|
14461
|
-
return new Class2({
|
|
14462
|
-
type: "number",
|
|
14463
|
-
coerce: true,
|
|
14464
|
-
checks: [],
|
|
14465
|
-
...normalizeParams(params)
|
|
14466
|
-
});
|
|
14925
|
+
return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
|
|
14467
14926
|
}
|
|
14468
14927
|
// @__NO_SIDE_EFFECTS__
|
|
14469
14928
|
function _int(Class2, params) {
|
|
@@ -14805,8 +15264,12 @@ function _property(property, schema, params) {
|
|
|
14805
15264
|
});
|
|
14806
15265
|
}
|
|
14807
15266
|
// @__NO_SIDE_EFFECTS__
|
|
14808
|
-
function _properties(shape) {
|
|
14809
|
-
return
|
|
15267
|
+
function _properties(shape, params) {
|
|
15268
|
+
return new $ZodCheckProperties({
|
|
15269
|
+
check: "properties",
|
|
15270
|
+
shape,
|
|
15271
|
+
...normalizeParams(params)
|
|
15272
|
+
});
|
|
14810
15273
|
}
|
|
14811
15274
|
// @__NO_SIDE_EFFECTS__
|
|
14812
15275
|
function _mime(types, params) {
|
|
@@ -15244,7 +15707,7 @@ function handleUnrepresentable(schema, ctx, json2, params, message) {
|
|
|
15244
15707
|
Object.assign(json2, result);
|
|
15245
15708
|
return true;
|
|
15246
15709
|
}
|
|
15247
|
-
function
|
|
15710
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
15248
15711
|
var _a3;
|
|
15249
15712
|
const def = schema._zod.def;
|
|
15250
15713
|
const seen = ctx.seen.get(schema);
|
|
@@ -15283,7 +15746,7 @@ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
15283
15746
|
if (parent) {
|
|
15284
15747
|
if (!result.ref)
|
|
15285
15748
|
result.ref = parent;
|
|
15286
|
-
|
|
15749
|
+
processSchema(parent, ctx, params);
|
|
15287
15750
|
ctx.seen.get(parent).isParent = true;
|
|
15288
15751
|
}
|
|
15289
15752
|
}
|
|
@@ -15390,7 +15853,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15390
15853
|
if (seen.count > 1) {
|
|
15391
15854
|
if (ctx.reused === "ref") {
|
|
15392
15855
|
extractToDef(entry);
|
|
15393
|
-
continue;
|
|
15394
15856
|
}
|
|
15395
15857
|
}
|
|
15396
15858
|
}
|
|
@@ -15718,20 +16180,108 @@ function isTransforming(_schema, _ctx) {
|
|
|
15718
16180
|
}
|
|
15719
16181
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
15720
16182
|
const ctx = initializeContext({ ...params, processors });
|
|
15721
|
-
|
|
16183
|
+
processSchema(schema, ctx);
|
|
15722
16184
|
extractDefs(ctx, schema);
|
|
15723
16185
|
return finalize(ctx, schema);
|
|
15724
16186
|
};
|
|
15725
16187
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
15726
16188
|
const { libraryOptions, target } = params ?? {};
|
|
15727
16189
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
15728
|
-
|
|
16190
|
+
processSchema(schema, ctx);
|
|
15729
16191
|
extractDefs(ctx, schema);
|
|
15730
16192
|
return finalize(ctx, schema);
|
|
15731
16193
|
};
|
|
15732
16194
|
|
|
15733
16195
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
15734
16196
|
init_define_import_meta_env();
|
|
16197
|
+
var narrowMin = (agg, key, value) => {
|
|
16198
|
+
if (agg[key] === void 0 || value > agg[key])
|
|
16199
|
+
agg[key] = value;
|
|
16200
|
+
};
|
|
16201
|
+
var narrowMax = (agg, key, value) => {
|
|
16202
|
+
if (agg[key] === void 0 || value < agg[key])
|
|
16203
|
+
agg[key] = value;
|
|
16204
|
+
};
|
|
16205
|
+
var narrowBoth = (agg, value) => {
|
|
16206
|
+
narrowMin(agg, "minimum", value);
|
|
16207
|
+
narrowMax(agg, "maximum", value);
|
|
16208
|
+
};
|
|
16209
|
+
var addDivisor = (agg, value) => {
|
|
16210
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
16211
|
+
if (!agg.multipleOf.includes(value))
|
|
16212
|
+
agg.multipleOf.push(value);
|
|
16213
|
+
};
|
|
16214
|
+
var addPattern = (agg, pattern) => {
|
|
16215
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
16216
|
+
agg.patterns.add(pattern);
|
|
16217
|
+
};
|
|
16218
|
+
var intersectMime = (agg, mime) => {
|
|
16219
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
16220
|
+
};
|
|
16221
|
+
var setFormat = (agg, format) => {
|
|
16222
|
+
agg.format = format;
|
|
16223
|
+
if (format.includes("int"))
|
|
16224
|
+
agg.isInt = true;
|
|
16225
|
+
};
|
|
16226
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
16227
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
16228
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
16229
|
+
setFormat(agg, def.format);
|
|
16230
|
+
const [minimum, maximum] = ranges[def.format];
|
|
16231
|
+
narrowMin(agg, "minimum", minimum);
|
|
16232
|
+
narrowMax(agg, "maximum", maximum);
|
|
16233
|
+
};
|
|
16234
|
+
var contributors = {
|
|
16235
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
16236
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
16237
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
16238
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
16239
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
16240
|
+
min_length: minContributor,
|
|
16241
|
+
max_length: maxContributor,
|
|
16242
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
16243
|
+
min_size: minContributor,
|
|
16244
|
+
max_size: maxContributor,
|
|
16245
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
16246
|
+
string_format: (agg, def) => {
|
|
16247
|
+
setFormat(agg, def.format);
|
|
16248
|
+
if (def.pattern)
|
|
16249
|
+
addPattern(agg, def.pattern);
|
|
16250
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
16251
|
+
agg.contentEncoding = def.format;
|
|
16252
|
+
if (def.local || def.precision === -1)
|
|
16253
|
+
agg.laxFormat = true;
|
|
16254
|
+
},
|
|
16255
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
16256
|
+
};
|
|
16257
|
+
function aggregateChecks(schema) {
|
|
16258
|
+
const agg = {};
|
|
16259
|
+
const def = schema._zod.def;
|
|
16260
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
16261
|
+
for (const ch of list)
|
|
16262
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
16263
|
+
const bag = schema._zod.bag;
|
|
16264
|
+
if (bag.minimum !== void 0)
|
|
16265
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
16266
|
+
if (bag.exclusiveMinimum !== void 0)
|
|
16267
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
16268
|
+
if (bag.maximum !== void 0)
|
|
16269
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
16270
|
+
if (bag.exclusiveMaximum !== void 0)
|
|
16271
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
16272
|
+
if (bag.multipleOf !== void 0)
|
|
16273
|
+
addDivisor(agg, bag.multipleOf);
|
|
16274
|
+
if (bag.format !== void 0) {
|
|
16275
|
+
agg.format ?? (agg.format = bag.format);
|
|
16276
|
+
if (bag.format.includes("int"))
|
|
16277
|
+
agg.isInt = true;
|
|
16278
|
+
}
|
|
16279
|
+
if (bag.mime)
|
|
16280
|
+
intersectMime(agg, bag.mime);
|
|
16281
|
+
for (const pattern of bag.patterns ?? [])
|
|
16282
|
+
addPattern(agg, pattern);
|
|
16283
|
+
return agg;
|
|
16284
|
+
}
|
|
15735
16285
|
var formatMap = {
|
|
15736
16286
|
guid: "uuid",
|
|
15737
16287
|
url: "uri",
|
|
@@ -15740,10 +16290,15 @@ var formatMap = {
|
|
|
15740
16290
|
regex: ""
|
|
15741
16291
|
// do not set
|
|
15742
16292
|
};
|
|
16293
|
+
var exactPatterns = /* @__PURE__ */ new Map([
|
|
16294
|
+
[base64Charset, base64],
|
|
16295
|
+
[base64urlCharset, base64url]
|
|
16296
|
+
]);
|
|
16297
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
15743
16298
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
15744
16299
|
const json2 = _json;
|
|
15745
16300
|
json2.type = "string";
|
|
15746
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
16301
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
15747
16302
|
if (typeof minimum === "number")
|
|
15748
16303
|
json2.minLength = minimum;
|
|
15749
16304
|
if (typeof maximum === "number")
|
|
@@ -15759,7 +16314,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15759
16314
|
if (contentEncoding)
|
|
15760
16315
|
json2.contentEncoding = contentEncoding;
|
|
15761
16316
|
if (patterns && patterns.size > 0) {
|
|
15762
|
-
const patternList = [...patterns];
|
|
16317
|
+
const patternList = [...patterns].map(exactPattern);
|
|
15763
16318
|
if (patternList.length === 1)
|
|
15764
16319
|
json2.pattern = patternList[0].source;
|
|
15765
16320
|
else if (patternList.length > 1) {
|
|
@@ -15774,11 +16329,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15774
16329
|
};
|
|
15775
16330
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
15776
16331
|
const json2 = _json;
|
|
15777
|
-
const { minimum, maximum,
|
|
15778
|
-
|
|
15779
|
-
json2.type = "integer";
|
|
15780
|
-
else
|
|
15781
|
-
json2.type = "number";
|
|
16332
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
16333
|
+
json2.type = isInt ? "integer" : "number";
|
|
15782
16334
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
15783
16335
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
15784
16336
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -15802,11 +16354,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
15802
16354
|
} else if (typeof maximum === "number") {
|
|
15803
16355
|
json2.maximum = maximum;
|
|
15804
16356
|
}
|
|
15805
|
-
if (
|
|
15806
|
-
|
|
15807
|
-
|
|
15808
|
-
|
|
15809
|
-
|
|
16357
|
+
if (multipleOf) {
|
|
16358
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
16359
|
+
for (const divisor of multipleOf) {
|
|
16360
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
16361
|
+
divisors.add(Math.abs(divisor));
|
|
16362
|
+
else
|
|
16363
|
+
handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
16364
|
+
}
|
|
16365
|
+
const [first, ...rest] = divisors;
|
|
16366
|
+
if (first !== void 0)
|
|
16367
|
+
json2.multipleOf = first;
|
|
16368
|
+
if (rest.length)
|
|
16369
|
+
json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
15810
16370
|
}
|
|
15811
16371
|
};
|
|
15812
16372
|
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
@@ -15909,27 +16469,22 @@ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
|
15909
16469
|
};
|
|
15910
16470
|
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
15911
16471
|
const _json = json2;
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
};
|
|
15917
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
16472
|
+
_json.type = "string";
|
|
16473
|
+
_json.format = "binary";
|
|
16474
|
+
_json.contentEncoding = "binary";
|
|
16475
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
15918
16476
|
if (minimum !== void 0)
|
|
15919
|
-
|
|
16477
|
+
_json.minLength = minimum;
|
|
15920
16478
|
if (maximum !== void 0)
|
|
15921
|
-
|
|
15922
|
-
if (mime)
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
}
|
|
15930
|
-
} else {
|
|
15931
|
-
Object.assign(_json, file2);
|
|
15932
|
-
}
|
|
16479
|
+
_json.maxLength = maximum;
|
|
16480
|
+
if (!mime)
|
|
16481
|
+
return;
|
|
16482
|
+
if (mime.length === 0)
|
|
16483
|
+
_json.not = {};
|
|
16484
|
+
else if (mime.length === 1)
|
|
16485
|
+
_json.contentMediaType = mime[0];
|
|
16486
|
+
else
|
|
16487
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
15933
16488
|
};
|
|
15934
16489
|
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
15935
16490
|
json2.type = "boolean";
|
|
@@ -15952,13 +16507,13 @@ var setProcessor = (schema, ctx, json2, params) => {
|
|
|
15952
16507
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
15953
16508
|
const json2 = _json;
|
|
15954
16509
|
const def = schema._zod.def;
|
|
15955
|
-
const { minimum, maximum } = schema
|
|
16510
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
15956
16511
|
if (typeof minimum === "number")
|
|
15957
16512
|
json2.minItems = minimum;
|
|
15958
16513
|
if (typeof maximum === "number")
|
|
15959
16514
|
json2.maxItems = maximum;
|
|
15960
16515
|
json2.type = "array";
|
|
15961
|
-
json2.items =
|
|
16516
|
+
json2.items = processSchema(def.element, ctx, {
|
|
15962
16517
|
...params,
|
|
15963
16518
|
path: [...params.path, "items"]
|
|
15964
16519
|
});
|
|
@@ -15984,22 +16539,20 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
15984
16539
|
json2.type = "object";
|
|
15985
16540
|
json2.properties = {};
|
|
15986
16541
|
for (const key in shape) {
|
|
15987
|
-
assignProp(json2.properties, key,
|
|
16542
|
+
assignProp(json2.properties, key, processSchema(shape[key], ctx, {
|
|
15988
16543
|
...params,
|
|
15989
16544
|
path: [...params.path, "properties", key]
|
|
15990
16545
|
}));
|
|
15991
16546
|
}
|
|
15992
|
-
const
|
|
15993
|
-
const
|
|
16547
|
+
const requiredKeys = [];
|
|
16548
|
+
for (const key of Object.keys(shape)) {
|
|
15994
16549
|
const field = def.shape[key];
|
|
15995
|
-
if (ctx.io === "input") {
|
|
15996
|
-
|
|
15997
|
-
} else {
|
|
15998
|
-
return field._zod.optout === void 0;
|
|
16550
|
+
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
|
|
16551
|
+
requiredKeys.push(key);
|
|
15999
16552
|
}
|
|
16000
|
-
}
|
|
16001
|
-
if (requiredKeys.
|
|
16002
|
-
json2.required =
|
|
16553
|
+
}
|
|
16554
|
+
if (requiredKeys.length > 0) {
|
|
16555
|
+
json2.required = requiredKeys;
|
|
16003
16556
|
}
|
|
16004
16557
|
if (def.catchall?._zod.def.type === "never") {
|
|
16005
16558
|
json2.additionalProperties = false;
|
|
@@ -16007,7 +16560,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
16007
16560
|
if (ctx.io === "output")
|
|
16008
16561
|
json2.additionalProperties = false;
|
|
16009
16562
|
} else if (def.catchall) {
|
|
16010
|
-
json2.additionalProperties =
|
|
16563
|
+
json2.additionalProperties = processSchema(def.catchall, ctx, {
|
|
16011
16564
|
...params,
|
|
16012
16565
|
path: [...params.path, "additionalProperties"]
|
|
16013
16566
|
});
|
|
@@ -16016,7 +16569,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
16016
16569
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
16017
16570
|
const def = schema._zod.def;
|
|
16018
16571
|
const isExclusive = def.inclusive === false;
|
|
16019
|
-
const options = def.options.map((x, i) =>
|
|
16572
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
16020
16573
|
...params,
|
|
16021
16574
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
16022
16575
|
}));
|
|
@@ -16028,11 +16581,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
16028
16581
|
};
|
|
16029
16582
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
16030
16583
|
const def = schema._zod.def;
|
|
16031
|
-
const a =
|
|
16584
|
+
const a = processSchema(def.left, ctx, {
|
|
16032
16585
|
...params,
|
|
16033
16586
|
path: [...params.path, "allOf", 0]
|
|
16034
16587
|
});
|
|
16035
|
-
const b =
|
|
16588
|
+
const b = processSchema(def.right, ctx, {
|
|
16036
16589
|
...params,
|
|
16037
16590
|
path: [...params.path, "allOf", 1]
|
|
16038
16591
|
});
|
|
@@ -16050,11 +16603,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
16050
16603
|
json2.type = "array";
|
|
16051
16604
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
16052
16605
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
16053
|
-
const prefixItems = def.items.map((x, i) =>
|
|
16606
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
16054
16607
|
...params,
|
|
16055
16608
|
path: [...params.path, prefixPath, i]
|
|
16056
16609
|
}));
|
|
16057
|
-
const rest = def.rest ?
|
|
16610
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
16058
16611
|
...params,
|
|
16059
16612
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
16060
16613
|
}) : null;
|
|
@@ -16102,7 +16655,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
16102
16655
|
if (isClosed)
|
|
16103
16656
|
json2.maxItems = maxItems;
|
|
16104
16657
|
}
|
|
16105
|
-
const { minimum, maximum } = schema
|
|
16658
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
16106
16659
|
if (typeof minimum === "number")
|
|
16107
16660
|
json2.minItems = minimum;
|
|
16108
16661
|
if (typeof maximum === "number")
|
|
@@ -16176,20 +16729,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16176
16729
|
const def = schema._zod.def;
|
|
16177
16730
|
json2.type = "object";
|
|
16178
16731
|
const keyType = def.keyType;
|
|
16179
|
-
const
|
|
16180
|
-
const patterns = keyBag?.patterns;
|
|
16732
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
16181
16733
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
16182
|
-
const valueSchema =
|
|
16734
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
16183
16735
|
...params,
|
|
16184
16736
|
path: [...params.path, "patternProperties", "*"]
|
|
16185
16737
|
});
|
|
16186
16738
|
json2.patternProperties = {};
|
|
16187
16739
|
for (const pattern of patterns) {
|
|
16188
|
-
assignProp(json2.patternProperties, pattern.source, valueSchema);
|
|
16740
|
+
assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
16189
16741
|
}
|
|
16190
16742
|
} else {
|
|
16191
16743
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
16192
|
-
json2.propertyNames =
|
|
16744
|
+
json2.propertyNames = processSchema(def.keyType, ctx, {
|
|
16193
16745
|
...params,
|
|
16194
16746
|
path: [...params.path, "propertyNames"]
|
|
16195
16747
|
});
|
|
@@ -16201,7 +16753,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16201
16753
|
}
|
|
16202
16754
|
pending.push(schema);
|
|
16203
16755
|
}
|
|
16204
|
-
json2.additionalProperties =
|
|
16756
|
+
json2.additionalProperties = processSchema(def.valueType, ctx, {
|
|
16205
16757
|
...params,
|
|
16206
16758
|
path: [...params.path, "additionalProperties"]
|
|
16207
16759
|
});
|
|
@@ -16217,7 +16769,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16217
16769
|
};
|
|
16218
16770
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
16219
16771
|
const def = schema._zod.def;
|
|
16220
|
-
const inner =
|
|
16772
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
16221
16773
|
const seen = ctx.seen.get(schema);
|
|
16222
16774
|
if (ctx.target === "openapi-3.0") {
|
|
16223
16775
|
seen.ref = def.innerType;
|
|
@@ -16228,7 +16780,7 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
16228
16780
|
};
|
|
16229
16781
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
16230
16782
|
const def = schema._zod.def;
|
|
16231
|
-
|
|
16783
|
+
processSchema(def.innerType, ctx, params);
|
|
16232
16784
|
const seen = ctx.seen.get(schema);
|
|
16233
16785
|
seen.ref = def.innerType;
|
|
16234
16786
|
};
|
|
@@ -16248,7 +16800,7 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
|
|
|
16248
16800
|
}
|
|
16249
16801
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
16250
16802
|
const def = schema._zod.def;
|
|
16251
|
-
|
|
16803
|
+
processSchema(def.innerType, ctx, params);
|
|
16252
16804
|
const seen = ctx.seen.get(schema);
|
|
16253
16805
|
seen.ref = def.innerType;
|
|
16254
16806
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
|
|
@@ -16257,7 +16809,7 @@ var defaultProcessor = (schema, ctx, json2, params) => {
|
|
|
16257
16809
|
};
|
|
16258
16810
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
16259
16811
|
const def = schema._zod.def;
|
|
16260
|
-
|
|
16812
|
+
processSchema(def.innerType, ctx, params);
|
|
16261
16813
|
const seen = ctx.seen.get(schema);
|
|
16262
16814
|
seen.ref = def.innerType;
|
|
16263
16815
|
if (ctx.io !== "input")
|
|
@@ -16268,7 +16820,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
16268
16820
|
};
|
|
16269
16821
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
16270
16822
|
const def = schema._zod.def;
|
|
16271
|
-
|
|
16823
|
+
processSchema(def.innerType, ctx, params);
|
|
16272
16824
|
const seen = ctx.seen.get(schema);
|
|
16273
16825
|
seen.ref = def.innerType;
|
|
16274
16826
|
let catchValue;
|
|
@@ -16284,32 +16836,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
16284
16836
|
const def = schema._zod.def;
|
|
16285
16837
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
16286
16838
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
16287
|
-
|
|
16839
|
+
processSchema(innerType, ctx, params);
|
|
16288
16840
|
const seen = ctx.seen.get(schema);
|
|
16289
16841
|
seen.ref = innerType;
|
|
16290
16842
|
};
|
|
16291
16843
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
16292
16844
|
const def = schema._zod.def;
|
|
16293
|
-
|
|
16845
|
+
processSchema(def.innerType, ctx, params);
|
|
16294
16846
|
const seen = ctx.seen.get(schema);
|
|
16295
16847
|
seen.ref = def.innerType;
|
|
16296
16848
|
json2.readOnly = true;
|
|
16297
16849
|
};
|
|
16298
16850
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
16299
16851
|
const def = schema._zod.def;
|
|
16300
|
-
|
|
16852
|
+
processSchema(def.innerType, ctx, params);
|
|
16301
16853
|
const seen = ctx.seen.get(schema);
|
|
16302
16854
|
seen.ref = def.innerType;
|
|
16303
16855
|
};
|
|
16304
16856
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
16305
16857
|
const def = schema._zod.def;
|
|
16306
|
-
|
|
16858
|
+
processSchema(def.innerType, ctx, params);
|
|
16307
16859
|
const seen = ctx.seen.get(schema);
|
|
16308
16860
|
seen.ref = def.innerType;
|
|
16309
16861
|
};
|
|
16310
16862
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
16311
16863
|
const innerType = schema._zod.innerType;
|
|
16312
|
-
|
|
16864
|
+
processSchema(innerType, ctx, params);
|
|
16313
16865
|
const seen = ctx.seen.get(schema);
|
|
16314
16866
|
seen.ref = innerType;
|
|
16315
16867
|
};
|
|
@@ -16361,7 +16913,7 @@ function toJSONSchema(input2, params) {
|
|
|
16361
16913
|
const defs = {};
|
|
16362
16914
|
for (const entry of registry2._idmap.entries()) {
|
|
16363
16915
|
const [_, schema] = entry;
|
|
16364
|
-
|
|
16916
|
+
processSchema(schema, ctx2);
|
|
16365
16917
|
}
|
|
16366
16918
|
const schemas = {};
|
|
16367
16919
|
const external = {
|
|
@@ -16384,7 +16936,7 @@ function toJSONSchema(input2, params) {
|
|
|
16384
16936
|
return { schemas };
|
|
16385
16937
|
}
|
|
16386
16938
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
16387
|
-
|
|
16939
|
+
processSchema(input2, ctx);
|
|
16388
16940
|
extractDefs(ctx, input2);
|
|
16389
16941
|
return finalize(ctx, input2);
|
|
16390
16942
|
}
|
|
@@ -16444,7 +16996,7 @@ var JSONSchemaGenerator = class {
|
|
|
16444
16996
|
* This must be called before emit().
|
|
16445
16997
|
*/
|
|
16446
16998
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
16447
|
-
return
|
|
16999
|
+
return processSchema(schema, this.ctx, _params);
|
|
16448
17000
|
}
|
|
16449
17001
|
/**
|
|
16450
17002
|
* Emit the final JSON Schema after processing.
|
|
@@ -16502,12 +17054,14 @@ __export(schemas_exports2, {
|
|
|
16502
17054
|
ZodFile: () => ZodFile,
|
|
16503
17055
|
ZodFunction: () => ZodFunction,
|
|
16504
17056
|
ZodGUID: () => ZodGUID,
|
|
17057
|
+
ZodIBAN: () => ZodIBAN,
|
|
16505
17058
|
ZodIPv4: () => ZodIPv4,
|
|
16506
17059
|
ZodIPv6: () => ZodIPv6,
|
|
16507
17060
|
ZodISODate: () => ZodISODate,
|
|
16508
17061
|
ZodISODateTime: () => ZodISODateTime,
|
|
16509
17062
|
ZodISODuration: () => ZodISODuration,
|
|
16510
17063
|
ZodISOTime: () => ZodISOTime,
|
|
17064
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
16511
17065
|
ZodIntersection: () => ZodIntersection,
|
|
16512
17066
|
ZodJWT: () => ZodJWT,
|
|
16513
17067
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -16566,6 +17120,7 @@ __export(schemas_exports2, {
|
|
|
16566
17120
|
creditCard: () => creditCard2,
|
|
16567
17121
|
cuid: () => cuid3,
|
|
16568
17122
|
cuid2: () => cuid22,
|
|
17123
|
+
currencyCode: () => currencyCode2,
|
|
16569
17124
|
custom: () => custom,
|
|
16570
17125
|
date: () => date2,
|
|
16571
17126
|
describe: () => describe2,
|
|
@@ -16584,6 +17139,7 @@ __export(schemas_exports2, {
|
|
|
16584
17139
|
hex: () => hex2,
|
|
16585
17140
|
hostname: () => hostname2,
|
|
16586
17141
|
httpUrl: () => httpUrl,
|
|
17142
|
+
iban: () => iban2,
|
|
16587
17143
|
instanceof: () => _instanceof,
|
|
16588
17144
|
int: () => int,
|
|
16589
17145
|
int32: () => int32,
|
|
@@ -16892,6 +17448,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
16892
17448
|
set spa(value) {
|
|
16893
17449
|
util_exports.own(this, "spa", value);
|
|
16894
17450
|
},
|
|
17451
|
+
validate(data, params) {
|
|
17452
|
+
return validate(this, data, params);
|
|
17453
|
+
},
|
|
17454
|
+
validateAsync(data, params) {
|
|
17455
|
+
return validateAsync(this, data, params);
|
|
17456
|
+
},
|
|
16895
17457
|
encode: function _encode2(data, params) {
|
|
16896
17458
|
return encode2(this, data, params, { callee: _encode2 });
|
|
16897
17459
|
},
|
|
@@ -16928,61 +17490,65 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
16928
17490
|
return this._zod.def;
|
|
16929
17491
|
}
|
|
16930
17492
|
});
|
|
16931
|
-
var _ZodString = /* @__PURE__ */ $constructor(
|
|
16932
|
-
|
|
16933
|
-
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
inst.minLength = bag.minimum ?? null;
|
|
16938
|
-
inst.maxLength = bag.maximum ?? null;
|
|
16939
|
-
}, {
|
|
16940
|
-
regex(...args) {
|
|
16941
|
-
return this.check(_regex(...args));
|
|
16942
|
-
},
|
|
16943
|
-
includes(...args) {
|
|
16944
|
-
return this.check(_includes(...args));
|
|
16945
|
-
},
|
|
16946
|
-
startsWith(...args) {
|
|
16947
|
-
return this.check(_startsWith(...args));
|
|
16948
|
-
},
|
|
16949
|
-
endsWith(...args) {
|
|
16950
|
-
return this.check(_endsWith(...args));
|
|
16951
|
-
},
|
|
16952
|
-
min(...args) {
|
|
16953
|
-
return this.check(_minLength(...args));
|
|
16954
|
-
},
|
|
16955
|
-
max(...args) {
|
|
16956
|
-
return this.check(_maxLength(...args));
|
|
16957
|
-
},
|
|
16958
|
-
length(...args) {
|
|
16959
|
-
return this.check(_length(...args));
|
|
16960
|
-
},
|
|
16961
|
-
nonempty(...args) {
|
|
16962
|
-
return this.check(_minLength(1, ...args));
|
|
16963
|
-
},
|
|
16964
|
-
lowercase(params) {
|
|
16965
|
-
return this.check(_lowercase(params));
|
|
16966
|
-
},
|
|
16967
|
-
uppercase(params) {
|
|
16968
|
-
return this.check(_uppercase(params));
|
|
16969
|
-
},
|
|
16970
|
-
trim() {
|
|
16971
|
-
return this.check(_trim());
|
|
16972
|
-
},
|
|
16973
|
-
normalize(...args) {
|
|
16974
|
-
return this.check(_normalize(...args));
|
|
16975
|
-
},
|
|
16976
|
-
toLowerCase() {
|
|
16977
|
-
return this.check(_toLowerCase());
|
|
16978
|
-
},
|
|
16979
|
-
toUpperCase() {
|
|
16980
|
-
return this.check(_toUpperCase());
|
|
17493
|
+
var _ZodString = /* @__PURE__ */ $constructor(
|
|
17494
|
+
"_ZodString",
|
|
17495
|
+
(inst, def) => {
|
|
17496
|
+
$ZodString.init(inst, def);
|
|
17497
|
+
ZodType.init(inst, def);
|
|
17498
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
|
|
16981
17499
|
},
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
17500
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17501
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
17502
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
17503
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
17504
|
+
}, {
|
|
17505
|
+
regex(...args) {
|
|
17506
|
+
return this.check(_regex(...args));
|
|
17507
|
+
},
|
|
17508
|
+
includes(...args) {
|
|
17509
|
+
return this.check(_includes(...args));
|
|
17510
|
+
},
|
|
17511
|
+
startsWith(...args) {
|
|
17512
|
+
return this.check(_startsWith(...args));
|
|
17513
|
+
},
|
|
17514
|
+
endsWith(...args) {
|
|
17515
|
+
return this.check(_endsWith(...args));
|
|
17516
|
+
},
|
|
17517
|
+
min(...args) {
|
|
17518
|
+
return this.check(_minLength(...args));
|
|
17519
|
+
},
|
|
17520
|
+
max(...args) {
|
|
17521
|
+
return this.check(_maxLength(...args));
|
|
17522
|
+
},
|
|
17523
|
+
length(...args) {
|
|
17524
|
+
return this.check(_length(...args));
|
|
17525
|
+
},
|
|
17526
|
+
nonempty(...args) {
|
|
17527
|
+
return this.check(_minLength(1, ...args));
|
|
17528
|
+
},
|
|
17529
|
+
lowercase(params) {
|
|
17530
|
+
return this.check(_lowercase(params));
|
|
17531
|
+
},
|
|
17532
|
+
uppercase(params) {
|
|
17533
|
+
return this.check(_uppercase(params));
|
|
17534
|
+
},
|
|
17535
|
+
trim() {
|
|
17536
|
+
return this.check(_trim());
|
|
17537
|
+
},
|
|
17538
|
+
normalize(...args) {
|
|
17539
|
+
return this.check(_normalize(...args));
|
|
17540
|
+
},
|
|
17541
|
+
toLowerCase() {
|
|
17542
|
+
return this.check(_toLowerCase());
|
|
17543
|
+
},
|
|
17544
|
+
toUpperCase() {
|
|
17545
|
+
return this.check(_toUpperCase());
|
|
17546
|
+
},
|
|
17547
|
+
slugify() {
|
|
17548
|
+
return this.check(_slugify());
|
|
17549
|
+
}
|
|
17550
|
+
})
|
|
17551
|
+
);
|
|
16986
17552
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
16987
17553
|
$ZodString.init(inst, def);
|
|
16988
17554
|
_ZodString.init(inst, def);
|
|
@@ -17128,8 +17694,8 @@ function url(params) {
|
|
|
17128
17694
|
}
|
|
17129
17695
|
function httpUrl(params) {
|
|
17130
17696
|
return _url(ZodURL, {
|
|
17131
|
-
protocol:
|
|
17132
|
-
hostname:
|
|
17697
|
+
protocol: httpProtocol,
|
|
17698
|
+
hostname: domain,
|
|
17133
17699
|
...util_exports.normalizeParams(params)
|
|
17134
17700
|
});
|
|
17135
17701
|
}
|
|
@@ -17245,6 +17811,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
17245
17811
|
function creditCard2(params) {
|
|
17246
17812
|
return _creditCard(ZodCreditCard, params);
|
|
17247
17813
|
}
|
|
17814
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
17815
|
+
$ZodIBAN.init(inst, def);
|
|
17816
|
+
ZodStringFormat.init(inst, def);
|
|
17817
|
+
});
|
|
17818
|
+
function iban2(params) {
|
|
17819
|
+
return _iban(ZodIBAN, params);
|
|
17820
|
+
}
|
|
17248
17821
|
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
17249
17822
|
$ZodJWT.init(inst, def);
|
|
17250
17823
|
ZodStringFormat.init(inst, def);
|
|
@@ -17260,10 +17833,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
17260
17833
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
17261
17834
|
}
|
|
17262
17835
|
function hostname2(_params) {
|
|
17263
|
-
return _stringFormat(ZodCustomStringFormat, "hostname",
|
|
17836
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
|
|
17264
17837
|
}
|
|
17265
17838
|
function hex2(_params) {
|
|
17266
|
-
return _stringFormat(ZodCustomStringFormat, "hex",
|
|
17839
|
+
return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
|
|
17840
|
+
}
|
|
17841
|
+
function currencyCode2(_params) {
|
|
17842
|
+
return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
|
|
17267
17843
|
}
|
|
17268
17844
|
function hash(alg, params) {
|
|
17269
17845
|
const enc = params?.enc ?? "hex";
|
|
@@ -17273,63 +17849,76 @@ function hash(alg, params) {
|
|
|
17273
17849
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
17274
17850
|
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
17275
17851
|
}
|
|
17276
|
-
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
17277
|
-
|
|
17278
|
-
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
17284
|
-
inst.isFinite = true;
|
|
17285
|
-
inst.format = bag.format ?? null;
|
|
17286
|
-
}, {
|
|
17287
|
-
gt(value, params) {
|
|
17288
|
-
return this.check(_gt(value, params));
|
|
17289
|
-
},
|
|
17290
|
-
gte(value, params) {
|
|
17291
|
-
return this.check(_gte(value, params));
|
|
17292
|
-
},
|
|
17293
|
-
min(value, params) {
|
|
17294
|
-
return this.check(_gte(value, params));
|
|
17295
|
-
},
|
|
17296
|
-
lt(value, params) {
|
|
17297
|
-
return this.check(_lt(value, params));
|
|
17852
|
+
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
17853
|
+
"ZodNumber",
|
|
17854
|
+
(inst, def) => {
|
|
17855
|
+
$ZodNumber.init(inst, def);
|
|
17856
|
+
ZodType.init(inst, def);
|
|
17857
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
17858
|
+
inst.isFinite = true;
|
|
17298
17859
|
},
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
},
|
|
17314
|
-
|
|
17315
|
-
|
|
17316
|
-
|
|
17317
|
-
|
|
17318
|
-
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17860
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17861
|
+
minValue: (inst) => {
|
|
17862
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
17863
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
17864
|
+
},
|
|
17865
|
+
maxValue: (inst) => {
|
|
17866
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
17867
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
17868
|
+
},
|
|
17869
|
+
isInt: (inst) => {
|
|
17870
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
17871
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
17872
|
+
},
|
|
17873
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
17874
|
+
}, {
|
|
17875
|
+
gt(value, params) {
|
|
17876
|
+
return this.check(_gt(value, params));
|
|
17877
|
+
},
|
|
17878
|
+
gte(value, params) {
|
|
17879
|
+
return this.check(_gte(value, params));
|
|
17880
|
+
},
|
|
17881
|
+
min(value, params) {
|
|
17882
|
+
return this.check(_gte(value, params));
|
|
17883
|
+
},
|
|
17884
|
+
lt(value, params) {
|
|
17885
|
+
return this.check(_lt(value, params));
|
|
17886
|
+
},
|
|
17887
|
+
lte(value, params) {
|
|
17888
|
+
return this.check(_lte(value, params));
|
|
17889
|
+
},
|
|
17890
|
+
max(value, params) {
|
|
17891
|
+
return this.check(_lte(value, params));
|
|
17892
|
+
},
|
|
17893
|
+
int(params) {
|
|
17894
|
+
return this.check(int(params));
|
|
17895
|
+
},
|
|
17896
|
+
safe(params) {
|
|
17897
|
+
return this.check(int(params));
|
|
17898
|
+
},
|
|
17899
|
+
positive(params) {
|
|
17900
|
+
return this.check(_gt(0, params));
|
|
17901
|
+
},
|
|
17902
|
+
nonnegative(params) {
|
|
17903
|
+
return this.check(_gte(0, params));
|
|
17904
|
+
},
|
|
17905
|
+
negative(params) {
|
|
17906
|
+
return this.check(_lt(0, params));
|
|
17907
|
+
},
|
|
17908
|
+
nonpositive(params) {
|
|
17909
|
+
return this.check(_lte(0, params));
|
|
17910
|
+
},
|
|
17911
|
+
multipleOf(value, params) {
|
|
17912
|
+
return this.check(_multipleOf(value, params));
|
|
17913
|
+
},
|
|
17914
|
+
step(value, params) {
|
|
17915
|
+
return this.check(_multipleOf(value, params));
|
|
17916
|
+
},
|
|
17917
|
+
finite() {
|
|
17918
|
+
return this;
|
|
17919
|
+
}
|
|
17920
|
+
})
|
|
17921
|
+
);
|
|
17333
17922
|
function number2(params) {
|
|
17334
17923
|
return _number(ZodNumber, params);
|
|
17335
17924
|
}
|
|
@@ -17360,49 +17949,53 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
17360
17949
|
function boolean2(params) {
|
|
17361
17950
|
return _boolean(ZodBoolean, params);
|
|
17362
17951
|
}
|
|
17363
|
-
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
inst.maxValue = bag.maximum ?? null;
|
|
17370
|
-
inst.format = bag.format ?? null;
|
|
17371
|
-
}, {
|
|
17372
|
-
gte(value, params) {
|
|
17373
|
-
return this.check(_gte(value, params));
|
|
17374
|
-
},
|
|
17375
|
-
min(value, params) {
|
|
17376
|
-
return this.check(_gte(value, params));
|
|
17377
|
-
},
|
|
17378
|
-
gt(value, params) {
|
|
17379
|
-
return this.check(_gt(value, params));
|
|
17380
|
-
},
|
|
17381
|
-
lt(value, params) {
|
|
17382
|
-
return this.check(_lt(value, params));
|
|
17383
|
-
},
|
|
17384
|
-
lte(value, params) {
|
|
17385
|
-
return this.check(_lte(value, params));
|
|
17386
|
-
},
|
|
17387
|
-
max(value, params) {
|
|
17388
|
-
return this.check(_lte(value, params));
|
|
17389
|
-
},
|
|
17390
|
-
positive(params) {
|
|
17391
|
-
return this.check(_gt(BigInt(0), params));
|
|
17952
|
+
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
17953
|
+
"ZodBigInt",
|
|
17954
|
+
(inst, def) => {
|
|
17955
|
+
$ZodBigInt.init(inst, def);
|
|
17956
|
+
ZodType.init(inst, def);
|
|
17957
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
17392
17958
|
},
|
|
17393
|
-
|
|
17394
|
-
|
|
17395
|
-
|
|
17396
|
-
|
|
17397
|
-
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17959
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17960
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
17961
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
17962
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
17963
|
+
}, {
|
|
17964
|
+
gte(value, params) {
|
|
17965
|
+
return this.check(_gte(value, params));
|
|
17966
|
+
},
|
|
17967
|
+
min(value, params) {
|
|
17968
|
+
return this.check(_gte(value, params));
|
|
17969
|
+
},
|
|
17970
|
+
gt(value, params) {
|
|
17971
|
+
return this.check(_gt(value, params));
|
|
17972
|
+
},
|
|
17973
|
+
lt(value, params) {
|
|
17974
|
+
return this.check(_lt(value, params));
|
|
17975
|
+
},
|
|
17976
|
+
lte(value, params) {
|
|
17977
|
+
return this.check(_lte(value, params));
|
|
17978
|
+
},
|
|
17979
|
+
max(value, params) {
|
|
17980
|
+
return this.check(_lte(value, params));
|
|
17981
|
+
},
|
|
17982
|
+
positive(params) {
|
|
17983
|
+
return this.check(_gt(BigInt(0), params));
|
|
17984
|
+
},
|
|
17985
|
+
negative(params) {
|
|
17986
|
+
return this.check(_lt(BigInt(0), params));
|
|
17987
|
+
},
|
|
17988
|
+
nonpositive(params) {
|
|
17989
|
+
return this.check(_lte(BigInt(0), params));
|
|
17990
|
+
},
|
|
17991
|
+
nonnegative(params) {
|
|
17992
|
+
return this.check(_gte(BigInt(0), params));
|
|
17993
|
+
},
|
|
17994
|
+
multipleOf(value, params) {
|
|
17995
|
+
return this.check(_multipleOf(value, params));
|
|
17996
|
+
}
|
|
17997
|
+
})
|
|
17998
|
+
);
|
|
17406
17999
|
function bigint2(params) {
|
|
17407
18000
|
return _bigint(ZodBigInt, params);
|
|
17408
18001
|
}
|
|
@@ -17472,16 +18065,26 @@ var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
|
17472
18065
|
function _void2(params) {
|
|
17473
18066
|
return _void(ZodVoid, params);
|
|
17474
18067
|
}
|
|
17475
|
-
var ZodDate = /* @__PURE__ */ $constructor(
|
|
17476
|
-
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
|
|
18068
|
+
var ZodDate = /* @__PURE__ */ $constructor(
|
|
18069
|
+
"ZodDate",
|
|
18070
|
+
(inst, def) => {
|
|
18071
|
+
$ZodDate.init(inst, def);
|
|
18072
|
+
ZodType.init(inst, def);
|
|
18073
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
18074
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
18075
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
18076
|
+
},
|
|
18077
|
+
/* @__PURE__ */ util_exports.derived({
|
|
18078
|
+
minDate: (inst) => {
|
|
18079
|
+
const { minimum } = aggregateChecks(inst);
|
|
18080
|
+
return minimum ? new Date(minimum) : null;
|
|
18081
|
+
},
|
|
18082
|
+
maxDate: (inst) => {
|
|
18083
|
+
const { maximum } = aggregateChecks(inst);
|
|
18084
|
+
return maximum ? new Date(maximum) : null;
|
|
18085
|
+
}
|
|
18086
|
+
}, {})
|
|
18087
|
+
);
|
|
17485
18088
|
function date2(params) {
|
|
17486
18089
|
return _date(ZodDate, params);
|
|
17487
18090
|
}
|
|
@@ -17526,19 +18129,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
17526
18129
|
return _enum2(Object.keys(this._zod.def.shape));
|
|
17527
18130
|
},
|
|
17528
18131
|
catchall(catchall) {
|
|
17529
|
-
return this.clone(
|
|
18132
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
|
|
17530
18133
|
},
|
|
17531
18134
|
passthrough() {
|
|
17532
|
-
return this.clone(
|
|
18135
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
17533
18136
|
},
|
|
17534
18137
|
loose() {
|
|
17535
|
-
return this.clone(
|
|
18138
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
17536
18139
|
},
|
|
17537
18140
|
strict() {
|
|
17538
|
-
return this.clone(
|
|
18141
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
|
|
17539
18142
|
},
|
|
17540
18143
|
strip() {
|
|
17541
|
-
return this.clone(
|
|
18144
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
17542
18145
|
},
|
|
17543
18146
|
extend(incoming) {
|
|
17544
18147
|
return util_exports.extend(this, incoming);
|
|
@@ -17757,7 +18360,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
17757
18360
|
ZodType.init(inst, def);
|
|
17758
18361
|
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
17759
18362
|
inst.enum = def.entries;
|
|
17760
|
-
inst.options =
|
|
18363
|
+
inst.options = [...inst._zod.values];
|
|
17761
18364
|
const keys = new Set(Object.keys(def.entries));
|
|
17762
18365
|
inst.extract = (values, params) => {
|
|
17763
18366
|
const newEntries = {};
|
|
@@ -18120,8 +18723,15 @@ function superRefine(fn, params) {
|
|
|
18120
18723
|
}
|
|
18121
18724
|
var describe2 = describe;
|
|
18122
18725
|
var meta2 = meta;
|
|
18726
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
18727
|
+
ZodCustom.init(inst, def);
|
|
18728
|
+
}, {
|
|
18729
|
+
properties(shape, params) {
|
|
18730
|
+
return this.check(_properties(shape, params));
|
|
18731
|
+
}
|
|
18732
|
+
});
|
|
18123
18733
|
function _instanceof(cls, params = {}) {
|
|
18124
|
-
const inst = new
|
|
18734
|
+
const inst = new ZodInstanceOf({
|
|
18125
18735
|
type: "custom",
|
|
18126
18736
|
check: "custom",
|
|
18127
18737
|
fn: (data) => data instanceof cls,
|
|
@@ -18331,27 +18941,188 @@ function resolveRef(ref, ctx) {
|
|
|
18331
18941
|
}
|
|
18332
18942
|
throw new Error(`Reference not found: ${ref}`);
|
|
18333
18943
|
}
|
|
18334
|
-
function
|
|
18944
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
18335
18945
|
const guard = z.transform((value) => value).check((payload) => {
|
|
18336
18946
|
const value = payload.value;
|
|
18337
18947
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
18338
18948
|
return;
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
if (result.success)
|
|
18342
|
-
continue;
|
|
18949
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
18950
|
+
if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
|
|
18343
18951
|
payload.issues.push({
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
|
|
18952
|
+
origin: "object",
|
|
18953
|
+
code: "too_small",
|
|
18954
|
+
minimum: guards.minProperties,
|
|
18955
|
+
inclusive: true,
|
|
18956
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
18957
|
+
input: value,
|
|
18958
|
+
inst: objectSchema,
|
|
18959
|
+
continue: true
|
|
18960
|
+
});
|
|
18961
|
+
}
|
|
18962
|
+
if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
|
|
18963
|
+
payload.issues.push({
|
|
18964
|
+
origin: "object",
|
|
18965
|
+
code: "too_big",
|
|
18966
|
+
maximum: guards.maxProperties,
|
|
18967
|
+
inclusive: true,
|
|
18968
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
18969
|
+
input: value,
|
|
18970
|
+
inst: objectSchema,
|
|
18349
18971
|
continue: true
|
|
18350
18972
|
});
|
|
18351
18973
|
}
|
|
18974
|
+
if (guards.keySchema) {
|
|
18975
|
+
for (const key of keys) {
|
|
18976
|
+
const result = guards.keySchema.safeParse(key);
|
|
18977
|
+
if (result.success)
|
|
18978
|
+
continue;
|
|
18979
|
+
payload.issues.push({
|
|
18980
|
+
code: "invalid_key",
|
|
18981
|
+
origin: "record",
|
|
18982
|
+
issues: result.error.issues,
|
|
18983
|
+
input: key,
|
|
18984
|
+
path: [key],
|
|
18985
|
+
continue: true
|
|
18986
|
+
});
|
|
18987
|
+
}
|
|
18988
|
+
}
|
|
18352
18989
|
});
|
|
18353
18990
|
return guard.pipe(objectSchema);
|
|
18354
18991
|
}
|
|
18992
|
+
function canonicalKey(value, seen) {
|
|
18993
|
+
if (value === null)
|
|
18994
|
+
return "z";
|
|
18995
|
+
const type = typeof value;
|
|
18996
|
+
if (type !== "object") {
|
|
18997
|
+
if (type === "number" && Number.isNaN(value))
|
|
18998
|
+
return null;
|
|
18999
|
+
const raw = String(value);
|
|
19000
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
19001
|
+
}
|
|
19002
|
+
if (seen.has(value))
|
|
19003
|
+
return null;
|
|
19004
|
+
seen.add(value);
|
|
19005
|
+
try {
|
|
19006
|
+
if (Array.isArray(value)) {
|
|
19007
|
+
const parts2 = [];
|
|
19008
|
+
for (const item of value) {
|
|
19009
|
+
const key = canonicalKey(item, seen);
|
|
19010
|
+
if (key === null)
|
|
19011
|
+
return null;
|
|
19012
|
+
parts2.push(key);
|
|
19013
|
+
}
|
|
19014
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
19015
|
+
}
|
|
19016
|
+
const keys = Object.keys(value).sort();
|
|
19017
|
+
const parts = [];
|
|
19018
|
+
for (const k of keys) {
|
|
19019
|
+
const key = canonicalKey(value[k], seen);
|
|
19020
|
+
if (key === null)
|
|
19021
|
+
return null;
|
|
19022
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
19023
|
+
}
|
|
19024
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
19025
|
+
} finally {
|
|
19026
|
+
seen.delete(value);
|
|
19027
|
+
}
|
|
19028
|
+
}
|
|
19029
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
19030
|
+
"items",
|
|
19031
|
+
"prefixItems",
|
|
19032
|
+
"additionalItems",
|
|
19033
|
+
"additionalProperties",
|
|
19034
|
+
"contains",
|
|
19035
|
+
"propertyNames",
|
|
19036
|
+
"not",
|
|
19037
|
+
"if",
|
|
19038
|
+
"then",
|
|
19039
|
+
"else",
|
|
19040
|
+
"allOf",
|
|
19041
|
+
"anyOf",
|
|
19042
|
+
"oneOf",
|
|
19043
|
+
"unevaluatedItems",
|
|
19044
|
+
"unevaluatedProperties",
|
|
19045
|
+
"contentSchema"
|
|
19046
|
+
]);
|
|
19047
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
19048
|
+
"properties",
|
|
19049
|
+
"patternProperties",
|
|
19050
|
+
"dependentSchemas",
|
|
19051
|
+
"dependencies",
|
|
19052
|
+
"$defs",
|
|
19053
|
+
"definitions"
|
|
19054
|
+
]);
|
|
19055
|
+
function containsRef(value) {
|
|
19056
|
+
if (typeof value !== "object" || value === null)
|
|
19057
|
+
return false;
|
|
19058
|
+
if (Array.isArray(value))
|
|
19059
|
+
return value.some(containsRef);
|
|
19060
|
+
if (typeof value.$ref === "string")
|
|
19061
|
+
return true;
|
|
19062
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
19063
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
19064
|
+
return containsRef(sub);
|
|
19065
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
19066
|
+
return false;
|
|
19067
|
+
return Object.values(sub).some(containsRef);
|
|
19068
|
+
});
|
|
19069
|
+
}
|
|
19070
|
+
function plural(n) {
|
|
19071
|
+
return n === 1 ? "element" : "elements";
|
|
19072
|
+
}
|
|
19073
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
19074
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
19075
|
+
const items = payload.value;
|
|
19076
|
+
if (!Array.isArray(items))
|
|
19077
|
+
return;
|
|
19078
|
+
if (guards.uniqueItems === true) {
|
|
19079
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
19080
|
+
for (let i = 0; i < items.length; i++) {
|
|
19081
|
+
const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
19082
|
+
if (key === null)
|
|
19083
|
+
continue;
|
|
19084
|
+
const first = firstSeen.get(key);
|
|
19085
|
+
if (first === void 0) {
|
|
19086
|
+
firstSeen.set(key, i);
|
|
19087
|
+
continue;
|
|
19088
|
+
}
|
|
19089
|
+
payload.issues.push({
|
|
19090
|
+
code: "custom",
|
|
19091
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
19092
|
+
input: items,
|
|
19093
|
+
path: [i],
|
|
19094
|
+
continue: true
|
|
19095
|
+
});
|
|
19096
|
+
}
|
|
19097
|
+
}
|
|
19098
|
+
if (guards.containsSchema) {
|
|
19099
|
+
const minContains = guards.minContains ?? 1;
|
|
19100
|
+
const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
19101
|
+
let matches = 0;
|
|
19102
|
+
for (const item of items) {
|
|
19103
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
19104
|
+
break;
|
|
19105
|
+
}
|
|
19106
|
+
if (matches < minContains) {
|
|
19107
|
+
payload.issues.push({
|
|
19108
|
+
code: "custom",
|
|
19109
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
19110
|
+
input: items,
|
|
19111
|
+
continue: true
|
|
19112
|
+
});
|
|
19113
|
+
}
|
|
19114
|
+
if (guards.maxContains !== void 0 && matches > guards.maxContains) {
|
|
19115
|
+
payload.issues.push({
|
|
19116
|
+
code: "custom",
|
|
19117
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
19118
|
+
input: items,
|
|
19119
|
+
continue: true
|
|
19120
|
+
});
|
|
19121
|
+
}
|
|
19122
|
+
}
|
|
19123
|
+
});
|
|
19124
|
+
return guard.pipe(arraySchema);
|
|
19125
|
+
}
|
|
18355
19126
|
function getTupleRest(restSchema, ctx) {
|
|
18356
19127
|
if (restSchema === false) {
|
|
18357
19128
|
return void 0;
|
|
@@ -18481,6 +19252,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18481
19252
|
stringSchema = stringSchema.check(z.e164());
|
|
18482
19253
|
} else if (format === "credit_card") {
|
|
18483
19254
|
stringSchema = stringSchema.check(z.creditCard());
|
|
19255
|
+
} else if (format === "iban") {
|
|
19256
|
+
stringSchema = stringSchema.check(z.iban());
|
|
18484
19257
|
} else if (format === "jwt") {
|
|
18485
19258
|
stringSchema = stringSchema.check(z.jwt());
|
|
18486
19259
|
} else if (format === "emoji") {
|
|
@@ -18613,9 +19386,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18613
19386
|
zodSchema = objectSchema.passthrough();
|
|
18614
19387
|
}
|
|
18615
19388
|
}
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
19389
|
+
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
19390
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
|
|
19391
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
|
|
19392
|
+
if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
|
|
19393
|
+
let keySchema;
|
|
19394
|
+
if (hasKeyGuard) {
|
|
19395
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
19396
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
19397
|
+
}
|
|
19398
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
18619
19399
|
}
|
|
18620
19400
|
break;
|
|
18621
19401
|
}
|
|
@@ -18661,6 +19441,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18661
19441
|
} else {
|
|
18662
19442
|
zodSchema = z.array(z.any());
|
|
18663
19443
|
}
|
|
19444
|
+
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
19445
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
19446
|
+
uniqueItems: schema.uniqueItems === true,
|
|
19447
|
+
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
19448
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
19449
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
|
|
19450
|
+
});
|
|
19451
|
+
}
|
|
18664
19452
|
break;
|
|
18665
19453
|
}
|
|
18666
19454
|
default:
|
|
@@ -18718,8 +19506,23 @@ function convertSchema(schema, ctx) {
|
|
|
18718
19506
|
extraMeta[key] = schema[key];
|
|
18719
19507
|
}
|
|
18720
19508
|
}
|
|
18721
|
-
if (schema.
|
|
18722
|
-
|
|
19509
|
+
if (schema.type === "object" && schema.$ref === void 0) {
|
|
19510
|
+
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
19511
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
19512
|
+
}
|
|
19513
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
19514
|
+
if (schema[key] !== void 0)
|
|
19515
|
+
extraMeta[key] = schema[key];
|
|
19516
|
+
}
|
|
19517
|
+
}
|
|
19518
|
+
if (schema.type === "array" && schema.$ref === void 0) {
|
|
19519
|
+
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
19520
|
+
extraMeta.contains = schema.contains;
|
|
19521
|
+
}
|
|
19522
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
19523
|
+
if (schema[key] !== void 0)
|
|
19524
|
+
extraMeta[key] = schema[key];
|
|
19525
|
+
}
|
|
18723
19526
|
}
|
|
18724
19527
|
for (const key of Object.keys(schema)) {
|
|
18725
19528
|
if (!RECOGNIZED_KEYS.has(key)) {
|
|
@@ -19006,9 +19809,11 @@ export {
|
|
|
19006
19809
|
$input,
|
|
19007
19810
|
registry,
|
|
19008
19811
|
globalRegistry,
|
|
19812
|
+
INVALID,
|
|
19009
19813
|
ZodCompileAsyncError,
|
|
19010
19814
|
ZodCompileUnsupportedError,
|
|
19011
19815
|
compile,
|
|
19816
|
+
withParser,
|
|
19012
19817
|
TimePrecision,
|
|
19013
19818
|
_lt,
|
|
19014
19819
|
_lte,
|
|
@@ -19109,12 +19914,15 @@ export {
|
|
|
19109
19914
|
e1642 as e164,
|
|
19110
19915
|
ZodCreditCard,
|
|
19111
19916
|
creditCard2 as creditCard,
|
|
19917
|
+
ZodIBAN,
|
|
19918
|
+
iban2 as iban,
|
|
19112
19919
|
ZodJWT,
|
|
19113
19920
|
jwt,
|
|
19114
19921
|
ZodCustomStringFormat,
|
|
19115
19922
|
stringFormat,
|
|
19116
19923
|
hostname2 as hostname,
|
|
19117
19924
|
hex2 as hex,
|
|
19925
|
+
currencyCode2 as currencyCode,
|
|
19118
19926
|
hash,
|
|
19119
19927
|
ZodNumber,
|
|
19120
19928
|
number2 as number,
|
|
@@ -19223,6 +20031,7 @@ export {
|
|
|
19223
20031
|
superRefine,
|
|
19224
20032
|
describe2 as describe,
|
|
19225
20033
|
meta2 as meta,
|
|
20034
|
+
ZodInstanceOf,
|
|
19226
20035
|
_instanceof,
|
|
19227
20036
|
stringbool,
|
|
19228
20037
|
json,
|