New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mendeley/api

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mendeley/api - npm Package Compare versions

Comparing version 7.0.2 to 7.1.0

8

lib/utilities.js

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

/**

@@ -41,2 +40,3 @@ * Pass the second argument as it is. This is to allow receiving non-standard

function normaliseOptions(options) {
options.requestFilter = options.requestFilter || passFilter;
options.responseFilter = options.responseFilter || dataFilter;

@@ -107,2 +107,4 @@ options.args = options.args || [];

request = options.requestFilter(options, request);
return Request.create(request, settings)

@@ -148,2 +150,4 @@ .send()

request = options.requestFilter(options, request);
return Request.create(request, settings)

@@ -194,2 +198,4 @@ .send()

request = options.requestFilter(options, request);
return Request.create(request, settings)

@@ -196,0 +202,0 @@ .send()

2

package.json
{
"name": "@mendeley/api",
"version": "7.0.2",
"version": "7.1.0",
"description": "Mendeley API JavaScript SDK",

@@ -5,0 +5,0 @@ "directories": {

@@ -168,2 +168,28 @@ 'use strict';

it('should allow the request to be modified using a requestFilter', function() {
var requestFunction = utils.requestFun(assign({
requestFilter: function(options, request) {
request.headers.foo = 'bar';
return request;
},
method: 'GET',
resource: '/test'
}, defaultOptions));
requestFunction();
expect(requestCreateSpy).toHaveBeenCalledWith({
method: 'GET',
responseType: 'json',
url: 'https://api.mendeley.com/test',
headers: {
foo: 'bar'
},
params: undefined
}, {
authFlow: authFlow,
maxRetries: 1
});
});
});

@@ -238,2 +264,27 @@

it('should allow the request to be modified using a requestFilter', function() {
var requestFunction = utils.requestWithDataFun(assign({
requestFilter: function(options, request) {
request.headers.foo = 'bar';
return request;
},
method: 'POST',
resource: '/test'
}, defaultOptions));
requestFunction();
expect(requestCreateSpy).toHaveBeenCalledWith({
method: 'POST',
url: 'https://api.mendeley.com/test',
headers: {
foo: 'bar'
},
data: undefined
}, {
authFlow: authFlow,
followLocation: undefined
});
});
});

@@ -332,2 +383,28 @@

it('should allow the request to be modified using a requestFilter', function() {
var requestFunction = utils.requestWithFileFun(assign({
requestFilter: function(options, request) {
request.headers.foo = 'bar';
return request;
},
method: 'POST',
resource: '/test'
}, defaultOptions));
requestFunction(file, 'zelda');
expect(requestCreateSpy).toHaveBeenCalledWith({
method: 'POST',
url: 'https://api.mendeley.com/test',
headers: assign({
foo: 'bar'
}, headers),
data: file,
onUploadProgress: undefined,
onDownloadProgress: undefined
}, {
authFlow: authFlow
});
});
});

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