(originalUrl: string, relativeUrl: string)
| 46 | export type Registry = z.infer<typeof registrySchema> |
| 47 | |
| 48 | function absolutizeUrl(originalUrl: string, relativeUrl: string) { |
| 49 | if (relativeUrl.startsWith('http') || relativeUrl.startsWith('https')) { |
| 50 | return relativeUrl |
| 51 | } |
| 52 | const baseUrl = originalUrl.replace(/registry.json$/, '') |
| 53 | return `${baseUrl}${relativeUrl.replace(/^\.\//, '')}` |
| 54 | } |
| 55 | |
| 56 | export async function getRawRegistry( |
| 57 | registryUrl?: string, |
no test coverage detected