map<R> method

VerificationResult<R> map<R>(
  1. R transform(
    1. T data
    )
)

Maps the success value to a new type

If this result is a failure, returns a new failure with the same error.

Implementation

VerificationResult<R> map<R>(R Function(T data) transform) {
  if (isSuccess) {
    return VerificationResult.success(transform(data as T));
  } else {
    return VerificationResult.failure(error!);
  }
}