fix: Task2 质量修复(TS2774/降级分支测试/跨平台checksize/显式lib)
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
export function uuid(): string {
|
||||
if (globalThis.crypto?.randomUUID) return crypto.randomUUID();
|
||||
const c = globalThis.crypto as Crypto | undefined;
|
||||
if (c?.randomUUID) return c.randomUUID();
|
||||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
||||
const r = (Math.random() * 16) | 0;
|
||||
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
||||
|
||||
Reference in New Issue
Block a user