{\bfseries{Table of Contents}}

\begin{quote}
Utilities for the snapdragon parser/compiler. \end{quote}
$<$details$>$


\begin{DoxyItemize}
\item \href{\#install}{\texttt{ Install}}
\item \href{\#usage}{\texttt{ Usage}}
\item \href{\#api}{\texttt{ API}}
\item \href{\#release-history}{\texttt{ Release history}}
\begin{DoxyItemize}
\item \href{\#300---2017-05-01}{\texttt{ \mbox{[}3.\+0.\+0\mbox{]} -\/ 2017-\/05-\/01}}
\item \href{\#010}{\texttt{ \mbox{[}0.\+1.\+0\mbox{]}}}
\end{DoxyItemize}
\item \href{\#about}{\texttt{ About}}
\end{DoxyItemize}

$<$/details$>$\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27469}{}\doxysection{Install}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27469}
Install with \href{https://www.npmjs.com/}{\texttt{ npm}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/-\/save snapdragon-\/util }

\end{DoxyCode}


Install with \href{https://yarnpkg.com}{\texttt{ yarn}}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ yarn add snapdragon-\/util }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27470}{}\doxysection{Usage}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27470}

\begin{DoxyCode}{0}
\DoxyCodeLine{var util = require('snapdragon-\/util'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27471}{}\doxysection{API}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27471}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27472}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L21\char`\"{}$>$.\+is\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27472}
Returns true if the given value is a node.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var node = new Node(\{type: 'foo'\});}
\DoxyCodeLine{console.log(utils.isNode(node)); //=> true}
\DoxyCodeLine{console.log(utils.isNode(\{\})); //=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27473}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L37\char`\"{}$>$.\+noop$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27473}
Emit an empty string for the given {\ttfamily node}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{undefined\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{// do nothing for beginning-\/of-\/string}
\DoxyCodeLine{snapdragon.compiler.set('bos', utils.noop); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27474}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L53\char`\"{}$>$.\+identity$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27474}
Appdend {\ttfamily node.\+val} to {\ttfamily compiler.\+output}, exactly as it was created by the parser.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{undefined\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{snapdragon.compiler.set('text', utils.identity); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27475}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L76\char`\"{}$>$.\+append$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27475}
Previously named {\ttfamily .emit}, this method appends the given {\ttfamily val} to {\ttfamily compiler.\+output} for the given node. Useful when you know what value should be appended advance, regardless of the actual value of {\ttfamily node.\+val}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Returns a compiler middleware function.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{snapdragon.compiler}
\DoxyCodeLine{  .set('i', function(node) \{}
\DoxyCodeLine{    this.mapVisit(node);}
\DoxyCodeLine{  \})}
\DoxyCodeLine{  .set('i.open', utils.append('<i>'))}
\DoxyCodeLine{  .set('i.close', utils.append('</i>')) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27476}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L99\char`\"{}$>$.\+to\+Noop$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27476}
Used in compiler middleware, this onverts an AST node into an empty {\ttfamily text} node and deletes {\ttfamily node.\+nodes} if it exists. The advantage of this method is that, as opposed to completely removing the node, indices will not need to be re-\/calculated in sibling nodes, and nothing is appended to the output.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily nodes} $\ast$$\ast$\{Array\}$\ast$$\ast$\+: Optionally pass a new {\ttfamily nodes} value, to replace the existing {\ttfamily node.\+nodes} array.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{utils.toNoop(node);}
\DoxyCodeLine{// convert `node.nodes` to the given value instead of deleting it}
\DoxyCodeLine{utils.toNoop(node, []); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27477}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L128\char`\"{}$>$.\+visit$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27477}
Visit {\ttfamily node} with the given {\ttfamily fn}. The built-\/in {\ttfamily .visit} method in snapdragon automatically calls registered compilers, this allows you to pass a visitor function.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily fn} $\ast$$\ast$\{Function\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: returns the node after recursively visiting all child nodes.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{snapdragon.compiler.set('i', function(node) \{}
\DoxyCodeLine{  utils.visit(node, function(childNode) \{}
\DoxyCodeLine{    // do stuff with "{}childNode"{}}
\DoxyCodeLine{    return childNode;}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27478}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L155\char`\"{}$>$.\+map\+Visit$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27478}
Map \href{\#visit}{\texttt{ visit}} the given {\ttfamily fn} over {\ttfamily node.\+nodes}. This is called by \href{\#visit}{\texttt{ visit}}, use this method if you do not want {\ttfamily fn} to be called on the first node.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily options} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily fn} $\ast$$\ast$\{Function\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: returns the node
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{snapdragon.compiler.set('i', function(node) \{}
\DoxyCodeLine{  utils.mapVisit(node, function(childNode) \{}
\DoxyCodeLine{    // do stuff with "{}childNode"{}}
\DoxyCodeLine{    return childNode;}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27479}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L194\char`\"{}$>$.\+add\+Open$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27479}
Unshift an {\ttfamily $\ast$.open} node onto {\ttfamily node.\+nodes}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily Node} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: (required) Node constructor function from \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}.
\item {\ttfamily filter} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Optionaly specify a filter function to exclude the node.
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Returns the created opening node.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{snapdragon.parser.set('brace', function(node) \{}
\DoxyCodeLine{  var match = this.match(/\string^\{/);}
\DoxyCodeLine{  if (match) \{}
\DoxyCodeLine{    var parent = new Node(\{type: 'brace'\});}
\DoxyCodeLine{    utils.addOpen(parent, Node);}
\DoxyCodeLine{    console.log(parent.nodes[0]):}
\DoxyCodeLine{    // \{ type: 'brace.open', val: '' \};}
\DoxyCodeLine{}
\DoxyCodeLine{    // push the parent "{}brace"{} node onto the stack}
\DoxyCodeLine{    this.push(parent);}
\DoxyCodeLine{}
\DoxyCodeLine{    // return the parent node, so it's also added to the AST}
\DoxyCodeLine{    return brace;}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27480}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L244\char`\"{}$>$.\+add\+Close$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27480}
Push a {\ttfamily $\ast$.close} node onto {\ttfamily node.\+nodes}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily Node} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: (required) Node constructor function from \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}.
\item {\ttfamily filter} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Optionaly specify a filter function to exclude the node.
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Returns the created closing node.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{snapdragon.parser.set('brace', function(node) \{}
\DoxyCodeLine{  var match = this.match(/\string^\}/);}
\DoxyCodeLine{  if (match) \{}
\DoxyCodeLine{    var parent = this.parent();}
\DoxyCodeLine{    if (parent.type !== 'brace') \{}
\DoxyCodeLine{      throw new Error('missing opening: ' + '\}');}
\DoxyCodeLine{    \}}
\DoxyCodeLine{}
\DoxyCodeLine{    utils.addClose(parent, Node);}
\DoxyCodeLine{    console.log(parent.nodes[parent.nodes.length -\/ 1]):}
\DoxyCodeLine{    // \{ type: 'brace.close', val: '' \};}
\DoxyCodeLine{}
\DoxyCodeLine{    // no need to return a node, since the parent}
\DoxyCodeLine{    // was already added to the AST}
\DoxyCodeLine{    return;}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27481}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L274\char`\"{}$>$.\+wrap\+Nodes$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27481}
Wraps the given {\ttfamily node} with {\ttfamily $\ast$.open} and {\ttfamily $\ast$.close} nodes.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily Node} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: (required) Node constructor function from \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}.
\item {\ttfamily filter} $\ast$$\ast$\{Function\}$\ast$$\ast$\+: Optionaly specify a filter function to exclude the node.
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Returns the node
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27482}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L299\char`\"{}$>$.\+push\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27482}
Push the given {\ttfamily node} onto {\ttfamily parent.\+nodes}, and set {\ttfamily parent} as \`{}node.parent.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily parent} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Returns the child node
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var parent = new Node(\{type: 'foo'\});}
\DoxyCodeLine{var node = new Node(\{type: 'bar'\});}
\DoxyCodeLine{utils.pushNode(parent, node);}
\DoxyCodeLine{console.log(parent.nodes[0].type) // 'bar'}
\DoxyCodeLine{console.log(node.parent.type) // 'foo' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27483}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L325\char`\"{}$>$.\+unshift\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27483}
Unshift {\ttfamily node} onto {\ttfamily parent.\+nodes}, and set {\ttfamily parent} as \`{}node.parent.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily parent} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{undefined\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var parent = new Node(\{type: 'foo'\});}
\DoxyCodeLine{var node = new Node(\{type: 'bar'\});}
\DoxyCodeLine{utils.unshiftNode(parent, node);}
\DoxyCodeLine{console.log(parent.nodes[0].type) // 'bar'}
\DoxyCodeLine{console.log(node.parent.type) // 'foo' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27484}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L354\char`\"{}$>$.\+pop\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27484}
Pop the last {\ttfamily node} off of {\ttfamily parent.\+nodes}. The advantage of using this method is that it checks for {\ttfamily node.\+nodes} and works with any version of {\ttfamily snapdragon-\/node}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily parent} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Number$\vert$\+Undefined\}$\ast$$\ast$\+: Returns the length of {\ttfamily node.\+nodes} or undefined.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var parent = new Node(\{type: 'foo'\});}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'foo'\}));}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'bar'\}));}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'baz'\}));}
\DoxyCodeLine{console.log(parent.nodes.length); //=> 3}
\DoxyCodeLine{utils.popNode(parent);}
\DoxyCodeLine{console.log(parent.nodes.length); //=> 2 }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27485}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L382\char`\"{}$>$.\+shift\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27485}
Shift the first {\ttfamily node} off of {\ttfamily parent.\+nodes}. The advantage of using this method is that it checks for {\ttfamily node.\+nodes} and works with any version of {\ttfamily snapdragon-\/node}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily parent} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Number$\vert$\+Undefined\}$\ast$$\ast$\+: Returns the length of {\ttfamily node.\+nodes} or undefined.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var parent = new Node(\{type: 'foo'\});}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'foo'\}));}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'bar'\}));}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'baz'\}));}
\DoxyCodeLine{console.log(parent.nodes.length); //=> 3}
\DoxyCodeLine{utils.shiftNode(parent);}
\DoxyCodeLine{console.log(parent.nodes.length); //=> 2 }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27486}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L409\char`\"{}$>$.\+remove\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27486}
Remove the specified {\ttfamily node} from {\ttfamily parent.\+nodes}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily parent} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Object$\vert$undefined\}$\ast$$\ast$\+: Returns the removed node, if successful, or undefined if it does not exist on {\ttfamily parent.\+nodes}.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var parent = new Node(\{type: 'abc'\});}
\DoxyCodeLine{var foo = new Node(\{type: 'foo'\});}
\DoxyCodeLine{utils.pushNode(parent, foo);}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'bar'\}));}
\DoxyCodeLine{utils.pushNode(parent, new Node(\{type: 'baz'\}));}
\DoxyCodeLine{console.log(parent.nodes.length); //=> 3}
\DoxyCodeLine{utils.removeNode(parent, foo);}
\DoxyCodeLine{console.log(parent.nodes.length); //=> 2 }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27487}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L443\char`\"{}$>$.\+is\+Type$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27487}
Returns true if {\ttfamily node.\+type} matches the given {\ttfamily type}. Throws a {\ttfamily Type\+Error} if {\ttfamily node} is not an instance of {\ttfamily Node}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily type} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var node = new Node(\{type: 'foo'\});}
\DoxyCodeLine{console.log(utils.isType(node, 'foo')); // false}
\DoxyCodeLine{console.log(utils.isType(node, 'bar')); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27488}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L486\char`\"{}$>$.\+has\+Type$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27488}
Returns true if the given {\ttfamily node} has the given {\ttfamily type} in {\ttfamily node.\+nodes}. Throws a {\ttfamily Type\+Error} if {\ttfamily node} is not an instance of {\ttfamily Node}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily type} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var node = new Node(\{}
\DoxyCodeLine{  type: 'foo',}
\DoxyCodeLine{  nodes: [}
\DoxyCodeLine{    new Node(\{type: 'bar'\}),}
\DoxyCodeLine{    new Node(\{type: 'baz'\})}
\DoxyCodeLine{  ]}
\DoxyCodeLine{\});}
\DoxyCodeLine{console.log(utils.hasType(node, 'xyz')); // false}
\DoxyCodeLine{console.log(utils.hasType(node, 'baz')); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27489}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L519\char`\"{}$>$.\+first\+Of\+Type$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27489}
Returns the first node from {\ttfamily node.\+nodes} of the given {\ttfamily type}

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily nodes} $\ast$$\ast$\{Array\}$\ast$$\ast$
\item {\ttfamily type} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Object$\vert$undefined\}$\ast$$\ast$\+: Returns the first matching node or undefined.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var node = new Node(\{}
\DoxyCodeLine{  type: 'foo',}
\DoxyCodeLine{  nodes: [}
\DoxyCodeLine{    new Node(\{type: 'text', val: 'abc'\}),}
\DoxyCodeLine{    new Node(\{type: 'text', val: 'xyz'\})}
\DoxyCodeLine{  ]}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{var textNode = utils.firstOfType(node.nodes, 'text');}
\DoxyCodeLine{console.log(textNode.val);}
\DoxyCodeLine{//=> 'abc' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27490}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L556\char`\"{}$>$.\+find\+Node$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27490}
Returns the node at the specified index, or the first node of the given {\ttfamily type} from {\ttfamily node.\+nodes}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily nodes} $\ast$$\ast$\{Array\}$\ast$$\ast$
\item {\ttfamily type} $\ast$$\ast$\{String$\vert$\+Number\}$\ast$$\ast$\+: Node type or index.
\item {\ttfamily returns} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Returns a node or undefined.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var node = new Node(\{}
\DoxyCodeLine{  type: 'foo',}
\DoxyCodeLine{  nodes: [}
\DoxyCodeLine{    new Node(\{type: 'text', val: 'abc'\}),}
\DoxyCodeLine{    new Node(\{type: 'text', val: 'xyz'\})}
\DoxyCodeLine{  ]}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{var nodeOne = utils.findNode(node.nodes, 'text');}
\DoxyCodeLine{console.log(nodeOne.val);}
\DoxyCodeLine{//=> 'abc'}
\DoxyCodeLine{}
\DoxyCodeLine{var nodeTwo = utils.findNode(node.nodes, 1);}
\DoxyCodeLine{console.log(nodeTwo.val);}
\DoxyCodeLine{//=> 'xyz' }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27491}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L584\char`\"{}$>$.\+is\+Open$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27491}
Returns true if the given node is an \char`\"{}$\ast$.\+open\char`\"{} node.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var brace = new Node(\{type: 'brace'\});}
\DoxyCodeLine{var open = new Node(\{type: 'brace.open'\});}
\DoxyCodeLine{var close = new Node(\{type: 'brace.close'\});}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(utils.isOpen(brace)); // false}
\DoxyCodeLine{console.log(utils.isOpen(open)); // true}
\DoxyCodeLine{console.log(utils.isOpen(close)); // false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27492}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L607\char`\"{}$>$.\+is\+Close$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27492}
Returns true if the given node is a \char`\"{}$\ast$.\+close\char`\"{} node.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var brace = new Node(\{type: 'brace'\});}
\DoxyCodeLine{var open = new Node(\{type: 'brace.open'\});}
\DoxyCodeLine{var close = new Node(\{type: 'brace.close'\});}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(utils.isClose(brace)); // false}
\DoxyCodeLine{console.log(utils.isClose(open)); // false}
\DoxyCodeLine{console.log(utils.isClose(close)); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27493}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L633\char`\"{}$>$.\+has\+Open$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27493}
Returns true if {\ttfamily node.\+nodes} {\bfseries{has}} an {\ttfamily .open} node

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var brace = new Node(\{}
\DoxyCodeLine{  type: 'brace',}
\DoxyCodeLine{  nodes: []}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{var open = new Node(\{type: 'brace.open'\});}
\DoxyCodeLine{console.log(utils.hasOpen(brace)); // false}
\DoxyCodeLine{}
\DoxyCodeLine{brace.pushNode(open);}
\DoxyCodeLine{console.log(utils.hasOpen(brace)); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27494}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L663\char`\"{}$>$.\+has\+Close$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27494}
Returns true if {\ttfamily node.\+nodes} {\bfseries{has}} a {\ttfamily .close} node

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var brace = new Node(\{}
\DoxyCodeLine{  type: 'brace',}
\DoxyCodeLine{  nodes: []}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{var close = new Node(\{type: 'brace.close'\});}
\DoxyCodeLine{console.log(utils.hasClose(brace)); // false}
\DoxyCodeLine{}
\DoxyCodeLine{brace.pushNode(close);}
\DoxyCodeLine{console.log(utils.hasClose(brace)); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27495}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L697\char`\"{}$>$.\+has\+Open\+And\+Close$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27495}
Returns true if {\ttfamily node.\+nodes} has both {\ttfamily .open} and {\ttfamily .close} nodes

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var Node = require('snapdragon-\/node');}
\DoxyCodeLine{var brace = new Node(\{}
\DoxyCodeLine{  type: 'brace',}
\DoxyCodeLine{  nodes: []}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{var open = new Node(\{type: 'brace.open'\});}
\DoxyCodeLine{var close = new Node(\{type: 'brace.close'\});}
\DoxyCodeLine{console.log(utils.hasOpen(brace)); // false}
\DoxyCodeLine{console.log(utils.hasClose(brace)); // false}
\DoxyCodeLine{}
\DoxyCodeLine{brace.pushNode(open);}
\DoxyCodeLine{brace.pushNode(close);}
\DoxyCodeLine{console.log(utils.hasOpen(brace)); // true}
\DoxyCodeLine{console.log(utils.hasClose(brace)); // true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27496}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L719\char`\"{}$>$.\+add\+Type$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27496}
Push the given {\ttfamily node} onto the {\ttfamily state.\+inside} array for the given type. This array is used as a specialized \char`\"{}stack\char`\"{} for only the given {\ttfamily node.\+type}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily state} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: The {\ttfamily compiler.\+state} object or custom state object.
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Array\}$\ast$$\ast$\+: Returns the {\ttfamily state.\+inside} stack for the given type.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var state = \{ inside: \{\}\};}
\DoxyCodeLine{var node = new Node(\{type: 'brace'\});}
\DoxyCodeLine{utils.addType(state, node);}
\DoxyCodeLine{console.log(state.inside);}
\DoxyCodeLine{//=> \{ brace: [\{type: 'brace'\}] \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27497}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L759\char`\"{}$>$.\+remove\+Type$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27497}
Remove the given {\ttfamily node} from the {\ttfamily state.\+inside} array for the given type. This array is used as a specialized \char`\"{}stack\char`\"{} for only the given {\ttfamily node.\+type}.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily state} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: The {\ttfamily compiler.\+state} object or custom state object.
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily returns} $\ast$$\ast$\{Array\}$\ast$$\ast$\+: Returns the {\ttfamily state.\+inside} stack for the given type.
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var state = \{ inside: \{\}\};}
\DoxyCodeLine{var node = new Node(\{type: 'brace'\});}
\DoxyCodeLine{utils.addType(state, node);}
\DoxyCodeLine{console.log(state.inside);}
\DoxyCodeLine{//=> \{ brace: [\{type: 'brace'\}] \}}
\DoxyCodeLine{utils.removeType(state, node);}
\DoxyCodeLine{//=> \{ brace: [] \} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27498}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L788\char`\"{}$>$.\+is\+Empty$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27498}
Returns true if {\ttfamily node.\+val} is an empty string, or {\ttfamily node.\+nodes} does not contain any non-\/empty text nodes.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily fn} $\ast$$\ast$\{Function\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var node = new Node(\{type: 'text'\});}
\DoxyCodeLine{utils.isEmpty(node); //=> true}
\DoxyCodeLine{node.val = 'foo';}
\DoxyCodeLine{utils.isEmpty(node); //=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27499}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L833\char`\"{}$>$.\+is\+Inside\+Type$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27499}
Returns true if the {\ttfamily state.\+inside} stack for the given type exists and has one or more nodes on it.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily state} $\ast$$\ast$\{Object\}$\ast$$\ast$
\item {\ttfamily type} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var state = \{ inside: \{\}\};}
\DoxyCodeLine{var node = new Node(\{type: 'brace'\});}
\DoxyCodeLine{console.log(utils.isInsideType(state, 'brace')); //=> false}
\DoxyCodeLine{utils.addType(state, node);}
\DoxyCodeLine{console.log(utils.isInsideType(state, 'brace')); //=> true}
\DoxyCodeLine{utils.removeType(state, node);}
\DoxyCodeLine{console.log(utils.isInsideType(state, 'brace')); //=> false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27500}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L867\char`\"{}$>$.\+is\+Inside$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27500}
Returns true if {\ttfamily node} is either a child or grand-\/child of the given {\ttfamily type}, or {\ttfamily state.\+inside\mbox{[}type\mbox{]}} is a non-\/empty array.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily state} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Either the {\ttfamily compiler.\+state} object, if it exists, or a user-\/supplied state object.
\item {\ttfamily node} $\ast$$\ast$\{Object\}$\ast$$\ast$\+: Instance of \href{https://github.com/jonschlinkert/snapdragon-node}{\texttt{ snapdragon-\/node}}
\item {\ttfamily type} $\ast$$\ast$\{String\}$\ast$$\ast$\+: The {\ttfamily node.\+type} to check for.
\item {\ttfamily returns} $\ast$$\ast$\{Boolean\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var state = \{ inside: \{\}\};}
\DoxyCodeLine{var node = new Node(\{type: 'brace'\});}
\DoxyCodeLine{var open = new Node(\{type: 'brace.open'\});}
\DoxyCodeLine{console.log(utils.isInside(state, open, 'brace')); //=> false}
\DoxyCodeLine{utils.pushNode(node, open);}
\DoxyCodeLine{console.log(utils.isInside(state, open, 'brace')); //=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27501}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L915\char`\"{}$>$.\+last$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27501}
Get the last {\ttfamily n} element from the given {\ttfamily array}. Used for getting a node from {\ttfamily node.\+nodes.}

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily array} $\ast$$\ast$\{Array\}$\ast$$\ast$
\item {\ttfamily n} $\ast$$\ast$\{Number\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{undefined\}$\ast$$\ast$
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27502}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L935\char`\"{}$>$.\+arrayify$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27502}
Cast the given {\ttfamily val} to an array.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily val} $\ast$$\ast$\{any\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Array\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{console.log(utils.arraify(''));}
\DoxyCodeLine{//=> []}
\DoxyCodeLine{console.log(utils.arraify('foo'));}
\DoxyCodeLine{//=> ['foo']}
\DoxyCodeLine{console.log(utils.arraify(['foo']));}
\DoxyCodeLine{//=> ['foo'] }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27503}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L948\char`\"{}$>$.\+stringify$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27503}
Convert the given {\ttfamily val} to a string by joining with {\ttfamily ,}. Useful for creating a cheerio/\+CSS/\+DOM-\/style selector from a list of strings.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily val} $\ast$$\ast$\{any\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{Array\}$\ast$$\ast$
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27504}{}\doxysubsection{$<$a href=\char`\"{}index.\+js\#\+L961\char`\"{}$>$.\+trim$<$/a$>$}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27504}
Ensure that the given value is a string and call {\ttfamily .trim()} on it, or return an empty string.

{\bfseries{Params}}


\begin{DoxyItemize}
\item {\ttfamily str} $\ast$$\ast$\{String\}$\ast$$\ast$
\item {\ttfamily returns} $\ast$$\ast$\{String\}$\ast$$\ast$
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27505}{}\doxysection{Release history}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27505}
Changelog entries are classified using the following labels from \href{https://github.com/olivierlacan/keep-a-changelog}{\texttt{ keep-\/a-\/changelog}}\+:


\begin{DoxyItemize}
\item {\ttfamily added}\+: for new features
\item {\ttfamily changed}\+: for changes in existing functionality
\item {\ttfamily deprecated}\+: for once-\/stable features removed in upcoming releases
\item {\ttfamily removed}\+: for deprecated features removed in this release
\item {\ttfamily fixed}\+: for any bug fixes
\end{DoxyItemize}

Custom labels used in this changelog\+:


\begin{DoxyItemize}
\item {\ttfamily dependencies}\+: bumps dependencies
\item {\ttfamily housekeeping}\+: code re-\/organization, minor edits, or other changes that don\textquotesingle{}t fit in one of the other categories.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27506}{}\doxysubsection{\mbox{[}3.\+0.\+0\mbox{]} -\/ 2017-\/05-\/01}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27506}
{\bfseries{Changed}}


\begin{DoxyItemize}
\item {\ttfamily .emit} was renamed to \href{\#append}{\texttt{ .append}}
\item {\ttfamily .add\+Node} was renamed to \href{\#pushNode}{\texttt{ .push\+Node}}
\item {\ttfamily .get\+Node} was renamed to \href{\#findNode}{\texttt{ .find\+Node}}
\item {\ttfamily .is\+Empty\+Nodes} was renamed to \href{\#isEmpty}{\texttt{ .is\+Empty}}\+: also now works with {\ttfamily node.\+nodes} and/or {\ttfamily node.\+val}
\end{DoxyItemize}

{\bfseries{Added}}


\begin{DoxyItemize}
\item \href{\#identity}{\texttt{ .identity}}
\item \href{\#removeNode}{\texttt{ .remove\+Node}}
\item \href{\#shiftNode}{\texttt{ .shift\+Node}}
\item \href{\#popNode}{\texttt{ .pop\+Node}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27507}{}\doxysubsection{\mbox{[}0.\+1.\+0\mbox{]}}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27507}
First release.\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27508}{}\doxysection{About}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27508}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27509}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27509}
Pull requests and stars are always welcome. For bugs and feature requests, \href{../../issues/new}{\texttt{ please create an issue}}.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27510}{}\doxysubsection{Building docs}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27510}
\+\_\+(This project\textquotesingle{}s readme.\+md is generated by \href{https://github.com/verbose/verb-generate-readme}{\texttt{ verb}}, please don\textquotesingle{}t edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)\+\_\+

To generate the readme, run the following command\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/g verbose/verb\#dev verb-\/generate-\/readme \&\& verb }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27511}{}\doxysubsection{Running tests}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27511}
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install \&\& npm test }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27512}{}\doxysubsection{Author}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27512}
{\bfseries{Jon Schlinkert}}


\begin{DoxyItemize}
\item \href{https://github.com/jonschlinkert}{\texttt{ github/jonschlinkert}}
\item \href{https://twitter.com/jonschlinkert}{\texttt{ twitter/jonschlinkert}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27513}{}\doxysubsection{License}\label{md_sfcode_node_modules_snapdragon_util_README_autotoc_md27513}
Copyright © 2017, \href{https://github.com/jonschlinkert}{\texttt{ Jon Schlinkert}}. Released under the \mbox{[}MIT License\mbox{]}(LICENSE).

\DoxyHorRuler{0}


{\itshape This file was generated by \href{https://github.com/verbose/verb-generate-readme}{\texttt{ verb-\/generate-\/readme}}, v0.\+6.\+0, on May 01, 2017.} 