18 lines
329 B
Lua
18 lines
329 B
Lua
|
local util = {}
|
||
|
|
||
|
function util.deepCopyTable(originalTable)
|
||
|
if originalTable == nil then return nil end
|
||
|
|
||
|
local tableCopy = {}
|
||
|
for key, value in pairs(originalTable) do
|
||
|
if type(value) == "table" then
|
||
|
tableCopy[key] = util.deepCopyTable(value)
|
||
|
else
|
||
|
tableCopy[key] = value
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return tableCopy
|
||
|
end
|
||
|
|
||
|
return util
|