Skip to content

Commit

Permalink
Clarify caret operator range for pre-1.0.0 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
greysteil committed Jul 24, 2018
1 parent 4ca3c04 commit 5dc6477
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -147,6 +147,7 @@ The caret (`^`) comparison operator is for major level changes. This is useful
when comparisons of API versions as a major change is API breaking. For example,

* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0`
* `^0.0.1` is equivalent to `>= 0.0.1, < 1.0.0`
* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0`
* `^2.3` is equivalent to `>= 2.3, < 3`
* `^2.x` is equivalent to `>= 2.0.0, < 3`
Expand Down
1 change: 1 addition & 0 deletions constraints_test.go
Expand Up @@ -354,6 +354,7 @@ func TestConstraintsValidate(t *testing.T) {
{"^1.x", "1.1.1", true},
{"^2.x", "1.1.1", false},
{"^1.x", "2.1.1", false},
{"^0.0.1", "0.1.3", true},
{"~*", "2.1.1", true},
{"~1", "2.1.1", false},
{"~1", "1.3.5", true},
Expand Down

0 comments on commit 5dc6477

Please sign in to comment.