-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: set namespace type, merge namespaces
- Loading branch information
1 parent
87bba19
commit 7c720b4
Showing
4 changed files
with
101 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
local M = {} | ||
|
||
function M.deep(t, indent, done) | ||
done = done or {} | ||
indent = indent or "" | ||
local output = {} | ||
|
||
for k, v in pairs(t) do | ||
if type(v) == "table" and not done[v] then | ||
done[v] = true | ||
table.insert( | ||
output, | ||
indent .. tostring(k) .. ":\n" .. M.deep(v, indent .. " ", done) | ||
) | ||
else | ||
table.insert(output, indent .. tostring(k) .. ": " .. tostring(v)) | ||
end | ||
end | ||
|
||
return table.concat(output, "\n") | ||
end | ||
|
||
function M.dump(o) | ||
if type(o) == "table" then | ||
local s = "{ " | ||
for k, v in pairs(o) do | ||
if type(k) ~= "number" then | ||
k = '"' .. k .. '"' | ||
end | ||
s = s .. "[" .. k .. "] = " .. M.dump(v) .. "," | ||
end | ||
return s .. "} " | ||
else | ||
return tostring(o) | ||
end | ||
end | ||
|
||
return M |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters