Skip to content

Commit

Permalink
revert changes to callback code (#3137)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm1957 authored Dec 27, 2023
1 parent 42bc7e2 commit 7f5135a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ function encryptPhrase(password, phrase, callback) {
encrypted += data.toString('hex');
}
});
cipher.on('end', () => callback(encrypted));

cipher.on('end', () => {
callback(encrypted);
});

cipher.write(phrase);
cipher.end();
}
Expand All @@ -68,7 +70,9 @@ function decryptPhrase(password, data, callback) {
console.error(`Cannot decode secret: ${error}`);
callback(null);
});
decipher.on('end', function () callback(decrypted));
decipher.on('end', function () {
callback(decrypted);
});

decipher.write(data, 'hex');
decipher.end();
Expand Down

0 comments on commit 7f5135a

Please sign in to comment.