|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
513 bytes
|
| Line | |
|---|
| 1 | var baseSortedUniq = require('./_baseSortedUniq');
|
|---|
| 2 |
|
|---|
| 3 | /**
|
|---|
| 4 | * This method is like `_.uniq` except that it's designed and optimized
|
|---|
| 5 | * for sorted arrays.
|
|---|
| 6 | *
|
|---|
| 7 | * @static
|
|---|
| 8 | * @memberOf _
|
|---|
| 9 | * @since 4.0.0
|
|---|
| 10 | * @category Array
|
|---|
| 11 | * @param {Array} array The array to inspect.
|
|---|
| 12 | * @returns {Array} Returns the new duplicate free array.
|
|---|
| 13 | * @example
|
|---|
| 14 | *
|
|---|
| 15 | * _.sortedUniq([1, 1, 2]);
|
|---|
| 16 | * // => [1, 2]
|
|---|
| 17 | */
|
|---|
| 18 | function sortedUniq(array) {
|
|---|
| 19 | return (array && array.length)
|
|---|
| 20 | ? baseSortedUniq(array)
|
|---|
| 21 | : [];
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | module.exports = sortedUniq;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.