// 内库使用-start
import ArrayUtil from "../../../../../utils/ArrayUtil";
// 内库使用-end

/* 测试使用-start
import { ArrayUtil } from 'seedsui-react'
测试使用-end */

// 判断是否在list中，在list中被认为是省市区，不在则是街道
function testNodeData(current, list) {
  var _node$type, _node$type$includes, _node$type2, _node$type2$includes;
  if (!(current !== null && current !== void 0 && current.id) || !Array.isArray(list) || !(list !== null && list !== void 0 && list.length)) return null;
  var node = ArrayUtil.getDeepTreeNode(list, current.id);
  if (node !== null && node !== void 0 && node.isStreet || node !== null && node !== void 0 && (_node$type = node.type) !== null && _node$type !== void 0 && (_node$type$includes = _node$type.includes) !== null && _node$type$includes !== void 0 && _node$type$includes.call(_node$type, 'street')) return 'street';
  if (node !== null && node !== void 0 && node.isDistrict || node !== null && node !== void 0 && (_node$type2 = node.type) !== null && _node$type2 !== void 0 && (_node$type2$includes = _node$type2.includes) !== null && _node$type2$includes !== void 0 && _node$type2$includes.call(_node$type2, 'district')) return 'district';
  return null;
}
export default testNodeData;