-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
76 lines (62 loc) · 1.24 KB
/
test.js
File metadata and controls
76 lines (62 loc) · 1.24 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import {fromString} from './mod.js'
const ret = fromString(`
This is a comment
title [jevkoconfig1 Example]
[owner]
name [tester]
dob \`''2020-08-05T20:30:01+09:00[Asia/Tokyo][u-ca=japanese]''
[database]
enabled [true]
quoted ['true]
test [Infinity]
ports [[8000][8001][8002]]
data [ [[delta] [phi]] [3.14] ]
temp targets [ cpu [79.5] case [72.0] ]
[servers]
[./[alpha]]
ip [10.0.0.1]
role [frontend]
-\`''absolute section path (like [servers.beta] in ini):''
[[servers][beta]]
ip [10.0.0.2]
role [backend]
-discarded key [[with][a][value]]
-[discarded section]
this key now goes under [[servers][beta]]
[embedded documents]
some json \`'json'
{
"id": "b3df0d",
"count": 55,
"props": {
"return code": "59503a7b",
"status": "pending"
},
"associated ids": [
"3adf7c",
"ff0df7",
"3aa670"
],
"parent": null
}
'json'
more json \`'json'55'json'
json string \`'json'"\\n\\tsomething\\u0000"'json'
json array \`'json'[1, 2, 3, 4, null]'json'
`)
console.log(JSON.stringify(ret, null, 2))
console.log(ret.database.test)
console.log(fromString(`array [
Comment for the
frist value of an array
[1]
Comment for the
second value
[2]
]`))
console.log(fromString(`[A]
key [value]
key2 [value2]
[A]
key [value3]
key3 [value4]`))