* Returns usage status. * @param {ExportInfoName | ExportInfoName[]} name export name * @param {RuntimeSpec} runtime check usage for this runtime only * @returns {UsageStateType} usage status
(name, runtime)
| 778 | * @returns {UsageStateType} usage status |
| 779 | */ |
| 780 | getUsed(name, runtime) { |
| 781 | if (Array.isArray(name)) { |
| 782 | if (name.length === 0) return this.otherExportsInfo.getUsed(runtime); |
| 783 | // Walk the nested path iteratively to avoid a `slice` per level |
| 784 | /** @type {ExportsInfo} */ |
| 785 | let exportsInfo = this; |
| 786 | const last = name.length - 1; |
| 787 | for (let i = 0; ; i++) { |
| 788 | const info = exportsInfo.getReadOnlyExportInfo(name[i]); |
| 789 | if (i === last || !info.exportsInfo) return info.getUsed(runtime); |
| 790 | exportsInfo = info.exportsInfo; |
| 791 | } |
| 792 | } |
| 793 | const info = this.getReadOnlyExportInfo(name); |
| 794 | return info.getUsed(runtime); |
| 795 | } |
| 796 | |
| 797 | /** |
| 798 | * Returns the used name. |
nothing calls this directly
no test coverage detected