From 493ec88520c960d0d848d55a929630fde62f2aae Mon Sep 17 00:00:00 2001
From: Josh Soref <2119212+jsoref@users.noreply.github.com>
Date: Mon, 17 Oct 2022 08:17:43 -0400
Subject: [PATCH] fix: Spelling (#897)
by: Josh Soref
---
.eslintrc.cjs | 2 +-
README.md | 6 +++---
examples/json.js | 6 +++---
examples/multiples.js | 4 ++--
examples/with-http.js | 2 +-
src/Formidable.js | 2 +-
src/parsers/Multipart.js | 2 +-
src/plugins/multipart.js | 2 +-
test/integration/fixtures.test.js | 2 +-
test/standalone/connection-aborted.test.js | 4 ++--
test/standalone/content-transfer-encoding.test.js | 4 ++--
test/standalone/end-event-emitted-twice.test.js | 6 +++---
test/standalone/issue-46.test.js | 4 ++--
test/standalone/keep-alive-error.test.js | 6 +++---
test/unit/custom-plugins.test.js | 6 +++---
test/unit/formidable.test.js | 2 +-
16 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 3b6d4df6..fd6e9583 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -18,7 +18,7 @@ const ignoredProps = bestPractices.rules[
'cfg',
);
-// Additional rules that are specific and overiding previous
+// Additional rules that are specific and overriding previous
const additionalChanges = {
strict: 'off',
diff --git a/README.md b/README.md
index f404040d..9808dacb 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ at Twitter.
[![Conventional Commits][ccommits-img]][ccommits-url]
[![Minimum Required Nodejs][nodejs-img]][npmv-url]
-[![Tidelift Subcsription][tidelift-img]][tidelift-url]
+[![Tidelift Subscription][tidelift-img]][tidelift-url]
[![Buy me a Kofi][kofi-img]][kofi-url]
[![Renovate App Status][renovateapp-img]][renovateapp-url]
[![Make A Pull Request][prs-welcome-img]][prs-welcome-url]
@@ -491,7 +491,7 @@ form.on('data', ({ name, key, value, buffer, start, end, formname, ...more }) =>
### .use(plugin: Plugin)
A method that allows you to extend the Formidable library. By default we include
-4 plugins, which esentially are adapters to plug the different built-in parsers.
+4 plugins, which essentially are adapters to plug the different built-in parsers.
**The plugins added by this method are always enabled.**
@@ -648,7 +648,7 @@ form.on('fileBegin', (formName, file) => {
// formName the name in the form () or http filename for octetstream
// file.originalFilename http filename or null if there was a parsing error
// file.newFilename generated hexoid or what options.filename returned
- // file.filepath default pathnme as per options.uploadDir and options.filename
+ // file.filepath default pathname as per options.uploadDir and options.filename
// file.filepath = CUSTOM_PATH // to change the final path
});
```
diff --git a/examples/json.js b/examples/json.js
index f37bd4d8..dc872fb4 100644
--- a/examples/json.js
+++ b/examples/json.js
@@ -34,8 +34,8 @@ const server = http.createServer((req, res) => {
});
server.listen(PORT, () => {
- const choosenPort = server.address().port;
- console.log(`Listening on http://localhost:${choosenPort}/`);
+ const chosenPort = server.address().port;
+ console.log(`Listening on http://localhost:${chosenPort}/`);
const body = JSON.stringify({
numbers: [1, 2, 3, 4, 5],
@@ -46,7 +46,7 @@ server.listen(PORT, () => {
{
host: 'localhost',
path: '/',
- port: choosenPort,
+ port: chosenPort,
method: 'POST',
headers: {
'Content-Type': 'application/json',
diff --git a/examples/multiples.js b/examples/multiples.js
index 1cb378cf..03158492 100644
--- a/examples/multiples.js
+++ b/examples/multiples.js
@@ -20,8 +20,8 @@ const server = http.createServer((req, res) => {
-
-
+
+
diff --git a/examples/with-http.js b/examples/with-http.js
index ef12d066..dfb3b842 100644
--- a/examples/with-http.js
+++ b/examples/with-http.js
@@ -21,7 +21,7 @@ const server = http.createServer((req, res) => {
// slugify to avoid invalid filenames
// substr to define a maximum
return `${slugify(name)}.${slugify(ext, {separator: ''})}`.substr(0, 100);
- // return 'yo.txt'; // or completly different name
+ // return 'yo.txt'; // or completely different name
// return 'z/yo.txt'; // subdirectory
},
// filter: function ({name, originalFilename, mimetype}) {
diff --git a/src/Formidable.js b/src/Formidable.js
index 01cc593e..946222ee 100644
--- a/src/Formidable.js
+++ b/src/Formidable.js
@@ -359,7 +359,7 @@ class IncomingForm extends EventEmitter {
if (!this.options.allowEmptyFiles && fileSize === 0) {
this._error(
new FormidableError(
- `options.allowEmptyFiles is false, file size should be greather than 0`,
+ `options.allowEmptyFiles is false, file size should be greater than 0`,
errors.noEmptyFiles,
400,
),
diff --git a/src/parsers/Multipart.js b/src/parsers/Multipart.js
index 361a9cc4..8267a013 100644
--- a/src/parsers/Multipart.js
+++ b/src/parsers/Multipart.js
@@ -237,7 +237,7 @@ class MultipartParser extends Transform {
prevIndex = index;
if (index === 0) {
- // boyer-moore derrived algorithm to safely skip non-boundary data
+ // boyer-moore derived algorithm to safely skip non-boundary data
i += boundaryEnd;
while (i < this.bufferLength && !(buffer[i] in boundaryChars)) {
i += boundaryLength;
diff --git a/src/plugins/multipart.js b/src/plugins/multipart.js
index dfb54651..eb444965 100644
--- a/src/plugins/multipart.js
+++ b/src/plugins/multipart.js
@@ -124,7 +124,7 @@ function createInitMultipart(boundary) {
/*
four bytes (chars) in base64 converts to three bytes in binary
encoding. So we should always work with a number of bytes that
- can be divided by 4, it will result in a number of buytes that
+ can be divided by 4, it will result in a number of bytes that
can be divided vy 3.
*/
const offset = parseInt(part.transferBuffer.length / 4, 10) * 4;
diff --git a/test/integration/fixtures.test.js b/test/integration/fixtures.test.js
index 0b6c81b3..cab4e5ff 100644
--- a/test/integration/fixtures.test.js
+++ b/test/integration/fixtures.test.js
@@ -97,7 +97,7 @@ test('fixtures', (done) => {
function callback(...args) {
const realCallback = cb;
// eslint-disable-next-line no-param-reassign
- cb = function calbackFn() {};
+ cb = function callbackFn() {};
realCallback(...args);
}
diff --git a/test/standalone/connection-aborted.test.js b/test/standalone/connection-aborted.test.js
index b7181424..431f68da 100644
--- a/test/standalone/connection-aborted.test.js
+++ b/test/standalone/connection-aborted.test.js
@@ -32,9 +32,9 @@ test('connection aborted', (done) => {
});
server.listen(PORT, 'localhost', () => {
- const choosenPort = server.address().port;
+ const chosenPort = server.address().port;
- const client = connect(choosenPort);
+ const client = connect(chosenPort);
client.write(
'POST / HTTP/1.1\r\n' +
diff --git a/test/standalone/content-transfer-encoding.test.js b/test/standalone/content-transfer-encoding.test.js
index 4db89ea9..7ec0f9db 100644
--- a/test/standalone/content-transfer-encoding.test.js
+++ b/test/standalone/content-transfer-encoding.test.js
@@ -23,7 +23,7 @@ test('content transfer encoding', (done) => {
});
server.listen(PORT, () => {
- const choosenPort = server.address().port;
+ const chosenPort = server.address().port;
const body =
'--foo\r\n' +
@@ -39,7 +39,7 @@ test('content transfer encoding', (done) => {
const req = request({
method: 'POST',
- port: choosenPort,
+ port: chosenPort,
headers: {
'Content-Length': body.length,
'Content-Type': 'multipart/form-data; boundary=foo',
diff --git a/test/standalone/end-event-emitted-twice.test.js b/test/standalone/end-event-emitted-twice.test.js
index 650f431b..ee15aed5 100644
--- a/test/standalone/end-event-emitted-twice.test.js
+++ b/test/standalone/end-event-emitted-twice.test.js
@@ -23,13 +23,13 @@ test('end event emitted twice', (done) => {
});
server.listen(PORT, 'localhost', () => {
- const choosenPort = server.address().port;
+ const chosenPort = server.address().port;
- const client = connect(choosenPort);
+ const client = connect(chosenPort);
client.write(
`POST /api/upload HTTP/1.1
-Host: localhost:${choosenPort}
+Host: localhost:${chosenPort}
User-Agent: N
Content-Type: multipart/form-data; boundary=---------------------------13068458571765726332503797717
diff --git a/test/standalone/issue-46.test.js b/test/standalone/issue-46.test.js
index 6707f247..6bd9f88f 100644
--- a/test/standalone/issue-46.test.js
+++ b/test/standalone/issue-46.test.js
@@ -22,8 +22,8 @@ test("issue 46", (done) => {
});
server.listen(PORT, () => {
- const choosenPort = server.address().port;
- const url = `http://localhost:${choosenPort}`;
+ const chosenPort = server.address().port;
+ const url = `http://localhost:${chosenPort}`;
const req = request(url, {
method: "POST",
diff --git a/test/standalone/keep-alive-error.test.js b/test/standalone/keep-alive-error.test.js
index 18ddab48..5ab91222 100644
--- a/test/standalone/keep-alive-error.test.js
+++ b/test/standalone/keep-alive-error.test.js
@@ -27,9 +27,9 @@ test('keep alive error', (done) => {
});
server.listen(PORT, () => {
- const choosenPort = server.address().port;
+ const chosenPort = server.address().port;
- const client = createConnection(choosenPort);
+ const client = createConnection(chosenPort);
// first send malformed (boundary / hyphens) post upload
client.write(
@@ -50,7 +50,7 @@ test('keep alive error', (done) => {
setTimeout(() => {
strictEqual(errors, 1, `should "errors" === 1, has: ${errors}`);
- const clientTwo = createConnection(choosenPort);
+ const clientTwo = createConnection(chosenPort);
// correct post upload (with hyphens)
clientTwo.write(
diff --git a/test/unit/custom-plugins.test.js b/test/unit/custom-plugins.test.js
index 6ae00ef1..1c4be789 100644
--- a/test/unit/custom-plugins.test.js
+++ b/test/unit/custom-plugins.test.js
@@ -25,14 +25,14 @@ function fromFixtures(...args) {
// function makeRequest(server, options) {
// server.listen(0, () => {
-// const choosenPort = server.address().port;
-// const url = `http://localhost:${choosenPort}`;
+// const chosenPort = server.address().port;
+// const url = `http://localhost:${chosenPort}`;
// const method = 'POST';
// const opts = {
// ...options,
-// port: choosenPort,
+// port: chosenPort,
// url,
// method,
// };
diff --git a/test/unit/formidable.test.js b/test/unit/formidable.test.js
index ab6de22a..ac9bb3b7 100644
--- a/test/unit/formidable.test.js
+++ b/test/unit/formidable.test.js
@@ -194,7 +194,7 @@ function makeHeader(originalFilename) {
// eslint-disable-next-line max-nested-callbacks
form.on('error', (error) => {
expect(error.message).toBe(
- 'options.allowEmptyFiles is false, file size should be greather than 0',
+ 'options.allowEmptyFiles is false, file size should be greater than 0',
);
done();
});