Skip to content

Commit 97d7fd3

Browse files
committed
feat!: drop node 18
1 parent 912eb76 commit 97d7fd3

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"vitest": "^3.2.4"
8484
},
8585
"engines": {
86-
"node": ">=18.12.0"
86+
"node": ">=20.19.0"
8787
},
8888
"prettier": "@sxzz/prettier-config"
8989
}

src/utils/uuid.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
81
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
2+
return crypto.randomUUID()
163
}

0 commit comments

Comments
 (0)