deserialize method
Implementation
dynamic deserialize(String jsonVal, String targetType) {
// Remove all spaces. Necessary for reg expressions as well.
targetType = targetType.replaceAll(' ', '');
if (targetType == 'String') {
return jsonVal;
}
final decodedJson = json.decode(jsonVal);
return _deserialize(decodedJson, targetType);
}