Skip to content

Commit 762a1b5

Browse files
committed
refactor(diff): fix revertChanges, remove default value for MHD.orderIndependent
1 parent 0a5ed68 commit 762a1b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/diff.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ export const revertChanges = (target: any, changes: Array<RawChangeT>): any => {
192192
switch (change.k) {
193193
case 'A':
194194
// $FlowFixMe
195+
if (Array.isArray(it)) {
196+
revertArrayChange(it, change.i, change.it);
197+
break;
198+
}
195199
revertArrayChange(it[change.p[i]], change.i, change.it);
196200
break;
197201
case 'D':
@@ -211,7 +215,7 @@ export const revertChanges = (target: any, changes: Array<RawChangeT>): any => {
211215
};
212216

213217
export default class MHD {
214-
static orderIndependent: boolean = true;
218+
static orderIndependent: boolean;
215219
static excludedFields: Array<ExcludeFieldT> = [];
216220

217221
static findDiff(lhs: any, rhs: any): Array<RawChangeT> {

0 commit comments

Comments
 (0)