1.1.5 • Published 3 years ago

@tropicalraisel/semver-regexp v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Description

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.

Usage

There are two functions, one default function that permits semantic version strings starting with ~, ^, or v, and another which strictly matches a semantic version.

ESM

import valid, { isValidSemanticVersion } from '@tropicalraisel/semver-regexp'

const version = 'v4.2.0'

console.log(valid(version))
console.log(isValidSemanticVersion(version))

CommonJS

const semver = require('@tropicalraisel/semver-regexp')

const version = 'v4.2.0'

console.log(semver.default(version))
console.log(semver.isValidSemanticVersion(version))