mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(audit): preserve emoji in npm registry errors (#108208)
* fix(audit): keep registry errors valid Unicode * style(audit): format registry error boundary test * docs(audit): document direct Node import floor Co-authored-by: Leon-SK668 <0668001470@xydigit.com> --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -5,6 +5,8 @@ import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import process from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
// This zero-install hook runs on Node 22.22.3+, where native TypeScript stripping is enabled.
|
||||
import { truncateUtf16Safe } from "../../packages/normalization-core/src/utf16-slice.ts";
|
||||
import { readBoundedResponseText as readBoundedResponseTextWithLimit } from "../lib/bounded-response.mjs";
|
||||
|
||||
const DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
||||
@@ -783,7 +785,7 @@ export async function readBoundedBulkAdvisoryErrorText(
|
||||
|
||||
text += decoder.decode(value, { stream: true });
|
||||
if (text.length > maxChars) {
|
||||
text = text.slice(0, maxChars);
|
||||
text = truncateUtf16Safe(text, maxChars);
|
||||
truncated = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user