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-07-23 23:28:00 +0300
committerisaacs <i@izs.me>2020-07-29 21:54:59 +0300
commit8654c05e6e8cabf4642425b9e6373aeae9801c21 (patch)
treea8a5053204d15c5eff467a90175526eba6233999 /lib/outdated.js
parentc3b3b79b03583887ba8e63201c1a01e8043a89e9 (diff)
lint the lib folder
Diffstat (limited to 'lib/outdated.js')
-rw-r--r--lib/outdated.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/outdated.js b/lib/outdated.js
index a4e3e7029..f86550be9 100644
--- a/lib/outdated.js
+++ b/lib/outdated.js
@@ -62,7 +62,7 @@ async function outdated (args) {
'Wanted',
'Latest',
'Location',
- 'Depended by',
+ 'Depended by'
]
if (opts.long) outHead.push('Package Type', 'Homepage')
@@ -84,12 +84,11 @@ async function outdated (args) {
async function outdated_ (tree, deps, opts) {
const list = []
-
const edges = new Set()
- function getEdges(nodes, type) {
+ function getEdges (nodes, type) {
const getEdgesIn = (node) => {
- for (const edge of node.edgesIn) {
+ for (const edge of node.edgesIn) {
edges.add(edge)
}
}
@@ -102,9 +101,9 @@ async function outdated_ (tree, deps, opts) {
if (!nodes) return getEdgesOut(tree)
for (const node of nodes) {
- type === 'edgesOut' ?
- getEdgesOut(node) :
- getEdgesIn(node)
+ type === 'edgesOut'
+ ? getEdgesOut(node)
+ : getEdgesIn(node)
}
}
@@ -135,8 +134,8 @@ async function outdated_ (tree, deps, opts) {
const type = edge.optional ? 'optionalDependencies'
: edge.peer ? 'peerDependencies'
- : edge.dev ? 'devDependencies'
- : 'dependencies'
+ : edge.dev ? 'devDependencies'
+ : 'dependencies'
// deps different from prod not currently
// on disk are not included in the output
@@ -176,7 +175,6 @@ async function outdated_ (tree, deps, opts) {
throw (err)
}
}
-
}
const p = []
@@ -270,4 +268,4 @@ function makeJSON (list, opts) {
return JSON.stringify(out, null, 2)
}
-module.exports = Object.assign(cmd, { completion, usage })
+module.exports = Object.assign(cmd, { completion, usage })