deepReplaceMapValues<T> function
Replaces values applying replacer
to values that matches filter
.
Implementation
void deepReplaceMapValues<T>(
Map? map, ValueFilter filter, ValueReplacer replacer) {
if (map == null || map.isEmpty) return;
for (var entry in map.entries) {
var k = entry.key;
var v = entry.value;
if (filter(map, k, v)) {
map[k] = replacer(map, k, v);
} else {
map[k] = deepReplaceValues(v, filter, replacer);
}
}
}