MCPcopy Index your code
hub / github.com/VSpaceCode/VSpaceCode / compare

Method compare

src/version.ts:23–46  ·  view source on GitHub ↗
(other: Version)

Source from the content-addressed store, hash-verified

21 }
22
23 compare(other: Version) {
24 if (this._major > other._major) {
25 return ComparisonResult.Newer;
26 }
27 if (this._major < other._major) {
28 return ComparisonResult.Older;
29 }
30
31 if (this._minor > other._minor) {
32 return ComparisonResult.Newer;
33 }
34 if (this._minor < other._minor) {
35 return ComparisonResult.Older;
36 }
37
38 if (this._patch > other._patch) {
39 return ComparisonResult.Newer;
40 }
41 if (this._patch < other._patch) {
42 return ComparisonResult.Older;
43 }
44
45 return ComparisonResult.Same;
46 }
47
48 static compare(v1: Version | string, v2: Version | string) {
49 if (typeof v1 === "string") {

Callers 1

showUpdateMessageFunction · 0.80

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected