Skip to content

Commit

Permalink
fix: Spelling (#897)
Browse files Browse the repository at this point in the history
by: Josh Soref
  • Loading branch information
jsoref authored Oct 17, 2022
1 parent e060e3f commit 493ec88
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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.**

Expand Down Expand Up @@ -648,7 +648,7 @@ form.on('fileBegin', (formName, file) => {
// formName the name in the form (<input name="thisname" type="file">) 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
});
```
Expand Down
6 changes: 3 additions & 3 deletions examples/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -46,7 +46,7 @@ server.listen(PORT, () => {
{
host: 'localhost',
path: '/',
port: choosenPort,
port: chosenPort,
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions examples/multiples.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const server = http.createServer((req, res) => {
<label>file html array0<input type="file" name="filearray[]" /></label><br />
<label>file html array1<input type="file" name="filearray[]" /></label><br />
<label>file html array and mulitple0<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
<label>file html array and mulitple1<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
<label>file html array and multiple0<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
<label>file html array and multiple1<input type="file" name="filearray_with_multiple[]" multiple /></label><br />
<br />
<button>Upload</button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}) {
Expand Down
2 changes: 1 addition & 1 deletion src/Formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/Multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions test/standalone/connection-aborted.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' +
Expand Down
4 changes: 2 additions & 2 deletions test/standalone/content-transfer-encoding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' +
Expand All @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions test/standalone/end-event-emitted-twice.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/standalone/issue-46.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions test/standalone/keep-alive-error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions test/unit/custom-plugins.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
// };
Expand Down
2 changes: 1 addition & 1 deletion test/unit/formidable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 493ec88

Please sign in to comment.