Software /
code /
prosody
Comparison
util/json.lua @ 5395:ec33d72a08b6
util.json: Add json.encode_array() (thanks B)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 28 Mar 2013 09:31:07 -0400 |
parent | 4474:b08a46cf06e6 |
child | 5436:a4ba5819bf50 |
comparison
equal
deleted
inserted
replaced
5393:57c4964eff0b | 5395:ec33d72a08b6 |
---|---|
144 return t_concat(t); | 144 return t_concat(t); |
145 end | 145 end |
146 function json.encode_ordered(obj) | 146 function json.encode_ordered(obj) |
147 local t = { ordered = true }; | 147 local t = { ordered = true }; |
148 simplesave(obj, t); | 148 simplesave(obj, t); |
149 return t_concat(t); | |
150 end | |
151 function json.encode_array(obj) | |
152 local t = {}; | |
153 arraysave(obj, t); | |
149 return t_concat(t); | 154 return t_concat(t); |
150 end | 155 end |
151 | 156 |
152 ----------------------------------- | 157 ----------------------------------- |
153 | 158 |