Socket
Socket
Sign inDemoInstall

eh-api-client

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eh-api-client - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

test/exists.js

31

index.js

@@ -62,2 +62,3 @@ var

var deferred = Q.defer();
var self = this;
if(typeof body === "function") {

@@ -143,3 +144,3 @@ cb = body;

}
var req = request(reqParams, function(err, res, data) {
var req = self._makeRequest(reqParams, function(err, res, data) {
_res = res;

@@ -166,2 +167,6 @@ if(err) {

Client.prototype._makeRequest = function() {
return request.apply(this, arguments);
};
Client.prototype.release = function(cb) {

@@ -176,2 +181,19 @@ this.delete("/locks/" + this.lockUUID, function(err, data) {

Client.prototype.exists = function(url, options, cb) {
if(typeof options === "function") {
cb = options;
options = null;
}
return this.request("head", url, options).then(function() {
return true;
}).catch(function(err) {
if(err) {
if(err.httpStatus === 404) {
return false;
}
throw err;
}
}).nodeify(cb);
};
methods.forEach(function(method) {

@@ -189,2 +211,9 @@ Client.prototype[method.toLowerCase()] = function() {

Factory.Client = Client;
Factory.prototype.exists = function() {
var c = new Client(this.apiURL);
return c.exists.apply(c, arguments);
};
methods.forEach(function(method) {

@@ -191,0 +220,0 @@ Factory.prototype[method.toLowerCase()] = function() {

7

package.json
{
"name": "eh-api-client",
"version": "0.9.0",
"version": "0.10.0",
"description": "Node.js rest client",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha test"
},

@@ -22,4 +22,5 @@ "repository": {

"eh-guid": "^0.2.0",
"should": "^6.0.3"
"should": "^6.0.3",
"sinon": "^1.15.4"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc