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

@rpldy/sender

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rpldy/sender - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

30

lib/xhrSender/prepareFormData.js

@@ -22,2 +22,25 @@ "use strict";

/**
* mimics FormData.set() when its not available (react-native)
* in case FormData.delete() isnt available, will append only (unlike set)
*/
var addToFormData = function addToFormData(fd, name) {
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
rest[_key - 2] = arguments[_key];
}
//rest = [value, fileName = undefined]
if (fd.set) {
// $FlowFixMe - ignore flow for not allowing FileLike here
fd.set.apply(fd, [name].concat(rest));
} else {
if (fd["delete"]) {
fd["delete"](name);
} // $FlowFixMe - ignore flow for not allowing FileLike here
fd.append.apply(fd, [name].concat(rest));
}
};
var getFormFileField = function getFormFileField(fd, items, options) {

@@ -29,6 +52,5 @@ var single = items.length === 1;

if (item.file) {
// $FlowFixMe - ignore flow for not allowing FileLike here
fd.set(name, item.file, item.file.name);
addToFormData(fd, name, item.file, item.file.name);
} else if (item.url) {
fd.set(name, item.url);
addToFormData(fd, name, item.url);
}

@@ -48,3 +70,3 @@ });

return fd.set(key, val);
return addToFormData(fd, key, val);
});

@@ -51,0 +73,0 @@ }

10

package.json
{
"version": "0.4.1",
"version": "0.5.0",
"name": "@rpldy/sender",

@@ -16,10 +16,10 @@ "description": "react-uploady's default XHR sender",

"scripts": {
"build": "node ../../scripts/build.js",
"build": "node ../../../scripts/build.js",
"flow:copy": "flow-copy-source ./src ./lib --ignore **/*.test.js --ignore **/*.mock.js; cp src/types.js lib/types.js"
},
"dependencies": {
"@rpldy/shared": "^0.4.1"
"@rpldy/shared": "^0.5.0"
},
"devDependencies": {
"flow-bin": "^0.130.0"
"flow-bin": "^0.133.0"
},

@@ -29,3 +29,3 @@ "publishConfig": {

},
"gitHead": "5978d6e0e9cf6257fdb0bce611742e2e7c95d215"
"gitHead": "ccd432a0d36a69f08fa65494d0a63735767fb273"
}

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