X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-uncss%2Fnode_modules%2Flodash%2F_baseSortedUniq.js;fp=node_modules%2Fgrunt-uncss%2Fnode_modules%2Flodash%2F_baseSortedUniq.js;h=802159a3dbd3cd18bdc8183476849130d27c92bf;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-uncss/node_modules/lodash/_baseSortedUniq.js b/node_modules/grunt-uncss/node_modules/lodash/_baseSortedUniq.js new file mode 100644 index 000000000..802159a3d --- /dev/null +++ b/node_modules/grunt-uncss/node_modules/lodash/_baseSortedUniq.js @@ -0,0 +1,30 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniq` and `_.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 baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; +} + +module.exports = baseSortedUniq;