\begin{quote}
Returns true if a value has the characteristics of a valid Java\+Script data descriptor. \end{quote}
\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13029}{}\doxysection{Install}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13029}
Install with \href{https://www.npmjs.com/}{\texttt{ npm}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm i is-\/data-\/descriptor -\/-\/save }

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

\begin{DoxyCode}{0}
\DoxyCodeLine{var isDataDesc = require('is-\/data-\/descriptor'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13031}{}\doxysection{Examples}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13031}
{\ttfamily true} when the descriptor has valid properties with valid values.


\begin{DoxyCode}{0}
\DoxyCodeLine{// `value` can be anything}
\DoxyCodeLine{isDataDesc(\{value: 'foo'\})}
\DoxyCodeLine{isDataDesc(\{value: function() \{\}\})}
\DoxyCodeLine{isDataDesc(\{value: true\})}
\DoxyCodeLine{//=> true }

\end{DoxyCode}


{\ttfamily false} when not an object


\begin{DoxyCode}{0}
\DoxyCodeLine{isDataDesc('a')}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc(null)}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc([])}
\DoxyCodeLine{//=> false }

\end{DoxyCode}


{\ttfamily false} when the object has invalid properties


\begin{DoxyCode}{0}
\DoxyCodeLine{isDataDesc(\{value: 'foo', bar: 'baz'\})}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc(\{value: 'foo', bar: 'baz'\})}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc(\{value: 'foo', get: function()\{\}\})}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc(\{get: function()\{\}, value: 'foo'\})}
\DoxyCodeLine{//=> false }

\end{DoxyCode}


{\ttfamily false} when a value is not the correct type


\begin{DoxyCode}{0}
\DoxyCodeLine{isDataDesc(\{value: 'foo', enumerable: 'foo'\})}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc(\{value: 'foo', configurable: 'foo'\})}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDataDesc(\{value: 'foo', writable: 'foo'\})}
\DoxyCodeLine{//=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13032}{}\doxysection{Valid properties}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13032}
The only valid data descriptor properties are the following\+:


\begin{DoxyItemize}
\item {\ttfamily configurable} (required)
\item {\ttfamily enumerable} (required)
\item {\ttfamily value} (optional)
\item {\ttfamily writable} (optional)
\end{DoxyItemize}

To be a valid data descriptor, either {\ttfamily value} or {\ttfamily writable} must be defined.

{\bfseries{Invalid properties}}

A descriptor may have additional {\itshape invalid} properties (an error will {\bfseries{not}} be thrown).


\begin{DoxyCode}{0}
\DoxyCodeLine{var foo = \{\};}
\DoxyCodeLine{}
\DoxyCodeLine{Object.defineProperty(foo, 'bar', \{}
\DoxyCodeLine{  enumerable: true,}
\DoxyCodeLine{  whatever: 'blah', // invalid, but doesn't cause an error}
\DoxyCodeLine{  get: function() \{}
\DoxyCodeLine{    return 'baz';}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(foo.bar);}
\DoxyCodeLine{//=> 'baz' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13033}{}\doxysection{Related projects}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13033}

\begin{DoxyItemize}
\item \href{https://www.npmjs.com/package/is-accessor-descriptor}{\texttt{ is-\/accessor-\/descriptor}}\+: Returns true if a value has the characteristics of a valid Java\+Script accessor descriptor. $\vert$ \href{https://github.com/jonschlinkert/is-accessor-descriptor}{\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://www.npmjs.com/package/is-descriptor}{\texttt{ more}} $\vert$ \href{https://github.com/jonschlinkert/is-descriptor}{\texttt{ homepage}}
\item \href{https://www.npmjs.com/package/isobject}{\texttt{ isobject}}\+: Returns true if the value is an object and not an array or null. $\vert$ \href{https://github.com/jonschlinkert/isobject}{\texttt{ homepage}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13034}{}\doxysection{Running tests}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13034}
Install dev dependencies\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm i -\/d \&\& npm test }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13035}{}\doxysection{Contributing}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13035}
Pull requests and stars are always welcome. For bugs and feature requests, \href{https://github.com/jonschlinkert/is-data-descriptor/issues/new}{\texttt{ please create an issue}}.\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13036}{}\doxysection{Author}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13036}
{\bfseries{Jon Schlinkert}}


\begin{DoxyItemize}
\item \href{https://github.com/jonschlinkert}{\texttt{ github/jonschlinkert}}
\item \href{http://twitter.com/jonschlinkert}{\texttt{ twitter/jonschlinkert}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13037}{}\doxysection{License}\label{md_sfcode_node_modules_is_data_descriptor_README_autotoc_md13037}
Copyright © 2015 \href{https://github.com/jonschlinkert}{\texttt{ Jon Schlinkert}} Released under the MIT license.

\DoxyHorRuler{0}


{\itshape This file was generated by \href{https://github.com/verbose/verb}{\texttt{ verb}} on December 28, 2015.} 