fix(isUUID)!: fully support rfc9562#2421
Merged
profnandaa merged 1 commit intovalidatorjs:masterfrom Jun 22, 2024
broofa:uuid_rfc9562
Merged
fix(isUUID)!: fully support rfc9562#2421profnandaa merged 1 commit intovalidatorjs:masterfrom broofa:uuid_rfc9562
profnandaa merged 1 commit intovalidatorjs:masterfrom
broofa:uuid_rfc9562
Conversation
rubiin
approved these changes
Jun 13, 2024
broofa
commented
Jun 13, 2024
Member
|
@profnandaa this is a critical fix considering we were allowing invalid uuids in the past |
4 tasks
6 tasks
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.
PR for #2419.
Note that this will be a BREAKING CHANGE for the following reasons:
isUUID(str, version)will now return false ifstrdoes not have a validvariantfield. (Previously only versions 4, 5, and 7 enforced this field.)isUUID(str, 'all')now only allows RFC9562 UUIDS. Previously it would accept any string that looked UUID-ish ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), regardless of what values were in theversionorvariantfields.New UUID values were generated with the
uuidutility. E.g.npx uuid v6. Also, I maintain theuuidmodule so... 🤷Checklist