sibyl-system 1.4.0 → 1.6.0
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/README.md +24 -5
- package/dist/cli.js +1631 -771
- package/dist/index.js +3945 -15322
- package/package.json +10 -5
package/dist/cli.js
CHANGED
|
@@ -1351,6 +1351,7 @@ __export(external_exports, {
|
|
|
1351
1351
|
$brand: () => $brand,
|
|
1352
1352
|
$input: () => $input,
|
|
1353
1353
|
$output: () => $output,
|
|
1354
|
+
INVALID: () => INVALID,
|
|
1354
1355
|
NEVER: () => NEVER,
|
|
1355
1356
|
TimePrecision: () => TimePrecision,
|
|
1356
1357
|
ZodAny: () => ZodAny,
|
|
@@ -1384,12 +1385,14 @@ __export(external_exports, {
|
|
|
1384
1385
|
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
1385
1386
|
ZodFunction: () => ZodFunction,
|
|
1386
1387
|
ZodGUID: () => ZodGUID,
|
|
1388
|
+
ZodIBAN: () => ZodIBAN,
|
|
1387
1389
|
ZodIPv4: () => ZodIPv4,
|
|
1388
1390
|
ZodIPv6: () => ZodIPv6,
|
|
1389
1391
|
ZodISODate: () => ZodISODate,
|
|
1390
1392
|
ZodISODateTime: () => ZodISODateTime,
|
|
1391
1393
|
ZodISODuration: () => ZodISODuration,
|
|
1392
1394
|
ZodISOTime: () => ZodISOTime,
|
|
1395
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
1393
1396
|
ZodIntersection: () => ZodIntersection,
|
|
1394
1397
|
ZodIssueCode: () => ZodIssueCode,
|
|
1395
1398
|
ZodJWT: () => ZodJWT,
|
|
@@ -1455,6 +1458,7 @@ __export(external_exports, {
|
|
|
1455
1458
|
creditCard: () => creditCard2,
|
|
1456
1459
|
cuid: () => cuid3,
|
|
1457
1460
|
cuid2: () => cuid22,
|
|
1461
|
+
currencyCode: () => currencyCode2,
|
|
1458
1462
|
custom: () => custom,
|
|
1459
1463
|
date: () => date2,
|
|
1460
1464
|
decode: () => decode2,
|
|
@@ -1487,6 +1491,7 @@ __export(external_exports, {
|
|
|
1487
1491
|
hex: () => hex2,
|
|
1488
1492
|
hostname: () => hostname2,
|
|
1489
1493
|
httpUrl: () => httpUrl,
|
|
1494
|
+
iban: () => iban2,
|
|
1490
1495
|
includes: () => _includes,
|
|
1491
1496
|
input: () => input,
|
|
1492
1497
|
instanceof: () => _instanceof,
|
|
@@ -1598,6 +1603,7 @@ __export(external_exports, {
|
|
|
1598
1603
|
validate: () => validate,
|
|
1599
1604
|
validateAsync: () => validateAsync,
|
|
1600
1605
|
void: () => _void2,
|
|
1606
|
+
withParser: () => withParser,
|
|
1601
1607
|
xid: () => xid2,
|
|
1602
1608
|
xor: () => xor
|
|
1603
1609
|
});
|
|
@@ -1634,6 +1640,7 @@ __export(core_exports2, {
|
|
|
1634
1640
|
$ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
|
|
1635
1641
|
$ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
|
|
1636
1642
|
$ZodCheckOverwrite: () => $ZodCheckOverwrite,
|
|
1643
|
+
$ZodCheckProperties: () => $ZodCheckProperties,
|
|
1637
1644
|
$ZodCheckProperty: () => $ZodCheckProperty,
|
|
1638
1645
|
$ZodCheckRegex: () => $ZodCheckRegex,
|
|
1639
1646
|
$ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
|
|
@@ -1658,6 +1665,7 @@ __export(core_exports2, {
|
|
|
1658
1665
|
$ZodFile: () => $ZodFile,
|
|
1659
1666
|
$ZodFunction: () => $ZodFunction,
|
|
1660
1667
|
$ZodGUID: () => $ZodGUID,
|
|
1668
|
+
$ZodIBAN: () => $ZodIBAN,
|
|
1661
1669
|
$ZodIPv4: () => $ZodIPv4,
|
|
1662
1670
|
$ZodIPv6: () => $ZodIPv6,
|
|
1663
1671
|
$ZodISODate: () => $ZodISODate,
|
|
@@ -1759,6 +1767,7 @@ __export(core_exports2, {
|
|
|
1759
1767
|
_gt: () => _gt,
|
|
1760
1768
|
_gte: () => _gte,
|
|
1761
1769
|
_guid: () => _guid,
|
|
1770
|
+
_iban: () => _iban,
|
|
1762
1771
|
_includes: () => _includes,
|
|
1763
1772
|
_int: () => _int,
|
|
1764
1773
|
_int32: () => _int32,
|
|
@@ -1850,6 +1859,9 @@ __export(core_exports2, {
|
|
|
1850
1859
|
_void: () => _void,
|
|
1851
1860
|
_xid: () => _xid,
|
|
1852
1861
|
_xor: () => _xor,
|
|
1862
|
+
base64Charset: () => base64Charset,
|
|
1863
|
+
base64urlCharset: () => base64urlCharset,
|
|
1864
|
+
canParseURL: () => canParseURL,
|
|
1853
1865
|
clone: () => clone,
|
|
1854
1866
|
compile: () => compile,
|
|
1855
1867
|
compileFn: () => compileFn,
|
|
@@ -1876,6 +1888,7 @@ __export(core_exports2, {
|
|
|
1876
1888
|
isValidBase64URL: () => isValidBase64URL,
|
|
1877
1889
|
isValidCIDRv6: () => isValidCIDRv6,
|
|
1878
1890
|
isValidCreditCard: () => isValidCreditCard,
|
|
1891
|
+
isValidIBAN: () => isValidIBAN,
|
|
1879
1892
|
isValidIPv6: () => isValidIPv6,
|
|
1880
1893
|
isValidJWT: () => isValidJWT,
|
|
1881
1894
|
locales: () => locales_exports,
|
|
@@ -1886,7 +1899,8 @@ __export(core_exports2, {
|
|
|
1886
1899
|
parseAsync: () => parseAsync,
|
|
1887
1900
|
parseURLObject: () => parseURLObject,
|
|
1888
1901
|
prettifyError: () => prettifyError,
|
|
1889
|
-
process: () =>
|
|
1902
|
+
process: () => processSchema,
|
|
1903
|
+
processSchema: () => processSchema,
|
|
1890
1904
|
regexes: () => regexes_exports,
|
|
1891
1905
|
registry: () => registry,
|
|
1892
1906
|
safeDecode: () => safeDecode,
|
|
@@ -1906,7 +1920,9 @@ __export(core_exports2, {
|
|
|
1906
1920
|
util: () => util_exports,
|
|
1907
1921
|
validate: () => validate,
|
|
1908
1922
|
validateAsync: () => validateAsync,
|
|
1909
|
-
|
|
1923
|
+
validateURL: () => validateURL,
|
|
1924
|
+
version: () => version,
|
|
1925
|
+
withParser: () => withParser
|
|
1910
1926
|
});
|
|
1911
1927
|
|
|
1912
1928
|
// node_modules/zod/v4/core/util.js
|
|
@@ -1938,6 +1954,7 @@ __export(util_exports, {
|
|
|
1938
1954
|
createTransparentProxy: () => createTransparentProxy,
|
|
1939
1955
|
defineLazy: () => defineLazy,
|
|
1940
1956
|
defineLazyInternal: () => defineLazyInternal,
|
|
1957
|
+
derived: () => derived,
|
|
1941
1958
|
esc: () => esc,
|
|
1942
1959
|
escapeRegex: () => escapeRegex,
|
|
1943
1960
|
explicitlyAborted: () => explicitlyAborted,
|
|
@@ -1975,9 +1992,11 @@ __export(util_exports, {
|
|
|
1975
1992
|
promiseAllObject: () => promiseAllObject,
|
|
1976
1993
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
1977
1994
|
randomString: () => randomString,
|
|
1995
|
+
rawShape: () => rawShape,
|
|
1978
1996
|
required: () => required,
|
|
1979
1997
|
safeExtend: () => safeExtend,
|
|
1980
1998
|
shallowClone: () => shallowClone,
|
|
1999
|
+
sizeCaps: () => sizeCaps,
|
|
1981
2000
|
slugify: () => slugify,
|
|
1982
2001
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
1983
2002
|
toZod: () => toZod,
|
|
@@ -2015,18 +2034,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
2015
2034
|
return value.toString();
|
|
2016
2035
|
return value;
|
|
2017
2036
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2037
|
+
var Cached = class {
|
|
2038
|
+
constructor(getter) {
|
|
2039
|
+
this._getter = getter;
|
|
2040
|
+
this._value = void 0;
|
|
2041
|
+
}
|
|
2042
|
+
get value() {
|
|
2043
|
+
const getter = this._getter;
|
|
2044
|
+
if (getter !== void 0) {
|
|
2045
|
+
this._value = getter();
|
|
2046
|
+
this._getter = void 0;
|
|
2028
2047
|
}
|
|
2029
|
-
|
|
2048
|
+
return this._value;
|
|
2049
|
+
}
|
|
2050
|
+
};
|
|
2051
|
+
function cached2(getter) {
|
|
2052
|
+
return new Cached(getter);
|
|
2030
2053
|
}
|
|
2031
2054
|
function nullish(input2) {
|
|
2032
2055
|
return input2 === null || input2 === void 0;
|
|
@@ -2078,6 +2101,56 @@ function assignProp(target, prop, value) {
|
|
|
2078
2101
|
configurable: true
|
|
2079
2102
|
});
|
|
2080
2103
|
}
|
|
2104
|
+
function rawShape(def) {
|
|
2105
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2106
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
2107
|
+
}
|
|
2108
|
+
function sourceShape(schema) {
|
|
2109
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
2110
|
+
}
|
|
2111
|
+
function deferProp(target, key, getter) {
|
|
2112
|
+
Object.defineProperty(target, key, {
|
|
2113
|
+
get() {
|
|
2114
|
+
const value = getter();
|
|
2115
|
+
assignProp(this, key, value);
|
|
2116
|
+
return value;
|
|
2117
|
+
},
|
|
2118
|
+
enumerable: true,
|
|
2119
|
+
configurable: true
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
function putProp(target, key, value) {
|
|
2123
|
+
if (key in target)
|
|
2124
|
+
assignProp(target, key, value);
|
|
2125
|
+
else
|
|
2126
|
+
target[key] = value;
|
|
2127
|
+
}
|
|
2128
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
2129
|
+
const raw = sourceShape(source);
|
|
2130
|
+
for (const key of keys) {
|
|
2131
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
2132
|
+
if (!desc.enumerable)
|
|
2133
|
+
continue;
|
|
2134
|
+
if (desc.get) {
|
|
2135
|
+
deferProp(target, key, () => {
|
|
2136
|
+
const value = source._zod.def.shape[key];
|
|
2137
|
+
return wrap ? wrap(value, key) : value;
|
|
2138
|
+
});
|
|
2139
|
+
} else
|
|
2140
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
function mirrorProps(target, source) {
|
|
2144
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
2145
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
2146
|
+
if (!desc.enumerable)
|
|
2147
|
+
continue;
|
|
2148
|
+
if (desc.get)
|
|
2149
|
+
deferProp(target, key, () => source[key]);
|
|
2150
|
+
else
|
|
2151
|
+
putProp(target, key, desc.value);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2081
2154
|
function mergeDefs(...defs) {
|
|
2082
2155
|
const mergedDescriptors = {};
|
|
2083
2156
|
for (const def of defs) {
|
|
@@ -2316,23 +2389,21 @@ function pick(schema, mask) {
|
|
|
2316
2389
|
if (hasChecks) {
|
|
2317
2390
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
2318
2391
|
}
|
|
2319
|
-
const
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
});
|
|
2335
|
-
return clone(schema, def);
|
|
2392
|
+
const newShape = {};
|
|
2393
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
2394
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
2395
|
+
}
|
|
2396
|
+
function maskedKeys(schema, mask) {
|
|
2397
|
+
const raw = sourceShape(schema);
|
|
2398
|
+
const keys = [];
|
|
2399
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
2400
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
2401
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2402
|
+
}
|
|
2403
|
+
if (mask[key])
|
|
2404
|
+
keys.push(key);
|
|
2405
|
+
}
|
|
2406
|
+
return keys;
|
|
2336
2407
|
}
|
|
2337
2408
|
function omit(schema, mask) {
|
|
2338
2409
|
const currDef = schema._zod.def;
|
|
@@ -2341,23 +2412,10 @@ function omit(schema, mask) {
|
|
|
2341
2412
|
if (hasChecks) {
|
|
2342
2413
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
2343
2414
|
}
|
|
2344
|
-
const
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
2349
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2350
|
-
}
|
|
2351
|
-
if (!mask[key])
|
|
2352
|
-
continue;
|
|
2353
|
-
delete newShape[key];
|
|
2354
|
-
}
|
|
2355
|
-
assignProp(this, "shape", newShape);
|
|
2356
|
-
return newShape;
|
|
2357
|
-
},
|
|
2358
|
-
checks: []
|
|
2359
|
-
});
|
|
2360
|
-
return clone(schema, def);
|
|
2415
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
2416
|
+
const newShape = {};
|
|
2417
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
2418
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
2361
2419
|
}
|
|
2362
2420
|
function extend(schema, shape) {
|
|
2363
2421
|
if (!isPlainObject(shape)) {
|
|
@@ -2366,34 +2424,26 @@ function extend(schema, shape) {
|
|
|
2366
2424
|
const checks = schema._zod.def.checks;
|
|
2367
2425
|
const hasChecks = checks && checks.length > 0;
|
|
2368
2426
|
if (hasChecks) {
|
|
2369
|
-
const existingShape = schema
|
|
2427
|
+
const existingShape = sourceShape(schema);
|
|
2370
2428
|
for (const key of Reflect.ownKeys(shape)) {
|
|
2371
2429
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
2372
2430
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
2373
2431
|
}
|
|
2374
2432
|
}
|
|
2375
2433
|
}
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
return clone(schema, def);
|
|
2434
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
2435
|
+
}
|
|
2436
|
+
function extended(schema, shape) {
|
|
2437
|
+
const newShape = {};
|
|
2438
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
2439
|
+
mirrorProps(newShape, shape);
|
|
2440
|
+
return newShape;
|
|
2384
2441
|
}
|
|
2385
2442
|
function safeExtend(schema, shape) {
|
|
2386
2443
|
if (!isPlainObject(shape)) {
|
|
2387
2444
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
2388
2445
|
}
|
|
2389
|
-
|
|
2390
|
-
get shape() {
|
|
2391
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
2392
|
-
assignProp(this, "shape", _shape);
|
|
2393
|
-
return _shape;
|
|
2394
|
-
}
|
|
2395
|
-
});
|
|
2396
|
-
return clone(schema, def);
|
|
2446
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
2397
2447
|
}
|
|
2398
2448
|
function merge(a, b) {
|
|
2399
2449
|
if (!b?._zod?.def) {
|
|
@@ -2402,12 +2452,11 @@ function merge(a, b) {
|
|
|
2402
2452
|
if (a._zod.def.checks?.length) {
|
|
2403
2453
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
2404
2454
|
}
|
|
2455
|
+
const newShape = {};
|
|
2456
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
2457
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
2405
2458
|
const def = mergeDefs(a._zod.def, {
|
|
2406
|
-
|
|
2407
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
2408
|
-
assignProp(this, "shape", _shape);
|
|
2409
|
-
return _shape;
|
|
2410
|
-
},
|
|
2459
|
+
shape: newShape,
|
|
2411
2460
|
get catchall() {
|
|
2412
2461
|
return b._zod.def.catchall;
|
|
2413
2462
|
},
|
|
@@ -2422,67 +2471,19 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
2422
2471
|
if (hasChecks) {
|
|
2423
2472
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
2424
2473
|
}
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
if (mask) {
|
|
2430
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
2431
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
2432
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2433
|
-
}
|
|
2434
|
-
if (!mask[key])
|
|
2435
|
-
continue;
|
|
2436
|
-
shape[key] = Class2 ? new Class2({
|
|
2437
|
-
type: "optional",
|
|
2438
|
-
innerType: oldShape[key]
|
|
2439
|
-
}) : oldShape[key];
|
|
2440
|
-
}
|
|
2441
|
-
} else {
|
|
2442
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
2443
|
-
shape[key] = Class2 ? new Class2({
|
|
2444
|
-
type: "optional",
|
|
2445
|
-
innerType: oldShape[key]
|
|
2446
|
-
}) : oldShape[key];
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
2449
|
-
assignProp(this, "shape", shape);
|
|
2450
|
-
return shape;
|
|
2451
|
-
},
|
|
2452
|
-
checks: []
|
|
2453
|
-
});
|
|
2454
|
-
return clone(schema, def);
|
|
2474
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
2475
|
+
const newShape = {};
|
|
2476
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
|
|
2477
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
2455
2478
|
}
|
|
2456
2479
|
function required(Class2, schema, mask) {
|
|
2457
|
-
const
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
2465
|
-
}
|
|
2466
|
-
if (!mask[key])
|
|
2467
|
-
continue;
|
|
2468
|
-
shape[key] = new Class2({
|
|
2469
|
-
type: "nonoptional",
|
|
2470
|
-
innerType: oldShape[key]
|
|
2471
|
-
});
|
|
2472
|
-
}
|
|
2473
|
-
} else {
|
|
2474
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
2475
|
-
shape[key] = new Class2({
|
|
2476
|
-
type: "nonoptional",
|
|
2477
|
-
innerType: oldShape[key]
|
|
2478
|
-
});
|
|
2479
|
-
}
|
|
2480
|
-
}
|
|
2481
|
-
assignProp(this, "shape", shape);
|
|
2482
|
-
return shape;
|
|
2483
|
-
}
|
|
2484
|
-
});
|
|
2485
|
-
return clone(schema, def);
|
|
2480
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
2481
|
+
const newShape = {};
|
|
2482
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
|
|
2483
|
+
// overwrite with non-optional
|
|
2484
|
+
selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
2485
|
+
));
|
|
2486
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
2486
2487
|
}
|
|
2487
2488
|
function aborted(x, startIndex = 0) {
|
|
2488
2489
|
if (x.aborted === true)
|
|
@@ -2515,6 +2516,18 @@ function prefixIssues(path, issues) {
|
|
|
2515
2516
|
function unwrapMessage(message) {
|
|
2516
2517
|
return typeof message === "string" ? message : message?.message;
|
|
2517
2518
|
}
|
|
2519
|
+
function sizeCaps(defChecks) {
|
|
2520
|
+
const caps = [];
|
|
2521
|
+
for (const ch of defChecks ?? []) {
|
|
2522
|
+
const d = ch._zod.def;
|
|
2523
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
2524
|
+
break;
|
|
2525
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
2526
|
+
if (max >= 0)
|
|
2527
|
+
caps.push([max, ch]);
|
|
2528
|
+
}
|
|
2529
|
+
return caps;
|
|
2530
|
+
}
|
|
2518
2531
|
function attachSchema(issues, start, inst) {
|
|
2519
2532
|
var _a3;
|
|
2520
2533
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -2532,13 +2545,18 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
2532
2545
|
}
|
|
2533
2546
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
2534
2547
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2537
|
-
|
|
2548
|
+
const full = {};
|
|
2549
|
+
for (const k of Object.keys(iss)) {
|
|
2550
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
2551
|
+
continue;
|
|
2552
|
+
full[k] = iss[k];
|
|
2553
|
+
}
|
|
2554
|
+
full.path ?? (full.path = []);
|
|
2555
|
+
full.message = message;
|
|
2538
2556
|
if (ctx?.reportInput) {
|
|
2539
|
-
|
|
2557
|
+
full.input = iss.input;
|
|
2540
2558
|
}
|
|
2541
|
-
return
|
|
2559
|
+
return full;
|
|
2542
2560
|
}
|
|
2543
2561
|
function getSizableOrigin(input2) {
|
|
2544
2562
|
if (input2 instanceof Set)
|
|
@@ -2665,6 +2683,23 @@ function own(inst, key, value, enumerable = true) {
|
|
|
2665
2683
|
function hide(inst, key, value) {
|
|
2666
2684
|
return own(inst, key, value, false);
|
|
2667
2685
|
}
|
|
2686
|
+
// @__NO_SIDE_EFFECTS__
|
|
2687
|
+
function derived(computes, table) {
|
|
2688
|
+
for (const key in computes) {
|
|
2689
|
+
const compute = computes[key];
|
|
2690
|
+
Object.defineProperty(table, key, {
|
|
2691
|
+
configurable: true,
|
|
2692
|
+
enumerable: true,
|
|
2693
|
+
get() {
|
|
2694
|
+
return own(this, key, compute(this));
|
|
2695
|
+
},
|
|
2696
|
+
set(value) {
|
|
2697
|
+
own(this, key, value);
|
|
2698
|
+
}
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
return table;
|
|
2702
|
+
}
|
|
2668
2703
|
function defineBound(proto, key, fn) {
|
|
2669
2704
|
Object.defineProperty(proto, key, {
|
|
2670
2705
|
configurable: true,
|
|
@@ -2792,8 +2827,7 @@ function $constructor(name, initializer3, proto, params) {
|
|
|
2792
2827
|
} finally {
|
|
2793
2828
|
_zodDesc.value = void 0;
|
|
2794
2829
|
}
|
|
2795
|
-
}
|
|
2796
|
-
if (inst._zod.traits.has(name)) {
|
|
2830
|
+
} else if (inst._zod.traits.has(name)) {
|
|
2797
2831
|
return;
|
|
2798
2832
|
}
|
|
2799
2833
|
inst._zod.traits.add(name);
|
|
@@ -2884,16 +2918,12 @@ var _messageDesc = {
|
|
|
2884
2918
|
enumerable: true,
|
|
2885
2919
|
configurable: true
|
|
2886
2920
|
};
|
|
2887
|
-
var _zodDesc2 = { value: void 0, enumerable: false };
|
|
2888
2921
|
var _issuesDesc = { value: void 0, enumerable: false };
|
|
2889
2922
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
2890
2923
|
var initializer = (inst, def) => {
|
|
2891
2924
|
inst.name = "$ZodError";
|
|
2892
|
-
_zodDesc2.value = inst._zod;
|
|
2893
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
2894
2925
|
_issuesDesc.value = def;
|
|
2895
2926
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
2896
|
-
_zodDesc2.value = void 0;
|
|
2897
2927
|
_issuesDesc.value = void 0;
|
|
2898
2928
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
2899
2929
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -2927,10 +2957,10 @@ function node(obj, key, make) {
|
|
|
2927
2957
|
}
|
|
2928
2958
|
return obj[key];
|
|
2929
2959
|
}
|
|
2930
|
-
function flattenError(
|
|
2960
|
+
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
2931
2961
|
const fieldErrors = {};
|
|
2932
2962
|
const formErrors = [];
|
|
2933
|
-
for (const sub of
|
|
2963
|
+
for (const sub of error62.issues) {
|
|
2934
2964
|
if (sub.path.length > 0) {
|
|
2935
2965
|
node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
2936
2966
|
} else {
|
|
@@ -2939,10 +2969,10 @@ function flattenError(error61, mapper = (issue2) => issue2.message) {
|
|
|
2939
2969
|
}
|
|
2940
2970
|
return { formErrors, fieldErrors };
|
|
2941
2971
|
}
|
|
2942
|
-
function formatError(
|
|
2972
|
+
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
2943
2973
|
const fieldErrors = { _errors: [] };
|
|
2944
|
-
const processError = (
|
|
2945
|
-
for (const issue2 of
|
|
2974
|
+
const processError = (error63, path = []) => {
|
|
2975
|
+
for (const issue2 of error63.issues) {
|
|
2946
2976
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
2947
2977
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
2948
2978
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -2984,14 +3014,14 @@ function formatError(error61, mapper = (issue2) => issue2.message) {
|
|
|
2984
3014
|
}
|
|
2985
3015
|
}
|
|
2986
3016
|
};
|
|
2987
|
-
processError(
|
|
3017
|
+
processError(error62);
|
|
2988
3018
|
return fieldErrors;
|
|
2989
3019
|
}
|
|
2990
|
-
function treeifyError(
|
|
3020
|
+
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
2991
3021
|
const result = { errors: [] };
|
|
2992
|
-
const processError = (
|
|
3022
|
+
const processError = (error63, path = []) => {
|
|
2993
3023
|
var _a3;
|
|
2994
|
-
for (const issue2 of
|
|
3024
|
+
for (const issue2 of error63.issues) {
|
|
2995
3025
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
2996
3026
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
2997
3027
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -3033,7 +3063,7 @@ function treeifyError(error61, mapper = (issue2) => issue2.message) {
|
|
|
3033
3063
|
}
|
|
3034
3064
|
}
|
|
3035
3065
|
};
|
|
3036
|
-
processError(
|
|
3066
|
+
processError(error62);
|
|
3037
3067
|
return result;
|
|
3038
3068
|
}
|
|
3039
3069
|
function toDotPath(_path) {
|
|
@@ -3054,9 +3084,9 @@ function toDotPath(_path) {
|
|
|
3054
3084
|
}
|
|
3055
3085
|
return segs.join("");
|
|
3056
3086
|
}
|
|
3057
|
-
function prettifyError(
|
|
3087
|
+
function prettifyError(error62) {
|
|
3058
3088
|
const lines = [];
|
|
3059
|
-
const issues = [...
|
|
3089
|
+
const issues = [...error62.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
3060
3090
|
for (const issue2 of issues) {
|
|
3061
3091
|
lines.push(`\u2716 ${issue2.message}`);
|
|
3062
3092
|
if (issue2.path?.length)
|
|
@@ -3108,33 +3138,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
3108
3138
|
if (result instanceof Promise) {
|
|
3109
3139
|
throw new $ZodAsyncError();
|
|
3110
3140
|
}
|
|
3111
|
-
return result.issues.length ? {
|
|
3112
|
-
success: false,
|
|
3113
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
3114
|
-
} : { success: true, data: result.value };
|
|
3141
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
3115
3142
|
};
|
|
3116
3143
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
3144
|
+
function failure(Err, issues, ctx) {
|
|
3145
|
+
let error62;
|
|
3146
|
+
return {
|
|
3147
|
+
success: false,
|
|
3148
|
+
get error() {
|
|
3149
|
+
if (!error62) {
|
|
3150
|
+
error62 = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
3151
|
+
issues = void 0;
|
|
3152
|
+
ctx = void 0;
|
|
3153
|
+
}
|
|
3154
|
+
return error62;
|
|
3155
|
+
},
|
|
3156
|
+
set error(e) {
|
|
3157
|
+
error62 = e;
|
|
3158
|
+
issues = void 0;
|
|
3159
|
+
ctx = void 0;
|
|
3160
|
+
}
|
|
3161
|
+
};
|
|
3162
|
+
}
|
|
3117
3163
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
3118
3164
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
3119
3165
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
3120
3166
|
if (result instanceof Promise)
|
|
3121
3167
|
result = await result;
|
|
3122
|
-
return result.issues.length ? {
|
|
3123
|
-
success: false,
|
|
3124
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
3125
|
-
} : { success: true, data: result.value };
|
|
3168
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
3126
3169
|
};
|
|
3127
3170
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
3128
3171
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
3129
3172
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
3130
3173
|
var validate = ((schema, value, _ctx) => {
|
|
3131
3174
|
const validator = schema._zod.bag.validator;
|
|
3132
|
-
if (validator !== void 0
|
|
3133
|
-
|
|
3175
|
+
if (validator !== void 0) {
|
|
3176
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
3177
|
+
return true;
|
|
3178
|
+
if (validator.definite === true && _ctx === void 0)
|
|
3179
|
+
return false;
|
|
3180
|
+
}
|
|
3134
3181
|
return validateFallback(schema, value, _ctx);
|
|
3135
3182
|
});
|
|
3136
3183
|
function validateFallback(schema, value, _ctx) {
|
|
3137
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
3184
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
3138
3185
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
3139
3186
|
let result;
|
|
3140
3187
|
if (fallbackRun) {
|
|
@@ -3149,7 +3196,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
3149
3196
|
return result.issues.length === 0;
|
|
3150
3197
|
}
|
|
3151
3198
|
var validateAsync = async (schema, value, _ctx) => {
|
|
3152
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
3199
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
3153
3200
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
3154
3201
|
if (result instanceof Promise)
|
|
3155
3202
|
result = await result;
|
|
@@ -3211,6 +3258,7 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
|
3211
3258
|
// node_modules/zod/v4/core/regexes.js
|
|
3212
3259
|
var regexes_exports = {};
|
|
3213
3260
|
__export(regexes_exports, {
|
|
3261
|
+
anyString: () => anyString,
|
|
3214
3262
|
base64: () => base64,
|
|
3215
3263
|
base64url: () => base64url,
|
|
3216
3264
|
bigint: () => bigint,
|
|
@@ -3221,6 +3269,7 @@ __export(regexes_exports, {
|
|
|
3221
3269
|
creditCard: () => creditCard,
|
|
3222
3270
|
cuid: () => cuid,
|
|
3223
3271
|
cuid2: () => cuid2,
|
|
3272
|
+
currencyCode: () => currencyCode,
|
|
3224
3273
|
date: () => date,
|
|
3225
3274
|
datetime: () => datetime,
|
|
3226
3275
|
domain: () => domain,
|
|
@@ -3234,6 +3283,7 @@ __export(regexes_exports, {
|
|
|
3234
3283
|
hostname: () => hostname,
|
|
3235
3284
|
html5Email: () => html5Email,
|
|
3236
3285
|
httpProtocol: () => httpProtocol,
|
|
3286
|
+
iban: () => iban,
|
|
3237
3287
|
idnEmail: () => idnEmail,
|
|
3238
3288
|
integer: () => integer,
|
|
3239
3289
|
ipv4: () => ipv4,
|
|
@@ -3293,13 +3343,13 @@ var uuid = (version2) => {
|
|
|
3293
3343
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
3294
3344
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
3295
3345
|
var uuid7 = /* @__PURE__ */ uuid(7);
|
|
3296
|
-
var email = /^(
|
|
3346
|
+
var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
3297
3347
|
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])?)*$/;
|
|
3298
3348
|
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,}))$/;
|
|
3299
3349
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
3300
3350
|
var idnEmail = unicodeEmail;
|
|
3301
3351
|
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])?)*$/;
|
|
3302
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
3352
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
3303
3353
|
function emoji() {
|
|
3304
3354
|
return new RegExp(_emoji, "u");
|
|
3305
3355
|
}
|
|
@@ -3312,12 +3362,14 @@ var mac = (delimiter) => {
|
|
|
3312
3362
|
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])$/;
|
|
3313
3363
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
3314
3364
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
3315
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
3365
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
3316
3366
|
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])?)*\.?$/;
|
|
3317
3367
|
var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
3318
3368
|
var httpProtocol = /^https?$/;
|
|
3319
3369
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
3320
3370
|
var creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
3371
|
+
var currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
|
|
3372
|
+
var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
3321
3373
|
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])))`;
|
|
3322
3374
|
function anchor(source) {
|
|
3323
3375
|
return new RegExp(`^${source}$`);
|
|
@@ -3339,6 +3391,7 @@ function datetime(args) {
|
|
|
3339
3391
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
3340
3392
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
3341
3393
|
}
|
|
3394
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
3342
3395
|
var string = (params) => {
|
|
3343
3396
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
3344
3397
|
return new RegExp(`^${regex}$`);
|
|
@@ -3397,16 +3450,6 @@ var numericOriginMap = {
|
|
|
3397
3450
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
3398
3451
|
$ZodCheck.init(inst, def);
|
|
3399
3452
|
const origin = numericOriginMap[typeof def.value];
|
|
3400
|
-
inst._zod.onattach.push((inst2) => {
|
|
3401
|
-
const bag = inst2._zod.bag;
|
|
3402
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
3403
|
-
if (def.value < curr) {
|
|
3404
|
-
if (def.inclusive)
|
|
3405
|
-
bag.maximum = def.value;
|
|
3406
|
-
else
|
|
3407
|
-
bag.exclusiveMaximum = def.value;
|
|
3408
|
-
}
|
|
3409
|
-
});
|
|
3410
3453
|
inst._zod.check = (payload) => {
|
|
3411
3454
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
3412
3455
|
return;
|
|
@@ -3425,16 +3468,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
3425
3468
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
3426
3469
|
$ZodCheck.init(inst, def);
|
|
3427
3470
|
const origin = numericOriginMap[typeof def.value];
|
|
3428
|
-
inst._zod.onattach.push((inst2) => {
|
|
3429
|
-
const bag = inst2._zod.bag;
|
|
3430
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
3431
|
-
if (def.value > curr) {
|
|
3432
|
-
if (def.inclusive)
|
|
3433
|
-
bag.minimum = def.value;
|
|
3434
|
-
else
|
|
3435
|
-
bag.exclusiveMinimum = def.value;
|
|
3436
|
-
}
|
|
3437
|
-
});
|
|
3438
3471
|
inst._zod.check = (payload) => {
|
|
3439
3472
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
3440
3473
|
return;
|
|
@@ -3452,10 +3485,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
3452
3485
|
});
|
|
3453
3486
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
3454
3487
|
$ZodCheck.init(inst, def);
|
|
3455
|
-
inst._zod.onattach.push((inst2) => {
|
|
3456
|
-
var _a3;
|
|
3457
|
-
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
3458
|
-
});
|
|
3459
3488
|
inst._zod.check = (payload) => {
|
|
3460
3489
|
if (typeof payload.value !== typeof def.value)
|
|
3461
3490
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -3481,14 +3510,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
3481
3510
|
const isInt = def.format?.includes("int");
|
|
3482
3511
|
const origin = isInt ? "int" : "number";
|
|
3483
3512
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
3484
|
-
inst._zod.onattach.push((inst2) => {
|
|
3485
|
-
const bag = inst2._zod.bag;
|
|
3486
|
-
bag.format = def.format;
|
|
3487
|
-
bag.minimum = minimum;
|
|
3488
|
-
bag.maximum = maximum;
|
|
3489
|
-
if (isInt)
|
|
3490
|
-
bag.pattern = integer;
|
|
3491
|
-
});
|
|
3492
3513
|
inst._zod.check = (payload) => {
|
|
3493
3514
|
const input2 = payload.value;
|
|
3494
3515
|
if (isInt) {
|
|
@@ -3557,12 +3578,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
3557
3578
|
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
3558
3579
|
$ZodCheck.init(inst, def);
|
|
3559
3580
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
3560
|
-
inst._zod.onattach.push((inst2) => {
|
|
3561
|
-
const bag = inst2._zod.bag;
|
|
3562
|
-
bag.format = def.format;
|
|
3563
|
-
bag.minimum = minimum;
|
|
3564
|
-
bag.maximum = maximum;
|
|
3565
|
-
});
|
|
3566
3581
|
inst._zod.check = (payload) => {
|
|
3567
3582
|
const input2 = payload.value;
|
|
3568
3583
|
if (input2 < minimum) {
|
|
@@ -3593,11 +3608,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
3593
3608
|
var _a3;
|
|
3594
3609
|
$ZodCheck.init(inst, def);
|
|
3595
3610
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
3596
|
-
inst._zod.onattach.push((inst2) => {
|
|
3597
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
3598
|
-
if (def.maximum < curr)
|
|
3599
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
3600
|
-
});
|
|
3601
3611
|
inst._zod.check = (payload) => {
|
|
3602
3612
|
const input2 = payload.value;
|
|
3603
3613
|
const size = input2.size;
|
|
@@ -3618,11 +3628,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
3618
3628
|
var _a3;
|
|
3619
3629
|
$ZodCheck.init(inst, def);
|
|
3620
3630
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
3621
|
-
inst._zod.onattach.push((inst2) => {
|
|
3622
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
3623
|
-
if (def.minimum > curr)
|
|
3624
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
3625
|
-
});
|
|
3626
3631
|
inst._zod.check = (payload) => {
|
|
3627
3632
|
const input2 = payload.value;
|
|
3628
3633
|
const size = input2.size;
|
|
@@ -3643,12 +3648,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
3643
3648
|
var _a3;
|
|
3644
3649
|
$ZodCheck.init(inst, def);
|
|
3645
3650
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
3646
|
-
inst._zod.onattach.push((inst2) => {
|
|
3647
|
-
const bag = inst2._zod.bag;
|
|
3648
|
-
bag.minimum = def.size;
|
|
3649
|
-
bag.maximum = def.size;
|
|
3650
|
-
bag.size = def.size;
|
|
3651
|
-
});
|
|
3652
3651
|
inst._zod.check = (payload) => {
|
|
3653
3652
|
const input2 = payload.value;
|
|
3654
3653
|
const size = input2.size;
|
|
@@ -3670,11 +3669,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
3670
3669
|
var _a3;
|
|
3671
3670
|
$ZodCheck.init(inst, def);
|
|
3672
3671
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
3673
|
-
inst._zod.onattach.push((inst2) => {
|
|
3674
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
3675
|
-
if (def.maximum < curr)
|
|
3676
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
3677
|
-
});
|
|
3678
3672
|
inst._zod.check = (payload) => {
|
|
3679
3673
|
const input2 = payload.value;
|
|
3680
3674
|
const units = input2.length;
|
|
@@ -3697,11 +3691,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
3697
3691
|
var _a3;
|
|
3698
3692
|
$ZodCheck.init(inst, def);
|
|
3699
3693
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
3700
|
-
inst._zod.onattach.push((inst2) => {
|
|
3701
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
3702
|
-
if (def.minimum > curr)
|
|
3703
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
3704
|
-
});
|
|
3705
3694
|
inst._zod.check = (payload) => {
|
|
3706
3695
|
const input2 = payload.value;
|
|
3707
3696
|
const units = input2.length;
|
|
@@ -3724,12 +3713,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
3724
3713
|
var _a3;
|
|
3725
3714
|
$ZodCheck.init(inst, def);
|
|
3726
3715
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
3727
|
-
inst._zod.onattach.push((inst2) => {
|
|
3728
|
-
const bag = inst2._zod.bag;
|
|
3729
|
-
bag.minimum = def.length;
|
|
3730
|
-
bag.maximum = def.length;
|
|
3731
|
-
bag.length = def.length;
|
|
3732
|
-
});
|
|
3733
3716
|
inst._zod.check = (payload) => {
|
|
3734
3717
|
const input2 = payload.value;
|
|
3735
3718
|
const units = input2.length;
|
|
@@ -3752,14 +3735,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
3752
3735
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
3753
3736
|
var _a3, _b;
|
|
3754
3737
|
$ZodCheck.init(inst, def);
|
|
3755
|
-
inst._zod.onattach.push((inst2) => {
|
|
3756
|
-
const bag = inst2._zod.bag;
|
|
3757
|
-
bag.format = def.format;
|
|
3758
|
-
if (def.pattern) {
|
|
3759
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
3760
|
-
bag.patterns.add(def.pattern);
|
|
3761
|
-
}
|
|
3762
|
-
});
|
|
3763
3738
|
if (def.pattern)
|
|
3764
3739
|
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
3765
3740
|
def.pattern.lastIndex = 0;
|
|
@@ -3809,11 +3784,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
3809
3784
|
const escapedRegex = escapeRegex(def.includes);
|
|
3810
3785
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
3811
3786
|
def.pattern = pattern;
|
|
3812
|
-
inst._zod.onattach.push((inst2) => {
|
|
3813
|
-
const bag = inst2._zod.bag;
|
|
3814
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
3815
|
-
bag.patterns.add(pattern);
|
|
3816
|
-
});
|
|
3817
3787
|
inst._zod.check = (payload) => {
|
|
3818
3788
|
if (payload.value.includes(def.includes, def.position))
|
|
3819
3789
|
return;
|
|
@@ -3832,11 +3802,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
3832
3802
|
$ZodCheck.init(inst, def);
|
|
3833
3803
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
3834
3804
|
def.pattern ?? (def.pattern = pattern);
|
|
3835
|
-
inst._zod.onattach.push((inst2) => {
|
|
3836
|
-
const bag = inst2._zod.bag;
|
|
3837
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
3838
|
-
bag.patterns.add(pattern);
|
|
3839
|
-
});
|
|
3840
3805
|
inst._zod.check = (payload) => {
|
|
3841
3806
|
if (payload.value.startsWith(def.prefix))
|
|
3842
3807
|
return;
|
|
@@ -3855,11 +3820,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
3855
3820
|
$ZodCheck.init(inst, def);
|
|
3856
3821
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
3857
3822
|
def.pattern ?? (def.pattern = pattern);
|
|
3858
|
-
inst._zod.onattach.push((inst2) => {
|
|
3859
|
-
const bag = inst2._zod.bag;
|
|
3860
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
3861
|
-
bag.patterns.add(pattern);
|
|
3862
|
-
});
|
|
3863
3823
|
inst._zod.check = (payload) => {
|
|
3864
3824
|
if (payload.value.endsWith(def.suffix))
|
|
3865
3825
|
return;
|
|
@@ -3893,12 +3853,37 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
|
|
|
3893
3853
|
return;
|
|
3894
3854
|
};
|
|
3895
3855
|
});
|
|
3856
|
+
var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
|
|
3857
|
+
$ZodCheck.init(inst, def);
|
|
3858
|
+
hide(inst, Symbol.iterator, function* () {
|
|
3859
|
+
yield inst;
|
|
3860
|
+
});
|
|
3861
|
+
let entries;
|
|
3862
|
+
inst._zod.check = (payload) => {
|
|
3863
|
+
if (payload.value == null) {
|
|
3864
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
3865
|
+
return void 0;
|
|
3866
|
+
}
|
|
3867
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
3868
|
+
const input2 = payload.value;
|
|
3869
|
+
let proms;
|
|
3870
|
+
for (const [key, schema] of entries) {
|
|
3871
|
+
const result = schema._zod.run({ value: input2[key], issues: [] }, {});
|
|
3872
|
+
if (result instanceof Promise) {
|
|
3873
|
+
proms ?? (proms = []);
|
|
3874
|
+
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
|
|
3875
|
+
} else {
|
|
3876
|
+
handleCheckPropertyResult(result, payload, key);
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
if (proms)
|
|
3880
|
+
return Promise.all(proms).then(() => void 0);
|
|
3881
|
+
return void 0;
|
|
3882
|
+
};
|
|
3883
|
+
});
|
|
3896
3884
|
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
3897
3885
|
$ZodCheck.init(inst, def);
|
|
3898
3886
|
const mimeSet = new Set(def.mime);
|
|
3899
|
-
inst._zod.onattach.push((inst2) => {
|
|
3900
|
-
inst2._zod.bag.mime = def.mime;
|
|
3901
|
-
});
|
|
3902
3887
|
inst._zod.check = (payload) => {
|
|
3903
3888
|
if (mimeSet.has(payload.value.type))
|
|
3904
3889
|
return;
|
|
@@ -3926,10 +3911,14 @@ var Doc = class {
|
|
|
3926
3911
|
this.args = args;
|
|
3927
3912
|
this.closed = closed;
|
|
3928
3913
|
}
|
|
3914
|
+
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
|
|
3929
3915
|
indented(fn) {
|
|
3930
3916
|
this.indent += 1;
|
|
3931
|
-
|
|
3932
|
-
|
|
3917
|
+
try {
|
|
3918
|
+
fn(this);
|
|
3919
|
+
} finally {
|
|
3920
|
+
this.indent -= 1;
|
|
3921
|
+
}
|
|
3933
3922
|
}
|
|
3934
3923
|
write(arg) {
|
|
3935
3924
|
if (typeof arg === "function") {
|
|
@@ -3958,8 +3947,8 @@ ${content.join("\n")}
|
|
|
3958
3947
|
// node_modules/zod/v4/core/versions.js
|
|
3959
3948
|
var version = {
|
|
3960
3949
|
major: 4,
|
|
3961
|
-
minor:
|
|
3962
|
-
patch:
|
|
3950
|
+
minor: 6,
|
|
3951
|
+
patch: 7
|
|
3963
3952
|
};
|
|
3964
3953
|
|
|
3965
3954
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -4072,15 +4061,22 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
4072
4061
|
own(this, "~standard", value);
|
|
4073
4062
|
}
|
|
4074
4063
|
});
|
|
4075
|
-
var toStandardResult = (r) => r.
|
|
4064
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
4065
|
+
async function validateAsync2(inst, value) {
|
|
4066
|
+
const ctx = { async: true };
|
|
4067
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
4068
|
+
}
|
|
4076
4069
|
function standardProps(inst) {
|
|
4077
4070
|
return {
|
|
4078
4071
|
validate: (value) => {
|
|
4072
|
+
const ctx = { async: false };
|
|
4079
4073
|
try {
|
|
4080
|
-
|
|
4074
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
4075
|
+
if (!(r instanceof Promise))
|
|
4076
|
+
return toStandardResult(r, ctx);
|
|
4081
4077
|
} catch (_) {
|
|
4082
|
-
return safeParseAsync(inst, value).then(toStandardResult);
|
|
4083
4078
|
}
|
|
4079
|
+
return validateAsync2(inst, value);
|
|
4084
4080
|
},
|
|
4085
4081
|
vendor: "zod",
|
|
4086
4082
|
version: 1
|
|
@@ -4088,7 +4084,7 @@ function standardProps(inst) {
|
|
|
4088
4084
|
}
|
|
4089
4085
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
4090
4086
|
$ZodType.init(inst, def);
|
|
4091
|
-
inst._zod.pattern =
|
|
4087
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
4092
4088
|
inst._zod.parse = (payload, _) => {
|
|
4093
4089
|
if (def.coerce)
|
|
4094
4090
|
try {
|
|
@@ -4140,11 +4136,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
|
4140
4136
|
});
|
|
4141
4137
|
var URL_BAD_FORMAT = 1;
|
|
4142
4138
|
var URL_UNPARSEABLE = 2;
|
|
4139
|
+
function canParseURL(input2) {
|
|
4140
|
+
try {
|
|
4141
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function")
|
|
4142
|
+
return URL.canParse(input2);
|
|
4143
|
+
new URL(input2);
|
|
4144
|
+
return true;
|
|
4145
|
+
} catch {
|
|
4146
|
+
return false;
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
function validateURL(trimmed, def) {
|
|
4150
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
|
|
4151
|
+
return canParseURL(trimmed) || URL_UNPARSEABLE;
|
|
4152
|
+
}
|
|
4153
|
+
return parseURLObject(trimmed, def);
|
|
4154
|
+
}
|
|
4143
4155
|
function parseURLObject(trimmed, def) {
|
|
4144
4156
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
4145
4157
|
return URL_BAD_FORMAT;
|
|
4146
4158
|
}
|
|
4147
4159
|
try {
|
|
4160
|
+
if (typeof URL !== "undefined") {
|
|
4161
|
+
const URLStatic = URL;
|
|
4162
|
+
if (typeof URLStatic.parse === "function")
|
|
4163
|
+
return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
|
|
4164
|
+
}
|
|
4148
4165
|
return new URL(trimmed);
|
|
4149
4166
|
} catch {
|
|
4150
4167
|
return URL_UNPARSEABLE;
|
|
@@ -4167,7 +4184,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
4167
4184
|
inst._zod.check = (payload) => {
|
|
4168
4185
|
try {
|
|
4169
4186
|
const trimmed = payload.value.trim();
|
|
4170
|
-
const url2 =
|
|
4187
|
+
const url2 = validateURL(trimmed, def);
|
|
4171
4188
|
if (url2 === URL_BAD_FORMAT) {
|
|
4172
4189
|
payload.issues.push({
|
|
4173
4190
|
code: "invalid_format",
|
|
@@ -4189,6 +4206,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
4189
4206
|
});
|
|
4190
4207
|
return;
|
|
4191
4208
|
}
|
|
4209
|
+
if (url2 === true) {
|
|
4210
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
4211
|
+
return;
|
|
4212
|
+
}
|
|
4192
4213
|
if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
|
|
4193
4214
|
payload.issues.push({
|
|
4194
4215
|
code: "invalid_format",
|
|
@@ -4257,12 +4278,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
4257
4278
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
4258
4279
|
def.pattern ?? (def.pattern = datetime(def));
|
|
4259
4280
|
$ZodStringFormat.init(inst, def);
|
|
4260
|
-
if (def.local || def.precision === -1) {
|
|
4261
|
-
inst._zod.bag.laxFormat = true;
|
|
4262
|
-
inst._zod.onattach.push((s) => {
|
|
4263
|
-
s._zod.bag.laxFormat = true;
|
|
4264
|
-
});
|
|
4265
|
-
}
|
|
4266
4281
|
});
|
|
4267
4282
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
4268
4283
|
def.pattern ?? (def.pattern = date);
|
|
@@ -4279,23 +4294,16 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
4279
4294
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
4280
4295
|
def.pattern ?? (def.pattern = ipv4);
|
|
4281
4296
|
$ZodStringFormat.init(inst, def);
|
|
4282
|
-
inst._zod.bag.format = `ipv4`;
|
|
4283
4297
|
});
|
|
4284
4298
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
4285
4299
|
function isValidIPv6(value) {
|
|
4286
4300
|
if (!ipv6Alphabet.test(value))
|
|
4287
4301
|
return false;
|
|
4288
|
-
|
|
4289
|
-
new URL(`http://[${value}]`);
|
|
4290
|
-
return true;
|
|
4291
|
-
} catch {
|
|
4292
|
-
return false;
|
|
4293
|
-
}
|
|
4302
|
+
return canParseURL(`http://[${value}]`);
|
|
4294
4303
|
}
|
|
4295
4304
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
4296
4305
|
def.pattern ?? (def.pattern = ipv6);
|
|
4297
4306
|
$ZodStringFormat.init(inst, def);
|
|
4298
|
-
inst._zod.bag.format = `ipv6`;
|
|
4299
4307
|
inst._zod.check = (payload) => {
|
|
4300
4308
|
if (!isValidIPv6(payload.value)) {
|
|
4301
4309
|
payload.issues.push({
|
|
@@ -4311,7 +4319,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
4311
4319
|
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
|
|
4312
4320
|
def.pattern ?? (def.pattern = mac(def.delimiter));
|
|
4313
4321
|
$ZodStringFormat.init(inst, def);
|
|
4314
|
-
inst._zod.bag.format = `mac`;
|
|
4315
4322
|
});
|
|
4316
4323
|
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
4317
4324
|
def.pattern ?? (def.pattern = cidrv4);
|
|
@@ -4360,10 +4367,10 @@ function isValidBase64(data) {
|
|
|
4360
4367
|
return false;
|
|
4361
4368
|
}
|
|
4362
4369
|
}
|
|
4370
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
4363
4371
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
4364
|
-
def.pattern ?? (def.pattern =
|
|
4372
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
4365
4373
|
$ZodStringFormat.init(inst, def);
|
|
4366
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
4367
4374
|
inst._zod.check = (payload) => {
|
|
4368
4375
|
if (isValidBase64(payload.value))
|
|
4369
4376
|
return;
|
|
@@ -4376,17 +4383,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
4376
4383
|
});
|
|
4377
4384
|
};
|
|
4378
4385
|
});
|
|
4386
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
4379
4387
|
function isValidBase64URL(data) {
|
|
4380
|
-
if (!
|
|
4388
|
+
if (!base64urlCharset.test(data))
|
|
4381
4389
|
return false;
|
|
4382
4390
|
const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
4383
4391
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
4384
4392
|
return isValidBase64(padded);
|
|
4385
4393
|
}
|
|
4386
4394
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
4387
|
-
def.pattern ?? (def.pattern =
|
|
4395
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
4388
4396
|
$ZodStringFormat.init(inst, def);
|
|
4389
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
4390
4397
|
inst._zod.check = (payload) => {
|
|
4391
4398
|
if (isValidBase64URL(payload.value))
|
|
4392
4399
|
return;
|
|
@@ -4409,7 +4416,7 @@ function isLuhnAlgo(digits) {
|
|
|
4409
4416
|
let bit = 1;
|
|
4410
4417
|
let sum = 0;
|
|
4411
4418
|
while (length) {
|
|
4412
|
-
const value =
|
|
4419
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
4413
4420
|
bit ^= 1;
|
|
4414
4421
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
4415
4422
|
}
|
|
@@ -4435,6 +4442,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
|
|
|
4435
4442
|
});
|
|
4436
4443
|
};
|
|
4437
4444
|
});
|
|
4445
|
+
function isIso7064Mod97(iban3) {
|
|
4446
|
+
let remainder = 0;
|
|
4447
|
+
const len = iban3.length;
|
|
4448
|
+
for (let i = 4; i < len; i++) {
|
|
4449
|
+
const code = iban3.charCodeAt(i);
|
|
4450
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
4451
|
+
}
|
|
4452
|
+
for (let i = 0; i < 4; i++) {
|
|
4453
|
+
const code = iban3.charCodeAt(i);
|
|
4454
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
4455
|
+
}
|
|
4456
|
+
return remainder === 1;
|
|
4457
|
+
}
|
|
4458
|
+
function isValidIBAN(input2) {
|
|
4459
|
+
if (!iban.test(input2))
|
|
4460
|
+
return false;
|
|
4461
|
+
return isIso7064Mod97(input2);
|
|
4462
|
+
}
|
|
4463
|
+
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
4464
|
+
def.pattern ?? (def.pattern = iban);
|
|
4465
|
+
$ZodStringFormat.init(inst, def);
|
|
4466
|
+
inst._zod.check = (payload) => {
|
|
4467
|
+
if (isValidIBAN(payload.value))
|
|
4468
|
+
return;
|
|
4469
|
+
payload.issues.push({
|
|
4470
|
+
code: "invalid_format",
|
|
4471
|
+
format: "iban",
|
|
4472
|
+
input: payload.value,
|
|
4473
|
+
inst,
|
|
4474
|
+
continue: !def.abort
|
|
4475
|
+
});
|
|
4476
|
+
};
|
|
4477
|
+
});
|
|
4438
4478
|
function isValidJWT(token, algorithm = null) {
|
|
4439
4479
|
try {
|
|
4440
4480
|
const tokensParts = token.split(".");
|
|
@@ -4485,7 +4525,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
|
|
|
4485
4525
|
});
|
|
4486
4526
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
4487
4527
|
$ZodType.init(inst, def);
|
|
4488
|
-
inst._zod.pattern =
|
|
4528
|
+
inst._zod.pattern = number;
|
|
4489
4529
|
inst._zod.parse = (payload, _ctx) => {
|
|
4490
4530
|
if (def.coerce)
|
|
4491
4531
|
try {
|
|
@@ -4664,6 +4704,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
4664
4704
|
return payload;
|
|
4665
4705
|
};
|
|
4666
4706
|
});
|
|
4707
|
+
function capSize(inst, size) {
|
|
4708
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
4709
|
+
if (!caps.length)
|
|
4710
|
+
return;
|
|
4711
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
4712
|
+
const parse3 = inst._zod.parse;
|
|
4713
|
+
inst._zod.parse = (payload, ctx) => {
|
|
4714
|
+
const n = size(payload.value);
|
|
4715
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
4716
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
4717
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
4718
|
+
const start = payload.issues.length;
|
|
4719
|
+
ch._zod.check(payload);
|
|
4720
|
+
payload.issues[start].continue = false;
|
|
4721
|
+
attachSchema(payload.issues, start, inst);
|
|
4722
|
+
return payload;
|
|
4723
|
+
}
|
|
4724
|
+
}
|
|
4725
|
+
}
|
|
4726
|
+
return parse3(payload, ctx);
|
|
4727
|
+
};
|
|
4728
|
+
}
|
|
4729
|
+
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
4730
|
+
var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
|
|
4731
|
+
var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
|
|
4667
4732
|
function handleArrayResult(result, final, index) {
|
|
4668
4733
|
if (result.issues.length) {
|
|
4669
4734
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -4687,6 +4752,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
4687
4752
|
}
|
|
4688
4753
|
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input2.length), ctx) : Array(input2.length);
|
|
4689
4754
|
const proms = [];
|
|
4755
|
+
const abortEarly = ctx?.abortEarly;
|
|
4690
4756
|
for (let i = 0; i < input2.length; i++) {
|
|
4691
4757
|
const item = input2[i];
|
|
4692
4758
|
const result = def.element._zod.run({
|
|
@@ -4697,6 +4763,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
4697
4763
|
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
4698
4764
|
} else {
|
|
4699
4765
|
handleArrayResult(result, payload, i);
|
|
4766
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
4767
|
+
break;
|
|
4700
4768
|
}
|
|
4701
4769
|
}
|
|
4702
4770
|
if (proms.length) {
|
|
@@ -4704,6 +4772,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
4704
4772
|
}
|
|
4705
4773
|
return payload;
|
|
4706
4774
|
};
|
|
4775
|
+
capSize(inst, arraySize);
|
|
4707
4776
|
});
|
|
4708
4777
|
function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
4709
4778
|
const isPresent = key in input2;
|
|
@@ -4729,7 +4798,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
|
4729
4798
|
return;
|
|
4730
4799
|
}
|
|
4731
4800
|
if (result.value === void 0) {
|
|
4732
|
-
if (isPresent) {
|
|
4801
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
4733
4802
|
final.value[key] = void 0;
|
|
4734
4803
|
}
|
|
4735
4804
|
} else {
|
|
@@ -4758,14 +4827,20 @@ function normalizeDef(def) {
|
|
|
4758
4827
|
optionalKeys: new Set(okeys)
|
|
4759
4828
|
};
|
|
4760
4829
|
}
|
|
4761
|
-
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
4830
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
4762
4831
|
const unrecognized = [];
|
|
4763
4832
|
const keySet = def.keySet;
|
|
4764
4833
|
const _catchall = def.catchall._zod;
|
|
4765
4834
|
const t = _catchall.def.type;
|
|
4766
4835
|
const optin = _catchall.optin;
|
|
4767
4836
|
const optout = _catchall.optout;
|
|
4837
|
+
let seen = 0;
|
|
4768
4838
|
for (const key in input2) {
|
|
4839
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4840
|
+
if (aborted(payload, seen))
|
|
4841
|
+
break;
|
|
4842
|
+
seen = payload.issues.length;
|
|
4843
|
+
}
|
|
4769
4844
|
if (keySet.has(key))
|
|
4770
4845
|
continue;
|
|
4771
4846
|
if (key === "__proto__") {
|
|
@@ -4800,23 +4875,19 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
|
4800
4875
|
return payload;
|
|
4801
4876
|
});
|
|
4802
4877
|
}
|
|
4803
|
-
var propShapes = /* @__PURE__ */ new WeakMap();
|
|
4804
4878
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
4805
4879
|
$ZodType.init(inst, def);
|
|
4806
4880
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
return newSh;
|
|
4818
|
-
}
|
|
4819
|
-
});
|
|
4881
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
4882
|
+
if (sh) {
|
|
4883
|
+
const get = () => {
|
|
4884
|
+
const newSh = { ...sh };
|
|
4885
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
4886
|
+
get.raw = newSh;
|
|
4887
|
+
return newSh;
|
|
4888
|
+
};
|
|
4889
|
+
get.raw = sh;
|
|
4890
|
+
Object.defineProperty(def, "shape", { get });
|
|
4820
4891
|
}
|
|
4821
4892
|
const _normalized = cached2(() => normalizeDef(def));
|
|
4822
4893
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -4856,7 +4927,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
4856
4927
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
4857
4928
|
const proms = [];
|
|
4858
4929
|
const shape = value.shape;
|
|
4930
|
+
const abortEarly = ctx?.abortEarly;
|
|
4931
|
+
let seen = payload.issues.length;
|
|
4859
4932
|
for (const key of value.allKeys) {
|
|
4933
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4934
|
+
if (aborted(payload, seen))
|
|
4935
|
+
break;
|
|
4936
|
+
seen = payload.issues.length;
|
|
4937
|
+
}
|
|
4860
4938
|
if (key === "__proto__")
|
|
4861
4939
|
continue;
|
|
4862
4940
|
const el = shape[key];
|
|
@@ -4872,7 +4950,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
4872
4950
|
if (!catchall) {
|
|
4873
4951
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
4874
4952
|
}
|
|
4875
|
-
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
4953
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
4876
4954
|
};
|
|
4877
4955
|
});
|
|
4878
4956
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -4886,10 +4964,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
4886
4964
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
4887
4965
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
4888
4966
|
const prefixStr = (id, k) => `
|
|
4967
|
+
let ${id}_ab = false;
|
|
4889
4968
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
4890
4969
|
const iss = ${id}.issues[i];
|
|
4891
4970
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
4892
4971
|
payload.issues.push(iss);
|
|
4972
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
4973
|
+
}
|
|
4974
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
4975
|
+
payload.value = newResult;
|
|
4976
|
+
return payload;
|
|
4893
4977
|
}`;
|
|
4894
4978
|
doc.write(`const input = payload.value;`);
|
|
4895
4979
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -4935,6 +5019,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
4935
5019
|
input: undefined,
|
|
4936
5020
|
path: [${k}]
|
|
4937
5021
|
});
|
|
5022
|
+
if (ctx && ctx.abortEarly) {
|
|
5023
|
+
payload.value = newResult;
|
|
5024
|
+
return payload;
|
|
5025
|
+
}
|
|
4938
5026
|
}
|
|
4939
5027
|
|
|
4940
5028
|
if (${id}_present) {
|
|
@@ -4946,16 +5034,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
4946
5034
|
doc.write(`
|
|
4947
5035
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
4948
5036
|
}
|
|
4949
|
-
|
|
4950
|
-
if (
|
|
4951
|
-
|
|
4952
|
-
newResult[${k}] = undefined;
|
|
4953
|
-
}
|
|
5037
|
+
`);
|
|
5038
|
+
if (optin === "defaulted") {
|
|
5039
|
+
doc.write(`newResult[${k}] = ${id}.value;`);
|
|
4954
5040
|
} else {
|
|
5041
|
+
doc.write(`
|
|
5042
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
4955
5043
|
newResult[${k}] = ${id}.value;
|
|
4956
5044
|
}
|
|
4957
|
-
|
|
4958
5045
|
`);
|
|
5046
|
+
}
|
|
4959
5047
|
}
|
|
4960
5048
|
}
|
|
4961
5049
|
doc.write(`payload.value = newResult;`);
|
|
@@ -4987,7 +5075,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
4987
5075
|
payload = fastpass(payload, ctx);
|
|
4988
5076
|
if (!catchall)
|
|
4989
5077
|
return payload;
|
|
4990
|
-
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
5078
|
+
return handleCatchall([], input2, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
4991
5079
|
}
|
|
4992
5080
|
return superParse(payload, ctx);
|
|
4993
5081
|
};
|
|
@@ -5119,16 +5207,31 @@ function getDiscriminatedOption(union2, value) {
|
|
|
5119
5207
|
const internals = union2._zod;
|
|
5120
5208
|
let map2 = internals.bag.optionsMap;
|
|
5121
5209
|
if (!map2) {
|
|
5122
|
-
map2 =
|
|
5123
|
-
const { options, discriminator } = internals.def;
|
|
5124
|
-
for (const option of options) {
|
|
5125
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
5126
|
-
if (!map2.has(v))
|
|
5127
|
-
map2.set(v, option);
|
|
5128
|
-
}
|
|
5210
|
+
map2 = discriminatorMap(internals.def);
|
|
5129
5211
|
internals.bag.optionsMap = map2;
|
|
5130
5212
|
}
|
|
5131
|
-
|
|
5213
|
+
const option = map2.get(value);
|
|
5214
|
+
if (option === null)
|
|
5215
|
+
throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
5216
|
+
return option;
|
|
5217
|
+
}
|
|
5218
|
+
function discriminatorMap(def) {
|
|
5219
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
5220
|
+
for (const option of def.options) {
|
|
5221
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
5222
|
+
if (!values || values.size === 0)
|
|
5223
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
5224
|
+
for (const value of values) {
|
|
5225
|
+
if (map2.has(value)) {
|
|
5226
|
+
if (value !== void 0)
|
|
5227
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
5228
|
+
map2.set(value, null);
|
|
5229
|
+
} else {
|
|
5230
|
+
map2.set(value, option);
|
|
5231
|
+
}
|
|
5232
|
+
}
|
|
5233
|
+
}
|
|
5234
|
+
return map2;
|
|
5132
5235
|
}
|
|
5133
5236
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
5134
5237
|
def.inclusive = false;
|
|
@@ -5136,10 +5239,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
5136
5239
|
const _super = inst._zod.parse;
|
|
5137
5240
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
5138
5241
|
const propValues = {};
|
|
5242
|
+
let undefinedCount = 0;
|
|
5139
5243
|
for (const option of zod.def.options) {
|
|
5140
5244
|
const pv = option._zod.propValues;
|
|
5141
5245
|
if (!pv || Object.keys(pv).length === 0)
|
|
5142
5246
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
5247
|
+
if (pv[zod.def.discriminator]?.has(void 0))
|
|
5248
|
+
undefinedCount++;
|
|
5143
5249
|
for (const [k, v] of Object.entries(pv)) {
|
|
5144
5250
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
5145
5251
|
assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
@@ -5149,30 +5255,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
5149
5255
|
}
|
|
5150
5256
|
}
|
|
5151
5257
|
}
|
|
5258
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
5259
|
+
propValues[zod.def.discriminator]?.delete(void 0);
|
|
5152
5260
|
return propValues;
|
|
5153
5261
|
});
|
|
5154
5262
|
def.options.forEach((option, i) => {
|
|
5155
|
-
const propShape =
|
|
5263
|
+
const propShape = rawShape(option._zod.def);
|
|
5156
5264
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
5157
5265
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
5158
5266
|
}
|
|
5159
5267
|
});
|
|
5160
|
-
const disc = cached2(() =>
|
|
5161
|
-
const opts = def.options;
|
|
5162
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
5163
|
-
for (const o of opts) {
|
|
5164
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
5165
|
-
if (!values || values.size === 0)
|
|
5166
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
5167
|
-
for (const v of values) {
|
|
5168
|
-
if (map2.has(v)) {
|
|
5169
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
5170
|
-
}
|
|
5171
|
-
map2.set(v, o);
|
|
5172
|
-
}
|
|
5173
|
-
}
|
|
5174
|
-
return map2;
|
|
5175
|
-
});
|
|
5268
|
+
const disc = cached2(() => discriminatorMap(def));
|
|
5176
5269
|
inst._zod.parse = (payload, ctx) => {
|
|
5177
5270
|
const input2 = payload.value;
|
|
5178
5271
|
if (!isObject(input2)) {
|
|
@@ -5184,8 +5277,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
5184
5277
|
});
|
|
5185
5278
|
return payload;
|
|
5186
5279
|
}
|
|
5187
|
-
const
|
|
5188
|
-
|
|
5280
|
+
const value = input2?.[def.discriminator];
|
|
5281
|
+
const opt = disc.value.get(value);
|
|
5282
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) {
|
|
5189
5283
|
return opt._zod.run(payload, ctx);
|
|
5190
5284
|
}
|
|
5191
5285
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -5196,7 +5290,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
5196
5290
|
errors: [],
|
|
5197
5291
|
note: "No matching discriminator",
|
|
5198
5292
|
discriminator: def.discriminator,
|
|
5199
|
-
options: Array.from(disc.value.keys()),
|
|
5293
|
+
options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
|
|
5200
5294
|
input: input2,
|
|
5201
5295
|
path: [def.discriminator],
|
|
5202
5296
|
inst
|
|
@@ -5362,6 +5456,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
5362
5456
|
}
|
|
5363
5457
|
}
|
|
5364
5458
|
const itemResults = new Array(items.length);
|
|
5459
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
5460
|
+
let itemAborted = false;
|
|
5365
5461
|
for (let i = 0; i < items.length; i++) {
|
|
5366
5462
|
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
5367
5463
|
if (r instanceof Promise) {
|
|
@@ -5370,12 +5466,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
5370
5466
|
}));
|
|
5371
5467
|
} else {
|
|
5372
5468
|
itemResults[i] = r;
|
|
5469
|
+
if (abortEarly && !itemAborted && r.issues.length)
|
|
5470
|
+
itemAborted = aborted(r);
|
|
5373
5471
|
}
|
|
5374
5472
|
}
|
|
5375
|
-
if (def.rest) {
|
|
5473
|
+
if (def.rest && !itemAborted) {
|
|
5376
5474
|
let i = items.length - 1;
|
|
5377
5475
|
const rest = input2.slice(items.length);
|
|
5476
|
+
let seen = payload.issues.length;
|
|
5378
5477
|
for (const el of rest) {
|
|
5478
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
5479
|
+
if (aborted(payload, seen))
|
|
5480
|
+
break;
|
|
5481
|
+
seen = payload.issues.length;
|
|
5482
|
+
}
|
|
5379
5483
|
i++;
|
|
5380
5484
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
5381
5485
|
if (result instanceof Promise) {
|
|
@@ -5603,7 +5707,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
5603
5707
|
}
|
|
5604
5708
|
const proms = [];
|
|
5605
5709
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
5710
|
+
const abortEarly = ctx?.abortEarly;
|
|
5711
|
+
let seen = payload.issues.length;
|
|
5606
5712
|
for (const [key, value] of input2) {
|
|
5713
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
5714
|
+
if (aborted(payload, seen))
|
|
5715
|
+
break;
|
|
5716
|
+
seen = payload.issues.length;
|
|
5717
|
+
}
|
|
5607
5718
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
5608
5719
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
5609
5720
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
@@ -5618,6 +5729,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
5618
5729
|
return Promise.all(proms).then(() => payload);
|
|
5619
5730
|
return payload;
|
|
5620
5731
|
};
|
|
5732
|
+
capSize(inst, mapSize);
|
|
5621
5733
|
});
|
|
5622
5734
|
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
5623
5735
|
if (keyResult.issues.length) {
|
|
@@ -5666,7 +5778,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
5666
5778
|
}
|
|
5667
5779
|
const proms = [];
|
|
5668
5780
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
5781
|
+
const abortEarly = ctx?.abortEarly;
|
|
5782
|
+
let seen = payload.issues.length;
|
|
5669
5783
|
for (const item of input2) {
|
|
5784
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
5785
|
+
if (aborted(payload, seen))
|
|
5786
|
+
break;
|
|
5787
|
+
seen = payload.issues.length;
|
|
5788
|
+
}
|
|
5670
5789
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
5671
5790
|
if (result instanceof Promise) {
|
|
5672
5791
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -5677,6 +5796,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
5677
5796
|
return Promise.all(proms).then(() => payload);
|
|
5678
5797
|
return payload;
|
|
5679
5798
|
};
|
|
5799
|
+
capSize(inst, setSize);
|
|
5680
5800
|
});
|
|
5681
5801
|
function handleSetResult(result, final) {
|
|
5682
5802
|
if (result.issues.length) {
|
|
@@ -5689,8 +5809,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
5689
5809
|
const values = getEnumValues(def.entries);
|
|
5690
5810
|
const valuesSet = new Set(values);
|
|
5691
5811
|
inst._zod.values = valuesSet;
|
|
5692
|
-
|
|
5693
|
-
|
|
5812
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
5813
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
5814
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
5815
|
+
});
|
|
5694
5816
|
inst._zod.parse = (payload, _ctx) => {
|
|
5695
5817
|
const input2 = payload.value;
|
|
5696
5818
|
if (valuesSet.has(input2)) {
|
|
@@ -5709,7 +5831,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
5709
5831
|
$ZodType.init(inst, def);
|
|
5710
5832
|
const values = new Set(def.values);
|
|
5711
5833
|
inst._zod.values = values;
|
|
5712
|
-
inst
|
|
5834
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
5835
|
+
const vals = zod.def.values;
|
|
5836
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
5837
|
+
});
|
|
5713
5838
|
inst._zod.parse = (payload, _ctx) => {
|
|
5714
5839
|
const input2 = payload.value;
|
|
5715
5840
|
if (values.has(input2)) {
|
|
@@ -6047,20 +6172,62 @@ function handleReadonlyResult(payload) {
|
|
|
6047
6172
|
payload.value = Object.freeze(payload.value);
|
|
6048
6173
|
return payload;
|
|
6049
6174
|
}
|
|
6175
|
+
function leafPattern(schema) {
|
|
6176
|
+
const def = schema._zod.def;
|
|
6177
|
+
let pattern = def.pattern;
|
|
6178
|
+
let isInt = !!def.format?.includes("int");
|
|
6179
|
+
let minimum;
|
|
6180
|
+
let maximum;
|
|
6181
|
+
for (const ch of def.checks ?? []) {
|
|
6182
|
+
const d = ch._zod.def;
|
|
6183
|
+
if (d.pattern)
|
|
6184
|
+
pattern = d.pattern;
|
|
6185
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
6186
|
+
const lo = d.minimum ?? d.length;
|
|
6187
|
+
const hi = d.maximum ?? d.length;
|
|
6188
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum))
|
|
6189
|
+
minimum = lo;
|
|
6190
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum))
|
|
6191
|
+
maximum = hi;
|
|
6192
|
+
}
|
|
6193
|
+
if (pattern)
|
|
6194
|
+
return pattern.source;
|
|
6195
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum)
|
|
6196
|
+
return "(?!)";
|
|
6197
|
+
if (minimum !== void 0 || maximum !== void 0)
|
|
6198
|
+
return string({ minimum, maximum }).source;
|
|
6199
|
+
const own2 = schema._zod.pattern;
|
|
6200
|
+
return (isInt && own2 === number ? integer : own2)?.source;
|
|
6201
|
+
}
|
|
6202
|
+
function partPattern(schema) {
|
|
6203
|
+
const def = schema._zod.def;
|
|
6204
|
+
const own2 = schema._zod.pattern?.source;
|
|
6205
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
6206
|
+
if (inner) {
|
|
6207
|
+
const before = inner._zod.pattern?.source;
|
|
6208
|
+
const after = partPattern(inner);
|
|
6209
|
+
if (own2 && before && after && after !== before) {
|
|
6210
|
+
return own2.replace(cleanRegex(before), () => cleanRegex(after));
|
|
6211
|
+
}
|
|
6212
|
+
return own2;
|
|
6213
|
+
}
|
|
6214
|
+
if (def.options) {
|
|
6215
|
+
const sources = def.options.map(partPattern);
|
|
6216
|
+
if (sources.every(Boolean))
|
|
6217
|
+
return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
6218
|
+
}
|
|
6219
|
+
return leafPattern(schema);
|
|
6220
|
+
}
|
|
6050
6221
|
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
6051
6222
|
$ZodType.init(inst, def);
|
|
6052
6223
|
const regexParts = [];
|
|
6053
6224
|
for (const part of def.parts) {
|
|
6054
6225
|
if (typeof part === "object" && part !== null) {
|
|
6055
|
-
|
|
6226
|
+
const source = partPattern(part);
|
|
6227
|
+
if (!source) {
|
|
6056
6228
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
6057
6229
|
}
|
|
6058
|
-
|
|
6059
|
-
if (!source)
|
|
6060
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
6061
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
6062
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
6063
|
-
regexParts.push(source.slice(start, end));
|
|
6230
|
+
regexParts.push(cleanRegex(source));
|
|
6064
6231
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
6065
6232
|
regexParts.push(escapeRegex(`${part}`));
|
|
6066
6233
|
} else {
|
|
@@ -6235,28 +6402,53 @@ var $ZodCyclicError = class extends Error {
|
|
|
6235
6402
|
};
|
|
6236
6403
|
var STATE = "~memo";
|
|
6237
6404
|
var NO_ISSUES = [];
|
|
6405
|
+
function isRef(value) {
|
|
6406
|
+
return value !== null && typeof value === "object";
|
|
6407
|
+
}
|
|
6238
6408
|
function cloneIssues(issues) {
|
|
6239
6409
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
6240
6410
|
}
|
|
6241
6411
|
var recursive = /* @__PURE__ */ new WeakMap();
|
|
6242
|
-
|
|
6412
|
+
var NONE = 0;
|
|
6413
|
+
var ASSUMED = 1;
|
|
6414
|
+
var PROVEN = 2;
|
|
6415
|
+
function isRecursive(inst, stack, resolve3) {
|
|
6243
6416
|
const cached3 = recursive.get(inst);
|
|
6244
6417
|
if (cached3 !== void 0)
|
|
6245
|
-
return cached3;
|
|
6418
|
+
return cached3 ? PROVEN : NONE;
|
|
6246
6419
|
if (stack.has(inst))
|
|
6247
|
-
return
|
|
6420
|
+
return PROVEN;
|
|
6248
6421
|
stack.add(inst);
|
|
6249
|
-
let result =
|
|
6422
|
+
let result = NONE;
|
|
6250
6423
|
const check2 = (child) => {
|
|
6251
|
-
if (
|
|
6252
|
-
|
|
6424
|
+
if (result !== PROVEN && child?._zod) {
|
|
6425
|
+
const answer = isRecursive(child, stack, resolve3);
|
|
6426
|
+
if (answer > result)
|
|
6427
|
+
result = answer;
|
|
6428
|
+
}
|
|
6429
|
+
};
|
|
6430
|
+
const shape = (sh, spread) => {
|
|
6431
|
+
let answer = NONE;
|
|
6432
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
6433
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
6434
|
+
if (spread && !desc.enumerable)
|
|
6435
|
+
continue;
|
|
6436
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve3) : NONE;
|
|
6437
|
+
if (child > answer)
|
|
6438
|
+
answer = child;
|
|
6439
|
+
}
|
|
6440
|
+
return answer;
|
|
6441
|
+
};
|
|
6442
|
+
const merge2 = (answer) => {
|
|
6443
|
+
if (answer > result)
|
|
6444
|
+
result = answer;
|
|
6253
6445
|
};
|
|
6254
6446
|
const def = inst._zod.def;
|
|
6255
6447
|
const kind = def.type;
|
|
6256
6448
|
switch (kind) {
|
|
6257
6449
|
case "object": {
|
|
6258
|
-
|
|
6259
|
-
|
|
6450
|
+
const raw = rawShape(def);
|
|
6451
|
+
merge2(raw ? shape(raw, true) : ASSUMED);
|
|
6260
6452
|
check2(def.catchall);
|
|
6261
6453
|
break;
|
|
6262
6454
|
}
|
|
@@ -6303,10 +6495,12 @@ function isRecursive(inst, stack) {
|
|
|
6303
6495
|
check2(def.input);
|
|
6304
6496
|
check2(def.output);
|
|
6305
6497
|
break;
|
|
6306
|
-
//
|
|
6307
|
-
case "lazy":
|
|
6308
|
-
|
|
6498
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
6499
|
+
case "lazy": {
|
|
6500
|
+
const inner = def._cachedInner ?? (resolve3 ? inst._zod.innerType : void 0);
|
|
6501
|
+
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
6309
6502
|
break;
|
|
6503
|
+
}
|
|
6310
6504
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
6311
6505
|
case "template_literal":
|
|
6312
6506
|
// leaves
|
|
@@ -6348,16 +6542,20 @@ function isRecursive(inst, stack) {
|
|
|
6348
6542
|
}
|
|
6349
6543
|
}
|
|
6350
6544
|
stack.delete(inst);
|
|
6351
|
-
|
|
6352
|
-
|
|
6545
|
+
return settle(inst, result);
|
|
6546
|
+
}
|
|
6547
|
+
function settle(inst, answer) {
|
|
6548
|
+
if (answer !== ASSUMED)
|
|
6549
|
+
recursive.set(inst, answer === PROVEN);
|
|
6550
|
+
return answer;
|
|
6353
6551
|
}
|
|
6354
6552
|
function isRecursiveSchema(inst) {
|
|
6355
|
-
return isRecursive(inst, /* @__PURE__ */ new Set());
|
|
6553
|
+
return isRecursive(inst, /* @__PURE__ */ new Set(), true) !== NONE;
|
|
6356
6554
|
}
|
|
6357
6555
|
function bucketFor(state, inst) {
|
|
6358
6556
|
let bucket = state.buckets.get(inst);
|
|
6359
6557
|
if (!bucket) {
|
|
6360
|
-
bucket = /* @__PURE__ */ new
|
|
6558
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
6361
6559
|
state.buckets.set(inst, bucket);
|
|
6362
6560
|
}
|
|
6363
6561
|
return bucket;
|
|
@@ -6393,6 +6591,7 @@ var memo = {
|
|
|
6393
6591
|
attach(inst) {
|
|
6394
6592
|
var _a3;
|
|
6395
6593
|
let isRecursiveInst;
|
|
6594
|
+
let rechecked = false;
|
|
6396
6595
|
let lastCtx;
|
|
6397
6596
|
let lastBucket;
|
|
6398
6597
|
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
@@ -6400,20 +6599,24 @@ var memo = {
|
|
|
6400
6599
|
const base = inst._zod.parse;
|
|
6401
6600
|
const wrapped = (payload, ctx) => {
|
|
6402
6601
|
if (isRecursiveInst === void 0) {
|
|
6403
|
-
|
|
6404
|
-
if (
|
|
6602
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
6603
|
+
if (walked === NONE) {
|
|
6405
6604
|
inst._zod.parse = base;
|
|
6406
6605
|
if (inst._zod.run === wrapped)
|
|
6407
6606
|
inst._zod.run = base;
|
|
6408
6607
|
return base(payload, ctx);
|
|
6409
6608
|
}
|
|
6609
|
+
if (walked === PROVEN || rechecked)
|
|
6610
|
+
isRecursiveInst = true;
|
|
6611
|
+
else
|
|
6612
|
+
rechecked = true;
|
|
6410
6613
|
}
|
|
6411
6614
|
const input2 = payload.value;
|
|
6412
|
-
if (input2
|
|
6615
|
+
if (!isRef(input2))
|
|
6413
6616
|
return base(payload, ctx);
|
|
6414
6617
|
let state = ctx[STATE];
|
|
6415
6618
|
if (!state) {
|
|
6416
|
-
state = { buckets: /* @__PURE__ */ new
|
|
6619
|
+
state = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 };
|
|
6417
6620
|
ctx[STATE] = state;
|
|
6418
6621
|
}
|
|
6419
6622
|
let bucket;
|
|
@@ -6432,7 +6635,7 @@ var memo = {
|
|
|
6432
6635
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
6433
6636
|
} else {
|
|
6434
6637
|
payload.memo = true;
|
|
6435
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
6638
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
6436
6639
|
state.backEdges.add(hit.value);
|
|
6437
6640
|
}
|
|
6438
6641
|
return payload;
|
|
@@ -6464,7 +6667,7 @@ function memoizer() {
|
|
|
6464
6667
|
}
|
|
6465
6668
|
function isBackEdge(ctx, value) {
|
|
6466
6669
|
const backEdges = ctx[STATE]?.backEdges;
|
|
6467
|
-
return backEdges !== void 0 && value
|
|
6670
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
6468
6671
|
}
|
|
6469
6672
|
|
|
6470
6673
|
// node_modules/zod/v4/locales/index.js
|
|
@@ -6521,6 +6724,7 @@ __export(locales_exports, {
|
|
|
6521
6724
|
sl: () => sl_default,
|
|
6522
6725
|
sv: () => sv_default,
|
|
6523
6726
|
ta: () => ta_default,
|
|
6727
|
+
tg: () => tg_default,
|
|
6524
6728
|
th: () => th_default,
|
|
6525
6729
|
tk: () => tk_default,
|
|
6526
6730
|
tr: () => tr_default,
|
|
@@ -6575,6 +6779,8 @@ var error = () => {
|
|
|
6575
6779
|
json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
|
|
6576
6780
|
e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
|
|
6577
6781
|
credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
|
|
6782
|
+
currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
|
|
6783
|
+
iban: "IBAN",
|
|
6578
6784
|
jwt: "JWT",
|
|
6579
6785
|
template_literal: "\u0645\u062F\u062E\u0644"
|
|
6580
6786
|
};
|
|
@@ -6685,6 +6891,8 @@ var error2 = () => {
|
|
|
6685
6891
|
json_string: "JSON string",
|
|
6686
6892
|
e164: "E.164 number",
|
|
6687
6893
|
credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
|
|
6894
|
+
currency_code: "valyuta kodu",
|
|
6895
|
+
iban: "IBAN",
|
|
6688
6896
|
jwt: "JWT",
|
|
6689
6897
|
template_literal: "input"
|
|
6690
6898
|
};
|
|
@@ -6844,6 +7052,8 @@ var error3 = () => {
|
|
|
6844
7052
|
json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
|
|
6845
7053
|
e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
|
|
6846
7054
|
credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
7055
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
7056
|
+
iban: "IBAN",
|
|
6847
7057
|
jwt: "JWT",
|
|
6848
7058
|
template_literal: "\u0443\u0432\u043E\u0434"
|
|
6849
7059
|
};
|
|
@@ -6961,6 +7171,8 @@ var error4 = () => {
|
|
|
6961
7171
|
json_string: "JSON \u043D\u0438\u0437",
|
|
6962
7172
|
e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
|
|
6963
7173
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
|
|
7174
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
7175
|
+
iban: "IBAN",
|
|
6964
7176
|
jwt: "JWT",
|
|
6965
7177
|
template_literal: "\u0432\u0445\u043E\u0434"
|
|
6966
7178
|
};
|
|
@@ -7085,6 +7297,8 @@ var error5 = () => {
|
|
|
7085
7297
|
json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
|
|
7086
7298
|
e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
7087
7299
|
credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
7300
|
+
currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
|
|
7301
|
+
iban: "IBAN",
|
|
7088
7302
|
jwt: "JWT",
|
|
7089
7303
|
template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
|
|
7090
7304
|
};
|
|
@@ -7197,6 +7411,8 @@ var error6 = () => {
|
|
|
7197
7411
|
json_string: "cadena JSON",
|
|
7198
7412
|
e164: "n\xFAmero E.164",
|
|
7199
7413
|
credit_card: "n\xFAmero de targeta de cr\xE8dit",
|
|
7414
|
+
currency_code: "codi de moneda",
|
|
7415
|
+
iban: "IBAN",
|
|
7200
7416
|
jwt: "JWT",
|
|
7201
7417
|
template_literal: "entrada"
|
|
7202
7418
|
};
|
|
@@ -7309,6 +7525,8 @@ var error7 = () => {
|
|
|
7309
7525
|
json_string: "\u062F\u06D5\u0642\u06CC JSON",
|
|
7310
7526
|
e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
|
|
7311
7527
|
credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
|
|
7528
|
+
currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
|
|
7529
|
+
iban: "IBAN",
|
|
7312
7530
|
jwt: "JWT",
|
|
7313
7531
|
template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
|
|
7314
7532
|
};
|
|
@@ -7440,6 +7658,8 @@ var error8 = () => {
|
|
|
7440
7658
|
json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
|
|
7441
7659
|
e164: "\u010D\xEDslo E.164",
|
|
7442
7660
|
credit_card: "\u010D\xEDslo kreditn\xED karty",
|
|
7661
|
+
currency_code: "k\xF3d m\u011Bny",
|
|
7662
|
+
iban: "IBAN",
|
|
7443
7663
|
jwt: "JWT",
|
|
7444
7664
|
template_literal: "vstup"
|
|
7445
7665
|
};
|
|
@@ -7555,6 +7775,8 @@ var error9 = () => {
|
|
|
7555
7775
|
json_string: "JSON-streng",
|
|
7556
7776
|
e164: "E.164-nummer",
|
|
7557
7777
|
credit_card: "kreditkortnummer",
|
|
7778
|
+
currency_code: "valutakode",
|
|
7779
|
+
iban: "IBAN",
|
|
7558
7780
|
jwt: "JWT",
|
|
7559
7781
|
template_literal: "input"
|
|
7560
7782
|
};
|
|
@@ -7674,6 +7896,8 @@ var error10 = () => {
|
|
|
7674
7896
|
json_string: "JSON-String",
|
|
7675
7897
|
e164: "E.164-Nummer",
|
|
7676
7898
|
credit_card: "Kreditkartennummer",
|
|
7899
|
+
currency_code: "W\xE4hrungscode",
|
|
7900
|
+
iban: "IBAN",
|
|
7677
7901
|
jwt: "JWT",
|
|
7678
7902
|
template_literal: "Eingabe"
|
|
7679
7903
|
};
|
|
@@ -7786,6 +8010,8 @@ var error11 = () => {
|
|
|
7786
8010
|
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
7787
8011
|
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
7788
8012
|
credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
|
|
8013
|
+
currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
|
|
8014
|
+
iban: "IBAN",
|
|
7789
8015
|
jwt: "JWT",
|
|
7790
8016
|
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
7791
8017
|
};
|
|
@@ -7896,7 +8122,9 @@ var error12 = () => {
|
|
|
7896
8122
|
base64url: "base64url-encoded string",
|
|
7897
8123
|
json_string: "JSON string",
|
|
7898
8124
|
e164: "E.164 number",
|
|
8125
|
+
currency_code: "currency code",
|
|
7899
8126
|
credit_card: "credit card number",
|
|
8127
|
+
iban: "IBAN",
|
|
7900
8128
|
jwt: "JWT",
|
|
7901
8129
|
template_literal: "input"
|
|
7902
8130
|
};
|
|
@@ -8020,6 +8248,8 @@ var error13 = () => {
|
|
|
8020
8248
|
json_string: "JSON-karaktraro",
|
|
8021
8249
|
e164: "E.164-nombro",
|
|
8022
8250
|
credit_card: "kreditkarta numero",
|
|
8251
|
+
currency_code: "valuta kodo",
|
|
8252
|
+
iban: "IBAN",
|
|
8023
8253
|
jwt: "JWT",
|
|
8024
8254
|
template_literal: "enigo"
|
|
8025
8255
|
};
|
|
@@ -8132,6 +8362,8 @@ var error14 = () => {
|
|
|
8132
8362
|
json_string: "cadena JSON",
|
|
8133
8363
|
e164: "n\xFAmero E.164",
|
|
8134
8364
|
credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
|
|
8365
|
+
currency_code: "c\xF3digo de moneda",
|
|
8366
|
+
iban: "IBAN",
|
|
8135
8367
|
jwt: "JWT",
|
|
8136
8368
|
template_literal: "entrada"
|
|
8137
8369
|
};
|
|
@@ -8268,6 +8500,8 @@ var error15 = () => {
|
|
|
8268
8500
|
json_string: "JSON \u0631\u0634\u062A\u0647",
|
|
8269
8501
|
e164: "E.164 \u0639\u062F\u062F",
|
|
8270
8502
|
credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
|
|
8503
|
+
currency_code: "\u06A9\u062F \u0627\u0631\u0632",
|
|
8504
|
+
iban: "IBAN",
|
|
8271
8505
|
jwt: "JWT",
|
|
8272
8506
|
template_literal: "\u0648\u0631\u0648\u062F\u06CC"
|
|
8273
8507
|
};
|
|
@@ -8390,6 +8624,8 @@ var error16 = () => {
|
|
|
8390
8624
|
json_string: "JSON-merkkijono",
|
|
8391
8625
|
e164: "E.164-luku",
|
|
8392
8626
|
credit_card: "luottokortin numero",
|
|
8627
|
+
currency_code: "valuuttakoodi",
|
|
8628
|
+
iban: "IBAN",
|
|
8393
8629
|
jwt: "JWT",
|
|
8394
8630
|
template_literal: "templaattimerkkijono"
|
|
8395
8631
|
};
|
|
@@ -8501,6 +8737,8 @@ var error17 = () => {
|
|
|
8501
8737
|
json_string: "cha\xEEne de caract\xE8res JSON",
|
|
8502
8738
|
e164: "num\xE9ro au format E.164",
|
|
8503
8739
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
8740
|
+
currency_code: "code de devise",
|
|
8741
|
+
iban: "IBAN",
|
|
8504
8742
|
jwt: "JWT",
|
|
8505
8743
|
template_literal: "entr\xE9e"
|
|
8506
8744
|
};
|
|
@@ -8630,6 +8868,8 @@ var error18 = () => {
|
|
|
8630
8868
|
json_string: "cha\xEEne JSON",
|
|
8631
8869
|
e164: "num\xE9ro E.164",
|
|
8632
8870
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
8871
|
+
currency_code: "code de devise",
|
|
8872
|
+
iban: "IBAN",
|
|
8633
8873
|
jwt: "JWT",
|
|
8634
8874
|
template_literal: "entr\xE9e"
|
|
8635
8875
|
};
|
|
@@ -8741,6 +8981,8 @@ var error19 = () => {
|
|
|
8741
8981
|
json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
|
|
8742
8982
|
e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
8743
8983
|
credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
8984
|
+
currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
|
|
8985
|
+
iban: "IBAN",
|
|
8744
8986
|
jwt: "JWT",
|
|
8745
8987
|
template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
|
|
8746
8988
|
};
|
|
@@ -8889,6 +9131,8 @@ var error20 = () => {
|
|
|
8889
9131
|
json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
|
|
8890
9132
|
e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
|
|
8891
9133
|
credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
|
|
9134
|
+
currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
|
|
9135
|
+
iban: { label: "IBAN", gender: "m" },
|
|
8892
9136
|
jwt: { label: "JWT", gender: "m" },
|
|
8893
9137
|
template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
8894
9138
|
ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
@@ -9053,6 +9297,8 @@ var error21 = () => {
|
|
|
9053
9297
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
|
|
9054
9298
|
e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
9055
9299
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
9300
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
9301
|
+
iban: "IBAN",
|
|
9056
9302
|
jwt: "JWT",
|
|
9057
9303
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
9058
9304
|
};
|
|
@@ -9162,6 +9408,8 @@ var error22 = () => {
|
|
|
9162
9408
|
json_string: "JSON tekst",
|
|
9163
9409
|
e164: "E.164 broj",
|
|
9164
9410
|
credit_card: "broj kreditne kartice",
|
|
9411
|
+
currency_code: "kod valute",
|
|
9412
|
+
iban: "IBAN",
|
|
9165
9413
|
jwt: "JWT",
|
|
9166
9414
|
template_literal: "unos"
|
|
9167
9415
|
};
|
|
@@ -9288,6 +9536,8 @@ var error23 = () => {
|
|
|
9288
9536
|
json_string: "JSON string",
|
|
9289
9537
|
e164: "E.164 sz\xE1m",
|
|
9290
9538
|
credit_card: "hitelk\xE1rtyasz\xE1m",
|
|
9539
|
+
currency_code: "p\xE9nznemk\xF3d",
|
|
9540
|
+
iban: "IBAN",
|
|
9291
9541
|
jwt: "JWT",
|
|
9292
9542
|
template_literal: "bemenet"
|
|
9293
9543
|
};
|
|
@@ -9440,6 +9690,8 @@ var error24 = () => {
|
|
|
9440
9690
|
json_string: "JSON \u057F\u0578\u0572",
|
|
9441
9691
|
e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
|
|
9442
9692
|
credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
|
|
9693
|
+
currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
|
|
9694
|
+
iban: "IBAN",
|
|
9443
9695
|
jwt: "JWT",
|
|
9444
9696
|
template_literal: "\u0574\u0578\u0582\u057F\u0584"
|
|
9445
9697
|
};
|
|
@@ -9557,6 +9809,8 @@ var error25 = () => {
|
|
|
9557
9809
|
json_string: "string JSON",
|
|
9558
9810
|
e164: "angka E.164",
|
|
9559
9811
|
credit_card: "nomor kartu kredit",
|
|
9812
|
+
currency_code: "kode mata uang",
|
|
9813
|
+
iban: "IBAN",
|
|
9560
9814
|
jwt: "JWT",
|
|
9561
9815
|
template_literal: "input"
|
|
9562
9816
|
};
|
|
@@ -9667,6 +9921,8 @@ var error26 = () => {
|
|
|
9667
9921
|
json_string: "JSON strengur",
|
|
9668
9922
|
e164: "E.164 t\xF6lugildi",
|
|
9669
9923
|
credit_card: "kreditkortan\xFAmer",
|
|
9924
|
+
currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
|
|
9925
|
+
iban: "IBAN",
|
|
9670
9926
|
jwt: "JWT",
|
|
9671
9927
|
template_literal: "gildi"
|
|
9672
9928
|
};
|
|
@@ -9780,6 +10036,8 @@ var error27 = () => {
|
|
|
9780
10036
|
json_string: "stringa JSON",
|
|
9781
10037
|
e164: "numero E.164",
|
|
9782
10038
|
credit_card: "numero di carta di credito",
|
|
10039
|
+
currency_code: "codice valuta",
|
|
10040
|
+
iban: "IBAN",
|
|
9783
10041
|
jwt: "JWT",
|
|
9784
10042
|
template_literal: "input"
|
|
9785
10043
|
};
|
|
@@ -9892,6 +10150,8 @@ var error28 = () => {
|
|
|
9892
10150
|
json_string: "JSON\u6587\u5B57\u5217",
|
|
9893
10151
|
e164: "E.164\u756A\u53F7",
|
|
9894
10152
|
credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
|
|
10153
|
+
currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
|
|
10154
|
+
iban: "IBAN",
|
|
9895
10155
|
jwt: "JWT",
|
|
9896
10156
|
template_literal: "\u5165\u529B\u5024"
|
|
9897
10157
|
};
|
|
@@ -10003,6 +10263,8 @@ var error29 = () => {
|
|
|
10003
10263
|
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
10004
10264
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
10005
10265
|
credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
10266
|
+
currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
|
|
10267
|
+
iban: "IBAN",
|
|
10006
10268
|
jwt: "JWT",
|
|
10007
10269
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
10008
10270
|
};
|
|
@@ -10119,6 +10381,8 @@ var error30 = () => {
|
|
|
10119
10381
|
json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
|
|
10120
10382
|
e164: "\u179B\u17C1\u1781 E.164",
|
|
10121
10383
|
credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
|
|
10384
|
+
currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
|
|
10385
|
+
iban: "IBAN",
|
|
10122
10386
|
jwt: "JWT",
|
|
10123
10387
|
template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
|
|
10124
10388
|
};
|
|
@@ -10238,6 +10502,8 @@ var error31 = () => {
|
|
|
10238
10502
|
json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
|
|
10239
10503
|
e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
10240
10504
|
credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
10505
|
+
currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
|
|
10506
|
+
iban: "IBAN",
|
|
10241
10507
|
jwt: "JWT",
|
|
10242
10508
|
template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
|
|
10243
10509
|
};
|
|
@@ -10352,6 +10618,8 @@ var error32 = () => {
|
|
|
10352
10618
|
json_string: "JSON \uBB38\uC790\uC5F4",
|
|
10353
10619
|
e164: "E.164 \uBC88\uD638",
|
|
10354
10620
|
credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
|
|
10621
|
+
currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
|
|
10622
|
+
iban: "IBAN",
|
|
10355
10623
|
jwt: "JWT",
|
|
10356
10624
|
template_literal: "\uC785\uB825"
|
|
10357
10625
|
};
|
|
@@ -10549,6 +10817,8 @@ var error33 = () => {
|
|
|
10549
10817
|
json_string: "JSON eilut\u0117",
|
|
10550
10818
|
e164: "E.164 numeris",
|
|
10551
10819
|
credit_card: "kredito kortel\u0117s numeris",
|
|
10820
|
+
currency_code: "valiutos kodas",
|
|
10821
|
+
iban: "IBAN",
|
|
10552
10822
|
jwt: "JWT",
|
|
10553
10823
|
template_literal: "\u012Fvestis"
|
|
10554
10824
|
};
|
|
@@ -10673,6 +10943,8 @@ var error34 = () => {
|
|
|
10673
10943
|
json_string: "JSON \u043D\u0438\u0437\u0430",
|
|
10674
10944
|
e164: "E.164 \u0431\u0440\u043E\u0458",
|
|
10675
10945
|
credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
|
|
10946
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
10947
|
+
iban: "IBAN",
|
|
10676
10948
|
jwt: "JWT",
|
|
10677
10949
|
template_literal: "\u0432\u043D\u0435\u0441"
|
|
10678
10950
|
};
|
|
@@ -10786,6 +11058,8 @@ var error35 = () => {
|
|
|
10786
11058
|
json_string: "string JSON",
|
|
10787
11059
|
e164: "nombor E.164",
|
|
10788
11060
|
credit_card: "nombor kad kredit",
|
|
11061
|
+
currency_code: "kod mata wang",
|
|
11062
|
+
iban: "IBAN",
|
|
10789
11063
|
jwt: "JWT",
|
|
10790
11064
|
template_literal: "input"
|
|
10791
11065
|
};
|
|
@@ -10897,6 +11171,8 @@ var error36 = () => {
|
|
|
10897
11171
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
|
|
10898
11172
|
e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
|
|
10899
11173
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
|
|
11174
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
11175
|
+
iban: "IBAN",
|
|
10900
11176
|
jwt: "JWT",
|
|
10901
11177
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
10902
11178
|
};
|
|
@@ -11007,6 +11283,8 @@ var error37 = () => {
|
|
|
11007
11283
|
json_string: "JSON string",
|
|
11008
11284
|
e164: "E.164-nummer",
|
|
11009
11285
|
credit_card: "creditcardnummer",
|
|
11286
|
+
currency_code: "valutacode",
|
|
11287
|
+
iban: "IBAN",
|
|
11010
11288
|
jwt: "JWT",
|
|
11011
11289
|
template_literal: "invoer"
|
|
11012
11290
|
};
|
|
@@ -11121,6 +11399,8 @@ var error38 = () => {
|
|
|
11121
11399
|
json_string: "JSON-streng",
|
|
11122
11400
|
e164: "E.164-nummer",
|
|
11123
11401
|
credit_card: "kredittkortnummer",
|
|
11402
|
+
currency_code: "valutakode",
|
|
11403
|
+
iban: "IBAN",
|
|
11124
11404
|
jwt: "JWT",
|
|
11125
11405
|
template_literal: "input"
|
|
11126
11406
|
};
|
|
@@ -11233,6 +11513,8 @@ var error39 = () => {
|
|
|
11233
11513
|
json_string: "JSON-streng",
|
|
11234
11514
|
e164: "E.164-nummer",
|
|
11235
11515
|
credit_card: "kredittkortnummer",
|
|
11516
|
+
currency_code: "valutakode",
|
|
11517
|
+
iban: "IBAN",
|
|
11236
11518
|
jwt: "JWT",
|
|
11237
11519
|
template_literal: "input"
|
|
11238
11520
|
};
|
|
@@ -11345,6 +11627,8 @@ var error40 = () => {
|
|
|
11345
11627
|
json_string: "JSON metin",
|
|
11346
11628
|
e164: "E.164 say\u0131s\u0131",
|
|
11347
11629
|
credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
|
|
11630
|
+
currency_code: "para birimi kodu",
|
|
11631
|
+
iban: "IBAN",
|
|
11348
11632
|
jwt: "JWT",
|
|
11349
11633
|
template_literal: "giren"
|
|
11350
11634
|
};
|
|
@@ -11458,6 +11742,8 @@ var error41 = () => {
|
|
|
11458
11742
|
json_string: "JSON \u0645\u062A\u0646",
|
|
11459
11743
|
e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
|
|
11460
11744
|
credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
|
|
11745
|
+
currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
|
|
11746
|
+
iban: "IBAN",
|
|
11461
11747
|
jwt: "JWT",
|
|
11462
11748
|
template_literal: "\u0648\u0631\u0648\u062F\u064A"
|
|
11463
11749
|
};
|
|
@@ -11576,6 +11862,8 @@ var error42 = () => {
|
|
|
11576
11862
|
json_string: "ci\u0105g znak\xF3w w formacie JSON",
|
|
11577
11863
|
e164: "liczba E.164",
|
|
11578
11864
|
credit_card: "numer karty kredytowej",
|
|
11865
|
+
currency_code: "kod waluty",
|
|
11866
|
+
iban: "IBAN",
|
|
11579
11867
|
jwt: "JWT",
|
|
11580
11868
|
template_literal: "wej\u015Bcie"
|
|
11581
11869
|
};
|
|
@@ -11689,6 +11977,8 @@ var error43 = () => {
|
|
|
11689
11977
|
json_string: "o texto JSON",
|
|
11690
11978
|
e164: "o n\xFAmero E.164",
|
|
11691
11979
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
11980
|
+
currency_code: "o c\xF3digo de moeda",
|
|
11981
|
+
iban: "o IBAN",
|
|
11692
11982
|
jwt: "o JWT",
|
|
11693
11983
|
template_literal: "a entrada"
|
|
11694
11984
|
};
|
|
@@ -11766,8 +12056,8 @@ var error43 = () => {
|
|
|
11766
12056
|
case "not_multiple_of":
|
|
11767
12057
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
11768
12058
|
case "unrecognized_keys": {
|
|
11769
|
-
const
|
|
11770
|
-
return `Chave${
|
|
12059
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
12060
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
11771
12061
|
}
|
|
11772
12062
|
case "invalid_key":
|
|
11773
12063
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -11831,6 +12121,8 @@ var error44 = () => {
|
|
|
11831
12121
|
json_string: "o texto JSON",
|
|
11832
12122
|
e164: "o n\xFAmero E.164",
|
|
11833
12123
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
12124
|
+
currency_code: "o c\xF3digo de moeda",
|
|
12125
|
+
iban: "o IBAN",
|
|
11834
12126
|
jwt: "o JWT",
|
|
11835
12127
|
template_literal: "a entrada"
|
|
11836
12128
|
};
|
|
@@ -11909,8 +12201,8 @@ var error44 = () => {
|
|
|
11909
12201
|
case "not_multiple_of":
|
|
11910
12202
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
11911
12203
|
case "unrecognized_keys": {
|
|
11912
|
-
const
|
|
11913
|
-
return `Chave${
|
|
12204
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
12205
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
11914
12206
|
}
|
|
11915
12207
|
case "invalid_key":
|
|
11916
12208
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -11974,6 +12266,8 @@ var error45 = () => {
|
|
|
11974
12266
|
json_string: "\u0219ir JSON",
|
|
11975
12267
|
e164: "num\u0103r E.164",
|
|
11976
12268
|
credit_card: "num\u0103r de card de credit",
|
|
12269
|
+
currency_code: "cod valutar",
|
|
12270
|
+
iban: "IBAN",
|
|
11977
12271
|
jwt: "JWT",
|
|
11978
12272
|
template_literal: "intrare"
|
|
11979
12273
|
};
|
|
@@ -12145,6 +12439,8 @@ var error46 = () => {
|
|
|
12145
12439
|
json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
|
|
12146
12440
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
12147
12441
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
12442
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
12443
|
+
iban: "IBAN",
|
|
12148
12444
|
jwt: "JWT",
|
|
12149
12445
|
template_literal: "\u0432\u0432\u043E\u0434"
|
|
12150
12446
|
};
|
|
@@ -12262,6 +12558,8 @@ var error47 = () => {
|
|
|
12262
12558
|
json_string: "re\u0165azec vo form\xE1te JSON",
|
|
12263
12559
|
e164: "\u010D\xEDslo E.164",
|
|
12264
12560
|
credit_card: "\u010D\xEDslo kreditnej karty",
|
|
12561
|
+
currency_code: "k\xF3d meny",
|
|
12562
|
+
iban: "IBAN",
|
|
12265
12563
|
jwt: "JWT",
|
|
12266
12564
|
template_literal: "vstup"
|
|
12267
12565
|
};
|
|
@@ -12377,6 +12675,8 @@ var error48 = () => {
|
|
|
12377
12675
|
json_string: "JSON niz",
|
|
12378
12676
|
e164: "E.164 \u0161tevilka",
|
|
12379
12677
|
credit_card: "\u0161tevilka kreditne kartice",
|
|
12678
|
+
currency_code: "koda valute",
|
|
12679
|
+
iban: "IBAN",
|
|
12380
12680
|
jwt: "JWT",
|
|
12381
12681
|
template_literal: "vnos"
|
|
12382
12682
|
};
|
|
@@ -12490,6 +12790,8 @@ var error49 = () => {
|
|
|
12490
12790
|
json_string: "JSON-str\xE4ng",
|
|
12491
12791
|
e164: "E.164-nummer",
|
|
12492
12792
|
credit_card: "kreditkortsnummer",
|
|
12793
|
+
currency_code: "valutakod",
|
|
12794
|
+
iban: "IBAN",
|
|
12493
12795
|
jwt: "JWT",
|
|
12494
12796
|
template_literal: "mall-literal"
|
|
12495
12797
|
};
|
|
@@ -12604,6 +12906,8 @@ var error50 = () => {
|
|
|
12604
12906
|
json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
|
|
12605
12907
|
e164: "E.164 \u0B8E\u0BA3\u0BCD",
|
|
12606
12908
|
credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
|
|
12909
|
+
currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
|
|
12910
|
+
iban: "IBAN",
|
|
12607
12911
|
jwt: "JWT",
|
|
12608
12912
|
template_literal: "input"
|
|
12609
12913
|
};
|
|
@@ -12677,23 +12981,23 @@ function ta_default() {
|
|
|
12677
12981
|
};
|
|
12678
12982
|
}
|
|
12679
12983
|
|
|
12680
|
-
// node_modules/zod/v4/locales/
|
|
12984
|
+
// node_modules/zod/v4/locales/tg.js
|
|
12681
12985
|
var error51 = () => {
|
|
12682
12986
|
const Sizable = {
|
|
12683
|
-
string: { unit: "\
|
|
12684
|
-
file: { unit: "\
|
|
12685
|
-
array: { unit: "\
|
|
12686
|
-
set: { unit: "\
|
|
12687
|
-
map: { unit: "\
|
|
12987
|
+
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
12988
|
+
file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
12989
|
+
array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
12990
|
+
set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
12991
|
+
map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
|
|
12688
12992
|
};
|
|
12689
12993
|
function getSizing(origin) {
|
|
12690
12994
|
return Sizable[origin] ?? null;
|
|
12691
12995
|
}
|
|
12692
12996
|
const FormatDictionary = {
|
|
12693
|
-
regex: "\
|
|
12694
|
-
email: "\
|
|
12997
|
+
regex: "\u0432\u0443\u0440\u0443\u0434",
|
|
12998
|
+
email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
|
|
12695
12999
|
url: "URL",
|
|
12696
|
-
emoji: "\
|
|
13000
|
+
emoji: "\u044D\u043C\u043E\u04B7\u0438",
|
|
12697
13001
|
uuid: "UUID",
|
|
12698
13002
|
uuidv4: "UUIDv4",
|
|
12699
13003
|
uuidv6: "UUIDv6",
|
|
@@ -12704,26 +13008,145 @@ var error51 = () => {
|
|
|
12704
13008
|
ulid: "ULID",
|
|
12705
13009
|
xid: "XID",
|
|
12706
13010
|
ksuid: "KSUID",
|
|
12707
|
-
datetime: "\
|
|
12708
|
-
date: "\
|
|
12709
|
-
time: "\
|
|
12710
|
-
duration: "\
|
|
12711
|
-
ipv4: "\
|
|
12712
|
-
ipv6: "\
|
|
12713
|
-
mac: "\
|
|
12714
|
-
cidrv4: "\
|
|
12715
|
-
cidrv6: "\
|
|
12716
|
-
base64: "\
|
|
12717
|
-
base64url: "\
|
|
12718
|
-
json_string: "\
|
|
12719
|
-
e164: "\
|
|
12720
|
-
credit_card: "\
|
|
12721
|
-
|
|
12722
|
-
|
|
13011
|
+
datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
|
|
13012
|
+
date: "\u0441\u0430\u043D\u0430\u0438 ISO",
|
|
13013
|
+
time: "\u0432\u0430\u049B\u0442\u0438 ISO",
|
|
13014
|
+
duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
|
|
13015
|
+
ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
|
|
13016
|
+
ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
|
|
13017
|
+
mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
|
|
13018
|
+
cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
|
|
13019
|
+
cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
|
|
13020
|
+
base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
|
|
13021
|
+
base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
|
|
13022
|
+
json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
|
|
13023
|
+
e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
|
|
13024
|
+
credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
|
|
13025
|
+
currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
|
|
13026
|
+
iban: "IBAN",
|
|
13027
|
+
jwt: "JWT",
|
|
13028
|
+
template_literal: "\u0432\u0443\u0440\u0443\u0434"
|
|
12723
13029
|
};
|
|
12724
13030
|
const TypeDictionary = {
|
|
12725
13031
|
nan: "NaN",
|
|
12726
|
-
number: "\
|
|
13032
|
+
number: "\u0440\u0430\u049B\u0430\u043C",
|
|
13033
|
+
string: "\u0441\u0430\u0442\u0440",
|
|
13034
|
+
array: "\u043C\u0430\u0441\u0441\u0438\u0432",
|
|
13035
|
+
object: "\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
13036
|
+
date: "\u0441\u0430\u043D\u0430"
|
|
13037
|
+
};
|
|
13038
|
+
return (issue2) => {
|
|
13039
|
+
switch (issue2.code) {
|
|
13040
|
+
case "invalid_type": {
|
|
13041
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
13042
|
+
const receivedType = parsedType(issue2.input);
|
|
13043
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
13044
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${expected} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${received} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`;
|
|
13045
|
+
}
|
|
13046
|
+
case "invalid_value":
|
|
13047
|
+
if (issue2.values.length === 1)
|
|
13048
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${stringifyPrimitive(issue2.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
13049
|
+
return `\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${joinValues(issue2.values, "|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
13050
|
+
case "too_big": {
|
|
13051
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
13052
|
+
const sizing = getSizing(issue2.origin);
|
|
13053
|
+
if (sizing)
|
|
13054
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
13055
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
13056
|
+
}
|
|
13057
|
+
case "too_small": {
|
|
13058
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
13059
|
+
const sizing = getSizing(issue2.origin);
|
|
13060
|
+
if (sizing)
|
|
13061
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
13062
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
13063
|
+
}
|
|
13064
|
+
case "invalid_format": {
|
|
13065
|
+
const _issue = issue2;
|
|
13066
|
+
if (_issue.format === "starts_with")
|
|
13067
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`;
|
|
13068
|
+
if (_issue.format === "ends_with")
|
|
13069
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`;
|
|
13070
|
+
if (_issue.format === "includes")
|
|
13071
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${_issue.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`;
|
|
13072
|
+
if (_issue.format === "regex")
|
|
13073
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${_issue.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`;
|
|
13074
|
+
return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
13075
|
+
}
|
|
13076
|
+
case "not_multiple_of":
|
|
13077
|
+
return `\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${issue2.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;
|
|
13078
|
+
case "unrecognized_keys":
|
|
13079
|
+
return `\u041A\u0430\u043B\u0438\u0434${issue2.keys.length > 1 ? "\u04B3\u043E\u0438" : "\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${joinValues(issue2.keys, ", ")}`;
|
|
13080
|
+
case "invalid_key":
|
|
13081
|
+
return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
13082
|
+
case "invalid_union":
|
|
13083
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
13084
|
+
const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
|
|
13085
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${opts} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
13086
|
+
}
|
|
13087
|
+
return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
|
|
13088
|
+
case "invalid_element":
|
|
13089
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
13090
|
+
default:
|
|
13091
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
13092
|
+
}
|
|
13093
|
+
};
|
|
13094
|
+
};
|
|
13095
|
+
function tg_default() {
|
|
13096
|
+
return {
|
|
13097
|
+
localeError: error51()
|
|
13098
|
+
};
|
|
13099
|
+
}
|
|
13100
|
+
|
|
13101
|
+
// node_modules/zod/v4/locales/th.js
|
|
13102
|
+
var error52 = () => {
|
|
13103
|
+
const Sizable = {
|
|
13104
|
+
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
13105
|
+
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
13106
|
+
array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
13107
|
+
set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
13108
|
+
map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
|
|
13109
|
+
};
|
|
13110
|
+
function getSizing(origin) {
|
|
13111
|
+
return Sizable[origin] ?? null;
|
|
13112
|
+
}
|
|
13113
|
+
const FormatDictionary = {
|
|
13114
|
+
regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
|
|
13115
|
+
email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
|
|
13116
|
+
url: "URL",
|
|
13117
|
+
emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
|
|
13118
|
+
uuid: "UUID",
|
|
13119
|
+
uuidv4: "UUIDv4",
|
|
13120
|
+
uuidv6: "UUIDv6",
|
|
13121
|
+
nanoid: "nanoid",
|
|
13122
|
+
guid: "GUID",
|
|
13123
|
+
cuid: "cuid",
|
|
13124
|
+
cuid2: "cuid2",
|
|
13125
|
+
ulid: "ULID",
|
|
13126
|
+
xid: "XID",
|
|
13127
|
+
ksuid: "KSUID",
|
|
13128
|
+
datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
13129
|
+
date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
|
|
13130
|
+
time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
13131
|
+
duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
13132
|
+
ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
|
|
13133
|
+
ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
|
|
13134
|
+
mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
|
|
13135
|
+
cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
|
|
13136
|
+
cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
|
|
13137
|
+
base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
|
|
13138
|
+
base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
|
|
13139
|
+
json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
|
|
13140
|
+
e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
|
|
13141
|
+
credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
|
|
13142
|
+
currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
|
|
13143
|
+
iban: "IBAN",
|
|
13144
|
+
jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
|
|
13145
|
+
template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
|
|
13146
|
+
};
|
|
13147
|
+
const TypeDictionary = {
|
|
13148
|
+
nan: "NaN",
|
|
13149
|
+
number: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
|
|
12727
13150
|
array: "\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",
|
|
12728
13151
|
null: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"
|
|
12729
13152
|
};
|
|
@@ -12787,12 +13210,12 @@ var error51 = () => {
|
|
|
12787
13210
|
};
|
|
12788
13211
|
function th_default() {
|
|
12789
13212
|
return {
|
|
12790
|
-
localeError:
|
|
13213
|
+
localeError: error52()
|
|
12791
13214
|
};
|
|
12792
13215
|
}
|
|
12793
13216
|
|
|
12794
13217
|
// node_modules/zod/v4/locales/tk.js
|
|
12795
|
-
var
|
|
13218
|
+
var error53 = () => {
|
|
12796
13219
|
const Sizable = {
|
|
12797
13220
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
12798
13221
|
file: { unit: "ba\xFDt", verb: "bolmaly" },
|
|
@@ -12832,6 +13255,8 @@ var error52 = () => {
|
|
|
12832
13255
|
json_string: "JSON setiri",
|
|
12833
13256
|
e164: "E.164 nomeri",
|
|
12834
13257
|
credit_card: "kredit kartyny\u0148 nomeri",
|
|
13258
|
+
currency_code: "wal\xFDuta kody",
|
|
13259
|
+
iban: "IBAN",
|
|
12835
13260
|
jwt: "JWT",
|
|
12836
13261
|
template_literal: "\u015Fablon"
|
|
12837
13262
|
};
|
|
@@ -12893,12 +13318,12 @@ var error52 = () => {
|
|
|
12893
13318
|
};
|
|
12894
13319
|
function tk_default() {
|
|
12895
13320
|
return {
|
|
12896
|
-
localeError:
|
|
13321
|
+
localeError: error53()
|
|
12897
13322
|
};
|
|
12898
13323
|
}
|
|
12899
13324
|
|
|
12900
13325
|
// node_modules/zod/v4/locales/tr.js
|
|
12901
|
-
var
|
|
13326
|
+
var error54 = () => {
|
|
12902
13327
|
const Sizable = {
|
|
12903
13328
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
12904
13329
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -12938,6 +13363,8 @@ var error53 = () => {
|
|
|
12938
13363
|
json_string: "JSON dizesi",
|
|
12939
13364
|
e164: "E.164 say\u0131s\u0131",
|
|
12940
13365
|
credit_card: "kredi kart\u0131 numaras\u0131",
|
|
13366
|
+
currency_code: "para birimi kodu",
|
|
13367
|
+
iban: "IBAN",
|
|
12941
13368
|
jwt: "JWT",
|
|
12942
13369
|
template_literal: "\u015Eablon dizesi"
|
|
12943
13370
|
};
|
|
@@ -13002,12 +13429,12 @@ var error53 = () => {
|
|
|
13002
13429
|
};
|
|
13003
13430
|
function tr_default() {
|
|
13004
13431
|
return {
|
|
13005
|
-
localeError:
|
|
13432
|
+
localeError: error54()
|
|
13006
13433
|
};
|
|
13007
13434
|
}
|
|
13008
13435
|
|
|
13009
13436
|
// node_modules/zod/v4/locales/uk.js
|
|
13010
|
-
var
|
|
13437
|
+
var error55 = () => {
|
|
13011
13438
|
const Sizable = {
|
|
13012
13439
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
13013
13440
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -13047,6 +13474,8 @@ var error54 = () => {
|
|
|
13047
13474
|
json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
|
|
13048
13475
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
13049
13476
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
|
|
13477
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
|
|
13478
|
+
iban: "IBAN",
|
|
13050
13479
|
jwt: "JWT",
|
|
13051
13480
|
template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
|
|
13052
13481
|
};
|
|
@@ -13114,7 +13543,7 @@ var error54 = () => {
|
|
|
13114
13543
|
};
|
|
13115
13544
|
function uk_default() {
|
|
13116
13545
|
return {
|
|
13117
|
-
localeError:
|
|
13546
|
+
localeError: error55()
|
|
13118
13547
|
};
|
|
13119
13548
|
}
|
|
13120
13549
|
|
|
@@ -13124,7 +13553,7 @@ function ua_default() {
|
|
|
13124
13553
|
}
|
|
13125
13554
|
|
|
13126
13555
|
// node_modules/zod/v4/locales/ur.js
|
|
13127
|
-
var
|
|
13556
|
+
var error56 = () => {
|
|
13128
13557
|
const Sizable = {
|
|
13129
13558
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
13130
13559
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -13164,6 +13593,8 @@ var error55 = () => {
|
|
|
13164
13593
|
json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
|
|
13165
13594
|
e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
|
|
13166
13595
|
credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
|
|
13596
|
+
currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
|
|
13597
|
+
iban: "IBAN",
|
|
13167
13598
|
jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
|
|
13168
13599
|
template_literal: "\u0627\u0646 \u067E\u0679"
|
|
13169
13600
|
};
|
|
@@ -13233,12 +13664,12 @@ var error55 = () => {
|
|
|
13233
13664
|
};
|
|
13234
13665
|
function ur_default() {
|
|
13235
13666
|
return {
|
|
13236
|
-
localeError:
|
|
13667
|
+
localeError: error56()
|
|
13237
13668
|
};
|
|
13238
13669
|
}
|
|
13239
13670
|
|
|
13240
13671
|
// node_modules/zod/v4/locales/uz.js
|
|
13241
|
-
var
|
|
13672
|
+
var error57 = () => {
|
|
13242
13673
|
const Sizable = {
|
|
13243
13674
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
13244
13675
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -13278,6 +13709,8 @@ var error56 = () => {
|
|
|
13278
13709
|
json_string: "JSON satr",
|
|
13279
13710
|
e164: "E.164 raqam",
|
|
13280
13711
|
credit_card: "kredit karta raqami",
|
|
13712
|
+
currency_code: "valyuta kodi",
|
|
13713
|
+
iban: "IBAN",
|
|
13281
13714
|
jwt: "JWT",
|
|
13282
13715
|
template_literal: "kirish"
|
|
13283
13716
|
};
|
|
@@ -13345,12 +13778,12 @@ var error56 = () => {
|
|
|
13345
13778
|
};
|
|
13346
13779
|
function uz_default() {
|
|
13347
13780
|
return {
|
|
13348
|
-
localeError:
|
|
13781
|
+
localeError: error57()
|
|
13349
13782
|
};
|
|
13350
13783
|
}
|
|
13351
13784
|
|
|
13352
13785
|
// node_modules/zod/v4/locales/vi.js
|
|
13353
|
-
var
|
|
13786
|
+
var error58 = () => {
|
|
13354
13787
|
const Sizable = {
|
|
13355
13788
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
13356
13789
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -13390,6 +13823,8 @@ var error57 = () => {
|
|
|
13390
13823
|
json_string: "chu\u1ED7i JSON",
|
|
13391
13824
|
e164: "s\u1ED1 E.164",
|
|
13392
13825
|
credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
|
|
13826
|
+
currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
|
|
13827
|
+
iban: "IBAN",
|
|
13393
13828
|
jwt: "JWT",
|
|
13394
13829
|
template_literal: "\u0111\u1EA7u v\xE0o"
|
|
13395
13830
|
};
|
|
@@ -13457,12 +13892,12 @@ var error57 = () => {
|
|
|
13457
13892
|
};
|
|
13458
13893
|
function vi_default() {
|
|
13459
13894
|
return {
|
|
13460
|
-
localeError:
|
|
13895
|
+
localeError: error58()
|
|
13461
13896
|
};
|
|
13462
13897
|
}
|
|
13463
13898
|
|
|
13464
13899
|
// node_modules/zod/v4/locales/zh-CN.js
|
|
13465
|
-
var
|
|
13900
|
+
var error59 = () => {
|
|
13466
13901
|
const Sizable = {
|
|
13467
13902
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
13468
13903
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -13502,6 +13937,8 @@ var error58 = () => {
|
|
|
13502
13937
|
json_string: "JSON\u5B57\u7B26\u4E32",
|
|
13503
13938
|
e164: "E.164\u53F7\u7801",
|
|
13504
13939
|
credit_card: "\u4FE1\u7528\u5361\u53F7",
|
|
13940
|
+
currency_code: "\u8D27\u5E01\u4EE3\u7801",
|
|
13941
|
+
iban: "IBAN",
|
|
13505
13942
|
jwt: "JWT",
|
|
13506
13943
|
template_literal: "\u8F93\u5165"
|
|
13507
13944
|
};
|
|
@@ -13570,12 +14007,12 @@ var error58 = () => {
|
|
|
13570
14007
|
};
|
|
13571
14008
|
function zh_CN_default() {
|
|
13572
14009
|
return {
|
|
13573
|
-
localeError:
|
|
14010
|
+
localeError: error59()
|
|
13574
14011
|
};
|
|
13575
14012
|
}
|
|
13576
14013
|
|
|
13577
14014
|
// node_modules/zod/v4/locales/zh-TW.js
|
|
13578
|
-
var
|
|
14015
|
+
var error60 = () => {
|
|
13579
14016
|
const Sizable = {
|
|
13580
14017
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
13581
14018
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -13615,6 +14052,8 @@ var error59 = () => {
|
|
|
13615
14052
|
json_string: "JSON \u5B57\u4E32",
|
|
13616
14053
|
e164: "E.164 \u6578\u503C",
|
|
13617
14054
|
credit_card: "\u4FE1\u7528\u5361\u865F",
|
|
14055
|
+
currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
|
|
14056
|
+
iban: "IBAN",
|
|
13618
14057
|
jwt: "JWT",
|
|
13619
14058
|
template_literal: "\u8F38\u5165"
|
|
13620
14059
|
};
|
|
@@ -13681,12 +14120,12 @@ var error59 = () => {
|
|
|
13681
14120
|
};
|
|
13682
14121
|
function zh_TW_default() {
|
|
13683
14122
|
return {
|
|
13684
|
-
localeError:
|
|
14123
|
+
localeError: error60()
|
|
13685
14124
|
};
|
|
13686
14125
|
}
|
|
13687
14126
|
|
|
13688
14127
|
// node_modules/zod/v4/locales/yo.js
|
|
13689
|
-
var
|
|
14128
|
+
var error61 = () => {
|
|
13690
14129
|
const Sizable = {
|
|
13691
14130
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
13692
14131
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -13726,6 +14165,8 @@ var error60 = () => {
|
|
|
13726
14165
|
json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
|
|
13727
14166
|
e164: "n\u1ECD\u0301mb\xE0 E.164",
|
|
13728
14167
|
credit_card: "n\u1ECDmba kaadi gbese",
|
|
14168
|
+
currency_code: "koodu ow\xF3",
|
|
14169
|
+
iban: "IBAN",
|
|
13729
14170
|
jwt: "JWT",
|
|
13730
14171
|
template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
|
|
13731
14172
|
};
|
|
@@ -13792,7 +14233,7 @@ var error60 = () => {
|
|
|
13792
14233
|
};
|
|
13793
14234
|
function yo_default() {
|
|
13794
14235
|
return {
|
|
13795
|
-
localeError:
|
|
14236
|
+
localeError: error61()
|
|
13796
14237
|
};
|
|
13797
14238
|
}
|
|
13798
14239
|
|
|
@@ -13847,8 +14288,8 @@ function registry() {
|
|
|
13847
14288
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
13848
14289
|
|
|
13849
14290
|
// node_modules/zod/v4/core/compile.js
|
|
13850
|
-
var INVALID = Symbol.for("zod.compile.invalid");
|
|
13851
|
-
var FALLBACK_FLAG = Symbol.for("zod.compile.fallback");
|
|
14291
|
+
var INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
14292
|
+
var FALLBACK_FLAG = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
13852
14293
|
var ZodCompileAsyncError = class extends Error {
|
|
13853
14294
|
constructor(message = "z.compile does not support async refinements, transforms, or checks") {
|
|
13854
14295
|
super(message);
|
|
@@ -13872,31 +14313,8 @@ function compileValidator(schema, parser) {
|
|
|
13872
14313
|
function compile(schema, options) {
|
|
13873
14314
|
try {
|
|
13874
14315
|
const parser = compileFn(schema);
|
|
13875
|
-
const clone2 =
|
|
13876
|
-
const liveRun = schema._zod.run;
|
|
13877
|
-
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
13878
|
-
const wrapped = (payload, ctx) => {
|
|
13879
|
-
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
13880
|
-
return originalRun(payload, ctx);
|
|
13881
|
-
}
|
|
13882
|
-
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
13883
|
-
return originalRun(payload, ctx);
|
|
13884
|
-
}
|
|
13885
|
-
const out = parser(payload.value);
|
|
13886
|
-
if (out !== INVALID) {
|
|
13887
|
-
payload.value = out;
|
|
13888
|
-
return payload;
|
|
13889
|
-
}
|
|
13890
|
-
if (ctx)
|
|
13891
|
-
ctx[FALLBACK_FLAG] = true;
|
|
13892
|
-
return originalRun(payload, ctx);
|
|
13893
|
-
};
|
|
13894
|
-
wrapped.__originalRun = originalRun;
|
|
13895
|
-
clone2._zod.bag.fallbackRun = originalRun;
|
|
14316
|
+
const clone2 = withParser(schema, parser);
|
|
13896
14317
|
clone2._zod.bag.validator = compileValidator(schema, parser);
|
|
13897
|
-
clone2._zod.run = wrapped;
|
|
13898
|
-
if (!liveRun.__originalRun)
|
|
13899
|
-
installCompiledUserMethods(clone2, schema, parser);
|
|
13900
14318
|
return clone2;
|
|
13901
14319
|
} catch (err) {
|
|
13902
14320
|
if (options?.strict)
|
|
@@ -13904,6 +14322,37 @@ function compile(schema, options) {
|
|
|
13904
14322
|
return schema;
|
|
13905
14323
|
}
|
|
13906
14324
|
}
|
|
14325
|
+
function withParser(schema, parser) {
|
|
14326
|
+
if (isRecursiveSchema(schema)) {
|
|
14327
|
+
throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
|
|
14328
|
+
}
|
|
14329
|
+
const clone2 = clone(schema);
|
|
14330
|
+
const liveRun = schema._zod.run;
|
|
14331
|
+
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
14332
|
+
const wrapped = (payload, ctx) => {
|
|
14333
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
14334
|
+
return originalRun(payload, ctx);
|
|
14335
|
+
}
|
|
14336
|
+
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
14337
|
+
return originalRun(payload, ctx);
|
|
14338
|
+
}
|
|
14339
|
+
const out = parser(payload.value);
|
|
14340
|
+
if (out !== INVALID) {
|
|
14341
|
+
payload.value = out;
|
|
14342
|
+
return payload;
|
|
14343
|
+
}
|
|
14344
|
+
if (ctx)
|
|
14345
|
+
ctx[FALLBACK_FLAG] = true;
|
|
14346
|
+
return originalRun(payload, ctx);
|
|
14347
|
+
};
|
|
14348
|
+
wrapped.__originalRun = originalRun;
|
|
14349
|
+
clone2._zod.bag.fallbackRun = originalRun;
|
|
14350
|
+
clone2._zod.bag.validator = parser;
|
|
14351
|
+
clone2._zod.run = wrapped;
|
|
14352
|
+
if (!liveRun.__originalRun)
|
|
14353
|
+
installCompiledUserMethods(clone2, schema, parser);
|
|
14354
|
+
return clone2;
|
|
14355
|
+
}
|
|
13907
14356
|
function installCompiledUserMethods(target, source, parser) {
|
|
13908
14357
|
const targetAny = target;
|
|
13909
14358
|
const sourceAny = source;
|
|
@@ -13940,7 +14389,8 @@ function compileFn(schema, options) {
|
|
|
13940
14389
|
const ctx = {
|
|
13941
14390
|
constants: /* @__PURE__ */ new Map(),
|
|
13942
14391
|
constantCounter: 0,
|
|
13943
|
-
varCounter: 0
|
|
14392
|
+
varCounter: 0,
|
|
14393
|
+
definite: true
|
|
13944
14394
|
};
|
|
13945
14395
|
const doc = new Doc(["input"]);
|
|
13946
14396
|
const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
|
|
@@ -13964,6 +14414,7 @@ ${code}
|
|
|
13964
14414
|
if (options?.debug) {
|
|
13965
14415
|
fn.code = fullCode;
|
|
13966
14416
|
}
|
|
14417
|
+
fn.definite = ctx.definite;
|
|
13967
14418
|
return fn;
|
|
13968
14419
|
}
|
|
13969
14420
|
function addConstant(ctx, value) {
|
|
@@ -13975,6 +14426,10 @@ function addConstant(ctx, value) {
|
|
|
13975
14426
|
ctx.constants.set(name, value);
|
|
13976
14427
|
return name;
|
|
13977
14428
|
}
|
|
14429
|
+
function addUserConstant(ctx, fn) {
|
|
14430
|
+
ctx.definite = false;
|
|
14431
|
+
return addConstant(ctx, fn);
|
|
14432
|
+
}
|
|
13978
14433
|
function newVar(ctx) {
|
|
13979
14434
|
return `v${ctx.varCounter++}`;
|
|
13980
14435
|
}
|
|
@@ -14007,6 +14462,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
14007
14462
|
}
|
|
14008
14463
|
}
|
|
14009
14464
|
function emitRuntimeIsland(doc, ctx, schema, accessor) {
|
|
14465
|
+
ctx.definite = false;
|
|
14010
14466
|
const schemaConst = addConstant(ctx, schema);
|
|
14011
14467
|
const runConst = addConstant(ctx, runtimeRun);
|
|
14012
14468
|
const outVar = newVar(ctx);
|
|
@@ -14087,6 +14543,9 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
14087
14543
|
case "property":
|
|
14088
14544
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
14089
14545
|
break;
|
|
14546
|
+
case "properties":
|
|
14547
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
14548
|
+
break;
|
|
14090
14549
|
case "overwrite": {
|
|
14091
14550
|
const newAccessor = newVar(ctx);
|
|
14092
14551
|
generateOverwriteCheck(doc, ctx, check2, currentAccessor, newAccessor);
|
|
@@ -14195,6 +14654,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
14195
14654
|
doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
|
|
14196
14655
|
}
|
|
14197
14656
|
}
|
|
14657
|
+
function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
14658
|
+
if (def.when) {
|
|
14659
|
+
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
14660
|
+
}
|
|
14661
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
14662
|
+
const shape = def.shape;
|
|
14663
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
14664
|
+
const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
|
|
14665
|
+
const inputVar = newVar(ctx);
|
|
14666
|
+
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
14667
|
+
compileChild(doc, ctx, shape[key], inputVar, false);
|
|
14668
|
+
}
|
|
14669
|
+
}
|
|
14198
14670
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
14199
14671
|
const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
|
|
14200
14672
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
@@ -14222,7 +14694,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
14222
14694
|
if (isAsyncFunction(def.fn)) {
|
|
14223
14695
|
throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
|
|
14224
14696
|
}
|
|
14225
|
-
const fnConst =
|
|
14697
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
14226
14698
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
14227
14699
|
const resVar = newVar(ctx);
|
|
14228
14700
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -14242,7 +14714,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
14242
14714
|
throwAsync();
|
|
14243
14715
|
return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
|
|
14244
14716
|
};
|
|
14245
|
-
const helperConst =
|
|
14717
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
14246
14718
|
const outVar = newVar(ctx);
|
|
14247
14719
|
doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
|
|
14248
14720
|
doc.write(`if (${outVar} === INVALID) return INVALID;`);
|
|
@@ -14276,7 +14748,7 @@ var PATTERN_IS_COMPLETE = /* @__PURE__ */ new Set([
|
|
|
14276
14748
|
"uuid",
|
|
14277
14749
|
"xid"
|
|
14278
14750
|
]);
|
|
14279
|
-
function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
14751
|
+
function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
|
|
14280
14752
|
const fmt = def.format;
|
|
14281
14753
|
if (fmt === "base64") {
|
|
14282
14754
|
const validator = addConstant(ctx, isValidBase64);
|
|
@@ -14309,9 +14781,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
14309
14781
|
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
14310
14782
|
return accessor;
|
|
14311
14783
|
}
|
|
14784
|
+
if (fmt === "iban") {
|
|
14785
|
+
const validator = addConstant(ctx, isValidIBAN);
|
|
14786
|
+
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
14787
|
+
return accessor;
|
|
14788
|
+
}
|
|
14312
14789
|
const formatDef = def;
|
|
14313
14790
|
if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
|
|
14314
|
-
const parseConst = addConstant(ctx,
|
|
14791
|
+
const parseConst = addConstant(ctx, validateURL);
|
|
14315
14792
|
const defConst = addConstant(ctx, def);
|
|
14316
14793
|
const trimVar = newVar(ctx);
|
|
14317
14794
|
const urlVar = newVar(ctx);
|
|
@@ -14326,6 +14803,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
14326
14803
|
const protocolConst = addConstant(ctx, urlProtocolOk);
|
|
14327
14804
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
14328
14805
|
}
|
|
14806
|
+
if (!needsValue)
|
|
14807
|
+
return null;
|
|
14329
14808
|
const outputVar = newVar(ctx);
|
|
14330
14809
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
|
|
14331
14810
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -14385,7 +14864,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
14385
14864
|
let typeAccessor;
|
|
14386
14865
|
switch (type) {
|
|
14387
14866
|
case "string":
|
|
14388
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
14867
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
14389
14868
|
break;
|
|
14390
14869
|
case "number":
|
|
14391
14870
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -14506,12 +14985,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
14506
14985
|
return null;
|
|
14507
14986
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
14508
14987
|
}
|
|
14509
|
-
function generateStringCheck(doc, ctx, schema, accessor) {
|
|
14988
|
+
function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
14510
14989
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
14511
14990
|
const def = schema._zod.def;
|
|
14512
14991
|
if (def.format === void 0)
|
|
14513
14992
|
return accessor;
|
|
14514
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
14993
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
14515
14994
|
}
|
|
14516
14995
|
function generateNumberCheck(doc, schema, accessor) {
|
|
14517
14996
|
doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
|
|
@@ -14629,7 +15108,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
14629
15108
|
}
|
|
14630
15109
|
}
|
|
14631
15110
|
const outputVar = newVar(ctx);
|
|
14632
|
-
const hasConditionalKeys = allKeys.some((k) =>
|
|
15111
|
+
const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
|
|
14633
15112
|
if (!buildsValue) {
|
|
14634
15113
|
if (unknownKeysMode === "schema") {
|
|
14635
15114
|
const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
|
|
@@ -14656,7 +15135,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
14656
15135
|
const out = propOutputs.get(k);
|
|
14657
15136
|
if (dropsWhenAbsent(propShape[k])) {
|
|
14658
15137
|
doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
14659
|
-
} else if (
|
|
15138
|
+
} else if (mayOmitUndefined(propShape[k])) {
|
|
14660
15139
|
doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
14661
15140
|
} else {
|
|
14662
15141
|
doc.write(`${outputVar}[${kx}] = ${out};`);
|
|
@@ -14789,6 +15268,9 @@ function fastPathAcceptsAbsence(schema) {
|
|
|
14789
15268
|
function dropsWhenAbsent(schema) {
|
|
14790
15269
|
return schema._zod.optin === "optional" && schema._zod.optout === "optional";
|
|
14791
15270
|
}
|
|
15271
|
+
function mayOmitUndefined(schema) {
|
|
15272
|
+
return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
|
|
15273
|
+
}
|
|
14792
15274
|
function mayOutputUndefined(schema) {
|
|
14793
15275
|
const def = schema._zod.def;
|
|
14794
15276
|
switch (def.type) {
|
|
@@ -14845,9 +15327,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
14845
15327
|
doc.write(`}`);
|
|
14846
15328
|
return outputVar;
|
|
14847
15329
|
}
|
|
15330
|
+
function generateSizeGate(doc, schema, size) {
|
|
15331
|
+
for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
|
|
15332
|
+
doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
|
|
15333
|
+
}
|
|
15334
|
+
}
|
|
14848
15335
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
14849
15336
|
const def = schema._zod.def;
|
|
14850
15337
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
15338
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
14851
15339
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
14852
15340
|
const iVar = newVar(ctx);
|
|
14853
15341
|
const elemVar = newVar(ctx);
|
|
@@ -15131,6 +15619,7 @@ function literalEquality(ctx, accessor, value) {
|
|
|
15131
15619
|
}
|
|
15132
15620
|
function generateIntersectionCheck(doc, ctx, schema, accessor) {
|
|
15133
15621
|
const def = schema._zod.def;
|
|
15622
|
+
ctx.definite = false;
|
|
15134
15623
|
const leftOutput = compileChild(doc, ctx, def.left, accessor);
|
|
15135
15624
|
const rightOutput = compileChild(doc, ctx, def.right, accessor);
|
|
15136
15625
|
const mergeConst = addConstant(ctx, mergeValues);
|
|
@@ -15184,14 +15673,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
15184
15673
|
const keyIsBareString = keyDef.type === "string" && keyDef.format === void 0 && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
|
|
15185
15674
|
if (!keyIsBareString) {
|
|
15186
15675
|
const isLoose = def.mode === "loose";
|
|
15187
|
-
const
|
|
15676
|
+
const keyFn = compileFn(def.keyType);
|
|
15677
|
+
if (keyFn.definite === false)
|
|
15678
|
+
ctx.definite = false;
|
|
15679
|
+
const keyFast = addConstant(ctx, keyFn);
|
|
15188
15680
|
const numericConst = addConstant(ctx, number);
|
|
15189
|
-
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
15190
15681
|
const outKeyVar = newVar(ctx);
|
|
15191
|
-
doc
|
|
15192
|
-
doc.indented((d) => {
|
|
15193
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
15194
|
-
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
15682
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
15195
15683
|
d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
|
|
15196
15684
|
d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
|
|
15197
15685
|
if (isLoose) {
|
|
@@ -15205,21 +15693,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
15205
15693
|
const valOutput = compileChild(d, ctx, def.valueType, valueVar);
|
|
15206
15694
|
d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
|
|
15207
15695
|
});
|
|
15208
|
-
doc.write(`}`);
|
|
15209
15696
|
return outputVar;
|
|
15210
15697
|
}
|
|
15211
|
-
|
|
15212
|
-
doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
|
|
15213
|
-
doc.indented((d) => {
|
|
15214
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
15215
|
-
d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
|
|
15216
|
-
d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
|
|
15698
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
15217
15699
|
d.write(`const ${valVar} = ${accessor}[${kVar}];`);
|
|
15218
15700
|
const valOutput = compileChild(d, ctx, def.valueType, valVar);
|
|
15219
15701
|
d.write(`${outputVar}[${kVar}] = ${valOutput};`);
|
|
15702
|
+
}, `return INVALID;`);
|
|
15703
|
+
return outputVar;
|
|
15704
|
+
}
|
|
15705
|
+
function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
15706
|
+
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
15707
|
+
const symsVar = newVar(ctx);
|
|
15708
|
+
const keysVar = newVar(ctx);
|
|
15709
|
+
const iVar = newVar(ctx);
|
|
15710
|
+
doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
|
|
15711
|
+
doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
|
|
15712
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
|
|
15713
|
+
doc.indented((d) => {
|
|
15714
|
+
d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
|
|
15715
|
+
d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
15716
|
+
body(d);
|
|
15717
|
+
});
|
|
15718
|
+
doc.write(`}`);
|
|
15719
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
|
|
15720
|
+
doc.indented((d) => {
|
|
15721
|
+
d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
|
|
15722
|
+
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
15723
|
+
if (onSymbol)
|
|
15724
|
+
d.write(onSymbol);
|
|
15725
|
+
else
|
|
15726
|
+
body(d);
|
|
15220
15727
|
});
|
|
15221
15728
|
doc.write(`}`);
|
|
15222
|
-
return outputVar;
|
|
15223
15729
|
}
|
|
15224
15730
|
function literalPropertyKey(ctx, key) {
|
|
15225
15731
|
if (typeof key === "string")
|
|
@@ -15229,6 +15735,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
15229
15735
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
15230
15736
|
const def = schema._zod.def;
|
|
15231
15737
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
15738
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
15232
15739
|
const outputVar = newVar(ctx);
|
|
15233
15740
|
const kVar = newVar(ctx);
|
|
15234
15741
|
const valVar = newVar(ctx);
|
|
@@ -15245,6 +15752,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
15245
15752
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
15246
15753
|
const def = schema._zod.def;
|
|
15247
15754
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
15755
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
15248
15756
|
const outputVar = newVar(ctx);
|
|
15249
15757
|
const valVar = newVar(ctx);
|
|
15250
15758
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -15272,7 +15780,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
|
|
|
15272
15780
|
}
|
|
15273
15781
|
function generateLazyCheck(doc, ctx, schema, accessor) {
|
|
15274
15782
|
const def = schema._zod.def;
|
|
15275
|
-
const getterConst =
|
|
15783
|
+
const getterConst = addUserConstant(ctx, def.getter);
|
|
15276
15784
|
const cacheConst = addConstant(ctx, { parser: null });
|
|
15277
15785
|
doc.write(`if (!${cacheConst}.parser) {`);
|
|
15278
15786
|
doc.indented((d) => {
|
|
@@ -15305,7 +15813,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
|
|
|
15305
15813
|
return INVALID;
|
|
15306
15814
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
15307
15815
|
};
|
|
15308
|
-
const helperConst =
|
|
15816
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
15309
15817
|
const transformedVar = newVar(ctx);
|
|
15310
15818
|
doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
|
|
15311
15819
|
doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
|
|
@@ -15323,7 +15831,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
|
|
|
15323
15831
|
if (isAsyncFunction(def.fn)) {
|
|
15324
15832
|
throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
|
|
15325
15833
|
}
|
|
15326
|
-
const fnConst =
|
|
15834
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
15327
15835
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
15328
15836
|
const resVar = newVar(ctx);
|
|
15329
15837
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -15356,7 +15864,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
|
|
|
15356
15864
|
});
|
|
15357
15865
|
doc.write(`})();`);
|
|
15358
15866
|
const innerConst = addConstant(ctx, def.innerType);
|
|
15359
|
-
const catchConst =
|
|
15867
|
+
const catchConst = addUserConstant(ctx, def.catchValue);
|
|
15360
15868
|
const catchHelperConst = addConstant(ctx, runtimeCatch);
|
|
15361
15869
|
doc.write(`if (${outputVar} === INVALID) {`);
|
|
15362
15870
|
doc.indented((d) => {
|
|
@@ -15380,7 +15888,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
15380
15888
|
return INVALID;
|
|
15381
15889
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
15382
15890
|
};
|
|
15383
|
-
const helperConst =
|
|
15891
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
15384
15892
|
const outputVar = newVar(ctx);
|
|
15385
15893
|
doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
|
|
15386
15894
|
doc.write(`if (${outputVar} === INVALID) return INVALID;`);
|
|
@@ -15390,20 +15898,18 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
15390
15898
|
}
|
|
15391
15899
|
|
|
15392
15900
|
// node_modules/zod/v4/core/api.js
|
|
15901
|
+
function snapshotChecks(def) {
|
|
15902
|
+
if (def.checks)
|
|
15903
|
+
def.checks = [...def.checks];
|
|
15904
|
+
return def;
|
|
15905
|
+
}
|
|
15393
15906
|
// @__NO_SIDE_EFFECTS__
|
|
15394
15907
|
function _string(Class2, params) {
|
|
15395
|
-
return new Class2({
|
|
15396
|
-
type: "string",
|
|
15397
|
-
...normalizeParams(params)
|
|
15398
|
-
});
|
|
15908
|
+
return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
|
|
15399
15909
|
}
|
|
15400
15910
|
// @__NO_SIDE_EFFECTS__
|
|
15401
15911
|
function _coercedString(Class2, params) {
|
|
15402
|
-
return new Class2({
|
|
15403
|
-
type: "string",
|
|
15404
|
-
coerce: true,
|
|
15405
|
-
...normalizeParams(params)
|
|
15406
|
-
});
|
|
15912
|
+
return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
|
|
15407
15913
|
}
|
|
15408
15914
|
// @__NO_SIDE_EFFECTS__
|
|
15409
15915
|
function _email(Class2, params) {
|
|
@@ -15639,6 +16145,16 @@ function _creditCard(Class2, params) {
|
|
|
15639
16145
|
});
|
|
15640
16146
|
}
|
|
15641
16147
|
// @__NO_SIDE_EFFECTS__
|
|
16148
|
+
function _iban(Class2, params) {
|
|
16149
|
+
return new Class2({
|
|
16150
|
+
type: "string",
|
|
16151
|
+
format: "iban",
|
|
16152
|
+
check: "string_format",
|
|
16153
|
+
abort: false,
|
|
16154
|
+
...normalizeParams(params)
|
|
16155
|
+
});
|
|
16156
|
+
}
|
|
16157
|
+
// @__NO_SIDE_EFFECTS__
|
|
15642
16158
|
function _jwt(Class2, params) {
|
|
15643
16159
|
return new Class2({
|
|
15644
16160
|
type: "string",
|
|
@@ -15697,20 +16213,11 @@ function _isoDuration(Class2, params) {
|
|
|
15697
16213
|
}
|
|
15698
16214
|
// @__NO_SIDE_EFFECTS__
|
|
15699
16215
|
function _number(Class2, params) {
|
|
15700
|
-
return new Class2({
|
|
15701
|
-
type: "number",
|
|
15702
|
-
checks: [],
|
|
15703
|
-
...normalizeParams(params)
|
|
15704
|
-
});
|
|
16216
|
+
return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
|
|
15705
16217
|
}
|
|
15706
16218
|
// @__NO_SIDE_EFFECTS__
|
|
15707
16219
|
function _coercedNumber(Class2, params) {
|
|
15708
|
-
return new Class2({
|
|
15709
|
-
type: "number",
|
|
15710
|
-
coerce: true,
|
|
15711
|
-
checks: [],
|
|
15712
|
-
...normalizeParams(params)
|
|
15713
|
-
});
|
|
16220
|
+
return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
|
|
15714
16221
|
}
|
|
15715
16222
|
// @__NO_SIDE_EFFECTS__
|
|
15716
16223
|
function _int(Class2, params) {
|
|
@@ -16052,8 +16559,12 @@ function _property(property, schema, params) {
|
|
|
16052
16559
|
});
|
|
16053
16560
|
}
|
|
16054
16561
|
// @__NO_SIDE_EFFECTS__
|
|
16055
|
-
function _properties(shape) {
|
|
16056
|
-
return
|
|
16562
|
+
function _properties(shape, params) {
|
|
16563
|
+
return new $ZodCheckProperties({
|
|
16564
|
+
check: "properties",
|
|
16565
|
+
shape,
|
|
16566
|
+
...normalizeParams(params)
|
|
16567
|
+
});
|
|
16057
16568
|
}
|
|
16058
16569
|
// @__NO_SIDE_EFFECTS__
|
|
16059
16570
|
function _mime(types, params) {
|
|
@@ -16490,7 +17001,7 @@ function handleUnrepresentable(schema, ctx, json2, params, message) {
|
|
|
16490
17001
|
Object.assign(json2, result);
|
|
16491
17002
|
return true;
|
|
16492
17003
|
}
|
|
16493
|
-
function
|
|
17004
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
16494
17005
|
var _a3;
|
|
16495
17006
|
const def = schema._zod.def;
|
|
16496
17007
|
const seen = ctx.seen.get(schema);
|
|
@@ -16529,7 +17040,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
16529
17040
|
if (parent) {
|
|
16530
17041
|
if (!result.ref)
|
|
16531
17042
|
result.ref = parent;
|
|
16532
|
-
|
|
17043
|
+
processSchema(parent, ctx, params);
|
|
16533
17044
|
ctx.seen.get(parent).isParent = true;
|
|
16534
17045
|
}
|
|
16535
17046
|
}
|
|
@@ -16636,7 +17147,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16636
17147
|
if (seen.count > 1) {
|
|
16637
17148
|
if (ctx.reused === "ref") {
|
|
16638
17149
|
extractToDef(entry);
|
|
16639
|
-
continue;
|
|
16640
17150
|
}
|
|
16641
17151
|
}
|
|
16642
17152
|
}
|
|
@@ -16964,19 +17474,107 @@ function isTransforming(_schema, _ctx) {
|
|
|
16964
17474
|
}
|
|
16965
17475
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
16966
17476
|
const ctx = initializeContext({ ...params, processors });
|
|
16967
|
-
|
|
17477
|
+
processSchema(schema, ctx);
|
|
16968
17478
|
extractDefs(ctx, schema);
|
|
16969
17479
|
return finalize(ctx, schema);
|
|
16970
17480
|
};
|
|
16971
17481
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
16972
17482
|
const { libraryOptions, target } = params ?? {};
|
|
16973
17483
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
16974
|
-
|
|
17484
|
+
processSchema(schema, ctx);
|
|
16975
17485
|
extractDefs(ctx, schema);
|
|
16976
17486
|
return finalize(ctx, schema);
|
|
16977
17487
|
};
|
|
16978
17488
|
|
|
16979
17489
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
17490
|
+
var narrowMin = (agg, key, value) => {
|
|
17491
|
+
if (agg[key] === void 0 || value > agg[key])
|
|
17492
|
+
agg[key] = value;
|
|
17493
|
+
};
|
|
17494
|
+
var narrowMax = (agg, key, value) => {
|
|
17495
|
+
if (agg[key] === void 0 || value < agg[key])
|
|
17496
|
+
agg[key] = value;
|
|
17497
|
+
};
|
|
17498
|
+
var narrowBoth = (agg, value) => {
|
|
17499
|
+
narrowMin(agg, "minimum", value);
|
|
17500
|
+
narrowMax(agg, "maximum", value);
|
|
17501
|
+
};
|
|
17502
|
+
var addDivisor = (agg, value) => {
|
|
17503
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
17504
|
+
if (!agg.multipleOf.includes(value))
|
|
17505
|
+
agg.multipleOf.push(value);
|
|
17506
|
+
};
|
|
17507
|
+
var addPattern = (agg, pattern) => {
|
|
17508
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
17509
|
+
agg.patterns.add(pattern);
|
|
17510
|
+
};
|
|
17511
|
+
var intersectMime = (agg, mime) => {
|
|
17512
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
17513
|
+
};
|
|
17514
|
+
var setFormat = (agg, format) => {
|
|
17515
|
+
agg.format = format;
|
|
17516
|
+
if (format.includes("int"))
|
|
17517
|
+
agg.isInt = true;
|
|
17518
|
+
};
|
|
17519
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
17520
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
17521
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
17522
|
+
setFormat(agg, def.format);
|
|
17523
|
+
const [minimum, maximum] = ranges[def.format];
|
|
17524
|
+
narrowMin(agg, "minimum", minimum);
|
|
17525
|
+
narrowMax(agg, "maximum", maximum);
|
|
17526
|
+
};
|
|
17527
|
+
var contributors = {
|
|
17528
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
17529
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
17530
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
17531
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
17532
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
17533
|
+
min_length: minContributor,
|
|
17534
|
+
max_length: maxContributor,
|
|
17535
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
17536
|
+
min_size: minContributor,
|
|
17537
|
+
max_size: maxContributor,
|
|
17538
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
17539
|
+
string_format: (agg, def) => {
|
|
17540
|
+
setFormat(agg, def.format);
|
|
17541
|
+
if (def.pattern)
|
|
17542
|
+
addPattern(agg, def.pattern);
|
|
17543
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
17544
|
+
agg.contentEncoding = def.format;
|
|
17545
|
+
if (def.local || def.precision === -1)
|
|
17546
|
+
agg.laxFormat = true;
|
|
17547
|
+
},
|
|
17548
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
17549
|
+
};
|
|
17550
|
+
function aggregateChecks(schema) {
|
|
17551
|
+
const agg = {};
|
|
17552
|
+
const def = schema._zod.def;
|
|
17553
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
17554
|
+
for (const ch of list)
|
|
17555
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
17556
|
+
const bag = schema._zod.bag;
|
|
17557
|
+
if (bag.minimum !== void 0)
|
|
17558
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
17559
|
+
if (bag.exclusiveMinimum !== void 0)
|
|
17560
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
17561
|
+
if (bag.maximum !== void 0)
|
|
17562
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
17563
|
+
if (bag.exclusiveMaximum !== void 0)
|
|
17564
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
17565
|
+
if (bag.multipleOf !== void 0)
|
|
17566
|
+
addDivisor(agg, bag.multipleOf);
|
|
17567
|
+
if (bag.format !== void 0) {
|
|
17568
|
+
agg.format ?? (agg.format = bag.format);
|
|
17569
|
+
if (bag.format.includes("int"))
|
|
17570
|
+
agg.isInt = true;
|
|
17571
|
+
}
|
|
17572
|
+
if (bag.mime)
|
|
17573
|
+
intersectMime(agg, bag.mime);
|
|
17574
|
+
for (const pattern of bag.patterns ?? [])
|
|
17575
|
+
addPattern(agg, pattern);
|
|
17576
|
+
return agg;
|
|
17577
|
+
}
|
|
16980
17578
|
var formatMap = {
|
|
16981
17579
|
guid: "uuid",
|
|
16982
17580
|
url: "uri",
|
|
@@ -16985,10 +17583,15 @@ var formatMap = {
|
|
|
16985
17583
|
regex: ""
|
|
16986
17584
|
// do not set
|
|
16987
17585
|
};
|
|
17586
|
+
var exactPatterns = /* @__PURE__ */ new Map([
|
|
17587
|
+
[base64Charset, base64],
|
|
17588
|
+
[base64urlCharset, base64url]
|
|
17589
|
+
]);
|
|
17590
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
16988
17591
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
16989
17592
|
const json2 = _json;
|
|
16990
17593
|
json2.type = "string";
|
|
16991
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
17594
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
16992
17595
|
if (typeof minimum === "number")
|
|
16993
17596
|
json2.minLength = minimum;
|
|
16994
17597
|
if (typeof maximum === "number")
|
|
@@ -17004,7 +17607,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
17004
17607
|
if (contentEncoding)
|
|
17005
17608
|
json2.contentEncoding = contentEncoding;
|
|
17006
17609
|
if (patterns && patterns.size > 0) {
|
|
17007
|
-
const patternList = [...patterns];
|
|
17610
|
+
const patternList = [...patterns].map(exactPattern);
|
|
17008
17611
|
if (patternList.length === 1)
|
|
17009
17612
|
json2.pattern = patternList[0].source;
|
|
17010
17613
|
else if (patternList.length > 1) {
|
|
@@ -17019,11 +17622,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
17019
17622
|
};
|
|
17020
17623
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
17021
17624
|
const json2 = _json;
|
|
17022
|
-
const { minimum, maximum,
|
|
17023
|
-
|
|
17024
|
-
json2.type = "integer";
|
|
17025
|
-
else
|
|
17026
|
-
json2.type = "number";
|
|
17625
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
17626
|
+
json2.type = isInt ? "integer" : "number";
|
|
17027
17627
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
17028
17628
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
17029
17629
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -17047,11 +17647,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
17047
17647
|
} else if (typeof maximum === "number") {
|
|
17048
17648
|
json2.maximum = maximum;
|
|
17049
17649
|
}
|
|
17050
|
-
if (
|
|
17051
|
-
|
|
17052
|
-
|
|
17053
|
-
|
|
17054
|
-
|
|
17650
|
+
if (multipleOf) {
|
|
17651
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
17652
|
+
for (const divisor of multipleOf) {
|
|
17653
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
17654
|
+
divisors.add(Math.abs(divisor));
|
|
17655
|
+
else
|
|
17656
|
+
handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
17657
|
+
}
|
|
17658
|
+
const [first, ...rest] = divisors;
|
|
17659
|
+
if (first !== void 0)
|
|
17660
|
+
json2.multipleOf = first;
|
|
17661
|
+
if (rest.length)
|
|
17662
|
+
json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
17055
17663
|
}
|
|
17056
17664
|
};
|
|
17057
17665
|
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
@@ -17154,27 +17762,22 @@ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
|
17154
17762
|
};
|
|
17155
17763
|
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
17156
17764
|
const _json = json2;
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
};
|
|
17162
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
17765
|
+
_json.type = "string";
|
|
17766
|
+
_json.format = "binary";
|
|
17767
|
+
_json.contentEncoding = "binary";
|
|
17768
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
17163
17769
|
if (minimum !== void 0)
|
|
17164
|
-
|
|
17770
|
+
_json.minLength = minimum;
|
|
17165
17771
|
if (maximum !== void 0)
|
|
17166
|
-
|
|
17167
|
-
if (mime)
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
}
|
|
17175
|
-
} else {
|
|
17176
|
-
Object.assign(_json, file2);
|
|
17177
|
-
}
|
|
17772
|
+
_json.maxLength = maximum;
|
|
17773
|
+
if (!mime)
|
|
17774
|
+
return;
|
|
17775
|
+
if (mime.length === 0)
|
|
17776
|
+
_json.not = {};
|
|
17777
|
+
else if (mime.length === 1)
|
|
17778
|
+
_json.contentMediaType = mime[0];
|
|
17779
|
+
else
|
|
17780
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
17178
17781
|
};
|
|
17179
17782
|
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
17180
17783
|
json2.type = "boolean";
|
|
@@ -17197,13 +17800,13 @@ var setProcessor = (schema, ctx, json2, params) => {
|
|
|
17197
17800
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
17198
17801
|
const json2 = _json;
|
|
17199
17802
|
const def = schema._zod.def;
|
|
17200
|
-
const { minimum, maximum } = schema
|
|
17803
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
17201
17804
|
if (typeof minimum === "number")
|
|
17202
17805
|
json2.minItems = minimum;
|
|
17203
17806
|
if (typeof maximum === "number")
|
|
17204
17807
|
json2.maxItems = maximum;
|
|
17205
17808
|
json2.type = "array";
|
|
17206
|
-
json2.items =
|
|
17809
|
+
json2.items = processSchema(def.element, ctx, {
|
|
17207
17810
|
...params,
|
|
17208
17811
|
path: [...params.path, "items"]
|
|
17209
17812
|
});
|
|
@@ -17229,22 +17832,20 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
17229
17832
|
json2.type = "object";
|
|
17230
17833
|
json2.properties = {};
|
|
17231
17834
|
for (const key in shape) {
|
|
17232
|
-
assignProp(json2.properties, key,
|
|
17835
|
+
assignProp(json2.properties, key, processSchema(shape[key], ctx, {
|
|
17233
17836
|
...params,
|
|
17234
17837
|
path: [...params.path, "properties", key]
|
|
17235
17838
|
}));
|
|
17236
17839
|
}
|
|
17237
|
-
const
|
|
17238
|
-
const
|
|
17840
|
+
const requiredKeys = [];
|
|
17841
|
+
for (const key of Object.keys(shape)) {
|
|
17239
17842
|
const field = def.shape[key];
|
|
17240
|
-
if (ctx.io === "input") {
|
|
17241
|
-
|
|
17242
|
-
} else {
|
|
17243
|
-
return field._zod.optout === void 0;
|
|
17843
|
+
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
|
|
17844
|
+
requiredKeys.push(key);
|
|
17244
17845
|
}
|
|
17245
|
-
}
|
|
17246
|
-
if (requiredKeys.
|
|
17247
|
-
json2.required =
|
|
17846
|
+
}
|
|
17847
|
+
if (requiredKeys.length > 0) {
|
|
17848
|
+
json2.required = requiredKeys;
|
|
17248
17849
|
}
|
|
17249
17850
|
if (def.catchall?._zod.def.type === "never") {
|
|
17250
17851
|
json2.additionalProperties = false;
|
|
@@ -17252,7 +17853,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
17252
17853
|
if (ctx.io === "output")
|
|
17253
17854
|
json2.additionalProperties = false;
|
|
17254
17855
|
} else if (def.catchall) {
|
|
17255
|
-
json2.additionalProperties =
|
|
17856
|
+
json2.additionalProperties = processSchema(def.catchall, ctx, {
|
|
17256
17857
|
...params,
|
|
17257
17858
|
path: [...params.path, "additionalProperties"]
|
|
17258
17859
|
});
|
|
@@ -17261,7 +17862,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
17261
17862
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
17262
17863
|
const def = schema._zod.def;
|
|
17263
17864
|
const isExclusive = def.inclusive === false;
|
|
17264
|
-
const options = def.options.map((x, i) =>
|
|
17865
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
17265
17866
|
...params,
|
|
17266
17867
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
17267
17868
|
}));
|
|
@@ -17273,11 +17874,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
17273
17874
|
};
|
|
17274
17875
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
17275
17876
|
const def = schema._zod.def;
|
|
17276
|
-
const a =
|
|
17877
|
+
const a = processSchema(def.left, ctx, {
|
|
17277
17878
|
...params,
|
|
17278
17879
|
path: [...params.path, "allOf", 0]
|
|
17279
17880
|
});
|
|
17280
|
-
const b =
|
|
17881
|
+
const b = processSchema(def.right, ctx, {
|
|
17281
17882
|
...params,
|
|
17282
17883
|
path: [...params.path, "allOf", 1]
|
|
17283
17884
|
});
|
|
@@ -17295,11 +17896,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
17295
17896
|
json2.type = "array";
|
|
17296
17897
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
17297
17898
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
17298
|
-
const prefixItems = def.items.map((x, i) =>
|
|
17899
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
17299
17900
|
...params,
|
|
17300
17901
|
path: [...params.path, prefixPath, i]
|
|
17301
17902
|
}));
|
|
17302
|
-
const rest = def.rest ?
|
|
17903
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
17303
17904
|
...params,
|
|
17304
17905
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
17305
17906
|
}) : null;
|
|
@@ -17347,7 +17948,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
17347
17948
|
if (isClosed)
|
|
17348
17949
|
json2.maxItems = maxItems;
|
|
17349
17950
|
}
|
|
17350
|
-
const { minimum, maximum } = schema
|
|
17951
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
17351
17952
|
if (typeof minimum === "number")
|
|
17352
17953
|
json2.minItems = minimum;
|
|
17353
17954
|
if (typeof maximum === "number")
|
|
@@ -17421,20 +18022,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
17421
18022
|
const def = schema._zod.def;
|
|
17422
18023
|
json2.type = "object";
|
|
17423
18024
|
const keyType = def.keyType;
|
|
17424
|
-
const
|
|
17425
|
-
const patterns = keyBag?.patterns;
|
|
18025
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
17426
18026
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
17427
|
-
const valueSchema =
|
|
18027
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
17428
18028
|
...params,
|
|
17429
18029
|
path: [...params.path, "patternProperties", "*"]
|
|
17430
18030
|
});
|
|
17431
18031
|
json2.patternProperties = {};
|
|
17432
18032
|
for (const pattern of patterns) {
|
|
17433
|
-
assignProp(json2.patternProperties, pattern.source, valueSchema);
|
|
18033
|
+
assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
17434
18034
|
}
|
|
17435
18035
|
} else {
|
|
17436
18036
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
17437
|
-
json2.propertyNames =
|
|
18037
|
+
json2.propertyNames = processSchema(def.keyType, ctx, {
|
|
17438
18038
|
...params,
|
|
17439
18039
|
path: [...params.path, "propertyNames"]
|
|
17440
18040
|
});
|
|
@@ -17446,7 +18046,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
17446
18046
|
}
|
|
17447
18047
|
pending.push(schema);
|
|
17448
18048
|
}
|
|
17449
|
-
json2.additionalProperties =
|
|
18049
|
+
json2.additionalProperties = processSchema(def.valueType, ctx, {
|
|
17450
18050
|
...params,
|
|
17451
18051
|
path: [...params.path, "additionalProperties"]
|
|
17452
18052
|
});
|
|
@@ -17462,7 +18062,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
17462
18062
|
};
|
|
17463
18063
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
17464
18064
|
const def = schema._zod.def;
|
|
17465
|
-
const inner =
|
|
18065
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
17466
18066
|
const seen = ctx.seen.get(schema);
|
|
17467
18067
|
if (ctx.target === "openapi-3.0") {
|
|
17468
18068
|
seen.ref = def.innerType;
|
|
@@ -17473,11 +18073,11 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
17473
18073
|
};
|
|
17474
18074
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
17475
18075
|
const def = schema._zod.def;
|
|
17476
|
-
|
|
18076
|
+
processSchema(def.innerType, ctx, params);
|
|
17477
18077
|
const seen = ctx.seen.get(schema);
|
|
17478
18078
|
seen.ref = def.innerType;
|
|
17479
18079
|
};
|
|
17480
|
-
var UNREPRESENTABLE_DEFAULT = Symbol();
|
|
18080
|
+
var UNREPRESENTABLE_DEFAULT = /* @__PURE__ */ Symbol();
|
|
17481
18081
|
function serializeDefaultValue(value, schema, ctx, json2, params) {
|
|
17482
18082
|
let unrepresentable = false;
|
|
17483
18083
|
const serialized = JSON.stringify(value, (_, val) => {
|
|
@@ -17493,7 +18093,7 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
|
|
|
17493
18093
|
}
|
|
17494
18094
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
17495
18095
|
const def = schema._zod.def;
|
|
17496
|
-
|
|
18096
|
+
processSchema(def.innerType, ctx, params);
|
|
17497
18097
|
const seen = ctx.seen.get(schema);
|
|
17498
18098
|
seen.ref = def.innerType;
|
|
17499
18099
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
|
|
@@ -17502,7 +18102,7 @@ var defaultProcessor = (schema, ctx, json2, params) => {
|
|
|
17502
18102
|
};
|
|
17503
18103
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
17504
18104
|
const def = schema._zod.def;
|
|
17505
|
-
|
|
18105
|
+
processSchema(def.innerType, ctx, params);
|
|
17506
18106
|
const seen = ctx.seen.get(schema);
|
|
17507
18107
|
seen.ref = def.innerType;
|
|
17508
18108
|
if (ctx.io !== "input")
|
|
@@ -17513,7 +18113,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
17513
18113
|
};
|
|
17514
18114
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
17515
18115
|
const def = schema._zod.def;
|
|
17516
|
-
|
|
18116
|
+
processSchema(def.innerType, ctx, params);
|
|
17517
18117
|
const seen = ctx.seen.get(schema);
|
|
17518
18118
|
seen.ref = def.innerType;
|
|
17519
18119
|
let catchValue;
|
|
@@ -17529,32 +18129,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
17529
18129
|
const def = schema._zod.def;
|
|
17530
18130
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
17531
18131
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
17532
|
-
|
|
18132
|
+
processSchema(innerType, ctx, params);
|
|
17533
18133
|
const seen = ctx.seen.get(schema);
|
|
17534
18134
|
seen.ref = innerType;
|
|
17535
18135
|
};
|
|
17536
18136
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
17537
18137
|
const def = schema._zod.def;
|
|
17538
|
-
|
|
18138
|
+
processSchema(def.innerType, ctx, params);
|
|
17539
18139
|
const seen = ctx.seen.get(schema);
|
|
17540
18140
|
seen.ref = def.innerType;
|
|
17541
18141
|
json2.readOnly = true;
|
|
17542
18142
|
};
|
|
17543
18143
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
17544
18144
|
const def = schema._zod.def;
|
|
17545
|
-
|
|
18145
|
+
processSchema(def.innerType, ctx, params);
|
|
17546
18146
|
const seen = ctx.seen.get(schema);
|
|
17547
18147
|
seen.ref = def.innerType;
|
|
17548
18148
|
};
|
|
17549
18149
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
17550
18150
|
const def = schema._zod.def;
|
|
17551
|
-
|
|
18151
|
+
processSchema(def.innerType, ctx, params);
|
|
17552
18152
|
const seen = ctx.seen.get(schema);
|
|
17553
18153
|
seen.ref = def.innerType;
|
|
17554
18154
|
};
|
|
17555
18155
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
17556
18156
|
const innerType = schema._zod.innerType;
|
|
17557
|
-
|
|
18157
|
+
processSchema(innerType, ctx, params);
|
|
17558
18158
|
const seen = ctx.seen.get(schema);
|
|
17559
18159
|
seen.ref = innerType;
|
|
17560
18160
|
};
|
|
@@ -17606,7 +18206,7 @@ function toJSONSchema(input2, params) {
|
|
|
17606
18206
|
const defs = {};
|
|
17607
18207
|
for (const entry of registry2._idmap.entries()) {
|
|
17608
18208
|
const [_, schema] = entry;
|
|
17609
|
-
|
|
18209
|
+
processSchema(schema, ctx2);
|
|
17610
18210
|
}
|
|
17611
18211
|
const schemas = {};
|
|
17612
18212
|
const external = {
|
|
@@ -17629,7 +18229,7 @@ function toJSONSchema(input2, params) {
|
|
|
17629
18229
|
return { schemas };
|
|
17630
18230
|
}
|
|
17631
18231
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
17632
|
-
|
|
18232
|
+
processSchema(input2, ctx);
|
|
17633
18233
|
extractDefs(ctx, input2);
|
|
17634
18234
|
return finalize(ctx, input2);
|
|
17635
18235
|
}
|
|
@@ -17688,7 +18288,7 @@ var JSONSchemaGenerator = class {
|
|
|
17688
18288
|
* This must be called before emit().
|
|
17689
18289
|
*/
|
|
17690
18290
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
17691
|
-
return
|
|
18291
|
+
return processSchema(schema, this.ctx, _params);
|
|
17692
18292
|
}
|
|
17693
18293
|
/**
|
|
17694
18294
|
* Emit the final JSON Schema after processing.
|
|
@@ -17745,12 +18345,14 @@ __export(schemas_exports2, {
|
|
|
17745
18345
|
ZodFile: () => ZodFile,
|
|
17746
18346
|
ZodFunction: () => ZodFunction,
|
|
17747
18347
|
ZodGUID: () => ZodGUID,
|
|
18348
|
+
ZodIBAN: () => ZodIBAN,
|
|
17748
18349
|
ZodIPv4: () => ZodIPv4,
|
|
17749
18350
|
ZodIPv6: () => ZodIPv6,
|
|
17750
18351
|
ZodISODate: () => ZodISODate,
|
|
17751
18352
|
ZodISODateTime: () => ZodISODateTime,
|
|
17752
18353
|
ZodISODuration: () => ZodISODuration,
|
|
17753
18354
|
ZodISOTime: () => ZodISOTime,
|
|
18355
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
17754
18356
|
ZodIntersection: () => ZodIntersection,
|
|
17755
18357
|
ZodJWT: () => ZodJWT,
|
|
17756
18358
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -17809,6 +18411,7 @@ __export(schemas_exports2, {
|
|
|
17809
18411
|
creditCard: () => creditCard2,
|
|
17810
18412
|
cuid: () => cuid3,
|
|
17811
18413
|
cuid2: () => cuid22,
|
|
18414
|
+
currencyCode: () => currencyCode2,
|
|
17812
18415
|
custom: () => custom,
|
|
17813
18416
|
date: () => date2,
|
|
17814
18417
|
describe: () => describe2,
|
|
@@ -17827,6 +18430,7 @@ __export(schemas_exports2, {
|
|
|
17827
18430
|
hex: () => hex2,
|
|
17828
18431
|
hostname: () => hostname2,
|
|
17829
18432
|
httpUrl: () => httpUrl,
|
|
18433
|
+
iban: () => iban2,
|
|
17830
18434
|
instanceof: () => _instanceof,
|
|
17831
18435
|
int: () => int,
|
|
17832
18436
|
int32: () => int32,
|
|
@@ -18129,6 +18733,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
18129
18733
|
set spa(value) {
|
|
18130
18734
|
util_exports.own(this, "spa", value);
|
|
18131
18735
|
},
|
|
18736
|
+
validate(data, params) {
|
|
18737
|
+
return validate(this, data, params);
|
|
18738
|
+
},
|
|
18739
|
+
validateAsync(data, params) {
|
|
18740
|
+
return validateAsync(this, data, params);
|
|
18741
|
+
},
|
|
18132
18742
|
encode: function _encode2(data, params) {
|
|
18133
18743
|
return encode2(this, data, params, { callee: _encode2 });
|
|
18134
18744
|
},
|
|
@@ -18165,61 +18775,65 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
18165
18775
|
return this._zod.def;
|
|
18166
18776
|
}
|
|
18167
18777
|
});
|
|
18168
|
-
var _ZodString = /* @__PURE__ */ $constructor(
|
|
18169
|
-
|
|
18170
|
-
|
|
18171
|
-
|
|
18172
|
-
|
|
18173
|
-
|
|
18174
|
-
inst.minLength = bag.minimum ?? null;
|
|
18175
|
-
inst.maxLength = bag.maximum ?? null;
|
|
18176
|
-
}, {
|
|
18177
|
-
regex(...args) {
|
|
18178
|
-
return this.check(_regex(...args));
|
|
18179
|
-
},
|
|
18180
|
-
includes(...args) {
|
|
18181
|
-
return this.check(_includes(...args));
|
|
18182
|
-
},
|
|
18183
|
-
startsWith(...args) {
|
|
18184
|
-
return this.check(_startsWith(...args));
|
|
18185
|
-
},
|
|
18186
|
-
endsWith(...args) {
|
|
18187
|
-
return this.check(_endsWith(...args));
|
|
18188
|
-
},
|
|
18189
|
-
min(...args) {
|
|
18190
|
-
return this.check(_minLength(...args));
|
|
18191
|
-
},
|
|
18192
|
-
max(...args) {
|
|
18193
|
-
return this.check(_maxLength(...args));
|
|
18194
|
-
},
|
|
18195
|
-
length(...args) {
|
|
18196
|
-
return this.check(_length(...args));
|
|
18197
|
-
},
|
|
18198
|
-
nonempty(...args) {
|
|
18199
|
-
return this.check(_minLength(1, ...args));
|
|
18200
|
-
},
|
|
18201
|
-
lowercase(params) {
|
|
18202
|
-
return this.check(_lowercase(params));
|
|
18778
|
+
var _ZodString = /* @__PURE__ */ $constructor(
|
|
18779
|
+
"_ZodString",
|
|
18780
|
+
(inst, def) => {
|
|
18781
|
+
$ZodString.init(inst, def);
|
|
18782
|
+
ZodType.init(inst, def);
|
|
18783
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
|
|
18203
18784
|
},
|
|
18204
|
-
|
|
18205
|
-
|
|
18206
|
-
|
|
18207
|
-
|
|
18208
|
-
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
|
|
18214
|
-
|
|
18215
|
-
|
|
18216
|
-
|
|
18217
|
-
|
|
18218
|
-
|
|
18219
|
-
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
|
|
18785
|
+
/* @__PURE__ */ util_exports.derived({
|
|
18786
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
18787
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
18788
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
18789
|
+
}, {
|
|
18790
|
+
regex(...args) {
|
|
18791
|
+
return this.check(_regex(...args));
|
|
18792
|
+
},
|
|
18793
|
+
includes(...args) {
|
|
18794
|
+
return this.check(_includes(...args));
|
|
18795
|
+
},
|
|
18796
|
+
startsWith(...args) {
|
|
18797
|
+
return this.check(_startsWith(...args));
|
|
18798
|
+
},
|
|
18799
|
+
endsWith(...args) {
|
|
18800
|
+
return this.check(_endsWith(...args));
|
|
18801
|
+
},
|
|
18802
|
+
min(...args) {
|
|
18803
|
+
return this.check(_minLength(...args));
|
|
18804
|
+
},
|
|
18805
|
+
max(...args) {
|
|
18806
|
+
return this.check(_maxLength(...args));
|
|
18807
|
+
},
|
|
18808
|
+
length(...args) {
|
|
18809
|
+
return this.check(_length(...args));
|
|
18810
|
+
},
|
|
18811
|
+
nonempty(...args) {
|
|
18812
|
+
return this.check(_minLength(1, ...args));
|
|
18813
|
+
},
|
|
18814
|
+
lowercase(params) {
|
|
18815
|
+
return this.check(_lowercase(params));
|
|
18816
|
+
},
|
|
18817
|
+
uppercase(params) {
|
|
18818
|
+
return this.check(_uppercase(params));
|
|
18819
|
+
},
|
|
18820
|
+
trim() {
|
|
18821
|
+
return this.check(_trim());
|
|
18822
|
+
},
|
|
18823
|
+
normalize(...args) {
|
|
18824
|
+
return this.check(_normalize(...args));
|
|
18825
|
+
},
|
|
18826
|
+
toLowerCase() {
|
|
18827
|
+
return this.check(_toLowerCase());
|
|
18828
|
+
},
|
|
18829
|
+
toUpperCase() {
|
|
18830
|
+
return this.check(_toUpperCase());
|
|
18831
|
+
},
|
|
18832
|
+
slugify() {
|
|
18833
|
+
return this.check(_slugify());
|
|
18834
|
+
}
|
|
18835
|
+
})
|
|
18836
|
+
);
|
|
18223
18837
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
18224
18838
|
$ZodString.init(inst, def);
|
|
18225
18839
|
_ZodString.init(inst, def);
|
|
@@ -18365,8 +18979,8 @@ function url(params) {
|
|
|
18365
18979
|
}
|
|
18366
18980
|
function httpUrl(params) {
|
|
18367
18981
|
return _url(ZodURL, {
|
|
18368
|
-
protocol:
|
|
18369
|
-
hostname:
|
|
18982
|
+
protocol: httpProtocol,
|
|
18983
|
+
hostname: domain,
|
|
18370
18984
|
...util_exports.normalizeParams(params)
|
|
18371
18985
|
});
|
|
18372
18986
|
}
|
|
@@ -18482,6 +19096,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
18482
19096
|
function creditCard2(params) {
|
|
18483
19097
|
return _creditCard(ZodCreditCard, params);
|
|
18484
19098
|
}
|
|
19099
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
19100
|
+
$ZodIBAN.init(inst, def);
|
|
19101
|
+
ZodStringFormat.init(inst, def);
|
|
19102
|
+
});
|
|
19103
|
+
function iban2(params) {
|
|
19104
|
+
return _iban(ZodIBAN, params);
|
|
19105
|
+
}
|
|
18485
19106
|
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
18486
19107
|
$ZodJWT.init(inst, def);
|
|
18487
19108
|
ZodStringFormat.init(inst, def);
|
|
@@ -18497,10 +19118,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
18497
19118
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
18498
19119
|
}
|
|
18499
19120
|
function hostname2(_params) {
|
|
18500
|
-
return _stringFormat(ZodCustomStringFormat, "hostname",
|
|
19121
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
|
|
18501
19122
|
}
|
|
18502
19123
|
function hex2(_params) {
|
|
18503
|
-
return _stringFormat(ZodCustomStringFormat, "hex",
|
|
19124
|
+
return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
|
|
19125
|
+
}
|
|
19126
|
+
function currencyCode2(_params) {
|
|
19127
|
+
return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
|
|
18504
19128
|
}
|
|
18505
19129
|
function hash(alg, params) {
|
|
18506
19130
|
const enc = params?.enc ?? "hex";
|
|
@@ -18510,63 +19134,76 @@ function hash(alg, params) {
|
|
|
18510
19134
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
18511
19135
|
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
18512
19136
|
}
|
|
18513
|
-
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
18514
|
-
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18518
|
-
|
|
18519
|
-
|
|
18520
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
18521
|
-
inst.isFinite = true;
|
|
18522
|
-
inst.format = bag.format ?? null;
|
|
18523
|
-
}, {
|
|
18524
|
-
gt(value, params) {
|
|
18525
|
-
return this.check(_gt(value, params));
|
|
18526
|
-
},
|
|
18527
|
-
gte(value, params) {
|
|
18528
|
-
return this.check(_gte(value, params));
|
|
18529
|
-
},
|
|
18530
|
-
min(value, params) {
|
|
18531
|
-
return this.check(_gte(value, params));
|
|
18532
|
-
},
|
|
18533
|
-
lt(value, params) {
|
|
18534
|
-
return this.check(_lt(value, params));
|
|
18535
|
-
},
|
|
18536
|
-
lte(value, params) {
|
|
18537
|
-
return this.check(_lte(value, params));
|
|
18538
|
-
},
|
|
18539
|
-
max(value, params) {
|
|
18540
|
-
return this.check(_lte(value, params));
|
|
18541
|
-
},
|
|
18542
|
-
int(params) {
|
|
18543
|
-
return this.check(int(params));
|
|
18544
|
-
},
|
|
18545
|
-
safe(params) {
|
|
18546
|
-
return this.check(int(params));
|
|
18547
|
-
},
|
|
18548
|
-
positive(params) {
|
|
18549
|
-
return this.check(_gt(0, params));
|
|
18550
|
-
},
|
|
18551
|
-
nonnegative(params) {
|
|
18552
|
-
return this.check(_gte(0, params));
|
|
18553
|
-
},
|
|
18554
|
-
negative(params) {
|
|
18555
|
-
return this.check(_lt(0, params));
|
|
18556
|
-
},
|
|
18557
|
-
nonpositive(params) {
|
|
18558
|
-
return this.check(_lte(0, params));
|
|
19137
|
+
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
19138
|
+
"ZodNumber",
|
|
19139
|
+
(inst, def) => {
|
|
19140
|
+
$ZodNumber.init(inst, def);
|
|
19141
|
+
ZodType.init(inst, def);
|
|
19142
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
19143
|
+
inst.isFinite = true;
|
|
18559
19144
|
},
|
|
18560
|
-
|
|
18561
|
-
|
|
18562
|
-
|
|
18563
|
-
|
|
18564
|
-
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
|
|
18569
|
-
|
|
19145
|
+
/* @__PURE__ */ util_exports.derived({
|
|
19146
|
+
minValue: (inst) => {
|
|
19147
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
19148
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
19149
|
+
},
|
|
19150
|
+
maxValue: (inst) => {
|
|
19151
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
19152
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
19153
|
+
},
|
|
19154
|
+
isInt: (inst) => {
|
|
19155
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
19156
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
19157
|
+
},
|
|
19158
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
19159
|
+
}, {
|
|
19160
|
+
gt(value, params) {
|
|
19161
|
+
return this.check(_gt(value, params));
|
|
19162
|
+
},
|
|
19163
|
+
gte(value, params) {
|
|
19164
|
+
return this.check(_gte(value, params));
|
|
19165
|
+
},
|
|
19166
|
+
min(value, params) {
|
|
19167
|
+
return this.check(_gte(value, params));
|
|
19168
|
+
},
|
|
19169
|
+
lt(value, params) {
|
|
19170
|
+
return this.check(_lt(value, params));
|
|
19171
|
+
},
|
|
19172
|
+
lte(value, params) {
|
|
19173
|
+
return this.check(_lte(value, params));
|
|
19174
|
+
},
|
|
19175
|
+
max(value, params) {
|
|
19176
|
+
return this.check(_lte(value, params));
|
|
19177
|
+
},
|
|
19178
|
+
int(params) {
|
|
19179
|
+
return this.check(int(params));
|
|
19180
|
+
},
|
|
19181
|
+
safe(params) {
|
|
19182
|
+
return this.check(int(params));
|
|
19183
|
+
},
|
|
19184
|
+
positive(params) {
|
|
19185
|
+
return this.check(_gt(0, params));
|
|
19186
|
+
},
|
|
19187
|
+
nonnegative(params) {
|
|
19188
|
+
return this.check(_gte(0, params));
|
|
19189
|
+
},
|
|
19190
|
+
negative(params) {
|
|
19191
|
+
return this.check(_lt(0, params));
|
|
19192
|
+
},
|
|
19193
|
+
nonpositive(params) {
|
|
19194
|
+
return this.check(_lte(0, params));
|
|
19195
|
+
},
|
|
19196
|
+
multipleOf(value, params) {
|
|
19197
|
+
return this.check(_multipleOf(value, params));
|
|
19198
|
+
},
|
|
19199
|
+
step(value, params) {
|
|
19200
|
+
return this.check(_multipleOf(value, params));
|
|
19201
|
+
},
|
|
19202
|
+
finite() {
|
|
19203
|
+
return this;
|
|
19204
|
+
}
|
|
19205
|
+
})
|
|
19206
|
+
);
|
|
18570
19207
|
function number2(params) {
|
|
18571
19208
|
return _number(ZodNumber, params);
|
|
18572
19209
|
}
|
|
@@ -18597,49 +19234,53 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
18597
19234
|
function boolean2(params) {
|
|
18598
19235
|
return _boolean(ZodBoolean, params);
|
|
18599
19236
|
}
|
|
18600
|
-
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
18601
|
-
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
inst.maxValue = bag.maximum ?? null;
|
|
18607
|
-
inst.format = bag.format ?? null;
|
|
18608
|
-
}, {
|
|
18609
|
-
gte(value, params) {
|
|
18610
|
-
return this.check(_gte(value, params));
|
|
19237
|
+
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
19238
|
+
"ZodBigInt",
|
|
19239
|
+
(inst, def) => {
|
|
19240
|
+
$ZodBigInt.init(inst, def);
|
|
19241
|
+
ZodType.init(inst, def);
|
|
19242
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
18611
19243
|
},
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18615
|
-
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
|
|
18635
|
-
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
|
|
18640
|
-
|
|
18641
|
-
|
|
18642
|
-
|
|
19244
|
+
/* @__PURE__ */ util_exports.derived({
|
|
19245
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
19246
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
19247
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
19248
|
+
}, {
|
|
19249
|
+
gte(value, params) {
|
|
19250
|
+
return this.check(_gte(value, params));
|
|
19251
|
+
},
|
|
19252
|
+
min(value, params) {
|
|
19253
|
+
return this.check(_gte(value, params));
|
|
19254
|
+
},
|
|
19255
|
+
gt(value, params) {
|
|
19256
|
+
return this.check(_gt(value, params));
|
|
19257
|
+
},
|
|
19258
|
+
lt(value, params) {
|
|
19259
|
+
return this.check(_lt(value, params));
|
|
19260
|
+
},
|
|
19261
|
+
lte(value, params) {
|
|
19262
|
+
return this.check(_lte(value, params));
|
|
19263
|
+
},
|
|
19264
|
+
max(value, params) {
|
|
19265
|
+
return this.check(_lte(value, params));
|
|
19266
|
+
},
|
|
19267
|
+
positive(params) {
|
|
19268
|
+
return this.check(_gt(BigInt(0), params));
|
|
19269
|
+
},
|
|
19270
|
+
negative(params) {
|
|
19271
|
+
return this.check(_lt(BigInt(0), params));
|
|
19272
|
+
},
|
|
19273
|
+
nonpositive(params) {
|
|
19274
|
+
return this.check(_lte(BigInt(0), params));
|
|
19275
|
+
},
|
|
19276
|
+
nonnegative(params) {
|
|
19277
|
+
return this.check(_gte(BigInt(0), params));
|
|
19278
|
+
},
|
|
19279
|
+
multipleOf(value, params) {
|
|
19280
|
+
return this.check(_multipleOf(value, params));
|
|
19281
|
+
}
|
|
19282
|
+
})
|
|
19283
|
+
);
|
|
18643
19284
|
function bigint2(params) {
|
|
18644
19285
|
return _bigint(ZodBigInt, params);
|
|
18645
19286
|
}
|
|
@@ -18709,16 +19350,26 @@ var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
|
18709
19350
|
function _void2(params) {
|
|
18710
19351
|
return _void(ZodVoid, params);
|
|
18711
19352
|
}
|
|
18712
|
-
var ZodDate = /* @__PURE__ */ $constructor(
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18716
|
-
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
|
|
18720
|
-
|
|
18721
|
-
|
|
19353
|
+
var ZodDate = /* @__PURE__ */ $constructor(
|
|
19354
|
+
"ZodDate",
|
|
19355
|
+
(inst, def) => {
|
|
19356
|
+
$ZodDate.init(inst, def);
|
|
19357
|
+
ZodType.init(inst, def);
|
|
19358
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
19359
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
19360
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
19361
|
+
},
|
|
19362
|
+
/* @__PURE__ */ util_exports.derived({
|
|
19363
|
+
minDate: (inst) => {
|
|
19364
|
+
const { minimum } = aggregateChecks(inst);
|
|
19365
|
+
return minimum ? new Date(minimum) : null;
|
|
19366
|
+
},
|
|
19367
|
+
maxDate: (inst) => {
|
|
19368
|
+
const { maximum } = aggregateChecks(inst);
|
|
19369
|
+
return maximum ? new Date(maximum) : null;
|
|
19370
|
+
}
|
|
19371
|
+
}, {})
|
|
19372
|
+
);
|
|
18722
19373
|
function date2(params) {
|
|
18723
19374
|
return _date(ZodDate, params);
|
|
18724
19375
|
}
|
|
@@ -18763,19 +19414,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
18763
19414
|
return _enum2(Object.keys(this._zod.def.shape));
|
|
18764
19415
|
},
|
|
18765
19416
|
catchall(catchall) {
|
|
18766
|
-
return this.clone(
|
|
19417
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
|
|
18767
19418
|
},
|
|
18768
19419
|
passthrough() {
|
|
18769
|
-
return this.clone(
|
|
19420
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
18770
19421
|
},
|
|
18771
19422
|
loose() {
|
|
18772
|
-
return this.clone(
|
|
19423
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
18773
19424
|
},
|
|
18774
19425
|
strict() {
|
|
18775
|
-
return this.clone(
|
|
19426
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
|
|
18776
19427
|
},
|
|
18777
19428
|
strip() {
|
|
18778
|
-
return this.clone(
|
|
19429
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
18779
19430
|
},
|
|
18780
19431
|
extend(incoming) {
|
|
18781
19432
|
return util_exports.extend(this, incoming);
|
|
@@ -18994,7 +19645,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
18994
19645
|
ZodType.init(inst, def);
|
|
18995
19646
|
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
18996
19647
|
inst.enum = def.entries;
|
|
18997
|
-
inst.options =
|
|
19648
|
+
inst.options = [...inst._zod.values];
|
|
18998
19649
|
const keys = new Set(Object.keys(def.entries));
|
|
18999
19650
|
inst.extract = (values, params) => {
|
|
19000
19651
|
const newEntries = {};
|
|
@@ -19357,8 +20008,15 @@ function superRefine(fn, params) {
|
|
|
19357
20008
|
}
|
|
19358
20009
|
var describe2 = describe;
|
|
19359
20010
|
var meta2 = meta;
|
|
20011
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
20012
|
+
ZodCustom.init(inst, def);
|
|
20013
|
+
}, {
|
|
20014
|
+
properties(shape, params) {
|
|
20015
|
+
return this.check(_properties(shape, params));
|
|
20016
|
+
}
|
|
20017
|
+
});
|
|
19360
20018
|
function _instanceof(cls, params = {}) {
|
|
19361
|
-
const inst = new
|
|
20019
|
+
const inst = new ZodInstanceOf({
|
|
19362
20020
|
type: "custom",
|
|
19363
20021
|
check: "custom",
|
|
19364
20022
|
fn: (data) => data instanceof cls,
|
|
@@ -19563,27 +20221,188 @@ function resolveRef(ref, ctx) {
|
|
|
19563
20221
|
}
|
|
19564
20222
|
throw new Error(`Reference not found: ${ref}`);
|
|
19565
20223
|
}
|
|
19566
|
-
function
|
|
20224
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
19567
20225
|
const guard = z.transform((value) => value).check((payload) => {
|
|
19568
20226
|
const value = payload.value;
|
|
19569
20227
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
19570
20228
|
return;
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
if (result.success)
|
|
19574
|
-
continue;
|
|
20229
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
20230
|
+
if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
|
|
19575
20231
|
payload.issues.push({
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
20232
|
+
origin: "object",
|
|
20233
|
+
code: "too_small",
|
|
20234
|
+
minimum: guards.minProperties,
|
|
20235
|
+
inclusive: true,
|
|
20236
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
20237
|
+
input: value,
|
|
20238
|
+
inst: objectSchema,
|
|
20239
|
+
continue: true
|
|
20240
|
+
});
|
|
20241
|
+
}
|
|
20242
|
+
if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
|
|
20243
|
+
payload.issues.push({
|
|
20244
|
+
origin: "object",
|
|
20245
|
+
code: "too_big",
|
|
20246
|
+
maximum: guards.maxProperties,
|
|
20247
|
+
inclusive: true,
|
|
20248
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
20249
|
+
input: value,
|
|
20250
|
+
inst: objectSchema,
|
|
19581
20251
|
continue: true
|
|
19582
20252
|
});
|
|
19583
20253
|
}
|
|
20254
|
+
if (guards.keySchema) {
|
|
20255
|
+
for (const key of keys) {
|
|
20256
|
+
const result = guards.keySchema.safeParse(key);
|
|
20257
|
+
if (result.success)
|
|
20258
|
+
continue;
|
|
20259
|
+
payload.issues.push({
|
|
20260
|
+
code: "invalid_key",
|
|
20261
|
+
origin: "record",
|
|
20262
|
+
issues: result.error.issues,
|
|
20263
|
+
input: key,
|
|
20264
|
+
path: [key],
|
|
20265
|
+
continue: true
|
|
20266
|
+
});
|
|
20267
|
+
}
|
|
20268
|
+
}
|
|
19584
20269
|
});
|
|
19585
20270
|
return guard.pipe(objectSchema);
|
|
19586
20271
|
}
|
|
20272
|
+
function canonicalKey(value, seen) {
|
|
20273
|
+
if (value === null)
|
|
20274
|
+
return "z";
|
|
20275
|
+
const type = typeof value;
|
|
20276
|
+
if (type !== "object") {
|
|
20277
|
+
if (type === "number" && Number.isNaN(value))
|
|
20278
|
+
return null;
|
|
20279
|
+
const raw = String(value);
|
|
20280
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
20281
|
+
}
|
|
20282
|
+
if (seen.has(value))
|
|
20283
|
+
return null;
|
|
20284
|
+
seen.add(value);
|
|
20285
|
+
try {
|
|
20286
|
+
if (Array.isArray(value)) {
|
|
20287
|
+
const parts2 = [];
|
|
20288
|
+
for (const item of value) {
|
|
20289
|
+
const key = canonicalKey(item, seen);
|
|
20290
|
+
if (key === null)
|
|
20291
|
+
return null;
|
|
20292
|
+
parts2.push(key);
|
|
20293
|
+
}
|
|
20294
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
20295
|
+
}
|
|
20296
|
+
const keys = Object.keys(value).sort();
|
|
20297
|
+
const parts = [];
|
|
20298
|
+
for (const k of keys) {
|
|
20299
|
+
const key = canonicalKey(value[k], seen);
|
|
20300
|
+
if (key === null)
|
|
20301
|
+
return null;
|
|
20302
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
20303
|
+
}
|
|
20304
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
20305
|
+
} finally {
|
|
20306
|
+
seen.delete(value);
|
|
20307
|
+
}
|
|
20308
|
+
}
|
|
20309
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
20310
|
+
"items",
|
|
20311
|
+
"prefixItems",
|
|
20312
|
+
"additionalItems",
|
|
20313
|
+
"additionalProperties",
|
|
20314
|
+
"contains",
|
|
20315
|
+
"propertyNames",
|
|
20316
|
+
"not",
|
|
20317
|
+
"if",
|
|
20318
|
+
"then",
|
|
20319
|
+
"else",
|
|
20320
|
+
"allOf",
|
|
20321
|
+
"anyOf",
|
|
20322
|
+
"oneOf",
|
|
20323
|
+
"unevaluatedItems",
|
|
20324
|
+
"unevaluatedProperties",
|
|
20325
|
+
"contentSchema"
|
|
20326
|
+
]);
|
|
20327
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
20328
|
+
"properties",
|
|
20329
|
+
"patternProperties",
|
|
20330
|
+
"dependentSchemas",
|
|
20331
|
+
"dependencies",
|
|
20332
|
+
"$defs",
|
|
20333
|
+
"definitions"
|
|
20334
|
+
]);
|
|
20335
|
+
function containsRef(value) {
|
|
20336
|
+
if (typeof value !== "object" || value === null)
|
|
20337
|
+
return false;
|
|
20338
|
+
if (Array.isArray(value))
|
|
20339
|
+
return value.some(containsRef);
|
|
20340
|
+
if (typeof value.$ref === "string")
|
|
20341
|
+
return true;
|
|
20342
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
20343
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
20344
|
+
return containsRef(sub);
|
|
20345
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
20346
|
+
return false;
|
|
20347
|
+
return Object.values(sub).some(containsRef);
|
|
20348
|
+
});
|
|
20349
|
+
}
|
|
20350
|
+
function plural(n) {
|
|
20351
|
+
return n === 1 ? "element" : "elements";
|
|
20352
|
+
}
|
|
20353
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
20354
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
20355
|
+
const items = payload.value;
|
|
20356
|
+
if (!Array.isArray(items))
|
|
20357
|
+
return;
|
|
20358
|
+
if (guards.uniqueItems === true) {
|
|
20359
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
20360
|
+
for (let i = 0; i < items.length; i++) {
|
|
20361
|
+
const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
20362
|
+
if (key === null)
|
|
20363
|
+
continue;
|
|
20364
|
+
const first = firstSeen.get(key);
|
|
20365
|
+
if (first === void 0) {
|
|
20366
|
+
firstSeen.set(key, i);
|
|
20367
|
+
continue;
|
|
20368
|
+
}
|
|
20369
|
+
payload.issues.push({
|
|
20370
|
+
code: "custom",
|
|
20371
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
20372
|
+
input: items,
|
|
20373
|
+
path: [i],
|
|
20374
|
+
continue: true
|
|
20375
|
+
});
|
|
20376
|
+
}
|
|
20377
|
+
}
|
|
20378
|
+
if (guards.containsSchema) {
|
|
20379
|
+
const minContains = guards.minContains ?? 1;
|
|
20380
|
+
const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
20381
|
+
let matches = 0;
|
|
20382
|
+
for (const item of items) {
|
|
20383
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
20384
|
+
break;
|
|
20385
|
+
}
|
|
20386
|
+
if (matches < minContains) {
|
|
20387
|
+
payload.issues.push({
|
|
20388
|
+
code: "custom",
|
|
20389
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
20390
|
+
input: items,
|
|
20391
|
+
continue: true
|
|
20392
|
+
});
|
|
20393
|
+
}
|
|
20394
|
+
if (guards.maxContains !== void 0 && matches > guards.maxContains) {
|
|
20395
|
+
payload.issues.push({
|
|
20396
|
+
code: "custom",
|
|
20397
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
20398
|
+
input: items,
|
|
20399
|
+
continue: true
|
|
20400
|
+
});
|
|
20401
|
+
}
|
|
20402
|
+
}
|
|
20403
|
+
});
|
|
20404
|
+
return guard.pipe(arraySchema);
|
|
20405
|
+
}
|
|
19587
20406
|
function getTupleRest(restSchema, ctx) {
|
|
19588
20407
|
if (restSchema === false) {
|
|
19589
20408
|
return void 0;
|
|
@@ -19713,6 +20532,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
19713
20532
|
stringSchema = stringSchema.check(z.e164());
|
|
19714
20533
|
} else if (format === "credit_card") {
|
|
19715
20534
|
stringSchema = stringSchema.check(z.creditCard());
|
|
20535
|
+
} else if (format === "iban") {
|
|
20536
|
+
stringSchema = stringSchema.check(z.iban());
|
|
19716
20537
|
} else if (format === "jwt") {
|
|
19717
20538
|
stringSchema = stringSchema.check(z.jwt());
|
|
19718
20539
|
} else if (format === "emoji") {
|
|
@@ -19845,9 +20666,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
19845
20666
|
zodSchema = objectSchema.passthrough();
|
|
19846
20667
|
}
|
|
19847
20668
|
}
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
20669
|
+
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
20670
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
|
|
20671
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
|
|
20672
|
+
if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
|
|
20673
|
+
let keySchema;
|
|
20674
|
+
if (hasKeyGuard) {
|
|
20675
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
20676
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
20677
|
+
}
|
|
20678
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
19851
20679
|
}
|
|
19852
20680
|
break;
|
|
19853
20681
|
}
|
|
@@ -19893,6 +20721,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
19893
20721
|
} else {
|
|
19894
20722
|
zodSchema = z.array(z.any());
|
|
19895
20723
|
}
|
|
20724
|
+
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
20725
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
20726
|
+
uniqueItems: schema.uniqueItems === true,
|
|
20727
|
+
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
20728
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
20729
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
|
|
20730
|
+
});
|
|
20731
|
+
}
|
|
19896
20732
|
break;
|
|
19897
20733
|
}
|
|
19898
20734
|
default:
|
|
@@ -19950,8 +20786,23 @@ function convertSchema(schema, ctx) {
|
|
|
19950
20786
|
extraMeta[key] = schema[key];
|
|
19951
20787
|
}
|
|
19952
20788
|
}
|
|
19953
|
-
if (schema.
|
|
19954
|
-
|
|
20789
|
+
if (schema.type === "object" && schema.$ref === void 0) {
|
|
20790
|
+
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
20791
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
20792
|
+
}
|
|
20793
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
20794
|
+
if (schema[key] !== void 0)
|
|
20795
|
+
extraMeta[key] = schema[key];
|
|
20796
|
+
}
|
|
20797
|
+
}
|
|
20798
|
+
if (schema.type === "array" && schema.$ref === void 0) {
|
|
20799
|
+
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
20800
|
+
extraMeta.contains = schema.contains;
|
|
20801
|
+
}
|
|
20802
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
20803
|
+
if (schema[key] !== void 0)
|
|
20804
|
+
extraMeta[key] = schema[key];
|
|
20805
|
+
}
|
|
19955
20806
|
}
|
|
19956
20807
|
for (const key of Object.keys(schema)) {
|
|
19957
20808
|
if (!RECOGNIZED_KEYS.has(key)) {
|
|
@@ -19990,7 +20841,7 @@ function fromJSONSchema(schema, params) {
|
|
|
19990
20841
|
}
|
|
19991
20842
|
|
|
19992
20843
|
// node_modules/zod/v4/core/visit.js
|
|
19993
|
-
var RESOLVING = Symbol("z.visit/resolving");
|
|
20844
|
+
var RESOLVING = /* @__PURE__ */ Symbol("z.visit/resolving");
|
|
19994
20845
|
function visit(schema, fnOrHandlers) {
|
|
19995
20846
|
const fn = typeof fnOrHandlers === "function" ? fnOrHandlers : (node2, rewritten) => {
|
|
19996
20847
|
const h = fnOrHandlers[node2._zod.def.type];
|
|
@@ -20211,6 +21062,18 @@ function date4(params) {
|
|
|
20211
21062
|
return _coercedDate(ZodDate, params);
|
|
20212
21063
|
}
|
|
20213
21064
|
|
|
21065
|
+
// src/util.ts
|
|
21066
|
+
function errMessage(err) {
|
|
21067
|
+
if (err instanceof Error) return err.message;
|
|
21068
|
+
if (typeof err === "string") return err;
|
|
21069
|
+
try {
|
|
21070
|
+
const json2 = JSON.stringify(err);
|
|
21071
|
+
return json2 === void 0 ? String(err) : json2;
|
|
21072
|
+
} catch {
|
|
21073
|
+
return String(err);
|
|
21074
|
+
}
|
|
21075
|
+
}
|
|
21076
|
+
|
|
20214
21077
|
// src/options.ts
|
|
20215
21078
|
var DEFAULT_SLOT = "default";
|
|
20216
21079
|
var DEFAULT_TIMEOUT_MS = 24e4;
|
|
@@ -20281,9 +21144,6 @@ function formatIssue(issue2) {
|
|
|
20281
21144
|
const path = issue2.path.map((segment) => String(segment)).join(".") || "<root>";
|
|
20282
21145
|
return `${path}: ${issue2.message}`;
|
|
20283
21146
|
}
|
|
20284
|
-
function describeError(err) {
|
|
20285
|
-
return err instanceof Error ? err.message : String(err);
|
|
20286
|
-
}
|
|
20287
21147
|
function discoverOpencodeBin() {
|
|
20288
21148
|
const candidates = [
|
|
20289
21149
|
process.env["OPENCODE_BIN"] ?? "",
|
|
@@ -20310,7 +21170,7 @@ function parseOptions(raw) {
|
|
|
20310
21170
|
} catch (err) {
|
|
20311
21171
|
return {
|
|
20312
21172
|
ok: false,
|
|
20313
|
-
errors: [`options threw during parsing and was rejected: ${
|
|
21173
|
+
errors: [`options threw during parsing and was rejected: ${errMessage(err)}`]
|
|
20314
21174
|
};
|
|
20315
21175
|
}
|
|
20316
21176
|
}
|