From eaaa6220462aa88eabfd3f5793006f27af6cde6b Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 19 Oct 2026 17:40:29 +0100 Subject: [PATCH] Improve typing of `resolveFunction` --- src/codeql.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codeql.ts b/src/codeql.ts index 512d4eaf0..ef6d4c662 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -391,9 +391,9 @@ export function setCodeQL(codeql: Partial): void { cachedCodeQL = createStubCodeQL(codeql); } -function resolveFunction( +function resolveFunction( partialCodeql: Partial, - methodName: string, + methodName: K, defaultImplementation?: T, ): T { if (typeof partialCodeql[methodName] !== "function") { @@ -403,7 +403,7 @@ function resolveFunction( const dummyMethod = () => { throw new Error(`CodeQL ${methodName} method not correctly defined`); }; - return dummyMethod as T; + return dummyMethod as unknown as T; } return partialCodeql[methodName] as T; }