prerelease<=> ( semver1 semver2 -- <=> )


Vocabulary
semver.private

Inputs
semver1an object
semver2an object


Outputs
<=>an object


Definition


: prerelease<=> ( semver1 semver2 -- <=> )
[ prerelease>> ] bi@ {
{ [ over empty? ] [ nip empty? +eq+ +gt+ ? ] }
{ [ dup empty? ] [ 2drop +lt+ ] }
[
[ "." split [ [ string>number ] keep or ] map ] bi@
zip-longest [
first2 {
{ ~quotation~ ~quotation~ }
{ ~quotation~ ~quotation~ }
{ ~quotation~ ~quotation~ }
{ ~quotation~ ~quotation~ }
{ ~quotation~ ~quotation~ }
{ ~quotation~ ~quotation~ }
[ 2drop +eq+ ]
} cond dup +eq+ eq? [ drop f ] when
] map-find drop +eq+ or
]
} cond ; inline