diff options
Diffstat (limited to 'deps/npm/node_modules/lodash/internal/createSortedIndex.js')
-rw-r--r-- | deps/npm/node_modules/lodash/internal/createSortedIndex.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/deps/npm/node_modules/lodash/internal/createSortedIndex.js b/deps/npm/node_modules/lodash/internal/createSortedIndex.js new file mode 100644 index 0000000000..86c78520c9 --- /dev/null +++ b/deps/npm/node_modules/lodash/internal/createSortedIndex.js @@ -0,0 +1,20 @@ +var baseCallback = require('./baseCallback'), + binaryIndex = require('./binaryIndex'), + binaryIndexBy = require('./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); + }; +} + +module.exports = createSortedIndex; |