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


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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{var isDescriptor = require('is-\/descriptor');}
\DoxyCodeLine{}
\DoxyCodeLine{isDescriptor(\{value: 'foo'\})}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{isDescriptor(\{get: function()\{\}, set: function()\{\}\})}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{isDescriptor(\{get: 'foo', set: function()\{\}\})}
\DoxyCodeLine{//=> false }

\end{DoxyCode}


You may also check for a descriptor by passing an object as the first argument and property name ({\ttfamily string}) as the second argument.


\begin{DoxyCode}{0}
\DoxyCodeLine{var obj = \{\};}
\DoxyCodeLine{obj.foo = 'abc';}
\DoxyCodeLine{}
\DoxyCodeLine{Object.defineProperty(obj, 'bar', \{}
\DoxyCodeLine{  value: 'xyz'}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{isDescriptor(obj, 'foo');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{isDescriptor(obj, 'bar');}
\DoxyCodeLine{//=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3837}{}\doxysection{Examples}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3837}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3838}{}\doxysubsection{value type}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3838}
{\ttfamily false} when not an object


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

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3839}{}\doxysubsection{data descriptor}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3839}
{\ttfamily true} when the object has valid properties with valid values.


\begin{DoxyCode}{0}
\DoxyCodeLine{isDescriptor(\{value: 'foo'\});}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{isDescriptor(\{value: noop\});}
\DoxyCodeLine{//=> true }

\end{DoxyCode}


{\ttfamily false} when the object has invalid properties


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

\end{DoxyCode}


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


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

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3840}{}\doxysubsection{accessor descriptor}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3840}
{\ttfamily true} when the object has valid properties with valid values.


\begin{DoxyCode}{0}
\DoxyCodeLine{isDescriptor(\{get: noop, set: noop\});}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{isDescriptor(\{get: noop\});}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{isDescriptor(\{set: noop\});}
\DoxyCodeLine{//=> true }

\end{DoxyCode}


{\ttfamily false} when the object has invalid properties


\begin{DoxyCode}{0}
\DoxyCodeLine{isDescriptor(\{get: noop, set: noop, bar: 'baz'\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{get: noop, writable: true\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{get: noop, value: true\});}
\DoxyCodeLine{//=> false }

\end{DoxyCode}


{\ttfamily false} when an accessor is not a function


\begin{DoxyCode}{0}
\DoxyCodeLine{isDescriptor(\{get: noop, set: 'baz'\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{get: 'foo', set: noop\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{get: 'foo', bar: 'baz'\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{get: 'foo', set: 'baz'\});}
\DoxyCodeLine{//=> false }

\end{DoxyCode}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{isDescriptor(\{get: noop, set: noop, enumerable: 'foo'\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{set: noop, configurable: 'foo'\});}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{isDescriptor(\{get: noop, configurable: 'foo'\});}
\DoxyCodeLine{//=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3841}{}\doxysection{About}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3841}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3842}{}\doxysubsection{Related projects}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3842}

\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-data-descriptor}{\texttt{ is-\/data-\/descriptor}}\+: Returns true if a value has the characteristics of a valid Java\+Script data descriptor. $\vert$ \href{https://github.com/jonschlinkert/is-data-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://github.com/jonschlinkert/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_base_node_modules_is_descriptor_README_autotoc_md3843}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3843}
Pull requests and stars are always welcome. For bugs and feature requests, \href{../../issues/new}{\texttt{ please create an issue}}.\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3844}{}\doxysubsection{Contributors}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3844}
\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
24   &\href{https://github.com/jonschlinkert}{\texttt{ jonschlinkert}}    \\\cline{1-2}
1   &\href{https://github.com/doowb}{\texttt{ doowb}}    \\\cline{1-2}
1   &\href{https://github.com/wtgtybhertgeghgtwtg}{\texttt{ wtgtybhertgeghgtwtg}}   \\\cline{1-2}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3845}{}\doxysubsection{Building docs}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3845}
\+\_\+(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}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3846}{}\doxysubsection{Running tests}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3846}
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}
\hypertarget{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3847}{}\doxysubsection{Author}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3847}
{\bfseries{Jon Schlinkert}}


\begin{DoxyItemize}
\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_base_node_modules_is_descriptor_README_autotoc_md3848}{}\doxysubsection{License}\label{md_sfcode_node_modules_base_node_modules_is_descriptor_README_autotoc_md3848}
Copyright © 2017, \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 July 22, 2017.} 