mapValue method

Object? mapValue(
  1. Object onValue(
    1. T value
    )
)

Maps a concrete value through onValue (e.g. wrap a token in Bearer …); a matcher passes through untouched so easy_mock_http matches on it.

Implementation

Object? mapValue(Object Function(T value) onValue) {
  switch (_type) {
    case _ValueOrMatcherType.matcher:
      return _matcher;
    case _ValueOrMatcherType.value:
      return onValue(_value as T);
  }
}