"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/lodash.uniq/index.js" (8 Mar 2017, 1007 Bytes) of package /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * lodash (Custom Build) <https://lodash.com/>
    3  * Build: `lodash modularize exports="npm" -o ./`
    4  * Copyright jQuery Foundation and other contributors <https://jquery.org/>
    5  * Released under MIT license <https://lodash.com/license>
    6  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
    7  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
    8  */
    9 var baseUniq = require('lodash._baseuniq');
   10 
   11 /**
   12  * Creates a duplicate-free version of an array, using
   13  * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
   14  * for equality comparisons, in which only the first occurrence of each
   15  * element is kept.
   16  *
   17  * @static
   18  * @memberOf _
   19  * @since 0.1.0
   20  * @category Array
   21  * @param {Array} array The array to inspect.
   22  * @returns {Array} Returns the new duplicate free array.
   23  * @example
   24  *
   25  * _.uniq([2, 1, 2]);
   26  * // => [2, 1]
   27  */
   28 function uniq(array) {
   29   return (array && array.length)
   30     ? baseUniq(array)
   31     : [];
   32 }
   33 
   34 module.exports = uniq;