Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
undo() {
const lastChange = this._commitStack.pop();
if (lastChange) {
for (let i = lastChange.changes.length - 1; i >= 0; i--) {
let change = lastChange.changes[i];
revertChange(change.target, true, change);
}
this._revertStack.push(lastChange);
}
}