getMap<X> method

Map<String, X> getMap<X>(
  1. String path, [
  2. Map<String, X> defaultValue = const {}
])

Implementation

Map<String, X> getMap<X>(String path, [Map<String, X> defaultValue = const {}]) {
  dynamic value = get(path);
  if (value == null) return defaultValue;
  if (value is MapTraversable) return .from(value.data);
  if (value is! Map) return defaultValue;
  return .from(value);
}