function reduceToLeafNodes(nodes = []) {
  return nodes.reduce((ary, node) => {
    if (Array.isArray(node.children)) {
      ary.push(...reduceToLeafNodes(node.children));
      return ary;
    }
    ary.push(node);
    return ary;
  }, []);
}
/**
 * Flatten the array of nodes by removing any containers as they do not support styling, thus unable to brush them.
 * @param {array} nodes
 * @ignore
 */
Flatten the array of nodes by removing any containers as they do not support styling, thus unable to brush them.
@param {array} nodes
@ignore
Flatten the array of nodes by removing any containers as they do not support styling thus unable to brush them . @param { array } nodes @ignore
function reduceToLeafNodes(nodes = []) {
  return nodes.reduce((ary, node) => {
    if (Array.isArray(node.children)) {
      ary.push(...reduceToLeafNodes(node.children));
      return ary;
    }
    ary.push(node);
    return ary;
  }, []);
}
function reduceToLeafNodes ( nodes = [ ] ) { return nodes . reduce ( ( ary , node ) => { if ( Array . isArray ( node . children ) ) { ary . push ( ... reduceToLeafNodes ( node . children ) ) ; return ary ; } ary . push ( node ) ; return ary ; } , [ ] ) ; }
Flatten the array of nodes by removing any containers as they do not support styling, thus unable to brush them.
Flatten the array of nodes by removing any containers as they do not support styling thus unable to brush them .