Repository navigation
v8.3.4
Changes
- fix(factories): 🐛 Return subclass from static factories (#94)
Release details
- npm: https://www.npmjs.com/package/@haskou/value-objects/v/8.3.4
- Pull request: #95
- Source branch:
fix/subclass-static-factories - Version bump:
patch
Pull request notes
Closes #94
UUID.generate, ShortId.generate, Timestamp.now/new/fromSeconds and Duration.from* now instantiate through the receiver (new this(...)) with a typed this, so subclasses get subclass instances and types, and isEqual works against them.
Note: calling the factories detached (const f = UUID.generate; f(), .map(Duration.fromDays)) no longer works.
Adds regression tests in tests/value-objects/SubclassFactories.spec.ts.