Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / sortedUniqBy.js
1 var baseIteratee = require('./internal/baseIteratee'),
2     baseSortedUniqBy = require('./internal/baseSortedUniqBy');
3
4 /**
5  * This method is like `_.uniqBy` except that it's designed and optimized
6  * for sorted arrays.
7  *
8  * @static
9  * @memberOf _
10  * @category Array
11  * @param {Array} array The array to inspect.
12  * @param {Function} [iteratee] The iteratee invoked per element.
13  * @returns {Array} Returns the new duplicate free array.
14  * @example
15  *
16  * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
17  * // => [1.1, 2.2]
18  */
19 function sortedUniqBy(array, iteratee) {
20   return (array && array.length)
21     ? baseSortedUniqBy(array, baseIteratee(iteratee))
22     : [];
23 }
24
25 module.exports = sortedUniqBy;