Use globalThis instead of window (S7764)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ebd198e28d
commit
5d143d4cc3
8 files changed
+21
-21
No files matched your search
@@ -34,6 +34,6 @@ export const printObject = (obj, indent = 0) => {
|
||||
*/
|
||||
export const getRandomInt = (max) => {
|
||||
const array = new Uint32Array(1);
|
||||
window.crypto.getRandomValues(array);
|
||||
globalThis.crypto.getRandomValues(array);
|
||||
return Math.floor((array[0] / (0xffffffff + 1)) * (max + 1));
|
||||
};
|
||||
Reference in new issue
Block a user