Skip to content

fix: Duration precision, LMT offsets, and 4.7.1 - #151

Merged
knowledgecode merged 9 commits into
masterfrom
develop
Nov 1, 2026
Merged

knowledgecode merged 9 commits into
masterfrom
develop

Conversation

@knowledgecode

Copy link
Copy Markdown
Owner

Summary

  • Fix Duration sub-millisecond parts: values such as 1.001 ms no longer lose a unit to floating-point truncation.
  • Fix Z / ZZ for time zones whose offset has seconds (Local Mean Time): the offset is now truncated to whole minutes, like Date#getTimezoneOffset().
  • Docs and agent skills: describe YYYY for years above 9999 and the Buddhist calendar range, and fix the RFC 2822 examples.
  • CI: run the type check and build before tests, pin codecov-action, and scope the Pages write permissions to the deploy job.
  • Chore: update devDependencies and bump the version to 4.7.1.

Test plan

  • npm run lint / npm run ts
  • npm test (73 files / 2353 tests)
  • npm run build && npx vitest run tests/build
  • npm run docs:build

Building first lets tests/build/ check the CJS interop and .d.cts output
instead of skipping when dist/ is missing.
Move pages: write and id-token: write off the workflow level so only the
deploy job holds them; the build job gets read-only access.
Split the duration from an integer nanosecond count instead of truncating
floating-point fractions, which dropped a unit for values like 1.001 that
binary floating point stores slightly below their decimal form. Share the
descriptor construction across the to*() methods.
toParts() returned a fractional timezoneOffset for zones whose offset has
seconds, such as Local Mean Time. Truncate it toward zero, as
Date#getTimezoneOffset() does, so Z and ZZ print whole minutes.
…r range

YYYY keeps only the last four digits of a year above 9999, which with the
Buddhist calendar already happens after December 31, 9456. Document the
Buddhist years parse() accepts, mirror both in the agent skill references,
and pin the behavior with tests.
RFC 2822 offsets have no colon, so use Z instead of ZZ, and load the
day-of-week parser plugin that the ddd token needs when parsing.
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.87%. Comparing base (5c244df) to head (957f7d8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #151      +/-   ##
==========================================
+ Coverage   98.79%   98.87%   +0.07%     
==========================================
  Files          77       77              
  Lines        1247     1246       -1     
  Branches      367      367              
==========================================
  Hits         1232     1232              
+ Partials       15       14       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The token lookup in format() and the part lookup in toParts() always find
a number, so their ?? 0 fallbacks never ran and showed up as partially
covered branches. Compare the lookup against undefined in format() and
read the values through Object.entries() in toParts() instead.
@knowledgecode
knowledgecode merged commit cdf243a into master Nov 1, 2026
6 checks passed
@knowledgecode
knowledgecode deleted the develop branch November 1, 2026 09:09
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