*Move fetching request to a private helper
This commit is contained in:
parent
33c6302205
commit
29125ab6a3
|
@ -175,9 +175,7 @@ export default class WebEngine {
|
||||||
method: string,
|
method: string,
|
||||||
def = {}
|
def = {}
|
||||||
): Promise<BlockingResponse> {
|
): Promise<BlockingResponse> {
|
||||||
const provider = this.requests.get(details.requestId) as unknown as {
|
const provider = this.getRequestProvider(details.requestId);
|
||||||
[index: string]: Function;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!provider) {
|
if (!provider) {
|
||||||
return def;
|
return def;
|
||||||
|
@ -292,4 +290,13 @@ export default class WebEngine {
|
||||||
public getDomainContentProvider(domain: string): BaseProvider | null {
|
public getDomainContentProvider(domain: string): BaseProvider | null {
|
||||||
return this.domainContentProvider.get(domain) ?? null;
|
return this.domainContentProvider.get(domain) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getRequestProvider(
|
||||||
|
requestId: string
|
||||||
|
): { [p: string]: Function } | null {
|
||||||
|
const provider = this.requests.get(requestId) as unknown as {
|
||||||
|
[index: string]: Function;
|
||||||
|
};
|
||||||
|
return provider ?? null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue