fix: splice is not a function error

This commit is contained in:
Eric Maciel 2020-10-31 11:00:58 -04:00
parent c2066ed498
commit b47c408919

View File

@ -57,14 +57,10 @@ const opRemove = (op: Automerge.Diff, [map, ops]: any) => {
try {
const { index, path, obj, type } = op
// early return if no map obj available
if (!map) {
return [map, ops]
}
if (
map.hasOwnProperty(obj) &&
typeof map[obj] !== 'string' &&
map[obj].splice &&
type !== 'text'
) {
map[obj].splice(index, 1)