Skip to content

Commit 493ec88

Browse files
authored
fix: Spelling (#897)
by: Josh Soref
1 parent e060e3f commit 493ec88

16 files changed

+30
-30
lines changed

.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ignoredProps = bestPractices.rules[
1818
'cfg',
1919
);
2020

21-
// Additional rules that are specific and overiding previous
21+
// Additional rules that are specific and overriding previous
2222
const additionalChanges = {
2323
strict: 'off',
2424

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ at Twitter.
2020

2121
[![Conventional Commits][ccommits-img]][ccommits-url]
2222
[![Minimum Required Nodejs][nodejs-img]][npmv-url]
23-
[![Tidelift Subcsription][tidelift-img]][tidelift-url]
23+
[![Tidelift Subscription][tidelift-img]][tidelift-url]
2424
[![Buy me a Kofi][kofi-img]][kofi-url]
2525
[![Renovate App Status][renovateapp-img]][renovateapp-url]
2626
[![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 }) =>
491491
### .use(plugin: Plugin)
492492

493493
A method that allows you to extend the Formidable library. By default we include
494-
4 plugins, which esentially are adapters to plug the different built-in parsers.
494+
4 plugins, which essentially are adapters to plug the different built-in parsers.
495495

496496
**The plugins added by this method are always enabled.**
497497

@@ -648,7 +648,7 @@ form.on('fileBegin', (formName, file) => {
648648
// formName the name in the form (<input name="thisname" type="file">) or http filename for octetstream
649649
// file.originalFilename http filename or null if there was a parsing error
650650
// file.newFilename generated hexoid or what options.filename returned
651-
// file.filepath default pathnme as per options.uploadDir and options.filename
651+
// file.filepath default pathname as per options.uploadDir and options.filename
652652
// file.filepath = CUSTOM_PATH // to change the final path
653653
});
654654
```

examples/json.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const server = http.createServer((req, res) => {
3434
});
3535

3636
server.listen(PORT, () => {
37-
const choosenPort = server.address().port;
38-
console.log(`Listening on http://localhost:${choosenPort}/`);
37+
const chosenPort = server.address().port;
38+
console.log(`Listening on http://localhost:${chosenPort}/`);
3939

4040
const body = JSON.stringify({
4141
numbers: [1, 2, 3, 4, 5],
@@ -46,7 +46,7 @@ server.listen(PORT, () => {
4646
{
4747
host: 'localhost',
4848
path: '/',
49-
port: choosenPort,
49+
port: chosenPort,
5050
method: 'POST',
5151
headers: {
5252
'Content-Type': 'application/json',

examples/multiples.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const server = http.createServer((req, res) => {
2020
<label>file html array0<input type="file" name="filearray[]" /></label><br />
2121
<label>file html array1<input type="file" name="filearray[]" /></label><br />
2222
23-
<label>file html array and mulitple0<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
24-
<label>file html array and mulitple1<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
23+
<label>file html array and multiple0<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
24+
<label>file html array and multiple1<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
2525
<br />
2626
<button>Upload</button>
2727
</form>

examples/with-http.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const server = http.createServer((req, res) => {
2121
// slugify to avoid invalid filenames
2222
// substr to define a maximum
2323
return `${slugify(name)}.${slugify(ext, {separator: ''})}`.substr(0, 100);
24-
// return 'yo.txt'; // or completly different name
24+
// return 'yo.txt'; // or completely different name
2525
// return 'z/yo.txt'; // subdirectory
2626
},
2727
// filter: function ({name, originalFilename, mimetype}) {

src/Formidable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class IncomingForm extends EventEmitter {
359359
if (!this.options.allowEmptyFiles && fileSize === 0) {
360360
this._error(
361361
new FormidableError(
362-
`options.allowEmptyFiles is false, file size should be greather than 0`,
362+
`options.allowEmptyFiles is false, file size should be greater than 0`,
363363
errors.noEmptyFiles,
364364
400,
365365
),

src/parsers/Multipart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class MultipartParser extends Transform {
237237
prevIndex = index;
238238

239239
if (index === 0) {
240-
// boyer-moore derrived algorithm to safely skip non-boundary data
240+
// boyer-moore derived algorithm to safely skip non-boundary data
241241
i += boundaryEnd;
242242
while (i < this.bufferLength && !(buffer[i] in boundaryChars)) {
243243
i += boundaryLength;

src/plugins/multipart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function createInitMultipart(boundary) {
124124
/*
125125
four bytes (chars) in base64 converts to three bytes in binary
126126
encoding. So we should always work with a number of bytes that
127-
can be divided by 4, it will result in a number of buytes that
127+
can be divided by 4, it will result in a number of bytes that
128128
can be divided vy 3.
129129
*/
130130
const offset = parseInt(part.transferBuffer.length / 4, 10) * 4;

test/integration/fixtures.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ test('fixtures', (done) => {
9797
function callback(...args) {
9898
const realCallback = cb;
9999
// eslint-disable-next-line no-param-reassign
100-
cb = function calbackFn() {};
100+
cb = function callbackFn() {};
101101

102102
realCallback(...args);
103103
}

test/standalone/connection-aborted.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ test('connection aborted', (done) => {
3232
});
3333

3434
server.listen(PORT, 'localhost', () => {
35-
const choosenPort = server.address().port;
35+
const chosenPort = server.address().port;
3636

37-
const client = connect(choosenPort);
37+
const client = connect(chosenPort);
3838

3939
client.write(
4040
'POST / HTTP/1.1\r\n' +

test/standalone/content-transfer-encoding.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('content transfer encoding', (done) => {
2323
});
2424

2525
server.listen(PORT, () => {
26-
const choosenPort = server.address().port;
26+
const chosenPort = server.address().port;
2727

2828
const body =
2929
'--foo\r\n' +
@@ -39,7 +39,7 @@ test('content transfer encoding', (done) => {
3939

4040
const req = request({
4141
method: 'POST',
42-
port: choosenPort,
42+
port: chosenPort,
4343
headers: {
4444
'Content-Length': body.length,
4545
'Content-Type': 'multipart/form-data; boundary=foo',

test/standalone/end-event-emitted-twice.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ test('end event emitted twice', (done) => {
2323
});
2424

2525
server.listen(PORT, 'localhost', () => {
26-
const choosenPort = server.address().port;
26+
const chosenPort = server.address().port;
2727

28-
const client = connect(choosenPort);
28+
const client = connect(chosenPort);
2929

3030
client.write(
3131
`POST /api/upload HTTP/1.1
32-
Host: localhost:${choosenPort}
32+
Host: localhost:${chosenPort}
3333
User-Agent: N
3434
Content-Type: multipart/form-data; boundary=---------------------------13068458571765726332503797717
3535

test/standalone/issue-46.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ test("issue 46", (done) => {
2222
});
2323

2424
server.listen(PORT, () => {
25-
const choosenPort = server.address().port;
26-
const url = `http://localhost:${choosenPort}`;
25+
const chosenPort = server.address().port;
26+
const url = `http://localhost:${chosenPort}`;
2727

2828
const req = request(url, {
2929
method: "POST",

test/standalone/keep-alive-error.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ test('keep alive error', (done) => {
2727
});
2828

2929
server.listen(PORT, () => {
30-
const choosenPort = server.address().port;
30+
const chosenPort = server.address().port;
3131

32-
const client = createConnection(choosenPort);
32+
const client = createConnection(chosenPort);
3333

3434
// first send malformed (boundary / hyphens) post upload
3535
client.write(
@@ -50,7 +50,7 @@ test('keep alive error', (done) => {
5050
setTimeout(() => {
5151
strictEqual(errors, 1, `should "errors" === 1, has: ${errors}`);
5252

53-
const clientTwo = createConnection(choosenPort);
53+
const clientTwo = createConnection(chosenPort);
5454

5555
// correct post upload (with hyphens)
5656
clientTwo.write(

test/unit/custom-plugins.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ function fromFixtures(...args) {
2525

2626
// function makeRequest(server, options) {
2727
// server.listen(0, () => {
28-
// const choosenPort = server.address().port;
29-
// const url = `http://localhost:${choosenPort}`;
28+
// const chosenPort = server.address().port;
29+
// const url = `http://localhost:${chosenPort}`;
3030

3131
// const method = 'POST';
3232

3333
// const opts = {
3434
// ...options,
35-
// port: choosenPort,
35+
// port: chosenPort,
3636
// url,
3737
// method,
3838
// };

test/unit/formidable.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function makeHeader(originalFilename) {
194194
// eslint-disable-next-line max-nested-callbacks
195195
form.on('error', (error) => {
196196
expect(error.message).toBe(
197-
'options.allowEmptyFiles is false, file size should be greather than 0',
197+
'options.allowEmptyFiles is false, file size should be greater than 0',
198198
);
199199
done();
200200
});

0 commit comments

Comments
 (0)