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

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 2.0.0 to 2.1.0

16

lib/__tests__/index.test.js

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

it('should set ntag header', function () {
it('should set expected headers', function () {
return (0, _chai.expect)(fetchSpy.args[1][1].headers).to.deep.equal({ 'Content-type': 'application/x-www-form-urlencoded', Accept: 'application/json', 'Accept-Language': 'sv', ntag: ntag });

@@ -231,2 +231,16 @@ });

});
describe('when making POST request with custom Content-type header', function () {
beforeEach(settle(_index.post, '/next/2/user/lists/{list_id}/{instrument_id}', { list_id: 1, instrument_id: 101 }, { 'Accept-Language': 'sv', 'Content-type': 'application/json' }));
it('should set expected headers', function () {
return (0, _chai.expect)(fetchSpy.args[1][1].headers).to.deep.equal({ 'Content-type': 'application/json', Accept: 'application/json', 'Accept-Language': 'sv', ntag: ntag });
});
it('should set method \'post\'', function () {
return (0, _chai.expect)(fetchSpy.args[1][1].method).to.equal('post');
});
it('should include credentials', function () {
return (0, _chai.expect)(fetchSpy.args[1][1].credentials).to.equal('include');
});
});
});

@@ -233,0 +247,0 @@

4

lib/index.js

@@ -200,5 +200,5 @@ 'use strict';

if (method === 'post' || method === 'put') {
return _lodash2['default'].merge({ ntag: state.nTag }, headers, postDefaultHeaders);
return _lodash2['default'].merge({ ntag: state.nTag }, postDefaultHeaders, headers);
} else if (method === 'delete') {
return _lodash2['default'].merge({ ntag: state.nTag }, headers, defaultHeaders);
return _lodash2['default'].merge({ ntag: state.nTag }, defaultHeaders, headers);
}

@@ -205,0 +205,0 @@

{
"name": "nordnet-next-api",
"version": "2.0.0",
"version": "2.1.0",
"description": "Nordnet nExt API Javascript client",

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

@@ -182,3 +182,3 @@ import 'test-helper';

it('should set ntag header', () =>
it('should set expected headers', () =>
expect(fetchSpy.args[1][1].headers).to.deep.equal(

@@ -189,2 +189,13 @@ { 'Content-type': 'application/x-www-form-urlencoded', Accept: 'application/json', 'Accept-Language': 'sv', ntag: ntag }));

});
describe('when making POST request with custom Content-type header', () => {
beforeEach(settle(post, '/next/2/user/lists/{list_id}/{instrument_id}',
{ list_id: 1, instrument_id: 101}, { 'Accept-Language': 'sv', 'Content-type': 'application/json' }));
it('should set expected headers', () =>
expect(fetchSpy.args[1][1].headers).to.deep.equal(
{ 'Content-type': 'application/json', Accept: 'application/json', 'Accept-Language': 'sv', ntag: ntag }));
it('should set method \'post\'', () => expect(fetchSpy.args[1][1].method).to.equal('post'));
it('should include credentials', () => expect(fetchSpy.args[1][1].credentials).to.equal('include'));
});
});

@@ -191,0 +202,0 @@

@@ -166,5 +166,5 @@ import es6Promise from 'es6-promise';

if (method === 'post' || method === 'put') {
return _.merge({ ntag: state.nTag }, headers, postDefaultHeaders);
return _.merge({ ntag: state.nTag }, postDefaultHeaders, headers);
} else if (method === 'delete') {
return _.merge({ ntag: state.nTag }, headers, defaultHeaders);
return _.merge({ ntag: state.nTag }, defaultHeaders, headers);
}

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