Skip to content

Commit 5c216dd

Browse files
committed
fix: construct uuid using standard library 'crypto' instead of 'uuid'
1 parent 11039e2 commit 5c216dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/models/identifier/identifier.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { IsString } from 'class-validator';
2-
import { v4 as uuid } from 'uuid';
2+
import { randomUUID } from 'crypto';
33

44
export class IdentifierDto {
55
@IsString()
66
private readonly uuid: string;
77

88
constructor(id?: unknown) {
9-
this.uuid = id ? id.toString() : uuid(); // '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
9+
this.uuid = id ? id.toString() : randomUUID(); // '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
1010
}
1111

1212
toString() {

0 commit comments

Comments
 (0)