feature-form-validators
v0.0.3
Published
Validators for feature-form
Downloads
3
Readme
Status: Experimental
feature-form-validators
contains various validators for the feature-form
library.
import { zodValidator, valibotValidator } from 'feature-form-validators/zod';
import { valibotValidator } from 'feature-form-validators/valibot';
import * as z from 'zod';
import * as v from 'valibot';
const zodNameValidator = zodValidator(
z.string().min(2).max(10).regex(/^([^0-9]*)$/)
);
const valibotNameValidator = valibotValidator(
v.pipe(v.string(), v.minLength(2), v.maxLength(10), v.regex(/^([^0-9]*)$/))
);