Fix setNodes undefined value since automerge does not handle undefined value correctly. (#49)

fix_dependency_update
Ulion 3 years ago committed by GitHub
parent d141da4430
commit ef35812723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,12 @@ const setNode = (doc: SyncValue, op: SetNodeOperation): SyncValue => {
const { newProperties } = op
for (let key in newProperties) {
node[key] = newProperties[key]
const value = newProperties[key]
if (value !== undefined) {
node[key] = value
} else {
delete node[key]
}
}
return doc

Loading…
Cancel
Save