Rapport-Laravel/node_modules/collect.js/src/methods/countBy.js

8 lines
168 B
JavaScript

'use strict';
module.exports = function countBy(fn = value => value) {
return new this.constructor(this.items)
.groupBy(fn)
.map(value => value.count());
};