Skip to content

v1.16.0

Compare
Choose a tag to compare
@4lessandrodev 4lessandrodev released this 13 Jan 01:15
· 348 commits to main since this release

1.16.0 - 2022-01-12

Added

  • Entity: added method isEqual to compare current instance with another one.
  • ValueObject: added method isEqual to compare current instance with another one. Issue 27
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