File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 16.1.3] (melonJS 2) - _ 2024-02-13_
4+
5+ ### Fixed
6+ - Loader: fix a regression with TMX map loading related to a semver version comparaison (` compare() ` requires a "x.y.z" version format)
7+
38## [ 16.1.2] (melonJS 2) - _ 2024-02-12_
49
510### Fixed
747752
748753-------------------------------------------------------------------------------
749754
750- [ 16.1.0 ] : https://github.com/melonjs/melonJS/compare/16.1.1...16.1.2
755+ [ 16.1.3 ] : https://github.com/melonjs/melonJS/compare/16.1.2...16.1.3
756+ [ 16.1.2 ] : https://github.com/melonjs/melonJS/compare/16.1.1...16.1.2
751757[ 16.1.1 ] : https://github.com/melonjs/melonJS/compare/16.2.0...16.1.1
752758[ 16.1.0 ] : https://github.com/melonjs/melonJS/compare/16.0.0...16.1.0
753759[ 16.0.0 ] : https://github.com/melonjs/melonJS/compare/15.15.0...16.0.0
Original file line number Diff line number Diff line change @@ -33,6 +33,17 @@ let GUID_index = 0;
3333 * }
3434 */
3535export function checkVersion ( v1 , v2 ) {
36+ // Convert to proper "x.y.z" format if necessary
37+ if ( / ^ \d + $ / . test ( v1 ) ) {
38+ v1 += ".0.0" ;
39+ } else if ( / ^ \d + \. \d + $ / . test ( v1 ) ) {
40+ v1 += ".0" ;
41+ }
42+ if ( / ^ \d + $ / . test ( v2 ) ) {
43+ v2 += ".0.0" ;
44+ } else if ( / ^ \d + \. \d + $ / . test ( v2 ) ) {
45+ v2 += ".0" ;
46+ }
3647 return compare ( v1 , v2 ) ;
3748}
3849
Original file line number Diff line number Diff line change @@ -165,9 +165,18 @@ describe("utils", function () {
165165 // < 0 if the second string is greater
166166 // === 0 if the strings are equal
167167 expect ( me . utils . checkVersion ( "15.13.0" , "15.12.0" ) > 0 ) . toEqual ( true ) ;
168+ expect ( me . utils . checkVersion ( "15.13" , "15.12.0" ) > 0 ) . toEqual ( true ) ;
169+ expect ( me . utils . checkVersion ( "16" , "15.12.0" ) > 0 ) . toEqual ( true ) ;
170+ expect ( me . utils . checkVersion ( "16" , "15" ) > 0 ) . toEqual ( true ) ;
168171 expect ( me . utils . checkVersion ( "7.0.0" , "15.5.0" ) < 0 ) . toEqual ( true ) ;
169172 expect ( me . utils . checkVersion ( "15.12.0" , "15.12.0" ) === 0 ) . toEqual ( true ) ;
173+ expect ( me . utils . checkVersion ( "15.12.0" , "15.12" ) === 0 ) . toEqual ( true ) ;
174+ expect ( me . utils . checkVersion ( "15.0.0" , "15.0" ) === 0 ) . toEqual ( true ) ;
175+ expect ( me . utils . checkVersion ( "15.0.0" , "15" ) === 0 ) . toEqual ( true ) ;
170176 expect ( me . utils . checkVersion ( "15.12.1" , "16.1.1" ) < 0 ) . toEqual ( true ) ;
177+ expect ( me . utils . checkVersion ( "15.12.1" , "16.1" ) < 0 ) . toEqual ( true ) ;
178+ expect ( me . utils . checkVersion ( "15.12.1" , "16" ) < 0 ) . toEqual ( true ) ;
179+ expect ( me . utils . checkVersion ( "15" , "16" ) < 0 ) . toEqual ( true ) ;
171180 } ) ;
172181 } ) ;
173182} ) ;
You can’t perform that action at this time.
0 commit comments