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

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

The next-gen web framework.
Extremely Popular
Go to Latest
function semver.isSemVer
Re-export
import { semver } from "https://deno.land/x/fresh@1.4.0/src/dev/deps.ts";
const { isSemVer } = semver;

Checks to see if value is a valid SemVer object. It does a check into each field including prerelease and build.

Some invalid SemVer sentinels can still return true such as ANY and INVALID. An object which has the same value as a sentinel but isn't reference equal will still fail.

Objects which are valid SemVer objects but have extra fields are still considered SemVer objects and this will return true.

A type assertion is added to the value.

Parameters

value: unknown

The value to check to see if its a valid SemVer object

Returns

value is SemVer

True if value is a valid SemVer otherwise false