Skip to content

Commit c53f4a7

Browse files
committed
fixup! fix: use hosted-git-info to parse registry urls
1 parent 6a3688a commit c53f4a7

File tree

1 file changed

+8
-5
lines changed
  • workspaces/arborist/lib/arborist

1 file changed

+8
-5
lines changed

workspaces/arborist/lib/arborist/reify.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -727,13 +727,16 @@ module.exports = cls => class Reifier extends cls {
727727
// ${REGISTRY} or something. This has to be threaded through the
728728
// Shrinkwrap and Node classes carefully, so for now, just treat
729729
// the default reg as the magical animal that it has been.
730-
// const resolvedURL = new URL(resolved)
731-
const resolvedURL = hgi.parseUrl(resolved)
730+
let resolvedURL = hgi.parseUrl(resolved)
732731

733732
if (!resolvedURL) {
734-
// if we could not parse the url at all then returning nothing
735-
// here means it will get removed from the tree in the next step
736-
return
733+
try {
734+
resolvedURL = new URL(resolved)
735+
} catch {
736+
// if we could not parse the url at all then returning nothing
737+
// here means it will get removed from the tree in the next step
738+
return
739+
}
737740
}
738741

739742
if ((this.options.replaceRegistryHost === resolvedURL.hostname)

0 commit comments

Comments
 (0)