I tried this:
> s = require('semver')
> v='0.0.0'
'0.0.0'
> v = s.inc(v, 'premajor')
'1.0.0-0'
> v = s.inc(v, 'premajor')
'2.0.0-0'
> v = s.inc(v, 'premajor')
'3.0.0-0'
> v = s.inc(v, 'premajor')
I would expect 1.0.0-0, 1.0.0-1, 1.0.0-2 and so on -- as I can have a number of pre-releases before I do s.inc(v, 'major'), right?
Is this just my misunderstanding or is it a bug? And if this behaviour is expected, how do I get to e.g. 1.0.0-5 using the inc function? Or should I use the undocumented pre option from https://github.com/npm/node-semver/blob/master/semver.js#L457 ?
Btw, the same applies to inc with preminor or prepatch.
I tried this:
I would expect
1.0.0-0,1.0.0-1,1.0.0-2and so on -- as I can have a number of pre-releases before I dos.inc(v, 'major'), right?Is this just my misunderstanding or is it a bug? And if this behaviour is expected, how do I get to e.g. 1.0.0-5 using the
incfunction? Or should I use the undocumentedpreoption from https://github.com/npm/node-semver/blob/master/semver.js#L457 ?Btw, the same applies to
incwithpreminororprepatch.