664a58ea3f47c808d55d9e270b1c80c2175d2c97d2975d6755c04ec465caf14da957c8e7f0b4c29bbc881cee9715ca8202ef369cc36c4b5f6f78454d600001 511 B

123456789101112131415161718192021222324
  1. import baseSortedUniq from './_baseSortedUniq.js';
  2. /**
  3. * This method is like `_.uniq` except that it's designed and optimized
  4. * for sorted arrays.
  5. *
  6. * @static
  7. * @memberOf _
  8. * @since 4.0.0
  9. * @category Array
  10. * @param {Array} array The array to inspect.
  11. * @returns {Array} Returns the new duplicate free array.
  12. * @example
  13. *
  14. * _.sortedUniq([1, 1, 2]);
  15. * // => [1, 2]
  16. */
  17. function sortedUniq(array) {
  18. return (array && array.length)
  19. ? baseSortedUniq(array)
  20. : [];
  21. }
  22. export default sortedUniq;