avoid globals

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-11-22 15:36:22 +01:00
parent 724ac79ed8
commit d3fea4ae0a
19 changed files with 212 additions and 21 deletions
@@ -241,7 +241,7 @@ export class GoogleAnalytics implements AnalyticsApi {
* Simple hash function; relies on web cryptography + the sha-256 algorithm.
*/
private async hash(value: string): Promise<string> {
const digest = await crypto.subtle.digest(
const digest = await window.crypto.subtle.digest(
'sha-256',
new TextEncoder().encode(value),
);