Skip to content

feature: Add @IsCUID validator #2640

@MEDATTA0

Description

@MEDATTA0

Description

I'm using better-auth in my projects, and it automatically generates CUIDs, by default, for tables that it internally manages.
When I tried to validate these IDs with class-validator, I realized there's no built-in CUID validator. I had to write a custom one manually, copy and paste the same CUID validator across projects.

Proposed solution

I would like to propose adding an @IsCUID() and isCUID validators to class-validator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.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