bdb217d81a5a7d753a63474675610c1104dc9eba
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / sortedIndex.js
1 var baseSortedIndex = require('./_baseSortedIndex');
2
3 /**
4  * Uses a binary search to determine the lowest index at which `value` should
5  * be inserted into `array` in order to maintain its sort order.
6  *
7  * @static
8  * @memberOf _
9  * @category Array
10  * @param {Array} array The sorted array to inspect.
11  * @param {*} value The value to evaluate.
12  * @returns {number} Returns the index at which `value` should be inserted into `array`.
13  * @example
14  *
15  * _.sortedIndex([30, 50], 40);
16  * // => 1
17  *
18  * _.sortedIndex([4, 5], 4);
19  * // => 0
20  */
21 function sortedIndex(array, value) {
22   return baseSortedIndex(array, value);
23 }
24
25 module.exports = sortedIndex;