diff options
author | isaacs <i@izs.me> | 2020-07-23 23:28:00 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-07-29 21:54:59 +0300 |
commit | 8654c05e6e8cabf4642425b9e6373aeae9801c21 (patch) | |
tree | a8a5053204d15c5eff467a90175526eba6233999 /lib/rebuild.js | |
parent | c3b3b79b03583887ba8e63201c1a01e8043a89e9 (diff) |
lint the lib folder
Diffstat (limited to 'lib/rebuild.js')
-rw-r--r-- | lib/rebuild.js | 12 |
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) }) } |