open-form-validators
v1.5.0
Published
Validator package for OpenForm
Downloads
2
Readme
OpenForm - Validators
Validator library for OpenForm. It supports several validators such as minValue, maxValue, minLength, maxLength, *minDate, *maxDate, earliestToday, email and also combinations.
Usage
import { validate } from 'open-form-validators';
const result = validate('100', 'minValue60,maxValue100');
If you want to use the validationKeys to write your validation predicate:
import { validate, VALIDATION_KEYS } from 'open-form-validators';
const result = validate(
'100',
`${VALIDATION_KEYS.MIN_VALUE}60,${VALIDATION_KEYS.MAX_VALUE}100`
);