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

isomorphic-fetch-http

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-fetch-http - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

3

lib/isomorphic-fetch-http.js

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

* @param {object} [options] The options we want to pass to "fetch"
* @param {object} header The request header
* @return {object} An object containing either "data" or "err"

@@ -40,3 +41,3 @@ */

return (0, _isomorphicFetch2.default)(url, _extends({}, httpConfig, { headers: _extends({}, httpConfig.headers, header) }, option)).then(function (resp) {
return (0, _isomorphicFetch2.default)(header.prefix ? '' + header.prefix + url : url, _extends({}, httpConfig, { headers: _extends({}, httpConfig.headers, header) }, option)).then(function (resp) {
if (resp.status >= 400) {

@@ -43,0 +44,0 @@ throw new Error('400+Error');

{
"name": "isomorphic-fetch-http",
"version": "0.1.3",
"version": "0.1.4",
"description": "react fetch by isomorphic-fetch",

@@ -5,0 +5,0 @@ "main": "lib/isomorphic-fetch-http.js",

@@ -22,3 +22,2 @@ ## isomorphic-fetch-http

- [Home page](https://github.com/jindada/react-http)
- [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch)

@@ -29,2 +28,2 @@

You can submit any ideas as [pull requests](https://github.com/jindada/isomorphic-fetch-http) or as a [GitLab issue](https://github.com/jindada/isomorphic-fetch-http/issues).
You can submit any ideas as [pull requests](https://github.com/jindada/isomorphic-fetch-http) or as a [Github issue](https://github.com/jindada/isomorphic-fetch-http/issues).

@@ -19,6 +19,7 @@ import fetch from 'isomorphic-fetch';

* @param {object} [options] The options we want to pass to "fetch"
* @param {object} header The request header
* @return {object} An object containing either "data" or "err"
*/
const $http = (url, option = {}, header = {}) => {
return fetch(url, { ...httpConfig, headers: { ...httpConfig.headers, ...header }, ...option })
return fetch(header.prefix ? `${header.prefix}${url}` : url, { ...httpConfig, headers: { ...httpConfig.headers, ...header }, ...option })
.then((resp) => {

@@ -25,0 +26,0 @@ if (resp.status >= 400) {

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