Skip to content

Commit 829b785

Browse files
dplewisCopilot
andauthored
Update src/uuid.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Diamond Lewis <findlewis@gmail.com>
1 parent 488fa4f commit 829b785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uuid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const uuid = (): string => {
2-
if (typeof crypto === 'undefined' || typeof crypto.randomUUID !== 'function') {
2+
if (typeof crypto === 'undefined' || typeof crypto?.randomUUID !== 'function') {
33
throw new Error(
44
'crypto.randomUUID is not available in this environment. ' +
55
'Use a UUID polyfill or environment-specific implementation (for example, in React Native you can import "react-native-random-uuid").'

0 commit comments

Comments
 (0)