Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031interface ValueObjectProps { [index: string]: any;}
/** * @desc ValueObjects are objects that we determine their * equality through their structrual property. */
export abstract class ValueObject<T extends ValueObjectProps> { public props: T;
constructor(props: T) { let baseProps: any = { ...props, };
this.props = baseProps; }
public equals(vo?: ValueObject<T>): boolean { if (vo === null || vo === undefined) { return false; } if (vo.props === undefined) { return false; } return JSON.stringify(this.props) === JSON.stringify(vo.props); }}