mirror of
https://github.com/0x5eal/semver-luau.git
synced 2025-03-04 11:11:39 +00:00
feat: trim leading v
in versions
This commit is contained in:
parent
fa8452ecd9
commit
4c2d25485d
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…
Add table
Reference in a new issue