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