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:
parent
3fc4bf6239
commit
c2f85d3742
1 changed files with 3 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
const {isEqual} = require('lodash');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template T
|
* @template T
|
||||||
*/
|
*/
|
||||||
|
@ -29,7 +31,7 @@ class ValueObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (other instanceof ValueObject) {
|
if (other instanceof ValueObject) {
|
||||||
if (this.value === other.value) {
|
if (isEqual(this.props.value, other.props.value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue