mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v3.6.0.
This commit is contained in:
19
internal/createSortedIndex.js
Normal file
19
internal/createSortedIndex.js
Normal file
@@ -0,0 +1,19 @@
|
||||
define(['./baseCallback', './binaryIndex', './binaryIndexBy'], function(baseCallback, binaryIndex, binaryIndexBy) {
|
||||
|
||||
/**
|
||||
* Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
|
||||
*
|
||||
* @private
|
||||
* @param {boolean} [retHighest] Specify returning the highest qualified index.
|
||||
* @returns {Function} Returns the new index function.
|
||||
*/
|
||||
function createSortedIndex(retHighest) {
|
||||
return function(array, value, iteratee, thisArg) {
|
||||
return iteratee == null
|
||||
? binaryIndex(array, value, retHighest)
|
||||
: binaryIndexBy(array, value, baseCallback(iteratee, thisArg, 1), retHighest);
|
||||
};
|
||||
}
|
||||
|
||||
return createSortedIndex;
|
||||
});
|
||||
Reference in New Issue
Block a user