A problem with semver
is that its different functions return different outputs:
const semver = require("semver")
semver.valid("1.0.0")
//=> "1.0.0"
semver.valid(" 1.0.0 ")
//=> null
semver.valid(" v1.0.0 ")
//=> null
semver.clean("1.0.0")
//=> "1.0.0"
semver.clean(" 1.0.0 ")
//=> "1.0.0"
semver.clean(" v1.0.0 ")
//=> null
semver.valid(semver.coerce("1.0.0"))
//=> "1.0.0"
semver.valid(semver.coerce(" 1.0.0 "))
//=> "1.0.0"
…
Top comments (0)