All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.lodash.sortedUniq.js Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
var baseSortedUniq = require('./_baseSortedUniq');

/**
 * This method is like `_.uniq` except that it's designed and optimized
 * for sorted arrays.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Array
 * @param {Array} array The array to inspect.
 * @returns {Array} Returns the new duplicate free array.
 * @example
 *
 * _.sortedUniq([1, 1, 2]);
 * // => [1, 2]
 */
function sortedUniq(array) {
  return (array && array.length)
    ? baseSortedUniq(array)
    : [];
}

module.exports = sortedUniq;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy