add consolidateBy() function

This commit is contained in:
Alexander Zobnin
2017-07-22 20:47:24 +03:00
parent 0369fb83a5
commit 327aee7ef4
8 changed files with 79 additions and 8 deletions

View File

@@ -29,7 +29,8 @@ var categories = {
Filter: [],
Trends: [],
Time: [],
Alias: []
Alias: [],
Special: []
};
function addFuncDef(funcDef) {
@@ -188,6 +189,14 @@ addFuncDef({
defaultParams: ['/(.*)/', '$1']
});
// Special
addFuncDef({
name: 'consolidateBy',
category: 'Special',
params: [{ name: 'type', type: 'string', options: ['avg', 'min', 'max', 'sum', 'count'] }],
defaultParams: ['avg']
});
_lodash2.default.each(categories, function (funcList, catName) {
categories[catName] = _lodash2.default.sortBy(funcList, 'name');
});