# HG changeset patch # User Matthew Wild # Date 1364477467 14400 # Node ID ec33d72a08b6e88b683525f22efba7b400de765b # Parent 57c4964eff0bd0d761888d04c282d2516de5d934 util.json: Add json.encode_array() (thanks B) diff -r 57c4964eff0b -r ec33d72a08b6 util/json.lua --- a/util/json.lua Thu Mar 28 12:49:19 2013 +0100 +++ b/util/json.lua Thu Mar 28 09:31:07 2013 -0400 @@ -148,6 +148,11 @@ simplesave(obj, t); return t_concat(t); end +function json.encode_array(obj) + local t = {}; + arraysave(obj, t); + return t_concat(t); +end -----------------------------------