This repository was archived by the owner on Jul 13, 2020. It is now read-only.
File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function SystemLoader() {
20
20
// NB no specification provided for System.paths, used ideas discussed in https://github.com/jorendorff/js-loaders/issues/25
21
21
function applyPaths ( paths , name ) {
22
22
// most specific (most number of slashes in path) match wins
23
- var pathMatch = '' , wildcard , maxSlashCount = 0 ;
23
+ var pathMatch = '' , wildcard , maxWildcardPrefixLen = 0 ;
24
24
25
25
// check to see if we have a paths entry
26
26
for ( var p in paths ) {
@@ -37,11 +37,11 @@ function applyPaths(paths, name) {
37
37
}
38
38
// wildcard path match
39
39
else {
40
- var slashCount = p . split ( '/' ) . length ;
41
- if ( slashCount >= maxSlashCount &&
40
+ var wildcardPrefixLen = pathParts [ 0 ] . length ;
41
+ if ( wildcardPrefixLen >= maxWildcardPrefixLen &&
42
42
name . substr ( 0 , pathParts [ 0 ] . length ) == pathParts [ 0 ] &&
43
43
name . substr ( name . length - pathParts [ 1 ] . length ) == pathParts [ 1 ] ) {
44
- maxSlashCount = slashCount ;
44
+ maxWildcardPrefixLen = wildcardPrefixLen ;
45
45
pathMatch = p ;
46
46
wildcard = name . substr ( pathParts [ 0 ] . length , name . length - pathParts [ 1 ] . length - pathParts [ 0 ] . length ) ;
47
47
}
You can’t perform that action at this time.
0 commit comments