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

@uppy/xhr-upload

Package Overview
Dependencies
Maintainers
5
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppy/xhr-upload - npm Package Compare versions

Comparing version 3.6.4 to 4.0.0-beta.1

lib/index.d.ts

7

CHANGELOG.md
# @uppy/xhr-upload
## 4.0.0-beta.1
Released: 2024-03-28
Included in: Uppy v4.0.0-beta.1
- @uppy/aws-s3-multipart,@uppy/tus,@uppy/utils,@uppy/xhr-upload: Make `allowedMetaFields` consistent (Merlijn Vos / #5011)
## 3.6.4

@@ -4,0 +11,0 @@

13

lib/index.js

@@ -17,6 +17,8 @@ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }

// @ts-ignore We don't want TS to generate types for the package.json
import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't want TS to generate types for the package.json
const packageJson = {
"version": "3.6.4"
"version": "4.0.0-beta.1"
};

@@ -60,3 +62,3 @@ import locale from "./locale.js";

method: 'post',
allowedMetaFields: null,
allowedMetaFields: true,
responseUrlFieldName: 'url',

@@ -208,4 +210,3 @@ bundle: false,

addMetadata(formData, meta, opts) {
const allowedMetaFields = Array.isArray(opts.allowedMetaFields) ? opts.allowedMetaFields : Object.keys(meta); // Send along all fields by default.
const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, meta);
allowedMetaFields.forEach(item => {

@@ -489,5 +490,3 @@ const value = meta[item];

const opts = this.getOptions(file);
const allowedMetaFields = Array.isArray(opts.allowedMetaFields) ? opts.allowedMetaFields
// Send along all fields by default.
: Object.keys(file.meta);
const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, file.meta);
return {

@@ -494,0 +493,0 @@ ...((_file$remote = file.remote) == null ? void 0 : _file$remote.body),

{
"name": "@uppy/xhr-upload",
"description": "Plain and simple classic HTML multipart form uploads with Uppy, as well as uploads using the HTTP PUT method.",
"version": "3.6.4",
"version": "4.0.0-beta.1",
"license": "MIT",
"main": "lib/index.js",
"types": "types/index.d.ts",
"type": "module",

@@ -28,4 +27,4 @@ "keywords": [

"dependencies": {
"@uppy/companion-client": "^3.7.4",
"@uppy/utils": "^5.7.4",
"@uppy/companion-client": "^4.0.0-beta.1",
"@uppy/utils": "^6.0.0-beta.1",
"nanoid": "^4.0.0"

@@ -38,4 +37,5 @@ },

"peerDependencies": {
"@uppy/core": "^3.9.3"
}
"@uppy/core": "^4.0.0-beta.1"
},
"stableVersion": "3.6.4"
}

@@ -23,2 +23,3 @@ import BasePlugin from '@uppy/core/lib/BasePlugin.js'

import type { State, Uppy } from '@uppy/core'
import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment

@@ -65,3 +66,3 @@ // @ts-ignore We don't want TS to generate types for the package.json

getResponseError?: (body: string, xhr: XMLHttpRequest) => Error | NetworkError
allowedMetaFields?: string[] | null
allowedMetaFields?: string[] | boolean
bundle?: boolean

@@ -110,3 +111,3 @@ responseUrlFieldName?: string

method: 'post',
allowedMetaFields: null,
allowedMetaFields: true,
responseUrlFieldName: 'url',

@@ -246,6 +247,3 @@ bundle: false,

): void {
const allowedMetaFields =
Array.isArray(opts.allowedMetaFields) ?
opts.allowedMetaFields
: Object.keys(meta) // Send along all fields by default.
const allowedMetaFields = getAllowedMetaFields(opts.allowedMetaFields, meta)

@@ -567,7 +565,6 @@ allowedMetaFields.forEach((item) => {

const opts = this.getOptions(file)
const allowedMetaFields =
Array.isArray(opts.allowedMetaFields) ?
opts.allowedMetaFields
// Send along all fields by default.
: Object.keys(file.meta)
const allowedMetaFields = getAllowedMetaFields(
opts.allowedMetaFields,
file.meta,
)
return {

@@ -574,0 +571,0 @@ ...file.remote?.body,

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