form-data-extended 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/form-data.js +4 -3
  2. package/package.json +4 -5
package/lib/form-data.js CHANGED
@@ -20,12 +20,13 @@ const isValue = anyPass([
20
20
  ])
21
21
 
22
22
  /**
23
- * @param {Object} data - key values to append to the form data
23
+ * @param {Object} data - Key values to append to the form data.
24
+ * @param {FormData} FormDataCtor - Assumes browser FormData.
24
25
  *
25
26
  * @retuns {FormData}
26
27
  */
27
- function formData(data) {
28
- const formData = new FormData()
28
+ function formData(data, FormDataCtor = FormData) {
29
+ const formData = new FormDataCtor()
29
30
 
30
31
  const iter = (datum, path = []) =>
31
32
  isValue(datum)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form-data-extended",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Extended FormData",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -11,9 +11,7 @@
11
11
  "lib": "lib"
12
12
  },
13
13
  "scripts": {
14
- "pretest": "npm prune",
15
- "test": "npx tape ./lib/*.spec.js",
16
- "prepack": "npm test"
14
+ "test": "tape ./lib/*.spec.js"
17
15
  },
18
16
  "keywords": [
19
17
  "multipart",
@@ -34,6 +32,7 @@
34
32
  "lodash.topairs": "^4.3.0"
35
33
  },
36
34
  "devDependencies": {
37
- "spyn": "^0.2.4"
35
+ "spyn": "^0.2.4",
36
+ "tape": "^5.4.1"
38
37
  }
39
38
  }