removeFromMap function

void removeFromMap(
  1. Map<String, dynamic> map,
  2. List<String> keyPath
)

Removes a key from a map with the depth definded by List<String> keyPath and cleans up afterwards

Implementation

void removeFromMap(Map<String, dynamic> map, List<String> keyPath) {
  _deleteKey(map, [...keyPath]);
  _removeEmptyness(map, keyPath.sublist(0, keyPath.length - 1));
}