{\bfseries{Contributing}}

\begin{quote}
Utils for working with Java\+Script classes and prototype methods. \end{quote}
Please consider following this project\textquotesingle{}s author, \href{https://github.com/jonschlinkert}{\texttt{ Jon Schlinkert}}, and consider starring the project to show your \+:heart\+: and support.\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5151}{}\doxysection{Install}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5151}
Install with \href{https://www.npmjs.com/}{\texttt{ npm}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/-\/save class-\/utils }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5152}{}\doxysection{Usage}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5152}

\begin{DoxyCode}{0}
\DoxyCodeLine{var cu = require('class-\/utils'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5153}{}\doxysection{API}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5153}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5154}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L43\char`\"{}$>$.\+has$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5154}
Returns true if an array has any of the given elements, or an object has any of the give keys.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily obj} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily val} $\ast$$\ast$\{String$\vert$\+Array\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{cu.has(['a', 'b', 'c'], 'c');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{cu.has(['a', 'b', 'c'], ['c', 'z']);}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{cu.has(\{a: 'b', c: 'd'\}, ['c', 'z']);}
\DoxyCodeLine{//=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5155}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L90\char`\"{}$>$.\+has\+All$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5155}
Returns true if an array or object has all of the given values.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily val} $\ast$$\ast$\{Object$\vert$\+Array\}$\ast$$\ast$
\item {\ttfamily values} $\ast$$\ast$\{String$\vert$\+Array\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{cu.hasAll(['a', 'b', 'c'], 'c');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{cu.hasAll(['a', 'b', 'c'], ['c', 'z']);}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{}
\DoxyCodeLine{cu.hasAll(\{a: 'b', c: 'd'\}, ['c', 'z']);}
\DoxyCodeLine{//=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5156}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L117\char`\"{}$>$.\+arrayify$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5156}
Cast the given value to an array.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily val} $\ast$$\ast$\{String$\vert$\+Array\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Array\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{cu.arrayify('foo');}
\DoxyCodeLine{//=> ['foo']}
\DoxyCodeLine{}
\DoxyCodeLine{cu.arrayify(['foo']);}
\DoxyCodeLine{//=> ['foo'] }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5157}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L152\char`\"{}$>$.\+has\+Constructor$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5157}
Returns true if a value has a {\ttfamily contructor}

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily value} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{cu.hasConstructor(\{\});}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{cu.hasConstructor(Object.create(null));}
\DoxyCodeLine{//=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5158}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L174\char`\"{}$>$.\+native\+Keys$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5158}
Get the native {\ttfamily own\+Property\+Names} from the constructor of the given {\ttfamily object}. An empty array is returned if the object does not have a constructor.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily obj} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Object that has a {\ttfamily constructor}.
\item {\ttfamily returns} $\ast$$\ast$\{Array\}$\ast$$\ast$\+: Array of keys.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{cu.nativeKeys(\{a: 'b', b: 'c', c: 'd'\})}
\DoxyCodeLine{//=> ['a', 'b', 'c']}
\DoxyCodeLine{}
\DoxyCodeLine{cu.nativeKeys(function()\{\})}
\DoxyCodeLine{//=> ['length', 'caller'] }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5159}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L208\char`\"{}$>$.\+get\+Descriptor$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5159}
Returns property descriptor {\ttfamily key} if it\textquotesingle{}s an \char`\"{}own\char`\"{} property of the given object.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily obj} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily key} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Returns descriptor {\ttfamily key}
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{function App() \{\}}
\DoxyCodeLine{Object.defineProperty(App.prototype, 'count', \{}
\DoxyCodeLine{  get: function() \{}
\DoxyCodeLine{    return Object.keys(this).length;}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\});}
\DoxyCodeLine{cu.getDescriptor(App.prototype, 'count');}
\DoxyCodeLine{// returns:}
\DoxyCodeLine{// \{}
\DoxyCodeLine{//   get: [Function],}
\DoxyCodeLine{//   set: undefined,}
\DoxyCodeLine{//   enumerable: false,}
\DoxyCodeLine{//   configurable: false}
\DoxyCodeLine{// \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5160}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L238\char`\"{}$>$.\+copy\+Descriptor$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5160}
Copy a descriptor from one object to another.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily receiver} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily provider} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily name} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{function App() \{\}}
\DoxyCodeLine{Object.defineProperty(App.prototype, 'count', \{}
\DoxyCodeLine{  get: function() \{}
\DoxyCodeLine{    return Object.keys(this).length;}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\});}
\DoxyCodeLine{var obj = \{\};}
\DoxyCodeLine{cu.copyDescriptor(obj, App.prototype, 'count'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5161}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L264\char`\"{}$>$.\+copy$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5161}
Copy static properties, prototype properties, and descriptors from one object to another.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily receiver} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily provider} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily omit} $\ast$$\ast$\{String$\vert$\+Array\}$\ast$$\ast$\+: One or more properties to omit
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5162}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L299\char`\"{}$>$.\+inherit$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5162}
Inherit the static properties, prototype properties, and descriptors from of an object.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily receiver} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily provider} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily omit} $\ast$$\ast$\{String$\vert$\+Array\}$\ast$$\ast$\+: One or more properties to omit
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5163}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L343\char`\"{}$>$.\+extend$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5163}
Returns a function for extending the static properties, prototype properties, and descriptors from the {\ttfamily Parent} constructor onto {\ttfamily Child} constructors.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily Parent} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Parent ctor
\item {\ttfamily extend} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Optional extend function to handle custom extensions. Useful when updating methods that require a specific prototype.
\item {\ttfamily Child} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Child ctor
\item {\ttfamily proto} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Optionally pass additional prototype properties to inherit.
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var extend = cu.extend(Parent);}
\DoxyCodeLine{Parent.extend(Child);}
\DoxyCodeLine{}
\DoxyCodeLine{// optional methods}
\DoxyCodeLine{Parent.extend(Child, \{}
\DoxyCodeLine{  foo: function() \{\},}
\DoxyCodeLine{  bar: function() \{\}}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5164}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L356\char`\"{}$>$.\+bubble$<$/a$>$}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5164}
Bubble up events emitted from static methods on the Parent ctor.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily Parent} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily events} $\ast$$\ast$\{Array\}$\ast$$\ast$\+: Event names to bubble up
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5165}{}\doxysection{About}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5165}
$<$details$>$

Pull requests and stars are always welcome. For bugs and feature requests, \href{../../issues/new}{\texttt{ please create an issue}}.

$<$/details$>$

$<$details$>$

{\bfseries{Running Tests}} 

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install \&\& npm test }

\end{DoxyCode}


$<$/details$>$ $<$details$>$

{\bfseries{Building docs}} 

\+\_\+(This project\textquotesingle{}s readme.\+md is generated by \href{https://github.com/verbose/verb-generate-readme}{\texttt{ verb}}, please don\textquotesingle{}t edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)\+\_\+

To generate the readme, run the following command\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/g verbose/verb\#dev verb-\/generate-\/readme \&\& verb }

\end{DoxyCode}


$<$/details$>$\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5166}{}\doxysubsection{Related projects}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5166}
You might also be interested in these projects\+:


\begin{DoxyItemize}
\item \href{https://www.npmjs.com/package/define-property}{\texttt{ define-\/property}}\+: Define a non-\/enumerable property on an object. Uses Reflect.\+define\+Property when available, otherwise Object.\+define\+Property. $\vert$ \href{https://github.com/jonschlinkert/define-property}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/delegate-properties}{\texttt{ delegate-\/properties}}\+: Deep-\/clone properties from one object to another and make them non-\/enumerable, or make existing properties… \href{https://github.com/jonschlinkert/delegate-properties}{\texttt{ more}} $\vert$ \href{https://github.com/jonschlinkert/delegate-properties}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/is-descriptor}{\texttt{ is-\/descriptor}}\+: Returns true if a value has the characteristics of a valid Java\+Script descriptor. Works for… \href{https://github.com/jonschlinkert/is-descriptor}{\texttt{ more}} $\vert$ \href{https://github.com/jonschlinkert/is-descriptor}{\texttt{ homepage}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5167}{}\doxysubsection{Contributors}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5167}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Commits}}   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Contributor}}    }\\\cline{1-2}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Commits}}   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ {\bfseries{Contributor}}    }\\\cline{1-2}
\endhead
34   &\href{https://github.com/jonschlinkert}{\texttt{ jonschlinkert}}    \\\cline{1-2}
8   &\href{https://github.com/doowb}{\texttt{ doowb}}    \\\cline{1-2}
2   &\href{https://github.com/wtgtybhertgeghgtwtg}{\texttt{ wtgtybhertgeghgtwtg}}   \\\cline{1-2}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5168}{}\doxysubsection{Author}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5168}
{\bfseries{Jon Schlinkert}}


\begin{DoxyItemize}
\item \href{https://linkedin.com/in/jonschlinkert}{\texttt{ linkedin/in/jonschlinkert}}
\item \href{https://github.com/jonschlinkert}{\texttt{ github/jonschlinkert}}
\item \href{https://twitter.com/jonschlinkert}{\texttt{ twitter/jonschlinkert}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_class_utils_README_autotoc_md5169}{}\doxysubsection{License}\label{md_sfcode_node_modules_class_utils_README_autotoc_md5169}
Copyright © 2018, \href{https://github.com/jonschlinkert}{\texttt{ Jon Schlinkert}}. Released under the \mbox{[}MIT License\mbox{]}(LICENSE).

\DoxyHorRuler{0}


{\itshape This file was generated by \href{https://github.com/verbose/verb-generate-readme}{\texttt{ verb-\/generate-\/readme}}, v0.\+6.\+0, on January 11, 2018.} 