Coerce non-semver into semver (#34)

This commit is contained in:
Paulo F. Oliveira authored and GitHub committed 2021-05-15 00:07:41 +01:00
1 parent d2707f347b
commit a550a4c889
5 files changed
+39 -5

No files matched your search

+4 -1
View File
@@ -184,7 +184,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
})