lookupWithKey method

Option<(K, V)> lookupWithKey(
  1. K key
)

Get the value and key at given key if present, otherwise return None.

Implementation

Option<(K, V)> lookupWithKey(K key) {
  final value = this[key];
  if (value != null) return some((key, value));
  if (containsKey(key)) return some((key, value as V));
  return const None();
}