'use strict';

var vue = require('vue');
var TreeNode = require('./TreeNode.cjs');

const internalProcessProps = (props) => props;
function convertDataToTree(treeData, processor) {
  if (!treeData)
    return [];
  const {
    processProps = internalProcessProps
  } = processor || {};
  const list = Array.isArray(treeData) ? treeData : [treeData];
  return list.map(({
    children,
    ...props
  }) => {
    const childrenNodes = convertDataToTree(children, processor);
    return vue.createVNode(TreeNode.default, {
      "key": props.key,
      ...processProps(props)
    }, {
      default: () => [childrenNodes]
    });
  });
}

exports.convertDataToTree = convertDataToTree;
//# sourceMappingURL=convertDataToTree.cjs.map
