File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
workspaces/arborist/lib/arborist Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -92,15 +92,15 @@ class Explain extends ArboristWorkspaceCmd {
9292 }
9393
9494 // if it's a location, get that node
95- const maybeLoc = arg . replace ( / \\ / g, '/' ) . replace ( / \/ + $ / , '' )
95+ const maybeLoc = arg . replace ( / \\ / g, '/' ) . replace ( / (?< ! \/ ) \/ + $ / , '' )
9696 const nodeByLoc = tree . inventory . get ( maybeLoc )
9797 if ( nodeByLoc ) {
9898 return [ nodeByLoc ]
9999 }
100100
101101 // maybe a path to a node_modules folder
102102 const maybePath = relative ( this . npm . prefix , resolve ( maybeLoc ) )
103- . replace ( / \\ / g, '/' ) . replace ( / \/ + $ / , '' )
103+ . replace ( / \\ / g, '/' ) . replace ( / (?< ! \/ ) \/ + $ / , '' )
104104 const nodeByPath = tree . inventory . get ( maybePath )
105105 if ( nodeByPath ) {
106106 return [ nodeByPath ]
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
103103
104104 // normalize trailing slash
105105 const registry = options . registry || 'https://registry.npmjs.org'
106- options . registry = this . registry = registry . replace ( / \/ + $ / , '' ) + '/'
106+ options . registry = this . registry = registry . replace ( / (?< ! \/ ) \/ + $ / , '' ) + '/'
107107
108108 const {
109109 follow = false ,
You can’t perform that action at this time.
0 commit comments