fix: use null
instead of undefined
(#8463)
This commit is contained in:
parent
dac3e65533
commit
2615c1c3d6
@ -123,7 +123,7 @@ export class Target {
|
|||||||
/**
|
/**
|
||||||
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
||||||
*/
|
*/
|
||||||
async page(): Promise<Page | undefined> {
|
async page(): Promise<Page | null> {
|
||||||
if (this._isPageTargetCallback(this._targetInfo) && !this._pagePromise) {
|
if (this._isPageTargetCallback(this._targetInfo) && !this._pagePromise) {
|
||||||
this._pagePromise = this._sessionFactory().then((client) =>
|
this._pagePromise = this._sessionFactory().then((client) =>
|
||||||
Page.create(
|
Page.create(
|
||||||
@ -135,7 +135,7 @@ export class Target {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return this._pagePromise;
|
return (await this._pagePromise) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user