Package Exports
- grouper
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (grouper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Grouper.js

Group objects by their properties.
Usage
var arr = [
{ name: 'foo', age: 2, score: 0 },
{ name: 'bar', age: 2, score: 0 },
{ name: 'baz', age: 3, score: 0 },
{ name: 'qux', age: 2, score: 1 }
];
grouper(arr, 'age'); // group by a single property
/* =>
* [ [ { name: 'foo', age: 2, score: 0 },
* { name: 'bar', age: 2, score: 0 },
* { name: 'qux', age: 2, score: 1 } ],
* [ { name: 'baz', age: 3, score: 0 } ] ]
*/
grouper(arr, ['age', 'score']); // group by multiple properties
/* =>
* [ [ { name: 'foo', age: 2, score: 0 },
* { name: 'bar', age: 2, score: 0 } ],
* [ { name: 'baz', age: 3, score: 0 } ],
* [ { name: 'qux', age: 2, score: 1 } ] ]
*/API
grouper(arr, props)
Groups objects in arr by props. Objects to be grouped together must have the same value (strict ===) for every property in props.
arris anarrayof objects.propsis astring, or anarrayof property names.
Installation
Install via npm:
$ npm i --save grouper