Socket
Socket
Sign inDemoInstall

@shopify/react-network

Package Overview
Dependencies
Maintainers
13
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-network - npm Package Compare versions

Comparing version 3.1.6 to 3.1.8

6

CHANGELOG.md

@@ -8,4 +8,8 @@ # Changelog

<!-- ## [Unreleased] -->
## Unreleased
## Fixed
- Store network headers in lowercase [#915](https://github.com/Shopify/quilt/pull/915)
## [3.1.2] - 2019-08-21

@@ -12,0 +16,0 @@

2

dist/context.d.ts

@@ -1,3 +0,3 @@

import * as React from 'react';
import React from 'react';
import { NetworkManager } from './manager';
export declare const NetworkContext: React.Context<NetworkManager | null>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
exports.NetworkContext = React.createContext(null);
var react_1 = tslib_1.__importDefault(require("react"));
exports.NetworkContext = react_1.default.createContext(null);

@@ -14,6 +14,6 @@ import { StatusCode, CspDirective } from '@shopify/network';

private readonly headers;
private readonly requestHeaders?;
private readonly requestHeaders;
constructor({ headers }?: Options);
reset(): void;
getHeader(header: string): string | undefined;
getHeader(header: string): string;
setHeader(header: string, value: string): void;

@@ -20,0 +20,0 @@ redirectTo(url: string, status?: StatusCode): void;

@@ -24,3 +24,3 @@ "use strict";

this.headers = new Map();
this.requestHeaders = headers;
this.requestHeaders = normalizeHeaders(headers);
}

@@ -90,1 +90,11 @@ NetworkManager.prototype.reset = function () {

exports.NetworkManager = NetworkManager;
function normalizeHeaders(headers) {
if (!headers) {
return {};
}
return Object.entries(headers).reduce(function (accumulator, _a) {
var _b = tslib_1.__read(_a, 2), key = _b[0], value = _b[1];
accumulator[key.toLowerCase()] = value;
return accumulator;
}, {});
}
{
"name": "@shopify/react-network",
"version": "3.1.6",
"version": "3.1.8",
"license": "MIT",

@@ -28,3 +28,3 @@ "description": "A collection of components that allow you to set common HTTP headers from within your React application.",

"@shopify/network": "^1.4.1",
"@shopify/react-effect": "^3.2.1",
"@shopify/react-effect": "^3.2.2",
"@types/koa": "^2.0.46",

@@ -31,0 +31,0 @@ "tslib": "^1.9.3"

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