replaces method

Iterable<E> replaces(
  1. Map<E, E> replacements
)

replace the old elements contained in the map with new ones.

Implementation

Iterable<E> replaces(Map<E, E> replacements) {
  return map((item) => replacements[item] ?? item);
}