fix: check none before patching mutable tables

This commit is contained in:
littensy 2025-11-22 22:03:42 -08:00
parent 189ae0f168
commit 422ee43a94
2 changed files with 19 additions and 13 deletions

View file

@ -127,4 +127,10 @@ test("patches mutable state", function()
assert(targetState.qaz == "qux", "should add the new value")
end)
test("removes table from mutable state", function()
local targetState = { foo = { bar = "baz" } }
patch.applyMutable(targetState, { foo = { __none = "__none" } })
assert(targetState.foo == nil, "should remove the table")
end)
return {}