If name is a valid reference to a submodule alias, return its resolution
( name: string )
| 608 | |
| 609 | /** If name is a valid reference to a submodule alias, return its resolution */ |
| 610 | protected maybeResolveSubalias( |
| 611 | name: string |
| 612 | ): BaseRoot | GenericRoot | undefined { |
| 613 | const resolution = |
| 614 | (this._lazy && maybeResolveExport(this._lazy, name)) ?? |
| 615 | maybeResolveSubalias(this.aliases, name) |
| 616 | if (resolution) return resolution |
| 617 | // an alias shadows the keyword of its name, including what only the |
| 618 | // keyword's submodule holds |
| 619 | const dotIndex = name.indexOf(".") |
| 620 | if (dotIndex !== -1 && hasOwn(this.aliases, name.slice(0, dotIndex))) return |
| 621 | const keyword = maybeResolveSubalias(this.ambient, name) |
| 622 | return keyword && this.holdAmbient(name, this.bindKw(keyword)) |
| 623 | } |
| 624 | |
| 625 | // an ambient module can be another scope's, read lazily, whose alias a |
| 626 | // check still waiting could fail or leave unchecked, so what this scope |
no test coverage detected