@@ -42,7 +42,7 @@ export class UnityVersion {
4242 }
4343
4444 static compare ( a : UnityVersion , b : UnityVersion ) : number {
45- const baseComparison = compare ( a . semVer , b . semVer , true ) ;
45+ const baseComparison = UnityVersion . baseCompare ( a , b ) ;
4646
4747 if ( baseComparison !== 0 ) {
4848 return baseComparison ;
@@ -51,6 +51,10 @@ export class UnityVersion {
5151 return UnityVersion . compareBuildMetadata ( a . semVer , b . semVer ) ;
5252 }
5353
54+ static baseCompare ( a : UnityVersion , b : UnityVersion ) : number {
55+ return compare ( a . semVer , b . semVer , true ) ;
56+ }
57+
5458 toString ( ) : string {
5559 return this . changeset ? `${ this . version } (${ this . changeset } )` : this . version ;
5660 }
@@ -109,22 +113,22 @@ export class UnityVersion {
109113
110114 isGreaterThan ( other : string | UnityVersion ) : boolean {
111115 const otherVersion = other instanceof UnityVersion ? other : new UnityVersion ( other ) ;
112- return UnityVersion . compare ( this , otherVersion ) > 0 ;
116+ return UnityVersion . baseCompare ( this , otherVersion ) > 0 ;
113117 }
114118
115119 isGreaterThanOrEqualTo ( other : string | UnityVersion ) : boolean {
116120 const otherVersion = other instanceof UnityVersion ? other : new UnityVersion ( other ) ;
117- return UnityVersion . compare ( this , otherVersion ) >= 0 ;
121+ return UnityVersion . baseCompare ( this , otherVersion ) >= 0 ;
118122 }
119123
120124 isLessThan ( other : string | UnityVersion ) : boolean {
121125 const otherVersion = other instanceof UnityVersion ? other : new UnityVersion ( other ) ;
122- return UnityVersion . compare ( this , otherVersion ) < 0 ;
126+ return UnityVersion . baseCompare ( this , otherVersion ) < 0 ;
123127 }
124128
125129 isLessThanOrEqualTo ( other : string | UnityVersion ) : boolean {
126130 const otherVersion = other instanceof UnityVersion ? other : new UnityVersion ( other ) ;
127- return UnityVersion . compare ( this , otherVersion ) <= 0 ;
131+ return UnityVersion . baseCompare ( this , otherVersion ) <= 0 ;
128132 }
129133
130134 equals ( other : UnityVersion ) : boolean {
0 commit comments