/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

function hasChildren(item) {
  var _item$children;
  return (item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.filter(c => c.path).length) > 0;
}
function findParents(treeData, id) {
  if (treeData.length === 0) return;
  for (let i = 0; i < treeData.length; i++) {
    if (treeData[i].path === id) {
      return [];
    } else {
      if (treeData[i].children) {
        const res = findParents(treeData[i].children, id);
        if (res !== void 0) return res.concat(treeData[i].path);
      }
    }
  }
}

export { findParents, hasChildren };
//# sourceMappingURL=utils.js.map
