Remove baseIteratee and castFunction.

This commit is contained in:
John-David Dalton
2017-01-09 17:17:03 -08:00
parent efcf51c7bf
commit 65654f8f9e
96 changed files with 140 additions and 537 deletions

View File

@@ -1,6 +1,5 @@
import baseExtremum from './_baseExtremum.js';
import baseGt from './_baseGt.js';
import baseIteratee from './_baseIteratee.js';
/**
* This method is like `_.max` except that it accepts `iteratee` which is
@@ -12,7 +11,7 @@ import baseIteratee from './_baseIteratee.js';
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @param {Function} iteratee The iteratee invoked per element.
* @returns {*} Returns the maximum value.
* @example
*
@@ -20,14 +19,10 @@ import baseIteratee from './_baseIteratee.js';
*
* _.maxBy(objects, function(o) { return o.n; });
* // => { 'n': 2 }
*
* // The `_.property` iteratee shorthand.
* _.maxBy(objects, 'n');
* // => { 'n': 2 }
*/
function maxBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, baseIteratee(iteratee, 2), baseGt)
? baseExtremum(array, iteratee, baseGt)
: undefined;
}