Created
September 23, 2013 04:58
-
-
Save luk-/6666574 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1.0 | |
semver.satisfies('2.1.0', '>2.x.x') // true | |
// 2.0 | |
semver.satisfies('2.1.0', '>2.x.x') // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's an odd case, since it depends on what you resolve the first
x
to,semver.satisfies('2.1.1', '>2.0.x') // => true
seems correct, howeversemver.satisfies('2.1.1', '>2.2.x') // => true
seems incorrectThis is so much easier with
~
definitions, since it's more deterministic:semver.satisfies('2.1.1', '~2.0.0') // => true
is correctsemver.satisfies('2.1.1', '~2.2.0') // => true
is incorrectI don't know if this is a bug, but would rather argue that
>
,<
and>=
,<=
, with a non-exact version are problematic and should be considered invalid definitions.