1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Don't expose private event fields to user in choices

This commit is contained in:
Étienne Fildadut 2021-11-27 13:10:36 +01:00
parent 7105b445ef
commit 7433d27da5
2 changed files with 16 additions and 22 deletions

View file

@ -21,20 +21,6 @@ local function format_text(t)
return r
end
--- remove unneeded things from a result table (namely private fields)
local function strip(t, visited)
visited = visited or {}
for k, v in pairs(t) do
if type(k) == "string" and k:match("^_") then
t[k] = nil
end
if type(v) == "table" and not visited[v] then
visited[v] = true
strip(v, visited)
end
end
end
local function compare(a, b)
if type(a) == "table" and type(b) == "table" then
for k, v in pairs(a) do
@ -214,8 +200,6 @@ else
table.insert(result, { "error", err })
end
strip(result)
if args["write-all"] then
write_result(filebase, result)
else