Skip to content

Commit

Permalink
uuid: added missing test function.
Browse files Browse the repository at this point in the history
  • Loading branch information
dehmer committed Jun 23, 2024
1 parent 1c23e93 commit 5c1b988
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/shared/uuid.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
import { randomUUID } from 'crypto'

randomUUID.test = s =>
typeof s === 'string' &&
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(s)

export default randomUUID

0 comments on commit 5c1b988

Please sign in to comment.