Skip to content

Commit

Permalink
Fix crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim authored Mar 23, 2023
1 parent 3a48221 commit 16e78a1
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 16e78a1

Please sign in to comment.