diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-03-28 09:31:07 -0400 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-03-28 09:31:07 -0400 |
commit | 533a5899e3016d01a68048d2d2b05e861e5d4d51 (patch) | |
tree | c3e4af12627509c8f4bffe9cb376b9338387ad19 /util/json.lua | |
parent | afbece2a947a2583a60daf6ec70259992c357e69 (diff) | |
download | prosody-533a5899e3016d01a68048d2d2b05e861e5d4d51.tar.gz prosody-533a5899e3016d01a68048d2d2b05e861e5d4d51.zip |
util.json: Add json.encode_array() (thanks B)
Diffstat (limited to 'util/json.lua')
-rw-r--r-- | util/json.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/json.lua b/util/json.lua index efc602f0..abb87eab 100644 --- a/util/json.lua +++ b/util/json.lua @@ -148,6 +148,11 @@ function json.encode_ordered(obj) simplesave(obj, t); return t_concat(t); end +function json.encode_array(obj) + local t = {}; + arraysave(obj, t); + return t_concat(t); +end ----------------------------------- |