fix linting
This commit is contained in:
parent
bc21add820
commit
2854aa76b0
14
lib/index.js
14
lib/index.js
@ -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' ]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user