alphabetical sorted json files

This commit is contained in:
sonoro1234
2018-12-02 11:15:17 +01:00
parent 7d963113c9
commit 291922f72c
5 changed files with 10330 additions and 10321 deletions

View File

@@ -85,8 +85,17 @@ local function encode_table(val, stack)
return "[" .. table.concat(res, ",\n") .. "]"
else
---[[
local ordered_keys = {}
for k,v in pairs(val) do
table.insert(ordered_keys,k)
end
table.sort(ordered_keys)
-- Treat as an object
for k, v in pairs(val) do
for _,k in ipairs(ordered_keys) do
local v = val[k]
--]]
--for k, v in pairs(val) do
if type(k) ~= "string" then
error("invalid table: mixed or invalid key types")
end