Transforms a Result into a Validation.
Transforms a Result into a Validation.
Result's Ok
s are mapped into Validation's Success
es, and Result's Error
s
are mapped into Validation's Failure
s.
const Result = require('folktale/result');
const Validation = require('folktale/validation');
Result.Ok(1).toValidation();
// ==> Validation.Success(1)
Result.Error(1).toValidation();
// ==> Validation.Failure(1)
toValidation() {
return require('folktale/conversions/result-to-validation')(this);
}