Skip to content
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
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ jobs:
- name: Run Biome
run: biome ci .
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ typings/

dist
coverage
coverage.lcov
coverage.lcov
.DS_Store
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"source.fixAll": "explicit",
"source.organizeImports.biome": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
7 changes: 4 additions & 3 deletions bench/formidable.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { createReadStream } from 'node:fs'
// @ts-check

import { createReadStream } from 'node:fs'
import { createServer } from 'node:http'
import formidable from 'formidable'

const form = formidable({})

const server = createServer((req, res) => {
form.parse(req, (_, fields, files) => {
// @ts-expect-error this is JS
form.parse(req, (_, _fields, files) => {
// @ts-expect-error the file is guaaranteed in payload
const file = createReadStream(files.file[0].filepath)
file.pipe(res)
})
Expand Down
3 changes: 2 additions & 1 deletion bench/milliparsec-multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import { createServer } from 'node:http'
import * as bodyParser from '../dist/index.js'

const mw = bodyParser.multipart()

const server = createServer((req, res) => {
mw(req, res, () => {
/**
* @type {File}
*/
// @ts-ignore
// @ts-expect-error
const file = req.body.file[0]
const stream = file.stream()

Expand Down
6 changes: 3 additions & 3 deletions bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@types/body-parser": "^1.19.5",
"@types/body-parser": "^1.19.6",
"@types/formidable": "^3.4.5",
"autocannon": "^8.0.0",
"body-parser": "^1.20.3"
"body-parser": "^2.2.0"
},
"dependencies": {
"formidable": "^3.5.2"
"formidable": "^3.5.4"
}
}
Loading