( fetchImpl: typeof fetch = fetch, )
| 86 | * **Throws** only when both sources fail; callers must catch (see above). |
| 87 | */ |
| 88 | export async function fetchLatestFromCdn( |
| 89 | fetchImpl: typeof fetch = fetch, |
| 90 | ): Promise<FetchLatestResult> { |
| 91 | const manifest = await fetchUpdateManifestFromCdn(fetchImpl).catch(() => null); |
| 92 | if (manifest !== null) { |
| 93 | return { latest: manifest.version, manifest }; |
| 94 | } |
| 95 | const latest = await fetchLatestVersionFromCdn(fetchImpl); |
| 96 | return { latest, manifest: null }; |
| 97 | } |
no test coverage detected