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