Coerce non-semver into semver (#34)

This commit is contained in:
Paulo F. Oliveira
2021-05-15 00:07:41 +01:00
committed by GitHub
parent d2707f347b
commit a550a4c889
5 changed files with 39 additions and 5 deletions
+4 -1
View File
@@ -4791,7 +4791,10 @@ async function getOTPVersions(osVersion) {
.forEach((line) => {
const otpMatch = line.match(/^(OTP-)?([^ ]+)/)
const otpVersion = otpMatch[2]
let otpVersion = otpMatch[2]
if (semver.validRange(otpVersion)) {
otpVersion = semver.minVersion(otpVersion).version
}
otpVersions.set(otpVersion, otpMatch[0]) // we keep the original for later reference
})