20 lines
400 B
Lua
Executable file
20 lines
400 B
Lua
Executable file
-- Various utility functions.
|
|
|
|
local utils = {}
|
|
|
|
utils.contains = function(table, element)
|
|
for key, value in pairs(table) do
|
|
if type(key) == type(element) then
|
|
if key == element then
|
|
return true
|
|
end
|
|
else
|
|
if value == element then
|
|
return true
|
|
end
|
|
end
|
|
end
|
|
return false
|
|
end
|
|
|
|
return utils
|