map<RK, RV> method

IMapOfSets<RK, RV> map<RK, RV>(
  1. MapEntry<RK, ISet<RV>> mapper(
    1. K key,
    2. ISet<V> set
    ), {
  2. ConfigMapOfSets? config,
})

Returns a new map where all entries of this map are transformed by the given mapper function. You may provide a config, otherwise it will be the same as the original map.

Implementation

IMapOfSets<RK, RV> map<RK, RV>(
  MapEntry<RK, ISet<RV>> Function(K key, ISet<V> set) mapper, {
  ConfigMapOfSets? config,
}) {
  bool Function(RK key, ISet<RV> set)? ifRemove;
  if ((config ?? this.config).removeEmptySets) ifRemove = (RK key, ISet<RV> set) => set.isEmpty;

  return IMapOfSets<RK, RV>.from(
    _mapOfSets.map(mapper, ifRemove: ifRemove),
    config: config ?? this.config,
  );
}