Skip to content

Commit c6100e5

Browse files
committed
docs: add documentation for dict:asJson
1 parent 95f390e commit c6100e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Dict.ark

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@
304304

305305
(+ _output "]") }))
306306

307+
# @brief Convert a given dictionary to its JSON representation
308+
# @details The original dictionary is not modified
309+
# @param _D dictionary to convert to JSON
310+
# =begin
311+
# (let data (dict "key" "value" "hello" nil "a" [1 true]))
312+
# (let new (dict "key" "new value" 5 12))
313+
# (print (dict:asJson data new)) # {"key": "value", "hello": null, "a": [1, true]}
314+
# =end
315+
# @author https://github.com/SuperFola
307316
(let asJson (fun (_D) {
308317
(mut _output [])
309318
(let _keys (keys _D))

0 commit comments

Comments
 (0)