Socket
Socket
Sign inDemoInstall

nordnet-next-api

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nordnet-next-api - npm Package Compare versions

Comparing version 3.3.0 to 4.0.0

23

lib/index.js

@@ -29,3 +29,2 @@ 'use strict';

var HTTP_BAD_REQUEST = 400;
var HTTP_FORBIDDEN = 403;
var regUrlParam = /{([\s\S]+?)}/g;

@@ -176,23 +175,3 @@

var request = function request() {
return fetch(fetchUrl, fetchParams).then(validateStatus).then(saveNTag).then(processResponse);
};
var getNTag = function getNTag() {
return fetch('/api/2/login').then(validateStatus).then(saveNTag);
};
/**
* If the response status code is 403, the reason may be
* an invalid ntag. Try to get a valid one, and retry the
* request.
*/
return request().catch(function (response) {
if (response.status === HTTP_FORBIDDEN) {
return getNTag().then(request).catch(function () {
return validateStatus(response);
});
}
return validateStatus(response);
});
return fetch(fetchUrl, fetchParams).then(validateStatus).then(saveNTag).then(processResponse);
}

@@ -199,0 +178,0 @@

2

package.json
{
"name": "nordnet-next-api",
"version": "3.3.0",
"version": "4.0.0",
"description": "Nordnet nExt API Javascript client",

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

@@ -9,3 +9,2 @@ import es6Promise from 'es6-promise';

const HTTP_BAD_REQUEST = 400;
const HTTP_FORBIDDEN = 403;
const regUrlParam = /{([\s\S]+?)}/g;

@@ -128,24 +127,6 @@

const request = () => fetch(fetchUrl, fetchParams)
return fetch(fetchUrl, fetchParams)
.then(validateStatus)
.then(saveNTag)
.then(processResponse);
const getNTag = () => fetch('/api/2/login')
.then(validateStatus)
.then(saveNTag);
/**
* If the response status code is 403, the reason may be
* an invalid ntag. Try to get a valid one, and retry the
* request.
*/
return request().catch((response) => {
if (response.status === HTTP_FORBIDDEN) {
return getNTag()
.then(request)
.catch(() => validateStatus(response));
}
return validateStatus(response);
});
}

@@ -152,0 +133,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