{\itshape Promise} instance\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_promise_autotoc_md9974}{}\doxysection{$<$tt$>$promise/is$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_promise_autotoc_md9974}
Confirms if given object is a native {\itshape promise}


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

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


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

\end{DoxyCode}
 