toMap<T> function
Converts a dynamic json value into a map, using the provided transformer to convert
Implementation
Map<String, T> toMap<T>(value, DynTransformer<T> txr) {
if (value is Map) {
return value.map((key, item) {
return MapEntry("$key", txr(item));
});
} else {
throw ArgumentError("Expected map value");
}
}