Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Lint #4

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const encryptFile = async (
): Promise<[string, string]> => {
const iv = globalThis.crypto.getRandomValues(new Uint8Array(12));

const [encryptionKey, wrappedEncryptionKeyB64] =
await (userWrappedEncryptionKeyB64
const [encryptionKey, wrappedEncryptionKeyB64] = await (
userWrappedEncryptionKeyB64
? async (): Promise<[CryptoKey, string]> => {
const wrappedEncryptionKey = autobb(
userWrappedEncryptionKeyB64,
Expand All @@ -68,7 +68,7 @@ const encryptFile = async (
);

return [encryptionKey, userWrappedEncryptionKeyB64];
}
}
: async (): Promise<[CryptoKey, string]> => {
const encryptionKey =
await globalThis.crypto.subtle.generateKey(
Expand All @@ -89,7 +89,8 @@ const encryptFile = async (
encryptionKey,
btoau(new Uint8Array(wrappedEncryptionKey)),
];
})();
}
)();

const dataBuffer =
typeof data === 'string' || data instanceof String
Expand Down
Loading