Skip to content

Commit

Permalink
feat: simplify UUIDv7 logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BoscoDomingo committed Nov 9, 2024
1 parent 2a3bde4 commit 0c860ff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/domain/value_objects/uuidv7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ export class UUIDv7 {
return;
}

if (
!value?.match(
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,
)
) {
if (!UUIDv7.validate(value)) {
throw new Error("Invalid UUIDv7 format");
}

Expand Down

0 comments on commit 0c860ff

Please sign in to comment.