A small library for validation stuff.
- Domain Validation
- Email Validation
- Text Validation
- Phone Number Validation
- Number Validation
npm install client-side-validator
or
yarn add client-side-validator
var clientSideValidator = require("client-side-validator");
var FIELDS=clientSideValidator.FIELDS;
var validator=clientSideValidator.validator;
var fieldValues= [{ key: 'sender', type: FIELDS.PHONENUMBER, value:'98' },{ key: 'email', type: FIELDS.EMAIL, value:'[email protected]' }]
var response = validator(fieldValues);
console.log(response)
import { validator, FIELDS } from 'client-side-validator';
const fieldValues= [{ key: 'sender', type: FIELDS.PHONENUMBER, value:'98' },{ key: 'email', type: FIELDS.EMAIL, value:'[email protected]' }]
const response = validator(fieldValues);
console.log(response)
npm test