chore: SDK 工程骨架(esbuild+vitest)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-15 11:30:42 +08:00
parent 2a7f08fd14
commit 8e2c91663e
8 changed files with 1246 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
export function uuid(): string {
if (globalThis.crypto?.randomUUID) return crypto.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);
});
}