Skip to content

Wrong diff changing an undefined attribute to empty object #66

Closed
@filipealonso

Description

@filipealonso

When you check against removed or undefined attributes it works fine:
✔️ diff({a:{}}, {a:undefined}) returns {a: undefined}
✔️ diff({a:{}}, {}) returns {a: undefined}

But when you invert and add/change to an empty object it differs depending if it was undefined or nonexistent before:
✔️ diff({}, {a:{}}) returns {a:{}}
diff({a:undefined}, {a:{}}) returns {} instead of {a:{}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions