formdata-polyfill
Advanced tools
Comparing version 1.0.7 to 2.0.0
@@ -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" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15924
6
264