Skip to content

Commit

Permalink
Remove fromString in Uuid #181
Browse files Browse the repository at this point in the history
  • Loading branch information
mapeveri committed Jan 18, 2025
1 parent a770407 commit 593b324
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/shared/domain/valueObjects/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4, v5 as uuidv5 } from 'uuid';
import { v4 as uuidv4 } from 'uuid';
import InvalidArgumentException from '../exceptions/invalidArgumentException';
import { ValueObject } from './valueObject';

Expand All @@ -22,10 +22,6 @@ export class Uuid extends ValueObject<string> {
return new Uuid(uuidv4());
}

static fromString(value: string): Uuid {
return new Uuid(uuidv5(value, uuidv5.DNS));
}

private validateUuid(id: string): void {
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;

Expand Down

0 comments on commit 593b324

Please sign in to comment.