Skip to content

Commit

Permalink
make options arg to listDistributions and listInvalidations optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tellnes committed Mar 11, 2012
1 parent 644df99 commit 34f35a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/index.js
Expand Up @@ -237,6 +237,11 @@ CloudFront.prototype.deleteDistribution = function(distribution, etag, opts, cb)
};

CloudFront.prototype.listDistributions = function(opts, cb) {
if (arguments.length === 1) {
cb = opts;
opts = {};
}

var self = this;
this.request('GET', listOptsToPath('distribution', opts), function(err, body) {
if (err) return cb(err);
Expand Down Expand Up @@ -273,6 +278,11 @@ CloudFront.prototype.getInvalidation = function(distribution, id, cb) {
};

CloudFront.prototype.listInvalidations = function(distribution, opts, cb) {
if (arguments.length === 2) {
cb = opts;
opts = {};
}

var self = this;
this.request('GET', listOptsToPath('distribution/' + distribution + '/invalidation', opts), function(err, body) {
if (err) return cb(err);
Expand Down

0 comments on commit 34f35a7

Please sign in to comment.