You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,12 +128,25 @@ greater than or equal to 4.2.3.
128
128
The basic comparisons are:
129
129
130
130
*`=`: equal (aliased to no operator)
131
+
*`==`: strictly equal
131
132
*`!=`: not equal
132
133
*`>`: greater than
133
134
*`<`: less than
134
135
*`>=`: greater than or equal to
135
136
*`<=`: less than or equal to
136
137
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
+
137
150
### Working With Prerelease Versions
138
151
139
152
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`.
177
190
### Wildcards In Comparisons
178
191
179
192
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
181
194
back to the patch level comparison (see tilde below). For example,
0 commit comments