recurseMapper function

dynamic recurseMapper(
  1. dynamic value,
  2. Map<String, PropertyMapper> mappings
)

Implementation

dynamic recurseMapper(dynamic value, Map<String, PropertyMapper> mappings) {
  if (value is List) {
    return value.map((value) => recurseMapper(value, mappings));
  } else if (value is Map<String, dynamic>) {
    return mapProperties(value, mappings);
  } else if (value is Map) {
    return value
        .map((key, value) => MapEntry(key, recurseMapper(value, mappings)));
  } else {
    return value;
  }
}