-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathjson.yml
25 lines (25 loc) · 950 Bytes
/
json.yml
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
name: json
scope: "both"
desc: "Contains functions for working with the json format"
desc_ru: "Содержит функции преобразования данных в формат json и наоборот"
constants: []
functions:
- name: "jsondecode"
args: "data"
desc: "converts data to json string"
desc_ru: "преобразует переданные данные в строку в формате json"
example: |-
use json
print jsondecode("{\"key1\":1,\"key2\":[1,2,3],\"key3\":\"text\"}") // {key2=[1, 2, 3], key3=text, key1=1}
- name: "jsonencode"
args: "jsonString, indent = 0"
desc: "converts string to data"
desc_ru: "преобразует строку в формате json в данные"
example: |-
use json
data = {
"key1": 1,
"key2": [1, 2, 3],
"key3": "text"
}
print jsonencode(data) // {"key1":1,"key2":[1,2,3],"key3":"text"}