Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kearfy/validlist
Basic Array-based validation module
https://github.com/kearfy/validlist
Last synced: about 2 months ago
JSON representation
Basic Array-based validation module
- Host: GitHub
- URL: https://github.com/kearfy/validlist
- Owner: kearfy
- License: mpl-2.0
- Created: 2020-10-17T13:40:42.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-18T08:36:56.000Z (about 4 years ago)
- Last Synced: 2024-11-19T02:54:03.800Z (about 2 months ago)
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# validlist
Basic Array-based validation module# Usage
You can provide the module with an array of values. If one of the given values counts as negative (false, null, undefined, etc), false will be returned.# Example
In this example plain types are such as booleans, strings and more are being used, but you could of course fill an array with responses from functions afterwhich they can all be validated at once.```javascript
const validate = require('validlist');
const validation1 = [true, 1, 'string'];
const validation2 = [true, 1, 'string', null];validate(validation1); //true, no negative values.
validate(validation2); //false, contains null which counts as negative.
```# Contribution
Please make a pull request. For major changes i kindly ask you to create an issue first where in you can discuss your changes.# Licence
[MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/)