Provides a complete cumulated input validation for an API endpoint. Validates multiple input arguments and consolidates eventual errors into one.\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9935}{}\doxysection{Arguments}\label{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9935}
\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9936}{}\doxysubsection{$<$tt$>$validation\+Datum1\mbox{[}, ...\+validation\+Datum\+N\mbox{]}$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9936}
For each argument to be validated a {\ttfamily validation\+Datum} of following stucture should be defined\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[argumentName, inputValue, ensureFunction, (options = \{\})]; }

\end{DoxyCode}



\begin{DoxyItemize}
\item {\ttfamily argument\+Name} -\/ Name of validated argument (used for meaningful error messaging)
\item {\ttfamily input\+Value} -\/ An argument value as passed to function
\item {\ttfamily ensure\+Function} -\/ An {\ttfamily ensureX} function with which argument should be validated (e.\+g. if we\textquotesingle{}re after string, then we need \href{string.md\#stringensure}{\texttt{ string/ensure}})
\item {\ttfamily options} -\/ Optional, extra options to be passed to {\ttfamily ensureX} function
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9937}{}\doxysubsection{$<$tt$>$\mbox{[}options\mbox{]}$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9937}
Eventual options be passed to underlying {\ttfamily ensureX} functions. If custom error constructor is passed with an {\ttfamily Error} option, then cumulated error is created with this constructor.\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9938}{}\doxysection{Usage example}\label{md_sfcode_node_modules_ext_node_modules_type_docs_ensure_autotoc_md9938}

\begin{DoxyCode}{0}
\DoxyCodeLine{const ensure = require("{}type/ensure"{});}
\DoxyCodeLine{const ensureString = require("{}type/string/ensure"{});}
\DoxyCodeLine{const ensureNaturalNumber = require("{}type/natural-\/number/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{const resolveRepositoryIssue = (repoName, issueNumber) => \{}
\DoxyCodeLine{  // Validate input}
\DoxyCodeLine{  [repoName, issueNumber] = ensure(}
\DoxyCodeLine{    ["{}repoName"{}, repoName, ensureString],}
\DoxyCodeLine{    ["{}issueNumber"{}, issueNumber, ensureNaturalNumber],}
\DoxyCodeLine{    \{ Error: UserError \}}
\DoxyCodeLine{  );}
\DoxyCodeLine{  // ... logic}
\DoxyCodeLine{\}; }

\end{DoxyCode}
 