https://github.com/nath-green/basic-validate
Helper functions for basic validation
https://github.com/nath-green/basic-validate
javascript npm-package
Last synced: 3 months ago
JSON representation
Helper functions for basic validation
- Host: GitHub
- URL: https://github.com/nath-green/basic-validate
- Owner: nath-green
- Created: 2018-07-26T12:24:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T19:16:20.000Z (over 6 years ago)
- Last Synced: 2025-03-05T10:48:17.584Z (3 months ago)
- Topics: javascript, npm-package
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Basic validation library
### Installation and usage
```npm install basic-validate```
Import full library with direct access to all functions with imported name:
`import * as Validate from 'basic-validate'` used as `Validation.isZero(10)`Imported single functions individually
`import { isZero } from 'basic-validate'` used as `isZero(10)`### Functions
#### isEmpty
Test whether a parameter is empty or not.
```
isEmpty('Hello') // false
```#### isZero
Test whether a parameter is equal (===) to 0.
```
isZero(10) // false
```#### charsBetween
Test whether a parameter is between (and including) min and max characters.
```
charsBetween('Hello', 1, 10) // true
```#### isEmail
Used to test whether a parameter meets email regular expression.
```
isEmail('[email protected]') // true
```#### isTelephone
Used to test whether a parameter meets telephone regular expression.
```
isTelephone('079123456789') // true
```#### isEqual
Used to test whether two parameters are equal (===)
```
isEqual('password', 'passw0rd') // false
```