feat: add serializeArrays option (#29)

* feat: add optional `convertArrays`

* perf: sync atomic changes to keys

* feat: add `serializeArrays` option

* docs: rephrase debug mode flag
This commit is contained in:
richard 2024-11-17 01:22:07 -08:00 • committed by GitHub
parent e4019c049c
commit aae769c981
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 230 additions and 205 deletions

View file

@ -98,4 +98,14 @@ return function()
expect(applied["2"]).to.be.ok()
expect(applied[2]).to.never.be.ok()
end)
it("optionally fixes sparse arrays", function()
for index in next, patch.diff({ 1, 1, 1, 1, 1 }, { 2, 1, 1, 2 }) do
expect(index).to.be.a("string")
end
for index in next, patch.diff({ 1, 1, 1, 1, 1 }, { 2, 1, 1, 2 }, false) do
expect(index).to.be.a("number")
end
end)
end