check if provided version satisfies the given range description.
version
range
version string or object to validate.
range of versions that are accepted.
true is returned if the provided version is within the provided range description, otherwise false is returned.
true
false
import { assertEquals } from "jsr:@std/assert"// aliasing our functions and constants for brevityconst fn = isSatisfying, eq = assertEqualseq(fn("1.2.3", "1.x || >=2.5.0 || 5.0.0 - 7.2.3"), true)eq(fn("0.2.3", "1.x || >=2.5.0 || 5.0.0 - 7.2.3"), false) Copy
import { assertEquals } from "jsr:@std/assert"// aliasing our functions and constants for brevityconst fn = isSatisfying, eq = assertEqualseq(fn("1.2.3", "1.x || >=2.5.0 || 5.0.0 - 7.2.3"), true)eq(fn("0.2.3", "1.x || >=2.5.0 || 5.0.0 - 7.2.3"), false)
check if provided
version
satisfies the givenrange
description.