tooling/toolchainlib/src/utils/eq.luau

29 lines
428 B
Text
Raw Normal View History

2024-11-25 11:47:56 +00:00
local function eq(this: any, that: any): boolean
if type(this) ~= type(that) then
return false
end
if type(this) == "table" then
local visited = {}
for key, value in pairs(this) do
if not eq(value, that[key]) then
return false
end
visited[key] = true
end
for key, _ in pairs(that) do
if not visited[key] then
return false
end
end
return true
end
return this == that
end
return eq