From f4c5f0e52679b1aa42db833fc23dc07d96cc904e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 23 Feb 2022 19:10:42 +0200 Subject: [PATCH] fix(arborist): fix unescaped periods (#4462) --- workspaces/arborist/lib/arborist/reify.js | 2 +- workspaces/arborist/lib/shrinkwrap.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index 91507fd791871..92e2b69606c81 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -716,7 +716,7 @@ module.exports = cls => class Reifier extends cls { // Shrinkwrap and Node classes carefully, so for now, just treat // the default reg as the magical animal that it has been. return resolved && resolved - .replace(/^https?:\/\/registry.npmjs.org\//, this.registry) + .replace(/^https?:\/\/registry\.npmjs\.org\//, this.registry) } // bundles are *sort of* like shrinkwraps, in that the branch is defined diff --git a/workspaces/arborist/lib/shrinkwrap.js b/workspaces/arborist/lib/shrinkwrap.js index bb6971f7ad57a..f4af71f478d5a 100644 --- a/workspaces/arborist/lib/shrinkwrap.js +++ b/workspaces/arborist/lib/shrinkwrap.js @@ -80,8 +80,8 @@ const swKeyOrder = [ ] // used to rewrite from yarn registry to npm registry -const yarnRegRe = /^https?:\/\/registry.yarnpkg.com\// -const npmRegRe = /^https?:\/\/registry.npmjs.org\// +const yarnRegRe = /^https?:\/\/registry\.yarnpkg\.com\// +const npmRegRe = /^https?:\/\/registry\.npmjs\.org\// // sometimes resolved: is weird or broken, or something npa can't handle const specFromResolved = resolved => {