Skip to content

feat(file-size): ✨ Add FileSize, FileSizeUnit and PositiveInteger value objects - #98

Merged
haskou merged 1 commit into
masterfrom
feat/file-size
Oct 13, 2026
Merged

haskou merged 1 commit into
masterfrom
feat/file-size

Conversation

@haskou

@haskou haskou commented Oct 13, 2026

Copy link
Copy Markdown
Owner

What

  • PositiveInteger (extends Integer, accepts 0).
  • FileSizeUnit (extends Enum): SI (kB..PB, base 1000) and IEC (KiB..PiB, base 1024) units, with a single typed bytes-per-unit table and FileSizeUnit.SI / FileSizeUnit.IEC sets.
  • FileSize (extends PositiveInteger, stored in bytes): fromBytes, from(value, unit), parse, toBytes, to(unit), toHumanReadable(units), plus inherited arithmetic.

Behaviour worth reviewing

Docs

Reference pages for the three classes, plus sidebar, reference index, docs home and README entries. The README table was re-aligned by prettier.

Verification

yarn test, yarn build and yarn docs:build pass. Coverage is 100% (statements, branches, functions, lines).

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@haskou
haskou merged commit 3a94555 into master Oct 13, 2026
3 checks passed
@haskou
haskou deleted the feat/file-size branch October 13, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant