Small improvements of version selection

This commit is contained in:
nobody 2020-07-26 12:08:37 +02:00
parent 351e4f9368
commit b24a403853
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
1 changed files with 16 additions and 16 deletions

View File

@ -277,17 +277,19 @@ helpers.setLastVersion = function (type, version) {
*/ */
if(version !== null && version !== undefined) { if(version !== null && version !== undefined) {
let requestVersion = version.toString(); version = version.toString();
} else {
return 'latest';
} }
if (type.includes('/algoliasearch/3.')) { if (type.includes('/algoliasearch/3.')) {
return '3.35.1'; return '3.35.1';
} else if (type.includes('/angularjs/1.')) { } else if (type.includes('/angularjs/1.')) {
if (helpers.compareVersion('1.2.19', requestVersion)) return '1.2.19'; // <= v1.2.19 if (helpers.compareVersion('1.2.19', version)) return '1.2.19'; // <= v1.2.19
else if (helpers.compareVersion('1.2.32', requestVersion)) return '1.2.32'; // > 1.2.19 to <= v1.2.32 else if (helpers.compareVersion('1.2.32', version)) return '1.2.32'; // > 1.2.19 to <= v1.2.32
else if (helpers.compareVersion('1.3.13', requestVersion)) return '1.3.13'; // > 1.2.32 to <= 1.3.13 else if (helpers.compareVersion('1.3.13', version)) return '1.3.13'; // > 1.2.32 to <= 1.3.13
else if (helpers.compareVersion('1.4.14', requestVersion)) return '1.4.14'; // > 1.3.13 to <= 1.4.14 else if (helpers.compareVersion('1.4.14', version)) return '1.4.14'; // > 1.3.13 to <= 1.4.14
else if (helpers.compareVersion('1.5.11', requestVersion)) return '1.5.11'; // > 1.4.14 to <= 1.5.11 else if (helpers.compareVersion('1.5.11', version)) return '1.5.11'; // > 1.4.14 to <= 1.5.11
else if (helpers.compareVersion('1.6.10', requestVersion)) return '1.6.10'; // > 1.5.11 to <= 1.6.10 else if (helpers.compareVersion('1.6.10', version)) return '1.6.10'; // > 1.5.11 to <= 1.6.10
else return '1.7.9'; // >= 1.6.11 else return '1.7.9'; // >= 1.6.11
} else if (type.includes('/angularjs-slider/6.')) { } else if (type.includes('/angularjs-slider/6.')) {
return '6.7.0'; return '6.7.0';
@ -302,11 +304,11 @@ helpers.setLastVersion = function (type, version) {
} else if (type.includes('/angular-stripe-checkout@5.')) { } else if (type.includes('/angular-stripe-checkout@5.')) {
return '5.1.0'; return '5.1.0';
} else if (type.includes('/angular-ui-bootstrap/')) { } else if (type.includes('/angular-ui-bootstrap/')) {
if (helpers.compareVersion('0.10.0', requestVersion)) return '0.10.0'; // <= v0.10.0 if (helpers.compareVersion('0.10.0', version)) return '0.10.0'; // <= v0.10.0
else if (helpers.compareVersion('0.14.3', requestVersion)) return '0.14.3'; // > 0.10.0 <= v0.14.3 else if (helpers.compareVersion('0.14.3', version)) return '0.14.3'; // > 0.10.0 <= v0.14.3
return '1.3.3'; // > v0.14.0 return '1.3.3'; // > v0.14.0
} else if (type.includes('/angular-ui-router/')) { } else if (type.includes('/angular-ui-router/')) {
if (helpers.compareVersion('0.4.3', requestVersion)) return '0.4.3'; // <= 0.4.3 if (helpers.compareVersion('0.4.3', version)) return '0.4.3'; // <= 0.4.3
else return '1.0.25'; // > 0.4.3 else return '1.0.25'; // > 0.4.3
} else if (type.includes('/angular-ui-utils/0.')) { } else if (type.includes('/angular-ui-utils/0.')) {
return '0.1.1'; return '0.1.1';
@ -385,8 +387,8 @@ helpers.setLastVersion = function (type, version) {
} else if (type.includes('/jets/0.')) { } else if (type.includes('/jets/0.')) {
return '0.14.1'; return '0.14.1';
} else if (type.includes('/jquery/1.')) { } else if (type.includes('/jquery/1.')) {
if (helpers.compareVersion('1.7.1', requestVersion)) return '1.7.1'; // <= v1.7.1 if (helpers.compareVersion('1.7.1', version)) return '1.7.1'; // <= v1.7.1
else if (helpers.compareVersion('1.8.3', requestVersion)) return '1.8.3'; // > 1.7.1 to <= 1.8.3 else if (helpers.compareVersion('1.8.3', version)) return '1.8.3'; // > 1.7.1 to <= 1.8.3
else return '1.12.4'; // >= 1.8.4 else return '1.12.4'; // >= 1.8.4
} else if (type.includes('/jquery/1.8.')) { } else if (type.includes('/jquery/1.8.')) {
return '1.8.3'; return '1.8.3';
@ -397,7 +399,7 @@ helpers.setLastVersion = function (type, version) {
} else if (type.includes('/jquery.devbridge-autocomplete/1.')) { } else if (type.includes('/jquery.devbridge-autocomplete/1.')) {
return '1.4.10'; return '1.4.10';
} else if (type.includes('/jqueryui/1.')) { } else if (type.includes('/jqueryui/1.')) {
if (helpers.compareVersion('1.8.18', requestVersion)) return '1.8.18'; // <= v1.8.18 if (helpers.compareVersion('1.8.18', version)) return '1.8.18'; // <= v1.8.18
else return '1.12.1'; // >= 1.8.19 else return '1.12.1'; // >= 1.8.19
} else if (type.includes('/jquery.blockUI/2.')) { } else if (type.includes('/jquery.blockUI/2.')) {
return '2.70'; return '2.70';
@ -442,7 +444,7 @@ helpers.setLastVersion = function (type, version) {
} else if (type.includes('/moment.js/2.')) { } else if (type.includes('/moment.js/2.')) {
return '2.24.0'; return '2.24.0';
} else if (type.includes('/mootools/1.')) { } else if (type.includes('/mootools/1.')) {
if (helpers.compareVersion('1.4.5', requestVersion)) return '1.4.5'; // <= v1.4.5 if (helpers.compareVersion('1.4.5', version)) return '1.4.5'; // <= v1.4.5
else return '1.6.0'; // > 1.4.5 else return '1.6.0'; // > 1.4.5
} else if (type.includes('/oclazyload/1.')) { } else if (type.includes('/oclazyload/1.')) {
return '1.1.0'; return '1.1.0';
@ -514,8 +516,6 @@ helpers.setLastVersion = function (type, version) {
return '6.4.8'; return '6.4.8';
} else if (type.includes('/wow/1.')) { } else if (type.includes('/wow/1.')) {
return '1.1.2'; return '1.1.2';
} else if (version === null) {
return 'latest';
} }
}; };