*Move fetching request to a private helper

This commit is contained in:
Derrick Hammer 2022-09-08 07:29:30 -04:00
parent 33c6302205
commit 29125ab6a3
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 10 additions and 3 deletions

View File

@ -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;
}
} }