fix(table_matches): remove leftover strict shape check from df7a6b9 (#50)

- The previous fix (commit df7a6b9) mistakenly left in a table.type
  / #t1 == #t2 check that breaks equality for {} and {x=nil}.
- This removes that leftover check, restoring the intended deep
  equality semantics.

Signed-off-by: RuksH4n <77233680+rukshanchamindu@users.noreply.github.com>
This commit is contained in:
RuksH4n
2025-09-13 16:17:16 +05:30
committed by GitHub
parent df7a6b9c21
commit 13a24baee4

View File

@@ -52,10 +52,6 @@ local function table_matches(t1, t2)
if type1 ~= type2 then return false end if type1 ~= type2 then return false end
if type1 ~= 'table' and type2 ~= 'table' then return t1 == t2 end if type1 ~= 'table' and type2 ~= 'table' then return t1 == t2 end
if tabletype1 ~= table.type(t2) or (tabletype1 == 'array' and #t1 ~= #t2) then
return false
end
for k, v1 in pairs(t1) do for k, v1 in pairs(t1) do
local v2 = t2[k] local v2 = t2[k]
if v2 == nil or not table_matches(v1, v2) then if v2 == nil or not table_matches(v1, v2) then