From 9721f2d275663bf9dab68c8ca35c9dd817152f67 Mon Sep 17 00:00:00 2001 From: Pawan Paudel Date: Wed, 24 Apr 2024 17:59:59 +0545 Subject: [PATCH] fix: Use isCryptoKey util for checking cryptokey --- src/lib/privateRepo.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/privateRepo.ts b/src/lib/privateRepo.ts index a59d3c0..4bd1330 100644 --- a/src/lib/privateRepo.ts +++ b/src/lib/privateRepo.ts @@ -1,6 +1,7 @@ import crypto from 'crypto'; import { getActivePublicKey } from './arweaveHelper'; import { getWallet, initArweave } from './common'; +import { isCryptoKey } from 'util/types'; type PrivateState = { iv: string; @@ -25,7 +26,7 @@ async function encryptDataWithExistingKey( ) { let key = aesKey; - if (!(aesKey instanceof CryptoKey)) { + if (!isCryptoKey(aesKey)) { key = await crypto.subtle.importKey( 'raw', aesKey,