Skip to content

Commit

Permalink
Fix failing uuid validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BlairJ committed Jul 11, 2022
1 parent 23cf61a commit e8f00df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/eventSourcing/UUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export function assertValidUUID(input: string): asserts input is UUID {

export function isValidUUID(input: string): input is UUID {
const s = '' + input
const match = s.match('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')
return match === null
const match = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(s)
return match
}

export function makeFromString(uuid: string): UUID {
Expand Down

0 comments on commit e8f00df

Please sign in to comment.