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

docs: update range.js comments to clarify the caret ranges examples #477

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

amitse
Copy link
Contributor

@amitse amitse commented Sep 7, 2022

Update range.js comments to clarify the caret examples

Caret (^) - does not modify the left-most non-zero element in the M.m.p-e. Tilde (~) - does not modify M and m.

hence, ^0.0.1-1 matches 0.0.1-5
however, ~0.0.1-1 matches 0.0.5
which might be counterintuitive and hence adding this example explicitly.

References

Update range.js comments to clarify the caret exaples

Caret (^) - does not modify the left-most non-zero element in the M.m.p-e.
Tilde (~) - does not modify M and m.

hence, ^0.0.1-1 matches 0.0.1-5
however, ~0.0.1-1 matches 0.0.5
which might be counterintuitive and hence adding this example explicitly.
@amitse amitse requested a review from a team as a code owner September 7, 2022 09:03
@amitse amitse changed the title Update range.js Update range.js comments to clarify the caret ranges examples comment. Sep 9, 2022
@wraithgar wraithgar changed the title Update range.js comments to clarify the caret ranges examples comment. docs: Update range.js comments to clarify the caret ranges examples comment. Oct 4, 2022
@wraithgar
Copy link
Member

Thanks, the "leading zeroes with caret ranges" is definitely one of the finer points of semver that trip people up. Anything that adds clarification is probably a good idea.

@wraithgar wraithgar changed the title docs: Update range.js comments to clarify the caret ranges examples comment. docs: update range.js comments to clarify the caret ranges examples Oct 4, 2022
@wraithgar wraithgar merged commit 7209b14 into npm:main Oct 4, 2022
@github-actions github-actions bot mentioned this pull request Oct 4, 2022
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

Successfully merging this pull request may close these issues.

2 participants