Skip to content

Commit

Permalink
refactor: Use a better name for the depth argument
Browse files Browse the repository at this point in the history
  • Loading branch information
RSeidelsohn committed Apr 12, 2023
1 parent 03c69ee commit 7a4f006
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ const recursivelyCollectAllDependencies = (options) => {
/*istanbul ignore else*/
if (json.dependencies) {
Object.keys(json.dependencies).forEach((name) => {
const childDependency = options.depth > options._args.direct ? {} : json.dependencies[name];
const childDependency = options.currentRecursionDepth > options._args.direct ? {} : json.dependencies[name];
const dependencyId = `${childDependency.name}@${childDependency.version}`;

if (data[dependencyId]) {
Expand All @@ -337,7 +337,7 @@ const recursivelyCollectAllDependencies = (options) => {
development: options.development,
production: options.production,
unknown,
depth: options.depth + 1,
currentRecursionDepth: options.currentRecursionDepth + 1,
clarifications: options.clarifications,
});
});
Expand Down Expand Up @@ -468,7 +468,7 @@ exports.init = function init(args, callback) {
development: args.development,
production: args.production,
unknown: args.unknown,
depth: 0,
currentRecursionDepth: 0,
clarifications,
});

Expand Down

0 comments on commit 7a4f006

Please sign in to comment.