Skip to content

Commit

Permalink
Get typescript passing
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Oct 10, 2022
1 parent 75c94db commit 8db413a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface EncryptionResult {

interface DecryptResult {
extractedKeyString: string;
vault: object;
vault: unknown;
data: string;
}

Expand Down Expand Up @@ -71,11 +71,9 @@ async function encryptWithKey<R>(
* the resulting value
* @param {string} password - password to decrypt with
* @param {string} text - cypher text to decrypt
* @returns {DecryptResult}
*/
async function decrypt<R>(
password: string,
text: string,
): Promise<DecryptResult> {
async function decrypt(password: string, text: string): Promise<DecryptResult> {
const payload = JSON.parse(text);
const { salt } = payload;
const key = await keyFromPassword(password, salt);
Expand Down Expand Up @@ -123,7 +121,7 @@ async function exportKey(key: CryptoKey): Promise<string> {
async function decryptWithKey<R>(
key: CryptoKey,
payload: EncryptionResult,
): Promise<object> {
): Promise<R> {
const encryptedData = Buffer.from(payload.data, 'base64');
const vector = Buffer.from(payload.iv, 'base64');

Expand Down

0 comments on commit 8db413a

Please sign in to comment.