( module: SourceModule, holder: Binding | string, depth: number )
| 5390 | // import of it, of an alias exported in its place or of a module |
| 5391 | // re-exporting it |
| 5392 | elsewhereOf( |
| 5393 | module: SourceModule, |
| 5394 | holder: Binding | string, |
| 5395 | depth: number |
| 5396 | ): Elsewhere | undefined { |
| 5397 | if (!this.view) return |
| 5398 | const isName = typeof holder === "string" |
| 5399 | const key = isName ? module : holder |
| 5400 | let byDepth = this.elsewhereByHolder.get(key) |
| 5401 | if (!byDepth) this.elsewhereByHolder.set(key, (byDepth = new Map())) |
| 5402 | const depthKey = isName ? `${depth}:${holder}` : depth |
| 5403 | let result = byDepth.get(depthKey) |
| 5404 | if (result === undefined) { |
| 5405 | const held = heldAs(depth) |
| 5406 | result = |
| 5407 | this.findElsewhere( |
| 5408 | isName ? |
| 5409 | [[module, holder, held]] |
| 5410 | : this.exportsHolding(holder, module, held) |
| 5411 | ) ?? null |
| 5412 | byDepth.set(depthKey, result) |
| 5413 | } |
| 5414 | return result ?? undefined |
| 5415 | } |
| 5416 | |
| 5417 | private findElsewhere(exports: HeldExport[]): Elsewhere | undefined { |
| 5418 | const seen = new Set<string>() |
no test coverage detected