fix: Task2 质量修复(TS2774/降级分支测试/跨平台checksize/显式lib)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-15 11:39:34 +08:00
parent 15853f20b3
commit cda80b1605
4 changed files with 13 additions and 3 deletions
+2 -1
View File
@@ -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);