valueEnsureAsMap<KK, VV> method
Reads key and casts it to Map<KK, VV>.
Implementation
Map<KK, VV> valueEnsureAsMap<KK, VV>(
K key, {
Map<KK, VV> Function(BuError err)? onError,
Map<KK, VV> Function()? onMissing,
/// Only applicable when [K] is `String`.
bool normalizeKeyLookup = false,
}) {
try {
final value = _checkItem<Map>(key, onMissing, normalizeKeyLookup);
return JsonParser.valueEnsureAsMap<KK, VV>(value);
} on BuError catch (e) {
if (onError != null) return onError(e);
throw CoreErrors.jsonErrorWithKey(e, key);
}
}