mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Remove baseIteratee and castFunction.
This commit is contained in:
@@ -18,16 +18,12 @@ const hasOwnProperty = objectProto.hasOwnProperty;
|
||||
* @since 0.5.0
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
|
||||
* @param {Function} iteratee The iteratee to transform keys.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
*
|
||||
* _.countBy([6.1, 4.2, 6.3], Math.floor);
|
||||
* // => { '4': 1, '6': 2 }
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.countBy(['one', 'two', 'three'], 'length');
|
||||
* // => { '3': 2, '5': 1 }
|
||||
*/
|
||||
const countBy = createAggregator((result, value, key) => {
|
||||
if (hasOwnProperty.call(result, key)) {
|
||||
|
||||
Reference in New Issue
Block a user