fix(version): return nil with empty string

This commit is contained in:
Maria José Solano
2024-07-26 19:19:39 -07:00
committed by Lewis Russell
parent 60967cd9aa
commit 8bdfc2ab2b
2 changed files with 8 additions and 0 deletions

View File

@@ -174,6 +174,10 @@ function M._version(version, strict) -- Adapted from https://github.com/folke/la
version = version:match('%d[^ ]*')
end
if version == nil then
return nil
end
local prerel = version:match('%-([^+]*)')
local prerel_strict = version:match('%-([0-9A-Za-z-]*)')
if