Skip to content

Commit

Permalink
my previous shorthand option is stupid. this is better
Browse files Browse the repository at this point in the history
  • Loading branch information
kc-dot-io committed Mar 8, 2013
1 parent 1a3c34f commit b1c2799
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ module.exports = function (api_key, options) {
del("/v1/customers/" + customer_id, {}, cb);
},
list: function(count, offset, cb) {
if(typeof count == 'object' && typeof offset == 'function' && !cb)
cb = offset && offset = count.object && count = count.count;
if(typeof count == 'object' && typeof offset == 'function' && !cb) {
cb = offset; offset; count.object; count = count.count;
}
get("/v1/customers", { count: count, offset: offset}, cb );
},
update_subscription: function(customer_id, data, cb) {
Expand Down Expand Up @@ -216,8 +217,9 @@ module.exports = function (api_key, options) {
del("/v1/coupons/" + coupon_id, {}, cb);
},
list: function(count, offset, cb) {
if(typeof count == 'object' && typeof offset == 'function' && !cb)
cb = offset && offset = count.object && count = count.count;
if(typeof count == 'object' && typeof offset == 'function' && !cb) {
cb = offset; offset = count.object; count = count.count;
}
get("/v1/coupons", { count: count, offset: offset}, cb );
}
},
Expand Down

0 comments on commit b1c2799

Please sign in to comment.