Uh oh!
There was an error while loading. Please reload this page.
Add semver.minVersion function. - #241
Conversation
coreyfarrell
commented
Jan 6, 2019
I've rebased / resolved the conflicts. |
Uh oh!
There was an error while loading. Please reload this page.
isaacs
commented
Jan 18, 2019
I think there's an edge case missed here, which isn't likely to come up in practice, but is worth covering for correctness. If a version has a prerelease on it, and is a Consider the range I think this can be handled by having another Another interesting case is something like (If you had Also, it'd be good to have 100% coverage of new code, if possible, especially if it won't be exercised in npm itself. I haven't tested this directly. |
coreyfarrell
commented
Jan 18, 2019
Good catch. I've added this.
I've added this specific test case and with the components in reverse (less than first and greater than first).
The only added code which is not covered is the default case which is unreachable. For now I've added the hint for istanbul to ignore it, I could remove the default case if you prefer. |
isaacs
commented
Jan 19, 2019
If it's truly unreachable, then yeah, just go ahead and remove it, or make it an ignored throw so at least we'll find out some day if it turns out that assumption is incorrect. |
isaacs
commented
Jan 19, 2019
OIC, I'd missed that, yeah, it just appends a |
coreyfarrell
commented
Jan 19, 2019
I already added the hint for istanbul to ignore the throw, knowing if a new operator is added in the future seemed like the right way to handle this. That way if someone uses minVersion against a range with a new operator it'll throw instead of giving an incorrect result. |
isaacs
commented
Jan 19, 2019
Ah, yeah, a new operator in the future could result in that case being hit. Good call 👍 |
coreyfarrell
commented
Feb 14, 2019
I understand time is short for all but can I do anything to help this move forward? |
No description provided.