You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A { a: undefined }
B {}
patch = diff(A,B) (results in 'remove a')
patchInPlace(patch, A)
fails with "path does not exist"
// key must exist for remove
if(notFound(pointer) || pointer.target[pointer.key] === void 0) {
throw new InvalidPatchOperationError('path does not exist ' + change.path);
}
The cause is the check for pointer.target[pointer.key] not being undefined.
The key needs to be present, but if the value is undefined that shouldn't prevent a removal.
The text was updated successfully, but these errors were encountered:
While technically undefined is not a supported type in JSON, it is supported in JavaScript, possibly we could enable a flag in the options to allow this behaviour.
A { a: undefined }
B {}
patch = diff(A,B) (results in 'remove a')
patchInPlace(patch, A)
fails with "path does not exist"
The cause is the check for pointer.target[pointer.key] not being undefined.
The key needs to be present, but if the value is undefined that shouldn't prevent a removal.
The text was updated successfully, but these errors were encountered: