mobiletto 1.0.42 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -411,9 +411,8 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
|
|
|
411
411
|
const cipher = crypt.getCipher(enc)
|
|
412
412
|
const realPath = encryptPath(path)
|
|
413
413
|
let generatorBytes = 0
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
return input.pipe(new Transform({
|
|
414
|
+
const createEncryptStream = (input) =>
|
|
415
|
+
input.pipe(new Transform({
|
|
417
416
|
transform(chunk, encoding, callback) {
|
|
418
417
|
generatorBytes += chunk.length
|
|
419
418
|
this.push(cipher.update(chunk))
|
|
@@ -424,10 +423,8 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
|
|
|
424
423
|
callback()
|
|
425
424
|
}
|
|
426
425
|
}))
|
|
427
|
-
}
|
|
428
426
|
|
|
429
427
|
// If we were passed a Readable, call write with a transform method
|
|
430
|
-
let streamBytes = -1
|
|
431
428
|
if (isReadable(readFunc)) {
|
|
432
429
|
await client.write(realPath, createEncryptStream(readFunc))
|
|
433
430
|
} else {
|