MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / custom2

Function custom2

out/cli.cjs:32773–32785  ·  view source on GitHub ↗
(check, params = {}, fatal)

Source from the content-addressed store, hash-verified

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

Callers 1

instanceOfTypeFunction · 0.85

Calls 2

superRefineMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected