/**
 * @description 数组对象去重
 * @param {Array} arr 去重的数组
 * @param {string} name 去重的key
 * @return {Array} 去重后的数组
 **/
export function arrayObjectDeduplication(arr, name) {
  const obj = {};
  arr = arr.reduce(function (previousValue, currentValue) {
    if (!obj[currentValue[name]]) {
      obj[currentValue[name]] = true;
      previousValue.push(currentValue);
    }
    return previousValue;
  }, []);
  return arr;
}
