Skip to content

Commit ce9cd2a

Browse files
Alan ShawwobsorianoGozala
authored
fix: formdata util missing file (#68)
* fix: File in formdata util not defined * chore: add missing dependency @web-std/file * fix: move dep into package.js * chore: re-export File --------- Co-authored-by: wobsoriano <[email protected]> Co-authored-by: Irakli Gozalishvili <[email protected]>
1 parent 389c2b8 commit ce9cd2a

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

packages/fetch/package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@
7474
"homepage": "https://github.com/web-std/io",
7575
"devDependencies": {
7676
"@types/chai": "^4.3.0",
77-
"@types/mocha": "^9.1.0",
7877
"@types/chai-as-promised": "^7.1.5",
7978
"@types/chai-string": "^1.4.2",
79+
"@types/mocha": "^9.1.0",
8080
"abort-controller": "^3.0.0",
8181
"@web-std/file": "^3.0.2",
8282
"abortcontroller-polyfill": "^1.7.1",
@@ -94,17 +94,18 @@
9494
"p-timeout": "^3.2.0",
9595
"rollup": "^2.26.10",
9696
"tsd": "^0.13.1",
97-
"xo": "^0.33.1",
98-
"typescript": "^4.4.4"
97+
"typescript": "^4.4.4",
98+
"xo": "^0.33.1"
9999
},
100100
"dependencies": {
101101
"@web-std/blob": "^3.0.3",
102+
"@web-std/file": "^3.0.2",
102103
"@web-std/form-data": "^3.0.2",
103104
"@web-std/stream": "^1.0.1",
105+
"@web3-storage/multipart-parser": "^1.0.0",
104106
"abort-controller": "^3.0.0",
105107
"data-uri-to-buffer": "^3.0.1",
106-
"mrmime": "^1.0.0",
107-
"@web3-storage/multipart-parser": "^1.0.0"
108+
"mrmime": "^1.0.0"
108109
},
109110
"esm": {
110111
"sourceMap": true,

packages/fetch/src/lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// On the web we just export native fetch implementation
2-
export { ReadableStream, Blob, FormData } from './package.js';
2+
export { ReadableStream, Blob, FormData, File } from './package.js';
33
export const { Headers, Request, Response } = globalThis;
44
export default globalThis.fetch.bind(globalThis)

packages/fetch/src/lib.node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fetch as webFetch, Headers as WebHeaders, Request as WebRequest, Response as WebResponse } from "./fetch.js"
22

3-
export { ReadableStream, Blob, FormData } from './package.js';
3+
export { ReadableStream, Blob, FormData, File } from './package.js';
44
// Electron-renderer should get the browser implementation instead of node
55
// Browser configuration is not enough
66

packages/fetch/src/package.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
export { Blob, ReadableStream } from '@web-std/blob'
3+
export { File } from '@web-std/file'
34
export { FormData } from '@web-std/form-data'
45

56

packages/fetch/src/package.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const { FormData, Blob } = globalThis
1+
export const { FormData, Blob, File } = globalThis
22
export { ReadableStream } from "@web-std/stream"
33

44

packages/fetch/src/utils/form-data.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {randomBytes} from 'crypto';
22
import { iterateMultipart } from '@web3-storage/multipart-parser';
3-
import { FormData } from '../package.js';
4-
import {isBlob} from './is.js';
3+
import { FormData, File } from '../package.js';
4+
import { isBlob } from './is.js';
55

66
const carriage = '\r\n';
77
const dashes = '-'.repeat(2);

0 commit comments

Comments
 (0)