Froncubator validator
A simple JavaScript library for validating data. https://github.com/froncubator/validator
Installation and Usage
Install the library with npm install froncubator-validator
const validator = ; validator; //=> truevalidator; //=> falsevalidator; //=> falsevalidator; //=> false validator //=> truevalidator //=> truevalidator //=> falsevalidator //=> false validator //=> truevalidator //=> truevalidator //=> falsevalidator //=> false validator //=> truevalidator //=> truevalidator //=> falsevalidator //=> false validator //=> truevalidator //=> falsevalidator //=> falsevalidator //=> false
Validators list
Validator | Description |
---|---|
isEmail(value) | Check is value is email and return true or false. |
isStr(value, min, max) | Check is value is string and return true or false. You can check count of characters in the string with min or max. (min, max) = not required. |
isInt(value, min, max) | Check is value is integer and return true or false. You can check number with min or max. (min, max) = not required. |
isArr(value, min, max) | Check is value is array and return true or false. You can check array length with min or max. (min, max) = not required. |
isExist(value) | Check is value exist (undefined, null, NaN). |
Froncubator Validator is freely distributable under the terms of the MIT license.