Skip to content

Set removed attributes to undefined #8

@Treora

Description

@Treora

Currently only additions and changes appear in the diff. I think it would be convenient and logical to treat removed attributes like attributes that were set to undefined. Possibly add a second loop roughly like this? (untested!)

var refKeys = Object.keys(ref);
var refKeysLength = refKeys.length;
var hasOwnProperty = Object.prototype.hasOwnProperty;
for (u = 0;u < refKeysLength;u++) {
	key = refKeys[u];
	if (!hasOwnProperty.call(c, key))
		diff[key] = undefined;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions