cleanUpObject method

dynamic cleanUpObject(
  1. dynamic parsedObject
)

Implementation

dynamic cleanUpObject(dynamic parsedObject) {
  if (parsedObject is List) {
    return parsedObject.map((e) => cleanUpObject(e)).toList();
  } else if (parsedObject is Map) {
    return parsedObject.map((key, value) {
      return MapEntry(key.toString(), cleanUpObject(value));
    });
  } else {
    return parsedObject.toString();
  }
}