typescript

This commit is contained in:
Mitchell McCaffrey
2021-07-16 14:55:33 +10:00
parent 68c1c6db0c
commit d80bfa2f1e
103 changed files with 1402 additions and 1336 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import { applyChange, Diff, revertChange, diff as deepDiff }from "deep-diff";
import { applyChange, Diff, revertChange, diff as deepDiff } from "deep-diff";
import get from "lodash.get";
export function applyChanges<LHS>(target: LHS, changes: Diff<LHS, any>[]) {
export function applyChanges<LHS>(target: LHS, changes: Diff<LHS>[]) {
for (let change of changes) {
if (change.path && (change.kind === "E" || change.kind === "A")) {
// If editing an object or array ensure that the value exists
@@ -15,7 +15,7 @@ export function applyChanges<LHS>(target: LHS, changes: Diff<LHS, any>[]) {
}
}
export function revertChanges<LHS>(target: LHS, changes: Diff<LHS, any>[]) {
export function revertChanges<LHS>(target: LHS, changes: Diff<LHS>[]) {
for (let change of changes) {
revertChange(target, true, change);
}