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 +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
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 ("
|
|
237
|
-
return Promise.resolve(req.
|
|
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
|
-
|
|
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 ("
|
|
233
|
-
return Promise.resolve(req.
|
|
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 = [];
|