Skip to content

Commit

Permalink
Fix module regex for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Loring committed May 2, 2016
1 parent 2167b16 commit e331cdd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ function stringifyPrefix(o, n) {
}

// Includes support for npm '@org/name' packages
// Regex: .*?node_modules\/(@[^\/]*\/[^\/]*|[^\/]*).*
// Tests: https://regex101.com/r/lW2bE3/4
// Regex: .*?node_modules(?!.*node_modules)\/(@[^\/]*\/[^\/]*|[^\/]*).*
// Tests: https://regex101.com/r/lW2bE3/6
var moduleRegex = new RegExp(
'.*?node_modules' + path.sep +
'(@[^' + path.sep +
']*' + path.sep +
'[^' + path.sep +
']*|[^' + path.sep +
'.*?node_modules(?!.*node_modules)\\' + path.sep +
'(@[^\\' + path.sep +
']*\\' + path.sep +
'[^\\' + path.sep +
']*|[^\\' + path.sep +
']*).*'
);

Expand Down

0 comments on commit e331cdd

Please sign in to comment.