Merge pull request #17831 from erik-krogh/skip-more-types

JS: have getId always return null if skipExtractingTypes is set
This commit is contained in:
Erik Krogh Kristensen
2024-10-24 12:34:22 +02:00
committed by GitHub

View File

@@ -435,6 +435,7 @@ export class TypeTable {
* Returns `null` if we do not support extraction of this type.
*/
public getId(type: ts.Type, unfoldAlias: boolean): number | null {
if (this.skipExtractingTypes) return null;
let cached = this.idCache.get(type) ?? [undefined, undefined];
let cachedValue = cached[unfoldAlias ? 1 : 0];
if (cachedValue !== undefined) return cachedValue;