Merge pull request #43 from jury89/feature/uploadStream-fix-cb
is not necessary to pass cb to pkgcloud
This commit is contained in:
commit
09cb66d062
|
@ -123,9 +123,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 || {};
|
||||
|
@ -136,7 +135,7 @@ StorageService.prototype.uploadStream = function (container, file, options, cb)
|
|||
options.remote = file;
|
||||
}
|
||||
|
||||
return this.client.upload(options, cb);
|
||||
return this.client.upload(options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -148,9 +147,8 @@ StorageService.prototype.uploadStream = function (container, file, options, cb)
|
|||
* @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 || {};
|
||||
|
@ -161,7 +159,7 @@ StorageService.prototype.downloadStream = function (container, file, options, cb
|
|||
options.remote = file;
|
||||
}
|
||||
|
||||
return this.client.download(options, cb);
|
||||
return this.client.download(options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue