Skip to content

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

Merged
wraithgar merged 1 commit into
npm:mainfrom
amitse:patch-1
Oct 4, 2022
Merged

docs: update range.js comments to clarify the caret ranges examples#477
wraithgar merged 1 commit into
npm:mainfrom
amitse:patch-1

Conversation

@amitse

Copy link
Copy Markdown
Contributor

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 ownerSeptember 7, 2022 09:03
@amitseamitse changed the title Update range.jsUpdate range.js comments to clarify the caret ranges examples comment.Sep 9, 2022
@wraithgarwraithgar 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
Copy Markdown
Contributor

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.

@wraithgarwraithgar 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 examplesOct 4, 2022
@wraithgar
wraithgar merged commit 7209b14 into npm:mainOct 4, 2022
@github-actionsgithub-actionsBot mentioned this pull request Oct 4, 2022
Sign up for freeto 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

@amitse@wraithgar