Skip to content

Commit

Permalink
fix: Use isCryptoKey util for checking cryptokey
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanpaudel93 committed Apr 24, 2024
1 parent f4acf55 commit 9721f2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/privateRepo.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,7 +26,7 @@ async function encryptDataWithExistingKey(
) {
let key = aesKey;

if (!(aesKey instanceof CryptoKey)) {
if (!isCryptoKey(aesKey)) {
key = await crypto.subtle.importKey(
'raw',
aesKey,
Expand Down

0 comments on commit 9721f2d

Please sign in to comment.