0.3.3 ⢠Published 6 years ago
min-valid v0.3.3
š MinValid
āļø string validation
$ npm i min-valid --save
Usage
import { isLower } from 'min-valid';
or
var { isLower } = require('min-valid');
Or include it via jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/min-valid@0.3.3/build/index.min.js"></script>
access via object : m
m.isLower('h') // true
- isEmpty(String) : boolean
isEmpty('') // true
isEmpty(' ') // true
isEmpty('h') // false
- isLower(String|Character) : boolean
isLower('h') // true
isLower('H') // false
- isUpper(String|Character) : boolean
isUpper('H') // true
isUpper('h') // false
- isAlpha(String|Character) : boolean
isAlpha('example') // true
isAlpha('1112') // false
- isAlphaNumeric(String|Character) : boolean
isAlphaNumeric('example') // true
isAlphaNumeric('example112') // true
isAlphaNumeric('112') // true
isAlphaNumeric('1112-/*') // false
- isNumeric(String|Character) : boolean
isNumeric('1225') // true
isNumeric('hello1112') // false
isNumeric('hello') // false
- isImage(String, extensions) : boolean
isImage("h.png") // true
isImage("h.mp4") // false
// default extensions : [ 'jpeg', 'jpg', 'png', 'gif', 'svg', 'bmp', 'ico' ]
- isEmail(email, services) : boolean
isEmail('hello.world@gmail.com') // true
isEmail('hello*world@hack.com') // false
isEmail('hello.world@hack.com', ["hack", "gmail"]) // true
isEmail('hello.world@tutanota.com.uk', ["gmail"]) // false
// default services : ["gmail", "outlook", "zoho", "hotmail", "tutanota"]
Notes
- Works both in Node.js and in the browser.
- All pull requests are welcome, feel free.
Licence
MIT