\href{https://travis-ci.org/mgechev/semver-dsl}{\texttt{ }}\hypertarget{md_sfcode_node_modules_semver_dsl_README_autotoc_md26524}{}\doxysection{Sem\+Ver DSL}\label{md_sfcode_node_modules_semver_dsl_README_autotoc_md26524}
A simple internal DSL which allows you to invoke different functionality depending on version match. Used in codelyzer for keeping the code compatible across different versions of the Angular compiler.\hypertarget{md_sfcode_node_modules_semver_dsl_README_autotoc_md26525}{}\doxysection{Demo}\label{md_sfcode_node_modules_semver_dsl_README_autotoc_md26525}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm i semver-\/dsl -\/-\/save }

\end{DoxyCode}



\begin{DoxyCode}{0}
\DoxyCodeLine{import \{SemVerDSL\} from 'semver-\/dsl';}
\DoxyCodeLine{}
\DoxyCodeLine{const base = () => \{\};}
\DoxyCodeLine{const elseIf1 = () => \{\};}
\DoxyCodeLine{const elseIf2 = () => \{\};}
\DoxyCodeLine{const else = () => console.log('I will be invoked!');}
\DoxyCodeLine{}
\DoxyCodeLine{SemVerDSL('3.0.0')}
\DoxyCodeLine{  .gt('3.2.1', base)}
\DoxyCodeLine{  .elseIf.gt('3.0.1', elseIf1)}
\DoxyCodeLine{  .elseIf.between('3.0.1', '3.1.8', elseIf2)}
\DoxyCodeLine{  .else(else); }

\end{DoxyCode}


In the example above will be invoked {\ttfamily else}.\hypertarget{md_sfcode_node_modules_semver_dsl_README_autotoc_md26526}{}\doxysection{API}\label{md_sfcode_node_modules_semver_dsl_README_autotoc_md26526}

\begin{DoxyItemize}
\item {\ttfamily Sem\+DSL(version\+: string)} -\/ factory which accepts a version and returns an object.
\item {\ttfamily gte(version\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} and {\ttfamily else} properties.
\item {\ttfamily lte(version\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} and {\ttfamily else} properties.
\item {\ttfamily gt(version\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} and {\ttfamily else} properties.
\item {\ttfamily lt(version\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} and {\ttfamily else} properties.
\item {\ttfamily eq(version\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} and {\ttfamily else} properties.
\item {\ttfamily neq(version\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} and {\ttfamily else} properties.
\item {\ttfamily between(v1\+: string, v2\+: string, callback?\+: Function)\+: ISem\+Contextual\+DSL} -\/ returns an object with {\ttfamily else\+If} properties.
\item {\ttfamily else\+If} -\/ returns an object of type {\ttfamily ISem\+Ver\+DSL} bound to the previous predicate.
\item {\ttfamily else} -\/ invokes given callback if all of the previous conditions have failed.
\end{DoxyItemize}


\begin{DoxyCode}{0}
\DoxyCodeLine{export interface ISemVerDSL \{}
\DoxyCodeLine{  gte(version: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{  lte(version: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{  gt(version: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{  lt(version: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{  eq(version: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{  neq(version: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{  between(v1: string, v2: string, callback: Function): ISemContextualDSL;}
\DoxyCodeLine{\} }

\end{DoxyCode}



\begin{DoxyCode}{0}
\DoxyCodeLine{export interface ISemVerContextBoundDSL \{}
\DoxyCodeLine{  elseIf: ISemVerDSL;}
\DoxyCodeLine{  else(callback: Function): void;}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_semver_dsl_README_autotoc_md26527}{}\doxysection{License}\label{md_sfcode_node_modules_semver_dsl_README_autotoc_md26527}
MIT 