Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Core
(view source)
Revision as of 05:14, 29 August 2018
205 bytes added
,
6 years ago
m
no edit summary
Line 281:
Line 281:
end
end
−
function Utils.json(x, i)
+
function Utils.json(x, i
, nested
)
i = i or 0
i = i or 0
local r = ""
local r = ""
if type(x) == "table" then
if type(x) == "table" then
−
r = string.rep(" ", i) .. "{\n"
+
r =
(nested and
string.rep(" ", i
) or ""
) .. "{\n"
for k, v in pairs(x) do
for k, v in pairs(x) do
−
r = r .. string.rep(" ", i + 1) .. tostring(k) .. ": " .. Utils.json(v, i + 1) .. "\n"
+
if type(v) == "table" then
+
r = r .. string.rep(" ", i + 1) .. tostring(k) .. ": " .. Utils.json(v, i + 1
, true) .. "\n"
+
else
+
r = r .. string.rep(" ", i + 1) .. tostring(k) .. ": " .. showValue(x
) .. "\n"
+
end
end
end
r = r .. string.rep(" ", i) .. "}\n"
r = r .. string.rep(" ", i) .. "}\n"
がか
cssedit, gkautomate
7,064
edits