Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre release version is ignored by semver.maxSatisfying #216

Closed
guptar8jan opened this issue Nov 9, 2017 · 1 comment
Closed

Pre release version is ignored by semver.maxSatisfying #216

guptar8jan opened this issue Nov 9, 2017 · 1 comment

Comments

@guptar8jan
Copy link

I am using maxSatisfying method with following parameters:
const versions = [ '1.0.0',
'1.0.1',
'1.0.2',
'1.0.3',
'1.0.4',
'1.1.2',
'1.1.6',
'1.1.7',
'1.1.8',
'1.1.9',
'2.0.4',
'2.1.7',
'2.1.8-alpha.1' ]
semver.maxSatisfying(versions, '*', true)

RESULT: '2.1.7'

I am expecting '2.1.8-alpha.1'.

I believe this is a bug. I traced to down to this line of code https://github.com/npm/node-semver/blob/master/semver.js#L1124. I believe replace CONTINUE, with 'return true' would makes sense. Please advice.

@isaacs
Copy link
Contributor

isaacs commented Nov 13, 2017

Working as intended. https://github.com/npm/node-semver#prerelease-tags

Pre-release tags are strictly opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants