-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_test.js
37 lines (36 loc) · 954 Bytes
/
example_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const example_map = require('./example_map.js');
var omv = require('./object_mapper_validator.js');
var inputObject = {
"key_one": "Hey",
"keyTwo": "This",
"key3": "is",
"key_four": "---",
"key5": "some",
"key_six": "key",
"keySeven": "exchange",
"key8": "example",
"ninthkey": [{
"somekey1": "with",
"somekey2": "sub",
"somekeythree": "-",
"somekeyFour": "object",
"somekey_five": ".",
"sixSomekey": "123",
"keysomeSeven": "ABC"
}],
"key10th": "hmm",
"key12": ":)",
"keynew" : [{
"somekey1": "with",
"somekey2": "sub",
"somekeythree": "-",
"somekeyFour": "object",
"somekey_five": ".",
"sixSomekey": "123",
"keysomeSeven": "ABC"
}]
};
let resultObject = omv.mapAndValidate(inputObject, example_map.objectMap);
if (resultObject.error == null) {
console.log(resultObject.result);
}