Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / createSortedIndex.js
1 var baseCallback = require('./baseCallback'),
2     binaryIndex = require('./binaryIndex'),
3     binaryIndexBy = require('./binaryIndexBy');
4
5 /**
6  * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
7  *
8  * @private
9  * @param {boolean} [retHighest] Specify returning the highest qualified index.
10  * @returns {Function} Returns the new index function.
11  */
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);
17   };
18 }
19
20 module.exports = createSortedIndex;