Repository navigation
fix(uuid-generator): inspect GUIDs in braces and urn:uuid: values - #415
Merged
anurag629 merged 1 commit intoOct 28, 2026
Merged
Conversation
anurag629
approved these changes
Oct 28, 2026
anurag629
left a comment
Member
There was a problem hiding this comment.
Thanks @prakashNalla. Lint (develop's 11 warnings), all 2435 tests, the build and the pages pass on top of develop. Braces and urn:uuid: (any case, with spaces around) now inspect like the bare UUID, while {abc..., double braces, urn:uuid:{...} and a bare uuid: prefix stay invalid, and good catch updating the guide line that told people to remove the braces.
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.
What and why
The UUID inspector rejected a GUID in braces (
{3f2504e0-...}, as .NET and the Windows registry show them) and aurn:uuid:value, becauseinspectUuid()tested the trimmed text againstUUID_PATTERNbefore anything else. It now drops a leadingurn:uuid:(any case) or one pair of surrounding braces first, then checks and decodes the rest as before. Unbalanced or doubled braces, braces afterurn:uuid:, and other prefixes stay invalid.The UUID guide said braces are reported as invalid, and its example test pinned that, so I updated that line to say both forms are accepted and changed the test to match.
Closes #414
How I tested this
lib/__tests__/uuid.test.ts: braces,urn:uuid:,URN:UUID:and surrounding whitespace each inspect the same as the bare UUID, and five malformed wrappers stay invalid. The 4 accepting cases fail without the change.npm run lint: 0 errors, the same 11 warnings as ondevelop.npm run test: 64 files, 2435 tests pass.npm run build: passes.npm run dev,/uuid-generator: the bare value,{...}andurn:uuid:...all show Version 4 and Variant RFC 9562, and{...without the closing brace shows no result.AI assistance
Claude helped me w/ understand the issue
Type of change
Checklist
npm run lint && npm run test && npm run buildpasses locallylib/and have a test inlib/__tests__/page.tsx, client component,opengraph-image.tsx, and the bug report dropdown are all done