Description
I'm expecting version 1.2.3-alpha
to satisfy the range < 1.2.4
, but that doesn't seem to be the case.
I'm not sure if the <
part of this is specific to npm or part of the underlying semver spec, but both of the following return false.
SemVersion.Parse("1.2.3-alpha").SatisfiesNpm("< 1.2.4"); // false
SemVersion.Parse("1.2.3-alpha").Satisfies(SemVersionRange.Parse("< 1.2.4")); // false
The only thing I can to make this work is use SatisfiesNpm
and pass in includeAllPrerelease: true
. IMO this shouldn't be necessary; regardless of the pre-release flag, 1.2.3 is definitely less than 1.2.4.
SemVersion.Parse("1.2.3-alpha").SatisfiesNpm("< 1.2.4", includeAllPrerelease: true); // true
Is this functioning as intended? I've read the description for this parameter a couple of times and I'm still struggling to get my head around exactly what it's intended to do:
includeAllPrerelease:
Whether to include all prerelease versions satisfying the bounds in the range
or to only include prerelease versions when it matches a bound that explicitly
includes prerelease versions.