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 912eb76 commit 97d7fd3Copy full SHA for 97d7fd3
package.json
@@ -83,7 +83,7 @@
83
"vitest": "^3.2.4"
84
},
85
"engines": {
86
- "node": ">=18.12.0"
+ "node": ">=20.19.0"
87
88
"prettier": "@sxzz/prettier-config"
89
}
src/utils/uuid.ts
@@ -1,16 +1,3 @@
1
-import type { webcrypto } from 'node:crypto'
2
-let _crypto: any
3
-import('node:crypto')
4
- .then((c) => (_crypto = c))
5
-
6
- .catch(() => null)
7
8
export function generateUUID(): string | undefined {
9
- try {
10
- const crypto: webcrypto.Crypto | undefined =
11
- (globalThis as any).crypto || _crypto
12
- if (!crypto) return undefined
13
- return crypto.randomUUID()
14
- } catch {}
15
- return undefined
+ return crypto.randomUUID()
16
0 commit comments