Baseless/Helpers/Merge.lua

16 lines
338 B
Lua
Raw Normal View History

2020-04-26 03:48:47 +00:00
-- Combine multiple tables into one
--
-- *In the case of duplicate keys the latest one is used
-- *Values are not deep copies
function Merge(...)
local newTable = {}
for _, table in ipairs({...}) do
if table then
for key, value in pairs(table) do
newTable[key] = value
end
end
end
return newTable
end