Skip to content

Update UUID parameter types in ValidatorJSAsserts interface - #288

Merged
risantos merged 1 commit into
masterfrom
support/uuid-assert-numeric-version
Aug 12, 2026
Merged

Update UUID parameter types in ValidatorJSAsserts interface#288
risantos merged 1 commit into
masterfrom
support/uuid-assert-numeric-version

Conversation

@jorgegoncalves99

@jorgegoncalves99 jorgegoncalves99 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Add numeric versions to the uuid assert interface. And improved test cases to test both stringified numbers and the numeric versions being passed.

@jorgegoncalves99
jorgegoncalves99 force-pushed the support/uuid-assert-numeric-version branch from c575767 to 1adad77 Compare June 17, 2026 10:37
@jorgegoncalves99
jorgegoncalves99 marked this pull request as ready for review June 17, 2026 10:38
@jorgegoncalves99
jorgegoncalves99 requested a review from a team as a code owner June 17, 2026 10:38
Copilot AI review requested due to automatic review settings June 17, 2026 10:38
@jorgegoncalves99
jorgegoncalves99 requested review from a team as code owners June 17, 2026 10:38
@jorgegoncalves99 jorgegoncalves99 self-assigned this Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Not ready to approve

The updated TypeScript definition still omits the explicitly supported 'all' UUID version, leaving the types slightly out of sync with runtime behavior.

Pull request overview

This PR updates the public TypeScript surface for the uuid() assert so consumers can pass UUID versions as numeric literals (in addition to the existing string literals), and expands the UUID assert tests to cover “stringified” numeric versions.

Changes:

  • Updated ValidatorJSAsserts.uuid() type signature to accept 3 | 4 | 5 | 7 (numeric literal versions) in addition to '3' | '4' | '5' | '7'.
  • Added test cases ensuring stringified numeric versions (e.g. '3', '4') are accepted.
File summaries
File Description
test/asserts/uuid-assert.test.js Adds passing test cases for stringified UUID version inputs.
src/types/index.d.ts Extends the uuid() TypeScript signature to allow numeric UUID version literals.

Copilot's findings

  • Files reviewed: 1/2 changed files
  • Comments generated: 0

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marioviana marioviana left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@risantos risantos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@risantos
risantos merged commit a61ba3a into master Aug 12, 2026
9 checks passed
@risantos
risantos deleted the support/uuid-assert-numeric-version branch August 12, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants