Urara-Blog/node_modules/.pnpm-store/v3/files/8b/725fae70a2cc8293f88dbee7c50f038a6cee68b0099f9eb45f65bbca086c8faf17d8157968749f9959101c2fcb4154ef221a5123d5837e11874aa33142d82f
2022-08-14 01:14:53 +08:00

25 lines
688 B
Text

var baseUniq = require('./_baseUniq');
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each element
* is kept. The order of result values is determined by the order they occur
* in the array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length) ? baseUniq(array) : [];
}
module.exports = uniq;