Skip to content

Commit 3ad6ea7

Browse files
committed
misc(expect-utils): removed creation of a new collection
1 parent 7cf3b8d commit 3ad6ea7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/expect-utils/src/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ export const getObjectSubset = (
144144
const trimmed: any = {};
145145
seenReferences.set(object, trimmed);
146146

147-
for (const key of getObjectKeys(object).filter(key =>
148-
hasPropertyInObject(subset, key),
149-
)) {
147+
for (const key of getObjectKeys(object)) {
148+
if (!hasPropertyInObject(subset, key)) {
149+
continue;
150+
}
151+
150152
trimmed[key] = seenReferences.has(object[key])
151153
? seenReferences.get(object[key])
152154
: getObjectSubset(

0 commit comments

Comments
 (0)