formstream 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +10 -0
- package/README.md +0 -6
- package/lib/formstream.js +4 -4
- package/package.json +8 -10
package/History.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
1.2.0 / 2023-03-17
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
**features**
|
|
6
|
+
* [[`f268e86`](http://github.com/node-modules/formstream/commit/f268e86e6b55d5b981bb7daf9c8662bdcd820f5c)] - feat: Porting from new Buffer() to Buffer.from() (#22) (Matthew Speiser <<mattrspeiser@gmail.com>>)
|
|
7
|
+
|
|
8
|
+
**others**
|
|
9
|
+
* [[`3c09f70`](http://github.com/node-modules/formstream/commit/3c09f700b2440b8f391650c939d91c2d5e4ae9b3)] - test: run on github action (#21) (fengmk2 <<fengmk2@gmail.com>>)
|
|
10
|
+
* [[`2d5ed81`](http://github.com/node-modules/formstream/commit/2d5ed81e95b4fde270b5db2720fff0e19effd2dc)] - test: run test on node 12, 14, 16 (#20) (fengmk2 <<fengmk2@gmail.com>>)
|
|
11
|
+
|
|
2
12
|
1.1.1 / 2021-04-28
|
|
3
13
|
==================
|
|
4
14
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
# formstream
|
|
2
2
|
|
|
3
3
|
[![NPM version][npm-image]][npm-url]
|
|
4
|
-
[![build status][travis-image]][travis-url]
|
|
5
4
|
[![Test coverage][coveralls-image]][coveralls-url]
|
|
6
|
-
[![David deps][david-image]][david-url]
|
|
7
5
|
[![npm download][download-image]][download-url]
|
|
8
6
|
|
|
9
7
|
[npm-image]: https://img.shields.io/npm/v/formstream.svg?style=flat-square
|
|
10
8
|
[npm-url]: https://npmjs.org/package/formstream
|
|
11
|
-
[travis-image]: https://img.shields.io/travis/node-modules/formstream.svg?style=flat-square
|
|
12
|
-
[travis-url]: https://travis-ci.org/node-modules/formstream
|
|
13
9
|
[coveralls-image]: https://img.shields.io/coveralls/node-modules/formstream.svg?style=flat-square
|
|
14
10
|
[coveralls-url]: https://coveralls.io/r/node-modules/formstream?branch=master
|
|
15
|
-
[david-image]: https://img.shields.io/david/node-modules/formstream.svg?style=flat-square
|
|
16
|
-
[david-url]: https://david-dm.org/node-modules/formstream
|
|
17
11
|
[download-image]: https://img.shields.io/npm/dm/formstream.svg?style=flat-square
|
|
18
12
|
[download-url]: https://npmjs.org/package/formstream
|
|
19
13
|
|
package/lib/formstream.js
CHANGED
|
@@ -33,7 +33,7 @@ var destroy = require('destroy');
|
|
|
33
33
|
|
|
34
34
|
var PADDING = '--';
|
|
35
35
|
var NEW_LINE = '\r\n';
|
|
36
|
-
var NEW_LINE_BUFFER =
|
|
36
|
+
var NEW_LINE_BUFFER = Buffer.from(NEW_LINE);
|
|
37
37
|
|
|
38
38
|
function FormStream() {
|
|
39
39
|
if (!(this instanceof FormStream)) {
|
|
@@ -45,7 +45,7 @@ function FormStream() {
|
|
|
45
45
|
this._boundary = this._generateBoundary();
|
|
46
46
|
this._streams = [];
|
|
47
47
|
this._buffers = [];
|
|
48
|
-
this._endData =
|
|
48
|
+
this._endData = Buffer.from(PADDING + this._boundary + PADDING + NEW_LINE);
|
|
49
49
|
this._contentLength = 0;
|
|
50
50
|
this._isAllStreamSizeKnown = true;
|
|
51
51
|
this._knownStreamSize = 0;
|
|
@@ -137,7 +137,7 @@ FormStream.prototype.field = function (name, value) {
|
|
|
137
137
|
if (typeof value === 'number') {
|
|
138
138
|
value = String(value);
|
|
139
139
|
}
|
|
140
|
-
value =
|
|
140
|
+
value = Buffer.from(value);
|
|
141
141
|
}
|
|
142
142
|
return this.buffer(name, value);
|
|
143
143
|
};
|
|
@@ -222,7 +222,7 @@ FormStream.prototype._leading = function (disposition, type) {
|
|
|
222
222
|
leading.push('');
|
|
223
223
|
leading.push('');
|
|
224
224
|
|
|
225
|
-
return
|
|
225
|
+
return Buffer.from(leading.join(NEW_LINE));
|
|
226
226
|
};
|
|
227
227
|
|
|
228
228
|
FormStream.prototype._emitBuffers = function () {
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formstream",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A multipart/form-data encoded stream, helper for file upload.",
|
|
5
5
|
"main": "lib/formstream.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"lib"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"autod": "autod -w --prefix '^'"
|
|
10
|
+
"test": "egg-bin test",
|
|
11
|
+
"cov": "egg-bin cov",
|
|
12
|
+
"ci": "npm run lint && npm run cov",
|
|
13
|
+
"lint": "jshint ."
|
|
15
14
|
},
|
|
16
15
|
"repository": {
|
|
17
16
|
"type": "git",
|
|
@@ -32,15 +31,14 @@
|
|
|
32
31
|
"pause-stream": "~0.0.11"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
|
-
"autod": "*",
|
|
36
34
|
"connect-multiparty": "1",
|
|
35
|
+
"egg-bin": "^5.6.1",
|
|
37
36
|
"express": "^4.16.4",
|
|
38
|
-
"
|
|
39
|
-
"mocha": "3",
|
|
37
|
+
"jshint": "^2.13.6",
|
|
40
38
|
"pedding": "1",
|
|
41
39
|
"should": "4",
|
|
42
40
|
"urllib": "2"
|
|
43
41
|
},
|
|
44
|
-
"author": "fengmk2 <fengmk2@gmail.com> (https://
|
|
42
|
+
"author": "fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2)",
|
|
45
43
|
"license": "MIT"
|
|
46
44
|
}
|