refactor(domain): extract source-map envelope walk and disambiguate stringValue (#828)

Move the indexed sections walk shared by the browser fetcher and
the artifact reader into domain/sourceMapEnvelope with the
fetchers stricter offset validation as an option; both validators
keep their leaf strictness. Rename the browser CDP stringValue to
cdpStringValue across its 18 files, fold the fingerprint duplicate
into the static helper, and rename the version-keys shadow to
nonEmptyString.
This commit is contained in:
morluto
2026-10-07 11:23:37 +08:00
committed by GitHub
parent 6dd719eaf6
commit 64ebdf4501
24 changed files with 300 additions and 200 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { canonicalDigest } from "../domain/comparisonSemantics.js";
import { createWebTextArtifact } from "../domain/webContentArtifact.js";
import type { CdpConnection } from "./CdpConnection.js";
import { CdpCaptureCompleteness } from "./CdpCaptureCompleteness.js";
import { requiredRecord, stringValue } from "./CdpCaptureValues.js";
import { requiredRecord, cdpStringValue } from "./CdpCaptureValues.js";
import type { ElectronScriptDraft } from "./CdpElectronScriptEvents.js";
import { authorizedElectronFile } from "./ElectronFileScope.js";
@@ -94,7 +94,7 @@ const captureScriptSource = async (
input.signal,
),
);
const text = stringValue(result.scriptSource) ?? "";
const text = cdpStringValue(result.scriptSource) ?? "";
return {
source: {
included: true,