Skip to content

Commit f82d0cb

Browse files
authored
Add explicit assertion on somewhat commonly incorrectly passed argument (#48078)
* Add explicit assertion on somewhat commonly incorrectly passed argument * PR feedback
1 parent ea0db9e commit f82d0cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compiler/moduleNameResolver.ts

+1
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ namespace ts {
298298
* is assumed to be the same as root directory of the project.
299299
*/
300300
export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache, resolutionMode?: SourceFile["impliedNodeFormat"]): ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
301+
Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
301302
const traceEnabled = isTraceEnabled(options, host);
302303
if (redirectedReference) {
303304
options = redirectedReference.commandLine.options;

0 commit comments

Comments
 (0)