Module:GetJSON: Difference between revisions

From AlternateWiki
338 bytes removed ,  1 month ago
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 17:
local value = root
for _, key in ipairs(keys) do
if key:subtonumber(1, 1key) == "#" then
key = tonumber(key:sub(2))
if not key then
return nil
end
local dictKeys = {}
for dictKey in pairs(value) do
table.insert(dictKeys, dictKey)
end
table.sort(dictKeys)
key = dictKeys[key]
end
Line 52 ⟶ 43:
if type(value) == "table" then
if frame.args[4] == "keys" then
-- Return the keys of the table if requested
local str = ""
for k, _ in pairs(value) do
Cookies help us deliver our services. By using our services, you agree to our use of cookies.