code: function getFlatInternalNodes(node, nodes) {
    // @ts-ignore: children only on GmfGroup
    const children = node.children;
    if (children !== undefined) {
      nodes.push(node);
      for (let i = 0; i < children.length; i++) {
        getFlatInternalNodes(children[i], nodes);
      }
    }
  }
docs: Fill the given "nodes" array with all internal nodes (non-leaf nones) in the given node.
  
  @param {import('gmf/themes.js').GmfGroup|import('gmf/themes.js').GmfLayer} node Layertree node.
  @param {Array.<import('gmf/themes.js').GmfGroup|import('gmf/themes.js').GmfLayer>} nodes An array.
  @private
  @hidden