Skip to content

Commit

Permalink
fixup! fix: use hosted-git-info to parse registry urls
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 26, 2022
1 parent 6a3688a commit c53f4a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions workspaces/arborist/lib/arborist/reify.js
Expand Up @@ -727,13 +727,16 @@ module.exports = cls => class Reifier extends cls {
// ${REGISTRY} or something. This has to be threaded through the
// Shrinkwrap and Node classes carefully, so for now, just treat
// the default reg as the magical animal that it has been.
// const resolvedURL = new URL(resolved)
const resolvedURL = hgi.parseUrl(resolved)
let resolvedURL = hgi.parseUrl(resolved)

if (!resolvedURL) {
// if we could not parse the url at all then returning nothing
// here means it will get removed from the tree in the next step
return
try {
resolvedURL = new URL(resolved)
} catch {
// if we could not parse the url at all then returning nothing
// here means it will get removed from the tree in the next step
return
}
}

if ((this.options.replaceRegistryHost === resolvedURL.hostname)
Expand Down

0 comments on commit c53f4a7

Please sign in to comment.