Skip to content

Commit

Permalink
Fix crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim authored Apr 5, 2023
1 parent e27a0ef commit 8931e6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion __tests__/setup/setupCryptoGetRandomValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { randomFillSync } from 'crypto';

// When microsoft-cognitiveservices-speech-sdk is loaded, it call "uuid" package to create a new GUID.
// "uuid" package requires crypto.getRandomValues().
if (!global.crypto.getRandomValues) {
if (!global.crypto?.getRandomValues) {
global.crypto = { ...global.crypto, getRandomValues: randomFillSync };
}

0 comments on commit 8931e6c

Please sign in to comment.