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

portals

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

portals - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

1

dist/index.d.ts

@@ -7,2 +7,3 @@ export interface Request {

cors?: boolean;
withCredentials?: boolean;
}

@@ -9,0 +10,0 @@ export interface Response {

9

dist/index.es.js

@@ -57,3 +57,3 @@ /*! *****************************************************************************

xhr.open(request.method, request.url, true);
xhr.withCredentials = request.cors;
xhr.withCredentials = request.withCredentials;
// Add each header to the XHR request

@@ -97,5 +97,10 @@ for (var k in request.headers) {

var contentType = (request.body instanceof FormData ? "multipart/form-data" : "text/plain");
// The "cors" option is being deprecated in favor of the more properly
// named "withCredentials"
if (request.cors) {
console.warn("DEPRECATION WARNING: Use `withCredentials` instead of `cors`.");
}
// Create a new copy of our request object so middleware doesn't mutate
// a given object
request = __assign({ method: "GET", cors: true, headers: {
request = __assign({ method: "GET", withCredentials: (request.cors || false), headers: {
"Content-Type": contentType

@@ -102,0 +107,0 @@ } }, request);

@@ -61,3 +61,3 @@ 'use strict';

xhr.open(request.method, request.url, true);
xhr.withCredentials = request.cors;
xhr.withCredentials = request.withCredentials;
// Add each header to the XHR request

@@ -101,5 +101,10 @@ for (var k in request.headers) {

var contentType = (request.body instanceof FormData ? "multipart/form-data" : "text/plain");
// The "cors" option is being deprecated in favor of the more properly
// named "withCredentials"
if (request.cors) {
console.warn("DEPRECATION WARNING: Use `withCredentials` instead of `cors`.");
}
// Create a new copy of our request object so middleware doesn't mutate
// a given object
request = __assign({ method: "GET", cors: true, headers: {
request = __assign({ method: "GET", withCredentials: (request.cors || false), headers: {
"Content-Type": contentType

@@ -106,0 +111,0 @@ } }, request);

{
"name": "portals",
"version": "2.0.0",
"version": "2.1.0",
"description": "Client-side HTTP requests with middleware support.",

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

@@ -49,3 +49,3 @@ ![Portals](logo.png)

**body** | `any` | The request body used by `POST`, `PUT` and `PATCH` requests. By default, you should use `string` or `FormData` formats unless you have middleware in place to handle type conversions.
**cors** | `boolean` | Sets the value of the `.withCredentials` property of the XHR instance for the request in order to allow Cross-Domain calls. _Defaults to `true`._
**withCredentials** | `boolean` | Sets the value of the `.withCredentials` property of the XHR instance for the request in order to allow secured cross-domain calls. _Defaults to `true`._

@@ -52,0 +52,0 @@ ### The Response Object

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