Commit c53f4a7 1 parent 6a3688a commit c53f4a7 Copy full SHA for c53f4a7
File tree 1 file changed +8
-5
lines changed
workspaces/arborist/lib/arborist
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -727,13 +727,16 @@ module.exports = cls => class Reifier extends cls {
727
727
// ${REGISTRY} or something. This has to be threaded through the
728
728
// Shrinkwrap and Node classes carefully, so for now, just treat
729
729
// 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 )
732
731
733
732
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
+ }
737
740
}
738
741
739
742
if ( ( this . options . replaceRegistryHost === resolvedURL . hostname )
You can’t perform that action at this time.
0 commit comments