\begin{quote}
Returns true if a value exists, false if empty. Works with deeply nested values using object paths. \end{quote}
\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11471}{}\doxysection{Install}\label{md_sfcode_node_modules_has_value_README_autotoc_md11471}
Install with \href{https://www.npmjs.com/}{\texttt{ npm}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/-\/save has-\/value }

\end{DoxyCode}


{\bfseries{Works for\+:}}


\begin{DoxyItemize}
\item booleans
\item functions
\item numbers
\item strings
\item nulls
\item object
\item arrays
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11472}{}\doxysection{Usage}\label{md_sfcode_node_modules_has_value_README_autotoc_md11472}
Works with property values (supports object-\/path notation, like {\ttfamily foo.\+bar}) or a single value\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var hasValue = require('has-\/value');}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue('foo');}
\DoxyCodeLine{hasValue(\{foo: 'bar'\}, 'foo');}
\DoxyCodeLine{hasValue(\{a: \{b: \{c: 'foo'\}\}\}, 'a.b.c');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue('');}
\DoxyCodeLine{hasValue(\{foo: ''\}, 'foo');}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue(0);}
\DoxyCodeLine{hasValue(1);}
\DoxyCodeLine{hasValue(\{foo: 0\}, 'foo');}
\DoxyCodeLine{hasValue(\{foo: 1\}, 'foo');}
\DoxyCodeLine{hasValue(\{foo: null\}, 'foo');}
\DoxyCodeLine{hasValue(\{foo: \{bar: 'a'\}\}\}, 'foo');}
\DoxyCodeLine{hasValue(\{foo: \{bar: 'a'\}\}\}, 'foo.bar');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue(\{foo: \{\}\}\}, 'foo');}
\DoxyCodeLine{hasValue(\{foo: \{bar: \{\}\}\}\}, 'foo.bar');}
\DoxyCodeLine{hasValue(\{foo: undefined\}, 'foo');}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue([]);}
\DoxyCodeLine{hasValue([[]]);}
\DoxyCodeLine{hasValue([[], []]);}
\DoxyCodeLine{hasValue([undefined]);}
\DoxyCodeLine{hasValue(\{foo: []\}, 'foo');}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue([0]);}
\DoxyCodeLine{hasValue([null]);}
\DoxyCodeLine{hasValue(['foo']);}
\DoxyCodeLine{hasValue(\{foo: ['a']\}, 'foo');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue(function() \{\})}
\DoxyCodeLine{hasValue(function(foo) \{\})}
\DoxyCodeLine{hasValue(\{foo: function(foo) \{\}\}, 'foo'); }
\DoxyCodeLine{hasValue(\{foo: function() \{\}\}, 'foo');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasValue(true);}
\DoxyCodeLine{hasValue(false);}
\DoxyCodeLine{hasValue(\{foo: true\}, 'foo');}
\DoxyCodeLine{hasValue(\{foo: false\}, 'foo');}
\DoxyCodeLine{//=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11473}{}\doxysection{is\+Empty}\label{md_sfcode_node_modules_has_value_README_autotoc_md11473}
To do the opposite and test for empty values, do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{function isEmpty(o) \{}
\DoxyCodeLine{  return !hasValue.apply(hasValue, arguments);}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11474}{}\doxysection{Release history}\label{md_sfcode_node_modules_has_value_README_autotoc_md11474}
\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11475}{}\doxysubsection{v1.\+0.\+0}\label{md_sfcode_node_modules_has_value_README_autotoc_md11475}

\begin{DoxyItemize}
\item {\ttfamily zero} always returns true
\item {\ttfamily array} now recurses, so that an array of empty arrays will return {\ttfamily false}
\item {\ttfamily null} now returns true
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11476}{}\doxysection{About}\label{md_sfcode_node_modules_has_value_README_autotoc_md11476}
\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11477}{}\doxysubsection{Related projects}\label{md_sfcode_node_modules_has_value_README_autotoc_md11477}

\begin{DoxyItemize}
\item \href{https://www.npmjs.com/package/define-property}{\texttt{ define-\/property}}\+: Define a non-\/enumerable property on an object. $\vert$ \href{https://github.com/jonschlinkert/define-property}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/get-value}{\texttt{ get-\/value}}\+: Use property paths ({\ttfamily a.\+b.\+c}) to get a nested value from an object. $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/get-value}{\texttt{ https\+://github.\+com/jonschlinkert/get-\/value}} \char`\"{}\+Use property paths (\`{}a.\+b.\+c\`{}) to get a nested value from an object.\char`\"{})
\item \href{https://www.npmjs.com/package/set-value}{\texttt{ set-\/value}}\+: Create nested values and any intermediaries using dot notation (`\textquotesingle{}a.\+b.\+c'{\ttfamily ) paths. $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/set-value}{\texttt{ https\+://github.\+com/jonschlinkert/set-\/value}} \char`\"{}\+Create nested values and any intermediaries using dot notation ($<$/tt$>$\textquotesingle{}a.\+b.\+c\textquotesingle{}\`{}) paths.\char`\"{})}
\item {\ttfamily \mbox{[}unset-\/value\mbox{]}(\href{https://www.npmjs.com/package/unset-value}{\texttt{ https\+://www.\+npmjs.\+com/package/unset-\/value}})\+: Delete nested properties from an object using dot notation. $\vert$ \mbox{[}homepage\mbox{]}(\href{https://github.com/jonschlinkert/unset-value}{\texttt{ https\+://github.\+com/jonschlinkert/unset-\/value}} \char`\"{}\+Delete nested properties from an object using dot notation.\char`\"{})}
\end{DoxyItemize}

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

{\ttfamily }\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11479}{}\doxysubsection{Contributors}\label{md_sfcode_node_modules_has_value_README_autotoc_md11479}
{\ttfamily  \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
17   &\href{https://github.com/jonschlinkert}{\texttt{ jonschlinkert}}    \\\cline{1-2}
2   &\href{https://github.com/rmharrison}{\texttt{ rmharrison}}   \\\cline{1-2}
\end{longtabu}
}

{\ttfamily }\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11480}{}\doxysubsection{Building docs}\label{md_sfcode_node_modules_has_value_README_autotoc_md11480}
{\ttfamily  \+\_\+(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.)\+\_\+}

{\ttfamily To generate the readme, run the following command\+:}

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

\end{DoxyCode}
}

{\ttfamily }\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11481}{}\doxysubsection{Running tests}\label{md_sfcode_node_modules_has_value_README_autotoc_md11481}
{\ttfamily  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\+:}

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

\end{DoxyCode}
}

{\ttfamily }\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11482}{}\doxysubsection{Author}\label{md_sfcode_node_modules_has_value_README_autotoc_md11482}
{\ttfamily  {\bfseries{Jon Schlinkert}}}

{\ttfamily 
\begin{DoxyItemize}
\item \href{https://github.com/jonschlinkert}{\texttt{ github/jonschlinkert}}
\item \href{https://twitter.com/jonschlinkert}{\texttt{ twitter/jonschlinkert}}
\end{DoxyItemize}}

{\ttfamily }\hypertarget{md_sfcode_node_modules_has_value_README_autotoc_md11483}{}\doxysubsection{License}\label{md_sfcode_node_modules_has_value_README_autotoc_md11483}
{\ttfamily  Copyright © 2017, \href{https://github.com/jonschlinkert}{\texttt{ Jon Schlinkert}}. Released under the \mbox{[}MIT License\mbox{]}(LICENSE).}

{\ttfamily \DoxyHorRuler{0}
}

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