Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
fix(pkgmap): perf fixed :D :D :D
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Aug 8, 2018
1 parent 4cab93f commit 3052dbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pkgmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function resolve (...p) {
let scope = pkgMap
while (subPath) {
[, pkgName, subPath] = subPath.match(/^((?:@[^/\\]+[/\\])?[^/\\]+)[/\\]?(.*)/)
if (pkgName === scope.path_separator) {
if (pkgName === scope.path_prefix) {
continue
}
if (
Expand All @@ -61,6 +61,8 @@ function resolve (...p) {
} else if (scope && scope.scopes && scope.scopes[pkgName]) {
const {scopes: {[pkgName]: newScope}} = scope
scope = newScope
} else {
return false
}
}
return false
Expand Down

0 comments on commit 3052dbf

Please sign in to comment.