{\itshape Array-\/like} value (any value with {\ttfamily length} property)\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_array_like_autotoc_md9926}{}\doxysection{$<$tt$>$array-\/like/is$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_array_like_autotoc_md9926}
Restricted {\itshape array-\/like} confirmation. Returns true for every value that meets following contraints


\begin{DoxyItemize}
\item is an {\itshape object} (or with {\ttfamily allow\+String} option, a {\itshape string})
\item is not a {\itshape function}
\item Exposes {\ttfamily length} that meets \href{array-length.md\#array-lengthcoerce}{\texttt{ {\ttfamily array-\/length}}} constraints
\end{DoxyItemize}


\begin{DoxyCode}{0}
\DoxyCodeLine{const isArrayLike = require("{}type/array-\/like/is"{});}
\DoxyCodeLine{}
\DoxyCodeLine{isArrayLike([]); // true}
\DoxyCodeLine{isArrayLike(\{\}); // false}
\DoxyCodeLine{isArrayLike(\{ length: 0 \}); // true}
\DoxyCodeLine{isArrayLike("{}foo"{}); // false}
\DoxyCodeLine{isArrayLike("{}foo"{}, \{ allowString: true \}); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_array_like_autotoc_md9927}{}\doxysection{$<$tt$>$array-\/like/ensure$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_array_like_autotoc_md9927}
If given argument is an {\itshape array-\/like}, it is returned back. Otherwise {\ttfamily Type\+Error} is thrown.


\begin{DoxyCode}{0}
\DoxyCodeLine{const ensureArrayLike = require("{}type/array-\/like/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{ensureArrayLike(\{ length: 0 \}); // \{ length: 0 \}}
\DoxyCodeLine{ensureArrayLike("{}foo"{}, \{ allowString: true \}); // "{}foo"{}}
\DoxyCodeLine{ensureArrayLike(\{\}); // Thrown TypeError: null is not an iterable }

\end{DoxyCode}
 