X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-log-utils%2Fnode_modules%2Flodash%2F_baseSortedUniqBy.js;fp=node_modules%2Fgrunt-legacy-log-utils%2Fnode_modules%2Flodash%2F_baseSortedUniqBy.js;h=c95a83f24342f0cee4761d05a38cc5dbd13fecfa;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-log-utils/node_modules/lodash/_baseSortedUniqBy.js b/node_modules/grunt-legacy-log-utils/node_modules/lodash/_baseSortedUniqBy.js new file mode 100644 index 000000000..c95a83f24 --- /dev/null +++ b/node_modules/grunt-legacy-log-utils/node_modules/lodash/_baseSortedUniqBy.js @@ -0,0 +1,33 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniqBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniqBy(array, iteratee) { + var index = 0, + length = array.length, + value = array[0], + computed = iteratee ? iteratee(value) : value, + seen = computed, + resIndex = 0, + result = [value]; + + while (++index < length) { + value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!eq(computed, seen)) { + seen = computed; + result[++resIndex] = value; + } + } + return result; +} + +module.exports = baseSortedUniqBy;