|
20 | 20 | @file
|
21 | 21 | json service
|
22 | 22 |
|
23 |
| - Esports JSON parsing methods for plugins to use. |
| 23 | + Exports JSON parsing methods for plugins to use. |
24 | 24 |
|
25 |
| - Fuctions of the service: |
26 |
| - js_type - returns the type of the JSON argument, |
| 25 | + Functions of the service: |
| 26 | + json_type - returns the type of the JSON argument, |
27 | 27 | and the parsed value if it's scalar (not object or array)
|
28 | 28 |
|
29 |
| - js_get_array_item - expecs JSON array as an argument, |
30 |
| - and returns the n_item's item's type and value |
| 29 | + json_get_array_item - expects JSON array as an argument, |
| 30 | + and returns the type of the element at index `n_item`. |
31 | 31 | Returns JSV_NOTHING type if the array is shorter
|
32 |
| - than n_item and the actual length of the array in v_len. |
| 32 | + than n_item and the actual length of the array in value_len. |
| 33 | + If successful, then `value` up till `value[value_len]` contains the array |
| 34 | + element at the desired index (n_item). |
33 | 35 |
|
34 |
| - js_get_object_key - expects JSON object as an argument, |
35 |
| - searches for a key in the object, return it's type and value. |
| 36 | + json_get_object_key - expects JSON object as an argument, |
| 37 | + searches for a key in the object, return it's type and stores its value in `value`. |
36 | 38 | JSV_NOTHING if no such key found, the number of keys
|
37 | 39 | in v_len.
|
38 | 40 |
|
39 |
| - js_get_object_nkey - expects JSON object as an argument. |
| 41 | + json_get_object_nkey - expects JSON object as an argument. |
40 | 42 | finds n_key's key in the object, returns it's name, type and value.
|
41 | 43 | JSV_NOTHING if object has less keys than n_key.
|
42 | 44 | */
|
|
0 commit comments