From b8fbed89401fd71a5e0f352b5c3b04dba3858d2a Mon Sep 17 00:00:00 2001 From: Brock Whitten Date: Wed, 27 Feb 2013 16:34:28 -0800 Subject: [PATCH] resolves reset issue on delta --- lib/dbox.js | 6 ++++++ test/all.js | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/dbox.js b/lib/dbox.js index 5095487..d39a258 100644 --- a/lib/dbox.js +++ b/lib/dbox.js @@ -70,6 +70,7 @@ exports.app = function(config){ var entries = [] var REQUEST_CONCURRENCY_DELAY = 20 + var reset; var fetch = function(args){ var signature = helpers.sign(options, args) @@ -87,6 +88,10 @@ exports.app = function(config){ return request(opts, function(e, r, b){ var status = e ? null : r.statusCode var output = helpers.parseJSON(b) + + if(typeof reset == 'undefined'){ + reset = output.reset + } if(output && output.hasOwnProperty("entries")){ output["entries"].forEach(function(entry){ @@ -99,6 +104,7 @@ exports.app = function(config){ }else{ if(output){ output["entries"] = entries + output["reset"] = reset } // console.log("MADE IT:", status, output) cb(status, output) diff --git a/test/all.js b/test/all.js index 4c2b2b7..10cc019 100644 --- a/test/all.js +++ b/test/all.js @@ -158,6 +158,7 @@ describe("all", function(){ it("should get delta results", function(done) { client.delta(function(status, reply){ status.should.eql(200) + reply.should.have.property("reset", true) done() }) })