UNPKG

@react-form-builder/core

Version:

React JSON Schema Form Builder to create complex, validated, reusable forms with no deep React knowledge required

14 lines (13 loc) 598 B
import { ruleBuilder as e } from "../utils/ruleBuilder.js"; import { zodErrorParams as l, requiredMessage as m } from "./consts.js"; import * as t from "zod/mini"; import { toRuleValidator as a, booleanScheme as i } from "./zodRuleBuilders.js"; const u = { required: e().withValidatorFactory(() => a(i, t.refine((r) => r, { error: m }))), truthy: e().withValidatorFactory(({ message: r }) => a(i, t.refine((o) => o, l(r)))), falsy: e().withValidatorFactory(({ message: r }) => a(i, t.refine((o) => !o, l(r)))) }; export { u as ZodBooleanRules }; //# sourceMappingURL=ZodBooleanRules.js.map