|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
361 bytes
|
| Line | |
|---|
| 1 | define(['./_group', './_has'], function (_group, _has) {
|
|---|
| 2 |
|
|---|
| 3 | // Groups the object's values by a criterion. Pass either a string attribute
|
|---|
| 4 | // to group by, or a function that returns the criterion.
|
|---|
| 5 | var groupBy = _group(function(result, value, key) {
|
|---|
| 6 | if (_has(result, key)) result[key].push(value); else result[key] = [value];
|
|---|
| 7 | });
|
|---|
| 8 |
|
|---|
| 9 | return groupBy;
|
|---|
| 10 |
|
|---|
| 11 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.