Модуль:Песочница/Vavilexxx/debug
Перейти к навигации
Перейти к поиску
Документация
local function DEBUG(indata, shift)
if shift == nil then
shift = ''
end
if string.len(shift) > 100 then
return 'table'
end
if type(indata) == 'table' then
local res = '{'
for key, value in pairs(indata) do
res = res .. shift .. key .. '='
if type(value) ~= 'table'
then
res = res .. DEBUG(value) .. '<br>'
else
res = res .. '<br>' .. DEBUG(value, shift .. ' ') .. '<br>'
end
end
return res .. '}'
end
if type(indata) == 'boolean' then
if indata then
return 'true'
else
return 'false'
end
end
if type(indata) == 'string' then
return indata
else
return tostring(type(indata))
end
end
return DEBUG