Repository navigation
fix: Duration precision, LMT offsets, and 4.7.1 - #151
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Durationsub-millisecond parts: values such as1.001ms no longer lose a unit to floating-point truncation.Z/ZZfor time zones whose offset has seconds (Local Mean Time): the offset is now truncated to whole minutes, likeDate#getTimezoneOffset().YYYYfor years above 9999 and the Buddhist calendar range, and fix the RFC 2822 examples.codecov-action, and scope the Pages write permissions to the deploy job.Test plan
npm run lint/npm run tsnpm test(73 files / 2353 tests)npm run build && npx vitest run tests/buildnpm run docs:build