deno.land / std@0.224.0 / semver / constants.ts

constants.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.import type { Comparator, SemVer } from "./types.ts";
/** * MAX is a sentinel value used by some range calculations. * It is equivalent to `∞.∞.∞`. */export const MAX: SemVer = { major: Number.POSITIVE_INFINITY, minor: Number.POSITIVE_INFINITY, patch: Number.POSITIVE_INFINITY, prerelease: [], build: [],};
/** * The minimum valid SemVer object. Equivalent to `0.0.0`. */export const MIN: SemVer = { major: 0, minor: 0, patch: 0, prerelease: [], build: [],};
/** * A sentinel value used to denote an invalid SemVer object * which may be the result of impossible ranges or comparator operations. * @example * ```ts * import { equals } from "https://deno.land/std@$STD_VERSION/semver/equals.ts"; * import { parse } from "https://deno.land/std@$STD_VERSION/semver/parse.ts"; * import { INVALID } from "https://deno.land/std@$STD_VERSION/semver/constants.ts" * equals(parse("1.2.3"), INVALID); * ``` */export const INVALID: SemVer = { major: Number.NEGATIVE_INFINITY, minor: Number.POSITIVE_INFINITY, patch: Number.POSITIVE_INFINITY, prerelease: [], build: [],};
/** * ANY is a sentinel value used by some range calculations. It is not a valid * SemVer object and should not be used directly. * @example * ```ts * import { equals } from "https://deno.land/std@$STD_VERSION/semver/equals.ts"; * import { parse } from "https://deno.land/std@$STD_VERSION/semver/parse.ts"; * import { ANY } from "https://deno.land/std@$STD_VERSION/semver/constants.ts" * equals(parse("1.2.3"), ANY); // false * ``` */export const ANY: SemVer = { major: Number.NaN, minor: Number.NaN, patch: Number.NaN, prerelease: [], build: [],};
/** * A comparator which will span all valid semantic versions */export const ALL: Comparator = { operator: undefined, ...ANY,};
/** * A comparator which will not span any semantic versions */export const NONE: Comparator = { operator: "<", ...MIN,};
std

Version Info

Tagged at
6 months ago