Skip to content

Commit 307cba9

Browse files
committed
docs: add examples for parse_json and to_boolean functions
Signed-off-by: Karthik babu Manam <karthikmanam@gmail.com>
1 parent 57a4201 commit 307cba9

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

website/docs/reference/jp/examples/parse_json.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,18 @@ Decodes a valid JSON encoded string to the appropriate type. Opposite of `to_str
1010

1111
## Examples
1212

13-
TODO
13+
```
14+
parse_json('{"name":"chainsaw","version":"1.0.0"}') == `{"name":"chainsaw","version":"1.0.0"}`
15+
```
16+
17+
```
18+
parse_json('{"enabled":true}').enabled == `true`
19+
```
20+
21+
```
22+
parse_json('[1,2,3]')[1] == `2`
23+
```
24+
25+
```
26+
parse_json('{"items":[{"id":1},{"id":2}]}').items[0].id == `1`
27+
```

website/docs/reference/jp/examples/to_boolean.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,26 @@ It returns true or false for any string, such as 'True', 'TruE', 'False', 'FAlse
1010

1111
## Examples
1212

13-
TODO
13+
```
14+
to_boolean('true') == `true`
15+
```
16+
17+
```
18+
to_boolean('True') == `true`
19+
```
20+
21+
```
22+
to_boolean('TRUE') == `true`
23+
```
24+
25+
```
26+
to_boolean('false') == `false`
27+
```
28+
29+
```
30+
to_boolean('False') == `false`
31+
```
32+
33+
```
34+
to_boolean('FALSE') == `false`
35+
```

0 commit comments

Comments
 (0)