Merge branch 'feature/ddr_upgrade' into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-03-22 22:30:20 +01:00
23 changed files with 400 additions and 87 deletions

View File

@@ -39,4 +39,31 @@ function Util.contains(t, value)
end
end
return false
end
end
--- Deep copies tables
--- @within Util
--- @param orig any The value to deep copy.
--- @param seen any Used for recursive calls to handle loops
--- @return any any The copied object
function Util.deepcopy(orig, seen)
if type(orig) ~= "table" then
return orig
end
if seen and seen[orig] then
return seen[orig] -- handle cycles / shared refs
end
local copy = {}
seen = seen or {}
seen[orig] = copy
for k, v in pairs(orig) do
local new_k = Util.deepcopy(k, seen)
local new_v = Util.deepcopy(v, seen)
copy[new_k] = new_v
end
return setmetatable(copy, getmetatable(orig))
end