Skip to content

Commit e773e60

Browse files
committed
fix: method names, missing hashish module, one step closer
Signed-off-by: Charlike Mike Reagent <[email protected]>
1 parent 37e26aa commit e773e60

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/file.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class File extends EventEmitter {
5656
return `File: ${this.name}, Path: ${this.path}`;
5757
}
5858

59-
writeFn(buffer, cb) {
59+
write(buffer, cb) {
6060
if (this.hash) {
6161
this.hash.update(buffer);
6262
}
@@ -74,7 +74,7 @@ class File extends EventEmitter {
7474
});
7575
}
7676

77-
endFn(cb) {
77+
end(cb) {
7878
if (this.hash) {
7979
this.hash = this.hash.digest('hex');
8080
}

src/incoming_form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class IncomingForm extends EventEmitter {
4646
}
4747

4848
parse(req, cb) {
49-
this.pause = function pauseFnc() {
49+
this.pause = () => {
5050
try {
5151
req.pause();
5252
} catch (err) {
@@ -60,7 +60,7 @@ class IncomingForm extends EventEmitter {
6060
return true;
6161
};
6262

63-
this.resume = function resumeFnc() {
63+
this.resume = () => {
6464
try {
6565
req.resume();
6666
} catch (err) {

src/multipart_parser.js

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class MultipartParser extends Transform {
111111
}
112112
this.push({ name, buffer: buf, start, end });
113113
};
114+
114115
const dataCallback = (name, shouldClear) => {
115116
const markSymbol = `${name}Mark`;
116117
if (!(markSymbol in this)) {

test/integration/test-octet-stream.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const fs = require('fs');
44
const http = require('http');
55
const path = require('path');
66
const assert = require('assert');
7-
const hashish = require('hashish');
87

98
const Formidable = require('../../src/index');
109

@@ -20,7 +19,7 @@ const server = http.createServer((req, res) => {
2019
const form = new Formidable();
2120

2221
form.parse(req, (err, fields, files) => {
23-
assert.equal(hashish(files).length, 1);
22+
assert.equal(Object.keys(files).length, 1);
2423
const { file } = files;
2524

2625
assert.equal(file.size, 301);

0 commit comments

Comments
 (0)