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