From 611070f0f7a1e185c75cadae46179194084b398f Mon Sep 17 00:00:00 2001 From: Zac Date: Thu, 3 Mar 2016 17:31:22 -0800 Subject: ls: Made `npm ls --parseable` honor the `depth` option Credit: @zacdoe Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/11773 Fixes: #11495 --- lib/ls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ls.js') diff --git a/lib/ls.js b/lib/ls.js index 8be186fdb..b5dc44888 100644 --- a/lib/ls.js +++ b/lib/ls.js @@ -434,7 +434,7 @@ function getExtras (data) { function makeParseable (data, long, dir, depth, parent, d) { depth = depth || 0 - + if (depth > npm.config.get('depth')) return [ makeParseable_(data, long, dir, depth, parent, d) ] return [ makeParseable_(data, long, dir, depth, parent, d) ] .concat(Object.keys(data.dependencies || {}) .sort(alphasort).map(function (d) { -- cgit v1.2.3