benjamine/jsondiffpatch — pull request #57 by pauljm (2014-11-02 07:09:51+00:00)
Title: Delete key from object when patching

Addressing issue https://github.com/benjamine/jsondiffpatch/issues/56.

When `patch()`ing with a diff in which a key is removed from an object, `delete` the key instead of setting to `undefined`. Also updates the `deepEqual()` test helper to distinguish between `undefined` and missing object keys and adds an explicit key deleted test case, although other tests incidentally address the same issue.

This resolves our issue with lingering `key: undefined` members when `un/patch()`ing objects without breaking other tests, so thought I'd share. I hope it's on the right track, but please feel free to disregard if not.