/**
 * tdesign v0.32.0
 * (c) 2021 tdesign
 * @license MIT
 */

import _typeof from '@babel/runtime/helpers/typeof';

function getFullPathLabel(node) {
  return node.getPath().map(function (node2) {
    return node2.label;
  }).join("/");
}
var getTreeValue = function getTreeValue(value) {
  var treeValue = [];

  if (Array.isArray(value)) {
    if (value.length > 0 && _typeof(value[0]) === "object") {
      treeValue = value.map(function (val) {
        return val.value;
      });
    } else if (value.length) {
      treeValue = value;
    }
  } else if (value) {
    if (_typeof(value) === "object") {
      treeValue = [value.value];
    } else {
      treeValue = [value];
    }
  }

  return treeValue;
};
var helper = {
  getFullPathLabel: getFullPathLabel
};

export { helper as default, getFullPathLabel, getTreeValue };
//# sourceMappingURL=helper.js.map
