Power Validator is a lightweight all in one library for the validation and respective utils which we use in the everyday project/product development.
Our Mission is to bring in all the possible validation functions and helper utils into to one place
We Support Node ES6 Modules, plain javascript, typescript. AMD modules
$ npm install power-validator
const PowerValidator = require("power-validator");
let status = PowerValidator.isString("Power Validator");
console.log(status);
you can check our cdn source for the latest version ro you can download form the Github release
https://cdn.jsdelivr.net/npm/power-validator/dist/power-validator.min.js
<script src = "https://cdn.jsdelivr.net/npm/power-validator/dist/power-validator.min.js" >
<script type = "text/javascript">
var name = "Power Validator";
console.log( PowerValidator.isString(name)); 'true'
var number = 100;
console.log( PowerValidator.isString(number)); 'false'
</script>
Our Validation functions are currently classifed into following type
* String Validator - function's to validate string
* Number Validator - function's to validate numbes, floats etc
* Array Validator - function's to validate array.
Function | README |
---|---|
isString | Return true if the input is ("typeof string != "string") |
isStringNull | Return true if the input is (null undefind "null") |
isStringEmpty | Return true if the input is (null undefind "" "null") |
isStringValid | Return false if the input is (null undefind "null" "typeof string != "string" "" ) |
isCapitalized | Return true if the isStringValid && First Charcter is Capticalized |
Function | README |
---|---|
isNumber(input) | Return true if the input is ("typeof input != "string") |
isZero(input) | Return true if the input is zero |
isPostiveNumber(input) | Return true if the input is zero or greater than zero |
isNegativeNumber(input) | Return true if the input less than zero |
Function | README |
---|---|
isArray(input) | Return true if the input is ("typeof input != "array") |
isArrayEmpty(input) | Return true if the input array empty |
Function | README |
---|---|
isEmailAddress(input) | Return true if the input is valid email (works on the mordern email) |