fix linting

This commit is contained in:
Igor Klopov 2017-07-24 20:16:43 +03:00
parent bc21add820
commit 2854aa76b0

View File

@ -32,10 +32,10 @@ export async function need (opts = {}) { // eslint-disable-line complexity
function satisfyingNodeVersion (includeLowPriority) {
const versions = Object.keys(patchesJson)
.filter((nodeVersion) => includeLowPriority ||
!patchesJson[nodeVersion].lowPriority)
.filter((nodeVersion) => semver.satisfies(nodeVersion, nodeRange) ||
nodeRange === 'latest')
.filter((nv) => includeLowPriority ||
!patchesJson[nv].lowPriority)
.filter((nv) => semver.satisfies(nv, nodeRange) ||
nodeRange === 'latest')
.sort((nv1, nv2) => semver.gt(nv1, nv2));
return versions.pop();
}
@ -52,11 +52,11 @@ export async function need (opts = {}) { // eslint-disable-line complexity
}
if (!nodeVersion) {
const withStars = Object.keys(patchesJson).map((nodeVersion) =>
nodeVersion.slice(1) + (patchesJson[nodeVersion].lowPriority ? '*' : '')
const withStars = Object.keys(patchesJson).map((nv) =>
nv.slice(1) + (patchesJson[nv].lowPriority ? '*' : '')
).reverse().join(', ');
throw wasReported(`No available node version satisfies '${opts.nodeRange}'`, [
throw wasReported(`No supported node version satisfies '${opts.nodeRange}'`, [
'Supported node versions are:', withStars,
'(*) Precompiled base binaries are available for limited number of',
'platforms. Pkg will likely have to compile base binaries from source' ]);