0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Used isEqual to compare ValueObjects

no-issue

This ensures that ValueObjects can contain non-primitive types.
This commit is contained in:
Fabien O'Carroll 2021-10-14 14:56:37 +02:00
parent 3fc4bf6239
commit c2f85d3742

View file

@ -1,3 +1,5 @@
const {isEqual} = require('lodash');
/**
* @template T
*/
@ -29,7 +31,7 @@ class ValueObject {
}
if (other instanceof ValueObject) {
if (this.value === other.value) {
if (isEqual(this.props.value, other.props.value)) {
return true;
}
}