mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
use shortcut for array wrapping
This commit is contained in:
parent
9326729174
commit
884ebbd9e7
1 changed files with 4 additions and 9 deletions
|
@ -11,15 +11,10 @@ define(function (require) {
|
|||
return function (sortObject, indexPattern) {
|
||||
var normalizedSort = [];
|
||||
|
||||
if (_.isArray(sortObject)) {
|
||||
normalizedSort = _.map(sortObject, function (sortable) {
|
||||
return normalize(sortable, indexPattern);
|
||||
});
|
||||
} else {
|
||||
normalizedSort.push(normalize(sortObject, indexPattern));
|
||||
}
|
||||
|
||||
return normalizedSort;
|
||||
// [].concat({}) -> [{}], [].concat([{}]) -> [{}]
|
||||
return [].concat(sortObject).map(function (sortable) {
|
||||
return normalize(sortable, indexPattern);
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue