0.3.3 • Published 6 years ago

min-valid v0.3.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

šŸ“‘ MinValid

āœ”ļø string validation

npm.io Snyk badge bundlephobia badge bundlephobia badge

$ 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("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

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago