deno.land / std@0.201.0 / semver / test_comparator.ts

test_comparator.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.import type { SemVer, SemVerComparator } from "./types.ts";import { cmp } from "./cmp.ts";
/** * Test to see if a semantic version falls within the range of the comparator. * @param version The version to compare * @param comparator The comparator * @returns True if the version is within the comparators set otherwise false */export function testComparator( version: SemVer, comparator: SemVerComparator,): boolean { return cmp(version, comparator.operator, comparator.semver);}
std

Version Info

Tagged at
a year ago