-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π typeid-js: fix zero not being a valid time (#373)
Greetings @jetify-com Team, π when running some of my unit tests using time mocking I discovered that a time of `0` currently spawns a `RangeError` in `uuidv7` even tho it's a perfectly valid time. This special case will most likely not occur in production, nevertheless being able to test with mocked time starting from timestamp zero is very convenient. As all data is usually initialized at the beginning of a every test, this would otherwise require initializing system time to some arbitrary value, which sounds more like a workaround than a solution. As this is a limitation of the `uuidv7` library I proposed a fix to @LiosK that would lift this limitation without impacting performance or handling: LiosK/uuidv7#14 (comment) Sadly he is not interested in lifting this limitation and won't merge the fix. This PR aims to fix this issue on your end by migrating from https://github.com/LiosK/uuidv7 to https://github.com/uuidjs/uuid which seems to be more widely adopted and better maintained anyway. I also tested performance and found it to be marginally better. For a a quick reproduction of the issue checkout: https://github.com/lukas-runge/typeid-zero-not-being-a-valid-time π Best regards, @lukas-runge
- Loading branch information
1 parent
08bf222
commit 1edfc67
Showing
7 changed files
with
35 additions
and
29 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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