-
Notifications
You must be signed in to change notification settings - Fork 518
Closed
Labels
Enhancementnew feature or improvementnew feature or improvementsemver:majorbackwards-incompatible breaking changesbackwards-incompatible breaking changesspecrelated to the semver specrelated to the semver spec
Milestone
Description
According to SemVer 2.0.0, a version like v1.2.3
is not valid (https://semver.org/#is-v123-a-semantic-version).
The library incorrectly marks a version like this as valid:
const semverValid = require('semver/functions/valid')
semverValid('v1.2.3')
// true
semverValid('v1.2.3', {loose: false})
// true
I understand that the v-prefix is often used to indicate that some string represents a version. However, when I explicitly want to check if a string is valid according to the SemVer spec, I expect the method to return false in this case, especially when I set the loose
option to false
.
A fix (or an option to be extra strict for backwards compatibility) would be appreciated!
riderx and silverwind
Metadata
Metadata
Assignees
Labels
Enhancementnew feature or improvementnew feature or improvementsemver:majorbackwards-incompatible breaking changesbackwards-incompatible breaking changesspecrelated to the semver specrelated to the semver spec