We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e67257 commit 46c926cCopy full SHA for 46c926c
index.js
@@ -31,11 +31,11 @@ FileSystemAdapter.prototype.createFile = function (filename, data) {
31
const stream = fs.createWriteStream(filepath);
32
return new Promise((resolve, reject) => {
33
try {
34
- const iv = this._encryptionKey !== null ? crypto.randomBytes(16) : null;
+ const iv = this._encryptionKey ? crypto.randomBytes(16) : null;
35
36
const cipher =
37
- this._encryptionKey !== null && iv
38
- ? crypto.createCipheriv(this._algorithm, this._encryptionKey, iv)
+ this._encryptionKey && iv
+ ? crypto.createCipheriv(algorithm, this._encryptionKey, iv)
39
: null;
40
41
// when working with a Blob, it could be over the max size of a buffer, so we need to stream it
0 commit comments