From b3f0d757c6598a7af9aedb1f670ee4c2c558773d Mon Sep 17 00:00:00 2001 From: Jury D'Ambros Date: Mon, 2 Feb 2015 17:04:55 +0000 Subject: [PATCH 1/2] is not necessary to pass cb to pkgcloud --- lib/storage-service.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/storage-service.js b/lib/storage-service.js index 79d96cd..f9ab846 100644 --- a/lib/storage-service.js +++ b/lib/storage-service.js @@ -112,9 +112,8 @@ StorageService.prototype.getContainer = function (container, cb) { * @param {String|Object} err Error string or object * @returns {Stream} Stream for uploading */ -StorageService.prototype.uploadStream = function (container, file, options, cb) { - if (!cb && typeof options === 'function') { - cb = options; +StorageService.prototype.uploadStream = function (container, file, options) { + if (typeof options === 'function') { options = {}; } options = options || {}; @@ -125,7 +124,7 @@ StorageService.prototype.uploadStream = function (container, file, options, cb) options.remote = file; } - return this.client.upload(options, cb); + return this.client.upload(options); }; /** From 38e1503c30a8a42055bfd8ef95b9e7a403513ed1 Mon Sep 17 00:00:00 2001 From: Jury D'Ambros Date: Tue, 3 Feb 2015 09:36:41 +0000 Subject: [PATCH 2/2] removed callback from downloadStream method --- lib/storage-service.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/storage-service.js b/lib/storage-service.js index f9ab846..66d74ff 100644 --- a/lib/storage-service.js +++ b/lib/storage-service.js @@ -136,9 +136,8 @@ StorageService.prototype.uploadStream = function (container, file, options) { * @param {String|Object} err Error string or object * @returns {Stream} Stream for downloading */ -StorageService.prototype.downloadStream = function (container, file, options, cb) { - if (!cb && typeof options === 'function') { - cb = options; +StorageService.prototype.downloadStream = function (container, file, options) { + if (typeof options === 'function') { options = {}; } options = options || {}; @@ -149,7 +148,7 @@ StorageService.prototype.downloadStream = function (container, file, options, cb options.remote = file; } - return this.client.download(options, cb); + return this.client.download(options); }; /**