import { shallowEqual } from 'shallow-equal-object' ; interface ValueObjectProps { [ index ] : any ; } export abstract class ValueObject < T extends ValueObjectProps > { public readonly props : T ; protected constructor ( props ) { this . props = Object . freeze ( props ) ; } public equals ( other ) { if ( this . constructor !== other . constructor ) { return false ; } return shallowEqual ( this . props , other . props ) ; } }