(file: string, line: number, column: number, specifier: string, context: ResolutionContext)
| 913 | * first time one is asked about. |
| 914 | */ |
| 915 | export function isInModuleBlock(file: string, line: number, column: number, specifier: string, context: ResolutionContext): boolean { |
| 916 | let blocks: readonly AmbientModuleBlock[] | undefined = scanned(context).byFile.get(file); |
| 917 | if (!blocks && !DECLARATION_FILE.test(file)) { |
| 918 | const memo = memoFor(context); |
| 919 | blocks = memo.otherBlocks.get(file); |
| 920 | if (!blocks) { |
| 921 | const source = context.readFile(file); |
| 922 | blocks = source && /\bdeclare\s+module\s*['"]/.test(source) ? scanAmbientModules(source).blocks : []; |
| 923 | memo.otherBlocks.set(file, blocks); |
| 924 | } |
| 925 | } |
| 926 | return (blocks ?? []).some((block) => block.specifier === specifier && inBlock({ startLine: line, startColumn: column }, block)); |
| 927 | } |
| 928 | |
| 929 | /** |
| 930 | * Whether `node` is one of several declarations of the same name that the |
no test coverage detected