mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
sort expects a 1, 0, or -1 to be returned, not a boolean
This commit is contained in:
parent
aac88eaa83
commit
808703c0cd
2 changed files with 3 additions and 4 deletions
|
@ -8,18 +8,18 @@ define(function (require) {
|
|||
|
||||
// Get the max version in this cluster
|
||||
var max = function (versions) {
|
||||
return _.last(sortVersions(versions));
|
||||
return sortVersions(versions).pop();
|
||||
};
|
||||
|
||||
// Return the lowest version in the cluster
|
||||
var min = function (versions) {
|
||||
return _.first(sortVersions(versions));
|
||||
return sortVersions(versions).shift();
|
||||
};
|
||||
|
||||
// Sort versions from lowest to highest
|
||||
var sortVersions = function (versions) {
|
||||
return _.uniq(versions).sort(function (a, b) {
|
||||
return !compare(a, b);
|
||||
return compare(a, b) ? -1 : 1;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ define(function (require) {
|
|||
];
|
||||
|
||||
describe('version math (0.90.0 - 2.3.1)', function () {
|
||||
|
||||
var methods = 'max,min,eq,is,lt,lte,gt,gte'.split(',');
|
||||
describe('methods', function () {
|
||||
it('should have ' + methods.join(', ') + ' methods', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue