(name: string)
| 26 | * @see https://github.com/antfu/fast-npm-meta |
| 27 | */ |
| 28 | export async function fetchLatestVersion(name: string): Promise<string | null> { |
| 29 | try { |
| 30 | const meta = await getLatestVersion(name) |
| 31 | return meta.version |
| 32 | } catch { |
| 33 | return null |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Validate an npm package name and throw an HTTP error if invalid. |
no test coverage detected