From 6a3f49ba47c2aa60f930df57086ab26d680add4d Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Thu, 18 Sep 2025 21:48:18 +0200 Subject: [PATCH] Fix typos --- README.md | 4 ++-- benchmark/server.js | 2 +- examples/forceBuffer.js | 6 +++--- examples/with-http.js | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a3990fd5..076207df 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ at Twitter. This project is [semantically versioned](https://semver.org) and if you want support in migrating between versions you can schedule us for training or support us through donations, so we can prioritize. > [!CAUTION] -> As of April 2025, old versions like v1 and v2 are still the most used, while they are deperecated for years -- they are also vulnerable to attacks if you are not implementing it properly. **Please upgrade!** We are here to help, and AI Editors & Agents could help a lot in such codemod-like migrations. +> As of April 2025, old versions like v1 and v2 are still the most used, while they are deprecated for years -- they are also vulnerable to attacks if you are not implementing it properly. **Please upgrade!** We are here to help, and AI Editors & Agents could help a lot in such codemod-like migrations. > [!TIP] > If you are starting a fresh project, you can check out the `formidable-mini` which is a super minimal version of Formidable (not quite configurable yet, but when it does it could become the basis for `formidable@v4`), using web standards like FormData API and File API, and you can use it to stream uploads directly to S3 or other such services. @@ -322,7 +322,7 @@ See it's defaults in [src/Formidable.js DEFAULT_OPTIONS](./src/Formidable.js) extensions of the original files or not - `options.allowEmptyFiles` **{boolean}** - default `false`; allow upload empty files -- `options.minFileSize` **{number}** - default `1` (1byte); the minium size of +- `options.minFileSize` **{number}** - default `1` (1byte); the minimum size of uploaded file. - `options.maxFiles` **{number}** - default `Infinity`; limit the amount of uploaded files, set Infinity for unlimited diff --git a/benchmark/server.js b/benchmark/server.js index f99f176b..e3bf46c4 100644 --- a/benchmark/server.js +++ b/benchmark/server.js @@ -1,4 +1,4 @@ -// inital copy of with-http.js +// initial copy of with-http.js // made a copy so that examples can be changed without impacting tests import http from 'node:http'; import slugify from '@sindresorhus/slugify'; diff --git a/examples/forceBuffer.js b/examples/forceBuffer.js index 47411499..5cda7592 100644 --- a/examples/forceBuffer.js +++ b/examples/forceBuffer.js @@ -1,4 +1,4 @@ -// warning: forcing file into a Buffer elminates the benefits of using streams and may cause memory overflow +// warning: forcing file into a Buffer eliminates the benefits of using streams and may cause memory overflow import http from 'node:http'; import { Buffer } from 'node:buffer' import { Writable } from 'node:stream'; @@ -12,10 +12,10 @@ const server = http.createServer((req, res) => { const form = formidable({ fileWriteStreamHandler: (file) => { const chunks = []; - + const writable = new Writable({ write (chunk, enc, next) { - chunks.push(chunk); + chunks.push(chunk); next(); }, destroy() { diff --git a/examples/with-http.js b/examples/with-http.js index 91d61a3b..39ba2989 100644 --- a/examples/with-http.js +++ b/examples/with-http.js @@ -28,12 +28,12 @@ const server = http.createServer((req, res) => { if (!originalFilename) { return 'invalid'; } - - // return 'yo.txt'; // or completly different name + + // return 'yo.txt'; // or completely different name // return 'z/yo.txt'; // subdirectory return originalFilename.split("/").map((subdir) => { return slugify(subdir, {separator: ''}); // slugify to avoid invalid filenames - }).join("/").substr(0, 100); // substr to define a maximum + }).join("/").substr(0, 100); // substr to define a maximum }, filter: function ({name, originalFilename, mimetype}) { return Boolean(originalFilename);