UNPKG

392 BPlain TextView Raw
1import {validate, length, forEach, email} from './src/index';
2
3let data = {
4 users: ['nauman', ''],
5 people: [{
6 name: 'nauman'
7 }]
8}
9
10validate(data, {
11 users: [ forEach([email()]) ],
12 // people: [length(2, 50), forEach({
13 // name: [length(10, 100)]
14 // })]
15}).then(()=>
16{
17 console.log('passed')
18}).catch((err)=>
19{
20 console.log(JSON.stringify(err));
21
22})
\No newline at end of file