Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: use globalThis
Co-authored-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv and susnux authored Jun 21, 2025
commit b0deb5b409b8eab3b59a1fb91c5a243920616609
4 changes: 2 additions & 2 deletions lib/guest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
* If the crypto API is available, it uses the less secure `randomUUID` method.
* Crypto API is available in modern browsers on secure contexts (HTTPS).
*
* @return {string} A random UUID.

Check failure on line 82 in lib/guest.ts

View workflow job for this annotation

GitHub Actions / NPM lint

Types are not permitted on @return
*/
function randomUUID(): string {
// Use the crypto API if available
if (self?.crypto?.randomUUID) {
return self.crypto.randomUUID()
if (globalThis.crypto?.randomUUID) {
return globalThis.crypto.randomUUID()
}

// Generate a random UUID (version 4)
Expand Down
Loading