UNPKG

local-fake-api

Version:

A simple async local mock API without backend.

9 lines (8 loc) 319 B
export function getUuid() { var _a; if (typeof window !== "undefined" && ((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID)) { return window.crypto.randomUUID(); } // fallback: simple pseudo-UUID return Math.random().toString(36).slice(2) + Date.now().toString(36); }