lookup method
Searches for a given path in the map.
Implementation
dynamic lookup(String path) {
JsonMap data = this;
final keys = path.trim().split(' ');
for (final entry in keys.asMap().entries) {
final isLastKey = entry.key == keys.length - 1;
final key = entry.value;
final value = data[key];
if (!isLastKey && value is Map) {
data = value.asJsonMap();
continue;
}
return value;
}
}