mapFailure method

Result<T> mapFailure(
  1. $<String, String> f(
    1. String errorKey,
    2. String errorMessage
    )
)

Implementation

Result<T> mapFailure(
    $<String, String> Function(String errorKey, String errorMessage) f) {
  if (isSuccess) {
    return this;
  } else {
    final ee = f(errorKey!, errorMessage!);
    return Result<T>.failure(ee.$0, ee.$1);
  }
}