Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style: fix formatting issues
  • Loading branch information
BenceSzalai committed Mar 20, 2023
commit b860071544adcee2434c656e00453a819c6902b7
11 changes: 9 additions & 2 deletions packages/jest-matcher-utils/src/deepCyclicCopyReplaceable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ function deepCyclicCopyObject<T>(object: T, cycles: WeakMap<any, unknown>): T {
let descriptors: Record<string, PropertyDescriptor> = {};
let obj = object;
do {
descriptors = Object.assign({}, Object.getOwnPropertyDescriptors(obj), descriptors)
} while ( (obj = Object.getPrototypeOf( obj )) && obj !== Object.getPrototypeOf({}) );
descriptors = Object.assign(
{},
Object.getOwnPropertyDescriptors(obj),
descriptors,
);
} while (
(obj = Object.getPrototypeOf(obj)) &&
obj !== Object.getPrototypeOf({})
);

cycles.set(object, newObject);

Expand Down