Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/playerony/validator-js
https://github.com/playerony/validator-js
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/playerony/validator-js
- Owner: playerony
- License: mit
- Created: 2018-08-12T09:25:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-21T15:33:06.000Z (about 6 years ago)
- Last Synced: 2024-12-16T04:38:39.041Z (22 days ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# validator-js
## Usage
Simple object validation using JSON schemas - another part of my project at University
###
## Example
```javascript
const data = {
name: "[email protected]",
objects: ["13.12.1995", "13.12.1995"]
};const schema = {
parameters: {
name: {
type: "string",
format: "email"
},
objects: {
type: "array",
items: {
type: "string",
format: "date"
}
}
},
required: ["name", "objects"]
};validate(data, schema);
```###