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

x/fresh/src/dev/deps.ts>semver.valid

The next-gen web framework.
Extremely Popular
Go to Latest
function semver.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 { semver } from "https://deno.land/x/fresh@1.5.4/src/dev/deps.ts";
const { valid } = semver;

Parameters

value: string | SemVer | null

A string which may or may not contain a valid SemVer

Returns

string | null

A valid SemVer or undefined