0.0.3 • Published 1 year ago

feature-form-validators v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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]*)$/))
);
0.0.3

1 year ago

0.0.2

1 year ago