Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

semver: matching a pre-release suffix (3.* =/= 3.4.5-1)

Using this online semver checker: https://jubianchi.github.io/semver-check/

Notice how

version "3.4.5" is compatible with expression "3." enter image description here but... enter image description here version "3.4.5-1" is NOT compatible with expression "3."

How can I change my compatibility expression to include this pre-release version?

like image 806
Carson the Powers Avatar asked Sep 11 '18 16:09

Carson the Powers


1 Answers

That's because pre-release versions are not included by default.

According to the docs:

SemVer comparisons without a pre-release comparator will skip pre-release versions. For example, >=1.2.3 will skip pre-releases when looking at a list of releases while >=1.2.3-0 will evaluate and find pre-releases.

In order to match that pre-release version, you could use, for example: ~3 >3.4.5-0.

3.4.5-1 satisfies constraint ~3 >3.4.5-0

like image 98
fsinisi90 Avatar answered Nov 17 '22 08:11

fsinisi90