(url)
| 88 | } |
| 89 | |
| 90 | function isDefaultNpmjsRegistry(url) { |
| 91 | try { |
| 92 | const { hostname } = new URL(url); |
| 93 | return hostname === "registry.npmjs.org"; |
| 94 | } catch (_) { |
| 95 | return false; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | function assertAllowedHost(url) { |
| 100 | const { hostname } = new URL(url); |