@darksheep/request-body 1.0.7 → 1.1.2
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/CHANGELOG.md +38 -0
- package/package.json +3 -3
- package/src/form.js +1 -1
- package/src/json.js +1 -1
- package/src/utilities/max-length.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.2](https://github.com/DarkSheepSoftware/node-packages/compare/request-body-v1.1.1...request-body-v1.1.2) (2026-04-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* devDependencies
|
|
10
|
+
* @darksheep/fake-fetch bumped to 0.0.3
|
|
11
|
+
|
|
12
|
+
## [1.1.1](https://github.com/DarkSheepSoftware/node-packages/compare/request-body-v1.1.0...request-body-v1.1.1) (2026-04-17)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Dependencies
|
|
16
|
+
|
|
17
|
+
* The following workspace dependencies were updated
|
|
18
|
+
* dependencies
|
|
19
|
+
* @darksheep/errors bumped from 1.2.0 to 1.2.1
|
|
20
|
+
* @darksheep/json-schema bumped to 0.1.2
|
|
21
|
+
* @darksheep/types bumped to 1.3.1
|
|
22
|
+
|
|
23
|
+
## [1.1.0](https://github.com/DarkSheepSoftware/node-packages/compare/request-body-v1.0.7...request-body-v1.1.0) (2025-10-09)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### 🌟 Features
|
|
27
|
+
|
|
28
|
+
* Support node 24 ([#761](https://github.com/DarkSheepSoftware/node-packages/issues/761)) ([f13caae](https://github.com/DarkSheepSoftware/node-packages/commit/f13caaef978c7a657e4599f775e0a62d1738f475))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
* The following workspace dependencies were updated
|
|
34
|
+
* dependencies
|
|
35
|
+
* @darksheep/errors bumped from 1.1.1 to 1.2.0
|
|
36
|
+
* @darksheep/json-schema bumped to 0.1.1
|
|
37
|
+
* @darksheep/types bumped to 1.3.0
|
|
38
|
+
* devDependencies
|
|
39
|
+
* @darksheep/fake-fetch bumped to 0.0.2
|
|
40
|
+
|
|
3
41
|
## [1.0.7](https://github.com/DarkSheepSoftware/node-packages/compare/request-body-v1.0.6...request-body-v1.0.7) (2025-09-17)
|
|
4
42
|
|
|
5
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/request-body",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "http.IncomingMessage to something a little more useful",
|
|
5
5
|
"license": "UNLICENCED",
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"test:watch": "node --watch --test src/**/*.test.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@darksheep/errors": "1.
|
|
48
|
+
"@darksheep/errors": "1.2.1",
|
|
49
49
|
"@darksheep/json-schema": "",
|
|
50
50
|
"@darksheep/types": "",
|
|
51
51
|
"@fastify/busboy": "3.2.0"
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"@darksheep/fake-fetch": ""
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": "^20.13.1 ||
|
|
57
|
+
"node": "^20.13.1 || >=22.2.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/form.js
CHANGED
|
@@ -47,7 +47,7 @@ export async function toForm(request, options) {
|
|
|
47
47
|
|
|
48
48
|
/** @type {Promise<unknown>[]} */
|
|
49
49
|
const pQueue = [];
|
|
50
|
-
return new Promise((resolve, reject) => {
|
|
50
|
+
return await new Promise((resolve, reject) => {
|
|
51
51
|
busboy
|
|
52
52
|
.on('file', (fieldname, stream, filename, _encoding, mimetype) => {
|
|
53
53
|
pQueue.push((async () => {
|
package/src/json.js
CHANGED
|
@@ -18,14 +18,16 @@ export function limitMaxLength({ maxBytes = 1_000_000 } = {}) {
|
|
|
18
18
|
return new Transform({
|
|
19
19
|
transform(chunk, _encoding, callback) {
|
|
20
20
|
if (Buffer.isBuffer(chunk) === false) {
|
|
21
|
-
|
|
21
|
+
callback(new Error('Cannot chunk, not buffer'));
|
|
22
|
+
return;
|
|
22
23
|
}
|
|
23
24
|
const current = lengths.get(this) ?? 0;
|
|
24
25
|
const next = current + chunk.length;
|
|
25
26
|
lengths.set(this, next);
|
|
26
27
|
|
|
27
28
|
if (next > maxBytes) {
|
|
28
|
-
|
|
29
|
+
callback(new Error('Maximum stream length exceeded'));
|
|
30
|
+
return;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
callback(null, chunk);
|