Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
fix canonicalization to handle non-wildcard paths
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed May 15, 2016
1 parent 649a19d commit a381d02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ function getCanonicalNamePlain(loader, normalized, isPlugin) {
return p;

// support trailing / in paths rules
else if (normalized.substr(0, curPath.length - 1) == curPath.substr(0, curPath.length - 1) && (normalized.length < curPath.length || normalized[curPath.length - 1] == curPath[curPath.length - 1]) && curPath[curPath.length - 1] == '/')
return p.substr(0, p.length - 1) + (normalized.length > curPath.length ? '/' + normalized.substr(curPath.length) : '');
else if (normalized.substr(0, curPath.length - 1) == curPath.substr(0, curPath.length - 1) &&
(normalized.length < curPath.length || normalized[curPath.length - 1] == curPath[curPath.length - 1]) &&
curPath[curPath.length - 1] == '/')
return p + normalized.substr(curPath.length);
}

// then wildcard matches
Expand Down

0 comments on commit a381d02

Please sign in to comment.