Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / sortedLastIndex.js
1 var baseSortedIndex = require('./internal/baseSortedIndex');
2
3 /**
4  * This method is like `_.sortedIndex` except that it returns the highest
5  * index at which `value` should be inserted into `array` in order to
6  * maintain its sort order.
7  *
8  * @static
9  * @memberOf _
10  * @category Array
11  * @param {Array} array The sorted array to inspect.
12  * @param {*} value The value to evaluate.
13  * @returns {number} Returns the index at which `value` should be inserted into `array`.
14  * @example
15  *
16  * _.sortedLastIndex([4, 5], 4);
17  * // => 1
18  */
19 function sortedLastIndex(array, value) {
20   return baseSortedIndex(array, value, true);
21 }
22
23 module.exports = sortedLastIndex;