refactor(kernel): migrate the remaining SHA-256 hex digests to sha256Hex and move isRecord into src/kernel (#11571)

* refactor(kernel): migrate the remaining one-shot SHA-256 hex digests to sha256Hex

* refactor(kernel): move isRecord into src/kernel and replace its inline copies (#11574)

* fix(scripts): import isRecord from src/kernel in the managed manifest parser
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 20:53:36 -05:00
1 parent 9ecfb109e8
commit b51ed4c3ec
157 files changed
+397 -589

No files matched your search

+3 -5
View File
@@ -4,7 +4,6 @@ import {
sourceMapLimitRecovery,
type SourceMapLimits,
} from "../../domain/sourceMapLimits.js";
import { createHash } from "node:crypto";
import { createRequire } from "node:module";
import { getHeapStatistics } from "node:v8";
import {
@@ -30,6 +29,7 @@ import {
type SourceMapSourceDeclaration,
} from "../../domain/sourceMapFormat.js";
import { decodeValidatedSourceMapLeaves } from "../../domain/decodedSourceMap.js";
import { sha256Hex } from "../../kernel/sha256Hex.js";
/** Decode with the pinned upstream codec; preserve every equal-position candidate. */
export const traceSourceMap = (
@@ -94,7 +94,7 @@ export const traceSourceMap = (
.parse(metadata).version;
const runtime = javaScriptRuntime(process.versions);
return webSourceMapReportSchema.parse({
source_map_sha256: createHash("sha256").update(text).digest("hex"),
source_map_sha256: sha256Hex(text),
url_context: url,
engine: { id: "jridgewell-trace-mapping", version },
// Bun reports V8-shaped heap statistics but ignores the codec's heap flags.
@@ -201,9 +201,7 @@ const originalMatch = (
: {
state: "embedded",
text: declaration.content,
utf8_sha256: createHash("sha256")
.update(declaration.content)
.digest("hex"),
utf8_sha256: sha256Hex(declaration.content),
utf8_bytes: Buffer.byteLength(declaration.content),
representation: "UTF-8 encoding of decoded sourcesContent text",
},