Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fanburst-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fanburst-api - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

25

lib/fanburst-api.js

@@ -9,23 +9,30 @@ 'use strict';

opts = opts || {};
this.credentials = opts.credentials || {};
var _this = this;
this.credentials = opts.credentials ? opts.credentials : {};
this.baseUrl = opts.baseUrl || 'https://api.fanburst.com';
var
credentials = {},
keysClientId = ['clientid', 'client_id', 'clientID', 'clientId'],
keysClientSecret = ['clientsecret', 'client_secret', 'clientSecret'],
keysCallbacks = ['callbackurl', 'callback_url', 'callbackUrl', 'callbackURL', 'redirecturi', 'redirectUri', 'redirect_uri'],
keysCredentials = [keysClientId, keysClientSecret, keysCallbacks];
objCredentials = {
clientId: keysClientId,
clientSecret: keysClientSecret,
redirect_uri: keysCallbacks
};
keysCredentials.forEach(function(arrKeys) {
arrKeys.forEach(function(key) {
for (var keyCredential in objCredentials) {
objCredentials[keyCredential].forEach(function(key) {
if (opts[key]) {
credentials.clientId = opts[key];
_this.credentials[keyCredential] = opts[key];
}
if (opts.credentials[key]) {
credentials.clientId = opts.credentials[key];
if (_this.credentials[key]) {
_this.credentials[keyCredential] = _this.credentials[key];
}
});
});
}
console.log('this', this);
}

@@ -32,0 +39,0 @@

{
"name": "fanburst-api",
"version": "1.0.0",
"version": "1.0.1",
"description": "Fanburst Api for Node.js",

@@ -23,10 +23,12 @@ "keywords": [

"author": {
"name" : "Igor Shabanov",
"name": "Igor Shabanov",
"email": "shabanovtg@gmail.com",
"url" : "http://shabanovtg.ru"
"url": "http://shabanovtg.ru"
},
"licenses": [ {
"type": "MIT",
"url": "http://www.opensource.org/licenses/MIT"
} ],
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/MIT"
}
],
"dependencies": {

@@ -33,0 +35,0 @@ "request-promise": "^3.0.0"

@@ -17,3 +17,4 @@ # fanburst-api

```
var FanburstApi = require('fanburst-api')();
var FanburstApi = require('fanburst-api');
var fanburstApi = new FanburstApi();
```

@@ -24,3 +25,3 @@

```
FanburstApi.me(accessToken, function(err, result) {
fanburstApi.me(accessToken, function(err, result) {
if (err) {

@@ -39,3 +40,3 @@ //...

```
FanburstApi.followingContains(followingId, accessToken, function(err, result) {
fanburstApi.followingContains(followingId, accessToken, function(err, result) {
if (err) {

@@ -52,3 +53,3 @@ //...

```
FanburstApi.followingAdd(followingId, accessToken, function(err, result) {
fanburstApi.followingAdd(followingId, accessToken, function(err, result) {
if (err) {

@@ -55,0 +56,0 @@ //...

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