From 1daf7ae4aad2f72e72e4a515a325acb2842ba93a Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Wed, 12 Aug 2020 13:25:00 -0400 Subject: [PATCH] lib: fix URL constructor The return from `require('url')` is not the URL constructor, that is exported as `url.URL`. The constructor is generally available as a global, so this pattern isn't 100% necessary, but this is the best way to do it based on existing patterns in npm Refs: https://github.com/nodejs/node/issues/34738 Fixes: https://github.com/npm/cli/issues/1658 --- lib/utils/replace-info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/replace-info.js b/lib/utils/replace-info.js index a613a3755fab0..36e35b0785ab0 100644 --- a/lib/utils/replace-info.js +++ b/lib/utils/replace-info.js @@ -1,4 +1,4 @@ -const URL = require('url') +const URL = require('url').URL // replaces auth info in an array // of arguments or in a strings