formdata-polyfill
Advanced tools
Comparing version 1.0.5 to 1.0.6
const map = new WeakMap | ||
const wm = o => map.get(o) | ||
function normilizeValue([value, filename]) { | ||
function normalizeValue([value, filename]) { | ||
if (value instanceof Blob) | ||
@@ -21,3 +21,3 @@ value = new File([value], filename, { | ||
function normilizeArgs(name, value, filename) { | ||
function normalizeArgs(name, value, filename) { | ||
if (arguments.length < 2) | ||
@@ -60,4 +60,4 @@ throw new TypeError(`2 arguments required, but only ${arguments.length} present.`) | ||
this.append(name, elm.value) | ||
else if (type === 'checkbox' && checked) | ||
this.append(name, value) | ||
else if (type === 'checkbox') | ||
if (checked) this.append(name, value) | ||
else | ||
@@ -108,3 +108,3 @@ this.append(name, value) | ||
for (let value of map[name]) | ||
yield [name, normilizeValue(value)] | ||
yield [name, normalizeValue(value)] | ||
} | ||
@@ -133,3 +133,3 @@ | ||
let map = wm(this) | ||
return map[name] ? normilizeValue(map[name][0]) : null | ||
return map[name] ? normalizeValue(map[name][0]) : null | ||
} | ||
@@ -145,3 +145,3 @@ | ||
getAll(name) { | ||
return (wm(this)[name] || []).map(normilizeValue) | ||
return (wm(this)[name] || []).map(normalizeValue) | ||
} | ||
@@ -281,3 +281,3 @@ | ||
for (let [method, overide] of [ | ||
['append', normilizeArgs], | ||
['append', normalizeArgs], | ||
['delete', stringify], | ||
@@ -287,3 +287,3 @@ ['get', stringify], | ||
['has', stringify], | ||
['set', normilizeArgs] | ||
['set', normalizeArgs] | ||
]) { | ||
@@ -290,0 +290,0 @@ let orig = FormDataPolyfill.prototype[method] |
{ | ||
"name": "formdata-polyfill", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "HTML5 `FormData` polyfill for Browsers.", | ||
@@ -5,0 +5,0 @@ "main": "FormData.js", |
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
10130