-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(range): consistently convert min & max to numbers (#4587)
* fix(range): consistently convert min & max to numbers Basically we had two methods to turn a number (or string) into a precision: 1. Math.floor(min * pow) / pow 2. Number(Number(v).toFixed(precision)) these behave different for precision 0 & a number over .5, let's say 1.5 turns into 1 for method 1, and into 2 for method 2. This is a bug (not caught by most of our tests, notably the ones i had to change) and causes the range to change to a number it's not supposed to be. Pay special attention to the new `toPrecision` utility, and the places it was used. At the same time I also converted to TypeScript, but not the components themselves, since that was too much work. typescript for tests is expected to fail until algolia/algoliasearch-client-javascript#1229 is released (since now certain parts aren't random objects, but rather search responses) The version for the helper is bumped for better typescript support as well. update types requires algolia/algoliasearch-client-javascript#1234 update client for fix in typing for tests update assertions in changed tests clarify why behaviour is like it is * address feedback * integrate fix from the helper avoiding workaround here
- Loading branch information
Showing
15 changed files
with
2,670 additions
and
2,230 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.