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
This commit is contained in:
George Kalpakas 2022-07-20 20:15:40 +03:00 committed by Andrew Kushnir
parent 3b34254932
commit 99e5fa157d

View file

@ -115,7 +115,7 @@ export class MockRequest extends MockBody implements Request {
url: string;
constructor(input: string|Request, init: RequestInit = {}) {
super(init !== undefined ? (init.body as (string | null)) || null : null);
super((init.body as string | null) ?? null);
if (typeof input !== 'string') {
throw 'Not implemented';
}