Skip to content

Commit 3232699

Browse files
committed
deps: Fix regexp used to cleanup from fields
Credit: @iarna
1 parent fb99f75 commit 3232699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/install/deps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function doesChildVersionMatch (child, requested, requestor) {
7676
// You'll see this scenario happen with at least tags and git dependencies.
7777
// Some buggy clients will write spaces into the module name part of a _from.
7878
if (child.package._from) {
79-
var fromReq = npa.resolve(moduleName(child), child.package._from.replace(new RegExp('^\s*' + moduleName(child) + '\s*@'), ''))
79+
var fromReq = npa.resolve(moduleName(child), child.package._from.replace(new RegExp('^\\s*' + moduleName(child) + '\\s*@'), ''))
8080
if (fromReq.rawSpec === requested.rawSpec) return true
8181
if (fromReq.type === requested.type && fromReq.saveSpec && fromReq.saveSpec === requested.saveSpec) return true
8282
}

0 commit comments

Comments
 (0)