@fi4f/v 1.1.1 → 2.0.0
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/out/index.d.ts +15 -10
- package/out/index.js +16 -18
- package/package.json +1 -1
- package/src/index.ts +18 -18
package/out/index.d.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
export declare function Version(o?: {
|
|
2
|
-
moniker?: string;
|
|
3
|
-
major?: number;
|
|
4
|
-
minor?: number;
|
|
5
|
-
patch?: number;
|
|
6
|
-
}): Version;
|
|
7
1
|
export interface Version {
|
|
8
2
|
readonly moniker: string;
|
|
9
3
|
readonly major: number;
|
|
10
4
|
readonly minor: number;
|
|
11
5
|
readonly patch: number;
|
|
12
6
|
}
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export declare const Version: {
|
|
8
|
+
"new"(o?: {
|
|
9
|
+
moniker?: string;
|
|
10
|
+
major?: number;
|
|
11
|
+
minor?: number;
|
|
12
|
+
patch?: number;
|
|
13
|
+
}): {
|
|
14
|
+
moniker: string;
|
|
15
|
+
major: number;
|
|
16
|
+
minor: number;
|
|
17
|
+
patch: number;
|
|
18
|
+
};
|
|
19
|
+
toString(a: Version): string;
|
|
20
|
+
compare(a: Version, b: Version): number;
|
|
21
|
+
};
|
|
17
22
|
export default Version;
|
package/out/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Version =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
exports.Version = void 0;
|
|
4
|
+
exports.Version = {
|
|
5
|
+
new(o) {
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
return {
|
|
8
|
+
moniker: (_a = o === null || o === void 0 ? void 0 : o.moniker) !== null && _a !== void 0 ? _a : "v",
|
|
9
|
+
major: (_b = o === null || o === void 0 ? void 0 : o.major) !== null && _b !== void 0 ? _b : 0,
|
|
10
|
+
minor: (_c = o === null || o === void 0 ? void 0 : o.minor) !== null && _c !== void 0 ? _c : 0,
|
|
11
|
+
patch: (_d = o === null || o === void 0 ? void 0 : o.patch) !== null && _d !== void 0 ? _d : 0,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
toString(a) {
|
|
15
15
|
return `${a.moniker} ${a.major}.${a.minor}.${a.patch}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function compare(a, b) {
|
|
16
|
+
},
|
|
17
|
+
compare(a, b) {
|
|
19
18
|
let k;
|
|
20
19
|
if ((k = a.major - b.major) != 0)
|
|
21
20
|
return k;
|
|
@@ -25,6 +24,5 @@ function Version(o) {
|
|
|
25
24
|
return k;
|
|
26
25
|
return 0;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.default = Version;
|
|
27
|
+
};
|
|
28
|
+
exports.default = exports.Version;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
export function Version(o ?: {
|
|
2
|
-
moniker ?: string;
|
|
3
|
-
major ?: number;
|
|
4
|
-
minor ?: number;
|
|
5
|
-
patch ?: number;
|
|
6
|
-
}): Version {
|
|
7
|
-
return {
|
|
8
|
-
moniker : o?.moniker ?? "v",
|
|
9
|
-
major : o?.major ?? 0,
|
|
10
|
-
minor : o?.minor ?? 0,
|
|
11
|
-
patch : o?.patch ?? 0,
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
1
|
export interface Version {
|
|
16
2
|
readonly moniker: string;
|
|
17
3
|
readonly major : number;
|
|
@@ -19,12 +5,26 @@ export interface Version {
|
|
|
19
5
|
readonly patch : number;
|
|
20
6
|
}
|
|
21
7
|
|
|
22
|
-
export
|
|
23
|
-
|
|
8
|
+
export const Version = {
|
|
9
|
+
new(o ?: {
|
|
10
|
+
moniker ?: string;
|
|
11
|
+
major ?: number;
|
|
12
|
+
minor ?: number;
|
|
13
|
+
patch ?: number;
|
|
14
|
+
}) {
|
|
15
|
+
return {
|
|
16
|
+
moniker : o?.moniker ?? "v",
|
|
17
|
+
major : o?.major ?? 0,
|
|
18
|
+
minor : o?.minor ?? 0,
|
|
19
|
+
patch : o?.patch ?? 0,
|
|
20
|
+
} satisfies Version;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
toString(a: Version) {
|
|
24
24
|
return `${a.moniker} ${a.major}.${a.minor}.${a.patch}`;
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
compare(a: Version, b: Version) {
|
|
28
28
|
let k: number;
|
|
29
29
|
if((k = a.major - b.major) != 0) return k;
|
|
30
30
|
if((k = a.minor - b.minor) != 0) return k;
|