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

@uppy/companion-client

Package Overview
Dependencies
Maintainers
8
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppy/companion-client - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

24

lib/RequestClient.js
'use strict';
let _Symbol$for;
function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }

@@ -16,3 +18,3 @@

const packageJson = {
"version": "2.2.0"
"version": "2.2.1"
}; // Remove the trailing slash so we can always safely append /xyz.

@@ -47,2 +49,4 @@

var _companionHeaders = /*#__PURE__*/_classPrivateFieldLooseKey("companionHeaders");
var _getPostResponseFunc = /*#__PURE__*/_classPrivateFieldLooseKey("getPostResponseFunc");

@@ -54,2 +58,4 @@

_Symbol$for = Symbol.for('uppy test: getCompanionHeaders');
class RequestClient {

@@ -63,2 +69,6 @@ constructor(uppy, opts) {

});
Object.defineProperty(this, _companionHeaders, {
writable: true,
value: void 0
});
Object.defineProperty(this, _getPostResponseFunc, {

@@ -73,4 +83,13 @@ writable: true,

this.preflightDone = false;
_classPrivateFieldLooseBase(this, _companionHeaders)[_companionHeaders] = opts == null ? void 0 : opts.companionHeaders;
}
setCompanionHeaders(headers) {
_classPrivateFieldLooseBase(this, _companionHeaders)[_companionHeaders] = headers;
}
[_Symbol$for]() {
return _classPrivateFieldLooseBase(this, _companionHeaders)[_companionHeaders];
}
get hostname() {

@@ -85,5 +104,4 @@ const {

headers() {
const userHeaders = this.opts.companionHeaders || {};
return Promise.resolve({ ...RequestClient.defaultHeaders,
...userHeaders
..._classPrivateFieldLooseBase(this, _companionHeaders)[_companionHeaders]
});

@@ -90,0 +108,0 @@ }

2

package.json
{
"name": "@uppy/companion-client",
"description": "Client library for communication with Companion. Intended for use in Uppy plugins.",
"version": "2.2.0",
"version": "2.2.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -38,2 +38,4 @@ 'use strict'

#companionHeaders
#getPostResponseFunc = skip => response => (skip ? response : this.onReceiveResponse(response))

@@ -47,4 +49,11 @@

this.preflightDone = false
this.#companionHeaders = opts?.companionHeaders
}
setCompanionHeaders (headers) {
this.#companionHeaders = headers
}
[Symbol.for('uppy test: getCompanionHeaders')] () { return this.#companionHeaders }
get hostname () {

@@ -63,6 +72,5 @@ const { companion } = this.uppy.getState()

headers () {
const userHeaders = this.opts.companionHeaders || {}
return Promise.resolve({
...RequestClient.defaultHeaders,
...userHeaders,
...this.#companionHeaders,
})

@@ -69,0 +77,0 @@ }

Sorry, the diff of this file is not supported yet

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