Socket
Socket
Sign inDemoInstall

formdata-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formdata-polyfill - npm Package Compare versions

Comparing version 1.0.7 to 2.0.0

formdata.min.js

26

FormData.js

@@ -15,3 +15,3 @@ const map = new WeakMap

function stringify(name) {
if (!arguments.length)
if (!arguments.length)
throw new TypeError('1 argument required, but only 0 present.')

@@ -23,10 +23,10 @@

function normalizeArgs(name, value, filename) {
if (arguments.length < 2)
if (arguments.length < 2)
throw new TypeError(`2 arguments required, but only ${arguments.length} present.`)
return value instanceof Blob
? [name + '', value, filename !== undefined
? filename + ''
return value instanceof Blob
? [name + '', value, filename !== undefined
? filename + ''
: value[Symbol.toStringTag] === 'File'
? value.name
? value.name
: 'Blob']

@@ -59,3 +59,3 @@ : [name + '', value + '']

else if (type === 'select-multiple' || type === 'select-one')
for (let elm of selectedOptions)
for (let elm of Array.from(selectedOptions))
this.append(name, elm.value)

@@ -157,4 +157,4 @@ else if (type === 'checkbox')

}
/**

@@ -202,3 +202,3 @@ * Iterate over all fields name

try {
return this._blob().stream()
return this['_blob']().stream()
} catch(e) {

@@ -216,3 +216,3 @@ throw new Error('Include https://github.com/jimmywarting/Screw-FileReader for streaming support')

*/
_asNative() {
['_asNative']() {
let fd = new FormData

@@ -232,3 +232,3 @@

*/
_blob() {
['_blob']() {
var boundary = '----formdata-polyfill-' + Math.random()

@@ -296,2 +296,2 @@ var chunks = []

module.exports = FormDataPolyfill
module['exports'] = FormDataPolyfill
{
"name": "formdata-polyfill",
"version": "1.0.7",
"version": "2.0.0",
"description": "HTML5 `FormData` polyfill for Browsers.",
"main": "FormData.js",
"main": "formdata.min.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

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