improvement : iterates table on table.toString

This commit is contained in:
Kazhnuz 2021-04-05 09:33:32 +02:00
parent 703d11d8b7
commit 6b04e86980

View file

@ -36,7 +36,19 @@ end
function Table.toString(table)
local string = "{"
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
return string .. "}"
end