Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _baseSortedUniqBy.js
1 var eq = require('./eq');
2
3 /**
4  * The base implementation of `_.sortedUniqBy` without support for iteratee
5  * shorthands.
6  *
7  * @private
8  * @param {Array} array The array to inspect.
9  * @param {Function} [iteratee] The iteratee invoked per element.
10  * @returns {Array} Returns the new duplicate free array.
11  */
12 function baseSortedUniqBy(array, iteratee) {
13   var index = 0,
14       length = array.length,
15       value = array[0],
16       computed = iteratee ? iteratee(value) : value,
17       seen = computed,
18       resIndex = 0,
19       result = [value];
20
21   while (++index < length) {
22     value = array[index],
23     computed = iteratee ? iteratee(value) : value;
24
25     if (!eq(computed, seen)) {
26       seen = computed;
27       result[++resIndex] = value;
28     }
29   }
30   return result;
31 }
32
33 module.exports = baseSortedUniqBy;