-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.js
41 lines (26 loc) · 940 Bytes
/
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
38
39
40
41
const kati = require('./')
const str = 'Hello World "_"'
const num = 3.14
const bool = true
const arr = [
'Hello',
'Dinosaur',
{ type: 'sauropod' },
[3.14, ['Dinosaurs', ['Are', 'Awesome']], '🦕'],
]
const obj = {
hello: 'world',
haha: 'baba',
hoho: ['ha!', 'hoo', ['heh', 'rar'], arr],
ha: 'ba',
}
console.log(`Encode String: `, kati.stringify(str))
console.log(`Decode String: `, kati.parse(kati.stringify(str)))
console.log(`Encode Number: `, kati.stringify(num))
console.log(`Decode Number: `, kati.parse(kati.stringify(num)))
console.log(`Encode Boolean `, kati.stringify(bool))
console.log(`Decode Boolean `, kati.parse(kati.stringify(bool)))
console.log(`Encode Array `, kati.stringify(arr))
console.log(`Decode Array `, kati.stringify(kati.parse(kati.stringify(arr))))
console.log(`Encode Object `, kati.stringify(obj))
console.log(`Decode Object `, kati.stringify(kati.parse(kati.stringify(obj))))