mirror of
https://github.com/semver/semver.git
synced 2026-07-11 03:53:53 -05:00
[GH-ISSUE #1055] "Uncaught TypeError: Invalid Version: 10.*" unexpected after valid function returns success #2381
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @IdoWald-TomTom on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/semver/semver/issues/1055
using "semver": "7.6.2" on Chrome.
The following code will throw an error:
`
import { lt, valid } from 'semver';
const version = "10.";
if (valid(version)){
return lt("1.0.0", version);
}
`
Will throw error:
"Uncaught TypeError: Invalid Version: 10."
Expected:
If the version pass the valid condition, then it should not throw an invalid error.
@IdoWald-TomTom commented on GitHub (Nov 7, 2024):
irrelevant