Socket
Socket
Sign inDemoInstall

node-yelp-api-v3

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

16

lib/index.js

@@ -78,3 +78,3 @@ 'use strict';

clearInterval(interval);
return reject(new Error('Token request timed out.'));
return reject(new Error('Yelp fetch token request timed out.'));
}

@@ -98,3 +98,8 @@ time += 100;

var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var tries = arguments[2];
if (!tries) {
tries = 0;
};
var promise = new Promise(function (resolve, reject) {

@@ -104,2 +109,3 @@ var debug = params.debug;

// If there is no access token, throw an error stating that
if (!_this3.access_token) {

@@ -111,2 +117,10 @@ return reject(new Error('Missing access_token'));

if (err) {
// Try three times on a 401 to refresh the access token
// It seems they last for about three months before expiring
if (tries < 3 && err.statusCode === 401) {
return _this3.getAccessToken().then(function () {
return _this3.makeReq(resource, params, tries);
});
}
return reject(err);

@@ -113,0 +127,0 @@ }

2

package.json
{
"name": "node-yelp-api-v3",
"version": "1.0.1",
"version": "1.0.2",
"description": "A promise-based JavaScript client for dealing with Yelp's API (v3).",

@@ -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