Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/cloudfiles/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ var Container = exports.Container = function (client, details) {
if (!details) {
throw new Error("Container must be constructed with at least basic details.")
}
if(typeof details !== 'object') {
details = {name: details};
}

this.files = [];
this.client = client;
Expand All @@ -20,7 +23,16 @@ var Container = exports.Container = function (client, details) {

Container.prototype = {
addFile: function (file, local, options, callback) {
return this.client.addFile(this.name, file, local, options, callback);
if(!options && !callback) {
options = {};
}
if (typeof options === 'function' && !callback) {
callback = options;
options = {};
}
options.remote = file;
options.local = local;
return this.client.addFile(this.name, options, callback);
},

destroy: function (callback) {
Expand Down