node-semvers 1.5.6 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/NodeVersions.d.cts +10 -0
- package/dist/cjs/cli.d.cts +2 -0
- package/dist/cjs/constants.d.cts +3 -0
- package/dist/cjs/index.d.cts +2 -0
- package/dist/cjs/lib/isNaN.d.cts +1 -0
- package/dist/cjs/lib/keyFunctions.d.cts +3 -0
- package/dist/cjs/lib/lineFunctions.d.cts +3 -0
- package/dist/cjs/lib/match.d.cts +1 -0
- package/dist/cjs/lib/normalizeSchedule.d.cts +2 -0
- package/dist/cjs/lib/normalizeVersion.d.cts +2 -0
- package/dist/cjs/parseExpression/index.d.cts +2 -0
- package/dist/cjs/parseExpression/isLTSFn.d.cts +3 -0
- package/dist/cjs/parseExpression/isLatestFn.d.cts +3 -0
- package/dist/cjs/parseExpression/schedulesLatest.d.cts +3 -0
- package/dist/cjs/types.d.cts +69 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LoadError, LoadOptions, ResolveOptions, Schedule, ScheduleRaw, Version, VersionRaw } from './types.js';
|
|
2
|
+
export type LoadCallback = (error?: LoadError, semvers?: NodeVersions) => void;
|
|
3
|
+
export default class NodeVersions {
|
|
4
|
+
versions: Version[];
|
|
5
|
+
schedules: Schedule[];
|
|
6
|
+
constructor(versions: VersionRaw[], schedule: ScheduleRaw[]);
|
|
7
|
+
static load(options?: LoadOptions | LoadCallback, callback?: LoadCallback): undefined | Promise<NodeVersions>;
|
|
8
|
+
static loadSync(options?: LoadOptions): NodeVersions | null;
|
|
9
|
+
resolve(expression: string | number | Date, options?: ResolveOptions): string | string[] | Version | Version[] | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isNaN(value: unknown): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function match(test: object, query: object): boolean;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface LoadOptions {
|
|
2
|
+
cachePath?: string;
|
|
3
|
+
now?: Date;
|
|
4
|
+
}
|
|
5
|
+
export interface LoadError extends Error {
|
|
6
|
+
code?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolveOptions {
|
|
9
|
+
now?: Date;
|
|
10
|
+
range?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ScheduleRaw {
|
|
14
|
+
version: string;
|
|
15
|
+
name: string;
|
|
16
|
+
semver: string;
|
|
17
|
+
date: string;
|
|
18
|
+
start: string;
|
|
19
|
+
end: string;
|
|
20
|
+
codename?: string;
|
|
21
|
+
lts: string;
|
|
22
|
+
maintenance?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface Schedule {
|
|
25
|
+
name: string;
|
|
26
|
+
semver: string;
|
|
27
|
+
raw: ScheduleRaw;
|
|
28
|
+
start: Date;
|
|
29
|
+
end: Date;
|
|
30
|
+
codename?: string;
|
|
31
|
+
lts?: Date;
|
|
32
|
+
maintenance?: Date;
|
|
33
|
+
}
|
|
34
|
+
export interface VersionRaw {
|
|
35
|
+
version: string;
|
|
36
|
+
name: string;
|
|
37
|
+
semver: string;
|
|
38
|
+
major: number;
|
|
39
|
+
minor: number;
|
|
40
|
+
patch: number;
|
|
41
|
+
lts: string;
|
|
42
|
+
date: Date;
|
|
43
|
+
raw: ScheduleRaw;
|
|
44
|
+
codename: string;
|
|
45
|
+
}
|
|
46
|
+
export interface Version {
|
|
47
|
+
version: string;
|
|
48
|
+
name: string;
|
|
49
|
+
semver: string;
|
|
50
|
+
major: number;
|
|
51
|
+
minor: number;
|
|
52
|
+
patch: number;
|
|
53
|
+
lts: string;
|
|
54
|
+
date: Date;
|
|
55
|
+
raw: VersionRaw;
|
|
56
|
+
codename: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ParsedVersion {
|
|
59
|
+
major: number;
|
|
60
|
+
minor?: number;
|
|
61
|
+
patch?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ParsedCodename {
|
|
64
|
+
codename: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ParsedName {
|
|
67
|
+
name: string;
|
|
68
|
+
}
|
|
69
|
+
export type ParsedExpression = ParsedVersion | ParsedCodename | ParsedName;
|