From 9cc46940be96d7325320279fd383b8ea5f7b8460 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 16 Jan 2020 11:40:54 -0800 Subject: [PATCH] allow new majors of node to be automatically considered supported --- lib/utils/unsupported.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/unsupported.js b/lib/utils/unsupported.js index 71a304030e242..a1e51f495da52 100644 --- a/lib/utils/unsupported.js +++ b/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'}, @@ -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) } }