@feedmepos/mf-payment 1.4.46 → 1.5.0-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Actions.vue_vue_type_script_setup_true_lang-sYaYPQ_s.js → Actions.vue_vue_type_script_setup_true_lang-DGbH2LsQ.js} +43 -43
- package/dist/{AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js → AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js} +13 -13
- package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-I9eO197f.js +47 -0
- package/dist/{Chargeback-BftBez0p.js → Chargeback-19afdT_4.js} +83 -83
- package/dist/{DateRangePicker.vue_vue_type_script_setup_true_lang-XZ7OzGau.js → DateRangePicker.vue_vue_type_script_setup_true_lang-kymnzYpd.js} +1 -1
- package/dist/DocumentViewer.vue_vue_type_script_setup_true_lang-CzwG5dCO.js +77 -0
- package/dist/Forbidden-CSTZjebc.js +38 -0
- package/dist/Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js +45 -0
- package/dist/{OnboardForm-CnKOFMMH.js → OnboardForm-Cc6JOr09.js} +596 -528
- package/dist/{OnboardForm-DqhRFi-H.js → OnboardForm-Do6ar3sx.js} +363 -347
- package/dist/{OnboardSubmission-DKxUJxCW.js → OnboardSubmission-B-leoVPo.js} +4 -4
- package/dist/{OnboardSubmission-munHiPKU.js → OnboardSubmission-Dj8AGb69.js} +8 -8
- package/dist/PDFViewer-DgyyGDHl.js +23209 -0
- package/dist/{PayoutAccount-DbLQjLVr.js → PayoutAccount--1J5ubvX.js} +341 -312
- package/dist/{PayoutAccount-C1ADGszh.js → PayoutAccount-ChGlsZ-O.js} +75 -75
- package/dist/{PayoutAccountSetting-YYswVooL.js → PayoutAccountSetting-BC0ANAqY.js} +281 -266
- package/dist/{Restaurant-26r7Q01z.js → Restaurant-ZiTHtFZJ.js} +79 -79
- package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-Bzj_sdSY.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-DG3iyjkK.js} +3 -3
- package/dist/{RestaurantSetting-D1APrvzM.js → RestaurantSetting-M1jYaGwx.js} +5 -5
- package/dist/{SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js → SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js} +5 -5
- package/dist/{Settlement-CWX5RKwL.js → Settlement-Cj2W8VfH.js} +7 -7
- package/dist/{Settlement-Ix55QLVB.js → Settlement-D_nmqYEC.js} +12 -15
- package/dist/{SettlementTransactions-DYAlKO__.js → SettlementTransactions-Ch9jeQU6.js} +99 -99
- package/dist/{SettlementTransactions-BIodJ6DN.js → SettlementTransactions-DK1ONvn6.js} +55 -55
- package/dist/{Status.vue_vue_type_script_setup_true_lang-B5iI3OiL.js → Status.vue_vue_type_script_setup_true_lang-BP5m6Vic.js} +9 -9
- package/dist/Terminal-CoPPPePw.js +1135 -0
- package/dist/{TerminalSetting-BiaGvysm.js → TerminalSetting-PWs1fyFe.js} +549 -425
- package/dist/{Transaction-D51QiCaP.js → Transaction-BirTp8t6.js} +82 -82
- package/dist/{Transaction-ouagKBic.js → Transaction-CegzBK7m.js} +65 -65
- package/dist/{TransactionOld-CCzonxUD.js → TransactionOld-DqGMuWvL.js} +9 -9
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/api/document/index.d.ts +4 -0
- package/dist/{app-DE4U_54A.js → app-D6U0uODp.js} +894 -944
- package/dist/app.d.ts +1 -358
- package/dist/app.js +4 -3
- package/dist/{assets--JQWdCl5.js → assets-DtwUojcS.js} +1 -1
- package/dist/components/AdminLayout.vue.d.ts +3 -3
- package/dist/components/AutoCopyCell.vue.d.ts +1 -1
- package/dist/components/DocumentViewer.vue.d.ts +16 -0
- package/dist/components/ImagePreview.vue.d.ts +3 -3
- package/dist/components/Layout.vue.d.ts +3 -3
- package/dist/components/PDFViewer.vue.d.ts +4 -4
- package/dist/components/RestaurantSelector.vue.d.ts +1 -1
- package/dist/components/RouteCell.vue.d.ts +1 -1
- package/dist/{grafana-22PXAn1O.js → grafana-fZyobMgN.js} +1 -1
- package/dist/{index-B0uA-O38.js → index--K2ipr4H.js} +7 -7
- package/dist/{index-cCTvH31Z.js → index-BJNCcdvT.js} +22132 -24859
- package/dist/{index-Blb5YaYR.js → index-C-YBwRQp.js} +3 -3
- package/dist/{index-Ctn4LFui.js → index-CMN40t8e.js} +1 -1
- package/dist/{index-sc6pzeZl.js → index-CbONxZz2.js} +17 -13
- package/dist/{index-BLyx8ZQr.js → index-CtkwL_6R.js} +1 -1
- package/dist/{index-B9kHmV6p.js → index-D69RnDa7.js} +19 -19
- package/dist/index-_u7l8cO3.js +27 -0
- package/dist/{index-B0-Kn6Mw.js → index-eLZ3BErV.js} +12 -12
- package/dist/{index.vue_vue_type_script_setup_true_lang-NUicoOT2.js → index.vue_vue_type_script_setup_true_lang-zxkA_YTt.js} +50 -50
- package/dist/model/payout-account.d.ts +2 -2
- package/dist/{Forbidden-Dqw0MqyC.js → no-data-BRmo6XOO.js} +2 -35
- package/dist/package.json +13 -7
- package/dist/{payout-account-KcIc3kyX.js → payout-account-CVYMFqu9.js} +78 -77
- package/dist/plugins.d.ts +1 -5
- package/dist/router/index.d.ts +1 -0
- package/dist/stores/payoutAccount.d.ts +16 -16
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{validator-D5jtpt9A.js → validator-DzjyJnvv.js} +842 -763
- package/dist/views/Forbidden.vue.d.ts +1 -1
- package/dist/views/admin/chargeback/cell/Actions.vue.d.ts +1 -1
- package/dist/views/admin/onboard-submission/cell/SignatureBoard.vue.d.ts +2 -1
- package/dist/views/admin/onboard-submission/cell/UploadButton.vue.d.ts +3 -2
- package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +17 -17
- package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +17 -17
- package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +22 -22
- package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +22 -22
- package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
- package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +17 -17
- package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +22 -22
- package/dist/views/admin/payout-account/tabs/cell/Actions.vue.d.ts +1 -1
- package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +2 -2
- package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +2 -2
- package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
- package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
- package/dist/views/admin/restaurant/cell/LogButton.vue.d.ts +1 -1
- package/dist/views/admin/restaurant/tabs/PaymentGateway.vue.d.ts +118 -244
- package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
- package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +4 -4
- package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +6 -6
- package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +4 -4
- package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +4 -4
- package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
- package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
- package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +4 -4
- package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +4 -4
- package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +28 -8
- package/dist/views/admin/terminal/cell/Actions.vue.d.ts +1 -1
- package/dist/views/admin/terminal/cell/ID.vue.d.ts +1 -1
- package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +29 -9
- package/dist/views/admin/terminal/tabs/Information.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +29 -9
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +250 -0
- package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +28 -8
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +28 -8
- package/dist/views/admin/transaction/cell/Actions.vue.d.ts +1 -1
- package/dist/views/admin/transaction/cell/BillSeqNumber.vue.d.ts +1 -1
- package/dist/views/onboard-submission/cell/SignatureBoard.vue.d.ts +2 -1
- package/dist/views/onboard-submission/cell/UploadButton.vue.d.ts +6 -5
- package/dist/views/payout-account/PayoutAccountDialog.vue.d.ts +2 -2
- package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
- package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +68 -68
- package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +34 -34
- package/dist/views/transaction/cell/Actions.vue.d.ts +1 -1
- package/dist/views/transaction/cell/BillSeqNumber.vue.d.ts +1 -1
- package/package.json +26 -20
- package/dist/AutoCopyCell.vue_vue_type_script_setup_true_lang-DP8STuAT.js +0 -47
- package/dist/Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js +0 -45
- package/dist/PDFViewer-DHKBD99J.js +0 -22433
- package/dist/Terminal-CrM7EzkM.js +0 -1095
- package/dist/plugins-DOA8YO_V.js +0 -1366
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "@feedmepos/ui-library";
|
|
2
|
-
var
|
|
2
|
+
var v;
|
|
3
3
|
(function(r) {
|
|
4
|
-
r.assertEqual = (n) =>
|
|
4
|
+
r.assertEqual = (n) => {
|
|
5
|
+
};
|
|
5
6
|
function e(n) {
|
|
6
7
|
}
|
|
7
8
|
r.assertIs = e;
|
|
@@ -29,21 +30,21 @@ var g;
|
|
|
29
30
|
for (const i of n)
|
|
30
31
|
if (a(i))
|
|
31
32
|
return i;
|
|
32
|
-
}, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && isFinite(n) && Math.floor(n) === n;
|
|
33
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && Number.isFinite(n) && Math.floor(n) === n;
|
|
33
34
|
function s(n, a = " | ") {
|
|
34
35
|
return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
35
36
|
}
|
|
36
37
|
r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
|
|
37
|
-
})(
|
|
38
|
-
var
|
|
38
|
+
})(v || (v = {}));
|
|
39
|
+
var _e;
|
|
39
40
|
(function(r) {
|
|
40
41
|
r.mergeShapes = (e, t) => ({
|
|
41
42
|
...e,
|
|
42
43
|
...t
|
|
43
44
|
// second overwrites first
|
|
44
45
|
});
|
|
45
|
-
})(
|
|
46
|
-
const
|
|
46
|
+
})(_e || (_e = {}));
|
|
47
|
+
const u = v.arrayToEnum([
|
|
47
48
|
"string",
|
|
48
49
|
"nan",
|
|
49
50
|
"number",
|
|
@@ -67,25 +68,25 @@ const f = g.arrayToEnum([
|
|
|
67
68
|
]), j = (r) => {
|
|
68
69
|
switch (typeof r) {
|
|
69
70
|
case "undefined":
|
|
70
|
-
return
|
|
71
|
+
return u.undefined;
|
|
71
72
|
case "string":
|
|
72
|
-
return
|
|
73
|
+
return u.string;
|
|
73
74
|
case "number":
|
|
74
|
-
return isNaN(r) ?
|
|
75
|
+
return Number.isNaN(r) ? u.nan : u.number;
|
|
75
76
|
case "boolean":
|
|
76
|
-
return
|
|
77
|
+
return u.boolean;
|
|
77
78
|
case "function":
|
|
78
|
-
return
|
|
79
|
+
return u.function;
|
|
79
80
|
case "bigint":
|
|
80
|
-
return
|
|
81
|
+
return u.bigint;
|
|
81
82
|
case "symbol":
|
|
82
|
-
return
|
|
83
|
+
return u.symbol;
|
|
83
84
|
case "object":
|
|
84
|
-
return Array.isArray(r) ?
|
|
85
|
+
return Array.isArray(r) ? u.array : r === null ? u.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? u.promise : typeof Map < "u" && r instanceof Map ? u.map : typeof Set < "u" && r instanceof Set ? u.set : typeof Date < "u" && r instanceof Date ? u.date : u.object;
|
|
85
86
|
default:
|
|
86
|
-
return
|
|
87
|
+
return u.unknown;
|
|
87
88
|
}
|
|
88
|
-
},
|
|
89
|
+
}, c = v.arrayToEnum([
|
|
89
90
|
"invalid_type",
|
|
90
91
|
"invalid_literal",
|
|
91
92
|
"custom",
|
|
@@ -102,8 +103,11 @@ const f = g.arrayToEnum([
|
|
|
102
103
|
"invalid_intersection_types",
|
|
103
104
|
"not_multiple_of",
|
|
104
105
|
"not_finite"
|
|
105
|
-
]),
|
|
106
|
+
]), $e = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
106
107
|
class w extends Error {
|
|
108
|
+
get errors() {
|
|
109
|
+
return this.issues;
|
|
110
|
+
}
|
|
107
111
|
constructor(e) {
|
|
108
112
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
109
113
|
this.issues = [...this.issues, s];
|
|
@@ -113,9 +117,6 @@ class w extends Error {
|
|
|
113
117
|
const t = new.target.prototype;
|
|
114
118
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
115
119
|
}
|
|
116
|
-
get errors() {
|
|
117
|
-
return this.issues;
|
|
118
|
-
}
|
|
119
120
|
format(e) {
|
|
120
121
|
const t = e || function(a) {
|
|
121
122
|
return a.message;
|
|
@@ -130,10 +131,10 @@ class w extends Error {
|
|
|
130
131
|
else if (i.path.length === 0)
|
|
131
132
|
s._errors.push(t(i));
|
|
132
133
|
else {
|
|
133
|
-
let o = s,
|
|
134
|
-
for (;
|
|
135
|
-
const
|
|
136
|
-
|
|
134
|
+
let o = s, f = 0;
|
|
135
|
+
for (; f < i.path.length; ) {
|
|
136
|
+
const l = i.path[f];
|
|
137
|
+
f === i.path.length - 1 ? (o[l] = o[l] || { _errors: [] }, o[l]._errors.push(t(i))) : o[l] = o[l] || { _errors: [] }, o = o[l], f++;
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
};
|
|
@@ -147,7 +148,7 @@ class w extends Error {
|
|
|
147
148
|
return this.message;
|
|
148
149
|
}
|
|
149
150
|
get message() {
|
|
150
|
-
return JSON.stringify(this.issues,
|
|
151
|
+
return JSON.stringify(this.issues, v.jsonStringifyReplacer, 2);
|
|
151
152
|
}
|
|
152
153
|
get isEmpty() {
|
|
153
154
|
return this.issues.length === 0;
|
|
@@ -155,7 +156,11 @@ class w extends Error {
|
|
|
155
156
|
flatten(e = (t) => t.message) {
|
|
156
157
|
const t = {}, s = [];
|
|
157
158
|
for (const n of this.issues)
|
|
158
|
-
n.path.length > 0
|
|
159
|
+
if (n.path.length > 0) {
|
|
160
|
+
const a = n.path[0];
|
|
161
|
+
t[a] = t[a] || [], t[a].push(e(n));
|
|
162
|
+
} else
|
|
163
|
+
s.push(e(n));
|
|
159
164
|
return { formErrors: s, fieldErrors: t };
|
|
160
165
|
}
|
|
161
166
|
get formErrors() {
|
|
@@ -166,67 +171,67 @@ w.create = (r) => new w(r);
|
|
|
166
171
|
const W = (r, e) => {
|
|
167
172
|
let t;
|
|
168
173
|
switch (r.code) {
|
|
169
|
-
case
|
|
170
|
-
r.received ===
|
|
174
|
+
case c.invalid_type:
|
|
175
|
+
r.received === u.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
171
176
|
break;
|
|
172
|
-
case
|
|
173
|
-
t = `Invalid literal value, expected ${JSON.stringify(r.expected,
|
|
177
|
+
case c.invalid_literal:
|
|
178
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, v.jsonStringifyReplacer)}`;
|
|
174
179
|
break;
|
|
175
|
-
case
|
|
176
|
-
t = `Unrecognized key(s) in object: ${
|
|
180
|
+
case c.unrecognized_keys:
|
|
181
|
+
t = `Unrecognized key(s) in object: ${v.joinValues(r.keys, ", ")}`;
|
|
177
182
|
break;
|
|
178
|
-
case
|
|
183
|
+
case c.invalid_union:
|
|
179
184
|
t = "Invalid input";
|
|
180
185
|
break;
|
|
181
|
-
case
|
|
182
|
-
t = `Invalid discriminator value. Expected ${
|
|
186
|
+
case c.invalid_union_discriminator:
|
|
187
|
+
t = `Invalid discriminator value. Expected ${v.joinValues(r.options)}`;
|
|
183
188
|
break;
|
|
184
|
-
case
|
|
185
|
-
t = `Invalid enum value. Expected ${
|
|
189
|
+
case c.invalid_enum_value:
|
|
190
|
+
t = `Invalid enum value. Expected ${v.joinValues(r.options)}, received '${r.received}'`;
|
|
186
191
|
break;
|
|
187
|
-
case
|
|
192
|
+
case c.invalid_arguments:
|
|
188
193
|
t = "Invalid function arguments";
|
|
189
194
|
break;
|
|
190
|
-
case
|
|
195
|
+
case c.invalid_return_type:
|
|
191
196
|
t = "Invalid function return type";
|
|
192
197
|
break;
|
|
193
|
-
case
|
|
198
|
+
case c.invalid_date:
|
|
194
199
|
t = "Invalid date";
|
|
195
200
|
break;
|
|
196
|
-
case
|
|
197
|
-
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` :
|
|
201
|
+
case c.invalid_string:
|
|
202
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : v.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
198
203
|
break;
|
|
199
|
-
case
|
|
200
|
-
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
204
|
+
case c.too_small:
|
|
205
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "bigint" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
201
206
|
break;
|
|
202
|
-
case
|
|
207
|
+
case c.too_big:
|
|
203
208
|
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
|
|
204
209
|
break;
|
|
205
|
-
case
|
|
210
|
+
case c.custom:
|
|
206
211
|
t = "Invalid input";
|
|
207
212
|
break;
|
|
208
|
-
case
|
|
213
|
+
case c.invalid_intersection_types:
|
|
209
214
|
t = "Intersection results could not be merged";
|
|
210
215
|
break;
|
|
211
|
-
case
|
|
216
|
+
case c.not_multiple_of:
|
|
212
217
|
t = `Number must be a multiple of ${r.multipleOf}`;
|
|
213
218
|
break;
|
|
214
|
-
case
|
|
219
|
+
case c.not_finite:
|
|
215
220
|
t = "Number must be finite";
|
|
216
221
|
break;
|
|
217
222
|
default:
|
|
218
|
-
t = e.defaultError,
|
|
223
|
+
t = e.defaultError, v.assertNever(r);
|
|
219
224
|
}
|
|
220
225
|
return { message: t };
|
|
221
226
|
};
|
|
222
|
-
let
|
|
223
|
-
function
|
|
224
|
-
|
|
227
|
+
let Se = W;
|
|
228
|
+
function Me(r) {
|
|
229
|
+
Se = r;
|
|
225
230
|
}
|
|
226
|
-
function
|
|
227
|
-
return
|
|
231
|
+
function ce() {
|
|
232
|
+
return Se;
|
|
228
233
|
}
|
|
229
|
-
const
|
|
234
|
+
const de = (r) => {
|
|
230
235
|
const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
|
|
231
236
|
...n,
|
|
232
237
|
path: a
|
|
@@ -238,24 +243,27 @@ const le = (r) => {
|
|
|
238
243
|
message: n.message
|
|
239
244
|
};
|
|
240
245
|
let o = "";
|
|
241
|
-
const
|
|
242
|
-
for (const
|
|
243
|
-
o =
|
|
246
|
+
const f = s.filter((l) => !!l).slice().reverse();
|
|
247
|
+
for (const l of f)
|
|
248
|
+
o = l(i, { data: e, defaultError: o }).message;
|
|
244
249
|
return {
|
|
245
250
|
...n,
|
|
246
251
|
path: a,
|
|
247
252
|
message: o
|
|
248
253
|
};
|
|
249
|
-
},
|
|
250
|
-
function
|
|
251
|
-
const t =
|
|
254
|
+
}, Ve = [];
|
|
255
|
+
function d(r, e) {
|
|
256
|
+
const t = ce(), s = de({
|
|
252
257
|
issueData: e,
|
|
253
258
|
data: r.data,
|
|
254
259
|
path: r.path,
|
|
255
260
|
errorMaps: [
|
|
256
261
|
r.common.contextualErrorMap,
|
|
262
|
+
// contextual error map is first priority
|
|
257
263
|
r.schemaErrorMap,
|
|
264
|
+
// then schema-bound map if available
|
|
258
265
|
t,
|
|
266
|
+
// then global override map
|
|
259
267
|
t === W ? void 0 : W
|
|
260
268
|
// then global default map
|
|
261
269
|
].filter((n) => !!n)
|
|
@@ -305,30 +313,21 @@ class k {
|
|
|
305
313
|
}
|
|
306
314
|
const m = Object.freeze({
|
|
307
315
|
status: "aborted"
|
|
308
|
-
}),
|
|
309
|
-
function fe(r, e, t, s) {
|
|
310
|
-
if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
311
|
-
return e.get(r);
|
|
312
|
-
}
|
|
313
|
-
function Oe(r, e, t, s, n) {
|
|
314
|
-
if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
315
|
-
return e.set(r, t), t;
|
|
316
|
-
}
|
|
316
|
+
}), B = (r) => ({ status: "dirty", value: r }), b = (r) => ({ status: "valid", value: r }), ge = (r) => r.status === "aborted", ve = (r) => r.status === "dirty", z = (r) => r.status === "valid", Y = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
317
317
|
var h;
|
|
318
318
|
(function(r) {
|
|
319
319
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
320
320
|
})(h || (h = {}));
|
|
321
|
-
|
|
322
|
-
class O {
|
|
321
|
+
class N {
|
|
323
322
|
constructor(e, t, s, n) {
|
|
324
323
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
325
324
|
}
|
|
326
325
|
get path() {
|
|
327
|
-
return this._cachedPath.length || (this._key
|
|
326
|
+
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
329
|
+
const we = (r, e) => {
|
|
330
|
+
if (z(e))
|
|
332
331
|
return { success: !0, data: e.value };
|
|
333
332
|
if (!r.common.issues.length)
|
|
334
333
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -342,22 +341,18 @@ const Se = (r, e) => {
|
|
|
342
341
|
}
|
|
343
342
|
};
|
|
344
343
|
};
|
|
345
|
-
function
|
|
344
|
+
function y(r) {
|
|
346
345
|
if (!r)
|
|
347
346
|
return {};
|
|
348
347
|
const { errorMap: e, invalid_type_error: t, required_error: s, description: n } = r;
|
|
349
348
|
if (e && (t || s))
|
|
350
349
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
351
350
|
return e ? { errorMap: e, description: n } : { errorMap: (i, o) => {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
return i.code === "invalid_enum_value" ? { message: y ?? o.defaultError } : typeof o.data > "u" ? { message: (l = y ?? s) !== null && l !== void 0 ? l : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = y ?? t) !== null && c !== void 0 ? c : o.defaultError };
|
|
351
|
+
const { message: f } = r;
|
|
352
|
+
return i.code === "invalid_enum_value" ? { message: f ?? o.defaultError } : typeof o.data > "u" ? { message: f ?? s ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: f ?? t ?? o.defaultError };
|
|
355
353
|
}, description: n };
|
|
356
354
|
}
|
|
357
355
|
class _ {
|
|
358
|
-
constructor(e) {
|
|
359
|
-
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
|
|
360
|
-
}
|
|
361
356
|
get description() {
|
|
362
357
|
return this._def.description;
|
|
363
358
|
}
|
|
@@ -389,7 +384,7 @@ class _ {
|
|
|
389
384
|
}
|
|
390
385
|
_parseSync(e) {
|
|
391
386
|
const t = this._parse(e);
|
|
392
|
-
if (
|
|
387
|
+
if (Y(t))
|
|
393
388
|
throw new Error("Synchronous parse encountered promise.");
|
|
394
389
|
return t;
|
|
395
390
|
}
|
|
@@ -404,11 +399,10 @@ class _ {
|
|
|
404
399
|
throw s.error;
|
|
405
400
|
}
|
|
406
401
|
safeParse(e, t) {
|
|
407
|
-
|
|
408
|
-
const n = {
|
|
402
|
+
const s = {
|
|
409
403
|
common: {
|
|
410
404
|
issues: [],
|
|
411
|
-
async: (
|
|
405
|
+
async: (t == null ? void 0 : t.async) ?? !1,
|
|
412
406
|
contextualErrorMap: t == null ? void 0 : t.errorMap
|
|
413
407
|
},
|
|
414
408
|
path: (t == null ? void 0 : t.path) || [],
|
|
@@ -416,8 +410,41 @@ class _ {
|
|
|
416
410
|
parent: null,
|
|
417
411
|
data: e,
|
|
418
412
|
parsedType: j(e)
|
|
419
|
-
},
|
|
420
|
-
return
|
|
413
|
+
}, n = this._parseSync({ data: e, path: s.path, parent: s });
|
|
414
|
+
return we(s, n);
|
|
415
|
+
}
|
|
416
|
+
"~validate"(e) {
|
|
417
|
+
var s, n;
|
|
418
|
+
const t = {
|
|
419
|
+
common: {
|
|
420
|
+
issues: [],
|
|
421
|
+
async: !!this["~standard"].async
|
|
422
|
+
},
|
|
423
|
+
path: [],
|
|
424
|
+
schemaErrorMap: this._def.errorMap,
|
|
425
|
+
parent: null,
|
|
426
|
+
data: e,
|
|
427
|
+
parsedType: j(e)
|
|
428
|
+
};
|
|
429
|
+
if (!this["~standard"].async)
|
|
430
|
+
try {
|
|
431
|
+
const a = this._parseSync({ data: e, path: [], parent: t });
|
|
432
|
+
return z(a) ? {
|
|
433
|
+
value: a.value
|
|
434
|
+
} : {
|
|
435
|
+
issues: t.common.issues
|
|
436
|
+
};
|
|
437
|
+
} catch (a) {
|
|
438
|
+
(n = (s = a == null ? void 0 : a.message) == null ? void 0 : s.toLowerCase()) != null && n.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
439
|
+
issues: [],
|
|
440
|
+
async: !0
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
return this._parseAsync({ data: e, path: [], parent: t }).then((a) => z(a) ? {
|
|
444
|
+
value: a.value
|
|
445
|
+
} : {
|
|
446
|
+
issues: t.common.issues
|
|
447
|
+
});
|
|
421
448
|
}
|
|
422
449
|
async parseAsync(e, t) {
|
|
423
450
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -437,24 +464,24 @@ class _ {
|
|
|
437
464
|
parent: null,
|
|
438
465
|
data: e,
|
|
439
466
|
parsedType: j(e)
|
|
440
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
441
|
-
return
|
|
467
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (Y(n) ? n : Promise.resolve(n));
|
|
468
|
+
return we(s, a);
|
|
442
469
|
}
|
|
443
470
|
refine(e, t) {
|
|
444
471
|
const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
|
|
445
472
|
return this._refinement((n, a) => {
|
|
446
473
|
const i = e(n), o = () => a.addIssue({
|
|
447
|
-
code:
|
|
474
|
+
code: c.custom,
|
|
448
475
|
...s(n)
|
|
449
476
|
});
|
|
450
|
-
return typeof Promise < "u" && i instanceof Promise ? i.then((
|
|
477
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((f) => f ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
451
478
|
});
|
|
452
479
|
}
|
|
453
480
|
refinement(e, t) {
|
|
454
481
|
return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
|
|
455
482
|
}
|
|
456
483
|
_refinement(e) {
|
|
457
|
-
return new
|
|
484
|
+
return new O({
|
|
458
485
|
schema: this,
|
|
459
486
|
typeName: p.ZodEffects,
|
|
460
487
|
effect: { type: "refinement", refinement: e }
|
|
@@ -463,30 +490,37 @@ class _ {
|
|
|
463
490
|
superRefine(e) {
|
|
464
491
|
return this._refinement(e);
|
|
465
492
|
}
|
|
493
|
+
constructor(e) {
|
|
494
|
+
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
|
|
495
|
+
version: 1,
|
|
496
|
+
vendor: "zod",
|
|
497
|
+
validate: (t) => this["~validate"](t)
|
|
498
|
+
};
|
|
499
|
+
}
|
|
466
500
|
optional() {
|
|
467
|
-
return
|
|
501
|
+
return A.create(this, this._def);
|
|
468
502
|
}
|
|
469
503
|
nullable() {
|
|
470
|
-
return
|
|
504
|
+
return V.create(this, this._def);
|
|
471
505
|
}
|
|
472
506
|
nullish() {
|
|
473
507
|
return this.nullable().optional();
|
|
474
508
|
}
|
|
475
509
|
array() {
|
|
476
|
-
return S.create(this
|
|
510
|
+
return S.create(this);
|
|
477
511
|
}
|
|
478
512
|
promise() {
|
|
479
|
-
return
|
|
513
|
+
return J.create(this, this._def);
|
|
480
514
|
}
|
|
481
515
|
or(e) {
|
|
482
|
-
return
|
|
516
|
+
return X.create([this, e], this._def);
|
|
483
517
|
}
|
|
484
518
|
and(e) {
|
|
485
|
-
return
|
|
519
|
+
return K.create(this, e, this._def);
|
|
486
520
|
}
|
|
487
521
|
transform(e) {
|
|
488
|
-
return new
|
|
489
|
-
...
|
|
522
|
+
return new O({
|
|
523
|
+
...y(this._def),
|
|
490
524
|
schema: this,
|
|
491
525
|
typeName: p.ZodEffects,
|
|
492
526
|
effect: { type: "transform", transform: e }
|
|
@@ -494,24 +528,24 @@ class _ {
|
|
|
494
528
|
}
|
|
495
529
|
default(e) {
|
|
496
530
|
const t = typeof e == "function" ? e : () => e;
|
|
497
|
-
return new
|
|
498
|
-
...
|
|
531
|
+
return new ne({
|
|
532
|
+
...y(this._def),
|
|
499
533
|
innerType: this,
|
|
500
534
|
defaultValue: t,
|
|
501
535
|
typeName: p.ZodDefault
|
|
502
536
|
});
|
|
503
537
|
}
|
|
504
538
|
brand() {
|
|
505
|
-
return new
|
|
539
|
+
return new ke({
|
|
506
540
|
typeName: p.ZodBranded,
|
|
507
541
|
type: this,
|
|
508
|
-
...
|
|
542
|
+
...y(this._def)
|
|
509
543
|
});
|
|
510
544
|
}
|
|
511
545
|
catch(e) {
|
|
512
546
|
const t = typeof e == "function" ? e : () => e;
|
|
513
|
-
return new
|
|
514
|
-
...
|
|
547
|
+
return new ae({
|
|
548
|
+
...y(this._def),
|
|
515
549
|
innerType: this,
|
|
516
550
|
catchValue: t,
|
|
517
551
|
typeName: p.ZodCatch
|
|
@@ -525,10 +559,10 @@ class _ {
|
|
|
525
559
|
});
|
|
526
560
|
}
|
|
527
561
|
pipe(e) {
|
|
528
|
-
return
|
|
562
|
+
return oe.create(this, e);
|
|
529
563
|
}
|
|
530
564
|
readonly() {
|
|
531
|
-
return
|
|
565
|
+
return ie.create(this);
|
|
532
566
|
}
|
|
533
567
|
isOptional() {
|
|
534
568
|
return this.safeParse(void 0).success;
|
|
@@ -537,31 +571,49 @@ class _ {
|
|
|
537
571
|
return this.safeParse(null).success;
|
|
538
572
|
}
|
|
539
573
|
}
|
|
540
|
-
const
|
|
541
|
-
let
|
|
542
|
-
const
|
|
543
|
-
function
|
|
544
|
-
let e = "
|
|
545
|
-
|
|
574
|
+
const Pe = /^c[^\s-]{8,}$/i, ze = /^[0-9a-z]+$/, Le = /^[0-9A-HJKMNP-TV-Z]{26}$/i, De = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ue = /^[a-z0-9_-]{21}$/i, Be = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Fe = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, We = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, qe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
575
|
+
let ye;
|
|
576
|
+
const Je = /^(?:(?: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])$/, Ye = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, He = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ge = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Qe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Xe = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Oe = "((\\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])))", Ke = new RegExp(`^${Oe}$`);
|
|
577
|
+
function Ae(r) {
|
|
578
|
+
let e = "[0-5]\\d";
|
|
579
|
+
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
580
|
+
const t = r.precision ? "+" : "?";
|
|
581
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
546
582
|
}
|
|
547
|
-
function
|
|
548
|
-
return new RegExp(`^${
|
|
583
|
+
function et(r) {
|
|
584
|
+
return new RegExp(`^${Ae(r)}$`);
|
|
549
585
|
}
|
|
550
|
-
function
|
|
551
|
-
let e = `${
|
|
586
|
+
function Ne(r) {
|
|
587
|
+
let e = `${Oe}T${Ae(r)}`;
|
|
552
588
|
const t = [];
|
|
553
589
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
554
590
|
}
|
|
555
|
-
function
|
|
556
|
-
return !!((e === "v4" || !e) &&
|
|
591
|
+
function tt(r, e) {
|
|
592
|
+
return !!((e === "v4" || !e) && Je.test(r) || (e === "v6" || !e) && He.test(r));
|
|
593
|
+
}
|
|
594
|
+
function rt(r, e) {
|
|
595
|
+
if (!Be.test(r))
|
|
596
|
+
return !1;
|
|
597
|
+
try {
|
|
598
|
+
const [t] = r.split(".");
|
|
599
|
+
if (!t)
|
|
600
|
+
return !1;
|
|
601
|
+
const s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
|
|
602
|
+
return !(typeof n != "object" || n === null || "typ" in n && (n == null ? void 0 : n.typ) !== "JWT" || !n.alg || e && n.alg !== e);
|
|
603
|
+
} catch {
|
|
604
|
+
return !1;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function st(r, e) {
|
|
608
|
+
return !!((e === "v4" || !e) && Ye.test(r) || (e === "v6" || !e) && Ge.test(r));
|
|
557
609
|
}
|
|
558
|
-
class
|
|
610
|
+
class C extends _ {
|
|
559
611
|
_parse(e) {
|
|
560
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
612
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
|
|
561
613
|
const a = this._getOrReturnCtx(e);
|
|
562
|
-
return
|
|
563
|
-
code:
|
|
564
|
-
expected:
|
|
614
|
+
return d(a, {
|
|
615
|
+
code: c.invalid_type,
|
|
616
|
+
expected: u.string,
|
|
565
617
|
received: a.parsedType
|
|
566
618
|
}), m;
|
|
567
619
|
}
|
|
@@ -569,8 +621,8 @@ class Z extends _ {
|
|
|
569
621
|
let n;
|
|
570
622
|
for (const a of this._def.checks)
|
|
571
623
|
if (a.kind === "min")
|
|
572
|
-
e.data.length < a.value && (n = this._getOrReturnCtx(e, n),
|
|
573
|
-
code:
|
|
624
|
+
e.data.length < a.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
625
|
+
code: c.too_small,
|
|
574
626
|
minimum: a.value,
|
|
575
627
|
type: "string",
|
|
576
628
|
inclusive: !0,
|
|
@@ -578,8 +630,8 @@ class Z extends _ {
|
|
|
578
630
|
message: a.message
|
|
579
631
|
}), s.dirty());
|
|
580
632
|
else if (a.kind === "max")
|
|
581
|
-
e.data.length > a.value && (n = this._getOrReturnCtx(e, n),
|
|
582
|
-
code:
|
|
633
|
+
e.data.length > a.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
634
|
+
code: c.too_big,
|
|
583
635
|
maximum: a.value,
|
|
584
636
|
type: "string",
|
|
585
637
|
inclusive: !0,
|
|
@@ -588,15 +640,15 @@ class Z extends _ {
|
|
|
588
640
|
}), s.dirty());
|
|
589
641
|
else if (a.kind === "length") {
|
|
590
642
|
const i = e.data.length > a.value, o = e.data.length < a.value;
|
|
591
|
-
(i || o) && (n = this._getOrReturnCtx(e, n), i ?
|
|
592
|
-
code:
|
|
643
|
+
(i || o) && (n = this._getOrReturnCtx(e, n), i ? d(n, {
|
|
644
|
+
code: c.too_big,
|
|
593
645
|
maximum: a.value,
|
|
594
646
|
type: "string",
|
|
595
647
|
inclusive: !0,
|
|
596
648
|
exact: !0,
|
|
597
649
|
message: a.message
|
|
598
|
-
}) : o &&
|
|
599
|
-
code:
|
|
650
|
+
}) : o && d(n, {
|
|
651
|
+
code: c.too_small,
|
|
600
652
|
minimum: a.value,
|
|
601
653
|
type: "string",
|
|
602
654
|
inclusive: !0,
|
|
@@ -604,109 +656,121 @@ class Z extends _ {
|
|
|
604
656
|
message: a.message
|
|
605
657
|
}), s.dirty());
|
|
606
658
|
} else if (a.kind === "email")
|
|
607
|
-
|
|
659
|
+
We.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
608
660
|
validation: "email",
|
|
609
|
-
code:
|
|
661
|
+
code: c.invalid_string,
|
|
610
662
|
message: a.message
|
|
611
663
|
}), s.dirty());
|
|
612
664
|
else if (a.kind === "emoji")
|
|
613
|
-
|
|
665
|
+
ye || (ye = new RegExp(qe, "u")), ye.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
614
666
|
validation: "emoji",
|
|
615
|
-
code:
|
|
667
|
+
code: c.invalid_string,
|
|
616
668
|
message: a.message
|
|
617
669
|
}), s.dirty());
|
|
618
670
|
else if (a.kind === "uuid")
|
|
619
|
-
|
|
671
|
+
De.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
620
672
|
validation: "uuid",
|
|
621
|
-
code:
|
|
673
|
+
code: c.invalid_string,
|
|
622
674
|
message: a.message
|
|
623
675
|
}), s.dirty());
|
|
624
676
|
else if (a.kind === "nanoid")
|
|
625
|
-
|
|
677
|
+
Ue.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
626
678
|
validation: "nanoid",
|
|
627
|
-
code:
|
|
679
|
+
code: c.invalid_string,
|
|
628
680
|
message: a.message
|
|
629
681
|
}), s.dirty());
|
|
630
682
|
else if (a.kind === "cuid")
|
|
631
|
-
|
|
683
|
+
Pe.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
632
684
|
validation: "cuid",
|
|
633
|
-
code:
|
|
685
|
+
code: c.invalid_string,
|
|
634
686
|
message: a.message
|
|
635
687
|
}), s.dirty());
|
|
636
688
|
else if (a.kind === "cuid2")
|
|
637
|
-
|
|
689
|
+
ze.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
638
690
|
validation: "cuid2",
|
|
639
|
-
code:
|
|
691
|
+
code: c.invalid_string,
|
|
640
692
|
message: a.message
|
|
641
693
|
}), s.dirty());
|
|
642
694
|
else if (a.kind === "ulid")
|
|
643
|
-
|
|
695
|
+
Le.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
644
696
|
validation: "ulid",
|
|
645
|
-
code:
|
|
697
|
+
code: c.invalid_string,
|
|
646
698
|
message: a.message
|
|
647
699
|
}), s.dirty());
|
|
648
700
|
else if (a.kind === "url")
|
|
649
701
|
try {
|
|
650
702
|
new URL(e.data);
|
|
651
703
|
} catch {
|
|
652
|
-
n = this._getOrReturnCtx(e, n),
|
|
704
|
+
n = this._getOrReturnCtx(e, n), d(n, {
|
|
653
705
|
validation: "url",
|
|
654
|
-
code:
|
|
706
|
+
code: c.invalid_string,
|
|
655
707
|
message: a.message
|
|
656
708
|
}), s.dirty();
|
|
657
709
|
}
|
|
658
|
-
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
710
|
+
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
659
711
|
validation: "regex",
|
|
660
|
-
code:
|
|
712
|
+
code: c.invalid_string,
|
|
661
713
|
message: a.message
|
|
662
|
-
}), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n),
|
|
663
|
-
code:
|
|
714
|
+
}), s.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
715
|
+
code: c.invalid_string,
|
|
664
716
|
validation: { includes: a.value, position: a.position },
|
|
665
717
|
message: a.message
|
|
666
|
-
}), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n),
|
|
667
|
-
code:
|
|
718
|
+
}), s.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
719
|
+
code: c.invalid_string,
|
|
668
720
|
validation: { startsWith: a.value },
|
|
669
721
|
message: a.message
|
|
670
|
-
}), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n),
|
|
671
|
-
code:
|
|
722
|
+
}), s.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
723
|
+
code: c.invalid_string,
|
|
672
724
|
validation: { endsWith: a.value },
|
|
673
725
|
message: a.message
|
|
674
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
675
|
-
code:
|
|
726
|
+
}), s.dirty()) : a.kind === "datetime" ? Ne(a).test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
727
|
+
code: c.invalid_string,
|
|
676
728
|
validation: "datetime",
|
|
677
729
|
message: a.message
|
|
678
|
-
}), s.dirty()) : a.kind === "date" ? Ke.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
679
|
-
code:
|
|
730
|
+
}), s.dirty()) : a.kind === "date" ? Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
731
|
+
code: c.invalid_string,
|
|
680
732
|
validation: "date",
|
|
681
733
|
message: a.message
|
|
682
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
683
|
-
code:
|
|
734
|
+
}), s.dirty()) : a.kind === "time" ? et(a).test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
735
|
+
code: c.invalid_string,
|
|
684
736
|
validation: "time",
|
|
685
737
|
message: a.message
|
|
686
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
738
|
+
}), s.dirty()) : a.kind === "duration" ? Fe.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
687
739
|
validation: "duration",
|
|
688
|
-
code:
|
|
740
|
+
code: c.invalid_string,
|
|
689
741
|
message: a.message
|
|
690
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
742
|
+
}), s.dirty()) : a.kind === "ip" ? tt(e.data, a.version) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
691
743
|
validation: "ip",
|
|
692
|
-
code:
|
|
744
|
+
code: c.invalid_string,
|
|
745
|
+
message: a.message
|
|
746
|
+
}), s.dirty()) : a.kind === "jwt" ? rt(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
747
|
+
validation: "jwt",
|
|
748
|
+
code: c.invalid_string,
|
|
749
|
+
message: a.message
|
|
750
|
+
}), s.dirty()) : a.kind === "cidr" ? st(e.data, a.version) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
751
|
+
validation: "cidr",
|
|
752
|
+
code: c.invalid_string,
|
|
693
753
|
message: a.message
|
|
694
|
-
}), s.dirty()) : a.kind === "base64" ? Qe.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
754
|
+
}), s.dirty()) : a.kind === "base64" ? Qe.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
695
755
|
validation: "base64",
|
|
696
|
-
code:
|
|
756
|
+
code: c.invalid_string,
|
|
697
757
|
message: a.message
|
|
698
|
-
}), s.dirty()) :
|
|
758
|
+
}), s.dirty()) : a.kind === "base64url" ? Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
759
|
+
validation: "base64url",
|
|
760
|
+
code: c.invalid_string,
|
|
761
|
+
message: a.message
|
|
762
|
+
}), s.dirty()) : v.assertNever(a);
|
|
699
763
|
return { status: s.value, value: e.data };
|
|
700
764
|
}
|
|
701
765
|
_regex(e, t, s) {
|
|
702
766
|
return this.refinement((n) => e.test(n), {
|
|
703
767
|
validation: t,
|
|
704
|
-
code:
|
|
768
|
+
code: c.invalid_string,
|
|
705
769
|
...h.errToObj(s)
|
|
706
770
|
});
|
|
707
771
|
}
|
|
708
772
|
_addCheck(e) {
|
|
709
|
-
return new
|
|
773
|
+
return new C({
|
|
710
774
|
...this._def,
|
|
711
775
|
checks: [...this._def.checks, e]
|
|
712
776
|
});
|
|
@@ -738,11 +802,22 @@ class Z extends _ {
|
|
|
738
802
|
base64(e) {
|
|
739
803
|
return this._addCheck({ kind: "base64", ...h.errToObj(e) });
|
|
740
804
|
}
|
|
805
|
+
base64url(e) {
|
|
806
|
+
return this._addCheck({
|
|
807
|
+
kind: "base64url",
|
|
808
|
+
...h.errToObj(e)
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
jwt(e) {
|
|
812
|
+
return this._addCheck({ kind: "jwt", ...h.errToObj(e) });
|
|
813
|
+
}
|
|
741
814
|
ip(e) {
|
|
742
815
|
return this._addCheck({ kind: "ip", ...h.errToObj(e) });
|
|
743
816
|
}
|
|
817
|
+
cidr(e) {
|
|
818
|
+
return this._addCheck({ kind: "cidr", ...h.errToObj(e) });
|
|
819
|
+
}
|
|
744
820
|
datetime(e) {
|
|
745
|
-
var t, s;
|
|
746
821
|
return typeof e == "string" ? this._addCheck({
|
|
747
822
|
kind: "datetime",
|
|
748
823
|
precision: null,
|
|
@@ -752,8 +827,8 @@ class Z extends _ {
|
|
|
752
827
|
}) : this._addCheck({
|
|
753
828
|
kind: "datetime",
|
|
754
829
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
755
|
-
offset: (
|
|
756
|
-
local: (
|
|
830
|
+
offset: (e == null ? void 0 : e.offset) ?? !1,
|
|
831
|
+
local: (e == null ? void 0 : e.local) ?? !1,
|
|
757
832
|
...h.errToObj(e == null ? void 0 : e.message)
|
|
758
833
|
});
|
|
759
834
|
}
|
|
@@ -825,26 +900,25 @@ class Z extends _ {
|
|
|
825
900
|
});
|
|
826
901
|
}
|
|
827
902
|
/**
|
|
828
|
-
*
|
|
829
|
-
* @see {@link ZodString.min}
|
|
903
|
+
* Equivalent to `.min(1)`
|
|
830
904
|
*/
|
|
831
905
|
nonempty(e) {
|
|
832
906
|
return this.min(1, h.errToObj(e));
|
|
833
907
|
}
|
|
834
908
|
trim() {
|
|
835
|
-
return new
|
|
909
|
+
return new C({
|
|
836
910
|
...this._def,
|
|
837
911
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
838
912
|
});
|
|
839
913
|
}
|
|
840
914
|
toLowerCase() {
|
|
841
|
-
return new
|
|
915
|
+
return new C({
|
|
842
916
|
...this._def,
|
|
843
917
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
844
918
|
});
|
|
845
919
|
}
|
|
846
920
|
toUpperCase() {
|
|
847
|
-
return new
|
|
921
|
+
return new C({
|
|
848
922
|
...this._def,
|
|
849
923
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
850
924
|
});
|
|
@@ -888,9 +962,15 @@ class Z extends _ {
|
|
|
888
962
|
get isIP() {
|
|
889
963
|
return !!this._def.checks.find((e) => e.kind === "ip");
|
|
890
964
|
}
|
|
965
|
+
get isCIDR() {
|
|
966
|
+
return !!this._def.checks.find((e) => e.kind === "cidr");
|
|
967
|
+
}
|
|
891
968
|
get isBase64() {
|
|
892
969
|
return !!this._def.checks.find((e) => e.kind === "base64");
|
|
893
970
|
}
|
|
971
|
+
get isBase64url() {
|
|
972
|
+
return !!this._def.checks.find((e) => e.kind === "base64url");
|
|
973
|
+
}
|
|
894
974
|
get minLength() {
|
|
895
975
|
let e = null;
|
|
896
976
|
for (const t of this._def.checks)
|
|
@@ -904,62 +984,59 @@ class Z extends _ {
|
|
|
904
984
|
return e;
|
|
905
985
|
}
|
|
906
986
|
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
function tt(r, e) {
|
|
917
|
-
const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
|
|
918
|
-
return a % i / Math.pow(10, n);
|
|
987
|
+
C.create = (r) => new C({
|
|
988
|
+
checks: [],
|
|
989
|
+
typeName: p.ZodString,
|
|
990
|
+
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
991
|
+
...y(r)
|
|
992
|
+
});
|
|
993
|
+
function nt(r, e) {
|
|
994
|
+
const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = Number.parseInt(r.toFixed(n).replace(".", "")), i = Number.parseInt(e.toFixed(n).replace(".", ""));
|
|
995
|
+
return a % i / 10 ** n;
|
|
919
996
|
}
|
|
920
|
-
class
|
|
997
|
+
class I extends _ {
|
|
921
998
|
constructor() {
|
|
922
999
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
923
1000
|
}
|
|
924
1001
|
_parse(e) {
|
|
925
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
1002
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
|
|
926
1003
|
const a = this._getOrReturnCtx(e);
|
|
927
|
-
return
|
|
928
|
-
code:
|
|
929
|
-
expected:
|
|
1004
|
+
return d(a, {
|
|
1005
|
+
code: c.invalid_type,
|
|
1006
|
+
expected: u.number,
|
|
930
1007
|
received: a.parsedType
|
|
931
1008
|
}), m;
|
|
932
1009
|
}
|
|
933
1010
|
let s;
|
|
934
1011
|
const n = new k();
|
|
935
1012
|
for (const a of this._def.checks)
|
|
936
|
-
a.kind === "int" ?
|
|
937
|
-
code:
|
|
1013
|
+
a.kind === "int" ? v.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1014
|
+
code: c.invalid_type,
|
|
938
1015
|
expected: "integer",
|
|
939
1016
|
received: "float",
|
|
940
1017
|
message: a.message
|
|
941
|
-
}), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s),
|
|
942
|
-
code:
|
|
1018
|
+
}), n.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1019
|
+
code: c.too_small,
|
|
943
1020
|
minimum: a.value,
|
|
944
1021
|
type: "number",
|
|
945
1022
|
inclusive: a.inclusive,
|
|
946
1023
|
exact: !1,
|
|
947
1024
|
message: a.message
|
|
948
|
-
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s),
|
|
949
|
-
code:
|
|
1025
|
+
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1026
|
+
code: c.too_big,
|
|
950
1027
|
maximum: a.value,
|
|
951
1028
|
type: "number",
|
|
952
1029
|
inclusive: a.inclusive,
|
|
953
1030
|
exact: !1,
|
|
954
1031
|
message: a.message
|
|
955
|
-
}), n.dirty()) : a.kind === "multipleOf" ?
|
|
956
|
-
code:
|
|
1032
|
+
}), n.dirty()) : a.kind === "multipleOf" ? nt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1033
|
+
code: c.not_multiple_of,
|
|
957
1034
|
multipleOf: a.value,
|
|
958
1035
|
message: a.message
|
|
959
|
-
}), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s),
|
|
960
|
-
code:
|
|
1036
|
+
}), n.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1037
|
+
code: c.not_finite,
|
|
961
1038
|
message: a.message
|
|
962
|
-
}), n.dirty()) :
|
|
1039
|
+
}), n.dirty()) : v.assertNever(a);
|
|
963
1040
|
return { status: n.value, value: e.data };
|
|
964
1041
|
}
|
|
965
1042
|
gte(e, t) {
|
|
@@ -975,7 +1052,7 @@ class A extends _ {
|
|
|
975
1052
|
return this.setLimit("max", e, !1, h.toString(t));
|
|
976
1053
|
}
|
|
977
1054
|
setLimit(e, t, s, n) {
|
|
978
|
-
return new
|
|
1055
|
+
return new I({
|
|
979
1056
|
...this._def,
|
|
980
1057
|
checks: [
|
|
981
1058
|
...this._def.checks,
|
|
@@ -989,7 +1066,7 @@ class A extends _ {
|
|
|
989
1066
|
});
|
|
990
1067
|
}
|
|
991
1068
|
_addCheck(e) {
|
|
992
|
-
return new
|
|
1069
|
+
return new I({
|
|
993
1070
|
...this._def,
|
|
994
1071
|
checks: [...this._def.checks, e]
|
|
995
1072
|
});
|
|
@@ -1071,7 +1148,7 @@ class A extends _ {
|
|
|
1071
1148
|
return e;
|
|
1072
1149
|
}
|
|
1073
1150
|
get isInt() {
|
|
1074
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1151
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && v.isInteger(e.value));
|
|
1075
1152
|
}
|
|
1076
1153
|
get isFinite() {
|
|
1077
1154
|
let e = null, t = null;
|
|
@@ -1083,47 +1160,55 @@ class A extends _ {
|
|
|
1083
1160
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1084
1161
|
}
|
|
1085
1162
|
}
|
|
1086
|
-
|
|
1163
|
+
I.create = (r) => new I({
|
|
1087
1164
|
checks: [],
|
|
1088
1165
|
typeName: p.ZodNumber,
|
|
1089
1166
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1090
|
-
...
|
|
1167
|
+
...y(r)
|
|
1091
1168
|
});
|
|
1092
|
-
class
|
|
1169
|
+
class $ extends _ {
|
|
1093
1170
|
constructor() {
|
|
1094
1171
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1095
1172
|
}
|
|
1096
1173
|
_parse(e) {
|
|
1097
|
-
if (this._def.coerce
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1174
|
+
if (this._def.coerce)
|
|
1175
|
+
try {
|
|
1176
|
+
e.data = BigInt(e.data);
|
|
1177
|
+
} catch {
|
|
1178
|
+
return this._getInvalidInput(e);
|
|
1179
|
+
}
|
|
1180
|
+
if (this._getType(e) !== u.bigint)
|
|
1181
|
+
return this._getInvalidInput(e);
|
|
1105
1182
|
let s;
|
|
1106
1183
|
const n = new k();
|
|
1107
1184
|
for (const a of this._def.checks)
|
|
1108
|
-
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s),
|
|
1109
|
-
code:
|
|
1185
|
+
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1186
|
+
code: c.too_small,
|
|
1110
1187
|
type: "bigint",
|
|
1111
1188
|
minimum: a.value,
|
|
1112
1189
|
inclusive: a.inclusive,
|
|
1113
1190
|
message: a.message
|
|
1114
|
-
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s),
|
|
1115
|
-
code:
|
|
1191
|
+
}), n.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1192
|
+
code: c.too_big,
|
|
1116
1193
|
type: "bigint",
|
|
1117
1194
|
maximum: a.value,
|
|
1118
1195
|
inclusive: a.inclusive,
|
|
1119
1196
|
message: a.message
|
|
1120
|
-
}), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s),
|
|
1121
|
-
code:
|
|
1197
|
+
}), n.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), d(s, {
|
|
1198
|
+
code: c.not_multiple_of,
|
|
1122
1199
|
multipleOf: a.value,
|
|
1123
1200
|
message: a.message
|
|
1124
|
-
}), n.dirty()) :
|
|
1201
|
+
}), n.dirty()) : v.assertNever(a);
|
|
1125
1202
|
return { status: n.value, value: e.data };
|
|
1126
1203
|
}
|
|
1204
|
+
_getInvalidInput(e) {
|
|
1205
|
+
const t = this._getOrReturnCtx(e);
|
|
1206
|
+
return d(t, {
|
|
1207
|
+
code: c.invalid_type,
|
|
1208
|
+
expected: u.bigint,
|
|
1209
|
+
received: t.parsedType
|
|
1210
|
+
}), m;
|
|
1211
|
+
}
|
|
1127
1212
|
gte(e, t) {
|
|
1128
1213
|
return this.setLimit("min", e, !0, h.toString(t));
|
|
1129
1214
|
}
|
|
@@ -1137,7 +1222,7 @@ class M extends _ {
|
|
|
1137
1222
|
return this.setLimit("max", e, !1, h.toString(t));
|
|
1138
1223
|
}
|
|
1139
1224
|
setLimit(e, t, s, n) {
|
|
1140
|
-
return new
|
|
1225
|
+
return new $({
|
|
1141
1226
|
...this._def,
|
|
1142
1227
|
checks: [
|
|
1143
1228
|
...this._def.checks,
|
|
@@ -1151,7 +1236,7 @@ class M extends _ {
|
|
|
1151
1236
|
});
|
|
1152
1237
|
}
|
|
1153
1238
|
_addCheck(e) {
|
|
1154
|
-
return new
|
|
1239
|
+
return new $({
|
|
1155
1240
|
...this._def,
|
|
1156
1241
|
checks: [...this._def.checks, e]
|
|
1157
1242
|
});
|
|
@@ -1208,74 +1293,71 @@ class M extends _ {
|
|
|
1208
1293
|
return e;
|
|
1209
1294
|
}
|
|
1210
1295
|
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
});
|
|
1219
|
-
};
|
|
1220
|
-
class Q extends _ {
|
|
1296
|
+
$.create = (r) => new $({
|
|
1297
|
+
checks: [],
|
|
1298
|
+
typeName: p.ZodBigInt,
|
|
1299
|
+
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
1300
|
+
...y(r)
|
|
1301
|
+
});
|
|
1302
|
+
class H extends _ {
|
|
1221
1303
|
_parse(e) {
|
|
1222
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1304
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
|
|
1223
1305
|
const s = this._getOrReturnCtx(e);
|
|
1224
|
-
return
|
|
1225
|
-
code:
|
|
1226
|
-
expected:
|
|
1306
|
+
return d(s, {
|
|
1307
|
+
code: c.invalid_type,
|
|
1308
|
+
expected: u.boolean,
|
|
1227
1309
|
received: s.parsedType
|
|
1228
1310
|
}), m;
|
|
1229
1311
|
}
|
|
1230
1312
|
return b(e.data);
|
|
1231
1313
|
}
|
|
1232
1314
|
}
|
|
1233
|
-
|
|
1315
|
+
H.create = (r) => new H({
|
|
1234
1316
|
typeName: p.ZodBoolean,
|
|
1235
1317
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1236
|
-
...
|
|
1318
|
+
...y(r)
|
|
1237
1319
|
});
|
|
1238
|
-
class
|
|
1320
|
+
class L extends _ {
|
|
1239
1321
|
_parse(e) {
|
|
1240
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
1322
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
|
|
1241
1323
|
const a = this._getOrReturnCtx(e);
|
|
1242
|
-
return
|
|
1243
|
-
code:
|
|
1244
|
-
expected:
|
|
1324
|
+
return d(a, {
|
|
1325
|
+
code: c.invalid_type,
|
|
1326
|
+
expected: u.date,
|
|
1245
1327
|
received: a.parsedType
|
|
1246
1328
|
}), m;
|
|
1247
1329
|
}
|
|
1248
|
-
if (isNaN(e.data.getTime())) {
|
|
1330
|
+
if (Number.isNaN(e.data.getTime())) {
|
|
1249
1331
|
const a = this._getOrReturnCtx(e);
|
|
1250
|
-
return
|
|
1251
|
-
code:
|
|
1332
|
+
return d(a, {
|
|
1333
|
+
code: c.invalid_date
|
|
1252
1334
|
}), m;
|
|
1253
1335
|
}
|
|
1254
1336
|
const s = new k();
|
|
1255
1337
|
let n;
|
|
1256
1338
|
for (const a of this._def.checks)
|
|
1257
|
-
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n),
|
|
1258
|
-
code:
|
|
1339
|
+
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1340
|
+
code: c.too_small,
|
|
1259
1341
|
message: a.message,
|
|
1260
1342
|
inclusive: !0,
|
|
1261
1343
|
exact: !1,
|
|
1262
1344
|
minimum: a.value,
|
|
1263
1345
|
type: "date"
|
|
1264
|
-
}), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n),
|
|
1265
|
-
code:
|
|
1346
|
+
}), s.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1347
|
+
code: c.too_big,
|
|
1266
1348
|
message: a.message,
|
|
1267
1349
|
inclusive: !0,
|
|
1268
1350
|
exact: !1,
|
|
1269
1351
|
maximum: a.value,
|
|
1270
1352
|
type: "date"
|
|
1271
|
-
}), s.dirty()) :
|
|
1353
|
+
}), s.dirty()) : v.assertNever(a);
|
|
1272
1354
|
return {
|
|
1273
1355
|
status: s.value,
|
|
1274
1356
|
value: new Date(e.data.getTime())
|
|
1275
1357
|
};
|
|
1276
1358
|
}
|
|
1277
1359
|
_addCheck(e) {
|
|
1278
|
-
return new
|
|
1360
|
+
return new L({
|
|
1279
1361
|
...this._def,
|
|
1280
1362
|
checks: [...this._def.checks, e]
|
|
1281
1363
|
});
|
|
@@ -1307,62 +1389,62 @@ class D extends _ {
|
|
|
1307
1389
|
return e != null ? new Date(e) : null;
|
|
1308
1390
|
}
|
|
1309
1391
|
}
|
|
1310
|
-
|
|
1392
|
+
L.create = (r) => new L({
|
|
1311
1393
|
checks: [],
|
|
1312
1394
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1313
1395
|
typeName: p.ZodDate,
|
|
1314
|
-
...
|
|
1396
|
+
...y(r)
|
|
1315
1397
|
});
|
|
1316
|
-
class
|
|
1398
|
+
class ue extends _ {
|
|
1317
1399
|
_parse(e) {
|
|
1318
|
-
if (this._getType(e) !==
|
|
1400
|
+
if (this._getType(e) !== u.symbol) {
|
|
1319
1401
|
const s = this._getOrReturnCtx(e);
|
|
1320
|
-
return
|
|
1321
|
-
code:
|
|
1322
|
-
expected:
|
|
1402
|
+
return d(s, {
|
|
1403
|
+
code: c.invalid_type,
|
|
1404
|
+
expected: u.symbol,
|
|
1323
1405
|
received: s.parsedType
|
|
1324
1406
|
}), m;
|
|
1325
1407
|
}
|
|
1326
1408
|
return b(e.data);
|
|
1327
1409
|
}
|
|
1328
1410
|
}
|
|
1329
|
-
|
|
1411
|
+
ue.create = (r) => new ue({
|
|
1330
1412
|
typeName: p.ZodSymbol,
|
|
1331
|
-
...
|
|
1413
|
+
...y(r)
|
|
1332
1414
|
});
|
|
1333
|
-
class
|
|
1415
|
+
class G extends _ {
|
|
1334
1416
|
_parse(e) {
|
|
1335
|
-
if (this._getType(e) !==
|
|
1417
|
+
if (this._getType(e) !== u.undefined) {
|
|
1336
1418
|
const s = this._getOrReturnCtx(e);
|
|
1337
|
-
return
|
|
1338
|
-
code:
|
|
1339
|
-
expected:
|
|
1419
|
+
return d(s, {
|
|
1420
|
+
code: c.invalid_type,
|
|
1421
|
+
expected: u.undefined,
|
|
1340
1422
|
received: s.parsedType
|
|
1341
1423
|
}), m;
|
|
1342
1424
|
}
|
|
1343
1425
|
return b(e.data);
|
|
1344
1426
|
}
|
|
1345
1427
|
}
|
|
1346
|
-
|
|
1428
|
+
G.create = (r) => new G({
|
|
1347
1429
|
typeName: p.ZodUndefined,
|
|
1348
|
-
...
|
|
1430
|
+
...y(r)
|
|
1349
1431
|
});
|
|
1350
|
-
class
|
|
1432
|
+
class Q extends _ {
|
|
1351
1433
|
_parse(e) {
|
|
1352
|
-
if (this._getType(e) !==
|
|
1434
|
+
if (this._getType(e) !== u.null) {
|
|
1353
1435
|
const s = this._getOrReturnCtx(e);
|
|
1354
|
-
return
|
|
1355
|
-
code:
|
|
1356
|
-
expected:
|
|
1436
|
+
return d(s, {
|
|
1437
|
+
code: c.invalid_type,
|
|
1438
|
+
expected: u.null,
|
|
1357
1439
|
received: s.parsedType
|
|
1358
1440
|
}), m;
|
|
1359
1441
|
}
|
|
1360
1442
|
return b(e.data);
|
|
1361
1443
|
}
|
|
1362
1444
|
}
|
|
1363
|
-
|
|
1445
|
+
Q.create = (r) => new Q({
|
|
1364
1446
|
typeName: p.ZodNull,
|
|
1365
|
-
...
|
|
1447
|
+
...y(r)
|
|
1366
1448
|
});
|
|
1367
1449
|
class q extends _ {
|
|
1368
1450
|
constructor() {
|
|
@@ -1374,9 +1456,9 @@ class q extends _ {
|
|
|
1374
1456
|
}
|
|
1375
1457
|
q.create = (r) => new q({
|
|
1376
1458
|
typeName: p.ZodAny,
|
|
1377
|
-
...
|
|
1459
|
+
...y(r)
|
|
1378
1460
|
});
|
|
1379
|
-
class
|
|
1461
|
+
class P extends _ {
|
|
1380
1462
|
constructor() {
|
|
1381
1463
|
super(...arguments), this._unknown = !0;
|
|
1382
1464
|
}
|
|
@@ -1384,54 +1466,54 @@ class V extends _ {
|
|
|
1384
1466
|
return b(e.data);
|
|
1385
1467
|
}
|
|
1386
1468
|
}
|
|
1387
|
-
|
|
1469
|
+
P.create = (r) => new P({
|
|
1388
1470
|
typeName: p.ZodUnknown,
|
|
1389
|
-
...
|
|
1471
|
+
...y(r)
|
|
1390
1472
|
});
|
|
1391
|
-
class
|
|
1473
|
+
class E extends _ {
|
|
1392
1474
|
_parse(e) {
|
|
1393
1475
|
const t = this._getOrReturnCtx(e);
|
|
1394
|
-
return
|
|
1395
|
-
code:
|
|
1396
|
-
expected:
|
|
1476
|
+
return d(t, {
|
|
1477
|
+
code: c.invalid_type,
|
|
1478
|
+
expected: u.never,
|
|
1397
1479
|
received: t.parsedType
|
|
1398
1480
|
}), m;
|
|
1399
1481
|
}
|
|
1400
1482
|
}
|
|
1401
|
-
|
|
1483
|
+
E.create = (r) => new E({
|
|
1402
1484
|
typeName: p.ZodNever,
|
|
1403
|
-
...
|
|
1485
|
+
...y(r)
|
|
1404
1486
|
});
|
|
1405
|
-
class
|
|
1487
|
+
class le extends _ {
|
|
1406
1488
|
_parse(e) {
|
|
1407
|
-
if (this._getType(e) !==
|
|
1489
|
+
if (this._getType(e) !== u.undefined) {
|
|
1408
1490
|
const s = this._getOrReturnCtx(e);
|
|
1409
|
-
return
|
|
1410
|
-
code:
|
|
1411
|
-
expected:
|
|
1491
|
+
return d(s, {
|
|
1492
|
+
code: c.invalid_type,
|
|
1493
|
+
expected: u.void,
|
|
1412
1494
|
received: s.parsedType
|
|
1413
1495
|
}), m;
|
|
1414
1496
|
}
|
|
1415
1497
|
return b(e.data);
|
|
1416
1498
|
}
|
|
1417
1499
|
}
|
|
1418
|
-
|
|
1500
|
+
le.create = (r) => new le({
|
|
1419
1501
|
typeName: p.ZodVoid,
|
|
1420
|
-
...
|
|
1502
|
+
...y(r)
|
|
1421
1503
|
});
|
|
1422
1504
|
class S extends _ {
|
|
1423
1505
|
_parse(e) {
|
|
1424
1506
|
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
|
1425
|
-
if (t.parsedType !==
|
|
1426
|
-
return
|
|
1427
|
-
code:
|
|
1428
|
-
expected:
|
|
1507
|
+
if (t.parsedType !== u.array)
|
|
1508
|
+
return d(t, {
|
|
1509
|
+
code: c.invalid_type,
|
|
1510
|
+
expected: u.array,
|
|
1429
1511
|
received: t.parsedType
|
|
1430
1512
|
}), m;
|
|
1431
1513
|
if (n.exactLength !== null) {
|
|
1432
1514
|
const i = t.data.length > n.exactLength.value, o = t.data.length < n.exactLength.value;
|
|
1433
|
-
(i || o) && (
|
|
1434
|
-
code: i ?
|
|
1515
|
+
(i || o) && (d(t, {
|
|
1516
|
+
code: i ? c.too_big : c.too_small,
|
|
1435
1517
|
minimum: o ? n.exactLength.value : void 0,
|
|
1436
1518
|
maximum: i ? n.exactLength.value : void 0,
|
|
1437
1519
|
type: "array",
|
|
@@ -1440,23 +1522,23 @@ class S extends _ {
|
|
|
1440
1522
|
message: n.exactLength.message
|
|
1441
1523
|
}), s.dirty());
|
|
1442
1524
|
}
|
|
1443
|
-
if (n.minLength !== null && t.data.length < n.minLength.value && (
|
|
1444
|
-
code:
|
|
1525
|
+
if (n.minLength !== null && t.data.length < n.minLength.value && (d(t, {
|
|
1526
|
+
code: c.too_small,
|
|
1445
1527
|
minimum: n.minLength.value,
|
|
1446
1528
|
type: "array",
|
|
1447
1529
|
inclusive: !0,
|
|
1448
1530
|
exact: !1,
|
|
1449
1531
|
message: n.minLength.message
|
|
1450
|
-
}), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (
|
|
1451
|
-
code:
|
|
1532
|
+
}), s.dirty()), n.maxLength !== null && t.data.length > n.maxLength.value && (d(t, {
|
|
1533
|
+
code: c.too_big,
|
|
1452
1534
|
maximum: n.maxLength.value,
|
|
1453
1535
|
type: "array",
|
|
1454
1536
|
inclusive: !0,
|
|
1455
1537
|
exact: !1,
|
|
1456
1538
|
message: n.maxLength.message
|
|
1457
1539
|
}), s.dirty()), t.common.async)
|
|
1458
|
-
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new
|
|
1459
|
-
const a = [...t.data].map((i, o) => n.type._parseSync(new
|
|
1540
|
+
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new N(t, i, t.path, o)))).then((i) => k.mergeArray(s, i));
|
|
1541
|
+
const a = [...t.data].map((i, o) => n.type._parseSync(new N(t, i, t.path, o)));
|
|
1460
1542
|
return k.mergeArray(s, a);
|
|
1461
1543
|
}
|
|
1462
1544
|
get element() {
|
|
@@ -1490,14 +1572,14 @@ S.create = (r, e) => new S({
|
|
|
1490
1572
|
maxLength: null,
|
|
1491
1573
|
exactLength: null,
|
|
1492
1574
|
typeName: p.ZodArray,
|
|
1493
|
-
...
|
|
1575
|
+
...y(e)
|
|
1494
1576
|
});
|
|
1495
|
-
function
|
|
1577
|
+
function U(r) {
|
|
1496
1578
|
if (r instanceof x) {
|
|
1497
1579
|
const e = {};
|
|
1498
1580
|
for (const t in r.shape) {
|
|
1499
1581
|
const s = r.shape[t];
|
|
1500
|
-
e[t] =
|
|
1582
|
+
e[t] = A.create(U(s));
|
|
1501
1583
|
}
|
|
1502
1584
|
return new x({
|
|
1503
1585
|
...r._def,
|
|
@@ -1505,8 +1587,8 @@ function z(r) {
|
|
|
1505
1587
|
});
|
|
1506
1588
|
} else return r instanceof S ? new S({
|
|
1507
1589
|
...r._def,
|
|
1508
|
-
type:
|
|
1509
|
-
}) : r instanceof
|
|
1590
|
+
type: U(r.element)
|
|
1591
|
+
}) : r instanceof A ? A.create(U(r.unwrap())) : r instanceof V ? V.create(U(r.unwrap())) : r instanceof R ? R.create(r.items.map((e) => U(e))) : r;
|
|
1510
1592
|
}
|
|
1511
1593
|
class x extends _ {
|
|
1512
1594
|
constructor() {
|
|
@@ -1515,71 +1597,71 @@ class x extends _ {
|
|
|
1515
1597
|
_getCached() {
|
|
1516
1598
|
if (this._cached !== null)
|
|
1517
1599
|
return this._cached;
|
|
1518
|
-
const e = this._def.shape(), t =
|
|
1519
|
-
return this._cached = { shape: e, keys: t };
|
|
1600
|
+
const e = this._def.shape(), t = v.objectKeys(e);
|
|
1601
|
+
return this._cached = { shape: e, keys: t }, this._cached;
|
|
1520
1602
|
}
|
|
1521
1603
|
_parse(e) {
|
|
1522
|
-
if (this._getType(e) !==
|
|
1523
|
-
const
|
|
1524
|
-
return
|
|
1525
|
-
code:
|
|
1526
|
-
expected:
|
|
1527
|
-
received:
|
|
1604
|
+
if (this._getType(e) !== u.object) {
|
|
1605
|
+
const l = this._getOrReturnCtx(e);
|
|
1606
|
+
return d(l, {
|
|
1607
|
+
code: c.invalid_type,
|
|
1608
|
+
expected: u.object,
|
|
1609
|
+
received: l.parsedType
|
|
1528
1610
|
}), m;
|
|
1529
1611
|
}
|
|
1530
1612
|
const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1531
|
-
if (!(this._def.catchall instanceof
|
|
1532
|
-
for (const
|
|
1533
|
-
i.includes(
|
|
1534
|
-
const
|
|
1535
|
-
for (const
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
key: { status: "valid", value:
|
|
1539
|
-
value:
|
|
1540
|
-
alwaysSet:
|
|
1613
|
+
if (!(this._def.catchall instanceof E && this._def.unknownKeys === "strip"))
|
|
1614
|
+
for (const l in n.data)
|
|
1615
|
+
i.includes(l) || o.push(l);
|
|
1616
|
+
const f = [];
|
|
1617
|
+
for (const l of i) {
|
|
1618
|
+
const g = a[l], T = n.data[l];
|
|
1619
|
+
f.push({
|
|
1620
|
+
key: { status: "valid", value: l },
|
|
1621
|
+
value: g._parse(new N(n, T, n.path, l)),
|
|
1622
|
+
alwaysSet: l in n.data
|
|
1541
1623
|
});
|
|
1542
1624
|
}
|
|
1543
|
-
if (this._def.catchall instanceof
|
|
1544
|
-
const
|
|
1545
|
-
if (
|
|
1546
|
-
for (const
|
|
1547
|
-
|
|
1548
|
-
key: { status: "valid", value:
|
|
1549
|
-
value: { status: "valid", value: n.data[
|
|
1625
|
+
if (this._def.catchall instanceof E) {
|
|
1626
|
+
const l = this._def.unknownKeys;
|
|
1627
|
+
if (l === "passthrough")
|
|
1628
|
+
for (const g of o)
|
|
1629
|
+
f.push({
|
|
1630
|
+
key: { status: "valid", value: g },
|
|
1631
|
+
value: { status: "valid", value: n.data[g] }
|
|
1550
1632
|
});
|
|
1551
|
-
else if (
|
|
1552
|
-
o.length > 0 && (
|
|
1553
|
-
code:
|
|
1633
|
+
else if (l === "strict")
|
|
1634
|
+
o.length > 0 && (d(n, {
|
|
1635
|
+
code: c.unrecognized_keys,
|
|
1554
1636
|
keys: o
|
|
1555
1637
|
}), s.dirty());
|
|
1556
|
-
else if (
|
|
1638
|
+
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1557
1639
|
} else {
|
|
1558
|
-
const
|
|
1559
|
-
for (const
|
|
1560
|
-
const T = n.data[
|
|
1561
|
-
|
|
1562
|
-
key: { status: "valid", value:
|
|
1563
|
-
value:
|
|
1564
|
-
new
|
|
1640
|
+
const l = this._def.catchall;
|
|
1641
|
+
for (const g of o) {
|
|
1642
|
+
const T = n.data[g];
|
|
1643
|
+
f.push({
|
|
1644
|
+
key: { status: "valid", value: g },
|
|
1645
|
+
value: l._parse(
|
|
1646
|
+
new N(n, T, n.path, g)
|
|
1565
1647
|
//, ctx.child(key), value, getParsedType(value)
|
|
1566
1648
|
),
|
|
1567
|
-
alwaysSet:
|
|
1649
|
+
alwaysSet: g in n.data
|
|
1568
1650
|
});
|
|
1569
1651
|
}
|
|
1570
1652
|
}
|
|
1571
1653
|
return n.common.async ? Promise.resolve().then(async () => {
|
|
1572
|
-
const
|
|
1573
|
-
for (const
|
|
1574
|
-
const T = await
|
|
1575
|
-
|
|
1654
|
+
const l = [];
|
|
1655
|
+
for (const g of f) {
|
|
1656
|
+
const T = await g.key, be = await g.value;
|
|
1657
|
+
l.push({
|
|
1576
1658
|
key: T,
|
|
1577
|
-
value:
|
|
1578
|
-
alwaysSet:
|
|
1659
|
+
value: be,
|
|
1660
|
+
alwaysSet: g.alwaysSet
|
|
1579
1661
|
});
|
|
1580
1662
|
}
|
|
1581
|
-
return
|
|
1582
|
-
}).then((
|
|
1663
|
+
return l;
|
|
1664
|
+
}).then((l) => k.mergeObjectSync(s, l)) : k.mergeObjectSync(s, f);
|
|
1583
1665
|
}
|
|
1584
1666
|
get shape() {
|
|
1585
1667
|
return this._def.shape();
|
|
@@ -1590,12 +1672,12 @@ class x extends _ {
|
|
|
1590
1672
|
unknownKeys: "strict",
|
|
1591
1673
|
...e !== void 0 ? {
|
|
1592
1674
|
errorMap: (t, s) => {
|
|
1593
|
-
var
|
|
1594
|
-
const
|
|
1675
|
+
var a, i;
|
|
1676
|
+
const n = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, t, s).message) ?? s.defaultError;
|
|
1595
1677
|
return t.code === "unrecognized_keys" ? {
|
|
1596
|
-
message:
|
|
1678
|
+
message: h.errToObj(e).message ?? n
|
|
1597
1679
|
} : {
|
|
1598
|
-
message:
|
|
1680
|
+
message: n
|
|
1599
1681
|
};
|
|
1600
1682
|
}
|
|
1601
1683
|
} : {}
|
|
@@ -1722,18 +1804,18 @@ class x extends _ {
|
|
|
1722
1804
|
}
|
|
1723
1805
|
pick(e) {
|
|
1724
1806
|
const t = {};
|
|
1725
|
-
|
|
1807
|
+
for (const s of v.objectKeys(e))
|
|
1726
1808
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
1727
|
-
|
|
1809
|
+
return new x({
|
|
1728
1810
|
...this._def,
|
|
1729
1811
|
shape: () => t
|
|
1730
1812
|
});
|
|
1731
1813
|
}
|
|
1732
1814
|
omit(e) {
|
|
1733
1815
|
const t = {};
|
|
1734
|
-
|
|
1816
|
+
for (const s of v.objectKeys(this.shape))
|
|
1735
1817
|
e[s] || (t[s] = this.shape[s]);
|
|
1736
|
-
|
|
1818
|
+
return new x({
|
|
1737
1819
|
...this._def,
|
|
1738
1820
|
shape: () => t
|
|
1739
1821
|
});
|
|
@@ -1742,60 +1824,61 @@ class x extends _ {
|
|
|
1742
1824
|
* @deprecated
|
|
1743
1825
|
*/
|
|
1744
1826
|
deepPartial() {
|
|
1745
|
-
return
|
|
1827
|
+
return U(this);
|
|
1746
1828
|
}
|
|
1747
1829
|
partial(e) {
|
|
1748
1830
|
const t = {};
|
|
1749
|
-
|
|
1831
|
+
for (const s of v.objectKeys(this.shape)) {
|
|
1750
1832
|
const n = this.shape[s];
|
|
1751
1833
|
e && !e[s] ? t[s] = n : t[s] = n.optional();
|
|
1752
|
-
}
|
|
1834
|
+
}
|
|
1835
|
+
return new x({
|
|
1753
1836
|
...this._def,
|
|
1754
1837
|
shape: () => t
|
|
1755
1838
|
});
|
|
1756
1839
|
}
|
|
1757
1840
|
required(e) {
|
|
1758
1841
|
const t = {};
|
|
1759
|
-
|
|
1842
|
+
for (const s of v.objectKeys(this.shape))
|
|
1760
1843
|
if (e && !e[s])
|
|
1761
1844
|
t[s] = this.shape[s];
|
|
1762
1845
|
else {
|
|
1763
1846
|
let a = this.shape[s];
|
|
1764
|
-
for (; a instanceof
|
|
1847
|
+
for (; a instanceof A; )
|
|
1765
1848
|
a = a._def.innerType;
|
|
1766
1849
|
t[s] = a;
|
|
1767
1850
|
}
|
|
1768
|
-
|
|
1851
|
+
return new x({
|
|
1769
1852
|
...this._def,
|
|
1770
1853
|
shape: () => t
|
|
1771
1854
|
});
|
|
1772
1855
|
}
|
|
1773
1856
|
keyof() {
|
|
1774
|
-
return
|
|
1857
|
+
return Re(v.objectKeys(this.shape));
|
|
1775
1858
|
}
|
|
1776
1859
|
}
|
|
1777
1860
|
x.create = (r, e) => new x({
|
|
1778
1861
|
shape: () => r,
|
|
1779
1862
|
unknownKeys: "strip",
|
|
1780
|
-
catchall:
|
|
1863
|
+
catchall: E.create(),
|
|
1781
1864
|
typeName: p.ZodObject,
|
|
1782
|
-
...
|
|
1865
|
+
...y(e)
|
|
1783
1866
|
});
|
|
1784
1867
|
x.strictCreate = (r, e) => new x({
|
|
1785
1868
|
shape: () => r,
|
|
1786
1869
|
unknownKeys: "strict",
|
|
1787
|
-
catchall:
|
|
1870
|
+
catchall: E.create(),
|
|
1788
1871
|
typeName: p.ZodObject,
|
|
1789
|
-
...
|
|
1872
|
+
...y(e)
|
|
1790
1873
|
});
|
|
1791
1874
|
x.lazycreate = (r, e) => new x({
|
|
1792
1875
|
shape: r,
|
|
1793
1876
|
unknownKeys: "strip",
|
|
1794
|
-
catchall:
|
|
1877
|
+
catchall: E.create(),
|
|
1795
1878
|
typeName: p.ZodObject,
|
|
1796
|
-
...
|
|
1879
|
+
...y(e)
|
|
1797
1880
|
});
|
|
1798
|
-
class
|
|
1881
|
+
class X extends _ {
|
|
1799
1882
|
_parse(e) {
|
|
1800
1883
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1801
1884
|
function n(a) {
|
|
@@ -1806,8 +1889,8 @@ class ee extends _ {
|
|
|
1806
1889
|
if (o.result.status === "dirty")
|
|
1807
1890
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1808
1891
|
const i = a.map((o) => new w(o.ctx.common.issues));
|
|
1809
|
-
return
|
|
1810
|
-
code:
|
|
1892
|
+
return d(t, {
|
|
1893
|
+
code: c.invalid_union,
|
|
1811
1894
|
unionErrors: i
|
|
1812
1895
|
}), m;
|
|
1813
1896
|
}
|
|
@@ -1833,28 +1916,28 @@ class ee extends _ {
|
|
|
1833
1916
|
{
|
|
1834
1917
|
let a;
|
|
1835
1918
|
const i = [];
|
|
1836
|
-
for (const
|
|
1837
|
-
const
|
|
1919
|
+
for (const f of s) {
|
|
1920
|
+
const l = {
|
|
1838
1921
|
...t,
|
|
1839
1922
|
common: {
|
|
1840
1923
|
...t.common,
|
|
1841
1924
|
issues: []
|
|
1842
1925
|
},
|
|
1843
1926
|
parent: null
|
|
1844
|
-
},
|
|
1927
|
+
}, g = f._parseSync({
|
|
1845
1928
|
data: t.data,
|
|
1846
1929
|
path: t.path,
|
|
1847
|
-
parent:
|
|
1930
|
+
parent: l
|
|
1848
1931
|
});
|
|
1849
|
-
if (
|
|
1850
|
-
return
|
|
1851
|
-
|
|
1932
|
+
if (g.status === "valid")
|
|
1933
|
+
return g;
|
|
1934
|
+
g.status === "dirty" && !a && (a = { result: g, ctx: l }), l.common.issues.length && i.push(l.common.issues);
|
|
1852
1935
|
}
|
|
1853
1936
|
if (a)
|
|
1854
1937
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1855
|
-
const o = i.map((
|
|
1856
|
-
return
|
|
1857
|
-
code:
|
|
1938
|
+
const o = i.map((f) => new w(f));
|
|
1939
|
+
return d(t, {
|
|
1940
|
+
code: c.invalid_union,
|
|
1858
1941
|
unionErrors: o
|
|
1859
1942
|
}), m;
|
|
1860
1943
|
}
|
|
@@ -1863,19 +1946,19 @@ class ee extends _ {
|
|
|
1863
1946
|
return this._def.options;
|
|
1864
1947
|
}
|
|
1865
1948
|
}
|
|
1866
|
-
|
|
1949
|
+
X.create = (r, e) => new X({
|
|
1867
1950
|
options: r,
|
|
1868
1951
|
typeName: p.ZodUnion,
|
|
1869
|
-
...
|
|
1952
|
+
...y(e)
|
|
1870
1953
|
});
|
|
1871
|
-
const
|
|
1872
|
-
class
|
|
1954
|
+
const Z = (r) => r instanceof te ? Z(r.schema) : r instanceof O ? Z(r.innerType()) : r instanceof re ? [r.value] : r instanceof M ? r.options : r instanceof se ? v.objectValues(r.enum) : r instanceof ne ? Z(r._def.innerType) : r instanceof G ? [void 0] : r instanceof Q ? [null] : r instanceof A ? [void 0, ...Z(r.unwrap())] : r instanceof V ? [null, ...Z(r.unwrap())] : r instanceof ke || r instanceof ie ? Z(r.unwrap()) : r instanceof ae ? Z(r._def.innerType) : [];
|
|
1955
|
+
class me extends _ {
|
|
1873
1956
|
_parse(e) {
|
|
1874
1957
|
const { ctx: t } = this._processInputParams(e);
|
|
1875
|
-
if (t.parsedType !==
|
|
1876
|
-
return
|
|
1877
|
-
code:
|
|
1878
|
-
expected:
|
|
1958
|
+
if (t.parsedType !== u.object)
|
|
1959
|
+
return d(t, {
|
|
1960
|
+
code: c.invalid_type,
|
|
1961
|
+
expected: u.object,
|
|
1879
1962
|
received: t.parsedType
|
|
1880
1963
|
}), m;
|
|
1881
1964
|
const s = this.discriminator, n = t.data[s], a = this.optionsMap.get(n);
|
|
@@ -1887,8 +1970,8 @@ class ve extends _ {
|
|
|
1887
1970
|
data: t.data,
|
|
1888
1971
|
path: t.path,
|
|
1889
1972
|
parent: t
|
|
1890
|
-
}) : (
|
|
1891
|
-
code:
|
|
1973
|
+
}) : (d(t, {
|
|
1974
|
+
code: c.invalid_union_discriminator,
|
|
1892
1975
|
options: Array.from(this.optionsMap.keys()),
|
|
1893
1976
|
path: [s]
|
|
1894
1977
|
}), m);
|
|
@@ -1913,7 +1996,7 @@ class ve extends _ {
|
|
|
1913
1996
|
static create(e, t, s) {
|
|
1914
1997
|
const n = /* @__PURE__ */ new Map();
|
|
1915
1998
|
for (const a of t) {
|
|
1916
|
-
const i =
|
|
1999
|
+
const i = Z(a.shape[e]);
|
|
1917
2000
|
if (!i.length)
|
|
1918
2001
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
1919
2002
|
for (const o of i) {
|
|
@@ -1922,49 +2005,49 @@ class ve extends _ {
|
|
|
1922
2005
|
n.set(o, a);
|
|
1923
2006
|
}
|
|
1924
2007
|
}
|
|
1925
|
-
return new
|
|
2008
|
+
return new me({
|
|
1926
2009
|
typeName: p.ZodDiscriminatedUnion,
|
|
1927
2010
|
discriminator: e,
|
|
1928
2011
|
options: t,
|
|
1929
2012
|
optionsMap: n,
|
|
1930
|
-
...
|
|
2013
|
+
...y(s)
|
|
1931
2014
|
});
|
|
1932
2015
|
}
|
|
1933
2016
|
}
|
|
1934
|
-
function
|
|
2017
|
+
function xe(r, e) {
|
|
1935
2018
|
const t = j(r), s = j(e);
|
|
1936
2019
|
if (r === e)
|
|
1937
2020
|
return { valid: !0, data: r };
|
|
1938
|
-
if (t ===
|
|
1939
|
-
const n =
|
|
2021
|
+
if (t === u.object && s === u.object) {
|
|
2022
|
+
const n = v.objectKeys(e), a = v.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1940
2023
|
for (const o of a) {
|
|
1941
|
-
const
|
|
1942
|
-
if (!
|
|
2024
|
+
const f = xe(r[o], e[o]);
|
|
2025
|
+
if (!f.valid)
|
|
1943
2026
|
return { valid: !1 };
|
|
1944
|
-
i[o] =
|
|
2027
|
+
i[o] = f.data;
|
|
1945
2028
|
}
|
|
1946
2029
|
return { valid: !0, data: i };
|
|
1947
|
-
} else if (t ===
|
|
2030
|
+
} else if (t === u.array && s === u.array) {
|
|
1948
2031
|
if (r.length !== e.length)
|
|
1949
2032
|
return { valid: !1 };
|
|
1950
2033
|
const n = [];
|
|
1951
2034
|
for (let a = 0; a < r.length; a++) {
|
|
1952
|
-
const i = r[a], o = e[a],
|
|
1953
|
-
if (!
|
|
2035
|
+
const i = r[a], o = e[a], f = xe(i, o);
|
|
2036
|
+
if (!f.valid)
|
|
1954
2037
|
return { valid: !1 };
|
|
1955
|
-
n.push(
|
|
2038
|
+
n.push(f.data);
|
|
1956
2039
|
}
|
|
1957
2040
|
return { valid: !0, data: n };
|
|
1958
|
-
} else return t ===
|
|
2041
|
+
} else return t === u.date && s === u.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
1959
2042
|
}
|
|
1960
|
-
class
|
|
2043
|
+
class K extends _ {
|
|
1961
2044
|
_parse(e) {
|
|
1962
2045
|
const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
|
|
1963
|
-
if (
|
|
2046
|
+
if (ge(a) || ge(i))
|
|
1964
2047
|
return m;
|
|
1965
|
-
const o =
|
|
1966
|
-
return o.valid ? ((
|
|
1967
|
-
code:
|
|
2048
|
+
const o = xe(a.value, i.value);
|
|
2049
|
+
return o.valid ? ((ve(a) || ve(i)) && t.dirty(), { status: t.value, value: o.data }) : (d(s, {
|
|
2050
|
+
code: c.invalid_intersection_types
|
|
1968
2051
|
}), m);
|
|
1969
2052
|
};
|
|
1970
2053
|
return s.common.async ? Promise.all([
|
|
@@ -1989,39 +2072,39 @@ class te extends _ {
|
|
|
1989
2072
|
}));
|
|
1990
2073
|
}
|
|
1991
2074
|
}
|
|
1992
|
-
|
|
2075
|
+
K.create = (r, e, t) => new K({
|
|
1993
2076
|
left: r,
|
|
1994
2077
|
right: e,
|
|
1995
2078
|
typeName: p.ZodIntersection,
|
|
1996
|
-
...
|
|
2079
|
+
...y(t)
|
|
1997
2080
|
});
|
|
1998
|
-
class
|
|
2081
|
+
class R extends _ {
|
|
1999
2082
|
_parse(e) {
|
|
2000
2083
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2001
|
-
if (s.parsedType !==
|
|
2002
|
-
return
|
|
2003
|
-
code:
|
|
2004
|
-
expected:
|
|
2084
|
+
if (s.parsedType !== u.array)
|
|
2085
|
+
return d(s, {
|
|
2086
|
+
code: c.invalid_type,
|
|
2087
|
+
expected: u.array,
|
|
2005
2088
|
received: s.parsedType
|
|
2006
2089
|
}), m;
|
|
2007
2090
|
if (s.data.length < this._def.items.length)
|
|
2008
|
-
return
|
|
2009
|
-
code:
|
|
2091
|
+
return d(s, {
|
|
2092
|
+
code: c.too_small,
|
|
2010
2093
|
minimum: this._def.items.length,
|
|
2011
2094
|
inclusive: !0,
|
|
2012
2095
|
exact: !1,
|
|
2013
2096
|
type: "array"
|
|
2014
2097
|
}), m;
|
|
2015
|
-
!this._def.rest && s.data.length > this._def.items.length && (
|
|
2016
|
-
code:
|
|
2098
|
+
!this._def.rest && s.data.length > this._def.items.length && (d(s, {
|
|
2099
|
+
code: c.too_big,
|
|
2017
2100
|
maximum: this._def.items.length,
|
|
2018
2101
|
inclusive: !0,
|
|
2019
2102
|
exact: !1,
|
|
2020
2103
|
type: "array"
|
|
2021
2104
|
}), t.dirty());
|
|
2022
2105
|
const a = [...s.data].map((i, o) => {
|
|
2023
|
-
const
|
|
2024
|
-
return
|
|
2106
|
+
const f = this._def.items[o] || this._def.rest;
|
|
2107
|
+
return f ? f._parse(new N(s, i, s.path, o)) : null;
|
|
2025
2108
|
}).filter((i) => !!i);
|
|
2026
2109
|
return s.common.async ? Promise.all(a).then((i) => k.mergeArray(t, i)) : k.mergeArray(t, a);
|
|
2027
2110
|
}
|
|
@@ -2029,23 +2112,23 @@ class E extends _ {
|
|
|
2029
2112
|
return this._def.items;
|
|
2030
2113
|
}
|
|
2031
2114
|
rest(e) {
|
|
2032
|
-
return new
|
|
2115
|
+
return new R({
|
|
2033
2116
|
...this._def,
|
|
2034
2117
|
rest: e
|
|
2035
2118
|
});
|
|
2036
2119
|
}
|
|
2037
2120
|
}
|
|
2038
|
-
|
|
2121
|
+
R.create = (r, e) => {
|
|
2039
2122
|
if (!Array.isArray(r))
|
|
2040
2123
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2041
|
-
return new
|
|
2124
|
+
return new R({
|
|
2042
2125
|
items: r,
|
|
2043
2126
|
typeName: p.ZodTuple,
|
|
2044
2127
|
rest: null,
|
|
2045
|
-
...
|
|
2128
|
+
...y(e)
|
|
2046
2129
|
});
|
|
2047
2130
|
};
|
|
2048
|
-
class
|
|
2131
|
+
class ee extends _ {
|
|
2049
2132
|
get keySchema() {
|
|
2050
2133
|
return this._def.keyType;
|
|
2051
2134
|
}
|
|
@@ -2054,17 +2137,17 @@ class re extends _ {
|
|
|
2054
2137
|
}
|
|
2055
2138
|
_parse(e) {
|
|
2056
2139
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2057
|
-
if (s.parsedType !==
|
|
2058
|
-
return
|
|
2059
|
-
code:
|
|
2060
|
-
expected:
|
|
2140
|
+
if (s.parsedType !== u.object)
|
|
2141
|
+
return d(s, {
|
|
2142
|
+
code: c.invalid_type,
|
|
2143
|
+
expected: u.object,
|
|
2061
2144
|
received: s.parsedType
|
|
2062
2145
|
}), m;
|
|
2063
2146
|
const n = [], a = this._def.keyType, i = this._def.valueType;
|
|
2064
2147
|
for (const o in s.data)
|
|
2065
2148
|
n.push({
|
|
2066
|
-
key: a._parse(new
|
|
2067
|
-
value: i._parse(new
|
|
2149
|
+
key: a._parse(new N(s, o, s.path, o)),
|
|
2150
|
+
value: i._parse(new N(s, s.data[o], s.path, o)),
|
|
2068
2151
|
alwaysSet: o in s.data
|
|
2069
2152
|
});
|
|
2070
2153
|
return s.common.async ? k.mergeObjectAsync(t, n) : k.mergeObjectSync(t, n);
|
|
@@ -2073,20 +2156,20 @@ class re extends _ {
|
|
|
2073
2156
|
return this._def.valueType;
|
|
2074
2157
|
}
|
|
2075
2158
|
static create(e, t, s) {
|
|
2076
|
-
return t instanceof _ ? new
|
|
2159
|
+
return t instanceof _ ? new ee({
|
|
2077
2160
|
keyType: e,
|
|
2078
2161
|
valueType: t,
|
|
2079
2162
|
typeName: p.ZodRecord,
|
|
2080
|
-
...
|
|
2081
|
-
}) : new
|
|
2082
|
-
keyType:
|
|
2163
|
+
...y(s)
|
|
2164
|
+
}) : new ee({
|
|
2165
|
+
keyType: C.create(),
|
|
2083
2166
|
valueType: e,
|
|
2084
2167
|
typeName: p.ZodRecord,
|
|
2085
|
-
...
|
|
2168
|
+
...y(t)
|
|
2086
2169
|
});
|
|
2087
2170
|
}
|
|
2088
2171
|
}
|
|
2089
|
-
class
|
|
2172
|
+
class fe extends _ {
|
|
2090
2173
|
get keySchema() {
|
|
2091
2174
|
return this._def.keyType;
|
|
2092
2175
|
}
|
|
@@ -2095,64 +2178,64 @@ class me extends _ {
|
|
|
2095
2178
|
}
|
|
2096
2179
|
_parse(e) {
|
|
2097
2180
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2098
|
-
if (s.parsedType !==
|
|
2099
|
-
return
|
|
2100
|
-
code:
|
|
2101
|
-
expected:
|
|
2181
|
+
if (s.parsedType !== u.map)
|
|
2182
|
+
return d(s, {
|
|
2183
|
+
code: c.invalid_type,
|
|
2184
|
+
expected: u.map,
|
|
2102
2185
|
received: s.parsedType
|
|
2103
2186
|
}), m;
|
|
2104
|
-
const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o,
|
|
2105
|
-
key: n._parse(new
|
|
2106
|
-
value: a._parse(new
|
|
2187
|
+
const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, f], l) => ({
|
|
2188
|
+
key: n._parse(new N(s, o, s.path, [l, "key"])),
|
|
2189
|
+
value: a._parse(new N(s, f, s.path, [l, "value"]))
|
|
2107
2190
|
}));
|
|
2108
2191
|
if (s.common.async) {
|
|
2109
2192
|
const o = /* @__PURE__ */ new Map();
|
|
2110
2193
|
return Promise.resolve().then(async () => {
|
|
2111
|
-
for (const
|
|
2112
|
-
const
|
|
2113
|
-
if (
|
|
2194
|
+
for (const f of i) {
|
|
2195
|
+
const l = await f.key, g = await f.value;
|
|
2196
|
+
if (l.status === "aborted" || g.status === "aborted")
|
|
2114
2197
|
return m;
|
|
2115
|
-
(
|
|
2198
|
+
(l.status === "dirty" || g.status === "dirty") && t.dirty(), o.set(l.value, g.value);
|
|
2116
2199
|
}
|
|
2117
2200
|
return { status: t.value, value: o };
|
|
2118
2201
|
});
|
|
2119
2202
|
} else {
|
|
2120
2203
|
const o = /* @__PURE__ */ new Map();
|
|
2121
|
-
for (const
|
|
2122
|
-
const
|
|
2123
|
-
if (
|
|
2204
|
+
for (const f of i) {
|
|
2205
|
+
const l = f.key, g = f.value;
|
|
2206
|
+
if (l.status === "aborted" || g.status === "aborted")
|
|
2124
2207
|
return m;
|
|
2125
|
-
(
|
|
2208
|
+
(l.status === "dirty" || g.status === "dirty") && t.dirty(), o.set(l.value, g.value);
|
|
2126
2209
|
}
|
|
2127
2210
|
return { status: t.value, value: o };
|
|
2128
2211
|
}
|
|
2129
2212
|
}
|
|
2130
2213
|
}
|
|
2131
|
-
|
|
2214
|
+
fe.create = (r, e, t) => new fe({
|
|
2132
2215
|
valueType: e,
|
|
2133
2216
|
keyType: r,
|
|
2134
2217
|
typeName: p.ZodMap,
|
|
2135
|
-
...
|
|
2218
|
+
...y(t)
|
|
2136
2219
|
});
|
|
2137
|
-
class
|
|
2220
|
+
class D extends _ {
|
|
2138
2221
|
_parse(e) {
|
|
2139
2222
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2140
|
-
if (s.parsedType !==
|
|
2141
|
-
return
|
|
2142
|
-
code:
|
|
2143
|
-
expected:
|
|
2223
|
+
if (s.parsedType !== u.set)
|
|
2224
|
+
return d(s, {
|
|
2225
|
+
code: c.invalid_type,
|
|
2226
|
+
expected: u.set,
|
|
2144
2227
|
received: s.parsedType
|
|
2145
2228
|
}), m;
|
|
2146
2229
|
const n = this._def;
|
|
2147
|
-
n.minSize !== null && s.data.size < n.minSize.value && (
|
|
2148
|
-
code:
|
|
2230
|
+
n.minSize !== null && s.data.size < n.minSize.value && (d(s, {
|
|
2231
|
+
code: c.too_small,
|
|
2149
2232
|
minimum: n.minSize.value,
|
|
2150
2233
|
type: "set",
|
|
2151
2234
|
inclusive: !0,
|
|
2152
2235
|
exact: !1,
|
|
2153
2236
|
message: n.minSize.message
|
|
2154
|
-
}), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (
|
|
2155
|
-
code:
|
|
2237
|
+
}), t.dirty()), n.maxSize !== null && s.data.size > n.maxSize.value && (d(s, {
|
|
2238
|
+
code: c.too_big,
|
|
2156
2239
|
maximum: n.maxSize.value,
|
|
2157
2240
|
type: "set",
|
|
2158
2241
|
inclusive: !0,
|
|
@@ -2160,26 +2243,26 @@ class L extends _ {
|
|
|
2160
2243
|
message: n.maxSize.message
|
|
2161
2244
|
}), t.dirty());
|
|
2162
2245
|
const a = this._def.valueType;
|
|
2163
|
-
function i(
|
|
2164
|
-
const
|
|
2165
|
-
for (const
|
|
2166
|
-
if (
|
|
2246
|
+
function i(f) {
|
|
2247
|
+
const l = /* @__PURE__ */ new Set();
|
|
2248
|
+
for (const g of f) {
|
|
2249
|
+
if (g.status === "aborted")
|
|
2167
2250
|
return m;
|
|
2168
|
-
|
|
2251
|
+
g.status === "dirty" && t.dirty(), l.add(g.value);
|
|
2169
2252
|
}
|
|
2170
|
-
return { status: t.value, value:
|
|
2253
|
+
return { status: t.value, value: l };
|
|
2171
2254
|
}
|
|
2172
|
-
const o = [...s.data.values()].map((
|
|
2173
|
-
return s.common.async ? Promise.all(o).then((
|
|
2255
|
+
const o = [...s.data.values()].map((f, l) => a._parse(new N(s, f, s.path, l)));
|
|
2256
|
+
return s.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
|
|
2174
2257
|
}
|
|
2175
2258
|
min(e, t) {
|
|
2176
|
-
return new
|
|
2259
|
+
return new D({
|
|
2177
2260
|
...this._def,
|
|
2178
2261
|
minSize: { value: e, message: h.toString(t) }
|
|
2179
2262
|
});
|
|
2180
2263
|
}
|
|
2181
2264
|
max(e, t) {
|
|
2182
|
-
return new
|
|
2265
|
+
return new D({
|
|
2183
2266
|
...this._def,
|
|
2184
2267
|
maxSize: { value: e, message: h.toString(t) }
|
|
2185
2268
|
});
|
|
@@ -2191,77 +2274,67 @@ class L extends _ {
|
|
|
2191
2274
|
return this.min(1, e);
|
|
2192
2275
|
}
|
|
2193
2276
|
}
|
|
2194
|
-
|
|
2277
|
+
D.create = (r, e) => new D({
|
|
2195
2278
|
valueType: r,
|
|
2196
2279
|
minSize: null,
|
|
2197
2280
|
maxSize: null,
|
|
2198
2281
|
typeName: p.ZodSet,
|
|
2199
|
-
...
|
|
2282
|
+
...y(e)
|
|
2200
2283
|
});
|
|
2201
|
-
class
|
|
2284
|
+
class F extends _ {
|
|
2202
2285
|
constructor() {
|
|
2203
2286
|
super(...arguments), this.validate = this.implement;
|
|
2204
2287
|
}
|
|
2205
2288
|
_parse(e) {
|
|
2206
2289
|
const { ctx: t } = this._processInputParams(e);
|
|
2207
|
-
if (t.parsedType !==
|
|
2208
|
-
return
|
|
2209
|
-
code:
|
|
2210
|
-
expected:
|
|
2290
|
+
if (t.parsedType !== u.function)
|
|
2291
|
+
return d(t, {
|
|
2292
|
+
code: c.invalid_type,
|
|
2293
|
+
expected: u.function,
|
|
2211
2294
|
received: t.parsedType
|
|
2212
2295
|
}), m;
|
|
2213
|
-
function s(o,
|
|
2214
|
-
return
|
|
2296
|
+
function s(o, f) {
|
|
2297
|
+
return de({
|
|
2215
2298
|
data: o,
|
|
2216
2299
|
path: t.path,
|
|
2217
|
-
errorMaps: [
|
|
2218
|
-
t.common.contextualErrorMap,
|
|
2219
|
-
t.schemaErrorMap,
|
|
2220
|
-
ue(),
|
|
2221
|
-
W
|
|
2222
|
-
].filter((c) => !!c),
|
|
2300
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, ce(), W].filter((l) => !!l),
|
|
2223
2301
|
issueData: {
|
|
2224
|
-
code:
|
|
2225
|
-
argumentsError:
|
|
2302
|
+
code: c.invalid_arguments,
|
|
2303
|
+
argumentsError: f
|
|
2226
2304
|
}
|
|
2227
2305
|
});
|
|
2228
2306
|
}
|
|
2229
|
-
function n(o,
|
|
2230
|
-
return
|
|
2307
|
+
function n(o, f) {
|
|
2308
|
+
return de({
|
|
2231
2309
|
data: o,
|
|
2232
2310
|
path: t.path,
|
|
2233
|
-
errorMaps: [
|
|
2234
|
-
t.common.contextualErrorMap,
|
|
2235
|
-
t.schemaErrorMap,
|
|
2236
|
-
ue(),
|
|
2237
|
-
W
|
|
2238
|
-
].filter((c) => !!c),
|
|
2311
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, ce(), W].filter((l) => !!l),
|
|
2239
2312
|
issueData: {
|
|
2240
|
-
code:
|
|
2241
|
-
returnTypeError:
|
|
2313
|
+
code: c.invalid_return_type,
|
|
2314
|
+
returnTypeError: f
|
|
2242
2315
|
}
|
|
2243
2316
|
});
|
|
2244
2317
|
}
|
|
2245
2318
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2246
|
-
if (this._def.returns instanceof
|
|
2319
|
+
if (this._def.returns instanceof J) {
|
|
2247
2320
|
const o = this;
|
|
2248
|
-
return b(async function(...
|
|
2249
|
-
const
|
|
2250
|
-
throw
|
|
2251
|
-
}), T = await Reflect.apply(i, this,
|
|
2252
|
-
return await o._def.returns._def.type.parseAsync(T, a).catch((
|
|
2253
|
-
throw
|
|
2321
|
+
return b(async function(...f) {
|
|
2322
|
+
const l = new w([]), g = await o._def.args.parseAsync(f, a).catch((pe) => {
|
|
2323
|
+
throw l.addIssue(s(f, pe)), l;
|
|
2324
|
+
}), T = await Reflect.apply(i, this, g);
|
|
2325
|
+
return await o._def.returns._def.type.parseAsync(T, a).catch((pe) => {
|
|
2326
|
+
throw l.addIssue(n(T, pe)), l;
|
|
2254
2327
|
});
|
|
2255
2328
|
});
|
|
2256
2329
|
} else {
|
|
2257
2330
|
const o = this;
|
|
2258
|
-
return b(function(...
|
|
2259
|
-
const
|
|
2260
|
-
if (!
|
|
2261
|
-
throw new w([s(
|
|
2262
|
-
const
|
|
2331
|
+
return b(function(...f) {
|
|
2332
|
+
const l = o._def.args.safeParse(f, a);
|
|
2333
|
+
if (!l.success)
|
|
2334
|
+
throw new w([s(f, l.error)]);
|
|
2335
|
+
const g = Reflect.apply(i, this, l.data), T = o._def.returns.safeParse(g, a);
|
|
2263
2336
|
if (!T.success)
|
|
2264
|
-
throw new w([n(
|
|
2337
|
+
throw new w([n(g, T.error)]);
|
|
2265
2338
|
return T.data;
|
|
2266
2339
|
});
|
|
2267
2340
|
}
|
|
@@ -2273,13 +2346,13 @@ class B extends _ {
|
|
|
2273
2346
|
return this._def.returns;
|
|
2274
2347
|
}
|
|
2275
2348
|
args(...e) {
|
|
2276
|
-
return new
|
|
2349
|
+
return new F({
|
|
2277
2350
|
...this._def,
|
|
2278
|
-
args:
|
|
2351
|
+
args: R.create(e).rest(P.create())
|
|
2279
2352
|
});
|
|
2280
2353
|
}
|
|
2281
2354
|
returns(e) {
|
|
2282
|
-
return new
|
|
2355
|
+
return new F({
|
|
2283
2356
|
...this._def,
|
|
2284
2357
|
returns: e
|
|
2285
2358
|
});
|
|
@@ -2291,15 +2364,15 @@ class B extends _ {
|
|
|
2291
2364
|
return this.parse(e);
|
|
2292
2365
|
}
|
|
2293
2366
|
static create(e, t, s) {
|
|
2294
|
-
return new
|
|
2295
|
-
args: e ||
|
|
2296
|
-
returns: t ||
|
|
2367
|
+
return new F({
|
|
2368
|
+
args: e || R.create([]).rest(P.create()),
|
|
2369
|
+
returns: t || P.create(),
|
|
2297
2370
|
typeName: p.ZodFunction,
|
|
2298
|
-
...
|
|
2371
|
+
...y(s)
|
|
2299
2372
|
});
|
|
2300
2373
|
}
|
|
2301
2374
|
}
|
|
2302
|
-
class
|
|
2375
|
+
class te extends _ {
|
|
2303
2376
|
get schema() {
|
|
2304
2377
|
return this._def.getter();
|
|
2305
2378
|
}
|
|
@@ -2308,18 +2381,18 @@ class se extends _ {
|
|
|
2308
2381
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2309
2382
|
}
|
|
2310
2383
|
}
|
|
2311
|
-
|
|
2384
|
+
te.create = (r, e) => new te({
|
|
2312
2385
|
getter: r,
|
|
2313
2386
|
typeName: p.ZodLazy,
|
|
2314
|
-
...
|
|
2387
|
+
...y(e)
|
|
2315
2388
|
});
|
|
2316
|
-
class
|
|
2389
|
+
class re extends _ {
|
|
2317
2390
|
_parse(e) {
|
|
2318
2391
|
if (e.data !== this._def.value) {
|
|
2319
2392
|
const t = this._getOrReturnCtx(e);
|
|
2320
|
-
return
|
|
2393
|
+
return d(t, {
|
|
2321
2394
|
received: t.data,
|
|
2322
|
-
code:
|
|
2395
|
+
code: c.invalid_literal,
|
|
2323
2396
|
expected: this._def.value
|
|
2324
2397
|
}), m;
|
|
2325
2398
|
}
|
|
@@ -2329,36 +2402,33 @@ class ne extends _ {
|
|
|
2329
2402
|
return this._def.value;
|
|
2330
2403
|
}
|
|
2331
2404
|
}
|
|
2332
|
-
|
|
2405
|
+
re.create = (r, e) => new re({
|
|
2333
2406
|
value: r,
|
|
2334
2407
|
typeName: p.ZodLiteral,
|
|
2335
|
-
...
|
|
2408
|
+
...y(e)
|
|
2336
2409
|
});
|
|
2337
|
-
function
|
|
2338
|
-
return new
|
|
2410
|
+
function Re(r, e) {
|
|
2411
|
+
return new M({
|
|
2339
2412
|
values: r,
|
|
2340
2413
|
typeName: p.ZodEnum,
|
|
2341
|
-
...
|
|
2414
|
+
...y(e)
|
|
2342
2415
|
});
|
|
2343
2416
|
}
|
|
2344
|
-
class
|
|
2345
|
-
constructor() {
|
|
2346
|
-
super(...arguments), J.set(this, void 0);
|
|
2347
|
-
}
|
|
2417
|
+
class M extends _ {
|
|
2348
2418
|
_parse(e) {
|
|
2349
2419
|
if (typeof e.data != "string") {
|
|
2350
2420
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2351
|
-
return
|
|
2352
|
-
expected:
|
|
2421
|
+
return d(t, {
|
|
2422
|
+
expected: v.joinValues(s),
|
|
2353
2423
|
received: t.parsedType,
|
|
2354
|
-
code:
|
|
2424
|
+
code: c.invalid_type
|
|
2355
2425
|
}), m;
|
|
2356
2426
|
}
|
|
2357
|
-
if (
|
|
2427
|
+
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2358
2428
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2359
|
-
return
|
|
2429
|
+
return d(t, {
|
|
2360
2430
|
received: t.data,
|
|
2361
|
-
code:
|
|
2431
|
+
code: c.invalid_enum_value,
|
|
2362
2432
|
options: s
|
|
2363
2433
|
}), m;
|
|
2364
2434
|
}
|
|
@@ -2386,39 +2456,35 @@ class $ extends _ {
|
|
|
2386
2456
|
return e;
|
|
2387
2457
|
}
|
|
2388
2458
|
extract(e, t = this._def) {
|
|
2389
|
-
return
|
|
2459
|
+
return M.create(e, {
|
|
2390
2460
|
...this._def,
|
|
2391
2461
|
...t
|
|
2392
2462
|
});
|
|
2393
2463
|
}
|
|
2394
2464
|
exclude(e, t = this._def) {
|
|
2395
|
-
return
|
|
2465
|
+
return M.create(this.options.filter((s) => !e.includes(s)), {
|
|
2396
2466
|
...this._def,
|
|
2397
2467
|
...t
|
|
2398
2468
|
});
|
|
2399
2469
|
}
|
|
2400
2470
|
}
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
class ae extends _ {
|
|
2404
|
-
constructor() {
|
|
2405
|
-
super(...arguments), H.set(this, void 0);
|
|
2406
|
-
}
|
|
2471
|
+
M.create = Re;
|
|
2472
|
+
class se extends _ {
|
|
2407
2473
|
_parse(e) {
|
|
2408
|
-
const t =
|
|
2409
|
-
if (s.parsedType !==
|
|
2410
|
-
const n =
|
|
2411
|
-
return
|
|
2412
|
-
expected:
|
|
2474
|
+
const t = v.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2475
|
+
if (s.parsedType !== u.string && s.parsedType !== u.number) {
|
|
2476
|
+
const n = v.objectValues(t);
|
|
2477
|
+
return d(s, {
|
|
2478
|
+
expected: v.joinValues(n),
|
|
2413
2479
|
received: s.parsedType,
|
|
2414
|
-
code:
|
|
2480
|
+
code: c.invalid_type
|
|
2415
2481
|
}), m;
|
|
2416
2482
|
}
|
|
2417
|
-
if (
|
|
2418
|
-
const n =
|
|
2419
|
-
return
|
|
2483
|
+
if (this._cache || (this._cache = new Set(v.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2484
|
+
const n = v.objectValues(t);
|
|
2485
|
+
return d(s, {
|
|
2420
2486
|
received: s.data,
|
|
2421
|
-
code:
|
|
2487
|
+
code: c.invalid_enum_value,
|
|
2422
2488
|
options: n
|
|
2423
2489
|
}), m;
|
|
2424
2490
|
}
|
|
@@ -2428,37 +2494,36 @@ class ae extends _ {
|
|
|
2428
2494
|
return this._def.values;
|
|
2429
2495
|
}
|
|
2430
2496
|
}
|
|
2431
|
-
|
|
2432
|
-
ae.create = (r, e) => new ae({
|
|
2497
|
+
se.create = (r, e) => new se({
|
|
2433
2498
|
values: r,
|
|
2434
2499
|
typeName: p.ZodNativeEnum,
|
|
2435
|
-
...
|
|
2500
|
+
...y(e)
|
|
2436
2501
|
});
|
|
2437
|
-
class
|
|
2502
|
+
class J extends _ {
|
|
2438
2503
|
unwrap() {
|
|
2439
2504
|
return this._def.type;
|
|
2440
2505
|
}
|
|
2441
2506
|
_parse(e) {
|
|
2442
2507
|
const { ctx: t } = this._processInputParams(e);
|
|
2443
|
-
if (t.parsedType !==
|
|
2444
|
-
return
|
|
2445
|
-
code:
|
|
2446
|
-
expected:
|
|
2508
|
+
if (t.parsedType !== u.promise && t.common.async === !1)
|
|
2509
|
+
return d(t, {
|
|
2510
|
+
code: c.invalid_type,
|
|
2511
|
+
expected: u.promise,
|
|
2447
2512
|
received: t.parsedType
|
|
2448
2513
|
}), m;
|
|
2449
|
-
const s = t.parsedType ===
|
|
2514
|
+
const s = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
|
|
2450
2515
|
return b(s.then((n) => this._def.type.parseAsync(n, {
|
|
2451
2516
|
path: t.path,
|
|
2452
2517
|
errorMap: t.common.contextualErrorMap
|
|
2453
2518
|
})));
|
|
2454
2519
|
}
|
|
2455
2520
|
}
|
|
2456
|
-
|
|
2521
|
+
J.create = (r, e) => new J({
|
|
2457
2522
|
type: r,
|
|
2458
2523
|
typeName: p.ZodPromise,
|
|
2459
|
-
...
|
|
2524
|
+
...y(e)
|
|
2460
2525
|
});
|
|
2461
|
-
class
|
|
2526
|
+
class O extends _ {
|
|
2462
2527
|
innerType() {
|
|
2463
2528
|
return this._def.schema;
|
|
2464
2529
|
}
|
|
@@ -2468,7 +2533,7 @@ class C extends _ {
|
|
|
2468
2533
|
_parse(e) {
|
|
2469
2534
|
const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
|
|
2470
2535
|
addIssue: (i) => {
|
|
2471
|
-
|
|
2536
|
+
d(s, i), i.fatal ? t.abort() : t.dirty();
|
|
2472
2537
|
},
|
|
2473
2538
|
get path() {
|
|
2474
2539
|
return s.path;
|
|
@@ -2480,12 +2545,12 @@ class C extends _ {
|
|
|
2480
2545
|
return Promise.resolve(i).then(async (o) => {
|
|
2481
2546
|
if (t.value === "aborted")
|
|
2482
2547
|
return m;
|
|
2483
|
-
const
|
|
2548
|
+
const f = await this._def.schema._parseAsync({
|
|
2484
2549
|
data: o,
|
|
2485
2550
|
path: s.path,
|
|
2486
2551
|
parent: s
|
|
2487
2552
|
});
|
|
2488
|
-
return
|
|
2553
|
+
return f.status === "aborted" ? m : f.status === "dirty" || t.value === "dirty" ? B(f.value) : f;
|
|
2489
2554
|
});
|
|
2490
2555
|
{
|
|
2491
2556
|
if (t.value === "aborted")
|
|
@@ -2495,15 +2560,15 @@ class C extends _ {
|
|
|
2495
2560
|
path: s.path,
|
|
2496
2561
|
parent: s
|
|
2497
2562
|
});
|
|
2498
|
-
return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ?
|
|
2563
|
+
return o.status === "aborted" ? m : o.status === "dirty" || t.value === "dirty" ? B(o.value) : o;
|
|
2499
2564
|
}
|
|
2500
2565
|
}
|
|
2501
2566
|
if (n.type === "refinement") {
|
|
2502
2567
|
const i = (o) => {
|
|
2503
|
-
const
|
|
2568
|
+
const f = n.refinement(o, a);
|
|
2504
2569
|
if (s.common.async)
|
|
2505
|
-
return Promise.resolve(
|
|
2506
|
-
if (
|
|
2570
|
+
return Promise.resolve(f);
|
|
2571
|
+
if (f instanceof Promise)
|
|
2507
2572
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2508
2573
|
return o;
|
|
2509
2574
|
};
|
|
@@ -2524,60 +2589,63 @@ class C extends _ {
|
|
|
2524
2589
|
path: s.path,
|
|
2525
2590
|
parent: s
|
|
2526
2591
|
});
|
|
2527
|
-
if (!
|
|
2528
|
-
return
|
|
2592
|
+
if (!z(i))
|
|
2593
|
+
return m;
|
|
2529
2594
|
const o = n.transform(i.value, a);
|
|
2530
2595
|
if (o instanceof Promise)
|
|
2531
2596
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2532
2597
|
return { status: t.value, value: o };
|
|
2533
2598
|
} else
|
|
2534
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) =>
|
|
2535
|
-
|
|
2599
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => z(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({
|
|
2600
|
+
status: t.value,
|
|
2601
|
+
value: o
|
|
2602
|
+
})) : m);
|
|
2603
|
+
v.assertNever(n);
|
|
2536
2604
|
}
|
|
2537
2605
|
}
|
|
2538
|
-
|
|
2606
|
+
O.create = (r, e, t) => new O({
|
|
2539
2607
|
schema: r,
|
|
2540
2608
|
typeName: p.ZodEffects,
|
|
2541
2609
|
effect: e,
|
|
2542
|
-
...
|
|
2610
|
+
...y(t)
|
|
2543
2611
|
});
|
|
2544
|
-
|
|
2612
|
+
O.createWithPreprocess = (r, e, t) => new O({
|
|
2545
2613
|
schema: e,
|
|
2546
2614
|
effect: { type: "preprocess", transform: r },
|
|
2547
2615
|
typeName: p.ZodEffects,
|
|
2548
|
-
...
|
|
2616
|
+
...y(t)
|
|
2549
2617
|
});
|
|
2550
|
-
class
|
|
2618
|
+
class A extends _ {
|
|
2551
2619
|
_parse(e) {
|
|
2552
|
-
return this._getType(e) ===
|
|
2620
|
+
return this._getType(e) === u.undefined ? b(void 0) : this._def.innerType._parse(e);
|
|
2553
2621
|
}
|
|
2554
2622
|
unwrap() {
|
|
2555
2623
|
return this._def.innerType;
|
|
2556
2624
|
}
|
|
2557
2625
|
}
|
|
2558
|
-
|
|
2626
|
+
A.create = (r, e) => new A({
|
|
2559
2627
|
innerType: r,
|
|
2560
2628
|
typeName: p.ZodOptional,
|
|
2561
|
-
...
|
|
2629
|
+
...y(e)
|
|
2562
2630
|
});
|
|
2563
|
-
class
|
|
2631
|
+
class V extends _ {
|
|
2564
2632
|
_parse(e) {
|
|
2565
|
-
return this._getType(e) ===
|
|
2633
|
+
return this._getType(e) === u.null ? b(null) : this._def.innerType._parse(e);
|
|
2566
2634
|
}
|
|
2567
2635
|
unwrap() {
|
|
2568
2636
|
return this._def.innerType;
|
|
2569
2637
|
}
|
|
2570
2638
|
}
|
|
2571
|
-
|
|
2639
|
+
V.create = (r, e) => new V({
|
|
2572
2640
|
innerType: r,
|
|
2573
2641
|
typeName: p.ZodNullable,
|
|
2574
|
-
...
|
|
2642
|
+
...y(e)
|
|
2575
2643
|
});
|
|
2576
|
-
class
|
|
2644
|
+
class ne extends _ {
|
|
2577
2645
|
_parse(e) {
|
|
2578
2646
|
const { ctx: t } = this._processInputParams(e);
|
|
2579
2647
|
let s = t.data;
|
|
2580
|
-
return t.parsedType ===
|
|
2648
|
+
return t.parsedType === u.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
2581
2649
|
data: s,
|
|
2582
2650
|
path: t.path,
|
|
2583
2651
|
parent: t
|
|
@@ -2587,13 +2655,13 @@ class ie extends _ {
|
|
|
2587
2655
|
return this._def.innerType;
|
|
2588
2656
|
}
|
|
2589
2657
|
}
|
|
2590
|
-
|
|
2658
|
+
ne.create = (r, e) => new ne({
|
|
2591
2659
|
innerType: r,
|
|
2592
2660
|
typeName: p.ZodDefault,
|
|
2593
2661
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2594
|
-
...
|
|
2662
|
+
...y(e)
|
|
2595
2663
|
});
|
|
2596
|
-
class
|
|
2664
|
+
class ae extends _ {
|
|
2597
2665
|
_parse(e) {
|
|
2598
2666
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2599
2667
|
...t,
|
|
@@ -2608,7 +2676,7 @@ class oe extends _ {
|
|
|
2608
2676
|
...s
|
|
2609
2677
|
}
|
|
2610
2678
|
});
|
|
2611
|
-
return
|
|
2679
|
+
return Y(n) ? n.then((a) => ({
|
|
2612
2680
|
status: "valid",
|
|
2613
2681
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2614
2682
|
get error() {
|
|
@@ -2630,31 +2698,31 @@ class oe extends _ {
|
|
|
2630
2698
|
return this._def.innerType;
|
|
2631
2699
|
}
|
|
2632
2700
|
}
|
|
2633
|
-
|
|
2701
|
+
ae.create = (r, e) => new ae({
|
|
2634
2702
|
innerType: r,
|
|
2635
2703
|
typeName: p.ZodCatch,
|
|
2636
2704
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2637
|
-
...
|
|
2705
|
+
...y(e)
|
|
2638
2706
|
});
|
|
2639
|
-
class
|
|
2707
|
+
class he extends _ {
|
|
2640
2708
|
_parse(e) {
|
|
2641
|
-
if (this._getType(e) !==
|
|
2709
|
+
if (this._getType(e) !== u.nan) {
|
|
2642
2710
|
const s = this._getOrReturnCtx(e);
|
|
2643
|
-
return
|
|
2644
|
-
code:
|
|
2645
|
-
expected:
|
|
2711
|
+
return d(s, {
|
|
2712
|
+
code: c.invalid_type,
|
|
2713
|
+
expected: u.nan,
|
|
2646
2714
|
received: s.parsedType
|
|
2647
2715
|
}), m;
|
|
2648
2716
|
}
|
|
2649
2717
|
return { status: "valid", value: e.data };
|
|
2650
2718
|
}
|
|
2651
2719
|
}
|
|
2652
|
-
|
|
2720
|
+
he.create = (r) => new he({
|
|
2653
2721
|
typeName: p.ZodNaN,
|
|
2654
|
-
...
|
|
2722
|
+
...y(r)
|
|
2655
2723
|
});
|
|
2656
|
-
const
|
|
2657
|
-
class
|
|
2724
|
+
const at = Symbol("zod_brand");
|
|
2725
|
+
class ke extends _ {
|
|
2658
2726
|
_parse(e) {
|
|
2659
2727
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2660
2728
|
return this._def.type._parse({
|
|
@@ -2667,7 +2735,7 @@ class Te extends _ {
|
|
|
2667
2735
|
return this._def.type;
|
|
2668
2736
|
}
|
|
2669
2737
|
}
|
|
2670
|
-
class
|
|
2738
|
+
class oe extends _ {
|
|
2671
2739
|
_parse(e) {
|
|
2672
2740
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2673
2741
|
if (s.common.async)
|
|
@@ -2677,7 +2745,7 @@ class ce extends _ {
|
|
|
2677
2745
|
path: s.path,
|
|
2678
2746
|
parent: s
|
|
2679
2747
|
});
|
|
2680
|
-
return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(),
|
|
2748
|
+
return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), B(a.value)) : this._def.out._parseAsync({
|
|
2681
2749
|
data: a.value,
|
|
2682
2750
|
path: s.path,
|
|
2683
2751
|
parent: s
|
|
@@ -2700,178 +2768,189 @@ class ce extends _ {
|
|
|
2700
2768
|
}
|
|
2701
2769
|
}
|
|
2702
2770
|
static create(e, t) {
|
|
2703
|
-
return new
|
|
2771
|
+
return new oe({
|
|
2704
2772
|
in: e,
|
|
2705
2773
|
out: t,
|
|
2706
2774
|
typeName: p.ZodPipeline
|
|
2707
2775
|
});
|
|
2708
2776
|
}
|
|
2709
2777
|
}
|
|
2710
|
-
class
|
|
2778
|
+
class ie extends _ {
|
|
2711
2779
|
_parse(e) {
|
|
2712
|
-
const t = this._def.innerType._parse(e), s = (n) => (
|
|
2713
|
-
return
|
|
2780
|
+
const t = this._def.innerType._parse(e), s = (n) => (z(n) && (n.value = Object.freeze(n.value)), n);
|
|
2781
|
+
return Y(t) ? t.then((n) => s(n)) : s(t);
|
|
2714
2782
|
}
|
|
2715
2783
|
unwrap() {
|
|
2716
2784
|
return this._def.innerType;
|
|
2717
2785
|
}
|
|
2718
2786
|
}
|
|
2719
|
-
|
|
2787
|
+
ie.create = (r, e) => new ie({
|
|
2720
2788
|
innerType: r,
|
|
2721
2789
|
typeName: p.ZodReadonly,
|
|
2722
|
-
...
|
|
2790
|
+
...y(e)
|
|
2723
2791
|
});
|
|
2724
|
-
function
|
|
2792
|
+
function Te(r, e) {
|
|
2793
|
+
const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
|
|
2794
|
+
return typeof t == "string" ? { message: t } : t;
|
|
2795
|
+
}
|
|
2796
|
+
function Ze(r, e = {}, t) {
|
|
2725
2797
|
return r ? q.create().superRefine((s, n) => {
|
|
2726
|
-
|
|
2727
|
-
if (
|
|
2728
|
-
|
|
2729
|
-
|
|
2798
|
+
const a = r(s);
|
|
2799
|
+
if (a instanceof Promise)
|
|
2800
|
+
return a.then((i) => {
|
|
2801
|
+
if (!i) {
|
|
2802
|
+
const o = Te(e, s), f = o.fatal ?? t ?? !0;
|
|
2803
|
+
n.addIssue({ code: "custom", ...o, fatal: f });
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
if (!a) {
|
|
2807
|
+
const i = Te(e, s), o = i.fatal ?? t ?? !0;
|
|
2808
|
+
n.addIssue({ code: "custom", ...i, fatal: o });
|
|
2730
2809
|
}
|
|
2731
2810
|
}) : q.create();
|
|
2732
2811
|
}
|
|
2733
|
-
const
|
|
2812
|
+
const it = {
|
|
2734
2813
|
object: x.lazycreate
|
|
2735
2814
|
};
|
|
2736
2815
|
var p;
|
|
2737
2816
|
(function(r) {
|
|
2738
2817
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2739
2818
|
})(p || (p = {}));
|
|
2740
|
-
const
|
|
2819
|
+
const ot = (r, e = {
|
|
2741
2820
|
message: `Input not instance of ${r.name}`
|
|
2742
|
-
}) =>
|
|
2743
|
-
string: (r) =>
|
|
2744
|
-
number: (r) =>
|
|
2745
|
-
boolean: (r) =>
|
|
2821
|
+
}) => Ze((t) => t instanceof r, e), je = C.create, Ee = I.create, ct = he.create, dt = $.create, Ie = H.create, ut = L.create, lt = ue.create, ft = G.create, ht = Q.create, mt = q.create, pt = P.create, yt = E.create, _t = le.create, gt = S.create, vt = x.create, xt = x.strictCreate, kt = X.create, bt = me.create, wt = K.create, Tt = R.create, Ct = ee.create, St = fe.create, Ot = D.create, At = F.create, Nt = te.create, Rt = re.create, Zt = M.create, jt = se.create, Et = J.create, Ce = O.create, It = A.create, $t = V.create, Mt = O.createWithPreprocess, Vt = oe.create, Pt = () => je().optional(), zt = () => Ee().optional(), Lt = () => Ie().optional(), Dt = {
|
|
2822
|
+
string: (r) => C.create({ ...r, coerce: !0 }),
|
|
2823
|
+
number: (r) => I.create({ ...r, coerce: !0 }),
|
|
2824
|
+
boolean: (r) => H.create({
|
|
2746
2825
|
...r,
|
|
2747
2826
|
coerce: !0
|
|
2748
2827
|
}),
|
|
2749
|
-
bigint: (r) =>
|
|
2750
|
-
date: (r) =>
|
|
2751
|
-
},
|
|
2752
|
-
var zt = /* @__PURE__ */ Object.freeze({
|
|
2828
|
+
bigint: (r) => $.create({ ...r, coerce: !0 }),
|
|
2829
|
+
date: (r) => L.create({ ...r, coerce: !0 })
|
|
2830
|
+
}, Ut = m, Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2753
2831
|
__proto__: null,
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
makeIssue: le,
|
|
2758
|
-
EMPTY_PATH: Le,
|
|
2759
|
-
addIssueToContext: u,
|
|
2760
|
-
ParseStatus: k,
|
|
2832
|
+
BRAND: at,
|
|
2833
|
+
DIRTY: B,
|
|
2834
|
+
EMPTY_PATH: Ve,
|
|
2761
2835
|
INVALID: m,
|
|
2762
|
-
|
|
2836
|
+
NEVER: Ut,
|
|
2763
2837
|
OK: b,
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
isValid: G,
|
|
2767
|
-
isAsync: X,
|
|
2768
|
-
get util() {
|
|
2769
|
-
return g;
|
|
2770
|
-
},
|
|
2771
|
-
get objectUtil() {
|
|
2772
|
-
return xe;
|
|
2773
|
-
},
|
|
2774
|
-
ZodParsedType: f,
|
|
2775
|
-
getParsedType: j,
|
|
2776
|
-
ZodType: _,
|
|
2777
|
-
datetimeRegex: Ie,
|
|
2778
|
-
ZodString: Z,
|
|
2779
|
-
ZodNumber: A,
|
|
2780
|
-
ZodBigInt: M,
|
|
2781
|
-
ZodBoolean: Q,
|
|
2782
|
-
ZodDate: D,
|
|
2783
|
-
ZodSymbol: he,
|
|
2784
|
-
ZodUndefined: K,
|
|
2785
|
-
ZodNull: F,
|
|
2838
|
+
ParseStatus: k,
|
|
2839
|
+
Schema: _,
|
|
2786
2840
|
ZodAny: q,
|
|
2787
|
-
ZodUnknown: V,
|
|
2788
|
-
ZodNever: I,
|
|
2789
|
-
ZodVoid: pe,
|
|
2790
2841
|
ZodArray: S,
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
ZodLiteral: ne,
|
|
2802
|
-
ZodEnum: $,
|
|
2803
|
-
ZodNativeEnum: ae,
|
|
2804
|
-
ZodPromise: Y,
|
|
2805
|
-
ZodEffects: C,
|
|
2806
|
-
ZodTransformer: C,
|
|
2807
|
-
ZodOptional: N,
|
|
2808
|
-
ZodNullable: P,
|
|
2809
|
-
ZodDefault: ie,
|
|
2810
|
-
ZodCatch: oe,
|
|
2811
|
-
ZodNaN: ye,
|
|
2812
|
-
BRAND: rt,
|
|
2813
|
-
ZodBranded: Te,
|
|
2814
|
-
ZodPipeline: ce,
|
|
2815
|
-
ZodReadonly: de,
|
|
2816
|
-
custom: Ae,
|
|
2817
|
-
Schema: _,
|
|
2818
|
-
ZodSchema: _,
|
|
2819
|
-
late: st,
|
|
2842
|
+
ZodBigInt: $,
|
|
2843
|
+
ZodBoolean: H,
|
|
2844
|
+
ZodBranded: ke,
|
|
2845
|
+
ZodCatch: ae,
|
|
2846
|
+
ZodDate: L,
|
|
2847
|
+
ZodDefault: ne,
|
|
2848
|
+
ZodDiscriminatedUnion: me,
|
|
2849
|
+
ZodEffects: O,
|
|
2850
|
+
ZodEnum: M,
|
|
2851
|
+
ZodError: w,
|
|
2820
2852
|
get ZodFirstPartyTypeKind() {
|
|
2821
2853
|
return p;
|
|
2822
2854
|
},
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2855
|
+
ZodFunction: F,
|
|
2856
|
+
ZodIntersection: K,
|
|
2857
|
+
ZodIssueCode: c,
|
|
2858
|
+
ZodLazy: te,
|
|
2859
|
+
ZodLiteral: re,
|
|
2860
|
+
ZodMap: fe,
|
|
2861
|
+
ZodNaN: he,
|
|
2862
|
+
ZodNativeEnum: se,
|
|
2863
|
+
ZodNever: E,
|
|
2864
|
+
ZodNull: Q,
|
|
2865
|
+
ZodNullable: V,
|
|
2866
|
+
ZodNumber: I,
|
|
2867
|
+
ZodObject: x,
|
|
2868
|
+
ZodOptional: A,
|
|
2869
|
+
ZodParsedType: u,
|
|
2870
|
+
ZodPipeline: oe,
|
|
2871
|
+
ZodPromise: J,
|
|
2872
|
+
ZodReadonly: ie,
|
|
2873
|
+
ZodRecord: ee,
|
|
2874
|
+
ZodSchema: _,
|
|
2875
|
+
ZodSet: D,
|
|
2876
|
+
ZodString: C,
|
|
2877
|
+
ZodSymbol: ue,
|
|
2878
|
+
ZodTransformer: O,
|
|
2879
|
+
ZodTuple: R,
|
|
2880
|
+
ZodType: _,
|
|
2881
|
+
ZodUndefined: G,
|
|
2882
|
+
ZodUnion: X,
|
|
2883
|
+
ZodUnknown: P,
|
|
2884
|
+
ZodVoid: le,
|
|
2885
|
+
addIssueToContext: d,
|
|
2886
|
+
any: mt,
|
|
2887
|
+
array: gt,
|
|
2888
|
+
bigint: dt,
|
|
2889
|
+
boolean: Ie,
|
|
2890
|
+
coerce: Dt,
|
|
2891
|
+
custom: Ze,
|
|
2892
|
+
date: ut,
|
|
2893
|
+
datetimeRegex: Ne,
|
|
2894
|
+
defaultErrorMap: W,
|
|
2895
|
+
discriminatedUnion: bt,
|
|
2830
2896
|
effect: Ce,
|
|
2831
|
-
enum:
|
|
2832
|
-
function:
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2897
|
+
enum: Zt,
|
|
2898
|
+
function: At,
|
|
2899
|
+
getErrorMap: ce,
|
|
2900
|
+
getParsedType: j,
|
|
2901
|
+
instanceof: ot,
|
|
2902
|
+
intersection: wt,
|
|
2903
|
+
isAborted: ge,
|
|
2904
|
+
isAsync: Y,
|
|
2905
|
+
isDirty: ve,
|
|
2906
|
+
isValid: z,
|
|
2907
|
+
late: it,
|
|
2908
|
+
lazy: Nt,
|
|
2909
|
+
literal: Rt,
|
|
2910
|
+
makeIssue: de,
|
|
2911
|
+
map: St,
|
|
2912
|
+
nan: ct,
|
|
2913
|
+
nativeEnum: jt,
|
|
2914
|
+
never: yt,
|
|
2915
|
+
null: ht,
|
|
2916
|
+
nullable: $t,
|
|
2917
|
+
number: Ee,
|
|
2918
|
+
object: vt,
|
|
2919
|
+
get objectUtil() {
|
|
2920
|
+
return _e;
|
|
2921
|
+
},
|
|
2922
|
+
oboolean: Lt,
|
|
2923
|
+
onumber: zt,
|
|
2924
|
+
optional: It,
|
|
2925
|
+
ostring: Pt,
|
|
2926
|
+
pipeline: Vt,
|
|
2927
|
+
preprocess: Mt,
|
|
2851
2928
|
promise: Et,
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2929
|
+
quotelessJson: $e,
|
|
2930
|
+
record: Ct,
|
|
2931
|
+
set: Ot,
|
|
2932
|
+
setErrorMap: Me,
|
|
2933
|
+
strictObject: xt,
|
|
2934
|
+
string: je,
|
|
2935
|
+
symbol: lt,
|
|
2857
2936
|
transformer: Ce,
|
|
2858
|
-
tuple:
|
|
2859
|
-
undefined:
|
|
2860
|
-
union:
|
|
2861
|
-
unknown:
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
function Ut(...r) {
|
|
2937
|
+
tuple: Tt,
|
|
2938
|
+
undefined: ft,
|
|
2939
|
+
union: kt,
|
|
2940
|
+
unknown: pt,
|
|
2941
|
+
get util() {
|
|
2942
|
+
return v;
|
|
2943
|
+
},
|
|
2944
|
+
void: _t
|
|
2945
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2946
|
+
function Wt(...r) {
|
|
2869
2947
|
return r.map((e) => function(t) {
|
|
2870
2948
|
const { success: s, error: n } = e.safeParse(t);
|
|
2871
2949
|
return s ? !0 : n.flatten().formErrors[0];
|
|
2872
2950
|
});
|
|
2873
2951
|
}
|
|
2874
2952
|
export {
|
|
2875
|
-
|
|
2876
|
-
|
|
2953
|
+
Ft as a,
|
|
2954
|
+
je as s,
|
|
2955
|
+
Wt as z
|
|
2877
2956
|
};
|