h3 0.3.6 → 0.3.7

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/dist/index.cjs CHANGED
@@ -233,8 +233,8 @@ function useRawBody(req, encoding = "utf-8") {
233
233
  const promise2 = Promise.resolve(req[RawBodySymbol]);
234
234
  return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
235
235
  }
236
- if ("_body" in req) {
237
- return Promise.resolve(req._body);
236
+ if ("body" in req) {
237
+ return Promise.resolve(req.body);
238
238
  }
239
239
  const promise = req[RawBodySymbol] = new Promise((resolve, reject) => {
240
240
  const bodyData = [];
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ declare const RawBodySymbol: unique symbol;
88
88
  interface _IncomingMessage extends IncomingMessage {
89
89
  [RawBodySymbol]?: Promise<Buffer>;
90
90
  ParsedBodySymbol?: any;
91
- _body?: any;
91
+ body?: any;
92
92
  }
93
93
  /**
94
94
  * Reads body of the request and returns encoded raw string (default) or `Buffer` if encoding if falsy.
package/dist/index.mjs CHANGED
@@ -229,8 +229,8 @@ function useRawBody(req, encoding = "utf-8") {
229
229
  const promise2 = Promise.resolve(req[RawBodySymbol]);
230
230
  return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
231
231
  }
232
- if ("_body" in req) {
233
- return Promise.resolve(req._body);
232
+ if ("body" in req) {
233
+ return Promise.resolve(req.body);
234
234
  }
235
235
  const promise = req[RawBodySymbol] = new Promise((resolve, reject) => {
236
236
  const bodyData = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h3",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Tiny JavaScript Server",
5
5
  "repository": "unjs/h3",
6
6
  "license": "MIT",