@bgord/tools 1.2.14 → 1.2.16
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.
|
@@ -7,7 +7,12 @@ export declare class PackageVersion {
|
|
|
7
7
|
static fromVersionString(candidate: string): PackageVersion;
|
|
8
8
|
static fromVersionStringSafe(candidate: PackageVersionSchemaType): PackageVersion;
|
|
9
9
|
static fromString(candidate: string): PackageVersion;
|
|
10
|
+
private compareTo;
|
|
11
|
+
equals(another: PackageVersion): boolean;
|
|
12
|
+
isGreaterThan(another: PackageVersion): boolean;
|
|
10
13
|
isGreaterThanOrEqual(another: PackageVersion): boolean;
|
|
14
|
+
isSmallerThan(another: PackageVersion): boolean;
|
|
15
|
+
isSmallerThanOrEqual(another: PackageVersion): boolean;
|
|
11
16
|
toString(): string;
|
|
12
17
|
toJSON(): {
|
|
13
18
|
major: number;
|
|
@@ -19,16 +19,35 @@ export class PackageVersion {
|
|
|
19
19
|
const version = PackageVersionSchema.parse(`v${candidate}`);
|
|
20
20
|
return new PackageVersion(version.major, version.minor, version.patch);
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
compareTo(another) {
|
|
23
23
|
if (this.major > another.major)
|
|
24
|
-
return
|
|
24
|
+
return 1;
|
|
25
25
|
if (this.major < another.major)
|
|
26
|
-
return
|
|
26
|
+
return -1;
|
|
27
27
|
if (this.minor > another.minor)
|
|
28
|
-
return
|
|
28
|
+
return 1;
|
|
29
29
|
if (this.minor < another.minor)
|
|
30
|
-
return
|
|
31
|
-
|
|
30
|
+
return -1;
|
|
31
|
+
if (this.patch > another.patch)
|
|
32
|
+
return 1;
|
|
33
|
+
if (this.patch < another.patch)
|
|
34
|
+
return -1;
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
equals(another) {
|
|
38
|
+
return this.compareTo(another) === 0;
|
|
39
|
+
}
|
|
40
|
+
isGreaterThan(another) {
|
|
41
|
+
return this.compareTo(another) === 1;
|
|
42
|
+
}
|
|
43
|
+
isGreaterThanOrEqual(another) {
|
|
44
|
+
return this.compareTo(another) !== -1;
|
|
45
|
+
}
|
|
46
|
+
isSmallerThan(another) {
|
|
47
|
+
return this.compareTo(another) === -1;
|
|
48
|
+
}
|
|
49
|
+
isSmallerThanOrEqual(another) {
|
|
50
|
+
return this.compareTo(another) !== 1;
|
|
32
51
|
}
|
|
33
52
|
toString() {
|
|
34
53
|
return `${this.major}.${this.minor}.${this.patch}`;
|
package/dist/weekday.vo.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare enum WeekdayFormatterEnum {
|
|
|
8
8
|
ZERO_BASED_NUMBER = "ZERO_BASED_NUMBER"
|
|
9
9
|
}
|
|
10
10
|
export declare const WeekdayValueError: {
|
|
11
|
-
|
|
11
|
+
Invalid: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const WeekdayFormatters: Record<WeekdayFormatterEnum, WeekdayFormatter>;
|
|
14
14
|
export declare class Weekday {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/tools",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bartosz Gordon",
|
|
@@ -21,27 +21,27 @@
|
|
|
21
21
|
"preinstall": "bunx only-allow bun"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@biomejs/biome": "2.3.
|
|
25
|
-
"@commitlint/cli": "20.
|
|
26
|
-
"@commitlint/config-conventional": "20.
|
|
24
|
+
"@biomejs/biome": "2.3.11",
|
|
25
|
+
"@commitlint/cli": "20.3.0",
|
|
26
|
+
"@commitlint/config-conventional": "20.3.0",
|
|
27
27
|
"@stryker-mutator/core": "9.4.0",
|
|
28
28
|
"@types/bun": "1.3.5",
|
|
29
29
|
"@types/mime-types": "3.0.1",
|
|
30
30
|
"cspell": "9.4.0",
|
|
31
|
-
"knip": "5.
|
|
31
|
+
"knip": "5.80.0",
|
|
32
32
|
"lefthook": "2.0.13",
|
|
33
33
|
"lockfile-lint": "4.14.1",
|
|
34
34
|
"only-allow": "1.2.2",
|
|
35
35
|
"shellcheck": "4.1.0",
|
|
36
36
|
"typescript": "5.9.3",
|
|
37
|
-
"zod": "4.3.
|
|
37
|
+
"zod": "4.3.5"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"date-fns": "4.1.0",
|
|
41
41
|
"mime-types": "3.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"zod": "4.3.
|
|
44
|
+
"zod": "4.3.5"
|
|
45
45
|
},
|
|
46
46
|
"sideEffects": false
|
|
47
47
|
}
|
|
@@ -23,14 +23,37 @@ export class PackageVersion {
|
|
|
23
23
|
return new PackageVersion(version.major, version.minor, version.patch);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
private compareTo(another: PackageVersion): -1 | 0 | 1 {
|
|
27
|
+
if (this.major > another.major) return 1;
|
|
28
|
+
if (this.major < another.major) return -1;
|
|
29
|
+
|
|
30
|
+
if (this.minor > another.minor) return 1;
|
|
31
|
+
if (this.minor < another.minor) return -1;
|
|
32
|
+
|
|
33
|
+
if (this.patch > another.patch) return 1;
|
|
34
|
+
if (this.patch < another.patch) return -1;
|
|
35
|
+
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
equals(another: PackageVersion): boolean {
|
|
40
|
+
return this.compareTo(another) === 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
isGreaterThan(another: PackageVersion): boolean {
|
|
44
|
+
return this.compareTo(another) === 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
26
47
|
isGreaterThanOrEqual(another: PackageVersion): boolean {
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
return this.compareTo(another) !== -1;
|
|
49
|
+
}
|
|
29
50
|
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
isSmallerThan(another: PackageVersion): boolean {
|
|
52
|
+
return this.compareTo(another) === -1;
|
|
53
|
+
}
|
|
32
54
|
|
|
33
|
-
|
|
55
|
+
isSmallerThanOrEqual(another: PackageVersion): boolean {
|
|
56
|
+
return this.compareTo(another) !== 1;
|
|
34
57
|
}
|
|
35
58
|
|
|
36
59
|
toString(): string {
|
package/src/weekday.vo.ts
CHANGED
|
@@ -10,7 +10,7 @@ export enum WeekdayFormatterEnum {
|
|
|
10
10
|
ZERO_BASED_NUMBER = "ZERO_BASED_NUMBER", // Sunday=0 ... Saturday=6 (JS)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const WeekdayValueError = { Invalid: "weekday.invalid" }
|
|
13
|
+
export const WeekdayValueError = { Invalid: "weekday.invalid" };
|
|
14
14
|
|
|
15
15
|
const FULL_NAMES: readonly string[] = [
|
|
16
16
|
"Sunday",
|