\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27414}{}\doxysection{Install}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27414}
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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27415}{}\doxysection{Usage}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27415}

\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27416}{}\doxysection{Examples}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27416}
\hypertarget{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27417}{}\doxysubsection{value type}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27417}
{\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27418}{}\doxysubsection{data descriptor}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27418}
{\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27419}{}\doxysubsection{accessor descriptor}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27419}
{\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27420}{}\doxysection{About}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27420}
\hypertarget{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27421}{}\doxysubsection{Related projects}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27421}

\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27422}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27422}
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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27423}{}\doxysubsection{Contributors}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27423}
\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27424}{}\doxysubsection{Building docs}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27424}
\+\_\+(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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27425}{}\doxysubsection{Running tests}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27425}
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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27426}{}\doxysubsection{Author}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27426}
{\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_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27427}{}\doxysubsection{License}\label{md_sfcode_node_modules_snapdragon_node_node_modules_is_descriptor_README_autotoc_md27427}
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.} 