form-data-extended 0.0.9 → 0.0.11

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.
@@ -0,0 +1,25 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ id-token: write # Required for OIDC
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v6
17
+
18
+ - uses: actions/setup-node@v6
19
+ with:
20
+ node-version: '24'
21
+ registry-url: 'https://registry.npmjs.org'
22
+ - run: npm ci
23
+ - run: npm run build --if-present
24
+ - run: npm test
25
+ - run: npm publish
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.11",
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": "npx 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
  }