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

autofetch

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autofetch - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

dist/index.browser.js

2

package.json
{
"name": "autofetch",
"version": "1.0.11",
"version": "1.0.12",
"description": "fetch for node",

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

@@ -8,5 +8,5 @@ const realFetch = require('isomorphic-fetch/fetch-npm-browserify.js');

const fetchRequest = (url, options = {}, ...extras) => {
options.data ? options.method === 'GET' ? options.query = {...(options.query || {}), ...options.data} : options.body = {...(options.body || {}), ...options.data} : '';
options.data ? options.method === 'GET' ? options.query = { ...(options.query || {}), ...options.data } : options.body = { ...(options.body || {}), ...options.data } : '';
if(!options.method || options.method === 'GET'){
if (!options.method || options.method === 'GET') {
options.body = options.body || options.data;

@@ -16,3 +16,3 @@ }

options.headers = options.headers || {};
if(options.headers['Content-Type'] !== 'application/json' && !(options.body instanceof 'FormData') {
if (options.headers['Content-Type'] !== 'application/json' && !(options.body instanceof 'FormData')) {
// convert to FormData

@@ -19,0 +19,0 @@ options.body = toFormData(body);

@@ -10,5 +10,5 @@ "use strict";

const fetchRequest = (url, options = {}, ...extras) => {
options.data ? options.method === 'GET' ? options.query = {...(options.query || {}), ...options.data} : options.body = {...(options.body || {}), ...options.data} : '';
options.data ? options.method === 'GET' ? options.query = { ...(options.query || {}), ...options.data } : options.body = { ...(options.body || {}), ...options.data } : '';
if(!options.method || options.method === 'GET'){
if (!options.method || options.method === 'GET') {
options.body = options.body || options.data;

@@ -18,3 +18,3 @@ }

options.headers = options.headers || {};
if(options.headers['Content-Type'] !== 'application/json' && !(options.body instanceof 'FormData') {
if (options.headers['Content-Type'] !== 'application/json' && !(options.body instanceof 'FormData')) {
// convert to FormData

@@ -24,3 +24,3 @@ options.body = toFormData(body);

return realFetch.call(this, parseUrl(url, options,baseHost), options, ...extras).then(responseMiddleware).then(globalCallback);
return realFetch.call(this, parseUrl(url, options, baseHost), options, ...extras).then(responseMiddleware).then(globalCallback);
};

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