improvement : iterates table on table.toString
This commit is contained in:
parent
703d11d8b7
commit
6b04e86980
1 changed files with 13 additions and 1 deletions
|
@ -36,7 +36,19 @@ end
|
||||||
function Table.toString(table)
|
function Table.toString(table)
|
||||||
local string = "{"
|
local string = "{"
|
||||||
for key, value in pairs(table) do
|
for key, value in pairs(table) do
|
||||||
string = string .. key .. ":" .. value .. ","
|
string = string .. key .. ":"
|
||||||
|
if (type(value) == "table") then
|
||||||
|
string = string .. Table.toString(value)
|
||||||
|
elseif type(value) == "boolean" then
|
||||||
|
if (value) then
|
||||||
|
string = string .. "true"
|
||||||
|
else
|
||||||
|
string = string .. "false"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
string = string .. value
|
||||||
|
end
|
||||||
|
string = string .. ","
|
||||||
end
|
end
|
||||||
return string .. "}"
|
return string .. "}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue