Performs a deep-comparison of two Validation values for equality.
This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.
Performs a deep-comparison of two Validation values for equality.
See adt/union/derivations/equality
for details.
const { Success, Failure } = require('folktale/validation');
Success(1).equals(Success(1));
// ==> true
Failure(1).equals(Failure(1));
// ==> true
Success(1).equals(Failure(1));
// ==> false
Success(Success(1)).equals(Success(Success(1)));
// ==> true
function(value) {
assertType(adt)(`${this[tagSymbol]}#equals`, value);
return sameType(this, value) && compositesEqual(this, value, Object.keys(this));
}