Skip to content

Commit

Permalink
fix override deduplication bug (#2142)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Oct 31, 2016
1 parent db0834c commit fd2990c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,15 +806,15 @@ function derivePackageConfig(pkg, packageConfig, override) {
// and clone properties that do
for (var p in override) {
var stringified = JSON.stringify(override[p]);
if (JSON.stringify(packageConfig.jspm[p]) !== stringified && JSON.stringify(packageConfig[p]) !== stringified)
if (p in packageConfig.jspm ? JSON.stringify(packageConfig.jspm[p]) !== stringified : JSON.stringify(packageConfig[p]) !== stringified)
packageConfig.jspm[p] = JSON.parse(stringified);
else
delete override[p];
}
}

// then apply the override
if (override || packageConfig.jspm)
if (packageConfig.jspm)
extend(packageConfig, packageConfig.jspm);

var endpoint = registry.load(packageConfig.registry || pkg.registry);
Expand Down

0 comments on commit fd2990c

Please sign in to comment.