14 lines
274 B
Text
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,
|
|
}
|