diff options
author | Jan-Philipp Litza <janphilipp@litza.de> | 2015-08-30 15:45:49 +0200 |
---|---|---|
committer | Jan-Philipp Litza <janphilipp@litza.de> | 2015-08-30 15:52:33 +0200 |
commit | e7645d557c1bd532e49c69f0ab781cf6342067d1 (patch) | |
tree | 06d874a2e8b01b6e91202b413779d864953fd280 /collections | |
parent | e32a877aa48d0e9d87d999026a6c49707b42a7bf (diff) |
luci-lib-jsonc: allow encoding empty lists
To be consistent with the behavior of luci-lib-json, an empty Lua table
should be encoded to an empty JSON list, not an empty JSON object.
To still allow encoding empty JSON objects, the usage of anything other
than a number or a string as a key (for example an empty table or a
function) can be used to force encoding as an object:
json.stringify({}) -- "[]"
json.stringify({[{}] = true}) -- "{}"
Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
Diffstat (limited to 'collections')
0 files changed, 0 insertions, 0 deletions