@mendeley/api
Advanced tools
Comparing version 7.0.1 to 7.0.2
@@ -11,5 +11,8 @@ 'use strict'; | ||
if (typeof process === 'object' && process + '' === '[object process]') { | ||
global.window = {}; | ||
} | ||
try { | ||
// prevent crashing in node-like environments | ||
if (!global.window) { | ||
global.window = {}; | ||
} | ||
} catch (e) {} | ||
@@ -35,17 +38,17 @@ var endpointFactories = { | ||
function createEndpoints (options) { | ||
var endpoints = {}; | ||
var endpoints = {}; | ||
Object.keys(endpointFactories).forEach(function(endpointName) { | ||
endpoints[endpointName] = endpointFactories[endpointName](options); | ||
}); | ||
Object.keys(endpointFactories).forEach(function(endpointName) { | ||
endpoints[endpointName] = endpointFactories[endpointName](options); | ||
}); | ||
return endpoints; | ||
return endpoints; | ||
} | ||
module.exports = function (options) { | ||
var api = {}; | ||
var api = {}; | ||
assign(api, createEndpoints(options)); | ||
assign(api, createEndpoints(options)); | ||
return api; | ||
return api; | ||
}; |
{ | ||
"name": "@mendeley/api", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "Mendeley API JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "directories": { |
1521285
15473