Skip to content

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 10 Jul 14:36
· 89 commits to master since this release

Changes

  • fix(value-objects)!: 💥 Enforce strict validation and immutability

Release details

Pull request notes

Summary

  • Remove TimestampInterval.modifyStart() and modifyEnd() so interval boundaries remain immutable.
  • Reject non-finite numbers and invalid timestamps.
  • Validate real calendar dates and preserve Unix epoch input.
  • Validate UUID structure, version, and RFC variant.
  • Correct Duration day and hour component calculations.

Breaking changes

  • TimestampInterval.modifyStart() and modifyEnd() are no longer available.
  • NumberValueObject, Integer, and Timestamp reject Infinity, -Infinity, and invalid date values.
  • UUID rejects 36-character strings that do not match the standard UUID structure.
  • CalendarDay rejects normalized dates such as 2022-02-31.

Root cause

Several validators delegated to permissive JavaScript behavior. Date normalized nonexistent dates, numeric validation rejected only NaN, and the UUID pattern checked character count without checking field structure. Duration.getHours() used seconds per hour as its modulo, and mutable timestamp intervals left the inherited primitive value out of sync with their boundaries.

Validation

  • yarn test (808 tests)
  • yarn test:coverage (100% statements, branches, functions, and lines)
  • yarn build
  • yarn docs:build
  • Prettier check for all changed files