function hasValue(map, val, valueEqualityFn = defaultEqualityFn) {
  for (const v of map.values()) {
    if (valueEqualityFn(v, val)) return true;
  }
  return false;
}
Determines if a given map contains the given value, optionally using
a custom comparison function.
@param {!MapLike<?,V1>} map The map whose values to check.
@param {V2} val The value to check for.
@param {(function(V1,V2): boolean)=} valueEqualityFn The comparison function
    used to determine if the given value is equivalent to any of the values
    in the map. If no function is provided, defaults to strict equality
    (===).
@return {boolean} True iff the given map contains the given value according
    to the comparison function.
@template V1,V2