1 var baseCallback = require('./baseCallback'),
2 binaryIndex = require('./binaryIndex'),
3 binaryIndexBy = require('./binaryIndexBy');
6 * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
9 * @param {boolean} [retHighest] Specify returning the highest qualified index.
10 * @returns {Function} Returns the new index function.
12 function createSortedIndex(retHighest) {
13 return function(array, value, iteratee, thisArg) {
14 return iteratee == null
15 ? binaryIndex(array, value, retHighest)
16 : binaryIndexBy(array, value, baseCallback(iteratee, thisArg, 1), retHighest);
20 module.exports = createSortedIndex;