checkIfResource function
Implementation
Map<String, dynamic> checkIfResource(
Map<String, dynamic> oldValue, String oldType) {
if (oldValue.keys.length == 1 &&
resourceTypeFromStringMap.keys.contains(oldValue.keys.first) &&
oldValue.values.first is Map) {
oldType = oldValue.keys.first;
oldValue = oldValue.values.first as Map<String, dynamic>;
oldValue['resourceType'] = oldType;
}
return <String, dynamic>{oldType: oldValue};
}