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

universal-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-api - npm Package Compare versions

Comparing version

to
0.1.1

14

dist/index.js

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

var fnOrObject = function fnOrObject(input) {
function fnOrObject(input) {
if (typeof input === 'function') {
return input();
return input.call(this);
} else {

@@ -69,3 +69,3 @@ return input || {};

var requestQuery = _extends({}, fnOrObject(_this.query), query);
var requestQuery = _extends({}, fnOrObject.call(_this, _this.query), query);

@@ -75,3 +75,3 @@ req.query(requestQuery);

if (method === 'POST' || method === 'PUT') {
var requestBody = _extends({}, fnOrObject(_this.body), body);
var requestBody = _extends({}, fnOrObject.call(_this, _this.body), body);

@@ -81,3 +81,3 @@ req.send(requestBody);

var requestHeaders = _extends({}, fnOrObject(_this.headers), headers);
var requestHeaders = _extends({}, fnOrObject.call(_this, _this.headers), headers);

@@ -139,3 +139,7 @@ req.set(requestHeaders);

UniversalApi.prototype.setToken = function (token) {
this.token = token;
};
exports['default'] = UniversalApi;
module.exports = exports['default'];
{
"name": "universal-api",
"version": "0.1.0",
"version": "0.1.1",
"description": "universal-api",

@@ -15,3 +15,2 @@ "main": "dist/index.js",

},
"preferGlobal": "true",
"repository": {

@@ -18,0 +17,0 @@ "type": "git",

@@ -18,5 +18,5 @@ import Promise from 'bluebird';

const fnOrObject = input => {
function fnOrObject(input) {
if (typeof input === 'function') {
return input();
return input.call(this);
} else {

@@ -36,3 +36,3 @@ return input || {};

const requestQuery = {
...fnOrObject(this.query),
...fnOrObject.call(this, this.query),
...query

@@ -45,3 +45,3 @@ };

const requestBody = {
...fnOrObject(this.body),
...fnOrObject.call(this, this.body),
...body

@@ -54,3 +54,3 @@ };

const requestHeaders = {
...fnOrObject(this.headers),
...fnOrObject.call(this, this.headers),
...headers

@@ -97,2 +97,6 @@ };

UniversalApi.prototype.setToken = function(token) {
this.token = token;
};
export default UniversalApi;