-
Notifications
You must be signed in to change notification settings - Fork 511
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
[FEATURE] decrement/truncate #48
Comments
Would be handy to have |
I didn't have time to do a proper patch, but I did a quick module for truncation if anyone else needs it: https://github.com/sindresorhus/semver-truncate |
What should |
Any news on this? |
Not pressing or urgent, but mostly for API symmetry, it'd be nice to have truncate/decrement functions.
semver.truncate('1.2.3-foo', 'patch') == '1.2.3'
semver.truncate('1.2.3', 'minor') == '1.2.0'
semver.truncate('1.2.3', 'major') == '1.0.0'
semver.dec('1.2.3-foo', 'patch') == '1.2.2'
semver.dec('1.2.3', 'minor') == '1.1.0'
semver.dec('1.2.3', 'major') == '0.0.0'
Re #46, but the use case presented there turned out to not require this functionality. It's still probably useful, though.
cc @ronkorving
The text was updated successfully, but these errors were encountered: