Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-10-02 20:48:31 +0300
committerisaacs <i@izs.me>2020-10-02 21:37:30 +0300
commitc20e2f0c7766a04f999fdc64faad29277904c2d3 (patch)
treeca388245fb451428636900b46f1a601b0e2956a2 /lib/outdated.js
parent384f5ec47091eed66c2a47f2c98df3ba7506ec9f (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.js6
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