import { shallowEqual } from "shallow-equal-object"; export abstract class ValueObject { protected readonly props: T; protected constructor(props: T) { this.props = Object.freeze(props); // 🔒 Garantiza inmutabilidad } abstract getValue(): any; equals(other: ValueObject): boolean { if (!(other instanceof ValueObject)) { return false; } if (other.props === undefined || other.props === null) { return false; } return shallowEqual(this.props, other.props); } /*isEmpty(): boolean { return this.props === null || this.props === undefined; }*/ /*toString(): string { return this.props !== null && this.props !== undefined ? String(this.props) : ""; }*/ }