{\itshape Thenable} object (an object with {\ttfamily then} method)\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_thenable_autotoc_md9988}{}\doxysection{$<$tt$>$thenable/is$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_thenable_autotoc_md9988}
Confirms if given object is a {\itshape thenable}


\begin{DoxyCode}{0}
\DoxyCodeLine{const isThenable = require("{}type/thenable/is"{});}
\DoxyCodeLine{}
\DoxyCodeLine{isThenable(Promise.resolve()); // true}
\DoxyCodeLine{isThenable(\{ then: () => \{\} \}); // true}
\DoxyCodeLine{isThenable(\{\}); // false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_thenable_autotoc_md9989}{}\doxysection{$<$tt$>$thenable/ensure$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_thenable_autotoc_md9989}
If given argument is a {\itshape thenable} object, it is returned back. Otherwise {\ttfamily Type\+Error} is thrown.


\begin{DoxyCode}{0}
\DoxyCodeLine{const ensureThenable = require("{}type/thenable/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{const promise = Promise.resolve();}
\DoxyCodeLine{ensureThenable(promise); // promise}
\DoxyCodeLine{ensureThenable(\{\}); // Thrown TypeError: [object Object] is not a thenable object }

\end{DoxyCode}
 