cringe deepComprasion function because effects are hard
This commit is contained in:
parent
7c5314b7c8
commit
94cd2e7ee9
@ -74,4 +74,20 @@ function P.lerp(from, to, t)
|
||||
return from + (to - from) * t
|
||||
end
|
||||
|
||||
--- Compares two tables by their fields
|
||||
--- @param t1 table
|
||||
--- @param t2 table
|
||||
--- @return boolean
|
||||
function P.deepComprasion(t1, t2)
|
||||
for k, v in pairs(t1) do
|
||||
if type(v) == "table" and type(t2[k]) == "table" then
|
||||
return P.deepComprasion(v, t2[k])
|
||||
end
|
||||
if t2[k] ~= v then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return P
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user