node-semvers 1.3.34 → 1.3.35

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.
Files changed (33) hide show
  1. package/dist/esm/NodeVersions.d.mts +10 -0
  2. package/dist/esm/cli.d.mts +2 -0
  3. package/dist/esm/constants.d.mts +1 -0
  4. package/dist/esm/index.d.mts +2 -0
  5. package/dist/esm/lib/isNaN.d.mts +1 -0
  6. package/dist/esm/lib/keyFunctions.d.mts +2 -0
  7. package/dist/esm/lib/lineFunctions.d.mts +2 -0
  8. package/dist/esm/lib/match.d.mts +1 -0
  9. package/dist/esm/lib/normalizeSchedule.d.mts +2 -0
  10. package/dist/esm/lib/normalizeVersion.d.mts +2 -0
  11. package/dist/esm/parseExpression/index.d.mts +31 -0
  12. package/dist/esm/parseExpression/isLTSFn.d.mts +1 -0
  13. package/dist/esm/parseExpression/isLatestFn.d.mts +1 -0
  14. package/dist/esm/parseExpression/schedulesForEach.d.mts +1 -0
  15. package/dist/esm/parseExpression/schedulesLatest.d.mts +1 -0
  16. package/dist/esm/types.d.mts +57 -0
  17. package/package.json +7 -6
  18. /package/dist/{types/NodeVersions.d.ts → cjs/NodeVersions.d.cts} +0 -0
  19. /package/dist/{types/cli.d.ts → cjs/cli.d.cts} +0 -0
  20. /package/dist/{types/constants.d.ts → cjs/constants.d.cts} +0 -0
  21. /package/dist/{types/index.d.ts → cjs/index.d.cts} +0 -0
  22. /package/dist/{types/lib/isNaN.d.ts → cjs/lib/isNaN.d.cts} +0 -0
  23. /package/dist/{types/lib/keyFunctions.d.ts → cjs/lib/keyFunctions.d.cts} +0 -0
  24. /package/dist/{types/lib/lineFunctions.d.ts → cjs/lib/lineFunctions.d.cts} +0 -0
  25. /package/dist/{types/lib/match.d.ts → cjs/lib/match.d.cts} +0 -0
  26. /package/dist/{types/lib/normalizeSchedule.d.ts → cjs/lib/normalizeSchedule.d.cts} +0 -0
  27. /package/dist/{types/lib/normalizeVersion.d.ts → cjs/lib/normalizeVersion.d.cts} +0 -0
  28. /package/dist/{types/parseExpression/index.d.ts → cjs/parseExpression/index.d.cts} +0 -0
  29. /package/dist/{types/parseExpression/isLTSFn.d.ts → cjs/parseExpression/isLTSFn.d.cts} +0 -0
  30. /package/dist/{types/parseExpression/isLatestFn.d.ts → cjs/parseExpression/isLatestFn.d.cts} +0 -0
  31. /package/dist/{types/parseExpression/schedulesForEach.d.ts → cjs/parseExpression/schedulesForEach.d.cts} +0 -0
  32. /package/dist/{types/parseExpression/schedulesLatest.d.ts → cjs/parseExpression/schedulesLatest.d.cts} +0 -0
  33. /package/dist/{types/types.d.ts → cjs/types.d.cts} +0 -0
@@ -0,0 +1,10 @@
1
+ import type { LoadError, LoadOptions, ResolveOptions, Schedule, ScheduleRaw, Version, VersionRaw } from './types';
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,2 @@
1
+ declare const _default: (argv: any) => any;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from '../../assets/constants.cjs';
@@ -0,0 +1,2 @@
1
+ export type * from './types';
2
+ export { default, type LoadCallback } from './NodeVersions';
@@ -0,0 +1 @@
1
+ export default function isNaN(value: any): boolean;
@@ -0,0 +1,2 @@
1
+ export declare const major: (version: any) => any;
2
+ export declare const minor: (version: any) => string;
@@ -0,0 +1,2 @@
1
+ export declare const even: (version: any) => boolean;
2
+ export declare const odd: (version: any) => boolean;
@@ -0,0 +1 @@
1
+ export default function match(test: any, query: any): boolean;
@@ -0,0 +1,2 @@
1
+ import type { Schedule, ScheduleRaw } from '../types';
2
+ export default function normalizeSchedule(name: string, raw: ScheduleRaw): Schedule;
@@ -0,0 +1,2 @@
1
+ import type { Schedule, Version, VersionRaw } from '../types';
2
+ export default function normalizeVersion(raw: VersionRaw, schedules: Schedule[]): Version;
@@ -0,0 +1,31 @@
1
+ export default function parseExpression(expression: any, now: any): {
2
+ major: number;
3
+ minor?: undefined;
4
+ patch?: undefined;
5
+ name?: undefined;
6
+ codename?: undefined;
7
+ } | {
8
+ major: number;
9
+ minor: number;
10
+ patch?: undefined;
11
+ name?: undefined;
12
+ codename?: undefined;
13
+ } | {
14
+ major: number;
15
+ minor: number;
16
+ patch: number;
17
+ name?: undefined;
18
+ codename?: undefined;
19
+ } | {
20
+ name: any;
21
+ major?: undefined;
22
+ minor?: undefined;
23
+ patch?: undefined;
24
+ codename?: undefined;
25
+ } | {
26
+ codename: any;
27
+ major?: undefined;
28
+ minor?: undefined;
29
+ patch?: undefined;
30
+ name?: undefined;
31
+ };
@@ -0,0 +1 @@
1
+ export default function isLTSFn(now: any): (item: any) => boolean;
@@ -0,0 +1 @@
1
+ export default function isLatestFn(now: any): (item: any) => boolean;
@@ -0,0 +1 @@
1
+ export default function schedulesForEach(schedules: any, filter: any, fn: any): void;
@@ -0,0 +1 @@
1
+ export default function schedulesLatest(schedules: any, filter: any): any;
@@ -0,0 +1,57 @@
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-semvers",
3
- "version": "1.3.34",
3
+ "version": "1.3.35",
4
4
  "description": "Utilities for managing versions of node including looking up codenames",
5
5
  "keywords": [
6
6
  "node",
@@ -19,13 +19,14 @@
19
19
  "author": "Kevin Malakoff <kmalakoff@gmail.com> (https://github.com/kmalakoff)",
20
20
  "type": "module",
21
21
  "exports": {
22
- "import": "./dist/esm/index.mjs",
23
- "require": "./dist/cjs/index.cjs",
24
- "types": "./dist/types/index.d.ts"
22
+ ".": {
23
+ "import": "./dist/esm/index.mjs",
24
+ "require": "./dist/cjs/index.cjs"
25
+ },
26
+ "./package.json": "./package.json"
25
27
  },
26
28
  "main": "dist/cjs/index.cjs",
27
- "module": "dist/esm/index.mjs",
28
- "types": "dist/types/index.d.ts",
29
+ "types": "dist/cjs/index.d.cts",
29
30
  "bin": {
30
31
  "nsv": "./bin/cli.cjs"
31
32
  },
File without changes
File without changes
File without changes