(
entries: RegistryManifestEntry[],
options: ResolveOptions = {},
)
| 45 | * break the picker. |
| 46 | */ |
| 47 | export async function loadAllItems( |
| 48 | entries: RegistryManifestEntry[], |
| 49 | options: ResolveOptions = {}, |
| 50 | ): Promise<RegistryItem[]> { |
| 51 | const baseUrl = options.baseUrl ?? DEFAULT_REGISTRY_URL; |
| 52 | const warn = options.onWarn ?? defaultWarn; |
| 53 | const results = await Promise.allSettled( |
| 54 | entries.map((e) => fetchItemManifest(e.name, e.type, baseUrl)), |
| 55 | ); |
| 56 | const items: RegistryItem[] = []; |
| 57 | results.forEach((r, i) => { |
| 58 | if (r.status === "fulfilled") { |
| 59 | items.push(r.value); |
| 60 | } else { |
| 61 | const name = entries[i]?.name ?? "<unknown>"; |
| 62 | warn(`skipped item "${name}": ${String(r.reason)}`); |
| 63 | } |
| 64 | }); |
| 65 | return items; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Resolve a single item by name. Throws if unknown or unreachable. |
no test coverage detected