Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow new majors of node to be automatically considered supported #697

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/utils/unsupported.js
@@ -1,5 +1,6 @@
'use strict'
var semver = require('semver')
var earliestSupportedNode = '9.3.0'
var supportedNode = [
{ver: '6', min: '6.0.0'},
{ver: '8', min: '8.0.0'},
Expand All @@ -13,10 +14,11 @@ var knownBroken = '<6.2.0 || 9.0 - 9.2'

var checkVersion = exports.checkVersion = function (version) {
var versionNoPrerelease = version.replace(/-.*$/, '')
var isExplicitlySupportedNode = semver.satisfies(versionNoPrerelease, supportedNode.map(function (n) { return '^' + n.min }).join('||'))
return {
version: versionNoPrerelease,
broken: semver.satisfies(versionNoPrerelease, knownBroken),
unsupported: !semver.satisfies(versionNoPrerelease, supportedNode.map(function (n) { return '^' + n.min }).join('||'))
unsupported: !isExplicitlySupportedNode || !semver.gte(versionNoPrerelease, earliestSupportedNode)
}
}

Expand Down