0

~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0-0 (highlighted)

In above example, what is the meaning of symbol -0 after version(1.3.0-0)?

see: https://github.com/npm/node-semver#versions

coldMater
  • 31
  • 4
  • 1
    https://semver.org/ From Item 9, it looks like it's used for a pre-release version. So it seems to be a prerelease tag? I tried using `semver.inc('1.2.3', 'prerelease', '')`, and got `'1.2.4-0'` – qrsngky Jun 22 '22 at 04:15
  • @qrsngky Thanks! `-0` from `1.3.0-0` means very-first pre-release of `1.3.0`. If so, why is it used with the `<` symbol? I don't think it simply means 'every pre-release lower than 1.3.0-0'. – coldMater Jun 22 '22 at 05:45
  • (Following the comment above) Actually, according to https://semver.npmjs.com/, there is no difference between `>=2.0.0-alpha-3 <6.0.1-0` and `>=2.0.0-alpha-3 <6.0.1`. (I picked a 'npm' package.) – coldMater Jun 22 '22 at 06:15
  • If you use `semver.satisfies` then there should be no difference: *anything with 1.3.... won't satisfy the requirement*. But if someone uses `semver.gt` and `semver.lt` then '1.3.0-0' results in `semver.gt("1.3.0-0", "1.2.0")`==true and `semver.lt("1.3.0-0", "1.3.0")`==true, i.e. `1.3.0-0` would appear to be both '>1.2.0' and '<1.3.0'. But `semver.satisfies('1.3.0-0', '>1.2.0')` is false anyway. – qrsngky Jun 22 '22 at 06:25

0 Answers0