@darksheep/request-body 1.1.0 → 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 CHANGED
@@ -1,5 +1,25 @@
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
+
3
23
  ## [1.1.0](https://github.com/DarkSheepSoftware/node-packages/compare/request-body-v1.0.7...request-body-v1.1.0) (2025-10-09)
4
24
 
5
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darksheep/request-body",
3
- "version": "1.1.0",
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.2.0",
48
+ "@darksheep/errors": "1.2.1",
49
49
  "@darksheep/json-schema": "",
50
50
  "@darksheep/types": "",
51
51
  "@fastify/busboy": "3.2.0"
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
@@ -50,5 +50,5 @@ export async function toJson(request, options) {
50
50
  return /** @type {Data} */ (data);
51
51
  }
52
52
 
53
- return validate(options.schema, data, RequestSchemaError);
53
+ return await validate(options.schema, data, RequestSchemaError);
54
54
  }
@@ -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
- return callback(new Error('Cannot chunk, not buffer'));
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
- return callback(new Error('Maximum stream length exceeded'));
29
+ callback(new Error('Maximum stream length exceeded'));
30
+ return;
29
31
  }
30
32
 
31
33
  callback(null, chunk);