17 lines
373 B
JavaScript
17 lines
373 B
JavaScript
import Ember from 'ember';
|
|
|
|
export function reduceToArray(params) {
|
|
return params.reduce(function(result, param) {
|
|
if (Ember.isNone(param)) {
|
|
return result;
|
|
}
|
|
if (Ember.typeOf(param) === 'array') {
|
|
return result.concat(param);
|
|
} else {
|
|
return result.concat([param]);
|
|
}
|
|
}, []);
|
|
}
|
|
|
|
export default Ember.Helper.helper(reduceToArray);
|