6517498773dc2b257cc209fa2194c3b3444e7b88
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / sortedLastIndexBy.js
1 var baseIteratee = require('./_baseIteratee'),
2     baseSortedIndexBy = require('./_baseSortedIndexBy');
3
4 /**
5  * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
6  * which is invoked for `value` and each element of `array` to compute their
7  * sort ranking. The iteratee is invoked with one argument: (value).
8  *
9  * @static
10  * @memberOf _
11  * @category Array
12  * @param {Array} array The sorted array to inspect.
13  * @param {*} value The value to evaluate.
14  * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
15  * @returns {number} Returns the index at which `value` should be inserted into `array`.
16  * @example
17  *
18  * // The `_.property` iteratee shorthand.
19  * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
20  * // => 1
21  */
22 function sortedLastIndexBy(array, value, iteratee) {
23   return baseSortedIndexBy(array, value, baseIteratee(iteratee), true);
24 }
25
26 module.exports = sortedLastIndexBy;