Skip to content

feature: Add support for v1 and v2 UUIDs to isUUID() #1497

Closed
@rjschineller

Description

@rjschineller

Description

A project I'm working with makes heavy use of this package, and we are starting to use v1 UUIDs in certain areas where we need to glean certain time info from the UUID. I would love to be able to use this package to validate v1 and v2 UUIDs as well.

Luckily validator.js has already expanded this functionality to accept type 1 and 2 UUIDS in ver 13.7.0. And the functionality just needs to be expanded here.

Proposed solution

This should be an easy drop in replacement in src/decorator/string/IsUUID.ts

Original:

export type UUIDVersion = '3' | '4' | '5' | 'all' | 3 | 4 | 5;

Modified:

export type UUIDVersion = '1' | '2' | '3' | '4' | '5' | 'all' | 1 | 2 | 3 | 4 | 5;

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: done/releasedIssue has been completed, no further action is needed.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions