diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 80f93f9..f791b8c 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -74,9 +74,9 @@ "homepage": "https://github.com/web-std/io", "devDependencies": { "@types/chai": "^4.3.0", - "@types/mocha": "^9.1.0", "@types/chai-as-promised": "^7.1.5", "@types/chai-string": "^1.4.2", + "@types/mocha": "^9.1.0", "abort-controller": "^3.0.0", "@web-std/file": "^3.0.2", "abortcontroller-polyfill": "^1.7.1", @@ -94,17 +94,18 @@ "p-timeout": "^3.2.0", "rollup": "^2.26.10", "tsd": "^0.13.1", - "xo": "^0.33.1", - "typescript": "^4.4.4" + "typescript": "^4.4.4", + "xo": "^0.33.1" }, "dependencies": { "@web-std/blob": "^3.0.3", + "@web-std/file": "^3.0.2", "@web-std/form-data": "^3.0.2", "@web-std/stream": "^1.0.1", + "@web3-storage/multipart-parser": "^1.0.0", "abort-controller": "^3.0.0", "data-uri-to-buffer": "^3.0.1", - "mrmime": "^1.0.0", - "@web3-storage/multipart-parser": "^1.0.0" + "mrmime": "^1.0.0" }, "esm": { "sourceMap": true, diff --git a/packages/fetch/src/lib.js b/packages/fetch/src/lib.js index d46bdc8..a5aa83e 100644 --- a/packages/fetch/src/lib.js +++ b/packages/fetch/src/lib.js @@ -1,4 +1,4 @@ // On the web we just export native fetch implementation -export { ReadableStream, Blob, FormData } from './package.js'; +export { ReadableStream, Blob, FormData, File } from './package.js'; export const { Headers, Request, Response } = globalThis; export default globalThis.fetch.bind(globalThis) diff --git a/packages/fetch/src/lib.node.js b/packages/fetch/src/lib.node.js index 86dfdb7..e392bd7 100644 --- a/packages/fetch/src/lib.node.js +++ b/packages/fetch/src/lib.node.js @@ -1,6 +1,6 @@ import { fetch as webFetch, Headers as WebHeaders, Request as WebRequest, Response as WebResponse } from "./fetch.js" -export { ReadableStream, Blob, FormData } from './package.js'; +export { ReadableStream, Blob, FormData, File } from './package.js'; // Electron-renderer should get the browser implementation instead of node // Browser configuration is not enough diff --git a/packages/fetch/src/package.js b/packages/fetch/src/package.js index cdd8d5b..63ed3da 100644 --- a/packages/fetch/src/package.js +++ b/packages/fetch/src/package.js @@ -1,5 +1,6 @@ export { Blob, ReadableStream } from '@web-std/blob' +export { File } from '@web-std/file' export { FormData } from '@web-std/form-data' diff --git a/packages/fetch/src/package.ts b/packages/fetch/src/package.ts index 993899d..a9c51bc 100644 --- a/packages/fetch/src/package.ts +++ b/packages/fetch/src/package.ts @@ -1,4 +1,4 @@ -export const { FormData, Blob } = globalThis +export const { FormData, Blob, File } = globalThis export { ReadableStream } from "@web-std/stream" diff --git a/packages/fetch/src/utils/form-data.js b/packages/fetch/src/utils/form-data.js index 9cafe05..f9dab0d 100644 --- a/packages/fetch/src/utils/form-data.js +++ b/packages/fetch/src/utils/form-data.js @@ -1,7 +1,7 @@ import {randomBytes} from 'crypto'; import { iterateMultipart } from '@web3-storage/multipart-parser'; -import { FormData } from '../package.js'; -import {isBlob} from './is.js'; +import { FormData, File } from '../package.js'; +import { isBlob } from './is.js'; const carriage = '\r\n'; const dashes = '-'.repeat(2);