Bump to v3.0.0.

This commit is contained in:
John-David Dalton
2015-01-10 12:55:03 -08:00
committed by jdalton
commit 5379c1996b
350 changed files with 12910 additions and 0 deletions

32
array/sortedLastIndex.js Normal file
View File

@@ -0,0 +1,32 @@
import baseCallback from '../internal/baseCallback';
import binaryIndex from '../internal/binaryIndex';
import binaryIndexBy from '../internal/binaryIndexBy';
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=_.identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.property" or "_.matches" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedLastIndex([4, 4, 5, 5, 6, 6], 5);
* // => 4
*/
function sortedLastIndex(array, value, iteratee, thisArg) {
return iteratee == null
? binaryIndex(array, value, true)
: binaryIndexBy(array, value, baseCallback(iteratee, thisArg, 1), true);
}
export default sortedLastIndex;