Module:GetJSON: Difference between revisions
From AlternateWiki
no edit summary
No edit summary |
No edit summary |
||
Line 31:
return value
end
-- Function to check if a table is an array
local function isArray(table)
local count = 0
for k, _ in pairs(table) do
if type(k) ~= "number" then
return false
end
count = count + 1
end
return #table == count
end
Line 38 ⟶ 50:
if value ~= nil then
if type(value) == "table" then
str = str .. v .. ";"
end
return frame:preprocess(str:sub(1, -2))▼
else
local str = ""
for k, _ in pairs(value) do
str = str .. k .. ";"
end
return frame:preprocess(str:sub(1, -2))
end
▲ return frame:preprocess(str:sub(1, -2))
end
return frame:preprocess(value)
|