Make Basis type parameters type-safe #208
Open
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.
I've based this PR on #207 so that I can actually make sure that all of the tests pass. Merge that before reviewing this. Once you've done that, you may need to push a commit that merges the main branch into this one in order to make the commit from that PR disappear from this one. You have my permission to do that (I've checked "Allow edits by maintainers").
Before, the type system would let you pass in anything as a basis, even things that weren't objects. Now, Basis types must conform to the type
Record<string, string>(aliased asBasisType, with a doc comment).I had to change how the
errorBasistest works (it's simpler now).I would start your review with
measure/unitSystem.ts.This will be a breaking change for anyone wrapping
Measure.