A convenience method for the folktale/conversions/validation-to-result
module.
A convenience method for the folktale/conversions/validation-to-result
module.
const Result = require('folktale/result');
const Validation = require('folktale/validation');
Result.fromValidation(Validation.Success(1));
// ==> Result.Ok(1)
Result.fromValidation(Validation.Failure(1));
// ==> Result.Error(1)
fromValidation(aValidation) {
return require('folktale/conversions/validation-to-result')(aValidation);
}