import { shallowEqual } from "shallow-equal-object"; interface ValueObjectProps { // eslint-disable-next-line @typescript-eslint/no-explicit-any [index: string]: any; } export abstract class ValueObject { public readonly props: T; protected constructor (props: T) { this.props = Object.freeze(props); } public equals (vo?: ValueObject) : boolean { const props = vo?.props || vo; if (vo === null || vo === undefined) { return false; } if (props === undefined) { return false; } return shallowEqual(this.props, props) } }