{\itshape string} primitive\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_string_autotoc_md9985}{}\doxysection{$<$tt$>$string/coerce$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_string_autotoc_md9985}
Restricted string coercion. Returns string presentation for every value that follows below constraints


\begin{DoxyItemize}
\item is implicitly coercible to string
\item is neither{\ttfamily null} nor {\ttfamily undefined}
\item its {\ttfamily to\+String} method is not {\ttfamily Object.\+prototype.\+to\+String}
\end{DoxyItemize}

For all other values {\ttfamily null} is returned


\begin{DoxyCode}{0}
\DoxyCodeLine{const coerceToString = require("{}type/string/coerce"{});}
\DoxyCodeLine{}
\DoxyCodeLine{coerceToString(12); // "{}12"{}}
\DoxyCodeLine{coerceToString(undefined); // null }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_string_autotoc_md9986}{}\doxysection{$<$tt$>$string/ensure$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_string_autotoc_md9986}
If given argument is a string coercible value (via \href{\#stringcoerce}{\texttt{ {\ttfamily string/coerce}}}) returns result string. Otherwise {\ttfamily Type\+Error} is thrown.


\begin{DoxyCode}{0}
\DoxyCodeLine{const ensureString = require("{}type/string/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{ensureString(12); // "{}12"{}}
\DoxyCodeLine{ensureString(null); // Thrown TypeError: null is not a string }

\end{DoxyCode}
 