UNPKG

@virtualstate/navigation

Version:

Native JavaScript [navigation](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API) implementation

7 lines 377 B
const isWebCryptoSupported = "crypto" in globalThis && typeof globalThis.crypto.randomUUID === "function"; export const v4 = isWebCryptoSupported ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : () => Array.from({ length: 5 }, () => `${Math.random()}`.replace(/^0\./, "")) .join("-") .replace(".", ""); //# sourceMappingURL=uuid-or-random.js.map