Skip to content

Commit

Permalink
deps: Fix regexp used to cleanup from fields
Browse files Browse the repository at this point in the history
Credit: @iarna
  • Loading branch information
iarna committed May 5, 2018
1 parent fb99f75 commit 3232699
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function doesChildVersionMatch (child, requested, requestor) {
// You'll see this scenario happen with at least tags and git dependencies.
// Some buggy clients will write spaces into the module name part of a _from.
if (child.package._from) {
var fromReq = npa.resolve(moduleName(child), child.package._from.replace(new RegExp('^\s*' + moduleName(child) + '\s*@'), ''))
var fromReq = npa.resolve(moduleName(child), child.package._from.replace(new RegExp('^\\s*' + moduleName(child) + '\\s*@'), ''))
if (fromReq.rawSpec === requested.rawSpec) return true
if (fromReq.type === requested.type && fromReq.saveSpec && fromReq.saveSpec === requested.saveSpec) return true
}
Expand Down

0 comments on commit 3232699

Please sign in to comment.