open-form-validators
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

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`
);

Package Sidebar

Install

npm i open-form-validators

Weekly Downloads

1

Version

1.5.0

License

MIT

Unpacked Size

15.7 kB

Total Files

17

Last publish

Collaborators

  • rootstrap-developers
  • manueljuarez
  • nmachado
  • fsarachu-dev
  • felipegarcia92
  • aguschaer
  • dpresa
  • spereztoledo