Permalink
Browse files

removed two unnecessary functions

in L54, err would have always be falsey (or the function had returned
earlier)
  • Loading branch information...
1 parent f74cfd3 commit e1aa6b0cac6297751f58f4d33d0f8cd1bb5e0872 @fb55 fb55 committed Sep 7, 2012
Showing with 4 additions and 7 deletions.
  1. +4 −7 lib/require-analyzer.js
View
@@ -50,9 +50,7 @@ analyzer.analyze = function (options, callback) {
return callback(null, deps);
}
- var npmEmitter = analyzer.npmAnalyze(deps, options, function (nerr, reduced, suspect) {
- return callback(err || nerr, reduced, suspect);
- });
+ var npmEmitter = analyzer.npmAnalyze(deps, options, callback);
//
// Re-emit the `search` and `reduce` events from the `npmEmitter`
@@ -132,7 +130,7 @@ analyzer.npmAnalyze = function (deps, options, callback) {
}
//
- // Analyze dependencies by searching for all installed locally via npm.
+ // Analyze dependencies by searching for all installed locally via read-installed.
// Then see if it depends on any other dependencies that are in the
// list so those dependencies may be removed (only if `options.reduce` is set).
//
@@ -141,6 +139,7 @@ analyzer.npmAnalyze = function (deps, options, callback) {
return callback(err);
}
else if (!result || !result.dependencies || Object.keys(result.dependencies).length === 0) {
+ // When no dependencies were found, return what we got
return callback(null, deps);
}
@@ -349,9 +348,7 @@ analyzer.package = function (options, callback) {
scripts = scripts.map(function (item) {
return pkg.scripts && pkg.scripts[item];
- }).filter(function (item) {
- return !!item;
- });
+ }).filter(Boolean);
if (scripts) {
scripts.forEach(function analyzeScript(script) {

0 comments on commit e1aa6b0

Please sign in to comment.