jecs-nightly/src/util/tbl.luau
2025-03-12 21:21:41 +01:00

14 lines
274 B
Text

--!strict
local function deep_clone<T>(t: T): T
local clone = table.clone(t :: any)
for k, v in clone do
if type(v) == "table" then
clone[k] = deep_clone(v)
end
end
return clone :: any
end
return {
deep_clone = deep_clone,
}