remap method

Map<K, V> remap(
  1. (K, V)? remapper(
    1. MapEntry<K, V>
    )
)

Implementation

Map<K, V> remap((K key, V value)? Function(MapEntry<K, V>) remapper) {
  Map<K, V> map = {};
  for (MapEntry<K, V> entry in entries) {
    (K key, V value)? newEntry = remapper(entry);
    if (newEntry != null) {
      map[newEntry.$1] = newEntry.$2;
    }
  }
  return map;
}