This package aims to fix issues with semver and semver-regex. Primarily, neither pass all tests provided on the semver website. Another small issue is that they allow invalid semantic version strings.
There are two functions, one default function that permits semantic version strings starting with ~
, ^
, or v
, and another which strictly matches a semantic version.
import valid, { isValidSemanticVersion } from '@tropicalraisel/semver-regexp'
const version = 'v4.2.0'
console.log(valid(version))
console.log(isValidSemanticVersion(version))
const semver = require('@tropicalraisel/semver-regexp')
const version = 'v4.2.0'
console.log(semver.default(version))
console.log(semver.isValidSemanticVersion(version))