Tests if an arbitrary value is a Failure case of a Validation instance.
Tests if an arbitrary value is a Failure case of a Validation instance.
const Validation = require('folktale/validation');
Validation.Failure.hasInstance({ value: 1 });
// ==> false
Validation.Failure.hasInstance(Validation.Success(1));
// ==> false
Validation.Failure.hasInstance(Validation.Failure(1));
// ==> true
hasInstance(value) {
return Boolean(value)
&& adt.hasInstance(value)
&& value[TAG] === name;
}