Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/semver/mod.ts>valid

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function valid
Deprecated
Deprecated

(will be removed after 0.200.0) Use parse() or tryParse() instead

A compatibility function which checks that a string is a valid semver

import { valid } from "https://deno.land/std@0.199.0/semver/mod.ts";

Parameters

value: string | SemVer | null

A string which may or may not contain a valid SemVer

Returns

string | null

A valid SemVer or undefined