(other: Version)
| 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") { |
no test coverage detected