node_modules/ant-design-vue/es/vc-tree/utils/treeUtil.js
/**
 * Convert `treeData` into entity records.
 */
Convert `treeData` into entity records.
Convert ` treeData ` into entity records .
function convertDataToEntities(dataNodes) {
  var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
      initWrapper = _ref2.initWrapper,
      processEntity = _ref2.processEntity,
      onProcessFinished = _ref2.onProcessFinished,
      externalGetKey = _ref2.externalGetKey,
      childrenPropName = _ref2.childrenPropName,
      fieldNames = _ref2.fieldNames;
  var
  legacyExternalGetKey = arguments.length > 2 ? arguments[2] : undefined;
  var mergedExternalGetKey = externalGetKey || legacyExternalGetKey;
  var posEntities = {};
  var keyEntities = {};
  var wrapper = {
    posEntities: posEntities,
    keyEntities: keyEntities
  };
  if (initWrapper) {
    wrapper = initWrapper(wrapper) || wrapper;
  }
  traverseDataNodes(dataNodes, function (item) {
    var node = item.node,
        index = item.index,
        pos = item.pos,
        key = item.key,
        parentPos = item.parentPos,
        level = item.level,
        nodes = item.nodes;
    var entity = {
      node: node,
      nodes: nodes,
      index: index,
      key: key,
      pos: pos,
      level: level
    };
    var mergedKey = getKey(key, pos);
    posEntities[pos] = entity;
    keyEntities[mergedKey] = entity; 
    entity.parent = posEntities[parentPos];
    if (entity.parent) {
      entity.parent.children = entity.parent.children || [];
      entity.parent.children.push(entity);
    }
    if (processEntity) {
      processEntity(entity, wrapper);
    }
  }, {
    externalGetKey: mergedExternalGetKey,
    childrenPropName: childrenPropName,
    fieldNames: fieldNames
  });
  if (onProcessFinished) {
    onProcessFinished(wrapper);
  }
  return wrapper;
}
function convertDataToEntities ( dataNodes ) { var _ref2 = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } , initWrapper = _ref2 . initWrapper , processEntity = _ref2 . processEntity , onProcessFinished = _ref2 . onProcessFinished , externalGetKey = _ref2 . externalGetKey , childrenPropName = _ref2 . childrenPropName , fieldNames = _ref2 . fieldNames ; var legacyExternalGetKey = arguments . length > 2 ? arguments [ 2 ] : undefined ; var mergedExternalGetKey = externalGetKey || legacyExternalGetKey ; var posEntities = { } ; var keyEntities = { } ; var wrapper = { posEntities : posEntities , keyEntities : keyEntities } ; if ( initWrapper ) { wrapper = initWrapper ( wrapper ) || wrapper ; } traverseDataNodes ( dataNodes , function ( item ) { var node = item . node , index = item . index , pos = item . pos , key = item . key , parentPos = item . parentPos , level = item . level , nodes = item . nodes ; var entity = { node : node , nodes : nodes , index : index , key : key , pos : pos , level : level } ; var mergedKey = getKey ( key , pos ) ; posEntities [ pos ] = entity ; keyEntities [ mergedKey ] = entity ; entity . parent = posEntities [ parentPos ] ; if ( entity . parent ) { entity . parent . children = entity . parent . children || [ ] ; entity . parent . children . push ( entity ) ; } if ( processEntity ) { processEntity ( entity , wrapper ) ; } } , { externalGetKey : mergedExternalGetKey , childrenPropName : childrenPropName , fieldNames : fieldNames } ) ; if ( onProcessFinished ) { onProcessFinished ( wrapper ) ; } return wrapper ; }
Convert `treeData` into entity records.
Convert ` treeData ` into entity records .
/** @deprecated Use `config.externalGetKey` instead */ // Init config // Fill children