feat(sync): add autoSerialize option

This commit is contained in:
Richard 2025-01-25 14:00:31 -08:00
parent 8eddd182d3
commit 9e5cb6954c
8 changed files with 54 additions and 49 deletions

View file

@ -100,7 +100,7 @@ return function()
end)
it("optionally fixes sparse arrays", function()
for index in next, patch.diff({ 1, 1, 1, 1, 1 }, { 2, 1, 1, 2 }) do
for index in next, patch.diff({ 1, 1, 1, 1, 1 }, { 2, 1, 1, 2 }, true) do
expect(index).to.be.a("string")
end
@ -108,4 +108,14 @@ return function()
expect(index).to.be.a("number")
end
end)
it("optionally validates state", function()
expect(function()
patch.diff({}, { [0.1] = true }, true)
end).to.throw()
expect(function()
patch.diff({}, { [0.1] = true }, false)
end).to.never.throw()
end)
end