brakit 0.7.3 → 0.7.4
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/api.js +1 -1
- package/dist/bin/brakit.js +1 -1
- package/dist/runtime/index.js +16 -6
- package/package.json +1 -1
package/dist/api.js
CHANGED
package/dist/bin/brakit.js
CHANGED
|
@@ -693,7 +693,7 @@ import { resolve as resolve2 } from "path";
|
|
|
693
693
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
694
694
|
|
|
695
695
|
// src/index.ts
|
|
696
|
-
var VERSION = "0.7.
|
|
696
|
+
var VERSION = "0.7.4";
|
|
697
697
|
|
|
698
698
|
// src/cli/commands/install.ts
|
|
699
699
|
var IMPORT_LINE = `import "brakit";`;
|
package/dist/runtime/index.js
CHANGED
|
@@ -3669,7 +3669,7 @@ var init_src = __esm({
|
|
|
3669
3669
|
init_rules();
|
|
3670
3670
|
init_engine();
|
|
3671
3671
|
init_insights2();
|
|
3672
|
-
VERSION = "0.7.
|
|
3672
|
+
VERSION = "0.7.4";
|
|
3673
3673
|
}
|
|
3674
3674
|
});
|
|
3675
3675
|
|
|
@@ -6303,6 +6303,12 @@ function decompress(body, encoding) {
|
|
|
6303
6303
|
}
|
|
6304
6304
|
return body;
|
|
6305
6305
|
}
|
|
6306
|
+
function toBuffer(chunk) {
|
|
6307
|
+
if (Buffer.isBuffer(chunk)) return chunk;
|
|
6308
|
+
if (chunk instanceof Uint8Array) return Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
6309
|
+
if (typeof chunk === "string") return Buffer.from(chunk);
|
|
6310
|
+
return null;
|
|
6311
|
+
}
|
|
6306
6312
|
function captureInProcess(req, res, requestId) {
|
|
6307
6313
|
const startTime = performance.now();
|
|
6308
6314
|
const method = req.method ?? "GET";
|
|
@@ -6314,9 +6320,11 @@ function captureInProcess(req, res, requestId) {
|
|
|
6314
6320
|
try {
|
|
6315
6321
|
const chunk = args[0];
|
|
6316
6322
|
if (chunk != null && typeof chunk !== "function" && resSize < DEFAULT_MAX_BODY_CAPTURE) {
|
|
6317
|
-
const buf =
|
|
6318
|
-
|
|
6319
|
-
|
|
6323
|
+
const buf = toBuffer(chunk);
|
|
6324
|
+
if (buf) {
|
|
6325
|
+
resChunks.push(buf);
|
|
6326
|
+
resSize += buf.length;
|
|
6327
|
+
}
|
|
6320
6328
|
}
|
|
6321
6329
|
} catch {
|
|
6322
6330
|
}
|
|
@@ -6326,8 +6334,10 @@ function captureInProcess(req, res, requestId) {
|
|
|
6326
6334
|
try {
|
|
6327
6335
|
const chunk = typeof args[0] !== "function" ? args[0] : void 0;
|
|
6328
6336
|
if (chunk != null && resSize < DEFAULT_MAX_BODY_CAPTURE) {
|
|
6329
|
-
const buf =
|
|
6330
|
-
|
|
6337
|
+
const buf = toBuffer(chunk);
|
|
6338
|
+
if (buf) {
|
|
6339
|
+
resChunks.push(buf);
|
|
6340
|
+
}
|
|
6331
6341
|
}
|
|
6332
6342
|
} catch {
|
|
6333
6343
|
}
|
package/package.json
CHANGED