Skip to content

Commit

Permalink
chore: simplify checks with optional chainging (#15177)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rajat19 authored Jul 11, 2024
1 parent 21cce70 commit 76514a8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/jest-mock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,7 @@ export class ModuleMocker {
) {
return metadata.value;
} else if (metadata.type === 'function') {
const prototype =
(metadata.members &&
metadata.members.prototype &&
metadata.members.prototype.members) ||
{};
const prototype = metadata.members?.prototype?.members ?? {};
const prototypeSlots = this._getSlots(prototype);
// eslint-disable-next-line @typescript-eslint/no-this-alias
const mocker = this;
Expand Down

0 comments on commit 76514a8

Please sign in to comment.