scripts/check_site.lua: add table_keys() helper

This commit is contained in:
Martin Weinelt 2018-03-13 18:56:11 +01:00 committed by Matthias Schiffer
parent 1a7d93a2b9
commit 85c0bd6f57
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -70,6 +70,14 @@ local function array_to_string(array)
return '[' .. table.concat(array, ', ') .. ']' return '[' .. table.concat(array, ', ') .. ']'
end end
function table_keys(tbl)
local keys = {}
for k, _ in pairs(tbl) do
keys[#keys + 1] = k
end
return keys
end
local loadpath local loadpath