Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / uniq.js
1 var baseUniq = require('./_baseUniq');
2
3 /**
4  * Creates a duplicate-free version of an array, using
5  * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
6  * for equality comparisons, in which only the first occurrence of each element
7  * is kept.
8  *
9  * @static
10  * @memberOf _
11  * @category Array
12  * @param {Array} array The array to inspect.
13  * @returns {Array} Returns the new duplicate free array.
14  * @example
15  *
16  * _.uniq([2, 1, 2]);
17  * // => [2, 1]
18  */
19 function uniq(array) {
20   return (array && array.length)
21     ? baseUniq(array)
22     : [];
23 }
24
25 module.exports = uniq;