Skip to content

Commit

Permalink
chore(randomuuid-polyfill): fix linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
Paola Nicosia committed Feb 6, 2024
1 parent ca60796 commit cdc9d19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/orchestrator/src/randomuuid-polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ if (!('randomUUID' in window.crypto)) {
// https://stackoverflow.com/a/2117523/2800218
// LICENSE: https://creativecommons.org/licenses/by-sa/4.0/legalcode
window.crypto.randomUUID = function randomUUID(): string {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
return (
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
[1e7] + -1e3 + -4e3 + -8e3 + -1e11
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
).replace(/[018]/g,
// eslint-disable-next-line no-mixed-operators
(ch) => (ch ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> ch / 4).toString(16)
Expand Down

0 comments on commit cdc9d19

Please sign in to comment.