Closed 4lessandrodev closed 1 year ago
isEqual
// entity class EntityExample extends Entity<Props>{ private constructor(props: Props) { super(props) } public static create(props: Props): Result<EntityExample> { return Ok(new EntityExample(props)); } } const a = EntityExample.create({...props, id }).value(); const b = EntityExample.create({...props, id}).value(); console.log(a.isEqual(b)); > true // ---------------- // value object class Exam extends ValueObject<Props> { private constructor(props: Props){ super(props) } public static create(props: Props): Result<Exam> { return Ok(new Exam(props)); } }; const a = Exam.create({ value : "hello there" }).value(); const b = Exam.create({ value : "hello there" }).value(); console.log(a.isEqual(b)); > true
1.16.0 - 2022-01-12
Added
isEqual
to compare current instance with another one.isEqual
to compare current instance with another one.27
Example