From 5f6df2126de391f70e361b64e266f77615b754d3 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 25 Aug 2019 19:37:13 +1200 Subject: [PATCH] Don't override user specified depth in outdated Restores ability to update packages using `--depth` as suggested by `npm audit`. i.e `npm update eslint-utils --depth 2`. --- lib/outdated.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/outdated.js b/lib/outdated.js index 794197cfc6a69..5b84ae35587c8 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -91,7 +91,7 @@ function outdated (args, silent, cb) { var dir = path.resolve(npm.dir, '..') // default depth for `outdated` is 0 (cf. `ls`) - if (opts.depth) opts = opts.concat({depth: 0}) + if (opts.depth === Infinity) opts = opts.concat({depth: 0}) readPackageTree(dir, andComputeMetadata(function (er, tree) { if (!tree) return cb(er)