setNode as slate does.

This commit is contained in:
Ulion 2021-04-21 11:02:15 +08:00
parent f65ab040ee
commit 42ed7ea024

View File

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