(availableVersions?: NodeVersionMajor[])
| 102 | } |
| 103 | |
| 104 | export function getLatestNodeVersion(availableVersions?: NodeVersionMajor[]) { |
| 105 | const all = getOptions(); |
| 106 | if (availableVersions) { |
| 107 | // Return the first node version that is definitely |
| 108 | // available in the build-container. |
| 109 | for (const version of all) { |
| 110 | for (const major of availableVersions) { |
| 111 | if (version.major === major) { |
| 112 | return version; |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | // As a fallback for local `vc build` and the tests, |
| 118 | // return the first node version if none is found. |
| 119 | return all[0]; |
| 120 | } |
| 121 | |
| 122 | export function getDiscontinuedNodeVersions(): NodeVersion[] { |
| 123 | return getOptions().filter(version => { |
no test coverage detected