eh-api-client
Advanced tools
Comparing version 0.8.1 to 0.8.2
12
index.js
@@ -108,3 +108,10 @@ var | ||
} | ||
deferred.promise.nodeify(cb); | ||
// _res will store result of http request, for return in callback | ||
var _res; | ||
deferred.promise.nodeify(function(err, data) { | ||
if(!cb) { | ||
return; | ||
} | ||
cb(err, data, _res); | ||
}); | ||
if(options.test) { | ||
@@ -117,2 +124,3 @@ process.nextTick(function() { | ||
request(reqParams, function(err, res, data) { | ||
_res = res; | ||
if(err) { | ||
@@ -124,3 +132,3 @@ return deferred.reject(err); | ||
} | ||
deferred.resolve(data, res); | ||
deferred.resolve(data); | ||
}); | ||
@@ -127,0 +135,0 @@ return deferred.promise; |
{ | ||
"name": "eh-api-client", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Node.js rest client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -32,4 +32,5 @@ var | ||
it("get note", function(done) { | ||
client.get("/notes/" + noteGlobalId, function(err, data) { | ||
client.get("/notes/" + noteGlobalId, function(err, data, res) { | ||
should.not.exists(err); | ||
res.should.type("object"); | ||
data.title.should.equal("test note"); | ||
@@ -36,0 +37,0 @@ data.globalId.should.equal(noteGlobalId); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8298
291