\href{https://travis-ci.org/fgnass/uniqs}{\texttt{ }}\hypertarget{md_sfcode_node_modules_uniqs_README_autotoc_md31304}{}\doxysubsubsection{Tiny utility to create unions and de-\/duplicated lists.}\label{md_sfcode_node_modules_uniqs_README_autotoc_md31304}
Example\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var uniqs = require('uniqs');}
\DoxyCodeLine{}
\DoxyCodeLine{var foo = \{ foo: 23 \};}
\DoxyCodeLine{var list = [3, 2, 2, 1, foo, foo];}
\DoxyCodeLine{}
\DoxyCodeLine{uniqs(list);}
\DoxyCodeLine{// => [3, 2, 1, \{ foo: 23 \}] }

\end{DoxyCode}


You can pass multiple lists to create a union\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{uniqs([2, 1, 1], [2, 3, 3, 4], [4, 3, 2]);}
\DoxyCodeLine{// => [2, 1, 3, 4] }

\end{DoxyCode}


Passing individual items works too\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{uniqs(3, 2, 2, [1, 1, 2]);}
\DoxyCodeLine{// => [3, 2, 1] }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_uniqs_README_autotoc_md31305}{}\doxysubsubsection{Summary}\label{md_sfcode_node_modules_uniqs_README_autotoc_md31305}

\begin{DoxyItemize}
\item Uniqueness is defined based on strict object equality.
\item The lists do not need to be sorted.
\item The resulting array contains the items in the order of their first appearance.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_uniqs_README_autotoc_md31306}{}\doxysubsubsection{About}\label{md_sfcode_node_modules_uniqs_README_autotoc_md31306}
This package has been written to accompany utilities like \href{https://npmjs.org/package/flatten}{\texttt{ flatten}} as alternative to full-\/blown libraries like underscore or lodash.

The implementation is optimized for simplicity rather than performance and looks like this\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = function uniqs() \{}
\DoxyCodeLine{  var list = Array.prototype.concat.apply([], arguments);}
\DoxyCodeLine{  return list.filter(function(item, i) \{}
\DoxyCodeLine{    return i == list.indexOf(item);}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_uniqs_README_autotoc_md31307}{}\doxysubsubsection{License}\label{md_sfcode_node_modules_uniqs_README_autotoc_md31307}
MIT 