Skip to content

v7.0.1

Choose a tag to compare

@github-actions github-actions released this 06 Sep 20:07
· 54 commits to master since this release
433b962

Changes

  • fix(value-object): 🐛 Enforce runtime value immutability

Release details

Pull request notes

JavaScript consumers could overwrite, delete, or redefine a ValueObject's stored value and bypass constructor validation despite its protected readonly declaration. Protect value at runtime while keeping the instance extensible so subclasses can initialize their own fields.

Remove Enum's redundant parameter property so it uses the inherited protected value. Document the guarantee and the requirement to pass the final primitive to super(). Treat this as a fix to the existing immutability contract; code that writes or redeclares the protected value after construction will now fail.

Validation: yarn test (567 tests), yarn build, yarn docs:build, and formatting checks pass. Distribution checks exercise both ESM and CommonJS with strict/non-strict writes, deletion, redefinition, subclass initialization, and Enum validation/NullObject behavior. The new overwrite assertion was observed failing against the original compiled package before the fix.