mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 14:14:36 +00:00
[added] quoted strings in tablex.stringify; todo consider moving it to stringx actually, as it works for non-table types, maybe as stringx.pretty...
This commit is contained in:
parent
f6a2c9834f
commit
6bf6113dc2
@ -276,7 +276,12 @@ function tablex.stringify(t)
|
||||
--just use tostring
|
||||
local mt = getmetatable(t)
|
||||
if type(t) ~= "table" or mt and mt.__tostring then
|
||||
return tostring(t)
|
||||
local s = tostring(t)
|
||||
--quote strings
|
||||
if type(t) == "string" then
|
||||
s = '"' .. s .. '"'
|
||||
end
|
||||
return s
|
||||
end
|
||||
|
||||
--otherwise, collate into member chunks
|
||||
|
Loading…
Reference in New Issue
Block a user