Transforms a Validation into a Maybe. Failure values are lost in the process.
Transforms a Validation into a Maybe. Failure values are lost in the process.
const { Success, Failure } = require('folktale/validation');
const Maybe = require('folktale/maybe');
Success('a').toMaybe();
// ==> Maybe.Just('a')
Failure('a').toMaybe();
// ==> Maybe.Nothing()
toMaybe() {
return require('folktale/conversions/validation-to-maybe')(this);
}