Skip to content

fix: accept Unit arguments in unit TypeScript declarations - #3699

Open
jakezwang wants to merge 1 commit into
josdejong:developfrom
jakezwang:fix-unit-argument-types
Open

jakezwang wants to merge 1 commit into
josdejong:developfrom
jakezwang:fix-unit-argument-types

Conversation

@jakezwang

Copy link
Copy Markdown

Fixes #3637.

Allow a valueless Unit as the second argument to unit in the TypeScript declarations, matching the existing runtime overload. Apply the same correction to numeric chains.

Add type regressions for numbers, BigNumbers, Fractions, Complex values, and chaining.

Validation: type tests, lint, full Node 24 test suite, Node 20 coverage, Node 22 unit tests, and Firefox browser tests passed. build-and-test intermittently failed the existing CLI script-output ordering test; the subsequent complete Node 24 test suite passed.

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.

Type annotation for mathjs.unit is not correct

1 participant