We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 488fa4f commit 829b785Copy full SHA for 829b785
src/uuid.ts
@@ -1,5 +1,5 @@
1
const uuid = (): string => {
2
- if (typeof crypto === 'undefined' || typeof crypto.randomUUID !== 'function') {
+ if (typeof crypto === 'undefined' || typeof crypto?.randomUUID !== 'function') {
3
throw new Error(
4
'crypto.randomUUID is not available in this environment. ' +
5
'Use a UUID polyfill or environment-specific implementation (for example, in React Native you can import "react-native-random-uuid").'
0 commit comments