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) {
const value = newProperties[key]
if (value !== undefined) {
if (value != null) {
node[key] = value
} else {
delete node[key]