(check, params = {}, fatal)
| 32771 | }); |
| 32772 | }; |
| 32773 | function custom2(check, params = {}, fatal) { |
| 32774 | if (check) |
| 32775 | return ZodAny.create().superRefine((data, ctx) => { |
| 32776 | var _a5, _b2; |
| 32777 | if (!check(data)) { |
| 32778 | const p4 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params; |
| 32779 | const _fatal = (_b2 = (_a5 = p4.fatal) !== null && _a5 !== void 0 ? _a5 : fatal) !== null && _b2 !== void 0 ? _b2 : true; |
| 32780 | const p22 = typeof p4 === "string" ? { message: p4 } : p4; |
| 32781 | ctx.addIssue({ code: "custom", ...p22, fatal: _fatal }); |
| 32782 | } |
| 32783 | }); |
| 32784 | return ZodAny.create(); |
| 32785 | } |
| 32786 | exports2.custom = custom2; |
| 32787 | exports2.late = { |
| 32788 | object: ZodObject.lazycreate |
no test coverage detected