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.2.0 to 3.3.0

lib/__tests__/expectations/put-json.js

5

lib/__tests__/expectations/index.js

@@ -27,2 +27,6 @@ 'use strict';

var _putJson = require('./put-json');
var _putJson2 = _interopRequireDefault(_putJson);
var _ping = require('./ping');

@@ -44,4 +48,5 @@

postJson: _postJson2.default,
putJson: _putJson2.default,
ping: _ping2.default,
forbidden: _forbidden2.default
};

1

lib/__tests__/index.test.js

@@ -88,3 +88,4 @@ 'use strict';

describe('when making POST JSON request', test(_expectations2.default.postJson));
describe('when making PUT JSON request', test(_expectations2.default.putJson));
describe.skip('when making POST JSON failed request', test(_expectations2.default.forbidden));
});

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

exports.put = put;
exports.putJson = putJson;
exports.del = del;

@@ -113,2 +114,12 @@

function putJson(url) {
var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var headers = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
var merge = function merge(one, two) {
return Object.assign({}, one, two);
};
return put(url, params, merge(headers, { 'Content-type': 'application/json' }));
}
function del(url) {

@@ -133,2 +144,3 @@ var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

put: put,
putJson: putJson,
del: del,

@@ -135,0 +147,0 @@ setConfig: setConfig

2

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

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

@@ -52,2 +52,3 @@ # Nordnet nExt API Javascript client

* `api.put(url, params = {}, headers = {})`
* `api.putJson(url, params = {}, headers = {})` — `api.put` with `{ 'Content-type': 'application/json;' }` in headers
* `api.del(url, params = {}, headers = {})`

@@ -54,0 +55,0 @@

@@ -6,2 +6,3 @@ import getInstrument from './get-instrument';

import postJson from './post-json';
import putJson from './put-json';
import ping from './ping';

@@ -16,4 +17,5 @@ import forbidden from './forbidden';

postJson,
putJson,
ping,
forbidden,
};

@@ -57,3 +57,4 @@ import { initSandBox, respondWith, execute, expectations } from 'test-helper';

describe('when making POST JSON request', test(tests.postJson));
describe('when making PUT JSON request', test(tests.putJson));
describe.skip('when making POST JSON failed request', test(tests.forbidden));
});

@@ -75,2 +75,7 @@ import es6Promise from 'es6-promise';

export function putJson(url, params = {}, headers = {}) {
const merge = (one, two) => Object.assign({}, one, two);
return put(url, params, merge(headers, { 'Content-type': 'application/json' }));
}
export function del(url, params = {}, headers = {}) {

@@ -92,2 +97,3 @@ const options = {

put,
putJson,
del,

@@ -94,0 +100,0 @@ setConfig,

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