function toObject(map) {
  const /** !Object<K,V> */ obj = {};
  for (const key of map.keys()) {
    obj[key] = map.get(key);
  }
  return obj;
}
ToObject returns a new object whose properties are the keys from the Map.
@param {!MapLike<K,V>} map The map to convert into an object.
@return {!Object<K,V>} An object representation of the Map.
@template K,V