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:
Diffstat (limited to 'lib/rebuild.js')
-rw-r--r--lib/rebuild.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/rebuild.js b/lib/rebuild.js
index df1d29566..a2beecc50 100644
--- a/lib/rebuild.js
+++ b/lib/rebuild.js
@@ -37,18 +37,14 @@ const rebuild = async args => {
const getFilterFn = args => {
const specs = args.map(arg => {
const spec = npa(arg)
- if (spec.type === 'tag' && spec.rawSpec === '')
- return spec
- if (spec.type !== 'range' && spec.type !== 'version')
- throw new Error('`npm rebuild` only supports SemVer version/range specifiers')
+ if (spec.type === 'tag' && spec.rawSpec === '') { return spec }
+ if (spec.type !== 'range' && spec.type !== 'version') { throw new Error('`npm rebuild` only supports SemVer version/range specifiers') }
return spec
})
return node => specs.some(spec => {
const { version } = node.package
- if (spec.name !== node.name)
- return false
- if (spec.rawSpec === '' || spec.rawSpec === '*')
- return true
+ if (spec.name !== node.name) { return false }
+ if (spec.rawSpec === '' || spec.rawSpec === '*') { return true }
return semver.satisfies(version, spec.fetchSpec)
})
}