Build/Utilities/forEach.lua

25 lines
448 B
Lua
Raw Permalink Normal View History

function auForEach(table, cb, ...)
if (not table) then
return
end
if type(table) == "table" then
for k, v in pairs(table) do
cb(v, ...)
end
else
cb(table, ...)
end
end
function auForEachKV(table, cb, ...)
if (not table) then
return
end
if type(table) == "table" then
for k, v in pairs(table) do
cb(k, v, ...)
end
end
end