Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: formdata util missing file #68

Merged
merged 5 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/fetch/src/lib.js
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion packages/fetch/src/lib.node.js
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions packages/fetch/src/package.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

export { Blob, ReadableStream } from '@web-std/blob'
export { File } from '@web-std/file'
export { FormData } from '@web-std/form-data'


2 changes: 1 addition & 1 deletion packages/fetch/src/package.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const { FormData, Blob } = globalThis
export const { FormData, Blob, File } = globalThis
export { ReadableStream } from "@web-std/stream"


4 changes: 2 additions & 2 deletions packages/fetch/src/utils/form-data.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Loading