1 | import {validate, length, forEach, email} from './src/index';
|
2 |
|
3 | let data = {
|
4 | users: ['nauman', ''],
|
5 | people: [{
|
6 | name: 'nauman'
|
7 | }]
|
8 | }
|
9 |
|
10 | validate(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 |