(itemName: string)
| 137 | // the `Promise<RegistryItem>` return type. The body has no `await`, so the |
| 138 | // cache is still populated synchronously on first request (dedup intact). |
| 139 | const getItem = async (itemName: string): Promise<RegistryItem> => { |
| 140 | const existing = itemCache.get(itemName); |
| 141 | if (existing) return existing; |
| 142 | |
| 143 | const registryEntry = entryByName.get(itemName); |
| 144 | if (!registryEntry) { |
| 145 | const available = entries.map((e) => e.name).join(", "); |
| 146 | throw new Error( |
| 147 | available.length > 0 |
| 148 | ? `Dependency "${itemName}" not found in registry. Available: ${available}` |
| 149 | : `Dependency "${itemName}" not found — registry unreachable or empty.`, |
| 150 | ); |
| 151 | } |
| 152 | |
| 153 | const pending = fetchItemManifest(registryEntry.name, registryEntry.type, options.baseUrl); |
| 154 | itemCache.set(itemName, pending); |
| 155 | return pending; |
| 156 | }; |
| 157 | |
| 158 | const visit = async (itemName: string, path: string[]): Promise<void> => { |
| 159 | if (visited.has(itemName)) return; |
no test coverage detected