Skip to content

Commit 99e5fa1

Browse files
gkalpakAndrewKushnir
authored andcommitted
test(service-worker): remove redundant ternary operator from MockRequest initialization (#46912)
Since the `init` parameter has a default value of `{}`, it can never be `!== undefined`. Thus, it is not necessary to account for that case. PR Close #46912
1 parent 3b34254 commit 99e5fa1

File tree

1 file changed

+1
-1
lines changed
  • packages/service-worker/worker/testing

1 file changed

+1
-1
lines changed

packages/service-worker/worker/testing/fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class MockRequest extends MockBody implements Request {
115115
url: string;
116116

117117
constructor(input: string|Request, init: RequestInit = {}) {
118-
super(init !== undefined ? (init.body as (string | null)) || null : null);
118+
super((init.body as string | null) ?? null);
119119
if (typeof input !== 'string') {
120120
throw 'Not implemented';
121121
}

0 commit comments

Comments
 (0)