From c53f4a71687565c016109ff2c73e80620135b0fb Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 26 Oct 2022 16:15:57 -0700 Subject: [PATCH] fixup! fix: use hosted-git-info to parse registry urls --- workspaces/arborist/lib/arborist/reify.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index dcbe42d59a4cf..7e74b1fea2cf2 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -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)