mirror of
https://github.com/0x5eal/semver-luau.git
synced 2024-12-12 15:00:36 +00:00
feat: trim leading v
in versions
This commit is contained in:
parent
953831d103
commit
f6090f9c98
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ local PRERELEASE_LEX_ORDER: { [PreleaseType]: number } = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Semver.parse(ver: string): SemverResult<SemverImpl>
|
function Semver.parse(ver: string): SemverResult<SemverImpl>
|
||||||
local components = string.split(ver, ".")
|
local components = string.split(if stringStartsWith(ver, "v") then string.sub(ver, 2) else ver, ".")
|
||||||
if #components < 3 then
|
if #components < 3 then
|
||||||
return Result.Err({
|
return Result.Err({
|
||||||
msg = Option.Some(`Expected MAJOR.MINOR.PATCH format, missing {#components} / 3 components`),
|
msg = Option.Some(`Expected MAJOR.MINOR.PATCH format, missing {#components} / 3 components`),
|
||||||
|
|
Loading…
Reference in a new issue