import { TreeType } from "../type";

/**
 * 补充原生state上的属性
 * @param state 
 */
export function addOldState(state) {
  var result = {
    label: '自定义state',
    key: 'state',
    type: TreeType.state,
    children: []
  };
  Object.keys(state).forEach(function (item) {
    var _result$children;
    (_result$children = result.children) === null || _result$children === void 0 ? void 0 : _result$children.push({
      label: item,
      key: item,
      type: TreeType.stateItem
    });
  });
  return result;
}