Module:Dev
外观
此模块的文档可以在Module:Dev/doc创建
local p = {}
-- 这个模板包含一些开发测试用工具
function p.tableToString(tbl)
local result = {}
for k, v in pairs(tbl) do
if type(k) == "string" then
k = string.format('"%s"', k)
end
if type(v) == "table" then
v = tableToString(v) -- 递归处理嵌套表
elseif type(v) == "string" then
v = string.format('"%s"', v)
end
table.insert(result, k .. ": " .. tostring(v))
end
return "{ " .. table.concat(result, ", ") .. " }"
end
return p