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 authored and GitHub committed 2026-10-07 11:23:37 +08:00
1 parent 6dd719eaf6
commit 64ebdf4501
24 files changed
+300 -200

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ import {
requiredRecord,
sourceExcluded,
sourceResult,
stringValue,
cdpStringValue,
} from "./CdpCaptureValues.js";
import type { CaptureContext } from "./CdpPageCapture.js";
import type { WebSourceMapRequest } from "./WebSourceMapFetcher.js";
@@ -115,7 +115,7 @@ const captureScriptSource = async (
context.signal,
),
);
const content = stringValue(result.scriptSource) ?? "";
const content = cdpStringValue(result.scriptSource) ?? "";
return sourceResult(content);
};