Skip to content

Commit ca72eb9

Browse files
committed
docs: updated readme
1 parent 6ebb3bd commit ca72eb9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,25 @@ greater than or equal to 4.2.3.
128128
The basic comparisons are:
129129

130130
* `=`: equal (aliased to no operator)
131+
* `==`: strictly equal
131132
* `!=`: not equal
132133
* `>`: greater than
133134
* `<`: less than
134135
* `>=`: greater than or equal to
135136
* `<=`: less than or equal to
136137

138+
### Strict Comparisons
139+
140+
The double equal (`==`) operator is used to check if a version is really strictly equal to
141+
the passed version.
142+
These look like:
143+
144+
* `==1.2.1` will only look for a `1.2.1` version, metadatas or preleased versions will be considered different from this version.
145+
* `==1.2.1-alpha` will only look for a `1.2.1-alpha` preleased version
146+
* `==1.2.1+alpha` will only look for a `1.2.1-alpha` preleased version
147+
148+
> This helps looking for a very specific version only, the `=` operator (or the no operator) will be ok with metadatas in the version in the first place, ex: `=1.2.1` will be equivalent to `=1.2.1+x` where `x` can be any medatata.
149+
137150
### Working With Prerelease Versions
138151

139152
Pre-releases, for those not familiar with them, are used for software releases
@@ -177,7 +190,7 @@ parsed as a single constraint `1.2.0` with _prerelease_ `1.4.5`.
177190
### Wildcards In Comparisons
178191

179192
The `x`, `X`, and `*` characters can be used as a wildcard character. This works
180-
for all comparison operators. When used on the `=` operator it falls
193+
for all comparison operators except the strict operators. When used on the `=` operator it falls
181194
back to the patch level comparison (see tilde below). For example,
182195

183196
* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`

0 commit comments

Comments
 (0)