Skip to main content
Go to Latest
class Checker
import { Checker } from "https://deno.land/x/embassyd_sdk@v0.3.3.0.5/emver-lite/mod.ts";

A checker is a function that takes a version and returns true if the version matches the checker. Used when we are doing range checking, like saying ">=1.0.0".check("1.2.3") will be true

Constructors

new
Checker(check: (value: string | EmVer) => boolean)

Methods

and(...others: (Checker | string)[]): Checker

Used when we want the and condition with another checker

A useful example is making sure we don't match an exact version, like !=1.2.3

or(...others: (Checker | string)[]): Checker

Used when we want the or condition with another checker

Static Methods

parse(range: string | Checker): Checker

Will take in a range, like >1.2 or <1.2.3.4 or =1.2 or 1.* and return a checker, that has the check function for checking that a version is in the valid