The prerelease that misses the range
A prerelease option works for one range spelling but excludes the lower boundary of its equivalent.
What’s going wrong
Input is an array of at most 100 {range, includePrerelease, versions} rows. range is ~M, ~M.m or ~M.m.p, with numeric components 0..99 and no leading zeros. versions contains at most 100 valid SemVer strings with three numeric core components 0..100, optional valid prerelease identifiers and optional build metadata. Open tildes (~M or ~M.m) accept prereleases at their minimum core only when includePrerelease is true; a fully specified ~M.m.p never accepts prereleases of its exact minimum core. Other prereleases within the core interval require includePrerelease. The next major (for ~M) or minor (otherwise), including ALL its prereleases, is excluded. Build metadata never affects acceptance. Return an array of boolean arrays. Explicit prerelease ranges, wildcard spellings and other operators are out of scope.
Expected behavior
Preserve an open range’s prerelease lower boundary.
Reproduction
[{"range":"~1.2","includePrerelease":true,"versions":["1.2.0-rc.1"]}][[true]]
[{"range":"~1.2","includePrerelease":false,"versions":["1.2.0","1.2.8","1.3.0"]}][[true,true,false]]
[{"range":"~1.2.3","includePrerelease":true,"versions":["1.2.3-rc.1","1.2.3","1.2.4-rc.1"]}][[false,true,true]]
Before you begin
- TypeScript arrays and predicates
- Semantic version components and prereleases
Need a nudge?
Reveal one investigation hint at a time. Try each clue before opening the next.
Read the report, then sign in to start your investigation.