diff --git a/lib/core/Project.js b/lib/core/Project.js index b897aaba..0bb39668 100644 --- a/lib/core/Project.js +++ b/lib/core/Project.js @@ -659,8 +659,8 @@ Project.prototype._restoreNode = function (node, flattened, jsonKey) { node.dependencies = node.dependencies || {}; node.dependants = node.dependants || {}; - deps = mout.object.filter(node.pkgMeta[jsonKey], function (value) { - return !node.dependencies[value]; + deps = mout.object.filter(node.pkgMeta[jsonKey], function (value, key) { + return !node.dependencies[key]; }); mout.object.forOwn(deps, function (value, key) { @@ -698,11 +698,11 @@ Project.prototype._restoreNode = function (node, flattened, jsonKey) { restored.dependants[node.name] = node; // Call restore for this dependency - this._restoreNode(restored, flattened, jsonKey); + this._restoreNode(restored, flattened, 'dependencies'); // Do the same for the incompatible local package if (local && restored !== local) { - this._restoreNode(local, flattened, jsonKey); + this._restoreNode(local, flattened, 'dependencies'); } }, this); };