mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 02:29:48 -04:00
* fix: normalize tarball URLs by removing default HTTP/HTTPS ports closes #6725 * feat: refactor, add test and changeset --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
11 lines
238 B
TypeScript
11 lines
238 B
TypeScript
/**
|
|
* Remove default ports (80 for HTTP, 443 for HTTPS) to ensure consistency
|
|
*/
|
|
export function normalizeRegistryUrl (urlString: string): string {
|
|
try {
|
|
return new URL(urlString).toString()
|
|
} catch {
|
|
return urlString
|
|
}
|
|
}
|