diff options
author | isaacs <i@izs.me> | 2020-10-02 20:48:31 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-10-02 21:37:30 +0300 |
commit | c20e2f0c7766a04f999fdc64faad29277904c2d3 (patch) | |
tree | ca388245fb451428636900b46f1a601b0e2956a2 /lib/outdated.js | |
parent | 384f5ec47091eed66c2a47f2c98df3ba7506ec9f (diff) |
Support --omit options in npm outdated
PR-URL: https://github.com/npm/cli/pull/1892
Credit: @isaacs
Close: #1892
Reviewed-by: @nlf
Diffstat (limited to 'lib/outdated.js')
-rw-r--r-- | lib/outdated.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index e7c800dc9..c3b15e411 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -130,6 +130,12 @@ async function outdated_ (tree, deps, opts) { : edge.dev ? 'devDependencies' : 'dependencies' + for (const omitType of opts.omit || []) { + if (node[omitType]) { + return + } + } + // deps different from prod not currently // on disk are not included in the output if (edge.error === 'MISSING' && type !== 'dependencies') return |