src/module/helpers.js
function getAllChildSpans(node) {
  return (
    Array.isArray(node.children)
      ? node.children
          .map(n => (n.spans || []).concat(getAllChildSpans(n)))
          .reduce((all, arr) => all.concat(arr))
      : []
  );
}
function getAllChildSpans(node) {
  return (
    Array.isArray(node.children)
      ? node.children
          .map(n => (n.spans || []).concat(getAllChildSpans(n)))
          .reduce((all, arr) => all.concat(arr))
      : []
  );
}
function getAllChildSpans ( node ) { return ( Array . isArray ( node . children ) ? node . children . map ( n => ( n . spans || [ ] ) . concat ( getAllChildSpans ( n ) ) ) . reduce ( ( all , arr ) => all . concat ( arr ) ) : [ ] ) ; }
Returns all children of the provided node, including those that are descendents of the node's
children.

@param  {Node}   node
@return {Span[]}
Returns all children of the provided node including those that are descendents of the node s children .