object-to-formdata
Advanced tools
Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "object-to-formdata", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "A convenient JavaScript function that converts an object to a FormData instance", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,5 +22,10 @@ # object-to-formdata | ||
const formData = objectToFormData(object, options) | ||
const formData = objectToFormData( | ||
object, | ||
options, // optional | ||
existingFormData, // optional | ||
keyPrefix // optional | ||
) | ||
console.log(formData) | ||
``` |
@@ -343,7 +343,6 @@ import test from 'ava' | ||
test('FormData instance as second parameter', t => { | ||
const foo = 'foo' | ||
const data = new FormData() | ||
const existingFormData = new FormData() | ||
const formData = objectToFormData({ | ||
foo | ||
}, data) | ||
foo: 'bar' | ||
}, existingFormData) | ||
@@ -353,6 +352,6 @@ t.true(formData.append.calledOnce) | ||
'foo', | ||
foo | ||
'bar' | ||
]) | ||
t.is(formData.get('foo'), foo) | ||
t.is(data, formData) | ||
t.is(formData.get('foo'), 'bar') | ||
t.is(formData, existingFormData) | ||
}) |
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
10557
31
374