chrobject
Version:
Stores chronicles of plain objects as diffs and snapshots
23 lines (22 loc) • 726 B
JavaScript
/**
* Creator: Christian Hotz
* Company: hydra newmedia GmbH
* Date: 16.06.16
*
* Copyright hydra newmedia GmbH
*/
;
var ArrayDiff = (function () {
function ArrayDiff(action, index, value, newIndex) {
this.action = action;
this.added = action === 'added' ? true : undefined;
this.moved = action === 'moved' ? true : undefined;
this.removed = action === 'removed' ? true : undefined;
this.oldIndex = action === 'moved' ? index : undefined;
this.index = action !== 'moved' ? index : undefined;
this.newIndex = action === 'moved' ? newIndex : undefined;
this.value = value;
}
return ArrayDiff;
}());
exports.ArrayDiff = ArrayDiff;