@declaro/data 2.0.0-beta.100 → 2.0.0-beta.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +20 -26
- package/dist/browser/index.js.map +27 -21
- package/dist/node/index.cjs +1855 -577
- package/dist/node/index.cjs.map +27 -21
- package/dist/node/index.js +1855 -577
- package/dist/node/index.js.map +27 -21
- package/package.json +6 -6
package/dist/node/index.cjs
CHANGED
|
@@ -297,6 +297,7 @@ __export(exports_external, {
|
|
|
297
297
|
uuidv6: () => uuidv6,
|
|
298
298
|
uuidv4: () => uuidv4,
|
|
299
299
|
uuid: () => uuid2,
|
|
300
|
+
util: () => exports_util,
|
|
300
301
|
url: () => url,
|
|
301
302
|
uppercase: () => _uppercase,
|
|
302
303
|
unknown: () => unknown,
|
|
@@ -326,6 +327,10 @@ __export(exports_external, {
|
|
|
326
327
|
set: () => set,
|
|
327
328
|
safeParseAsync: () => safeParseAsync2,
|
|
328
329
|
safeParse: () => safeParse2,
|
|
330
|
+
safeEncodeAsync: () => safeEncodeAsync2,
|
|
331
|
+
safeEncode: () => safeEncode2,
|
|
332
|
+
safeDecodeAsync: () => safeDecodeAsync2,
|
|
333
|
+
safeDecode: () => safeDecode2,
|
|
329
334
|
registry: () => registry,
|
|
330
335
|
regexes: () => exports_regexes,
|
|
331
336
|
regex: () => _regex,
|
|
@@ -386,6 +391,10 @@ __export(exports_external, {
|
|
|
386
391
|
int: () => int,
|
|
387
392
|
instanceof: () => _instanceof,
|
|
388
393
|
includes: () => _includes,
|
|
394
|
+
httpUrl: () => httpUrl,
|
|
395
|
+
hostname: () => hostname2,
|
|
396
|
+
hex: () => hex2,
|
|
397
|
+
hash: () => hash,
|
|
389
398
|
guid: () => guid2,
|
|
390
399
|
gte: () => _gte,
|
|
391
400
|
gt: () => _gt,
|
|
@@ -399,10 +408,14 @@ __export(exports_external, {
|
|
|
399
408
|
file: () => file,
|
|
400
409
|
enum: () => _enum2,
|
|
401
410
|
endsWith: () => _endsWith,
|
|
411
|
+
encodeAsync: () => encodeAsync2,
|
|
412
|
+
encode: () => encode2,
|
|
402
413
|
emoji: () => emoji2,
|
|
403
414
|
email: () => email2,
|
|
404
415
|
e164: () => e1642,
|
|
405
416
|
discriminatedUnion: () => discriminatedUnion,
|
|
417
|
+
decodeAsync: () => decodeAsync2,
|
|
418
|
+
decode: () => decode2,
|
|
406
419
|
date: () => date3,
|
|
407
420
|
custom: () => custom,
|
|
408
421
|
cuid2: () => cuid22,
|
|
@@ -410,6 +423,7 @@ __export(exports_external, {
|
|
|
410
423
|
core: () => exports_core2,
|
|
411
424
|
config: () => config,
|
|
412
425
|
coerce: () => exports_coerce,
|
|
426
|
+
codec: () => codec,
|
|
413
427
|
clone: () => clone,
|
|
414
428
|
cidrv6: () => cidrv62,
|
|
415
429
|
cidrv4: () => cidrv42,
|
|
@@ -421,6 +435,7 @@ __export(exports_external, {
|
|
|
421
435
|
base64: () => base642,
|
|
422
436
|
array: () => array,
|
|
423
437
|
any: () => any,
|
|
438
|
+
_function: () => _function,
|
|
424
439
|
_default: () => _default2,
|
|
425
440
|
_ZodString: () => _ZodString,
|
|
426
441
|
ZodXID: () => ZodXID,
|
|
@@ -470,6 +485,8 @@ __export(exports_external, {
|
|
|
470
485
|
ZodIPv6: () => ZodIPv6,
|
|
471
486
|
ZodIPv4: () => ZodIPv4,
|
|
472
487
|
ZodGUID: () => ZodGUID,
|
|
488
|
+
ZodFunction: () => ZodFunction,
|
|
489
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
473
490
|
ZodFile: () => ZodFile,
|
|
474
491
|
ZodError: () => ZodError,
|
|
475
492
|
ZodEnum: () => ZodEnum,
|
|
@@ -481,6 +498,7 @@ __export(exports_external, {
|
|
|
481
498
|
ZodDate: () => ZodDate,
|
|
482
499
|
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
483
500
|
ZodCustom: () => ZodCustom,
|
|
501
|
+
ZodCodec: () => ZodCodec,
|
|
484
502
|
ZodCatch: () => ZodCatch,
|
|
485
503
|
ZodCUID2: () => ZodCUID2,
|
|
486
504
|
ZodCUID: () => ZodCUID,
|
|
@@ -510,6 +528,10 @@ __export(exports_core2, {
|
|
|
510
528
|
toDotPath: () => toDotPath,
|
|
511
529
|
safeParseAsync: () => safeParseAsync,
|
|
512
530
|
safeParse: () => safeParse,
|
|
531
|
+
safeEncodeAsync: () => safeEncodeAsync,
|
|
532
|
+
safeEncode: () => safeEncode,
|
|
533
|
+
safeDecodeAsync: () => safeDecodeAsync,
|
|
534
|
+
safeDecode: () => safeDecode,
|
|
513
535
|
registry: () => registry,
|
|
514
536
|
regexes: () => exports_regexes,
|
|
515
537
|
prettifyError: () => prettifyError,
|
|
@@ -521,9 +543,12 @@ __export(exports_core2, {
|
|
|
521
543
|
isValidBase64: () => isValidBase64,
|
|
522
544
|
globalRegistry: () => globalRegistry,
|
|
523
545
|
globalConfig: () => globalConfig,
|
|
524
|
-
function: () => _function,
|
|
525
546
|
formatError: () => formatError,
|
|
526
547
|
flattenError: () => flattenError,
|
|
548
|
+
encodeAsync: () => encodeAsync,
|
|
549
|
+
encode: () => encode,
|
|
550
|
+
decodeAsync: () => decodeAsync,
|
|
551
|
+
decode: () => decode,
|
|
527
552
|
config: () => config,
|
|
528
553
|
clone: () => clone,
|
|
529
554
|
_xid: () => _xid,
|
|
@@ -547,6 +572,7 @@ __export(exports_core2, {
|
|
|
547
572
|
_toLowerCase: () => _toLowerCase,
|
|
548
573
|
_templateLiteral: () => _templateLiteral,
|
|
549
574
|
_symbol: () => _symbol,
|
|
575
|
+
_superRefine: () => _superRefine,
|
|
550
576
|
_success: () => _success,
|
|
551
577
|
_stringbool: () => _stringbool,
|
|
552
578
|
_stringFormat: () => _stringFormat,
|
|
@@ -556,6 +582,10 @@ __export(exports_core2, {
|
|
|
556
582
|
_set: () => _set,
|
|
557
583
|
_safeParseAsync: () => _safeParseAsync,
|
|
558
584
|
_safeParse: () => _safeParse,
|
|
585
|
+
_safeEncodeAsync: () => _safeEncodeAsync,
|
|
586
|
+
_safeEncode: () => _safeEncode,
|
|
587
|
+
_safeDecodeAsync: () => _safeDecodeAsync,
|
|
588
|
+
_safeDecode: () => _safeDecode,
|
|
559
589
|
_regex: () => _regex,
|
|
560
590
|
_refine: () => _refine,
|
|
561
591
|
_record: () => _record,
|
|
@@ -616,11 +646,15 @@ __export(exports_core2, {
|
|
|
616
646
|
_file: () => _file,
|
|
617
647
|
_enum: () => _enum,
|
|
618
648
|
_endsWith: () => _endsWith,
|
|
649
|
+
_encodeAsync: () => _encodeAsync,
|
|
650
|
+
_encode: () => _encode,
|
|
619
651
|
_emoji: () => _emoji2,
|
|
620
652
|
_email: () => _email,
|
|
621
653
|
_e164: () => _e164,
|
|
622
654
|
_discriminatedUnion: () => _discriminatedUnion,
|
|
623
655
|
_default: () => _default,
|
|
656
|
+
_decodeAsync: () => _decodeAsync,
|
|
657
|
+
_decode: () => _decode,
|
|
624
658
|
_date: () => _date,
|
|
625
659
|
_custom: () => _custom,
|
|
626
660
|
_cuid2: () => _cuid2,
|
|
@@ -632,6 +666,7 @@ __export(exports_core2, {
|
|
|
632
666
|
_coercedBigint: () => _coercedBigint,
|
|
633
667
|
_cidrv6: () => _cidrv6,
|
|
634
668
|
_cidrv4: () => _cidrv4,
|
|
669
|
+
_check: () => _check,
|
|
635
670
|
_catch: () => _catch,
|
|
636
671
|
_boolean: () => _boolean,
|
|
637
672
|
_bigint: () => _bigint,
|
|
@@ -673,6 +708,7 @@ __export(exports_core2, {
|
|
|
673
708
|
$ZodPrefault: () => $ZodPrefault,
|
|
674
709
|
$ZodPipe: () => $ZodPipe,
|
|
675
710
|
$ZodOptional: () => $ZodOptional,
|
|
711
|
+
$ZodObjectJIT: () => $ZodObjectJIT,
|
|
676
712
|
$ZodObject: () => $ZodObject,
|
|
677
713
|
$ZodNumberFormat: () => $ZodNumberFormat,
|
|
678
714
|
$ZodNumber: () => $ZodNumber,
|
|
@@ -699,6 +735,7 @@ __export(exports_core2, {
|
|
|
699
735
|
$ZodFile: () => $ZodFile,
|
|
700
736
|
$ZodError: () => $ZodError,
|
|
701
737
|
$ZodEnum: () => $ZodEnum,
|
|
738
|
+
$ZodEncodeError: () => $ZodEncodeError,
|
|
702
739
|
$ZodEmoji: () => $ZodEmoji,
|
|
703
740
|
$ZodEmail: () => $ZodEmail,
|
|
704
741
|
$ZodE164: () => $ZodE164,
|
|
@@ -707,6 +744,7 @@ __export(exports_core2, {
|
|
|
707
744
|
$ZodDate: () => $ZodDate,
|
|
708
745
|
$ZodCustomStringFormat: () => $ZodCustomStringFormat,
|
|
709
746
|
$ZodCustom: () => $ZodCustom,
|
|
747
|
+
$ZodCodec: () => $ZodCodec,
|
|
710
748
|
$ZodCheckUpperCase: () => $ZodCheckUpperCase,
|
|
711
749
|
$ZodCheckStringFormat: () => $ZodCheckStringFormat,
|
|
712
750
|
$ZodCheckStartsWith: () => $ZodCheckStartsWith,
|
|
@@ -798,6 +836,13 @@ class $ZodAsyncError extends Error {
|
|
|
798
836
|
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
799
837
|
}
|
|
800
838
|
}
|
|
839
|
+
|
|
840
|
+
class $ZodEncodeError extends Error {
|
|
841
|
+
constructor(name) {
|
|
842
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
843
|
+
this.name = "ZodEncodeError";
|
|
844
|
+
}
|
|
845
|
+
}
|
|
801
846
|
var globalConfig = {};
|
|
802
847
|
function config(newConfig) {
|
|
803
848
|
if (newConfig)
|
|
@@ -808,7 +853,12 @@ function config(newConfig) {
|
|
|
808
853
|
var exports_util = {};
|
|
809
854
|
__export(exports_util, {
|
|
810
855
|
unwrapMessage: () => unwrapMessage,
|
|
856
|
+
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
857
|
+
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
858
|
+
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
811
859
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
860
|
+
shallowClone: () => shallowClone,
|
|
861
|
+
safeExtend: () => safeExtend,
|
|
812
862
|
required: () => required,
|
|
813
863
|
randomString: () => randomString,
|
|
814
864
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
@@ -819,15 +869,18 @@ __export(exports_util, {
|
|
|
819
869
|
partial: () => partial,
|
|
820
870
|
optionalKeys: () => optionalKeys,
|
|
821
871
|
omit: () => omit,
|
|
872
|
+
objectClone: () => objectClone,
|
|
822
873
|
numKeys: () => numKeys,
|
|
823
874
|
nullish: () => nullish,
|
|
824
875
|
normalizeParams: () => normalizeParams,
|
|
876
|
+
mergeDefs: () => mergeDefs,
|
|
825
877
|
merge: () => merge,
|
|
826
878
|
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
827
879
|
joinValues: () => joinValues,
|
|
828
880
|
issue: () => issue,
|
|
829
881
|
isPlainObject: () => isPlainObject,
|
|
830
882
|
isObject: () => isObject,
|
|
883
|
+
hexToUint8Array: () => hexToUint8Array,
|
|
831
884
|
getSizableOrigin: () => getSizableOrigin,
|
|
832
885
|
getParsedType: () => getParsedType,
|
|
833
886
|
getLengthableOrigin: () => getLengthableOrigin,
|
|
@@ -840,11 +893,14 @@ __export(exports_util, {
|
|
|
840
893
|
esc: () => esc,
|
|
841
894
|
defineLazy: () => defineLazy,
|
|
842
895
|
createTransparentProxy: () => createTransparentProxy,
|
|
896
|
+
cloneDef: () => cloneDef,
|
|
843
897
|
clone: () => clone,
|
|
844
898
|
cleanRegex: () => cleanRegex,
|
|
845
899
|
cleanEnum: () => cleanEnum,
|
|
846
900
|
captureStackTrace: () => captureStackTrace,
|
|
847
901
|
cached: () => cached,
|
|
902
|
+
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
903
|
+
base64ToUint8Array: () => base64ToUint8Array,
|
|
848
904
|
assignProp: () => assignProp,
|
|
849
905
|
assertNotEqual: () => assertNotEqual,
|
|
850
906
|
assertNever: () => assertNever,
|
|
@@ -904,22 +960,32 @@ function cleanRegex(source) {
|
|
|
904
960
|
}
|
|
905
961
|
function floatSafeRemainder(val, step) {
|
|
906
962
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
907
|
-
const
|
|
963
|
+
const stepString = step.toString();
|
|
964
|
+
let stepDecCount = (stepString.split(".")[1] || "").length;
|
|
965
|
+
if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
|
|
966
|
+
const match = stepString.match(/\d?e-(\d?)/);
|
|
967
|
+
if (match?.[1]) {
|
|
968
|
+
stepDecCount = Number.parseInt(match[1]);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
908
971
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
909
972
|
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
910
973
|
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
911
974
|
return valInt % stepInt / 10 ** decCount;
|
|
912
975
|
}
|
|
976
|
+
var EVALUATING = Symbol("evaluating");
|
|
913
977
|
function defineLazy(object, key, getter) {
|
|
914
|
-
|
|
978
|
+
let value = undefined;
|
|
915
979
|
Object.defineProperty(object, key, {
|
|
916
980
|
get() {
|
|
917
|
-
if (
|
|
918
|
-
|
|
919
|
-
object[key] = value;
|
|
920
|
-
return value;
|
|
981
|
+
if (value === EVALUATING) {
|
|
982
|
+
return;
|
|
921
983
|
}
|
|
922
|
-
|
|
984
|
+
if (value === undefined) {
|
|
985
|
+
value = EVALUATING;
|
|
986
|
+
value = getter();
|
|
987
|
+
}
|
|
988
|
+
return value;
|
|
923
989
|
},
|
|
924
990
|
set(v) {
|
|
925
991
|
Object.defineProperty(object, key, {
|
|
@@ -929,6 +995,9 @@ function defineLazy(object, key, getter) {
|
|
|
929
995
|
configurable: true
|
|
930
996
|
});
|
|
931
997
|
}
|
|
998
|
+
function objectClone(obj) {
|
|
999
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
1000
|
+
}
|
|
932
1001
|
function assignProp(target, prop, value) {
|
|
933
1002
|
Object.defineProperty(target, prop, {
|
|
934
1003
|
value,
|
|
@@ -937,6 +1006,17 @@ function assignProp(target, prop, value) {
|
|
|
937
1006
|
configurable: true
|
|
938
1007
|
});
|
|
939
1008
|
}
|
|
1009
|
+
function mergeDefs(...defs) {
|
|
1010
|
+
const mergedDescriptors = {};
|
|
1011
|
+
for (const def of defs) {
|
|
1012
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
1013
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
1014
|
+
}
|
|
1015
|
+
return Object.defineProperties({}, mergedDescriptors);
|
|
1016
|
+
}
|
|
1017
|
+
function cloneDef(schema) {
|
|
1018
|
+
return mergeDefs(schema._zod.def);
|
|
1019
|
+
}
|
|
940
1020
|
function getElementAtPath(obj, path) {
|
|
941
1021
|
if (!path)
|
|
942
1022
|
return obj;
|
|
@@ -964,7 +1044,7 @@ function randomString(length = 10) {
|
|
|
964
1044
|
function esc(str) {
|
|
965
1045
|
return JSON.stringify(str);
|
|
966
1046
|
}
|
|
967
|
-
var captureStackTrace =
|
|
1047
|
+
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
968
1048
|
function isObject(data) {
|
|
969
1049
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
970
1050
|
}
|
|
@@ -994,6 +1074,13 @@ function isPlainObject(o) {
|
|
|
994
1074
|
}
|
|
995
1075
|
return true;
|
|
996
1076
|
}
|
|
1077
|
+
function shallowClone(o) {
|
|
1078
|
+
if (isPlainObject(o))
|
|
1079
|
+
return { ...o };
|
|
1080
|
+
if (Array.isArray(o))
|
|
1081
|
+
return [...o];
|
|
1082
|
+
return o;
|
|
1083
|
+
}
|
|
997
1084
|
function numKeys(data) {
|
|
998
1085
|
let keyCount = 0;
|
|
999
1086
|
for (const key in data) {
|
|
@@ -1131,43 +1218,68 @@ var BIGINT_FORMAT_RANGES = {
|
|
|
1131
1218
|
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
1132
1219
|
};
|
|
1133
1220
|
function pick(schema, mask) {
|
|
1134
|
-
const newShape = {};
|
|
1135
1221
|
const currDef = schema._zod.def;
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1222
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1223
|
+
get shape() {
|
|
1224
|
+
const newShape = {};
|
|
1225
|
+
for (const key in mask) {
|
|
1226
|
+
if (!(key in currDef.shape)) {
|
|
1227
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1228
|
+
}
|
|
1229
|
+
if (!mask[key])
|
|
1230
|
+
continue;
|
|
1231
|
+
newShape[key] = currDef.shape[key];
|
|
1232
|
+
}
|
|
1233
|
+
assignProp(this, "shape", newShape);
|
|
1234
|
+
return newShape;
|
|
1235
|
+
},
|
|
1147
1236
|
checks: []
|
|
1148
1237
|
});
|
|
1238
|
+
return clone(schema, def);
|
|
1149
1239
|
}
|
|
1150
1240
|
function omit(schema, mask) {
|
|
1151
|
-
const newShape = { ...schema._zod.def.shape };
|
|
1152
1241
|
const currDef = schema._zod.def;
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1242
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1243
|
+
get shape() {
|
|
1244
|
+
const newShape = { ...schema._zod.def.shape };
|
|
1245
|
+
for (const key in mask) {
|
|
1246
|
+
if (!(key in currDef.shape)) {
|
|
1247
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1248
|
+
}
|
|
1249
|
+
if (!mask[key])
|
|
1250
|
+
continue;
|
|
1251
|
+
delete newShape[key];
|
|
1252
|
+
}
|
|
1253
|
+
assignProp(this, "shape", newShape);
|
|
1254
|
+
return newShape;
|
|
1255
|
+
},
|
|
1164
1256
|
checks: []
|
|
1165
1257
|
});
|
|
1258
|
+
return clone(schema, def);
|
|
1166
1259
|
}
|
|
1167
1260
|
function extend(schema, shape) {
|
|
1168
1261
|
if (!isPlainObject(shape)) {
|
|
1169
1262
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
1170
1263
|
}
|
|
1264
|
+
const checks = schema._zod.def.checks;
|
|
1265
|
+
const hasChecks = checks && checks.length > 0;
|
|
1266
|
+
if (hasChecks) {
|
|
1267
|
+
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
1268
|
+
}
|
|
1269
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1270
|
+
get shape() {
|
|
1271
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1272
|
+
assignProp(this, "shape", _shape);
|
|
1273
|
+
return _shape;
|
|
1274
|
+
},
|
|
1275
|
+
checks: []
|
|
1276
|
+
});
|
|
1277
|
+
return clone(schema, def);
|
|
1278
|
+
}
|
|
1279
|
+
function safeExtend(schema, shape) {
|
|
1280
|
+
if (!isPlainObject(shape)) {
|
|
1281
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1282
|
+
}
|
|
1171
1283
|
const def = {
|
|
1172
1284
|
...schema._zod.def,
|
|
1173
1285
|
get shape() {
|
|
@@ -1175,84 +1287,95 @@ function extend(schema, shape) {
|
|
|
1175
1287
|
assignProp(this, "shape", _shape);
|
|
1176
1288
|
return _shape;
|
|
1177
1289
|
},
|
|
1178
|
-
checks:
|
|
1290
|
+
checks: schema._zod.def.checks
|
|
1179
1291
|
};
|
|
1180
1292
|
return clone(schema, def);
|
|
1181
1293
|
}
|
|
1182
1294
|
function merge(a, b) {
|
|
1183
|
-
|
|
1184
|
-
...a._zod.def,
|
|
1295
|
+
const def = mergeDefs(a._zod.def, {
|
|
1185
1296
|
get shape() {
|
|
1186
1297
|
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
1187
1298
|
assignProp(this, "shape", _shape);
|
|
1188
1299
|
return _shape;
|
|
1189
1300
|
},
|
|
1190
|
-
catchall
|
|
1301
|
+
get catchall() {
|
|
1302
|
+
return b._zod.def.catchall;
|
|
1303
|
+
},
|
|
1191
1304
|
checks: []
|
|
1192
1305
|
});
|
|
1306
|
+
return clone(a, def);
|
|
1193
1307
|
}
|
|
1194
1308
|
function partial(Class, schema, mask) {
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
if (
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1309
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1310
|
+
get shape() {
|
|
1311
|
+
const oldShape = schema._zod.def.shape;
|
|
1312
|
+
const shape = { ...oldShape };
|
|
1313
|
+
if (mask) {
|
|
1314
|
+
for (const key in mask) {
|
|
1315
|
+
if (!(key in oldShape)) {
|
|
1316
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1317
|
+
}
|
|
1318
|
+
if (!mask[key])
|
|
1319
|
+
continue;
|
|
1320
|
+
shape[key] = Class ? new Class({
|
|
1321
|
+
type: "optional",
|
|
1322
|
+
innerType: oldShape[key]
|
|
1323
|
+
}) : oldShape[key];
|
|
1324
|
+
}
|
|
1325
|
+
} else {
|
|
1326
|
+
for (const key in oldShape) {
|
|
1327
|
+
shape[key] = Class ? new Class({
|
|
1328
|
+
type: "optional",
|
|
1329
|
+
innerType: oldShape[key]
|
|
1330
|
+
}) : oldShape[key];
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
assignProp(this, "shape", shape);
|
|
1334
|
+
return shape;
|
|
1335
|
+
},
|
|
1220
1336
|
checks: []
|
|
1221
1337
|
});
|
|
1338
|
+
return clone(schema, def);
|
|
1222
1339
|
}
|
|
1223
1340
|
function required(Class, schema, mask) {
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
if (
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1341
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1342
|
+
get shape() {
|
|
1343
|
+
const oldShape = schema._zod.def.shape;
|
|
1344
|
+
const shape = { ...oldShape };
|
|
1345
|
+
if (mask) {
|
|
1346
|
+
for (const key in mask) {
|
|
1347
|
+
if (!(key in shape)) {
|
|
1348
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1349
|
+
}
|
|
1350
|
+
if (!mask[key])
|
|
1351
|
+
continue;
|
|
1352
|
+
shape[key] = new Class({
|
|
1353
|
+
type: "nonoptional",
|
|
1354
|
+
innerType: oldShape[key]
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
} else {
|
|
1358
|
+
for (const key in oldShape) {
|
|
1359
|
+
shape[key] = new Class({
|
|
1360
|
+
type: "nonoptional",
|
|
1361
|
+
innerType: oldShape[key]
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
assignProp(this, "shape", shape);
|
|
1366
|
+
return shape;
|
|
1367
|
+
},
|
|
1249
1368
|
checks: []
|
|
1250
1369
|
});
|
|
1370
|
+
return clone(schema, def);
|
|
1251
1371
|
}
|
|
1252
1372
|
function aborted(x, startIndex = 0) {
|
|
1373
|
+
if (x.aborted === true)
|
|
1374
|
+
return true;
|
|
1253
1375
|
for (let i = startIndex;i < x.issues.length; i++) {
|
|
1254
|
-
if (x.issues[i]?.continue !== true)
|
|
1376
|
+
if (x.issues[i]?.continue !== true) {
|
|
1255
1377
|
return true;
|
|
1378
|
+
}
|
|
1256
1379
|
}
|
|
1257
1380
|
return false;
|
|
1258
1381
|
}
|
|
@@ -1313,6 +1436,43 @@ function cleanEnum(obj) {
|
|
|
1313
1436
|
return Number.isNaN(Number.parseInt(k, 10));
|
|
1314
1437
|
}).map((el) => el[1]);
|
|
1315
1438
|
}
|
|
1439
|
+
function base64ToUint8Array(base64) {
|
|
1440
|
+
const binaryString = atob(base64);
|
|
1441
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
1442
|
+
for (let i = 0;i < binaryString.length; i++) {
|
|
1443
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
1444
|
+
}
|
|
1445
|
+
return bytes;
|
|
1446
|
+
}
|
|
1447
|
+
function uint8ArrayToBase64(bytes) {
|
|
1448
|
+
let binaryString = "";
|
|
1449
|
+
for (let i = 0;i < bytes.length; i++) {
|
|
1450
|
+
binaryString += String.fromCharCode(bytes[i]);
|
|
1451
|
+
}
|
|
1452
|
+
return btoa(binaryString);
|
|
1453
|
+
}
|
|
1454
|
+
function base64urlToUint8Array(base64url) {
|
|
1455
|
+
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
|
|
1456
|
+
const padding = "=".repeat((4 - base64.length % 4) % 4);
|
|
1457
|
+
return base64ToUint8Array(base64 + padding);
|
|
1458
|
+
}
|
|
1459
|
+
function uint8ArrayToBase64url(bytes) {
|
|
1460
|
+
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1461
|
+
}
|
|
1462
|
+
function hexToUint8Array(hex) {
|
|
1463
|
+
const cleanHex = hex.replace(/^0x/, "");
|
|
1464
|
+
if (cleanHex.length % 2 !== 0) {
|
|
1465
|
+
throw new Error("Invalid hex string length");
|
|
1466
|
+
}
|
|
1467
|
+
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
1468
|
+
for (let i = 0;i < cleanHex.length; i += 2) {
|
|
1469
|
+
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
1470
|
+
}
|
|
1471
|
+
return bytes;
|
|
1472
|
+
}
|
|
1473
|
+
function uint8ArrayToHex(bytes) {
|
|
1474
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1475
|
+
}
|
|
1316
1476
|
|
|
1317
1477
|
class Class {
|
|
1318
1478
|
constructor(..._args) {}
|
|
@@ -1329,12 +1489,7 @@ var initializer = (inst, def) => {
|
|
|
1329
1489
|
value: def,
|
|
1330
1490
|
enumerable: false
|
|
1331
1491
|
});
|
|
1332
|
-
|
|
1333
|
-
get() {
|
|
1334
|
-
return JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
1335
|
-
},
|
|
1336
|
-
enumerable: true
|
|
1337
|
-
});
|
|
1492
|
+
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
1338
1493
|
Object.defineProperty(inst, "toString", {
|
|
1339
1494
|
value: () => inst.message,
|
|
1340
1495
|
enumerable: false
|
|
@@ -1436,8 +1591,9 @@ function treeifyError(error, _mapper) {
|
|
|
1436
1591
|
processError(error);
|
|
1437
1592
|
return result;
|
|
1438
1593
|
}
|
|
1439
|
-
function toDotPath(
|
|
1594
|
+
function toDotPath(_path) {
|
|
1440
1595
|
const segs = [];
|
|
1596
|
+
const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1441
1597
|
for (const seg of path) {
|
|
1442
1598
|
if (typeof seg === "number")
|
|
1443
1599
|
segs.push(`[${seg}]`);
|
|
@@ -1455,7 +1611,7 @@ function toDotPath(path) {
|
|
|
1455
1611
|
}
|
|
1456
1612
|
function prettifyError(error) {
|
|
1457
1613
|
const lines = [];
|
|
1458
|
-
const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);
|
|
1614
|
+
const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
1459
1615
|
for (const issue2 of issues) {
|
|
1460
1616
|
lines.push(`✖ ${issue2.message}`);
|
|
1461
1617
|
if (issue2.path?.length)
|
|
@@ -1516,6 +1672,42 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1516
1672
|
} : { success: true, data: result.value };
|
|
1517
1673
|
};
|
|
1518
1674
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
1675
|
+
var _encode = (_Err) => (schema, value, _ctx) => {
|
|
1676
|
+
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
1677
|
+
return _parse(_Err)(schema, value, ctx);
|
|
1678
|
+
};
|
|
1679
|
+
var encode = /* @__PURE__ */ _encode($ZodRealError);
|
|
1680
|
+
var _decode = (_Err) => (schema, value, _ctx) => {
|
|
1681
|
+
return _parse(_Err)(schema, value, _ctx);
|
|
1682
|
+
};
|
|
1683
|
+
var decode = /* @__PURE__ */ _decode($ZodRealError);
|
|
1684
|
+
var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1685
|
+
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
1686
|
+
return _parseAsync(_Err)(schema, value, ctx);
|
|
1687
|
+
};
|
|
1688
|
+
var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
|
|
1689
|
+
var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1690
|
+
return _parseAsync(_Err)(schema, value, _ctx);
|
|
1691
|
+
};
|
|
1692
|
+
var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
|
|
1693
|
+
var _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
1694
|
+
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
1695
|
+
return _safeParse(_Err)(schema, value, ctx);
|
|
1696
|
+
};
|
|
1697
|
+
var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
|
|
1698
|
+
var _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
1699
|
+
return _safeParse(_Err)(schema, value, _ctx);
|
|
1700
|
+
};
|
|
1701
|
+
var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
|
|
1702
|
+
var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1703
|
+
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
1704
|
+
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
1705
|
+
};
|
|
1706
|
+
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
|
|
1707
|
+
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1708
|
+
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1709
|
+
};
|
|
1710
|
+
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
1519
1711
|
// ../../node_modules/zod/v4/core/regexes.js
|
|
1520
1712
|
var exports_regexes = {};
|
|
1521
1713
|
__export(exports_regexes, {
|
|
@@ -1530,17 +1722,34 @@ __export(exports_regexes, {
|
|
|
1530
1722
|
ulid: () => ulid,
|
|
1531
1723
|
time: () => time,
|
|
1532
1724
|
string: () => string,
|
|
1725
|
+
sha512_hex: () => sha512_hex,
|
|
1726
|
+
sha512_base64url: () => sha512_base64url,
|
|
1727
|
+
sha512_base64: () => sha512_base64,
|
|
1728
|
+
sha384_hex: () => sha384_hex,
|
|
1729
|
+
sha384_base64url: () => sha384_base64url,
|
|
1730
|
+
sha384_base64: () => sha384_base64,
|
|
1731
|
+
sha256_hex: () => sha256_hex,
|
|
1732
|
+
sha256_base64url: () => sha256_base64url,
|
|
1733
|
+
sha256_base64: () => sha256_base64,
|
|
1734
|
+
sha1_hex: () => sha1_hex,
|
|
1735
|
+
sha1_base64url: () => sha1_base64url,
|
|
1736
|
+
sha1_base64: () => sha1_base64,
|
|
1533
1737
|
rfc5322Email: () => rfc5322Email,
|
|
1534
1738
|
number: () => number,
|
|
1535
1739
|
null: () => _null,
|
|
1536
1740
|
nanoid: () => nanoid,
|
|
1741
|
+
md5_hex: () => md5_hex,
|
|
1742
|
+
md5_base64url: () => md5_base64url,
|
|
1743
|
+
md5_base64: () => md5_base64,
|
|
1537
1744
|
lowercase: () => lowercase,
|
|
1538
1745
|
ksuid: () => ksuid,
|
|
1539
1746
|
ipv6: () => ipv6,
|
|
1540
1747
|
ipv4: () => ipv4,
|
|
1541
1748
|
integer: () => integer,
|
|
1749
|
+
idnEmail: () => idnEmail,
|
|
1542
1750
|
html5Email: () => html5Email,
|
|
1543
1751
|
hostname: () => hostname,
|
|
1752
|
+
hex: () => hex,
|
|
1544
1753
|
guid: () => guid,
|
|
1545
1754
|
extendedDuration: () => extendedDuration,
|
|
1546
1755
|
emoji: () => emoji,
|
|
@@ -1558,8 +1767,7 @@ __export(exports_regexes, {
|
|
|
1558
1767
|
boolean: () => boolean,
|
|
1559
1768
|
bigint: () => bigint,
|
|
1560
1769
|
base64url: () => base64url,
|
|
1561
|
-
base64: () => base64
|
|
1562
|
-
_emoji: () => _emoji
|
|
1770
|
+
base64: () => base64
|
|
1563
1771
|
});
|
|
1564
1772
|
var cuid = /^[cC][^\s-]{8,}$/;
|
|
1565
1773
|
var cuid2 = /^[0-9a-z]+$/;
|
|
@@ -1572,7 +1780,7 @@ var extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(
|
|
|
1572
1780
|
var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
1573
1781
|
var uuid = (version) => {
|
|
1574
1782
|
if (!version)
|
|
1575
|
-
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
|
|
1783
|
+
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
1576
1784
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
1577
1785
|
};
|
|
1578
1786
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
@@ -1582,18 +1790,19 @@ var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A
|
|
|
1582
1790
|
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])?)*$/;
|
|
1583
1791
|
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,}))$/;
|
|
1584
1792
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
1793
|
+
var idnEmail = unicodeEmail;
|
|
1585
1794
|
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])?)*$/;
|
|
1586
1795
|
var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
1587
1796
|
function emoji() {
|
|
1588
1797
|
return new RegExp(_emoji, "u");
|
|
1589
1798
|
}
|
|
1590
1799
|
var ipv4 = /^(?:(?: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])$/;
|
|
1591
|
-
var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}
|
|
1800
|
+
var ipv6 = /^(([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}|:))$/;
|
|
1592
1801
|
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])$/;
|
|
1593
1802
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
1594
1803
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
1595
1804
|
var base64url = /^[A-Za-z0-9_-]*$/;
|
|
1596
|
-
var hostname = /^([a-zA-Z0-9-]
|
|
1805
|
+
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])?)*\.?$/;
|
|
1597
1806
|
var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
1598
1807
|
var e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
1599
1808
|
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])))`;
|
|
@@ -1612,7 +1821,7 @@ function datetime(args) {
|
|
|
1612
1821
|
if (args.local)
|
|
1613
1822
|
opts.push("");
|
|
1614
1823
|
if (args.offset)
|
|
1615
|
-
opts.push(`([+-]\\d
|
|
1824
|
+
opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
1616
1825
|
const timeRegex = `${time2}(?:${opts.join("|")})`;
|
|
1617
1826
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
1618
1827
|
}
|
|
@@ -1620,14 +1829,36 @@ var string = (params) => {
|
|
|
1620
1829
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
1621
1830
|
return new RegExp(`^${regex}$`);
|
|
1622
1831
|
};
|
|
1623
|
-
var bigint =
|
|
1624
|
-
var integer =
|
|
1625
|
-
var number = /^-?\d+(?:\.\d+)
|
|
1626
|
-
var boolean =
|
|
1627
|
-
var _null =
|
|
1628
|
-
var _undefined =
|
|
1832
|
+
var bigint = /^-?\d+n?$/;
|
|
1833
|
+
var integer = /^-?\d+$/;
|
|
1834
|
+
var number = /^-?\d+(?:\.\d+)?/;
|
|
1835
|
+
var boolean = /^(?:true|false)$/i;
|
|
1836
|
+
var _null = /^null$/i;
|
|
1837
|
+
var _undefined = /^undefined$/i;
|
|
1629
1838
|
var lowercase = /^[^A-Z]*$/;
|
|
1630
1839
|
var uppercase = /^[^a-z]*$/;
|
|
1840
|
+
var hex = /^[0-9a-fA-F]*$/;
|
|
1841
|
+
function fixedBase64(bodyLength, padding) {
|
|
1842
|
+
return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);
|
|
1843
|
+
}
|
|
1844
|
+
function fixedBase64url(length) {
|
|
1845
|
+
return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);
|
|
1846
|
+
}
|
|
1847
|
+
var md5_hex = /^[0-9a-fA-F]{32}$/;
|
|
1848
|
+
var md5_base64 = /* @__PURE__ */ fixedBase64(22, "==");
|
|
1849
|
+
var md5_base64url = /* @__PURE__ */ fixedBase64url(22);
|
|
1850
|
+
var sha1_hex = /^[0-9a-fA-F]{40}$/;
|
|
1851
|
+
var sha1_base64 = /* @__PURE__ */ fixedBase64(27, "=");
|
|
1852
|
+
var sha1_base64url = /* @__PURE__ */ fixedBase64url(27);
|
|
1853
|
+
var sha256_hex = /^[0-9a-fA-F]{64}$/;
|
|
1854
|
+
var sha256_base64 = /* @__PURE__ */ fixedBase64(43, "=");
|
|
1855
|
+
var sha256_base64url = /* @__PURE__ */ fixedBase64url(43);
|
|
1856
|
+
var sha384_hex = /^[0-9a-fA-F]{96}$/;
|
|
1857
|
+
var sha384_base64 = /* @__PURE__ */ fixedBase64(64, "");
|
|
1858
|
+
var sha384_base64url = /* @__PURE__ */ fixedBase64url(64);
|
|
1859
|
+
var sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
1860
|
+
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
|
|
1861
|
+
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
1631
1862
|
|
|
1632
1863
|
// ../../node_modules/zod/v4/core/checks.js
|
|
1633
1864
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
@@ -1741,6 +1972,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
1741
1972
|
expected: origin,
|
|
1742
1973
|
format: def.format,
|
|
1743
1974
|
code: "invalid_type",
|
|
1975
|
+
continue: false,
|
|
1744
1976
|
input,
|
|
1745
1977
|
inst
|
|
1746
1978
|
});
|
|
@@ -1847,6 +2079,7 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
1847
2079
|
origin: getSizableOrigin(input),
|
|
1848
2080
|
code: "too_big",
|
|
1849
2081
|
maximum: def.maximum,
|
|
2082
|
+
inclusive: true,
|
|
1850
2083
|
input,
|
|
1851
2084
|
inst,
|
|
1852
2085
|
continue: !def.abort
|
|
@@ -1874,6 +2107,7 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
1874
2107
|
origin: getSizableOrigin(input),
|
|
1875
2108
|
code: "too_small",
|
|
1876
2109
|
minimum: def.minimum,
|
|
2110
|
+
inclusive: true,
|
|
1877
2111
|
input,
|
|
1878
2112
|
inst,
|
|
1879
2113
|
continue: !def.abort
|
|
@@ -2155,7 +2389,8 @@ var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst,
|
|
|
2155
2389
|
code: "invalid_value",
|
|
2156
2390
|
values: def.mime,
|
|
2157
2391
|
input: payload.value.type,
|
|
2158
|
-
inst
|
|
2392
|
+
inst,
|
|
2393
|
+
continue: !def.abort
|
|
2159
2394
|
});
|
|
2160
2395
|
};
|
|
2161
2396
|
});
|
|
@@ -2207,8 +2442,8 @@ class Doc {
|
|
|
2207
2442
|
// ../../node_modules/zod/v4/core/versions.js
|
|
2208
2443
|
var version = {
|
|
2209
2444
|
major: 4,
|
|
2210
|
-
minor:
|
|
2211
|
-
patch:
|
|
2445
|
+
minor: 1,
|
|
2446
|
+
patch: 11
|
|
2212
2447
|
};
|
|
2213
2448
|
|
|
2214
2449
|
// ../../node_modules/zod/v4/core/schemas.js
|
|
@@ -2273,7 +2508,32 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
2273
2508
|
}
|
|
2274
2509
|
return payload;
|
|
2275
2510
|
};
|
|
2511
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
2512
|
+
if (aborted(canary)) {
|
|
2513
|
+
canary.aborted = true;
|
|
2514
|
+
return canary;
|
|
2515
|
+
}
|
|
2516
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
2517
|
+
if (checkResult instanceof Promise) {
|
|
2518
|
+
if (ctx.async === false)
|
|
2519
|
+
throw new $ZodAsyncError;
|
|
2520
|
+
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
2521
|
+
}
|
|
2522
|
+
return inst._zod.parse(checkResult, ctx);
|
|
2523
|
+
};
|
|
2276
2524
|
inst._zod.run = (payload, ctx) => {
|
|
2525
|
+
if (ctx.skipChecks) {
|
|
2526
|
+
return inst._zod.parse(payload, ctx);
|
|
2527
|
+
}
|
|
2528
|
+
if (ctx.direction === "backward") {
|
|
2529
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
2530
|
+
if (canary instanceof Promise) {
|
|
2531
|
+
return canary.then((canary2) => {
|
|
2532
|
+
return handleCanaryResult(canary2, payload, ctx);
|
|
2533
|
+
});
|
|
2534
|
+
}
|
|
2535
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
2536
|
+
}
|
|
2277
2537
|
const result = inst._zod.parse(payload, ctx);
|
|
2278
2538
|
if (result instanceof Promise) {
|
|
2279
2539
|
if (ctx.async === false)
|
|
@@ -2351,9 +2611,8 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
2351
2611
|
$ZodStringFormat.init(inst, def);
|
|
2352
2612
|
inst._zod.check = (payload) => {
|
|
2353
2613
|
try {
|
|
2354
|
-
const
|
|
2355
|
-
const url = new URL(
|
|
2356
|
-
const href = url.href;
|
|
2614
|
+
const trimmed = payload.value.trim();
|
|
2615
|
+
const url = new URL(trimmed);
|
|
2357
2616
|
if (def.hostname) {
|
|
2358
2617
|
def.hostname.lastIndex = 0;
|
|
2359
2618
|
if (!def.hostname.test(url.hostname)) {
|
|
@@ -2382,10 +2641,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
2382
2641
|
});
|
|
2383
2642
|
}
|
|
2384
2643
|
}
|
|
2385
|
-
if (
|
|
2386
|
-
payload.value = href
|
|
2644
|
+
if (def.normalize) {
|
|
2645
|
+
payload.value = url.href;
|
|
2387
2646
|
} else {
|
|
2388
|
-
payload.value =
|
|
2647
|
+
payload.value = trimmed;
|
|
2389
2648
|
}
|
|
2390
2649
|
return;
|
|
2391
2650
|
} catch (_) {
|
|
@@ -2480,8 +2739,11 @@ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
|
2480
2739
|
def.pattern ?? (def.pattern = cidrv6);
|
|
2481
2740
|
$ZodStringFormat.init(inst, def);
|
|
2482
2741
|
inst._zod.check = (payload) => {
|
|
2483
|
-
const
|
|
2742
|
+
const parts = payload.value.split("/");
|
|
2484
2743
|
try {
|
|
2744
|
+
if (parts.length !== 2)
|
|
2745
|
+
throw new Error;
|
|
2746
|
+
const [address, prefix] = parts;
|
|
2485
2747
|
if (!prefix)
|
|
2486
2748
|
throw new Error;
|
|
2487
2749
|
const prefixNum = Number(prefix);
|
|
@@ -2826,48 +3088,83 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2826
3088
|
return payload;
|
|
2827
3089
|
};
|
|
2828
3090
|
});
|
|
2829
|
-
function
|
|
3091
|
+
function handlePropertyResult(result, final, key, input) {
|
|
2830
3092
|
if (result.issues.length) {
|
|
2831
3093
|
final.issues.push(...prefixIssues(key, result.issues));
|
|
2832
3094
|
}
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
function handleOptionalObjectResult(result, final, key, input) {
|
|
2836
|
-
if (result.issues.length) {
|
|
2837
|
-
if (input[key] === undefined) {
|
|
2838
|
-
if (key in input) {
|
|
2839
|
-
final.value[key] = undefined;
|
|
2840
|
-
} else {
|
|
2841
|
-
final.value[key] = result.value;
|
|
2842
|
-
}
|
|
2843
|
-
} else {
|
|
2844
|
-
final.issues.push(...prefixIssues(key, result.issues));
|
|
2845
|
-
}
|
|
2846
|
-
} else if (result.value === undefined) {
|
|
2847
|
-
if (key in input)
|
|
3095
|
+
if (result.value === undefined) {
|
|
3096
|
+
if (key in input) {
|
|
2848
3097
|
final.value[key] = undefined;
|
|
3098
|
+
}
|
|
2849
3099
|
} else {
|
|
2850
3100
|
final.value[key] = result.value;
|
|
2851
3101
|
}
|
|
2852
3102
|
}
|
|
3103
|
+
function normalizeDef(def) {
|
|
3104
|
+
const keys = Object.keys(def.shape);
|
|
3105
|
+
for (const k of keys) {
|
|
3106
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
3107
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
const okeys = optionalKeys(def.shape);
|
|
3111
|
+
return {
|
|
3112
|
+
...def,
|
|
3113
|
+
keys,
|
|
3114
|
+
keySet: new Set(keys),
|
|
3115
|
+
numKeys: keys.length,
|
|
3116
|
+
optionalKeys: new Set(okeys)
|
|
3117
|
+
};
|
|
3118
|
+
}
|
|
3119
|
+
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
3120
|
+
const unrecognized = [];
|
|
3121
|
+
const keySet = def.keySet;
|
|
3122
|
+
const _catchall = def.catchall._zod;
|
|
3123
|
+
const t = _catchall.def.type;
|
|
3124
|
+
for (const key of Object.keys(input)) {
|
|
3125
|
+
if (keySet.has(key))
|
|
3126
|
+
continue;
|
|
3127
|
+
if (t === "never") {
|
|
3128
|
+
unrecognized.push(key);
|
|
3129
|
+
continue;
|
|
3130
|
+
}
|
|
3131
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
3132
|
+
if (r instanceof Promise) {
|
|
3133
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
3134
|
+
} else {
|
|
3135
|
+
handlePropertyResult(r, payload, key, input);
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
if (unrecognized.length) {
|
|
3139
|
+
payload.issues.push({
|
|
3140
|
+
code: "unrecognized_keys",
|
|
3141
|
+
keys: unrecognized,
|
|
3142
|
+
input,
|
|
3143
|
+
inst
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
if (!proms.length)
|
|
3147
|
+
return payload;
|
|
3148
|
+
return Promise.all(proms).then(() => {
|
|
3149
|
+
return payload;
|
|
3150
|
+
});
|
|
3151
|
+
}
|
|
2853
3152
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
2854
3153
|
$ZodType.init(inst, def);
|
|
2855
|
-
const
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
3154
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
3155
|
+
if (!desc?.get) {
|
|
3156
|
+
const sh = def.shape;
|
|
3157
|
+
Object.defineProperty(def, "shape", {
|
|
3158
|
+
get: () => {
|
|
3159
|
+
const newSh = { ...sh };
|
|
3160
|
+
Object.defineProperty(def, "shape", {
|
|
3161
|
+
value: newSh
|
|
3162
|
+
});
|
|
3163
|
+
return newSh;
|
|
2860
3164
|
}
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
shape: def.shape,
|
|
2865
|
-
keys,
|
|
2866
|
-
keySet: new Set(keys),
|
|
2867
|
-
numKeys: keys.length,
|
|
2868
|
-
optionalKeys: new Set(okeys)
|
|
2869
|
-
};
|
|
2870
|
-
});
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
2871
3168
|
defineLazy(inst._zod, "propValues", () => {
|
|
2872
3169
|
const shape = def.shape;
|
|
2873
3170
|
const propValues = {};
|
|
@@ -2881,6 +3178,43 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2881
3178
|
}
|
|
2882
3179
|
return propValues;
|
|
2883
3180
|
});
|
|
3181
|
+
const isObject2 = isObject;
|
|
3182
|
+
const catchall = def.catchall;
|
|
3183
|
+
let value;
|
|
3184
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3185
|
+
value ?? (value = _normalized.value);
|
|
3186
|
+
const input = payload.value;
|
|
3187
|
+
if (!isObject2(input)) {
|
|
3188
|
+
payload.issues.push({
|
|
3189
|
+
expected: "object",
|
|
3190
|
+
code: "invalid_type",
|
|
3191
|
+
input,
|
|
3192
|
+
inst
|
|
3193
|
+
});
|
|
3194
|
+
return payload;
|
|
3195
|
+
}
|
|
3196
|
+
payload.value = {};
|
|
3197
|
+
const proms = [];
|
|
3198
|
+
const shape = value.shape;
|
|
3199
|
+
for (const key of value.keys) {
|
|
3200
|
+
const el = shape[key];
|
|
3201
|
+
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
3202
|
+
if (r instanceof Promise) {
|
|
3203
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
3204
|
+
} else {
|
|
3205
|
+
handlePropertyResult(r, payload, key, input);
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
if (!catchall) {
|
|
3209
|
+
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3210
|
+
}
|
|
3211
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
3212
|
+
};
|
|
3213
|
+
});
|
|
3214
|
+
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
3215
|
+
$ZodObject.init(inst, def);
|
|
3216
|
+
const superParse = inst._zod.parse;
|
|
3217
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
2884
3218
|
const generateFastpass = (shape) => {
|
|
2885
3219
|
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
2886
3220
|
const normalized = _normalized.value;
|
|
@@ -2894,42 +3228,29 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2894
3228
|
for (const key of normalized.keys) {
|
|
2895
3229
|
ids[key] = `key_${counter++}`;
|
|
2896
3230
|
}
|
|
2897
|
-
doc.write(`const newResult = {}
|
|
3231
|
+
doc.write(`const newResult = {};`);
|
|
2898
3232
|
for (const key of normalized.keys) {
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
doc.write(`
|
|
3233
|
+
const id = ids[key];
|
|
3234
|
+
const k = esc(key);
|
|
3235
|
+
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
3236
|
+
doc.write(`
|
|
2904
3237
|
if (${id}.issues.length) {
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
);
|
|
3238
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
3239
|
+
...iss,
|
|
3240
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
3241
|
+
})));
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
|
|
3245
|
+
if (${id}.value === undefined) {
|
|
3246
|
+
if (${k} in input) {
|
|
3247
|
+
newResult[${k}] = undefined;
|
|
2916
3248
|
}
|
|
2917
|
-
} else if (${id}.value === undefined) {
|
|
2918
|
-
if (${k} in input) newResult[${k}] = undefined;
|
|
2919
3249
|
} else {
|
|
2920
3250
|
newResult[${k}] = ${id}.value;
|
|
2921
3251
|
}
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
const id = ids[key];
|
|
2925
|
-
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
2926
|
-
doc.write(`
|
|
2927
|
-
if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
2928
|
-
...iss,
|
|
2929
|
-
path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
|
|
2930
|
-
})));`);
|
|
2931
|
-
doc.write(`newResult[${esc(key)}] = ${id}.value`);
|
|
2932
|
-
}
|
|
3252
|
+
|
|
3253
|
+
`);
|
|
2933
3254
|
}
|
|
2934
3255
|
doc.write(`payload.value = newResult;`);
|
|
2935
3256
|
doc.write(`return payload;`);
|
|
@@ -2955,61 +3276,15 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
2955
3276
|
});
|
|
2956
3277
|
return payload;
|
|
2957
3278
|
}
|
|
2958
|
-
const proms = [];
|
|
2959
3279
|
if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
|
|
2960
3280
|
if (!fastpass)
|
|
2961
3281
|
fastpass = generateFastpass(def.shape);
|
|
2962
3282
|
payload = fastpass(payload, ctx);
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
for (const key of value.keys) {
|
|
2967
|
-
const el = shape[key];
|
|
2968
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
2969
|
-
const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
|
|
2970
|
-
if (r instanceof Promise) {
|
|
2971
|
-
proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
|
|
2972
|
-
} else if (isOptional) {
|
|
2973
|
-
handleOptionalObjectResult(r, payload, key, input);
|
|
2974
|
-
} else {
|
|
2975
|
-
handleObjectResult(r, payload, key);
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
}
|
|
2979
|
-
if (!catchall) {
|
|
2980
|
-
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2981
|
-
}
|
|
2982
|
-
const unrecognized = [];
|
|
2983
|
-
const keySet = value.keySet;
|
|
2984
|
-
const _catchall = catchall._zod;
|
|
2985
|
-
const t = _catchall.def.type;
|
|
2986
|
-
for (const key of Object.keys(input)) {
|
|
2987
|
-
if (keySet.has(key))
|
|
2988
|
-
continue;
|
|
2989
|
-
if (t === "never") {
|
|
2990
|
-
unrecognized.push(key);
|
|
2991
|
-
continue;
|
|
2992
|
-
}
|
|
2993
|
-
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
2994
|
-
if (r instanceof Promise) {
|
|
2995
|
-
proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
|
|
2996
|
-
} else {
|
|
2997
|
-
handleObjectResult(r, payload, key);
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
if (unrecognized.length) {
|
|
3001
|
-
payload.issues.push({
|
|
3002
|
-
code: "unrecognized_keys",
|
|
3003
|
-
keys: unrecognized,
|
|
3004
|
-
input,
|
|
3005
|
-
inst
|
|
3006
|
-
});
|
|
3283
|
+
if (!catchall)
|
|
3284
|
+
return payload;
|
|
3285
|
+
return handleCatchall([], input, payload, ctx, value, inst);
|
|
3007
3286
|
}
|
|
3008
|
-
|
|
3009
|
-
return payload;
|
|
3010
|
-
return Promise.all(proms).then(() => {
|
|
3011
|
-
return payload;
|
|
3012
|
-
});
|
|
3287
|
+
return superParse(payload, ctx);
|
|
3013
3288
|
};
|
|
3014
3289
|
});
|
|
3015
3290
|
function handleUnionResults(results, final, inst, ctx) {
|
|
@@ -3019,6 +3294,11 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
3019
3294
|
return final;
|
|
3020
3295
|
}
|
|
3021
3296
|
}
|
|
3297
|
+
const nonaborted = results.filter((r) => !aborted(r));
|
|
3298
|
+
if (nonaborted.length === 1) {
|
|
3299
|
+
final.value = nonaborted[0].value;
|
|
3300
|
+
return nonaborted[0];
|
|
3301
|
+
}
|
|
3022
3302
|
final.issues.push({
|
|
3023
3303
|
code: "invalid_union",
|
|
3024
3304
|
input: final.value,
|
|
@@ -3044,7 +3324,12 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
3044
3324
|
}
|
|
3045
3325
|
return;
|
|
3046
3326
|
});
|
|
3327
|
+
const single = def.options.length === 1;
|
|
3328
|
+
const first = def.options[0]._zod.run;
|
|
3047
3329
|
inst._zod.parse = (payload, ctx) => {
|
|
3330
|
+
if (single) {
|
|
3331
|
+
return first(payload, ctx);
|
|
3332
|
+
}
|
|
3048
3333
|
let async = false;
|
|
3049
3334
|
const results = [];
|
|
3050
3335
|
for (const option of def.options) {
|
|
@@ -3091,7 +3376,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3091
3376
|
const opts = def.options;
|
|
3092
3377
|
const map = new Map;
|
|
3093
3378
|
for (const o of opts) {
|
|
3094
|
-
const values = o._zod.propValues[def.discriminator];
|
|
3379
|
+
const values = o._zod.propValues?.[def.discriminator];
|
|
3095
3380
|
if (!values || values.size === 0)
|
|
3096
3381
|
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
3097
3382
|
for (const v of values) {
|
|
@@ -3125,6 +3410,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3125
3410
|
code: "invalid_union",
|
|
3126
3411
|
errors: [],
|
|
3127
3412
|
note: "No matching discriminator",
|
|
3413
|
+
discriminator: def.discriminator,
|
|
3128
3414
|
input,
|
|
3129
3415
|
path: [def.discriminator],
|
|
3130
3416
|
inst
|
|
@@ -3229,10 +3515,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3229
3515
|
const tooSmall = input.length < optStart - 1;
|
|
3230
3516
|
if (tooBig || tooSmall) {
|
|
3231
3517
|
payload.issues.push({
|
|
3518
|
+
...tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length },
|
|
3232
3519
|
input,
|
|
3233
3520
|
inst,
|
|
3234
|
-
origin: "array"
|
|
3235
|
-
...tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length }
|
|
3521
|
+
origin: "array"
|
|
3236
3522
|
});
|
|
3237
3523
|
return payload;
|
|
3238
3524
|
}
|
|
@@ -3341,8 +3627,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
3341
3627
|
}
|
|
3342
3628
|
if (keyResult.issues.length) {
|
|
3343
3629
|
payload.issues.push({
|
|
3344
|
-
origin: "record",
|
|
3345
3630
|
code: "invalid_key",
|
|
3631
|
+
origin: "record",
|
|
3346
3632
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
3347
3633
|
input: key,
|
|
3348
3634
|
path: [key],
|
|
@@ -3410,8 +3696,8 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
3410
3696
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
3411
3697
|
} else {
|
|
3412
3698
|
final.issues.push({
|
|
3413
|
-
origin: "map",
|
|
3414
3699
|
code: "invalid_key",
|
|
3700
|
+
origin: "map",
|
|
3415
3701
|
input,
|
|
3416
3702
|
inst,
|
|
3417
3703
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -3470,11 +3756,12 @@ function handleSetResult(result, final) {
|
|
|
3470
3756
|
var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
3471
3757
|
$ZodType.init(inst, def);
|
|
3472
3758
|
const values = getEnumValues(def.entries);
|
|
3473
|
-
|
|
3759
|
+
const valuesSet = new Set(values);
|
|
3760
|
+
inst._zod.values = valuesSet;
|
|
3474
3761
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
3475
3762
|
inst._zod.parse = (payload, _ctx) => {
|
|
3476
3763
|
const input = payload.value;
|
|
3477
|
-
if (
|
|
3764
|
+
if (valuesSet.has(input)) {
|
|
3478
3765
|
return payload;
|
|
3479
3766
|
}
|
|
3480
3767
|
payload.issues.push({
|
|
@@ -3488,8 +3775,11 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
3488
3775
|
});
|
|
3489
3776
|
var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
3490
3777
|
$ZodType.init(inst, def);
|
|
3778
|
+
if (def.values.length === 0) {
|
|
3779
|
+
throw new Error("Cannot create literal schema with no valid values");
|
|
3780
|
+
}
|
|
3491
3781
|
inst._zod.values = new Set(def.values);
|
|
3492
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`);
|
|
3782
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
3493
3783
|
inst._zod.parse = (payload, _ctx) => {
|
|
3494
3784
|
const input = payload.value;
|
|
3495
3785
|
if (inst._zod.values.has(input)) {
|
|
@@ -3521,9 +3811,12 @@ var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
|
3521
3811
|
});
|
|
3522
3812
|
var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
|
|
3523
3813
|
$ZodType.init(inst, def);
|
|
3524
|
-
inst._zod.parse = (payload,
|
|
3814
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3815
|
+
if (ctx.direction === "backward") {
|
|
3816
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
3817
|
+
}
|
|
3525
3818
|
const _out = def.transform(payload.value, payload);
|
|
3526
|
-
if (
|
|
3819
|
+
if (ctx.async) {
|
|
3527
3820
|
const output = _out instanceof Promise ? _out : Promise.resolve(_out);
|
|
3528
3821
|
return output.then((output2) => {
|
|
3529
3822
|
payload.value = output2;
|
|
@@ -3537,6 +3830,12 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
3537
3830
|
return payload;
|
|
3538
3831
|
};
|
|
3539
3832
|
});
|
|
3833
|
+
function handleOptionalResult(result, input) {
|
|
3834
|
+
if (result.issues.length && input === undefined) {
|
|
3835
|
+
return { issues: [], value: undefined };
|
|
3836
|
+
}
|
|
3837
|
+
return result;
|
|
3838
|
+
}
|
|
3540
3839
|
var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
3541
3840
|
$ZodType.init(inst, def);
|
|
3542
3841
|
inst._zod.optin = "optional";
|
|
@@ -3550,7 +3849,10 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
3550
3849
|
});
|
|
3551
3850
|
inst._zod.parse = (payload, ctx) => {
|
|
3552
3851
|
if (def.innerType._zod.optin === "optional") {
|
|
3553
|
-
|
|
3852
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
3853
|
+
if (result instanceof Promise)
|
|
3854
|
+
return result.then((r) => handleOptionalResult(r, payload.value));
|
|
3855
|
+
return handleOptionalResult(result, payload.value);
|
|
3554
3856
|
}
|
|
3555
3857
|
if (payload.value === undefined) {
|
|
3556
3858
|
return payload;
|
|
@@ -3580,6 +3882,9 @@ var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
|
3580
3882
|
inst._zod.optin = "optional";
|
|
3581
3883
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
3582
3884
|
inst._zod.parse = (payload, ctx) => {
|
|
3885
|
+
if (ctx.direction === "backward") {
|
|
3886
|
+
return def.innerType._zod.run(payload, ctx);
|
|
3887
|
+
}
|
|
3583
3888
|
if (payload.value === undefined) {
|
|
3584
3889
|
payload.value = def.defaultValue;
|
|
3585
3890
|
return payload;
|
|
@@ -3602,6 +3907,9 @@ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
|
|
|
3602
3907
|
inst._zod.optin = "optional";
|
|
3603
3908
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
3604
3909
|
inst._zod.parse = (payload, ctx) => {
|
|
3910
|
+
if (ctx.direction === "backward") {
|
|
3911
|
+
return def.innerType._zod.run(payload, ctx);
|
|
3912
|
+
}
|
|
3605
3913
|
if (payload.value === undefined) {
|
|
3606
3914
|
payload.value = def.defaultValue;
|
|
3607
3915
|
}
|
|
@@ -3636,6 +3944,9 @@ function handleNonOptionalResult(payload, inst) {
|
|
|
3636
3944
|
var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
|
|
3637
3945
|
$ZodType.init(inst, def);
|
|
3638
3946
|
inst._zod.parse = (payload, ctx) => {
|
|
3947
|
+
if (ctx.direction === "backward") {
|
|
3948
|
+
throw new $ZodEncodeError("ZodSuccess");
|
|
3949
|
+
}
|
|
3639
3950
|
const result = def.innerType._zod.run(payload, ctx);
|
|
3640
3951
|
if (result instanceof Promise) {
|
|
3641
3952
|
return result.then((result2) => {
|
|
@@ -3649,10 +3960,13 @@ var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
|
|
|
3649
3960
|
});
|
|
3650
3961
|
var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
3651
3962
|
$ZodType.init(inst, def);
|
|
3652
|
-
inst._zod
|
|
3963
|
+
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
3653
3964
|
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
3654
3965
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
3655
3966
|
inst._zod.parse = (payload, ctx) => {
|
|
3967
|
+
if (ctx.direction === "backward") {
|
|
3968
|
+
return def.innerType._zod.run(payload, ctx);
|
|
3969
|
+
}
|
|
3656
3970
|
const result = def.innerType._zod.run(payload, ctx);
|
|
3657
3971
|
if (result instanceof Promise) {
|
|
3658
3972
|
return result.then((result2) => {
|
|
@@ -3704,31 +4018,93 @@ var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
|
3704
4018
|
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
3705
4019
|
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
3706
4020
|
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
4021
|
+
defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
|
|
3707
4022
|
inst._zod.parse = (payload, ctx) => {
|
|
4023
|
+
if (ctx.direction === "backward") {
|
|
4024
|
+
const right = def.out._zod.run(payload, ctx);
|
|
4025
|
+
if (right instanceof Promise) {
|
|
4026
|
+
return right.then((right2) => handlePipeResult(right2, def.in, ctx));
|
|
4027
|
+
}
|
|
4028
|
+
return handlePipeResult(right, def.in, ctx);
|
|
4029
|
+
}
|
|
3708
4030
|
const left = def.in._zod.run(payload, ctx);
|
|
3709
4031
|
if (left instanceof Promise) {
|
|
3710
|
-
return left.then((left2) => handlePipeResult(left2, def, ctx));
|
|
4032
|
+
return left.then((left2) => handlePipeResult(left2, def.out, ctx));
|
|
3711
4033
|
}
|
|
3712
|
-
return handlePipeResult(left, def, ctx);
|
|
4034
|
+
return handlePipeResult(left, def.out, ctx);
|
|
3713
4035
|
};
|
|
3714
4036
|
});
|
|
3715
|
-
function handlePipeResult(left,
|
|
3716
|
-
if (
|
|
4037
|
+
function handlePipeResult(left, next, ctx) {
|
|
4038
|
+
if (left.issues.length) {
|
|
4039
|
+
left.aborted = true;
|
|
3717
4040
|
return left;
|
|
3718
4041
|
}
|
|
3719
|
-
return
|
|
4042
|
+
return next._zod.run({ value: left.value, issues: left.issues }, ctx);
|
|
3720
4043
|
}
|
|
3721
|
-
var $
|
|
4044
|
+
var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
|
|
3722
4045
|
$ZodType.init(inst, def);
|
|
3723
|
-
defineLazy(inst._zod, "
|
|
3724
|
-
defineLazy(inst._zod, "
|
|
3725
|
-
defineLazy(inst._zod, "
|
|
3726
|
-
defineLazy(inst._zod, "
|
|
4046
|
+
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
4047
|
+
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
4048
|
+
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
4049
|
+
defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
|
|
3727
4050
|
inst._zod.parse = (payload, ctx) => {
|
|
3728
|
-
const
|
|
3729
|
-
if (
|
|
3730
|
-
|
|
3731
|
-
|
|
4051
|
+
const direction = ctx.direction || "forward";
|
|
4052
|
+
if (direction === "forward") {
|
|
4053
|
+
const left = def.in._zod.run(payload, ctx);
|
|
4054
|
+
if (left instanceof Promise) {
|
|
4055
|
+
return left.then((left2) => handleCodecAResult(left2, def, ctx));
|
|
4056
|
+
}
|
|
4057
|
+
return handleCodecAResult(left, def, ctx);
|
|
4058
|
+
} else {
|
|
4059
|
+
const right = def.out._zod.run(payload, ctx);
|
|
4060
|
+
if (right instanceof Promise) {
|
|
4061
|
+
return right.then((right2) => handleCodecAResult(right2, def, ctx));
|
|
4062
|
+
}
|
|
4063
|
+
return handleCodecAResult(right, def, ctx);
|
|
4064
|
+
}
|
|
4065
|
+
};
|
|
4066
|
+
});
|
|
4067
|
+
function handleCodecAResult(result, def, ctx) {
|
|
4068
|
+
if (result.issues.length) {
|
|
4069
|
+
result.aborted = true;
|
|
4070
|
+
return result;
|
|
4071
|
+
}
|
|
4072
|
+
const direction = ctx.direction || "forward";
|
|
4073
|
+
if (direction === "forward") {
|
|
4074
|
+
const transformed = def.transform(result.value, result);
|
|
4075
|
+
if (transformed instanceof Promise) {
|
|
4076
|
+
return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
|
|
4077
|
+
}
|
|
4078
|
+
return handleCodecTxResult(result, transformed, def.out, ctx);
|
|
4079
|
+
} else {
|
|
4080
|
+
const transformed = def.reverseTransform(result.value, result);
|
|
4081
|
+
if (transformed instanceof Promise) {
|
|
4082
|
+
return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
|
|
4083
|
+
}
|
|
4084
|
+
return handleCodecTxResult(result, transformed, def.in, ctx);
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
function handleCodecTxResult(left, value, nextSchema, ctx) {
|
|
4088
|
+
if (left.issues.length) {
|
|
4089
|
+
left.aborted = true;
|
|
4090
|
+
return left;
|
|
4091
|
+
}
|
|
4092
|
+
return nextSchema._zod.run({ value, issues: left.issues }, ctx);
|
|
4093
|
+
}
|
|
4094
|
+
var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
|
|
4095
|
+
$ZodType.init(inst, def);
|
|
4096
|
+
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
4097
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
4098
|
+
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
4099
|
+
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
4100
|
+
inst._zod.parse = (payload, ctx) => {
|
|
4101
|
+
if (ctx.direction === "backward") {
|
|
4102
|
+
return def.innerType._zod.run(payload, ctx);
|
|
4103
|
+
}
|
|
4104
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
4105
|
+
if (result instanceof Promise) {
|
|
4106
|
+
return result.then(handleReadonlyResult);
|
|
4107
|
+
}
|
|
3732
4108
|
return handleReadonlyResult(result);
|
|
3733
4109
|
};
|
|
3734
4110
|
});
|
|
@@ -3740,7 +4116,7 @@ var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (i
|
|
|
3740
4116
|
$ZodType.init(inst, def);
|
|
3741
4117
|
const regexParts = [];
|
|
3742
4118
|
for (const part of def.parts) {
|
|
3743
|
-
if (part
|
|
4119
|
+
if (typeof part === "object" && part !== null) {
|
|
3744
4120
|
if (!part._zod.pattern) {
|
|
3745
4121
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
3746
4122
|
}
|
|
@@ -3773,7 +4149,7 @@ var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (i
|
|
|
3773
4149
|
input: payload.value,
|
|
3774
4150
|
inst,
|
|
3775
4151
|
code: "invalid_format",
|
|
3776
|
-
format: "template_literal",
|
|
4152
|
+
format: def.format ?? "template_literal",
|
|
3777
4153
|
pattern: inst._zod.pattern.source
|
|
3778
4154
|
});
|
|
3779
4155
|
return payload;
|
|
@@ -3781,6 +4157,83 @@ var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (i
|
|
|
3781
4157
|
return payload;
|
|
3782
4158
|
};
|
|
3783
4159
|
});
|
|
4160
|
+
var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
|
|
4161
|
+
$ZodType.init(inst, def);
|
|
4162
|
+
inst._def = def;
|
|
4163
|
+
inst._zod.def = def;
|
|
4164
|
+
inst.implement = (func) => {
|
|
4165
|
+
if (typeof func !== "function") {
|
|
4166
|
+
throw new Error("implement() must be called with a function");
|
|
4167
|
+
}
|
|
4168
|
+
return function(...args) {
|
|
4169
|
+
const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;
|
|
4170
|
+
const result = Reflect.apply(func, this, parsedArgs);
|
|
4171
|
+
if (inst._def.output) {
|
|
4172
|
+
return parse(inst._def.output, result);
|
|
4173
|
+
}
|
|
4174
|
+
return result;
|
|
4175
|
+
};
|
|
4176
|
+
};
|
|
4177
|
+
inst.implementAsync = (func) => {
|
|
4178
|
+
if (typeof func !== "function") {
|
|
4179
|
+
throw new Error("implementAsync() must be called with a function");
|
|
4180
|
+
}
|
|
4181
|
+
return async function(...args) {
|
|
4182
|
+
const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;
|
|
4183
|
+
const result = await Reflect.apply(func, this, parsedArgs);
|
|
4184
|
+
if (inst._def.output) {
|
|
4185
|
+
return await parseAsync(inst._def.output, result);
|
|
4186
|
+
}
|
|
4187
|
+
return result;
|
|
4188
|
+
};
|
|
4189
|
+
};
|
|
4190
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
4191
|
+
if (typeof payload.value !== "function") {
|
|
4192
|
+
payload.issues.push({
|
|
4193
|
+
code: "invalid_type",
|
|
4194
|
+
expected: "function",
|
|
4195
|
+
input: payload.value,
|
|
4196
|
+
inst
|
|
4197
|
+
});
|
|
4198
|
+
return payload;
|
|
4199
|
+
}
|
|
4200
|
+
const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
|
|
4201
|
+
if (hasPromiseOutput) {
|
|
4202
|
+
payload.value = inst.implementAsync(payload.value);
|
|
4203
|
+
} else {
|
|
4204
|
+
payload.value = inst.implement(payload.value);
|
|
4205
|
+
}
|
|
4206
|
+
return payload;
|
|
4207
|
+
};
|
|
4208
|
+
inst.input = (...args) => {
|
|
4209
|
+
const F = inst.constructor;
|
|
4210
|
+
if (Array.isArray(args[0])) {
|
|
4211
|
+
return new F({
|
|
4212
|
+
type: "function",
|
|
4213
|
+
input: new $ZodTuple({
|
|
4214
|
+
type: "tuple",
|
|
4215
|
+
items: args[0],
|
|
4216
|
+
rest: args[1]
|
|
4217
|
+
}),
|
|
4218
|
+
output: inst._def.output
|
|
4219
|
+
});
|
|
4220
|
+
}
|
|
4221
|
+
return new F({
|
|
4222
|
+
type: "function",
|
|
4223
|
+
input: args[0],
|
|
4224
|
+
output: inst._def.output
|
|
4225
|
+
});
|
|
4226
|
+
};
|
|
4227
|
+
inst.output = (output) => {
|
|
4228
|
+
const F = inst.constructor;
|
|
4229
|
+
return new F({
|
|
4230
|
+
type: "function",
|
|
4231
|
+
input: inst._def.input,
|
|
4232
|
+
output
|
|
4233
|
+
});
|
|
4234
|
+
};
|
|
4235
|
+
return inst;
|
|
4236
|
+
});
|
|
3784
4237
|
var $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def) => {
|
|
3785
4238
|
$ZodType.init(inst, def);
|
|
3786
4239
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -3792,8 +4245,8 @@ var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
|
|
|
3792
4245
|
defineLazy(inst._zod, "innerType", () => def.getter());
|
|
3793
4246
|
defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
|
|
3794
4247
|
defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
|
|
3795
|
-
defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin);
|
|
3796
|
-
defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout);
|
|
4248
|
+
defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin ?? undefined);
|
|
4249
|
+
defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout ?? undefined);
|
|
3797
4250
|
inst._zod.parse = (payload, ctx) => {
|
|
3798
4251
|
const inner = inst._zod.innerType;
|
|
3799
4252
|
return inner._zod.run(payload, ctx);
|
|
@@ -3834,8 +4287,10 @@ var exports_locales = {};
|
|
|
3834
4287
|
__export(exports_locales, {
|
|
3835
4288
|
zhTW: () => zh_TW_default,
|
|
3836
4289
|
zhCN: () => zh_CN_default,
|
|
4290
|
+
yo: () => yo_default,
|
|
3837
4291
|
vi: () => vi_default,
|
|
3838
4292
|
ur: () => ur_default,
|
|
4293
|
+
uk: () => uk_default,
|
|
3839
4294
|
ua: () => ua_default,
|
|
3840
4295
|
tr: () => tr_default,
|
|
3841
4296
|
th: () => th_default,
|
|
@@ -3851,10 +4306,14 @@ __export(exports_locales, {
|
|
|
3851
4306
|
nl: () => nl_default,
|
|
3852
4307
|
ms: () => ms_default,
|
|
3853
4308
|
mk: () => mk_default,
|
|
4309
|
+
lt: () => lt_default,
|
|
3854
4310
|
ko: () => ko_default,
|
|
4311
|
+
km: () => km_default,
|
|
3855
4312
|
kh: () => kh_default,
|
|
4313
|
+
ka: () => ka_default,
|
|
3856
4314
|
ja: () => ja_default,
|
|
3857
4315
|
it: () => it_default,
|
|
4316
|
+
is: () => is_default,
|
|
3858
4317
|
id: () => id_default,
|
|
3859
4318
|
hu: () => hu_default,
|
|
3860
4319
|
he: () => he_default,
|
|
@@ -3866,6 +4325,7 @@ __export(exports_locales, {
|
|
|
3866
4325
|
eo: () => eo_default,
|
|
3867
4326
|
en: () => en_default,
|
|
3868
4327
|
de: () => de_default,
|
|
4328
|
+
da: () => da_default,
|
|
3869
4329
|
cs: () => cs_default,
|
|
3870
4330
|
ca: () => ca_default,
|
|
3871
4331
|
be: () => be_default,
|
|
@@ -4520,8 +4980,139 @@ function cs_default() {
|
|
|
4520
4980
|
localeError: error5()
|
|
4521
4981
|
};
|
|
4522
4982
|
}
|
|
4523
|
-
// ../../node_modules/zod/v4/locales/
|
|
4983
|
+
// ../../node_modules/zod/v4/locales/da.js
|
|
4524
4984
|
var error6 = () => {
|
|
4985
|
+
const Sizable = {
|
|
4986
|
+
string: { unit: "tegn", verb: "havde" },
|
|
4987
|
+
file: { unit: "bytes", verb: "havde" },
|
|
4988
|
+
array: { unit: "elementer", verb: "indeholdt" },
|
|
4989
|
+
set: { unit: "elementer", verb: "indeholdt" }
|
|
4990
|
+
};
|
|
4991
|
+
const TypeNames = {
|
|
4992
|
+
string: "streng",
|
|
4993
|
+
number: "tal",
|
|
4994
|
+
boolean: "boolean",
|
|
4995
|
+
array: "liste",
|
|
4996
|
+
object: "objekt",
|
|
4997
|
+
set: "sæt",
|
|
4998
|
+
file: "fil"
|
|
4999
|
+
};
|
|
5000
|
+
function getSizing(origin) {
|
|
5001
|
+
return Sizable[origin] ?? null;
|
|
5002
|
+
}
|
|
5003
|
+
function getTypeName(type) {
|
|
5004
|
+
return TypeNames[type] ?? type;
|
|
5005
|
+
}
|
|
5006
|
+
const parsedType = (data) => {
|
|
5007
|
+
const t = typeof data;
|
|
5008
|
+
switch (t) {
|
|
5009
|
+
case "number": {
|
|
5010
|
+
return Number.isNaN(data) ? "NaN" : "tal";
|
|
5011
|
+
}
|
|
5012
|
+
case "object": {
|
|
5013
|
+
if (Array.isArray(data)) {
|
|
5014
|
+
return "liste";
|
|
5015
|
+
}
|
|
5016
|
+
if (data === null) {
|
|
5017
|
+
return "null";
|
|
5018
|
+
}
|
|
5019
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
5020
|
+
return data.constructor.name;
|
|
5021
|
+
}
|
|
5022
|
+
return "objekt";
|
|
5023
|
+
}
|
|
5024
|
+
}
|
|
5025
|
+
return t;
|
|
5026
|
+
};
|
|
5027
|
+
const Nouns = {
|
|
5028
|
+
regex: "input",
|
|
5029
|
+
email: "e-mailadresse",
|
|
5030
|
+
url: "URL",
|
|
5031
|
+
emoji: "emoji",
|
|
5032
|
+
uuid: "UUID",
|
|
5033
|
+
uuidv4: "UUIDv4",
|
|
5034
|
+
uuidv6: "UUIDv6",
|
|
5035
|
+
nanoid: "nanoid",
|
|
5036
|
+
guid: "GUID",
|
|
5037
|
+
cuid: "cuid",
|
|
5038
|
+
cuid2: "cuid2",
|
|
5039
|
+
ulid: "ULID",
|
|
5040
|
+
xid: "XID",
|
|
5041
|
+
ksuid: "KSUID",
|
|
5042
|
+
datetime: "ISO dato- og klokkeslæt",
|
|
5043
|
+
date: "ISO-dato",
|
|
5044
|
+
time: "ISO-klokkeslæt",
|
|
5045
|
+
duration: "ISO-varighed",
|
|
5046
|
+
ipv4: "IPv4-område",
|
|
5047
|
+
ipv6: "IPv6-område",
|
|
5048
|
+
cidrv4: "IPv4-spektrum",
|
|
5049
|
+
cidrv6: "IPv6-spektrum",
|
|
5050
|
+
base64: "base64-kodet streng",
|
|
5051
|
+
base64url: "base64url-kodet streng",
|
|
5052
|
+
json_string: "JSON-streng",
|
|
5053
|
+
e164: "E.164-nummer",
|
|
5054
|
+
jwt: "JWT",
|
|
5055
|
+
template_literal: "input"
|
|
5056
|
+
};
|
|
5057
|
+
return (issue2) => {
|
|
5058
|
+
switch (issue2.code) {
|
|
5059
|
+
case "invalid_type":
|
|
5060
|
+
return `Ugyldigt input: forventede ${getTypeName(issue2.expected)}, fik ${getTypeName(parsedType(issue2.input))}`;
|
|
5061
|
+
case "invalid_value":
|
|
5062
|
+
if (issue2.values.length === 1)
|
|
5063
|
+
return `Ugyldig værdi: forventede ${stringifyPrimitive(issue2.values[0])}`;
|
|
5064
|
+
return `Ugyldigt valg: forventede en af følgende ${joinValues(issue2.values, "|")}`;
|
|
5065
|
+
case "too_big": {
|
|
5066
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
5067
|
+
const sizing = getSizing(issue2.origin);
|
|
5068
|
+
const origin = getTypeName(issue2.origin);
|
|
5069
|
+
if (sizing)
|
|
5070
|
+
return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`;
|
|
5071
|
+
return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue2.maximum.toString()}`;
|
|
5072
|
+
}
|
|
5073
|
+
case "too_small": {
|
|
5074
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
5075
|
+
const sizing = getSizing(issue2.origin);
|
|
5076
|
+
const origin = getTypeName(issue2.origin);
|
|
5077
|
+
if (sizing) {
|
|
5078
|
+
return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`;
|
|
5079
|
+
}
|
|
5080
|
+
return `For lille: forventede ${origin} havde ${adj} ${issue2.minimum.toString()}`;
|
|
5081
|
+
}
|
|
5082
|
+
case "invalid_format": {
|
|
5083
|
+
const _issue = issue2;
|
|
5084
|
+
if (_issue.format === "starts_with")
|
|
5085
|
+
return `Ugyldig streng: skal starte med "${_issue.prefix}"`;
|
|
5086
|
+
if (_issue.format === "ends_with")
|
|
5087
|
+
return `Ugyldig streng: skal ende med "${_issue.suffix}"`;
|
|
5088
|
+
if (_issue.format === "includes")
|
|
5089
|
+
return `Ugyldig streng: skal indeholde "${_issue.includes}"`;
|
|
5090
|
+
if (_issue.format === "regex")
|
|
5091
|
+
return `Ugyldig streng: skal matche mønsteret ${_issue.pattern}`;
|
|
5092
|
+
return `Ugyldig ${Nouns[_issue.format] ?? issue2.format}`;
|
|
5093
|
+
}
|
|
5094
|
+
case "not_multiple_of":
|
|
5095
|
+
return `Ugyldigt tal: skal være deleligt med ${issue2.divisor}`;
|
|
5096
|
+
case "unrecognized_keys":
|
|
5097
|
+
return `${issue2.keys.length > 1 ? "Ukendte nøgler" : "Ukendt nøgle"}: ${joinValues(issue2.keys, ", ")}`;
|
|
5098
|
+
case "invalid_key":
|
|
5099
|
+
return `Ugyldig nøgle i ${issue2.origin}`;
|
|
5100
|
+
case "invalid_union":
|
|
5101
|
+
return "Ugyldigt input: matcher ingen af de tilladte typer";
|
|
5102
|
+
case "invalid_element":
|
|
5103
|
+
return `Ugyldig værdi i ${issue2.origin}`;
|
|
5104
|
+
default:
|
|
5105
|
+
return `Ugyldigt input`;
|
|
5106
|
+
}
|
|
5107
|
+
};
|
|
5108
|
+
};
|
|
5109
|
+
function da_default() {
|
|
5110
|
+
return {
|
|
5111
|
+
localeError: error6()
|
|
5112
|
+
};
|
|
5113
|
+
}
|
|
5114
|
+
// ../../node_modules/zod/v4/locales/de.js
|
|
5115
|
+
var error7 = () => {
|
|
4525
5116
|
const Sizable = {
|
|
4526
5117
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
4527
5118
|
file: { unit: "Bytes", verb: "zu haben" },
|
|
@@ -4633,7 +5224,7 @@ var error6 = () => {
|
|
|
4633
5224
|
};
|
|
4634
5225
|
function de_default() {
|
|
4635
5226
|
return {
|
|
4636
|
-
localeError:
|
|
5227
|
+
localeError: error7()
|
|
4637
5228
|
};
|
|
4638
5229
|
}
|
|
4639
5230
|
// ../../node_modules/zod/v4/locales/en.js
|
|
@@ -4657,7 +5248,7 @@ var parsedType = (data) => {
|
|
|
4657
5248
|
}
|
|
4658
5249
|
return t;
|
|
4659
5250
|
};
|
|
4660
|
-
var
|
|
5251
|
+
var error8 = () => {
|
|
4661
5252
|
const Sizable = {
|
|
4662
5253
|
string: { unit: "characters", verb: "to have" },
|
|
4663
5254
|
file: { unit: "bytes", verb: "to have" },
|
|
@@ -4750,7 +5341,7 @@ var error7 = () => {
|
|
|
4750
5341
|
};
|
|
4751
5342
|
function en_default() {
|
|
4752
5343
|
return {
|
|
4753
|
-
localeError:
|
|
5344
|
+
localeError: error8()
|
|
4754
5345
|
};
|
|
4755
5346
|
}
|
|
4756
5347
|
// ../../node_modules/zod/v4/locales/eo.js
|
|
@@ -4774,7 +5365,7 @@ var parsedType2 = (data) => {
|
|
|
4774
5365
|
}
|
|
4775
5366
|
return t;
|
|
4776
5367
|
};
|
|
4777
|
-
var
|
|
5368
|
+
var error9 = () => {
|
|
4778
5369
|
const Sizable = {
|
|
4779
5370
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
4780
5371
|
file: { unit: "bajtojn", verb: "havi" },
|
|
@@ -4866,36 +5457,66 @@ var error8 = () => {
|
|
|
4866
5457
|
};
|
|
4867
5458
|
function eo_default() {
|
|
4868
5459
|
return {
|
|
4869
|
-
localeError:
|
|
5460
|
+
localeError: error9()
|
|
4870
5461
|
};
|
|
4871
5462
|
}
|
|
4872
5463
|
// ../../node_modules/zod/v4/locales/es.js
|
|
4873
|
-
var
|
|
5464
|
+
var error10 = () => {
|
|
4874
5465
|
const Sizable = {
|
|
4875
5466
|
string: { unit: "caracteres", verb: "tener" },
|
|
4876
5467
|
file: { unit: "bytes", verb: "tener" },
|
|
4877
5468
|
array: { unit: "elementos", verb: "tener" },
|
|
4878
5469
|
set: { unit: "elementos", verb: "tener" }
|
|
4879
5470
|
};
|
|
5471
|
+
const TypeNames = {
|
|
5472
|
+
string: "texto",
|
|
5473
|
+
number: "número",
|
|
5474
|
+
boolean: "booleano",
|
|
5475
|
+
array: "arreglo",
|
|
5476
|
+
object: "objeto",
|
|
5477
|
+
set: "conjunto",
|
|
5478
|
+
file: "archivo",
|
|
5479
|
+
date: "fecha",
|
|
5480
|
+
bigint: "número grande",
|
|
5481
|
+
symbol: "símbolo",
|
|
5482
|
+
undefined: "indefinido",
|
|
5483
|
+
null: "nulo",
|
|
5484
|
+
function: "función",
|
|
5485
|
+
map: "mapa",
|
|
5486
|
+
record: "registro",
|
|
5487
|
+
tuple: "tupla",
|
|
5488
|
+
enum: "enumeración",
|
|
5489
|
+
union: "unión",
|
|
5490
|
+
literal: "literal",
|
|
5491
|
+
promise: "promesa",
|
|
5492
|
+
void: "vacío",
|
|
5493
|
+
never: "nunca",
|
|
5494
|
+
unknown: "desconocido",
|
|
5495
|
+
any: "cualquiera"
|
|
5496
|
+
};
|
|
4880
5497
|
function getSizing(origin) {
|
|
4881
5498
|
return Sizable[origin] ?? null;
|
|
4882
5499
|
}
|
|
5500
|
+
function getTypeName(type) {
|
|
5501
|
+
return TypeNames[type] ?? type;
|
|
5502
|
+
}
|
|
4883
5503
|
const parsedType3 = (data) => {
|
|
4884
5504
|
const t = typeof data;
|
|
4885
5505
|
switch (t) {
|
|
4886
5506
|
case "number": {
|
|
4887
|
-
return Number.isNaN(data) ? "NaN" : "
|
|
5507
|
+
return Number.isNaN(data) ? "NaN" : "number";
|
|
4888
5508
|
}
|
|
4889
5509
|
case "object": {
|
|
4890
5510
|
if (Array.isArray(data)) {
|
|
4891
|
-
return "
|
|
5511
|
+
return "array";
|
|
4892
5512
|
}
|
|
4893
5513
|
if (data === null) {
|
|
4894
|
-
return "
|
|
5514
|
+
return "null";
|
|
4895
5515
|
}
|
|
4896
5516
|
if (Object.getPrototypeOf(data) !== Object.prototype) {
|
|
4897
5517
|
return data.constructor.name;
|
|
4898
5518
|
}
|
|
5519
|
+
return "object";
|
|
4899
5520
|
}
|
|
4900
5521
|
}
|
|
4901
5522
|
return t;
|
|
@@ -4933,7 +5554,7 @@ var error9 = () => {
|
|
|
4933
5554
|
return (issue2) => {
|
|
4934
5555
|
switch (issue2.code) {
|
|
4935
5556
|
case "invalid_type":
|
|
4936
|
-
return `Entrada inválida: se esperaba ${issue2.expected}, recibido ${parsedType3(issue2.input)}`;
|
|
5557
|
+
return `Entrada inválida: se esperaba ${getTypeName(issue2.expected)}, recibido ${getTypeName(parsedType3(issue2.input))}`;
|
|
4937
5558
|
case "invalid_value":
|
|
4938
5559
|
if (issue2.values.length === 1)
|
|
4939
5560
|
return `Entrada inválida: se esperaba ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -4941,17 +5562,19 @@ var error9 = () => {
|
|
|
4941
5562
|
case "too_big": {
|
|
4942
5563
|
const adj = issue2.inclusive ? "<=" : "<";
|
|
4943
5564
|
const sizing = getSizing(issue2.origin);
|
|
5565
|
+
const origin = getTypeName(issue2.origin);
|
|
4944
5566
|
if (sizing)
|
|
4945
|
-
return `Demasiado grande: se esperaba que ${
|
|
4946
|
-
return `Demasiado grande: se esperaba que ${
|
|
5567
|
+
return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`;
|
|
5568
|
+
return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue2.maximum.toString()}`;
|
|
4947
5569
|
}
|
|
4948
5570
|
case "too_small": {
|
|
4949
5571
|
const adj = issue2.inclusive ? ">=" : ">";
|
|
4950
5572
|
const sizing = getSizing(issue2.origin);
|
|
5573
|
+
const origin = getTypeName(issue2.origin);
|
|
4951
5574
|
if (sizing) {
|
|
4952
|
-
return `Demasiado pequeño: se esperaba que ${
|
|
5575
|
+
return `Demasiado pequeño: se esperaba que ${origin} tuviera ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
4953
5576
|
}
|
|
4954
|
-
return `Demasiado pequeño: se esperaba que ${
|
|
5577
|
+
return `Demasiado pequeño: se esperaba que ${origin} fuera ${adj}${issue2.minimum.toString()}`;
|
|
4955
5578
|
}
|
|
4956
5579
|
case "invalid_format": {
|
|
4957
5580
|
const _issue = issue2;
|
|
@@ -4970,11 +5593,11 @@ var error9 = () => {
|
|
|
4970
5593
|
case "unrecognized_keys":
|
|
4971
5594
|
return `Llave${issue2.keys.length > 1 ? "s" : ""} desconocida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`;
|
|
4972
5595
|
case "invalid_key":
|
|
4973
|
-
return `Llave inválida en ${issue2.origin}`;
|
|
5596
|
+
return `Llave inválida en ${getTypeName(issue2.origin)}`;
|
|
4974
5597
|
case "invalid_union":
|
|
4975
5598
|
return "Entrada inválida";
|
|
4976
5599
|
case "invalid_element":
|
|
4977
|
-
return `Valor inválido en ${issue2.origin}`;
|
|
5600
|
+
return `Valor inválido en ${getTypeName(issue2.origin)}`;
|
|
4978
5601
|
default:
|
|
4979
5602
|
return `Entrada inválida`;
|
|
4980
5603
|
}
|
|
@@ -4982,11 +5605,11 @@ var error9 = () => {
|
|
|
4982
5605
|
};
|
|
4983
5606
|
function es_default() {
|
|
4984
5607
|
return {
|
|
4985
|
-
localeError:
|
|
5608
|
+
localeError: error10()
|
|
4986
5609
|
};
|
|
4987
5610
|
}
|
|
4988
5611
|
// ../../node_modules/zod/v4/locales/fa.js
|
|
4989
|
-
var
|
|
5612
|
+
var error11 = () => {
|
|
4990
5613
|
const Sizable = {
|
|
4991
5614
|
string: { unit: "کاراکتر", verb: "داشته باشد" },
|
|
4992
5615
|
file: { unit: "بایت", verb: "داشته باشد" },
|
|
@@ -5104,11 +5727,11 @@ var error10 = () => {
|
|
|
5104
5727
|
};
|
|
5105
5728
|
function fa_default() {
|
|
5106
5729
|
return {
|
|
5107
|
-
localeError:
|
|
5730
|
+
localeError: error11()
|
|
5108
5731
|
};
|
|
5109
5732
|
}
|
|
5110
5733
|
// ../../node_modules/zod/v4/locales/fi.js
|
|
5111
|
-
var
|
|
5734
|
+
var error12 = () => {
|
|
5112
5735
|
const Sizable = {
|
|
5113
5736
|
string: { unit: "merkkiä", subject: "merkkijonon" },
|
|
5114
5737
|
file: { unit: "tavua", subject: "tiedoston" },
|
|
@@ -5226,11 +5849,11 @@ var error11 = () => {
|
|
|
5226
5849
|
};
|
|
5227
5850
|
function fi_default() {
|
|
5228
5851
|
return {
|
|
5229
|
-
localeError:
|
|
5852
|
+
localeError: error12()
|
|
5230
5853
|
};
|
|
5231
5854
|
}
|
|
5232
5855
|
// ../../node_modules/zod/v4/locales/fr.js
|
|
5233
|
-
var
|
|
5856
|
+
var error13 = () => {
|
|
5234
5857
|
const Sizable = {
|
|
5235
5858
|
string: { unit: "caractères", verb: "avoir" },
|
|
5236
5859
|
file: { unit: "octets", verb: "avoir" },
|
|
@@ -5342,11 +5965,11 @@ var error12 = () => {
|
|
|
5342
5965
|
};
|
|
5343
5966
|
function fr_default() {
|
|
5344
5967
|
return {
|
|
5345
|
-
localeError:
|
|
5968
|
+
localeError: error13()
|
|
5346
5969
|
};
|
|
5347
5970
|
}
|
|
5348
5971
|
// ../../node_modules/zod/v4/locales/fr-CA.js
|
|
5349
|
-
var
|
|
5972
|
+
var error14 = () => {
|
|
5350
5973
|
const Sizable = {
|
|
5351
5974
|
string: { unit: "caractères", verb: "avoir" },
|
|
5352
5975
|
file: { unit: "octets", verb: "avoir" },
|
|
@@ -5459,11 +6082,11 @@ var error13 = () => {
|
|
|
5459
6082
|
};
|
|
5460
6083
|
function fr_CA_default() {
|
|
5461
6084
|
return {
|
|
5462
|
-
localeError:
|
|
6085
|
+
localeError: error14()
|
|
5463
6086
|
};
|
|
5464
6087
|
}
|
|
5465
6088
|
// ../../node_modules/zod/v4/locales/he.js
|
|
5466
|
-
var
|
|
6089
|
+
var error15 = () => {
|
|
5467
6090
|
const Sizable = {
|
|
5468
6091
|
string: { unit: "אותיות", verb: "לכלול" },
|
|
5469
6092
|
file: { unit: "בייטים", verb: "לכלול" },
|
|
@@ -5575,11 +6198,11 @@ var error14 = () => {
|
|
|
5575
6198
|
};
|
|
5576
6199
|
function he_default() {
|
|
5577
6200
|
return {
|
|
5578
|
-
localeError:
|
|
6201
|
+
localeError: error15()
|
|
5579
6202
|
};
|
|
5580
6203
|
}
|
|
5581
6204
|
// ../../node_modules/zod/v4/locales/hu.js
|
|
5582
|
-
var
|
|
6205
|
+
var error16 = () => {
|
|
5583
6206
|
const Sizable = {
|
|
5584
6207
|
string: { unit: "karakter", verb: "legyen" },
|
|
5585
6208
|
file: { unit: "byte", verb: "legyen" },
|
|
@@ -5691,11 +6314,11 @@ var error15 = () => {
|
|
|
5691
6314
|
};
|
|
5692
6315
|
function hu_default() {
|
|
5693
6316
|
return {
|
|
5694
|
-
localeError:
|
|
6317
|
+
localeError: error16()
|
|
5695
6318
|
};
|
|
5696
6319
|
}
|
|
5697
6320
|
// ../../node_modules/zod/v4/locales/id.js
|
|
5698
|
-
var
|
|
6321
|
+
var error17 = () => {
|
|
5699
6322
|
const Sizable = {
|
|
5700
6323
|
string: { unit: "karakter", verb: "memiliki" },
|
|
5701
6324
|
file: { unit: "byte", verb: "memiliki" },
|
|
@@ -5807,35 +6430,152 @@ var error16 = () => {
|
|
|
5807
6430
|
};
|
|
5808
6431
|
function id_default() {
|
|
5809
6432
|
return {
|
|
5810
|
-
localeError:
|
|
6433
|
+
localeError: error17()
|
|
5811
6434
|
};
|
|
5812
6435
|
}
|
|
5813
|
-
// ../../node_modules/zod/v4/locales/
|
|
5814
|
-
var
|
|
6436
|
+
// ../../node_modules/zod/v4/locales/is.js
|
|
6437
|
+
var parsedType3 = (data) => {
|
|
6438
|
+
const t = typeof data;
|
|
6439
|
+
switch (t) {
|
|
6440
|
+
case "number": {
|
|
6441
|
+
return Number.isNaN(data) ? "NaN" : "númer";
|
|
6442
|
+
}
|
|
6443
|
+
case "object": {
|
|
6444
|
+
if (Array.isArray(data)) {
|
|
6445
|
+
return "fylki";
|
|
6446
|
+
}
|
|
6447
|
+
if (data === null) {
|
|
6448
|
+
return "null";
|
|
6449
|
+
}
|
|
6450
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
6451
|
+
return data.constructor.name;
|
|
6452
|
+
}
|
|
6453
|
+
}
|
|
6454
|
+
}
|
|
6455
|
+
return t;
|
|
6456
|
+
};
|
|
6457
|
+
var error18 = () => {
|
|
5815
6458
|
const Sizable = {
|
|
5816
|
-
string: { unit: "
|
|
5817
|
-
file: { unit: "
|
|
5818
|
-
array: { unit: "
|
|
5819
|
-
set: { unit: "
|
|
6459
|
+
string: { unit: "stafi", verb: "að hafa" },
|
|
6460
|
+
file: { unit: "bæti", verb: "að hafa" },
|
|
6461
|
+
array: { unit: "hluti", verb: "að hafa" },
|
|
6462
|
+
set: { unit: "hluti", verb: "að hafa" }
|
|
5820
6463
|
};
|
|
5821
6464
|
function getSizing(origin) {
|
|
5822
6465
|
return Sizable[origin] ?? null;
|
|
5823
6466
|
}
|
|
5824
|
-
const
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
6467
|
+
const Nouns = {
|
|
6468
|
+
regex: "gildi",
|
|
6469
|
+
email: "netfang",
|
|
6470
|
+
url: "vefslóð",
|
|
6471
|
+
emoji: "emoji",
|
|
6472
|
+
uuid: "UUID",
|
|
6473
|
+
uuidv4: "UUIDv4",
|
|
6474
|
+
uuidv6: "UUIDv6",
|
|
6475
|
+
nanoid: "nanoid",
|
|
6476
|
+
guid: "GUID",
|
|
6477
|
+
cuid: "cuid",
|
|
6478
|
+
cuid2: "cuid2",
|
|
6479
|
+
ulid: "ULID",
|
|
6480
|
+
xid: "XID",
|
|
6481
|
+
ksuid: "KSUID",
|
|
6482
|
+
datetime: "ISO dagsetning og tími",
|
|
6483
|
+
date: "ISO dagsetning",
|
|
6484
|
+
time: "ISO tími",
|
|
6485
|
+
duration: "ISO tímalengd",
|
|
6486
|
+
ipv4: "IPv4 address",
|
|
6487
|
+
ipv6: "IPv6 address",
|
|
6488
|
+
cidrv4: "IPv4 range",
|
|
6489
|
+
cidrv6: "IPv6 range",
|
|
6490
|
+
base64: "base64-encoded strengur",
|
|
6491
|
+
base64url: "base64url-encoded strengur",
|
|
6492
|
+
json_string: "JSON strengur",
|
|
6493
|
+
e164: "E.164 tölugildi",
|
|
6494
|
+
jwt: "JWT",
|
|
6495
|
+
template_literal: "gildi"
|
|
6496
|
+
};
|
|
6497
|
+
return (issue2) => {
|
|
6498
|
+
switch (issue2.code) {
|
|
6499
|
+
case "invalid_type":
|
|
6500
|
+
return `Rangt gildi: Þú slóst inn ${parsedType3(issue2.input)} þar sem á að vera ${issue2.expected}`;
|
|
6501
|
+
case "invalid_value":
|
|
6502
|
+
if (issue2.values.length === 1)
|
|
6503
|
+
return `Rangt gildi: gert ráð fyrir ${stringifyPrimitive(issue2.values[0])}`;
|
|
6504
|
+
return `Ógilt val: má vera eitt af eftirfarandi ${joinValues(issue2.values, "|")}`;
|
|
6505
|
+
case "too_big": {
|
|
6506
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
6507
|
+
const sizing = getSizing(issue2.origin);
|
|
6508
|
+
if (sizing)
|
|
6509
|
+
return `Of stórt: gert er ráð fyrir að ${issue2.origin ?? "gildi"} hafi ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "hluti"}`;
|
|
6510
|
+
return `Of stórt: gert er ráð fyrir að ${issue2.origin ?? "gildi"} sé ${adj}${issue2.maximum.toString()}`;
|
|
6511
|
+
}
|
|
6512
|
+
case "too_small": {
|
|
6513
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
6514
|
+
const sizing = getSizing(issue2.origin);
|
|
6515
|
+
if (sizing) {
|
|
6516
|
+
return `Of lítið: gert er ráð fyrir að ${issue2.origin} hafi ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
6517
|
+
}
|
|
6518
|
+
return `Of lítið: gert er ráð fyrir að ${issue2.origin} sé ${adj}${issue2.minimum.toString()}`;
|
|
6519
|
+
}
|
|
6520
|
+
case "invalid_format": {
|
|
6521
|
+
const _issue = issue2;
|
|
6522
|
+
if (_issue.format === "starts_with") {
|
|
6523
|
+
return `Ógildur strengur: verður að byrja á "${_issue.prefix}"`;
|
|
6524
|
+
}
|
|
6525
|
+
if (_issue.format === "ends_with")
|
|
6526
|
+
return `Ógildur strengur: verður að enda á "${_issue.suffix}"`;
|
|
6527
|
+
if (_issue.format === "includes")
|
|
6528
|
+
return `Ógildur strengur: verður að innihalda "${_issue.includes}"`;
|
|
6529
|
+
if (_issue.format === "regex")
|
|
6530
|
+
return `Ógildur strengur: verður að fylgja mynstri ${_issue.pattern}`;
|
|
6531
|
+
return `Rangt ${Nouns[_issue.format] ?? issue2.format}`;
|
|
6532
|
+
}
|
|
6533
|
+
case "not_multiple_of":
|
|
6534
|
+
return `Röng tala: verður að vera margfeldi af ${issue2.divisor}`;
|
|
6535
|
+
case "unrecognized_keys":
|
|
6536
|
+
return `Óþekkt ${issue2.keys.length > 1 ? "ir lyklar" : "ur lykill"}: ${joinValues(issue2.keys, ", ")}`;
|
|
6537
|
+
case "invalid_key":
|
|
6538
|
+
return `Rangur lykill í ${issue2.origin}`;
|
|
6539
|
+
case "invalid_union":
|
|
6540
|
+
return "Rangt gildi";
|
|
6541
|
+
case "invalid_element":
|
|
6542
|
+
return `Rangt gildi í ${issue2.origin}`;
|
|
6543
|
+
default:
|
|
6544
|
+
return `Rangt gildi`;
|
|
6545
|
+
}
|
|
6546
|
+
};
|
|
6547
|
+
};
|
|
6548
|
+
function is_default() {
|
|
6549
|
+
return {
|
|
6550
|
+
localeError: error18()
|
|
6551
|
+
};
|
|
6552
|
+
}
|
|
6553
|
+
// ../../node_modules/zod/v4/locales/it.js
|
|
6554
|
+
var error19 = () => {
|
|
6555
|
+
const Sizable = {
|
|
6556
|
+
string: { unit: "caratteri", verb: "avere" },
|
|
6557
|
+
file: { unit: "byte", verb: "avere" },
|
|
6558
|
+
array: { unit: "elementi", verb: "avere" },
|
|
6559
|
+
set: { unit: "elementi", verb: "avere" }
|
|
6560
|
+
};
|
|
6561
|
+
function getSizing(origin) {
|
|
6562
|
+
return Sizable[origin] ?? null;
|
|
6563
|
+
}
|
|
6564
|
+
const parsedType4 = (data) => {
|
|
6565
|
+
const t = typeof data;
|
|
6566
|
+
switch (t) {
|
|
6567
|
+
case "number": {
|
|
6568
|
+
return Number.isNaN(data) ? "NaN" : "numero";
|
|
6569
|
+
}
|
|
6570
|
+
case "object": {
|
|
6571
|
+
if (Array.isArray(data)) {
|
|
6572
|
+
return "vettore";
|
|
6573
|
+
}
|
|
6574
|
+
if (data === null) {
|
|
6575
|
+
return "null";
|
|
6576
|
+
}
|
|
6577
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
6578
|
+
return data.constructor.name;
|
|
5839
6579
|
}
|
|
5840
6580
|
}
|
|
5841
6581
|
}
|
|
@@ -5874,7 +6614,7 @@ var error17 = () => {
|
|
|
5874
6614
|
return (issue2) => {
|
|
5875
6615
|
switch (issue2.code) {
|
|
5876
6616
|
case "invalid_type":
|
|
5877
|
-
return `Input non valido: atteso ${issue2.expected}, ricevuto ${
|
|
6617
|
+
return `Input non valido: atteso ${issue2.expected}, ricevuto ${parsedType4(issue2.input)}`;
|
|
5878
6618
|
case "invalid_value":
|
|
5879
6619
|
if (issue2.values.length === 1)
|
|
5880
6620
|
return `Input non valido: atteso ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -5923,11 +6663,11 @@ var error17 = () => {
|
|
|
5923
6663
|
};
|
|
5924
6664
|
function it_default() {
|
|
5925
6665
|
return {
|
|
5926
|
-
localeError:
|
|
6666
|
+
localeError: error19()
|
|
5927
6667
|
};
|
|
5928
6668
|
}
|
|
5929
6669
|
// ../../node_modules/zod/v4/locales/ja.js
|
|
5930
|
-
var
|
|
6670
|
+
var error20 = () => {
|
|
5931
6671
|
const Sizable = {
|
|
5932
6672
|
string: { unit: "文字", verb: "である" },
|
|
5933
6673
|
file: { unit: "バイト", verb: "である" },
|
|
@@ -5937,7 +6677,7 @@ var error18 = () => {
|
|
|
5937
6677
|
function getSizing(origin) {
|
|
5938
6678
|
return Sizable[origin] ?? null;
|
|
5939
6679
|
}
|
|
5940
|
-
const
|
|
6680
|
+
const parsedType4 = (data) => {
|
|
5941
6681
|
const t = typeof data;
|
|
5942
6682
|
switch (t) {
|
|
5943
6683
|
case "number": {
|
|
@@ -5990,7 +6730,7 @@ var error18 = () => {
|
|
|
5990
6730
|
return (issue2) => {
|
|
5991
6731
|
switch (issue2.code) {
|
|
5992
6732
|
case "invalid_type":
|
|
5993
|
-
return `無効な入力: ${issue2.expected}が期待されましたが、${
|
|
6733
|
+
return `無効な入力: ${issue2.expected}が期待されましたが、${parsedType4(issue2.input)}が入力されました`;
|
|
5994
6734
|
case "invalid_value":
|
|
5995
6735
|
if (issue2.values.length === 1)
|
|
5996
6736
|
return `無効な入力: ${stringifyPrimitive(issue2.values[0])}が期待されました`;
|
|
@@ -6038,11 +6778,136 @@ var error18 = () => {
|
|
|
6038
6778
|
};
|
|
6039
6779
|
function ja_default() {
|
|
6040
6780
|
return {
|
|
6041
|
-
localeError:
|
|
6781
|
+
localeError: error20()
|
|
6042
6782
|
};
|
|
6043
6783
|
}
|
|
6044
|
-
// ../../node_modules/zod/v4/locales/
|
|
6045
|
-
var
|
|
6784
|
+
// ../../node_modules/zod/v4/locales/ka.js
|
|
6785
|
+
var parsedType4 = (data) => {
|
|
6786
|
+
const t = typeof data;
|
|
6787
|
+
switch (t) {
|
|
6788
|
+
case "number": {
|
|
6789
|
+
return Number.isNaN(data) ? "NaN" : "რიცხვი";
|
|
6790
|
+
}
|
|
6791
|
+
case "object": {
|
|
6792
|
+
if (Array.isArray(data)) {
|
|
6793
|
+
return "მასივი";
|
|
6794
|
+
}
|
|
6795
|
+
if (data === null) {
|
|
6796
|
+
return "null";
|
|
6797
|
+
}
|
|
6798
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
6799
|
+
return data.constructor.name;
|
|
6800
|
+
}
|
|
6801
|
+
}
|
|
6802
|
+
}
|
|
6803
|
+
const typeMap = {
|
|
6804
|
+
string: "სტრინგი",
|
|
6805
|
+
boolean: "ბულეანი",
|
|
6806
|
+
undefined: "undefined",
|
|
6807
|
+
bigint: "bigint",
|
|
6808
|
+
symbol: "symbol",
|
|
6809
|
+
function: "ფუნქცია"
|
|
6810
|
+
};
|
|
6811
|
+
return typeMap[t] ?? t;
|
|
6812
|
+
};
|
|
6813
|
+
var error21 = () => {
|
|
6814
|
+
const Sizable = {
|
|
6815
|
+
string: { unit: "სიმბოლო", verb: "უნდა შეიცავდეს" },
|
|
6816
|
+
file: { unit: "ბაიტი", verb: "უნდა შეიცავდეს" },
|
|
6817
|
+
array: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" },
|
|
6818
|
+
set: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" }
|
|
6819
|
+
};
|
|
6820
|
+
function getSizing(origin) {
|
|
6821
|
+
return Sizable[origin] ?? null;
|
|
6822
|
+
}
|
|
6823
|
+
const Nouns = {
|
|
6824
|
+
regex: "შეყვანა",
|
|
6825
|
+
email: "ელ-ფოსტის მისამართი",
|
|
6826
|
+
url: "URL",
|
|
6827
|
+
emoji: "ემოჯი",
|
|
6828
|
+
uuid: "UUID",
|
|
6829
|
+
uuidv4: "UUIDv4",
|
|
6830
|
+
uuidv6: "UUIDv6",
|
|
6831
|
+
nanoid: "nanoid",
|
|
6832
|
+
guid: "GUID",
|
|
6833
|
+
cuid: "cuid",
|
|
6834
|
+
cuid2: "cuid2",
|
|
6835
|
+
ulid: "ULID",
|
|
6836
|
+
xid: "XID",
|
|
6837
|
+
ksuid: "KSUID",
|
|
6838
|
+
datetime: "თარიღი-დრო",
|
|
6839
|
+
date: "თარიღი",
|
|
6840
|
+
time: "დრო",
|
|
6841
|
+
duration: "ხანგრძლივობა",
|
|
6842
|
+
ipv4: "IPv4 მისამართი",
|
|
6843
|
+
ipv6: "IPv6 მისამართი",
|
|
6844
|
+
cidrv4: "IPv4 დიაპაზონი",
|
|
6845
|
+
cidrv6: "IPv6 დიაპაზონი",
|
|
6846
|
+
base64: "base64-კოდირებული სტრინგი",
|
|
6847
|
+
base64url: "base64url-კოდირებული სტრინგი",
|
|
6848
|
+
json_string: "JSON სტრინგი",
|
|
6849
|
+
e164: "E.164 ნომერი",
|
|
6850
|
+
jwt: "JWT",
|
|
6851
|
+
template_literal: "შეყვანა"
|
|
6852
|
+
};
|
|
6853
|
+
return (issue2) => {
|
|
6854
|
+
switch (issue2.code) {
|
|
6855
|
+
case "invalid_type":
|
|
6856
|
+
return `არასწორი შეყვანა: მოსალოდნელი ${issue2.expected}, მიღებული ${parsedType4(issue2.input)}`;
|
|
6857
|
+
case "invalid_value":
|
|
6858
|
+
if (issue2.values.length === 1)
|
|
6859
|
+
return `არასწორი შეყვანა: მოსალოდნელი ${stringifyPrimitive(issue2.values[0])}`;
|
|
6860
|
+
return `არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${joinValues(issue2.values, "|")}-დან`;
|
|
6861
|
+
case "too_big": {
|
|
6862
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
6863
|
+
const sizing = getSizing(issue2.origin);
|
|
6864
|
+
if (sizing)
|
|
6865
|
+
return `ზედმეტად დიდი: მოსალოდნელი ${issue2.origin ?? "მნიშვნელობა"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit}`;
|
|
6866
|
+
return `ზედმეტად დიდი: მოსალოდნელი ${issue2.origin ?? "მნიშვნელობა"} იყოს ${adj}${issue2.maximum.toString()}`;
|
|
6867
|
+
}
|
|
6868
|
+
case "too_small": {
|
|
6869
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
6870
|
+
const sizing = getSizing(issue2.origin);
|
|
6871
|
+
if (sizing) {
|
|
6872
|
+
return `ზედმეტად პატარა: მოსალოდნელი ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`;
|
|
6873
|
+
}
|
|
6874
|
+
return `ზედმეტად პატარა: მოსალოდნელი ${issue2.origin} იყოს ${adj}${issue2.minimum.toString()}`;
|
|
6875
|
+
}
|
|
6876
|
+
case "invalid_format": {
|
|
6877
|
+
const _issue = issue2;
|
|
6878
|
+
if (_issue.format === "starts_with") {
|
|
6879
|
+
return `არასწორი სტრინგი: უნდა იწყებოდეს "${_issue.prefix}"-ით`;
|
|
6880
|
+
}
|
|
6881
|
+
if (_issue.format === "ends_with")
|
|
6882
|
+
return `არასწორი სტრინგი: უნდა მთავრდებოდეს "${_issue.suffix}"-ით`;
|
|
6883
|
+
if (_issue.format === "includes")
|
|
6884
|
+
return `არასწორი სტრინგი: უნდა შეიცავდეს "${_issue.includes}"-ს`;
|
|
6885
|
+
if (_issue.format === "regex")
|
|
6886
|
+
return `არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${_issue.pattern}`;
|
|
6887
|
+
return `არასწორი ${Nouns[_issue.format] ?? issue2.format}`;
|
|
6888
|
+
}
|
|
6889
|
+
case "not_multiple_of":
|
|
6890
|
+
return `არასწორი რიცხვი: უნდა იყოს ${issue2.divisor}-ის ჯერადი`;
|
|
6891
|
+
case "unrecognized_keys":
|
|
6892
|
+
return `უცნობი გასაღებ${issue2.keys.length > 1 ? "ები" : "ი"}: ${joinValues(issue2.keys, ", ")}`;
|
|
6893
|
+
case "invalid_key":
|
|
6894
|
+
return `არასწორი გასაღები ${issue2.origin}-ში`;
|
|
6895
|
+
case "invalid_union":
|
|
6896
|
+
return "არასწორი შეყვანა";
|
|
6897
|
+
case "invalid_element":
|
|
6898
|
+
return `არასწორი მნიშვნელობა ${issue2.origin}-ში`;
|
|
6899
|
+
default:
|
|
6900
|
+
return `არასწორი შეყვანა`;
|
|
6901
|
+
}
|
|
6902
|
+
};
|
|
6903
|
+
};
|
|
6904
|
+
function ka_default() {
|
|
6905
|
+
return {
|
|
6906
|
+
localeError: error21()
|
|
6907
|
+
};
|
|
6908
|
+
}
|
|
6909
|
+
// ../../node_modules/zod/v4/locales/km.js
|
|
6910
|
+
var error22 = () => {
|
|
6046
6911
|
const Sizable = {
|
|
6047
6912
|
string: { unit: "តួអក្សរ", verb: "គួរមាន" },
|
|
6048
6913
|
file: { unit: "បៃ", verb: "គួរមាន" },
|
|
@@ -6052,7 +6917,7 @@ var error19 = () => {
|
|
|
6052
6917
|
function getSizing(origin) {
|
|
6053
6918
|
return Sizable[origin] ?? null;
|
|
6054
6919
|
}
|
|
6055
|
-
const
|
|
6920
|
+
const parsedType5 = (data) => {
|
|
6056
6921
|
const t = typeof data;
|
|
6057
6922
|
switch (t) {
|
|
6058
6923
|
case "number": {
|
|
@@ -6105,7 +6970,7 @@ var error19 = () => {
|
|
|
6105
6970
|
return (issue2) => {
|
|
6106
6971
|
switch (issue2.code) {
|
|
6107
6972
|
case "invalid_type":
|
|
6108
|
-
return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue2.expected} ប៉ុន្តែទទួលបាន ${
|
|
6973
|
+
return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue2.expected} ប៉ុន្តែទទួលបាន ${parsedType5(issue2.input)}`;
|
|
6109
6974
|
case "invalid_value":
|
|
6110
6975
|
if (issue2.values.length === 1)
|
|
6111
6976
|
return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -6153,13 +7018,18 @@ var error19 = () => {
|
|
|
6153
7018
|
}
|
|
6154
7019
|
};
|
|
6155
7020
|
};
|
|
6156
|
-
function
|
|
7021
|
+
function km_default() {
|
|
6157
7022
|
return {
|
|
6158
|
-
localeError:
|
|
7023
|
+
localeError: error22()
|
|
6159
7024
|
};
|
|
6160
7025
|
}
|
|
7026
|
+
|
|
7027
|
+
// ../../node_modules/zod/v4/locales/kh.js
|
|
7028
|
+
function kh_default() {
|
|
7029
|
+
return km_default();
|
|
7030
|
+
}
|
|
6161
7031
|
// ../../node_modules/zod/v4/locales/ko.js
|
|
6162
|
-
var
|
|
7032
|
+
var error23 = () => {
|
|
6163
7033
|
const Sizable = {
|
|
6164
7034
|
string: { unit: "문자", verb: "to have" },
|
|
6165
7035
|
file: { unit: "바이트", verb: "to have" },
|
|
@@ -6169,7 +7039,7 @@ var error20 = () => {
|
|
|
6169
7039
|
function getSizing(origin) {
|
|
6170
7040
|
return Sizable[origin] ?? null;
|
|
6171
7041
|
}
|
|
6172
|
-
const
|
|
7042
|
+
const parsedType5 = (data) => {
|
|
6173
7043
|
const t = typeof data;
|
|
6174
7044
|
switch (t) {
|
|
6175
7045
|
case "number": {
|
|
@@ -6222,7 +7092,7 @@ var error20 = () => {
|
|
|
6222
7092
|
return (issue2) => {
|
|
6223
7093
|
switch (issue2.code) {
|
|
6224
7094
|
case "invalid_type":
|
|
6225
|
-
return `잘못된 입력: 예상 타입은 ${issue2.expected}, 받은 타입은 ${
|
|
7095
|
+
return `잘못된 입력: 예상 타입은 ${issue2.expected}, 받은 타입은 ${parsedType5(issue2.input)}입니다`;
|
|
6226
7096
|
case "invalid_value":
|
|
6227
7097
|
if (issue2.values.length === 1)
|
|
6228
7098
|
return `잘못된 입력: 값은 ${stringifyPrimitive(issue2.values[0])} 이어야 합니다`;
|
|
@@ -6276,11 +7146,240 @@ var error20 = () => {
|
|
|
6276
7146
|
};
|
|
6277
7147
|
function ko_default() {
|
|
6278
7148
|
return {
|
|
6279
|
-
localeError:
|
|
7149
|
+
localeError: error23()
|
|
7150
|
+
};
|
|
7151
|
+
}
|
|
7152
|
+
// ../../node_modules/zod/v4/locales/lt.js
|
|
7153
|
+
var parsedType5 = (data) => {
|
|
7154
|
+
const t = typeof data;
|
|
7155
|
+
return parsedTypeFromType(t, data);
|
|
7156
|
+
};
|
|
7157
|
+
var parsedTypeFromType = (t, data = undefined) => {
|
|
7158
|
+
switch (t) {
|
|
7159
|
+
case "number": {
|
|
7160
|
+
return Number.isNaN(data) ? "NaN" : "skaičius";
|
|
7161
|
+
}
|
|
7162
|
+
case "bigint": {
|
|
7163
|
+
return "sveikasis skaičius";
|
|
7164
|
+
}
|
|
7165
|
+
case "string": {
|
|
7166
|
+
return "eilutė";
|
|
7167
|
+
}
|
|
7168
|
+
case "boolean": {
|
|
7169
|
+
return "loginė reikšmė";
|
|
7170
|
+
}
|
|
7171
|
+
case "undefined":
|
|
7172
|
+
case "void": {
|
|
7173
|
+
return "neapibrėžta reikšmė";
|
|
7174
|
+
}
|
|
7175
|
+
case "function": {
|
|
7176
|
+
return "funkcija";
|
|
7177
|
+
}
|
|
7178
|
+
case "symbol": {
|
|
7179
|
+
return "simbolis";
|
|
7180
|
+
}
|
|
7181
|
+
case "object": {
|
|
7182
|
+
if (data === undefined)
|
|
7183
|
+
return "nežinomas objektas";
|
|
7184
|
+
if (data === null)
|
|
7185
|
+
return "nulinė reikšmė";
|
|
7186
|
+
if (Array.isArray(data))
|
|
7187
|
+
return "masyvas";
|
|
7188
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
7189
|
+
return data.constructor.name;
|
|
7190
|
+
}
|
|
7191
|
+
return "objektas";
|
|
7192
|
+
}
|
|
7193
|
+
case "null": {
|
|
7194
|
+
return "nulinė reikšmė";
|
|
7195
|
+
}
|
|
7196
|
+
}
|
|
7197
|
+
return t;
|
|
7198
|
+
};
|
|
7199
|
+
var capitalizeFirstCharacter = (text) => {
|
|
7200
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
7201
|
+
};
|
|
7202
|
+
function getUnitTypeFromNumber(number2) {
|
|
7203
|
+
const abs = Math.abs(number2);
|
|
7204
|
+
const last = abs % 10;
|
|
7205
|
+
const last2 = abs % 100;
|
|
7206
|
+
if (last2 >= 11 && last2 <= 19 || last === 0)
|
|
7207
|
+
return "many";
|
|
7208
|
+
if (last === 1)
|
|
7209
|
+
return "one";
|
|
7210
|
+
return "few";
|
|
7211
|
+
}
|
|
7212
|
+
var error24 = () => {
|
|
7213
|
+
const Sizable = {
|
|
7214
|
+
string: {
|
|
7215
|
+
unit: {
|
|
7216
|
+
one: "simbolis",
|
|
7217
|
+
few: "simboliai",
|
|
7218
|
+
many: "simbolių"
|
|
7219
|
+
},
|
|
7220
|
+
verb: {
|
|
7221
|
+
smaller: {
|
|
7222
|
+
inclusive: "turi būti ne ilgesnė kaip",
|
|
7223
|
+
notInclusive: "turi būti trumpesnė kaip"
|
|
7224
|
+
},
|
|
7225
|
+
bigger: {
|
|
7226
|
+
inclusive: "turi būti ne trumpesnė kaip",
|
|
7227
|
+
notInclusive: "turi būti ilgesnė kaip"
|
|
7228
|
+
}
|
|
7229
|
+
}
|
|
7230
|
+
},
|
|
7231
|
+
file: {
|
|
7232
|
+
unit: {
|
|
7233
|
+
one: "baitas",
|
|
7234
|
+
few: "baitai",
|
|
7235
|
+
many: "baitų"
|
|
7236
|
+
},
|
|
7237
|
+
verb: {
|
|
7238
|
+
smaller: {
|
|
7239
|
+
inclusive: "turi būti ne didesnis kaip",
|
|
7240
|
+
notInclusive: "turi būti mažesnis kaip"
|
|
7241
|
+
},
|
|
7242
|
+
bigger: {
|
|
7243
|
+
inclusive: "turi būti ne mažesnis kaip",
|
|
7244
|
+
notInclusive: "turi būti didesnis kaip"
|
|
7245
|
+
}
|
|
7246
|
+
}
|
|
7247
|
+
},
|
|
7248
|
+
array: {
|
|
7249
|
+
unit: {
|
|
7250
|
+
one: "elementą",
|
|
7251
|
+
few: "elementus",
|
|
7252
|
+
many: "elementų"
|
|
7253
|
+
},
|
|
7254
|
+
verb: {
|
|
7255
|
+
smaller: {
|
|
7256
|
+
inclusive: "turi turėti ne daugiau kaip",
|
|
7257
|
+
notInclusive: "turi turėti mažiau kaip"
|
|
7258
|
+
},
|
|
7259
|
+
bigger: {
|
|
7260
|
+
inclusive: "turi turėti ne mažiau kaip",
|
|
7261
|
+
notInclusive: "turi turėti daugiau kaip"
|
|
7262
|
+
}
|
|
7263
|
+
}
|
|
7264
|
+
},
|
|
7265
|
+
set: {
|
|
7266
|
+
unit: {
|
|
7267
|
+
one: "elementą",
|
|
7268
|
+
few: "elementus",
|
|
7269
|
+
many: "elementų"
|
|
7270
|
+
},
|
|
7271
|
+
verb: {
|
|
7272
|
+
smaller: {
|
|
7273
|
+
inclusive: "turi turėti ne daugiau kaip",
|
|
7274
|
+
notInclusive: "turi turėti mažiau kaip"
|
|
7275
|
+
},
|
|
7276
|
+
bigger: {
|
|
7277
|
+
inclusive: "turi turėti ne mažiau kaip",
|
|
7278
|
+
notInclusive: "turi turėti daugiau kaip"
|
|
7279
|
+
}
|
|
7280
|
+
}
|
|
7281
|
+
}
|
|
7282
|
+
};
|
|
7283
|
+
function getSizing(origin, unitType, inclusive, targetShouldBe) {
|
|
7284
|
+
const result = Sizable[origin] ?? null;
|
|
7285
|
+
if (result === null)
|
|
7286
|
+
return result;
|
|
7287
|
+
return {
|
|
7288
|
+
unit: result.unit[unitType],
|
|
7289
|
+
verb: result.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"]
|
|
7290
|
+
};
|
|
7291
|
+
}
|
|
7292
|
+
const Nouns = {
|
|
7293
|
+
regex: "įvestis",
|
|
7294
|
+
email: "el. pašto adresas",
|
|
7295
|
+
url: "URL",
|
|
7296
|
+
emoji: "jaustukas",
|
|
7297
|
+
uuid: "UUID",
|
|
7298
|
+
uuidv4: "UUIDv4",
|
|
7299
|
+
uuidv6: "UUIDv6",
|
|
7300
|
+
nanoid: "nanoid",
|
|
7301
|
+
guid: "GUID",
|
|
7302
|
+
cuid: "cuid",
|
|
7303
|
+
cuid2: "cuid2",
|
|
7304
|
+
ulid: "ULID",
|
|
7305
|
+
xid: "XID",
|
|
7306
|
+
ksuid: "KSUID",
|
|
7307
|
+
datetime: "ISO data ir laikas",
|
|
7308
|
+
date: "ISO data",
|
|
7309
|
+
time: "ISO laikas",
|
|
7310
|
+
duration: "ISO trukmė",
|
|
7311
|
+
ipv4: "IPv4 adresas",
|
|
7312
|
+
ipv6: "IPv6 adresas",
|
|
7313
|
+
cidrv4: "IPv4 tinklo prefiksas (CIDR)",
|
|
7314
|
+
cidrv6: "IPv6 tinklo prefiksas (CIDR)",
|
|
7315
|
+
base64: "base64 užkoduota eilutė",
|
|
7316
|
+
base64url: "base64url užkoduota eilutė",
|
|
7317
|
+
json_string: "JSON eilutė",
|
|
7318
|
+
e164: "E.164 numeris",
|
|
7319
|
+
jwt: "JWT",
|
|
7320
|
+
template_literal: "įvestis"
|
|
7321
|
+
};
|
|
7322
|
+
return (issue2) => {
|
|
7323
|
+
switch (issue2.code) {
|
|
7324
|
+
case "invalid_type":
|
|
7325
|
+
return `Gautas tipas ${parsedType5(issue2.input)}, o tikėtasi - ${parsedTypeFromType(issue2.expected)}`;
|
|
7326
|
+
case "invalid_value":
|
|
7327
|
+
if (issue2.values.length === 1)
|
|
7328
|
+
return `Privalo būti ${stringifyPrimitive(issue2.values[0])}`;
|
|
7329
|
+
return `Privalo būti vienas iš ${joinValues(issue2.values, "|")} pasirinkimų`;
|
|
7330
|
+
case "too_big": {
|
|
7331
|
+
const origin = parsedTypeFromType(issue2.origin);
|
|
7332
|
+
const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.maximum)), issue2.inclusive ?? false, "smaller");
|
|
7333
|
+
if (sizing?.verb)
|
|
7334
|
+
return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} ${sizing.verb} ${issue2.maximum.toString()} ${sizing.unit ?? "elementų"}`;
|
|
7335
|
+
const adj = issue2.inclusive ? "ne didesnis kaip" : "mažesnis kaip";
|
|
7336
|
+
return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} turi būti ${adj} ${issue2.maximum.toString()} ${sizing?.unit}`;
|
|
7337
|
+
}
|
|
7338
|
+
case "too_small": {
|
|
7339
|
+
const origin = parsedTypeFromType(issue2.origin);
|
|
7340
|
+
const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.minimum)), issue2.inclusive ?? false, "bigger");
|
|
7341
|
+
if (sizing?.verb)
|
|
7342
|
+
return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} ${sizing.verb} ${issue2.minimum.toString()} ${sizing.unit ?? "elementų"}`;
|
|
7343
|
+
const adj = issue2.inclusive ? "ne mažesnis kaip" : "didesnis kaip";
|
|
7344
|
+
return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} turi būti ${adj} ${issue2.minimum.toString()} ${sizing?.unit}`;
|
|
7345
|
+
}
|
|
7346
|
+
case "invalid_format": {
|
|
7347
|
+
const _issue = issue2;
|
|
7348
|
+
if (_issue.format === "starts_with") {
|
|
7349
|
+
return `Eilutė privalo prasidėti "${_issue.prefix}"`;
|
|
7350
|
+
}
|
|
7351
|
+
if (_issue.format === "ends_with")
|
|
7352
|
+
return `Eilutė privalo pasibaigti "${_issue.suffix}"`;
|
|
7353
|
+
if (_issue.format === "includes")
|
|
7354
|
+
return `Eilutė privalo įtraukti "${_issue.includes}"`;
|
|
7355
|
+
if (_issue.format === "regex")
|
|
7356
|
+
return `Eilutė privalo atitikti ${_issue.pattern}`;
|
|
7357
|
+
return `Neteisingas ${Nouns[_issue.format] ?? issue2.format}`;
|
|
7358
|
+
}
|
|
7359
|
+
case "not_multiple_of":
|
|
7360
|
+
return `Skaičius privalo būti ${issue2.divisor} kartotinis.`;
|
|
7361
|
+
case "unrecognized_keys":
|
|
7362
|
+
return `Neatpažint${issue2.keys.length > 1 ? "i" : "as"} rakt${issue2.keys.length > 1 ? "ai" : "as"}: ${joinValues(issue2.keys, ", ")}`;
|
|
7363
|
+
case "invalid_key":
|
|
7364
|
+
return "Rastas klaidingas raktas";
|
|
7365
|
+
case "invalid_union":
|
|
7366
|
+
return "Klaidinga įvestis";
|
|
7367
|
+
case "invalid_element": {
|
|
7368
|
+
const origin = parsedTypeFromType(issue2.origin);
|
|
7369
|
+
return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} turi klaidingą įvestį`;
|
|
7370
|
+
}
|
|
7371
|
+
default:
|
|
7372
|
+
return "Klaidinga įvestis";
|
|
7373
|
+
}
|
|
7374
|
+
};
|
|
7375
|
+
};
|
|
7376
|
+
function lt_default() {
|
|
7377
|
+
return {
|
|
7378
|
+
localeError: error24()
|
|
6280
7379
|
};
|
|
6281
7380
|
}
|
|
6282
7381
|
// ../../node_modules/zod/v4/locales/mk.js
|
|
6283
|
-
var
|
|
7382
|
+
var error25 = () => {
|
|
6284
7383
|
const Sizable = {
|
|
6285
7384
|
string: { unit: "знаци", verb: "да имаат" },
|
|
6286
7385
|
file: { unit: "бајти", verb: "да имаат" },
|
|
@@ -6290,7 +7389,7 @@ var error21 = () => {
|
|
|
6290
7389
|
function getSizing(origin) {
|
|
6291
7390
|
return Sizable[origin] ?? null;
|
|
6292
7391
|
}
|
|
6293
|
-
const
|
|
7392
|
+
const parsedType6 = (data) => {
|
|
6294
7393
|
const t = typeof data;
|
|
6295
7394
|
switch (t) {
|
|
6296
7395
|
case "number": {
|
|
@@ -6343,7 +7442,7 @@ var error21 = () => {
|
|
|
6343
7442
|
return (issue2) => {
|
|
6344
7443
|
switch (issue2.code) {
|
|
6345
7444
|
case "invalid_type":
|
|
6346
|
-
return `Грешен внес: се очекува ${issue2.expected}, примено ${
|
|
7445
|
+
return `Грешен внес: се очекува ${issue2.expected}, примено ${parsedType6(issue2.input)}`;
|
|
6347
7446
|
case "invalid_value":
|
|
6348
7447
|
if (issue2.values.length === 1)
|
|
6349
7448
|
return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -6393,11 +7492,11 @@ var error21 = () => {
|
|
|
6393
7492
|
};
|
|
6394
7493
|
function mk_default() {
|
|
6395
7494
|
return {
|
|
6396
|
-
localeError:
|
|
7495
|
+
localeError: error25()
|
|
6397
7496
|
};
|
|
6398
7497
|
}
|
|
6399
7498
|
// ../../node_modules/zod/v4/locales/ms.js
|
|
6400
|
-
var
|
|
7499
|
+
var error26 = () => {
|
|
6401
7500
|
const Sizable = {
|
|
6402
7501
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
6403
7502
|
file: { unit: "bait", verb: "mempunyai" },
|
|
@@ -6407,7 +7506,7 @@ var error22 = () => {
|
|
|
6407
7506
|
function getSizing(origin) {
|
|
6408
7507
|
return Sizable[origin] ?? null;
|
|
6409
7508
|
}
|
|
6410
|
-
const
|
|
7509
|
+
const parsedType6 = (data) => {
|
|
6411
7510
|
const t = typeof data;
|
|
6412
7511
|
switch (t) {
|
|
6413
7512
|
case "number": {
|
|
@@ -6460,7 +7559,7 @@ var error22 = () => {
|
|
|
6460
7559
|
return (issue2) => {
|
|
6461
7560
|
switch (issue2.code) {
|
|
6462
7561
|
case "invalid_type":
|
|
6463
|
-
return `Input tidak sah: dijangka ${issue2.expected}, diterima ${
|
|
7562
|
+
return `Input tidak sah: dijangka ${issue2.expected}, diterima ${parsedType6(issue2.input)}`;
|
|
6464
7563
|
case "invalid_value":
|
|
6465
7564
|
if (issue2.values.length === 1)
|
|
6466
7565
|
return `Input tidak sah: dijangka ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -6509,11 +7608,11 @@ var error22 = () => {
|
|
|
6509
7608
|
};
|
|
6510
7609
|
function ms_default() {
|
|
6511
7610
|
return {
|
|
6512
|
-
localeError:
|
|
7611
|
+
localeError: error26()
|
|
6513
7612
|
};
|
|
6514
7613
|
}
|
|
6515
7614
|
// ../../node_modules/zod/v4/locales/nl.js
|
|
6516
|
-
var
|
|
7615
|
+
var error27 = () => {
|
|
6517
7616
|
const Sizable = {
|
|
6518
7617
|
string: { unit: "tekens" },
|
|
6519
7618
|
file: { unit: "bytes" },
|
|
@@ -6523,7 +7622,7 @@ var error23 = () => {
|
|
|
6523
7622
|
function getSizing(origin) {
|
|
6524
7623
|
return Sizable[origin] ?? null;
|
|
6525
7624
|
}
|
|
6526
|
-
const
|
|
7625
|
+
const parsedType6 = (data) => {
|
|
6527
7626
|
const t = typeof data;
|
|
6528
7627
|
switch (t) {
|
|
6529
7628
|
case "number": {
|
|
@@ -6576,7 +7675,7 @@ var error23 = () => {
|
|
|
6576
7675
|
return (issue2) => {
|
|
6577
7676
|
switch (issue2.code) {
|
|
6578
7677
|
case "invalid_type":
|
|
6579
|
-
return `Ongeldige invoer: verwacht ${issue2.expected}, ontving ${
|
|
7678
|
+
return `Ongeldige invoer: verwacht ${issue2.expected}, ontving ${parsedType6(issue2.input)}`;
|
|
6580
7679
|
case "invalid_value":
|
|
6581
7680
|
if (issue2.values.length === 1)
|
|
6582
7681
|
return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -6626,11 +7725,11 @@ var error23 = () => {
|
|
|
6626
7725
|
};
|
|
6627
7726
|
function nl_default() {
|
|
6628
7727
|
return {
|
|
6629
|
-
localeError:
|
|
7728
|
+
localeError: error27()
|
|
6630
7729
|
};
|
|
6631
7730
|
}
|
|
6632
7731
|
// ../../node_modules/zod/v4/locales/no.js
|
|
6633
|
-
var
|
|
7732
|
+
var error28 = () => {
|
|
6634
7733
|
const Sizable = {
|
|
6635
7734
|
string: { unit: "tegn", verb: "å ha" },
|
|
6636
7735
|
file: { unit: "bytes", verb: "å ha" },
|
|
@@ -6640,7 +7739,7 @@ var error24 = () => {
|
|
|
6640
7739
|
function getSizing(origin) {
|
|
6641
7740
|
return Sizable[origin] ?? null;
|
|
6642
7741
|
}
|
|
6643
|
-
const
|
|
7742
|
+
const parsedType6 = (data) => {
|
|
6644
7743
|
const t = typeof data;
|
|
6645
7744
|
switch (t) {
|
|
6646
7745
|
case "number": {
|
|
@@ -6693,7 +7792,7 @@ var error24 = () => {
|
|
|
6693
7792
|
return (issue2) => {
|
|
6694
7793
|
switch (issue2.code) {
|
|
6695
7794
|
case "invalid_type":
|
|
6696
|
-
return `Ugyldig input: forventet ${issue2.expected}, fikk ${
|
|
7795
|
+
return `Ugyldig input: forventet ${issue2.expected}, fikk ${parsedType6(issue2.input)}`;
|
|
6697
7796
|
case "invalid_value":
|
|
6698
7797
|
if (issue2.values.length === 1)
|
|
6699
7798
|
return `Ugyldig verdi: forventet ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -6742,11 +7841,11 @@ var error24 = () => {
|
|
|
6742
7841
|
};
|
|
6743
7842
|
function no_default() {
|
|
6744
7843
|
return {
|
|
6745
|
-
localeError:
|
|
7844
|
+
localeError: error28()
|
|
6746
7845
|
};
|
|
6747
7846
|
}
|
|
6748
7847
|
// ../../node_modules/zod/v4/locales/ota.js
|
|
6749
|
-
var
|
|
7848
|
+
var error29 = () => {
|
|
6750
7849
|
const Sizable = {
|
|
6751
7850
|
string: { unit: "harf", verb: "olmalıdır" },
|
|
6752
7851
|
file: { unit: "bayt", verb: "olmalıdır" },
|
|
@@ -6756,7 +7855,7 @@ var error25 = () => {
|
|
|
6756
7855
|
function getSizing(origin) {
|
|
6757
7856
|
return Sizable[origin] ?? null;
|
|
6758
7857
|
}
|
|
6759
|
-
const
|
|
7858
|
+
const parsedType6 = (data) => {
|
|
6760
7859
|
const t = typeof data;
|
|
6761
7860
|
switch (t) {
|
|
6762
7861
|
case "number": {
|
|
@@ -6809,7 +7908,7 @@ var error25 = () => {
|
|
|
6809
7908
|
return (issue2) => {
|
|
6810
7909
|
switch (issue2.code) {
|
|
6811
7910
|
case "invalid_type":
|
|
6812
|
-
return `Fâsit giren: umulan ${issue2.expected}, alınan ${
|
|
7911
|
+
return `Fâsit giren: umulan ${issue2.expected}, alınan ${parsedType6(issue2.input)}`;
|
|
6813
7912
|
case "invalid_value":
|
|
6814
7913
|
if (issue2.values.length === 1)
|
|
6815
7914
|
return `Fâsit giren: umulan ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -6858,11 +7957,11 @@ var error25 = () => {
|
|
|
6858
7957
|
};
|
|
6859
7958
|
function ota_default() {
|
|
6860
7959
|
return {
|
|
6861
|
-
localeError:
|
|
7960
|
+
localeError: error29()
|
|
6862
7961
|
};
|
|
6863
7962
|
}
|
|
6864
7963
|
// ../../node_modules/zod/v4/locales/ps.js
|
|
6865
|
-
var
|
|
7964
|
+
var error30 = () => {
|
|
6866
7965
|
const Sizable = {
|
|
6867
7966
|
string: { unit: "توکي", verb: "ولري" },
|
|
6868
7967
|
file: { unit: "بایټس", verb: "ولري" },
|
|
@@ -6872,7 +7971,7 @@ var error26 = () => {
|
|
|
6872
7971
|
function getSizing(origin) {
|
|
6873
7972
|
return Sizable[origin] ?? null;
|
|
6874
7973
|
}
|
|
6875
|
-
const
|
|
7974
|
+
const parsedType6 = (data) => {
|
|
6876
7975
|
const t = typeof data;
|
|
6877
7976
|
switch (t) {
|
|
6878
7977
|
case "number": {
|
|
@@ -6925,7 +8024,7 @@ var error26 = () => {
|
|
|
6925
8024
|
return (issue2) => {
|
|
6926
8025
|
switch (issue2.code) {
|
|
6927
8026
|
case "invalid_type":
|
|
6928
|
-
return `ناسم ورودي: باید ${issue2.expected} وای, مګر ${
|
|
8027
|
+
return `ناسم ورودي: باید ${issue2.expected} وای, مګر ${parsedType6(issue2.input)} ترلاسه شو`;
|
|
6929
8028
|
case "invalid_value":
|
|
6930
8029
|
if (issue2.values.length === 1) {
|
|
6931
8030
|
return `ناسم ورودي: باید ${stringifyPrimitive(issue2.values[0])} وای`;
|
|
@@ -6980,11 +8079,11 @@ var error26 = () => {
|
|
|
6980
8079
|
};
|
|
6981
8080
|
function ps_default() {
|
|
6982
8081
|
return {
|
|
6983
|
-
localeError:
|
|
8082
|
+
localeError: error30()
|
|
6984
8083
|
};
|
|
6985
8084
|
}
|
|
6986
8085
|
// ../../node_modules/zod/v4/locales/pl.js
|
|
6987
|
-
var
|
|
8086
|
+
var error31 = () => {
|
|
6988
8087
|
const Sizable = {
|
|
6989
8088
|
string: { unit: "znaków", verb: "mieć" },
|
|
6990
8089
|
file: { unit: "bajtów", verb: "mieć" },
|
|
@@ -6994,7 +8093,7 @@ var error27 = () => {
|
|
|
6994
8093
|
function getSizing(origin) {
|
|
6995
8094
|
return Sizable[origin] ?? null;
|
|
6996
8095
|
}
|
|
6997
|
-
const
|
|
8096
|
+
const parsedType6 = (data) => {
|
|
6998
8097
|
const t = typeof data;
|
|
6999
8098
|
switch (t) {
|
|
7000
8099
|
case "number": {
|
|
@@ -7047,7 +8146,7 @@ var error27 = () => {
|
|
|
7047
8146
|
return (issue2) => {
|
|
7048
8147
|
switch (issue2.code) {
|
|
7049
8148
|
case "invalid_type":
|
|
7050
|
-
return `Nieprawidłowe dane wejściowe: oczekiwano ${issue2.expected}, otrzymano ${
|
|
8149
|
+
return `Nieprawidłowe dane wejściowe: oczekiwano ${issue2.expected}, otrzymano ${parsedType6(issue2.input)}`;
|
|
7051
8150
|
case "invalid_value":
|
|
7052
8151
|
if (issue2.values.length === 1)
|
|
7053
8152
|
return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7097,11 +8196,11 @@ var error27 = () => {
|
|
|
7097
8196
|
};
|
|
7098
8197
|
function pl_default() {
|
|
7099
8198
|
return {
|
|
7100
|
-
localeError:
|
|
8199
|
+
localeError: error31()
|
|
7101
8200
|
};
|
|
7102
8201
|
}
|
|
7103
8202
|
// ../../node_modules/zod/v4/locales/pt.js
|
|
7104
|
-
var
|
|
8203
|
+
var error32 = () => {
|
|
7105
8204
|
const Sizable = {
|
|
7106
8205
|
string: { unit: "caracteres", verb: "ter" },
|
|
7107
8206
|
file: { unit: "bytes", verb: "ter" },
|
|
@@ -7111,7 +8210,7 @@ var error28 = () => {
|
|
|
7111
8210
|
function getSizing(origin) {
|
|
7112
8211
|
return Sizable[origin] ?? null;
|
|
7113
8212
|
}
|
|
7114
|
-
const
|
|
8213
|
+
const parsedType6 = (data) => {
|
|
7115
8214
|
const t = typeof data;
|
|
7116
8215
|
switch (t) {
|
|
7117
8216
|
case "number": {
|
|
@@ -7164,7 +8263,7 @@ var error28 = () => {
|
|
|
7164
8263
|
return (issue2) => {
|
|
7165
8264
|
switch (issue2.code) {
|
|
7166
8265
|
case "invalid_type":
|
|
7167
|
-
return `Tipo inválido: esperado ${issue2.expected}, recebido ${
|
|
8266
|
+
return `Tipo inválido: esperado ${issue2.expected}, recebido ${parsedType6(issue2.input)}`;
|
|
7168
8267
|
case "invalid_value":
|
|
7169
8268
|
if (issue2.values.length === 1)
|
|
7170
8269
|
return `Entrada inválida: esperado ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7213,7 +8312,7 @@ var error28 = () => {
|
|
|
7213
8312
|
};
|
|
7214
8313
|
function pt_default() {
|
|
7215
8314
|
return {
|
|
7216
|
-
localeError:
|
|
8315
|
+
localeError: error32()
|
|
7217
8316
|
};
|
|
7218
8317
|
}
|
|
7219
8318
|
// ../../node_modules/zod/v4/locales/ru.js
|
|
@@ -7232,7 +8331,7 @@ function getRussianPlural(count, one, few, many) {
|
|
|
7232
8331
|
}
|
|
7233
8332
|
return many;
|
|
7234
8333
|
}
|
|
7235
|
-
var
|
|
8334
|
+
var error33 = () => {
|
|
7236
8335
|
const Sizable = {
|
|
7237
8336
|
string: {
|
|
7238
8337
|
unit: {
|
|
@@ -7270,7 +8369,7 @@ var error29 = () => {
|
|
|
7270
8369
|
function getSizing(origin) {
|
|
7271
8370
|
return Sizable[origin] ?? null;
|
|
7272
8371
|
}
|
|
7273
|
-
const
|
|
8372
|
+
const parsedType6 = (data) => {
|
|
7274
8373
|
const t = typeof data;
|
|
7275
8374
|
switch (t) {
|
|
7276
8375
|
case "number": {
|
|
@@ -7323,7 +8422,7 @@ var error29 = () => {
|
|
|
7323
8422
|
return (issue2) => {
|
|
7324
8423
|
switch (issue2.code) {
|
|
7325
8424
|
case "invalid_type":
|
|
7326
|
-
return `Неверный ввод: ожидалось ${issue2.expected}, получено ${
|
|
8425
|
+
return `Неверный ввод: ожидалось ${issue2.expected}, получено ${parsedType6(issue2.input)}`;
|
|
7327
8426
|
case "invalid_value":
|
|
7328
8427
|
if (issue2.values.length === 1)
|
|
7329
8428
|
return `Неверный ввод: ожидалось ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7377,11 +8476,11 @@ var error29 = () => {
|
|
|
7377
8476
|
};
|
|
7378
8477
|
function ru_default() {
|
|
7379
8478
|
return {
|
|
7380
|
-
localeError:
|
|
8479
|
+
localeError: error33()
|
|
7381
8480
|
};
|
|
7382
8481
|
}
|
|
7383
8482
|
// ../../node_modules/zod/v4/locales/sl.js
|
|
7384
|
-
var
|
|
8483
|
+
var error34 = () => {
|
|
7385
8484
|
const Sizable = {
|
|
7386
8485
|
string: { unit: "znakov", verb: "imeti" },
|
|
7387
8486
|
file: { unit: "bajtov", verb: "imeti" },
|
|
@@ -7391,7 +8490,7 @@ var error30 = () => {
|
|
|
7391
8490
|
function getSizing(origin) {
|
|
7392
8491
|
return Sizable[origin] ?? null;
|
|
7393
8492
|
}
|
|
7394
|
-
const
|
|
8493
|
+
const parsedType6 = (data) => {
|
|
7395
8494
|
const t = typeof data;
|
|
7396
8495
|
switch (t) {
|
|
7397
8496
|
case "number": {
|
|
@@ -7444,7 +8543,7 @@ var error30 = () => {
|
|
|
7444
8543
|
return (issue2) => {
|
|
7445
8544
|
switch (issue2.code) {
|
|
7446
8545
|
case "invalid_type":
|
|
7447
|
-
return `Neveljaven vnos: pričakovano ${issue2.expected}, prejeto ${
|
|
8546
|
+
return `Neveljaven vnos: pričakovano ${issue2.expected}, prejeto ${parsedType6(issue2.input)}`;
|
|
7448
8547
|
case "invalid_value":
|
|
7449
8548
|
if (issue2.values.length === 1)
|
|
7450
8549
|
return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7494,11 +8593,11 @@ var error30 = () => {
|
|
|
7494
8593
|
};
|
|
7495
8594
|
function sl_default() {
|
|
7496
8595
|
return {
|
|
7497
|
-
localeError:
|
|
8596
|
+
localeError: error34()
|
|
7498
8597
|
};
|
|
7499
8598
|
}
|
|
7500
8599
|
// ../../node_modules/zod/v4/locales/sv.js
|
|
7501
|
-
var
|
|
8600
|
+
var error35 = () => {
|
|
7502
8601
|
const Sizable = {
|
|
7503
8602
|
string: { unit: "tecken", verb: "att ha" },
|
|
7504
8603
|
file: { unit: "bytes", verb: "att ha" },
|
|
@@ -7508,7 +8607,7 @@ var error31 = () => {
|
|
|
7508
8607
|
function getSizing(origin) {
|
|
7509
8608
|
return Sizable[origin] ?? null;
|
|
7510
8609
|
}
|
|
7511
|
-
const
|
|
8610
|
+
const parsedType6 = (data) => {
|
|
7512
8611
|
const t = typeof data;
|
|
7513
8612
|
switch (t) {
|
|
7514
8613
|
case "number": {
|
|
@@ -7561,7 +8660,7 @@ var error31 = () => {
|
|
|
7561
8660
|
return (issue2) => {
|
|
7562
8661
|
switch (issue2.code) {
|
|
7563
8662
|
case "invalid_type":
|
|
7564
|
-
return `Ogiltig inmatning: förväntat ${issue2.expected}, fick ${
|
|
8663
|
+
return `Ogiltig inmatning: förväntat ${issue2.expected}, fick ${parsedType6(issue2.input)}`;
|
|
7565
8664
|
case "invalid_value":
|
|
7566
8665
|
if (issue2.values.length === 1)
|
|
7567
8666
|
return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7612,11 +8711,11 @@ var error31 = () => {
|
|
|
7612
8711
|
};
|
|
7613
8712
|
function sv_default() {
|
|
7614
8713
|
return {
|
|
7615
|
-
localeError:
|
|
8714
|
+
localeError: error35()
|
|
7616
8715
|
};
|
|
7617
8716
|
}
|
|
7618
8717
|
// ../../node_modules/zod/v4/locales/ta.js
|
|
7619
|
-
var
|
|
8718
|
+
var error36 = () => {
|
|
7620
8719
|
const Sizable = {
|
|
7621
8720
|
string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
|
|
7622
8721
|
file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" },
|
|
@@ -7626,7 +8725,7 @@ var error32 = () => {
|
|
|
7626
8725
|
function getSizing(origin) {
|
|
7627
8726
|
return Sizable[origin] ?? null;
|
|
7628
8727
|
}
|
|
7629
|
-
const
|
|
8728
|
+
const parsedType6 = (data) => {
|
|
7630
8729
|
const t = typeof data;
|
|
7631
8730
|
switch (t) {
|
|
7632
8731
|
case "number": {
|
|
@@ -7679,7 +8778,7 @@ var error32 = () => {
|
|
|
7679
8778
|
return (issue2) => {
|
|
7680
8779
|
switch (issue2.code) {
|
|
7681
8780
|
case "invalid_type":
|
|
7682
|
-
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue2.expected}, பெறப்பட்டது ${
|
|
8781
|
+
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue2.expected}, பெறப்பட்டது ${parsedType6(issue2.input)}`;
|
|
7683
8782
|
case "invalid_value":
|
|
7684
8783
|
if (issue2.values.length === 1)
|
|
7685
8784
|
return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7729,11 +8828,11 @@ var error32 = () => {
|
|
|
7729
8828
|
};
|
|
7730
8829
|
function ta_default() {
|
|
7731
8830
|
return {
|
|
7732
|
-
localeError:
|
|
8831
|
+
localeError: error36()
|
|
7733
8832
|
};
|
|
7734
8833
|
}
|
|
7735
8834
|
// ../../node_modules/zod/v4/locales/th.js
|
|
7736
|
-
var
|
|
8835
|
+
var error37 = () => {
|
|
7737
8836
|
const Sizable = {
|
|
7738
8837
|
string: { unit: "ตัวอักษร", verb: "ควรมี" },
|
|
7739
8838
|
file: { unit: "ไบต์", verb: "ควรมี" },
|
|
@@ -7743,7 +8842,7 @@ var error33 = () => {
|
|
|
7743
8842
|
function getSizing(origin) {
|
|
7744
8843
|
return Sizable[origin] ?? null;
|
|
7745
8844
|
}
|
|
7746
|
-
const
|
|
8845
|
+
const parsedType6 = (data) => {
|
|
7747
8846
|
const t = typeof data;
|
|
7748
8847
|
switch (t) {
|
|
7749
8848
|
case "number": {
|
|
@@ -7796,7 +8895,7 @@ var error33 = () => {
|
|
|
7796
8895
|
return (issue2) => {
|
|
7797
8896
|
switch (issue2.code) {
|
|
7798
8897
|
case "invalid_type":
|
|
7799
|
-
return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue2.expected} แต่ได้รับ ${
|
|
8898
|
+
return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue2.expected} แต่ได้รับ ${parsedType6(issue2.input)}`;
|
|
7800
8899
|
case "invalid_value":
|
|
7801
8900
|
if (issue2.values.length === 1)
|
|
7802
8901
|
return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7846,11 +8945,11 @@ var error33 = () => {
|
|
|
7846
8945
|
};
|
|
7847
8946
|
function th_default() {
|
|
7848
8947
|
return {
|
|
7849
|
-
localeError:
|
|
8948
|
+
localeError: error37()
|
|
7850
8949
|
};
|
|
7851
8950
|
}
|
|
7852
8951
|
// ../../node_modules/zod/v4/locales/tr.js
|
|
7853
|
-
var
|
|
8952
|
+
var parsedType6 = (data) => {
|
|
7854
8953
|
const t = typeof data;
|
|
7855
8954
|
switch (t) {
|
|
7856
8955
|
case "number": {
|
|
@@ -7870,7 +8969,7 @@ var parsedType3 = (data) => {
|
|
|
7870
8969
|
}
|
|
7871
8970
|
return t;
|
|
7872
8971
|
};
|
|
7873
|
-
var
|
|
8972
|
+
var error38 = () => {
|
|
7874
8973
|
const Sizable = {
|
|
7875
8974
|
string: { unit: "karakter", verb: "olmalı" },
|
|
7876
8975
|
file: { unit: "bayt", verb: "olmalı" },
|
|
@@ -7913,7 +9012,7 @@ var error34 = () => {
|
|
|
7913
9012
|
return (issue2) => {
|
|
7914
9013
|
switch (issue2.code) {
|
|
7915
9014
|
case "invalid_type":
|
|
7916
|
-
return `Geçersiz değer: beklenen ${issue2.expected}, alınan ${
|
|
9015
|
+
return `Geçersiz değer: beklenen ${issue2.expected}, alınan ${parsedType6(issue2.input)}`;
|
|
7917
9016
|
case "invalid_value":
|
|
7918
9017
|
if (issue2.values.length === 1)
|
|
7919
9018
|
return `Geçersiz değer: beklenen ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -7961,11 +9060,11 @@ var error34 = () => {
|
|
|
7961
9060
|
};
|
|
7962
9061
|
function tr_default() {
|
|
7963
9062
|
return {
|
|
7964
|
-
localeError:
|
|
9063
|
+
localeError: error38()
|
|
7965
9064
|
};
|
|
7966
9065
|
}
|
|
7967
|
-
// ../../node_modules/zod/v4/locales/
|
|
7968
|
-
var
|
|
9066
|
+
// ../../node_modules/zod/v4/locales/uk.js
|
|
9067
|
+
var error39 = () => {
|
|
7969
9068
|
const Sizable = {
|
|
7970
9069
|
string: { unit: "символів", verb: "матиме" },
|
|
7971
9070
|
file: { unit: "байтів", verb: "матиме" },
|
|
@@ -7975,7 +9074,7 @@ var error35 = () => {
|
|
|
7975
9074
|
function getSizing(origin) {
|
|
7976
9075
|
return Sizable[origin] ?? null;
|
|
7977
9076
|
}
|
|
7978
|
-
const
|
|
9077
|
+
const parsedType7 = (data) => {
|
|
7979
9078
|
const t = typeof data;
|
|
7980
9079
|
switch (t) {
|
|
7981
9080
|
case "number": {
|
|
@@ -8028,7 +9127,7 @@ var error35 = () => {
|
|
|
8028
9127
|
return (issue2) => {
|
|
8029
9128
|
switch (issue2.code) {
|
|
8030
9129
|
case "invalid_type":
|
|
8031
|
-
return `Неправильні вхідні дані: очікується ${issue2.expected}, отримано ${
|
|
9130
|
+
return `Неправильні вхідні дані: очікується ${issue2.expected}, отримано ${parsedType7(issue2.input)}`;
|
|
8032
9131
|
case "invalid_value":
|
|
8033
9132
|
if (issue2.values.length === 1)
|
|
8034
9133
|
return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -8075,13 +9174,18 @@ var error35 = () => {
|
|
|
8075
9174
|
}
|
|
8076
9175
|
};
|
|
8077
9176
|
};
|
|
8078
|
-
function
|
|
9177
|
+
function uk_default() {
|
|
8079
9178
|
return {
|
|
8080
|
-
localeError:
|
|
9179
|
+
localeError: error39()
|
|
8081
9180
|
};
|
|
8082
9181
|
}
|
|
9182
|
+
|
|
9183
|
+
// ../../node_modules/zod/v4/locales/ua.js
|
|
9184
|
+
function ua_default() {
|
|
9185
|
+
return uk_default();
|
|
9186
|
+
}
|
|
8083
9187
|
// ../../node_modules/zod/v4/locales/ur.js
|
|
8084
|
-
var
|
|
9188
|
+
var error40 = () => {
|
|
8085
9189
|
const Sizable = {
|
|
8086
9190
|
string: { unit: "حروف", verb: "ہونا" },
|
|
8087
9191
|
file: { unit: "بائٹس", verb: "ہونا" },
|
|
@@ -8091,7 +9195,7 @@ var error36 = () => {
|
|
|
8091
9195
|
function getSizing(origin) {
|
|
8092
9196
|
return Sizable[origin] ?? null;
|
|
8093
9197
|
}
|
|
8094
|
-
const
|
|
9198
|
+
const parsedType7 = (data) => {
|
|
8095
9199
|
const t = typeof data;
|
|
8096
9200
|
switch (t) {
|
|
8097
9201
|
case "number": {
|
|
@@ -8144,7 +9248,7 @@ var error36 = () => {
|
|
|
8144
9248
|
return (issue2) => {
|
|
8145
9249
|
switch (issue2.code) {
|
|
8146
9250
|
case "invalid_type":
|
|
8147
|
-
return `غلط ان پٹ: ${issue2.expected} متوقع تھا، ${
|
|
9251
|
+
return `غلط ان پٹ: ${issue2.expected} متوقع تھا، ${parsedType7(issue2.input)} موصول ہوا`;
|
|
8148
9252
|
case "invalid_value":
|
|
8149
9253
|
if (issue2.values.length === 1)
|
|
8150
9254
|
return `غلط ان پٹ: ${stringifyPrimitive(issue2.values[0])} متوقع تھا`;
|
|
@@ -8194,11 +9298,11 @@ var error36 = () => {
|
|
|
8194
9298
|
};
|
|
8195
9299
|
function ur_default() {
|
|
8196
9300
|
return {
|
|
8197
|
-
localeError:
|
|
9301
|
+
localeError: error40()
|
|
8198
9302
|
};
|
|
8199
9303
|
}
|
|
8200
9304
|
// ../../node_modules/zod/v4/locales/vi.js
|
|
8201
|
-
var
|
|
9305
|
+
var error41 = () => {
|
|
8202
9306
|
const Sizable = {
|
|
8203
9307
|
string: { unit: "ký tự", verb: "có" },
|
|
8204
9308
|
file: { unit: "byte", verb: "có" },
|
|
@@ -8208,7 +9312,7 @@ var error37 = () => {
|
|
|
8208
9312
|
function getSizing(origin) {
|
|
8209
9313
|
return Sizable[origin] ?? null;
|
|
8210
9314
|
}
|
|
8211
|
-
const
|
|
9315
|
+
const parsedType7 = (data) => {
|
|
8212
9316
|
const t = typeof data;
|
|
8213
9317
|
switch (t) {
|
|
8214
9318
|
case "number": {
|
|
@@ -8261,7 +9365,7 @@ var error37 = () => {
|
|
|
8261
9365
|
return (issue2) => {
|
|
8262
9366
|
switch (issue2.code) {
|
|
8263
9367
|
case "invalid_type":
|
|
8264
|
-
return `Đầu vào không hợp lệ: mong đợi ${issue2.expected}, nhận được ${
|
|
9368
|
+
return `Đầu vào không hợp lệ: mong đợi ${issue2.expected}, nhận được ${parsedType7(issue2.input)}`;
|
|
8265
9369
|
case "invalid_value":
|
|
8266
9370
|
if (issue2.values.length === 1)
|
|
8267
9371
|
return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -8310,11 +9414,11 @@ var error37 = () => {
|
|
|
8310
9414
|
};
|
|
8311
9415
|
function vi_default() {
|
|
8312
9416
|
return {
|
|
8313
|
-
localeError:
|
|
9417
|
+
localeError: error41()
|
|
8314
9418
|
};
|
|
8315
9419
|
}
|
|
8316
9420
|
// ../../node_modules/zod/v4/locales/zh-CN.js
|
|
8317
|
-
var
|
|
9421
|
+
var error42 = () => {
|
|
8318
9422
|
const Sizable = {
|
|
8319
9423
|
string: { unit: "字符", verb: "包含" },
|
|
8320
9424
|
file: { unit: "字节", verb: "包含" },
|
|
@@ -8324,7 +9428,7 @@ var error38 = () => {
|
|
|
8324
9428
|
function getSizing(origin) {
|
|
8325
9429
|
return Sizable[origin] ?? null;
|
|
8326
9430
|
}
|
|
8327
|
-
const
|
|
9431
|
+
const parsedType7 = (data) => {
|
|
8328
9432
|
const t = typeof data;
|
|
8329
9433
|
switch (t) {
|
|
8330
9434
|
case "number": {
|
|
@@ -8377,7 +9481,7 @@ var error38 = () => {
|
|
|
8377
9481
|
return (issue2) => {
|
|
8378
9482
|
switch (issue2.code) {
|
|
8379
9483
|
case "invalid_type":
|
|
8380
|
-
return `无效输入:期望 ${issue2.expected},实际接收 ${
|
|
9484
|
+
return `无效输入:期望 ${issue2.expected},实际接收 ${parsedType7(issue2.input)}`;
|
|
8381
9485
|
case "invalid_value":
|
|
8382
9486
|
if (issue2.values.length === 1)
|
|
8383
9487
|
return `无效输入:期望 ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -8426,11 +9530,11 @@ var error38 = () => {
|
|
|
8426
9530
|
};
|
|
8427
9531
|
function zh_CN_default() {
|
|
8428
9532
|
return {
|
|
8429
|
-
localeError:
|
|
9533
|
+
localeError: error42()
|
|
8430
9534
|
};
|
|
8431
9535
|
}
|
|
8432
9536
|
// ../../node_modules/zod/v4/locales/zh-TW.js
|
|
8433
|
-
var
|
|
9537
|
+
var error43 = () => {
|
|
8434
9538
|
const Sizable = {
|
|
8435
9539
|
string: { unit: "字元", verb: "擁有" },
|
|
8436
9540
|
file: { unit: "位元組", verb: "擁有" },
|
|
@@ -8440,7 +9544,7 @@ var error39 = () => {
|
|
|
8440
9544
|
function getSizing(origin) {
|
|
8441
9545
|
return Sizable[origin] ?? null;
|
|
8442
9546
|
}
|
|
8443
|
-
const
|
|
9547
|
+
const parsedType7 = (data) => {
|
|
8444
9548
|
const t = typeof data;
|
|
8445
9549
|
switch (t) {
|
|
8446
9550
|
case "number": {
|
|
@@ -8493,7 +9597,7 @@ var error39 = () => {
|
|
|
8493
9597
|
return (issue2) => {
|
|
8494
9598
|
switch (issue2.code) {
|
|
8495
9599
|
case "invalid_type":
|
|
8496
|
-
return `無效的輸入值:預期為 ${issue2.expected},但收到 ${
|
|
9600
|
+
return `無效的輸入值:預期為 ${issue2.expected},但收到 ${parsedType7(issue2.input)}`;
|
|
8497
9601
|
case "invalid_value":
|
|
8498
9602
|
if (issue2.values.length === 1)
|
|
8499
9603
|
return `無效的輸入值:預期為 ${stringifyPrimitive(issue2.values[0])}`;
|
|
@@ -8543,7 +9647,122 @@ var error39 = () => {
|
|
|
8543
9647
|
};
|
|
8544
9648
|
function zh_TW_default() {
|
|
8545
9649
|
return {
|
|
8546
|
-
localeError:
|
|
9650
|
+
localeError: error43()
|
|
9651
|
+
};
|
|
9652
|
+
}
|
|
9653
|
+
// ../../node_modules/zod/v4/locales/yo.js
|
|
9654
|
+
var error44 = () => {
|
|
9655
|
+
const Sizable = {
|
|
9656
|
+
string: { unit: "àmi", verb: "ní" },
|
|
9657
|
+
file: { unit: "bytes", verb: "ní" },
|
|
9658
|
+
array: { unit: "nkan", verb: "ní" },
|
|
9659
|
+
set: { unit: "nkan", verb: "ní" }
|
|
9660
|
+
};
|
|
9661
|
+
function getSizing(origin) {
|
|
9662
|
+
return Sizable[origin] ?? null;
|
|
9663
|
+
}
|
|
9664
|
+
const parsedType7 = (data) => {
|
|
9665
|
+
const t = typeof data;
|
|
9666
|
+
switch (t) {
|
|
9667
|
+
case "number": {
|
|
9668
|
+
return Number.isNaN(data) ? "NaN" : "nọ́mbà";
|
|
9669
|
+
}
|
|
9670
|
+
case "object": {
|
|
9671
|
+
if (Array.isArray(data)) {
|
|
9672
|
+
return "akopọ";
|
|
9673
|
+
}
|
|
9674
|
+
if (data === null) {
|
|
9675
|
+
return "null";
|
|
9676
|
+
}
|
|
9677
|
+
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
9678
|
+
return data.constructor.name;
|
|
9679
|
+
}
|
|
9680
|
+
}
|
|
9681
|
+
}
|
|
9682
|
+
return t;
|
|
9683
|
+
};
|
|
9684
|
+
const Nouns = {
|
|
9685
|
+
regex: "ẹ̀rọ ìbáwọlé",
|
|
9686
|
+
email: "àdírẹ́sì ìmẹ́lì",
|
|
9687
|
+
url: "URL",
|
|
9688
|
+
emoji: "emoji",
|
|
9689
|
+
uuid: "UUID",
|
|
9690
|
+
uuidv4: "UUIDv4",
|
|
9691
|
+
uuidv6: "UUIDv6",
|
|
9692
|
+
nanoid: "nanoid",
|
|
9693
|
+
guid: "GUID",
|
|
9694
|
+
cuid: "cuid",
|
|
9695
|
+
cuid2: "cuid2",
|
|
9696
|
+
ulid: "ULID",
|
|
9697
|
+
xid: "XID",
|
|
9698
|
+
ksuid: "KSUID",
|
|
9699
|
+
datetime: "àkókò ISO",
|
|
9700
|
+
date: "ọjọ́ ISO",
|
|
9701
|
+
time: "àkókò ISO",
|
|
9702
|
+
duration: "àkókò tó pé ISO",
|
|
9703
|
+
ipv4: "àdírẹ́sì IPv4",
|
|
9704
|
+
ipv6: "àdírẹ́sì IPv6",
|
|
9705
|
+
cidrv4: "àgbègbè IPv4",
|
|
9706
|
+
cidrv6: "àgbègbè IPv6",
|
|
9707
|
+
base64: "ọ̀rọ̀ tí a kọ́ ní base64",
|
|
9708
|
+
base64url: "ọ̀rọ̀ base64url",
|
|
9709
|
+
json_string: "ọ̀rọ̀ JSON",
|
|
9710
|
+
e164: "nọ́mbà E.164",
|
|
9711
|
+
jwt: "JWT",
|
|
9712
|
+
template_literal: "ẹ̀rọ ìbáwọlé"
|
|
9713
|
+
};
|
|
9714
|
+
return (issue2) => {
|
|
9715
|
+
switch (issue2.code) {
|
|
9716
|
+
case "invalid_type":
|
|
9717
|
+
return `Ìbáwọlé aṣìṣe: a ní láti fi ${issue2.expected}, àmọ̀ a rí ${parsedType7(issue2.input)}`;
|
|
9718
|
+
case "invalid_value":
|
|
9719
|
+
if (issue2.values.length === 1)
|
|
9720
|
+
return `Ìbáwọlé aṣìṣe: a ní láti fi ${stringifyPrimitive(issue2.values[0])}`;
|
|
9721
|
+
return `Àṣàyàn aṣìṣe: yan ọ̀kan lára ${joinValues(issue2.values, "|")}`;
|
|
9722
|
+
case "too_big": {
|
|
9723
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
9724
|
+
const sizing = getSizing(issue2.origin);
|
|
9725
|
+
if (sizing)
|
|
9726
|
+
return `Tó pọ̀ jù: a ní láti jẹ́ pé ${issue2.origin ?? "iye"} ${sizing.verb} ${adj}${issue2.maximum} ${sizing.unit}`;
|
|
9727
|
+
return `Tó pọ̀ jù: a ní láti jẹ́ ${adj}${issue2.maximum}`;
|
|
9728
|
+
}
|
|
9729
|
+
case "too_small": {
|
|
9730
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
9731
|
+
const sizing = getSizing(issue2.origin);
|
|
9732
|
+
if (sizing)
|
|
9733
|
+
return `Kéré ju: a ní láti jẹ́ pé ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum} ${sizing.unit}`;
|
|
9734
|
+
return `Kéré ju: a ní láti jẹ́ ${adj}${issue2.minimum}`;
|
|
9735
|
+
}
|
|
9736
|
+
case "invalid_format": {
|
|
9737
|
+
const _issue = issue2;
|
|
9738
|
+
if (_issue.format === "starts_with")
|
|
9739
|
+
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${_issue.prefix}"`;
|
|
9740
|
+
if (_issue.format === "ends_with")
|
|
9741
|
+
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${_issue.suffix}"`;
|
|
9742
|
+
if (_issue.format === "includes")
|
|
9743
|
+
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${_issue.includes}"`;
|
|
9744
|
+
if (_issue.format === "regex")
|
|
9745
|
+
return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${_issue.pattern}`;
|
|
9746
|
+
return `Aṣìṣe: ${Nouns[_issue.format] ?? issue2.format}`;
|
|
9747
|
+
}
|
|
9748
|
+
case "not_multiple_of":
|
|
9749
|
+
return `Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${issue2.divisor}`;
|
|
9750
|
+
case "unrecognized_keys":
|
|
9751
|
+
return `Bọtìnì àìmọ̀: ${joinValues(issue2.keys, ", ")}`;
|
|
9752
|
+
case "invalid_key":
|
|
9753
|
+
return `Bọtìnì aṣìṣe nínú ${issue2.origin}`;
|
|
9754
|
+
case "invalid_union":
|
|
9755
|
+
return "Ìbáwọlé aṣìṣe";
|
|
9756
|
+
case "invalid_element":
|
|
9757
|
+
return `Iye aṣìṣe nínú ${issue2.origin}`;
|
|
9758
|
+
default:
|
|
9759
|
+
return "Ìbáwọlé aṣìṣe";
|
|
9760
|
+
}
|
|
9761
|
+
};
|
|
9762
|
+
};
|
|
9763
|
+
function yo_default() {
|
|
9764
|
+
return {
|
|
9765
|
+
localeError: error44()
|
|
8547
9766
|
};
|
|
8548
9767
|
}
|
|
8549
9768
|
// ../../node_modules/zod/v4/core/registries.js
|
|
@@ -8552,7 +9771,7 @@ var $input = Symbol("ZodInput");
|
|
|
8552
9771
|
|
|
8553
9772
|
class $ZodRegistry {
|
|
8554
9773
|
constructor() {
|
|
8555
|
-
this._map = new
|
|
9774
|
+
this._map = new WeakMap;
|
|
8556
9775
|
this._idmap = new Map;
|
|
8557
9776
|
}
|
|
8558
9777
|
add(schema, ..._meta) {
|
|
@@ -8567,7 +9786,7 @@ class $ZodRegistry {
|
|
|
8567
9786
|
return this;
|
|
8568
9787
|
}
|
|
8569
9788
|
clear() {
|
|
8570
|
-
this._map = new
|
|
9789
|
+
this._map = new WeakMap;
|
|
8571
9790
|
this._idmap = new Map;
|
|
8572
9791
|
return this;
|
|
8573
9792
|
}
|
|
@@ -8584,7 +9803,8 @@ class $ZodRegistry {
|
|
|
8584
9803
|
if (p) {
|
|
8585
9804
|
const pm = { ...this.get(p) ?? {} };
|
|
8586
9805
|
delete pm.id;
|
|
8587
|
-
|
|
9806
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
9807
|
+
return Object.keys(f).length ? f : undefined;
|
|
8588
9808
|
}
|
|
8589
9809
|
return this._map.get(schema);
|
|
8590
9810
|
}
|
|
@@ -9304,7 +10524,7 @@ function _default(Class2, innerType, defaultValue) {
|
|
|
9304
10524
|
type: "default",
|
|
9305
10525
|
innerType,
|
|
9306
10526
|
get defaultValue() {
|
|
9307
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
10527
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
9308
10528
|
}
|
|
9309
10529
|
});
|
|
9310
10530
|
}
|
|
@@ -9380,6 +10600,34 @@ function _refine(Class2, fn, _params) {
|
|
|
9380
10600
|
});
|
|
9381
10601
|
return schema;
|
|
9382
10602
|
}
|
|
10603
|
+
function _superRefine(fn) {
|
|
10604
|
+
const ch = _check((payload) => {
|
|
10605
|
+
payload.addIssue = (issue2) => {
|
|
10606
|
+
if (typeof issue2 === "string") {
|
|
10607
|
+
payload.issues.push(issue(issue2, payload.value, ch._zod.def));
|
|
10608
|
+
} else {
|
|
10609
|
+
const _issue = issue2;
|
|
10610
|
+
if (_issue.fatal)
|
|
10611
|
+
_issue.continue = false;
|
|
10612
|
+
_issue.code ?? (_issue.code = "custom");
|
|
10613
|
+
_issue.input ?? (_issue.input = payload.value);
|
|
10614
|
+
_issue.inst ?? (_issue.inst = ch);
|
|
10615
|
+
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
10616
|
+
payload.issues.push(issue(_issue));
|
|
10617
|
+
}
|
|
10618
|
+
};
|
|
10619
|
+
return fn(payload.value, payload);
|
|
10620
|
+
});
|
|
10621
|
+
return ch;
|
|
10622
|
+
}
|
|
10623
|
+
function _check(fn, params) {
|
|
10624
|
+
const ch = new $ZodCheck({
|
|
10625
|
+
check: "custom",
|
|
10626
|
+
...normalizeParams(params)
|
|
10627
|
+
});
|
|
10628
|
+
ch._zod.check = fn;
|
|
10629
|
+
return ch;
|
|
10630
|
+
}
|
|
9383
10631
|
function _stringbool(Classes, _params) {
|
|
9384
10632
|
const params = normalizeParams(_params);
|
|
9385
10633
|
let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
|
|
@@ -9390,12 +10638,15 @@ function _stringbool(Classes, _params) {
|
|
|
9390
10638
|
}
|
|
9391
10639
|
const truthySet = new Set(truthyArray);
|
|
9392
10640
|
const falsySet = new Set(falsyArray);
|
|
9393
|
-
const
|
|
10641
|
+
const _Codec = Classes.Codec ?? $ZodCodec;
|
|
9394
10642
|
const _Boolean = Classes.Boolean ?? $ZodBoolean;
|
|
9395
10643
|
const _String = Classes.String ?? $ZodString;
|
|
9396
|
-
const
|
|
9397
|
-
const
|
|
9398
|
-
|
|
10644
|
+
const stringSchema = new _String({ type: "string", error: params.error });
|
|
10645
|
+
const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
|
|
10646
|
+
const codec = new _Codec({
|
|
10647
|
+
type: "pipe",
|
|
10648
|
+
in: stringSchema,
|
|
10649
|
+
out: booleanSchema,
|
|
9399
10650
|
transform: (input, payload) => {
|
|
9400
10651
|
let data = input;
|
|
9401
10652
|
if (params.case !== "sensitive")
|
|
@@ -9410,29 +10661,22 @@ function _stringbool(Classes, _params) {
|
|
|
9410
10661
|
expected: "stringbool",
|
|
9411
10662
|
values: [...truthySet, ...falsySet],
|
|
9412
10663
|
input: payload.value,
|
|
9413
|
-
inst:
|
|
10664
|
+
inst: codec,
|
|
10665
|
+
continue: false
|
|
9414
10666
|
});
|
|
9415
10667
|
return {};
|
|
9416
10668
|
}
|
|
9417
10669
|
},
|
|
10670
|
+
reverseTransform: (input, _payload) => {
|
|
10671
|
+
if (input === true) {
|
|
10672
|
+
return truthyArray[0] || "true";
|
|
10673
|
+
} else {
|
|
10674
|
+
return falsyArray[0] || "false";
|
|
10675
|
+
}
|
|
10676
|
+
},
|
|
9418
10677
|
error: params.error
|
|
9419
10678
|
});
|
|
9420
|
-
|
|
9421
|
-
type: "pipe",
|
|
9422
|
-
in: new _String({ type: "string", error: params.error }),
|
|
9423
|
-
out: tx,
|
|
9424
|
-
error: params.error
|
|
9425
|
-
});
|
|
9426
|
-
const outerPipe = new _Pipe({
|
|
9427
|
-
type: "pipe",
|
|
9428
|
-
in: innerPipe,
|
|
9429
|
-
out: new _Boolean({
|
|
9430
|
-
type: "boolean",
|
|
9431
|
-
error: params.error
|
|
9432
|
-
}),
|
|
9433
|
-
error: params.error
|
|
9434
|
-
});
|
|
9435
|
-
return outerPipe;
|
|
10679
|
+
return codec;
|
|
9436
10680
|
}
|
|
9437
10681
|
function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
9438
10682
|
const params = normalizeParams(_params);
|
|
@@ -9450,76 +10694,6 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
9450
10694
|
const inst = new Class2(def);
|
|
9451
10695
|
return inst;
|
|
9452
10696
|
}
|
|
9453
|
-
|
|
9454
|
-
// ../../node_modules/zod/v4/core/function.js
|
|
9455
|
-
class $ZodFunction {
|
|
9456
|
-
constructor(def) {
|
|
9457
|
-
this._def = def;
|
|
9458
|
-
this.def = def;
|
|
9459
|
-
}
|
|
9460
|
-
implement(func) {
|
|
9461
|
-
if (typeof func !== "function") {
|
|
9462
|
-
throw new Error("implement() must be called with a function");
|
|
9463
|
-
}
|
|
9464
|
-
const impl = (...args) => {
|
|
9465
|
-
const parsedArgs = this._def.input ? parse(this._def.input, args, undefined, { callee: impl }) : args;
|
|
9466
|
-
if (!Array.isArray(parsedArgs)) {
|
|
9467
|
-
throw new Error("Invalid arguments schema: not an array or tuple schema.");
|
|
9468
|
-
}
|
|
9469
|
-
const output = func(...parsedArgs);
|
|
9470
|
-
return this._def.output ? parse(this._def.output, output, undefined, { callee: impl }) : output;
|
|
9471
|
-
};
|
|
9472
|
-
return impl;
|
|
9473
|
-
}
|
|
9474
|
-
implementAsync(func) {
|
|
9475
|
-
if (typeof func !== "function") {
|
|
9476
|
-
throw new Error("implement() must be called with a function");
|
|
9477
|
-
}
|
|
9478
|
-
const impl = async (...args) => {
|
|
9479
|
-
const parsedArgs = this._def.input ? await parseAsync(this._def.input, args, undefined, { callee: impl }) : args;
|
|
9480
|
-
if (!Array.isArray(parsedArgs)) {
|
|
9481
|
-
throw new Error("Invalid arguments schema: not an array or tuple schema.");
|
|
9482
|
-
}
|
|
9483
|
-
const output = await func(...parsedArgs);
|
|
9484
|
-
return this._def.output ? parseAsync(this._def.output, output, undefined, { callee: impl }) : output;
|
|
9485
|
-
};
|
|
9486
|
-
return impl;
|
|
9487
|
-
}
|
|
9488
|
-
input(...args) {
|
|
9489
|
-
const F = this.constructor;
|
|
9490
|
-
if (Array.isArray(args[0])) {
|
|
9491
|
-
return new F({
|
|
9492
|
-
type: "function",
|
|
9493
|
-
input: new $ZodTuple({
|
|
9494
|
-
type: "tuple",
|
|
9495
|
-
items: args[0],
|
|
9496
|
-
rest: args[1]
|
|
9497
|
-
}),
|
|
9498
|
-
output: this._def.output
|
|
9499
|
-
});
|
|
9500
|
-
}
|
|
9501
|
-
return new F({
|
|
9502
|
-
type: "function",
|
|
9503
|
-
input: args[0],
|
|
9504
|
-
output: this._def.output
|
|
9505
|
-
});
|
|
9506
|
-
}
|
|
9507
|
-
output(output) {
|
|
9508
|
-
const F = this.constructor;
|
|
9509
|
-
return new F({
|
|
9510
|
-
type: "function",
|
|
9511
|
-
input: this._def.input,
|
|
9512
|
-
output
|
|
9513
|
-
});
|
|
9514
|
-
}
|
|
9515
|
-
}
|
|
9516
|
-
function _function(params) {
|
|
9517
|
-
return new $ZodFunction({
|
|
9518
|
-
type: "function",
|
|
9519
|
-
input: Array.isArray(params?.input) ? _tuple($ZodTuple, params?.input) : params?.input ?? _array($ZodArray, _unknown($ZodUnknown)),
|
|
9520
|
-
output: params?.output ?? _unknown($ZodUnknown)
|
|
9521
|
-
});
|
|
9522
|
-
}
|
|
9523
10697
|
// ../../node_modules/zod/v4/core/to-json-schema.js
|
|
9524
10698
|
class JSONSchemaGenerator {
|
|
9525
10699
|
constructor(params) {
|
|
@@ -9591,7 +10765,7 @@ class JSONSchemaGenerator {
|
|
|
9591
10765
|
else if (regexes.length > 1) {
|
|
9592
10766
|
result.schema.allOf = [
|
|
9593
10767
|
...regexes.map((regex) => ({
|
|
9594
|
-
...this.target === "draft-7" ? { type: "string" } : {},
|
|
10768
|
+
...this.target === "draft-7" || this.target === "draft-4" || this.target === "openapi-3.0" ? { type: "string" } : {},
|
|
9595
10769
|
pattern: regex.source
|
|
9596
10770
|
}))
|
|
9597
10771
|
];
|
|
@@ -9606,22 +10780,34 @@ class JSONSchemaGenerator {
|
|
|
9606
10780
|
json.type = "integer";
|
|
9607
10781
|
else
|
|
9608
10782
|
json.type = "number";
|
|
9609
|
-
if (typeof exclusiveMinimum === "number")
|
|
9610
|
-
|
|
10783
|
+
if (typeof exclusiveMinimum === "number") {
|
|
10784
|
+
if (this.target === "draft-4" || this.target === "openapi-3.0") {
|
|
10785
|
+
json.minimum = exclusiveMinimum;
|
|
10786
|
+
json.exclusiveMinimum = true;
|
|
10787
|
+
} else {
|
|
10788
|
+
json.exclusiveMinimum = exclusiveMinimum;
|
|
10789
|
+
}
|
|
10790
|
+
}
|
|
9611
10791
|
if (typeof minimum === "number") {
|
|
9612
10792
|
json.minimum = minimum;
|
|
9613
|
-
if (typeof exclusiveMinimum === "number") {
|
|
10793
|
+
if (typeof exclusiveMinimum === "number" && this.target !== "draft-4") {
|
|
9614
10794
|
if (exclusiveMinimum >= minimum)
|
|
9615
10795
|
delete json.minimum;
|
|
9616
10796
|
else
|
|
9617
10797
|
delete json.exclusiveMinimum;
|
|
9618
10798
|
}
|
|
9619
10799
|
}
|
|
9620
|
-
if (typeof exclusiveMaximum === "number")
|
|
9621
|
-
|
|
10800
|
+
if (typeof exclusiveMaximum === "number") {
|
|
10801
|
+
if (this.target === "draft-4" || this.target === "openapi-3.0") {
|
|
10802
|
+
json.maximum = exclusiveMaximum;
|
|
10803
|
+
json.exclusiveMaximum = true;
|
|
10804
|
+
} else {
|
|
10805
|
+
json.exclusiveMaximum = exclusiveMaximum;
|
|
10806
|
+
}
|
|
10807
|
+
}
|
|
9622
10808
|
if (typeof maximum === "number") {
|
|
9623
10809
|
json.maximum = maximum;
|
|
9624
|
-
if (typeof exclusiveMaximum === "number") {
|
|
10810
|
+
if (typeof exclusiveMaximum === "number" && this.target !== "draft-4") {
|
|
9625
10811
|
if (exclusiveMaximum <= maximum)
|
|
9626
10812
|
delete json.maximum;
|
|
9627
10813
|
else
|
|
@@ -9650,7 +10836,12 @@ class JSONSchemaGenerator {
|
|
|
9650
10836
|
break;
|
|
9651
10837
|
}
|
|
9652
10838
|
case "null": {
|
|
9653
|
-
|
|
10839
|
+
if (this.target === "openapi-3.0") {
|
|
10840
|
+
_json.type = "string";
|
|
10841
|
+
_json.nullable = true;
|
|
10842
|
+
_json.enum = [null];
|
|
10843
|
+
} else
|
|
10844
|
+
_json.type = "null";
|
|
9654
10845
|
break;
|
|
9655
10846
|
}
|
|
9656
10847
|
case "any": {
|
|
@@ -9730,10 +10921,11 @@ class JSONSchemaGenerator {
|
|
|
9730
10921
|
}
|
|
9731
10922
|
case "union": {
|
|
9732
10923
|
const json = _json;
|
|
9733
|
-
|
|
10924
|
+
const options = def.options.map((x, i) => this.process(x, {
|
|
9734
10925
|
...params,
|
|
9735
10926
|
path: [...params.path, "anyOf", i]
|
|
9736
10927
|
}));
|
|
10928
|
+
json.anyOf = options;
|
|
9737
10929
|
break;
|
|
9738
10930
|
}
|
|
9739
10931
|
case "intersection": {
|
|
@@ -9757,29 +10949,38 @@ class JSONSchemaGenerator {
|
|
|
9757
10949
|
case "tuple": {
|
|
9758
10950
|
const json = _json;
|
|
9759
10951
|
json.type = "array";
|
|
9760
|
-
const
|
|
10952
|
+
const prefixPath = this.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
10953
|
+
const restPath = this.target === "draft-2020-12" ? "items" : this.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
10954
|
+
const prefixItems = def.items.map((x, i) => this.process(x, {
|
|
10955
|
+
...params,
|
|
10956
|
+
path: [...params.path, prefixPath, i]
|
|
10957
|
+
}));
|
|
10958
|
+
const rest = def.rest ? this.process(def.rest, {
|
|
10959
|
+
...params,
|
|
10960
|
+
path: [...params.path, restPath, ...this.target === "openapi-3.0" ? [def.items.length] : []]
|
|
10961
|
+
}) : null;
|
|
9761
10962
|
if (this.target === "draft-2020-12") {
|
|
9762
10963
|
json.prefixItems = prefixItems;
|
|
10964
|
+
if (rest) {
|
|
10965
|
+
json.items = rest;
|
|
10966
|
+
}
|
|
10967
|
+
} else if (this.target === "openapi-3.0") {
|
|
10968
|
+
json.items = {
|
|
10969
|
+
anyOf: prefixItems
|
|
10970
|
+
};
|
|
10971
|
+
if (rest) {
|
|
10972
|
+
json.items.anyOf.push(rest);
|
|
10973
|
+
}
|
|
10974
|
+
json.minItems = prefixItems.length;
|
|
10975
|
+
if (!rest) {
|
|
10976
|
+
json.maxItems = prefixItems.length;
|
|
10977
|
+
}
|
|
9763
10978
|
} else {
|
|
9764
10979
|
json.items = prefixItems;
|
|
9765
|
-
|
|
9766
|
-
if (def.rest) {
|
|
9767
|
-
const rest = this.process(def.rest, {
|
|
9768
|
-
...params,
|
|
9769
|
-
path: [...params.path, "items"]
|
|
9770
|
-
});
|
|
9771
|
-
if (this.target === "draft-2020-12") {
|
|
9772
|
-
json.items = rest;
|
|
9773
|
-
} else {
|
|
10980
|
+
if (rest) {
|
|
9774
10981
|
json.additionalItems = rest;
|
|
9775
10982
|
}
|
|
9776
10983
|
}
|
|
9777
|
-
if (def.rest) {
|
|
9778
|
-
json.items = this.process(def.rest, {
|
|
9779
|
-
...params,
|
|
9780
|
-
path: [...params.path, "items"]
|
|
9781
|
-
});
|
|
9782
|
-
}
|
|
9783
10984
|
const { minimum, maximum } = schema._zod.bag;
|
|
9784
10985
|
if (typeof minimum === "number")
|
|
9785
10986
|
json.minItems = minimum;
|
|
@@ -9790,7 +10991,12 @@ class JSONSchemaGenerator {
|
|
|
9790
10991
|
case "record": {
|
|
9791
10992
|
const json = _json;
|
|
9792
10993
|
json.type = "object";
|
|
9793
|
-
|
|
10994
|
+
if (this.target === "draft-7" || this.target === "draft-2020-12") {
|
|
10995
|
+
json.propertyNames = this.process(def.keyType, {
|
|
10996
|
+
...params,
|
|
10997
|
+
path: [...params.path, "propertyNames"]
|
|
10998
|
+
});
|
|
10999
|
+
}
|
|
9794
11000
|
json.additionalProperties = this.process(def.valueType, {
|
|
9795
11001
|
...params,
|
|
9796
11002
|
path: [...params.path, "additionalProperties"]
|
|
@@ -9840,7 +11046,11 @@ class JSONSchemaGenerator {
|
|
|
9840
11046
|
if (vals.length === 0) {} else if (vals.length === 1) {
|
|
9841
11047
|
const val = vals[0];
|
|
9842
11048
|
json.type = val === null ? "null" : typeof val;
|
|
9843
|
-
|
|
11049
|
+
if (this.target === "draft-4" || this.target === "openapi-3.0") {
|
|
11050
|
+
json.enum = [val];
|
|
11051
|
+
} else {
|
|
11052
|
+
json.const = val;
|
|
11053
|
+
}
|
|
9844
11054
|
} else {
|
|
9845
11055
|
if (vals.every((v) => typeof v === "number"))
|
|
9846
11056
|
json.type = "number";
|
|
@@ -9889,7 +11099,12 @@ class JSONSchemaGenerator {
|
|
|
9889
11099
|
}
|
|
9890
11100
|
case "nullable": {
|
|
9891
11101
|
const inner = this.process(def.innerType, params);
|
|
9892
|
-
|
|
11102
|
+
if (this.target === "openapi-3.0") {
|
|
11103
|
+
result.ref = def.innerType;
|
|
11104
|
+
_json.nullable = true;
|
|
11105
|
+
} else {
|
|
11106
|
+
_json.anyOf = [inner, { type: "null" }];
|
|
11107
|
+
}
|
|
9893
11108
|
break;
|
|
9894
11109
|
}
|
|
9895
11110
|
case "nonoptional": {
|
|
@@ -9976,6 +11191,12 @@ class JSONSchemaGenerator {
|
|
|
9976
11191
|
}
|
|
9977
11192
|
break;
|
|
9978
11193
|
}
|
|
11194
|
+
case "function": {
|
|
11195
|
+
if (this.unrepresentable === "throw") {
|
|
11196
|
+
throw new Error("Function types cannot be represented in JSON Schema");
|
|
11197
|
+
}
|
|
11198
|
+
break;
|
|
11199
|
+
}
|
|
9979
11200
|
default: {}
|
|
9980
11201
|
}
|
|
9981
11202
|
}
|
|
@@ -10086,7 +11307,7 @@ class JSONSchemaGenerator {
|
|
|
10086
11307
|
if (ref) {
|
|
10087
11308
|
flattenRef(ref, params2);
|
|
10088
11309
|
const refSchema = this.seen.get(ref).schema;
|
|
10089
|
-
if (refSchema.$ref && params2.target === "draft-7") {
|
|
11310
|
+
if (refSchema.$ref && (params2.target === "draft-7" || params2.target === "draft-4" || params2.target === "openapi-3.0")) {
|
|
10090
11311
|
schema2.allOf = schema2.allOf ?? [];
|
|
10091
11312
|
schema2.allOf.push(refSchema);
|
|
10092
11313
|
} else {
|
|
@@ -10109,7 +11330,9 @@ class JSONSchemaGenerator {
|
|
|
10109
11330
|
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
10110
11331
|
} else if (this.target === "draft-7") {
|
|
10111
11332
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
10112
|
-
} else {
|
|
11333
|
+
} else if (this.target === "draft-4") {
|
|
11334
|
+
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
11335
|
+
} else if (this.target === "openapi-3.0") {} else {
|
|
10113
11336
|
console.warn(`Invalid target: ${this.target}`);
|
|
10114
11337
|
}
|
|
10115
11338
|
if (params.external?.uri) {
|
|
@@ -10268,6 +11491,9 @@ function isTransforming(_schema, _ctx) {
|
|
|
10268
11491
|
case "catch": {
|
|
10269
11492
|
return false;
|
|
10270
11493
|
}
|
|
11494
|
+
case "function": {
|
|
11495
|
+
return false;
|
|
11496
|
+
}
|
|
10271
11497
|
default:
|
|
10272
11498
|
}
|
|
10273
11499
|
throw new Error(`Unknown schema type: ${def.type}`);
|
|
@@ -10327,10 +11553,16 @@ var initializer2 = (inst, issues) => {
|
|
|
10327
11553
|
value: (mapper) => flattenError(inst, mapper)
|
|
10328
11554
|
},
|
|
10329
11555
|
addIssue: {
|
|
10330
|
-
value: (issue2) =>
|
|
11556
|
+
value: (issue2) => {
|
|
11557
|
+
inst.issues.push(issue2);
|
|
11558
|
+
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
11559
|
+
}
|
|
10331
11560
|
},
|
|
10332
11561
|
addIssues: {
|
|
10333
|
-
value: (issues2) =>
|
|
11562
|
+
value: (issues2) => {
|
|
11563
|
+
inst.issues.push(...issues2);
|
|
11564
|
+
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
11565
|
+
}
|
|
10334
11566
|
},
|
|
10335
11567
|
isEmpty: {
|
|
10336
11568
|
get() {
|
|
@@ -10349,20 +11581,28 @@ var parse3 = /* @__PURE__ */ _parse(ZodRealError);
|
|
|
10349
11581
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
10350
11582
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
10351
11583
|
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
11584
|
+
var encode2 = /* @__PURE__ */ _encode(ZodRealError);
|
|
11585
|
+
var decode2 = /* @__PURE__ */ _decode(ZodRealError);
|
|
11586
|
+
var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
11587
|
+
var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
11588
|
+
var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
11589
|
+
var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
11590
|
+
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
11591
|
+
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
10352
11592
|
|
|
10353
11593
|
// ../../node_modules/zod/v4/classic/schemas.js
|
|
10354
11594
|
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
10355
11595
|
$ZodType.init(inst, def);
|
|
10356
11596
|
inst.def = def;
|
|
11597
|
+
inst.type = def.type;
|
|
10357
11598
|
Object.defineProperty(inst, "_def", { value: def });
|
|
10358
11599
|
inst.check = (...checks2) => {
|
|
10359
|
-
return inst.clone({
|
|
10360
|
-
...def,
|
|
11600
|
+
return inst.clone(exports_util.mergeDefs(def, {
|
|
10361
11601
|
checks: [
|
|
10362
11602
|
...def.checks ?? [],
|
|
10363
11603
|
...checks2.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
10364
11604
|
]
|
|
10365
|
-
});
|
|
11605
|
+
}));
|
|
10366
11606
|
};
|
|
10367
11607
|
inst.clone = (def2, params) => clone(inst, def2, params);
|
|
10368
11608
|
inst.brand = () => inst;
|
|
@@ -10375,6 +11615,14 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
10375
11615
|
inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
|
|
10376
11616
|
inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
|
|
10377
11617
|
inst.spa = inst.safeParseAsync;
|
|
11618
|
+
inst.encode = (data, params) => encode2(inst, data, params);
|
|
11619
|
+
inst.decode = (data, params) => decode2(inst, data, params);
|
|
11620
|
+
inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
|
|
11621
|
+
inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
|
|
11622
|
+
inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
|
|
11623
|
+
inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
|
|
11624
|
+
inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
|
|
11625
|
+
inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
|
|
10378
11626
|
inst.refine = (check, params) => inst.check(refine(check, params));
|
|
10379
11627
|
inst.superRefine = (refinement) => inst.check(superRefine(refinement));
|
|
10380
11628
|
inst.overwrite = (fn) => inst.check(_overwrite(fn));
|
|
@@ -10511,6 +11759,13 @@ var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
|
10511
11759
|
function url(params) {
|
|
10512
11760
|
return _url(ZodURL, params);
|
|
10513
11761
|
}
|
|
11762
|
+
function httpUrl(params) {
|
|
11763
|
+
return _url(ZodURL, {
|
|
11764
|
+
protocol: /^https?$/,
|
|
11765
|
+
hostname: exports_regexes.domain,
|
|
11766
|
+
...exports_util.normalizeParams(params)
|
|
11767
|
+
});
|
|
11768
|
+
}
|
|
10514
11769
|
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
10515
11770
|
$ZodEmoji.init(inst, def);
|
|
10516
11771
|
ZodStringFormat.init(inst, def);
|
|
@@ -10623,6 +11878,20 @@ var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat"
|
|
|
10623
11878
|
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
10624
11879
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
10625
11880
|
}
|
|
11881
|
+
function hostname2(_params) {
|
|
11882
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
|
|
11883
|
+
}
|
|
11884
|
+
function hex2(_params) {
|
|
11885
|
+
return _stringFormat(ZodCustomStringFormat, "hex", exports_regexes.hex, _params);
|
|
11886
|
+
}
|
|
11887
|
+
function hash(alg, params) {
|
|
11888
|
+
const enc = params?.enc ?? "hex";
|
|
11889
|
+
const format = `${alg}_${enc}`;
|
|
11890
|
+
const regex = exports_regexes[format];
|
|
11891
|
+
if (!regex)
|
|
11892
|
+
throw new Error(`Unrecognized hash format: ${format}`);
|
|
11893
|
+
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
11894
|
+
}
|
|
10626
11895
|
var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
10627
11896
|
$ZodNumber.init(inst, def);
|
|
10628
11897
|
ZodType.init(inst, def);
|
|
@@ -10787,12 +12056,14 @@ function array(element, params) {
|
|
|
10787
12056
|
}
|
|
10788
12057
|
function keyof(schema) {
|
|
10789
12058
|
const shape = schema._zod.def.shape;
|
|
10790
|
-
return
|
|
12059
|
+
return _enum2(Object.keys(shape));
|
|
10791
12060
|
}
|
|
10792
12061
|
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
10793
|
-
$
|
|
12062
|
+
$ZodObjectJIT.init(inst, def);
|
|
10794
12063
|
ZodType.init(inst, def);
|
|
10795
|
-
exports_util.defineLazy(inst, "shape", () =>
|
|
12064
|
+
exports_util.defineLazy(inst, "shape", () => {
|
|
12065
|
+
return def.shape;
|
|
12066
|
+
});
|
|
10796
12067
|
inst.keyof = () => _enum2(Object.keys(inst._zod.def.shape));
|
|
10797
12068
|
inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
|
|
10798
12069
|
inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
|
|
@@ -10802,6 +12073,9 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
10802
12073
|
inst.extend = (incoming) => {
|
|
10803
12074
|
return exports_util.extend(inst, incoming);
|
|
10804
12075
|
};
|
|
12076
|
+
inst.safeExtend = (incoming) => {
|
|
12077
|
+
return exports_util.safeExtend(inst, incoming);
|
|
12078
|
+
};
|
|
10805
12079
|
inst.merge = (other) => exports_util.merge(inst, other);
|
|
10806
12080
|
inst.pick = (mask) => exports_util.pick(inst, mask);
|
|
10807
12081
|
inst.omit = (mask) => exports_util.omit(inst, mask);
|
|
@@ -10811,10 +12085,7 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
10811
12085
|
function object(shape, params) {
|
|
10812
12086
|
const def = {
|
|
10813
12087
|
type: "object",
|
|
10814
|
-
|
|
10815
|
-
exports_util.assignProp(this, "shape", { ...shape });
|
|
10816
|
-
return this.shape;
|
|
10817
|
-
},
|
|
12088
|
+
shape: shape ?? {},
|
|
10818
12089
|
...exports_util.normalizeParams(params)
|
|
10819
12090
|
};
|
|
10820
12091
|
return new ZodObject(def);
|
|
@@ -10822,10 +12093,7 @@ function object(shape, params) {
|
|
|
10822
12093
|
function strictObject(shape, params) {
|
|
10823
12094
|
return new ZodObject({
|
|
10824
12095
|
type: "object",
|
|
10825
|
-
|
|
10826
|
-
exports_util.assignProp(this, "shape", { ...shape });
|
|
10827
|
-
return this.shape;
|
|
10828
|
-
},
|
|
12096
|
+
shape,
|
|
10829
12097
|
catchall: never(),
|
|
10830
12098
|
...exports_util.normalizeParams(params)
|
|
10831
12099
|
});
|
|
@@ -10833,10 +12101,7 @@ function strictObject(shape, params) {
|
|
|
10833
12101
|
function looseObject(shape, params) {
|
|
10834
12102
|
return new ZodObject({
|
|
10835
12103
|
type: "object",
|
|
10836
|
-
|
|
10837
|
-
exports_util.assignProp(this, "shape", { ...shape });
|
|
10838
|
-
return this.shape;
|
|
10839
|
-
},
|
|
12104
|
+
shape,
|
|
10840
12105
|
catchall: unknown(),
|
|
10841
12106
|
...exports_util.normalizeParams(params)
|
|
10842
12107
|
});
|
|
@@ -10910,9 +12175,11 @@ function record(keyType, valueType, params) {
|
|
|
10910
12175
|
});
|
|
10911
12176
|
}
|
|
10912
12177
|
function partialRecord(keyType, valueType, params) {
|
|
12178
|
+
const k = clone(keyType);
|
|
12179
|
+
k._zod.values = undefined;
|
|
10913
12180
|
return new ZodRecord({
|
|
10914
12181
|
type: "record",
|
|
10915
|
-
keyType:
|
|
12182
|
+
keyType: k,
|
|
10916
12183
|
valueType,
|
|
10917
12184
|
...exports_util.normalizeParams(params)
|
|
10918
12185
|
});
|
|
@@ -11032,6 +12299,9 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
|
11032
12299
|
$ZodTransform.init(inst, def);
|
|
11033
12300
|
ZodType.init(inst, def);
|
|
11034
12301
|
inst._zod.parse = (payload, _ctx) => {
|
|
12302
|
+
if (_ctx.direction === "backward") {
|
|
12303
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
12304
|
+
}
|
|
11035
12305
|
payload.addIssue = (issue2) => {
|
|
11036
12306
|
if (typeof issue2 === "string") {
|
|
11037
12307
|
payload.issues.push(exports_util.issue(issue2, payload.value, def));
|
|
@@ -11042,7 +12312,6 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
|
11042
12312
|
_issue.code ?? (_issue.code = "custom");
|
|
11043
12313
|
_issue.input ?? (_issue.input = payload.value);
|
|
11044
12314
|
_issue.inst ?? (_issue.inst = inst);
|
|
11045
|
-
_issue.continue ?? (_issue.continue = true);
|
|
11046
12315
|
payload.issues.push(exports_util.issue(_issue));
|
|
11047
12316
|
}
|
|
11048
12317
|
};
|
|
@@ -11099,7 +12368,7 @@ function _default2(innerType, defaultValue) {
|
|
|
11099
12368
|
type: "default",
|
|
11100
12369
|
innerType,
|
|
11101
12370
|
get defaultValue() {
|
|
11102
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
12371
|
+
return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue);
|
|
11103
12372
|
}
|
|
11104
12373
|
});
|
|
11105
12374
|
}
|
|
@@ -11113,7 +12382,7 @@ function prefault(innerType, defaultValue) {
|
|
|
11113
12382
|
type: "prefault",
|
|
11114
12383
|
innerType,
|
|
11115
12384
|
get defaultValue() {
|
|
11116
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
12385
|
+
return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue);
|
|
11117
12386
|
}
|
|
11118
12387
|
});
|
|
11119
12388
|
}
|
|
@@ -11173,9 +12442,23 @@ function pipe(in_, out) {
|
|
|
11173
12442
|
out
|
|
11174
12443
|
});
|
|
11175
12444
|
}
|
|
12445
|
+
var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => {
|
|
12446
|
+
ZodPipe.init(inst, def);
|
|
12447
|
+
$ZodCodec.init(inst, def);
|
|
12448
|
+
});
|
|
12449
|
+
function codec(in_, out, params) {
|
|
12450
|
+
return new ZodCodec({
|
|
12451
|
+
type: "pipe",
|
|
12452
|
+
in: in_,
|
|
12453
|
+
out,
|
|
12454
|
+
transform: params.decode,
|
|
12455
|
+
reverseTransform: params.encode
|
|
12456
|
+
});
|
|
12457
|
+
}
|
|
11176
12458
|
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
11177
12459
|
$ZodReadonly.init(inst, def);
|
|
11178
12460
|
ZodType.init(inst, def);
|
|
12461
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
11179
12462
|
});
|
|
11180
12463
|
function readonly(innerType) {
|
|
11181
12464
|
return new ZodReadonly({
|
|
@@ -11216,6 +12499,17 @@ function promise(innerType) {
|
|
|
11216
12499
|
innerType
|
|
11217
12500
|
});
|
|
11218
12501
|
}
|
|
12502
|
+
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
12503
|
+
$ZodFunction.init(inst, def);
|
|
12504
|
+
ZodType.init(inst, def);
|
|
12505
|
+
});
|
|
12506
|
+
function _function(params) {
|
|
12507
|
+
return new ZodFunction({
|
|
12508
|
+
type: "function",
|
|
12509
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
|
|
12510
|
+
output: params?.output ?? unknown()
|
|
12511
|
+
});
|
|
12512
|
+
}
|
|
11219
12513
|
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
11220
12514
|
$ZodCustom.init(inst, def);
|
|
11221
12515
|
ZodType.init(inst, def);
|
|
@@ -11234,24 +12528,7 @@ function refine(fn, _params = {}) {
|
|
|
11234
12528
|
return _refine(ZodCustom, fn, _params);
|
|
11235
12529
|
}
|
|
11236
12530
|
function superRefine(fn) {
|
|
11237
|
-
|
|
11238
|
-
payload.addIssue = (issue2) => {
|
|
11239
|
-
if (typeof issue2 === "string") {
|
|
11240
|
-
payload.issues.push(exports_util.issue(issue2, payload.value, ch._zod.def));
|
|
11241
|
-
} else {
|
|
11242
|
-
const _issue = issue2;
|
|
11243
|
-
if (_issue.fatal)
|
|
11244
|
-
_issue.continue = false;
|
|
11245
|
-
_issue.code ?? (_issue.code = "custom");
|
|
11246
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
11247
|
-
_issue.inst ?? (_issue.inst = ch);
|
|
11248
|
-
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
11249
|
-
payload.issues.push(exports_util.issue(_issue));
|
|
11250
|
-
}
|
|
11251
|
-
};
|
|
11252
|
-
return fn(payload.value, payload);
|
|
11253
|
-
});
|
|
11254
|
-
return ch;
|
|
12531
|
+
return _superRefine(fn);
|
|
11255
12532
|
}
|
|
11256
12533
|
function _instanceof(cls, params = {
|
|
11257
12534
|
error: `Input not instance of ${cls.name}`
|
|
@@ -11267,10 +12544,9 @@ function _instanceof(cls, params = {
|
|
|
11267
12544
|
return inst;
|
|
11268
12545
|
}
|
|
11269
12546
|
var stringbool = (...args) => _stringbool({
|
|
11270
|
-
|
|
12547
|
+
Codec: ZodCodec,
|
|
11271
12548
|
Boolean: ZodBoolean,
|
|
11272
|
-
String: ZodString
|
|
11273
|
-
Transform: ZodTransform
|
|
12549
|
+
String: ZodString
|
|
11274
12550
|
}, ...args);
|
|
11275
12551
|
function json(params) {
|
|
11276
12552
|
const jsonSchema = lazy(() => {
|
|
@@ -11303,6 +12579,8 @@ function setErrorMap(map2) {
|
|
|
11303
12579
|
function getErrorMap() {
|
|
11304
12580
|
return config().customError;
|
|
11305
12581
|
}
|
|
12582
|
+
var ZodFirstPartyTypeKind;
|
|
12583
|
+
(function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
11306
12584
|
// ../../node_modules/zod/v4/classic/coerce.js
|
|
11307
12585
|
var exports_coerce = {};
|
|
11308
12586
|
__export(exports_coerce, {
|
|
@@ -11812,5 +13090,5 @@ class MockMemoryRepository {
|
|
|
11812
13090
|
}
|
|
11813
13091
|
}
|
|
11814
13092
|
|
|
11815
|
-
//# debugId=
|
|
13093
|
+
//# debugId=63100B44900CBD5A64756E2164756E21
|
|
11816
13094
|
//# sourceMappingURL=index.cjs.map
|