Socket
Socket
Sign inDemoInstall

linkage

Package Overview
Dependencies
47
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.3

27

index.js

@@ -30,3 +30,5 @@ 'use strict';

if (response.statusCode >= 400) {
return callback(new linkage.LinkedInError(body.message), body);
err = linkage.LinkedInError.createFromResponseBody(body);
return callback(err, body);
}

@@ -45,2 +47,3 @@

this.message = message;
this.body = {};
};

@@ -50,2 +53,24 @@

/**
*
* @param {Object|String} body JSON string or already parsed object
* @returns {linkage.LinkedInError}
*/
linkage.LinkedInError.createFromResponseBody = function (body) {
body = typeof body === 'object' ? body : JSON.parse(body);
// Errors from API v1 endpoints contain `message`, while errors from UAS use
// `error` and `error_description` properties.
var message = body.message || body.error;
var err = new linkage.LinkedInError(message);
err.setBody(body);
return err;
};
linkage.LinkedInError.prototype.setBody = function (body) {
this.body = body;
};
module.exports = linkage;

2

package.json
{
"name": "linkage",
"version": "0.0.1",
"version": "0.0.3",
"description": "Do raw requests to LinkedIn REST API using OAuth2 access tokens",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc