We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 17ec4f6 + 65dd2f5 commit a1adbd5Copy full SHA for a1adbd5
src/modules/request-recorder/heal-body.js
@@ -1,17 +1,15 @@
1
import objectScan from 'object-scan';
2
import cloneDeep from 'lodash.clonedeep';
3
4
-const last = (arr) => arr[arr.length - 1];
5
-
6
const healer = objectScan(['**.*|*'], {
7
breakFn: ({
8
isMatch, depth, property, context
9
}) => {
10
if (property === undefined) {
11
return false;
12
}
13
- context.expected[depth] = last(context.expected)?.[property];
14
- context.actual[depth] = last(context.actual)?.[property];
+ context.expected[depth] = context.expected[depth - 1]?.[property];
+ context.actual[depth] = context.actual[depth - 1]?.[property];
15
return isMatch;
16
},
17
filterFn: ({
0 commit comments