refactor(domain): consolidate canonical ordering and digest helpers (#624)

* refactor(domain): consolidate canonical ordering and digest helpers

Single owner for code-point ordering (domain/canonicalOrdering.ts)
and canonical JSON digests (domain/comparisonSemantics.ts). Delete
all local compareCodePoints/compareText/digestCanonical duplicates
and migrate every importer. No re-export shims.

* fix(ci): allow slower real browser startup
This commit is contained in:
morluto
2026-10-06 04:55:26 +08:00
committed by GitHub
parent 38b293329c
commit ba3869c597
74 changed files with 438 additions and 530 deletions
+2 -2
View File
@@ -1,3 +1,4 @@
import { canonicalDigest } from "../domain/comparisonSemantics.js";
import type { ProgressReporter } from "../application/ProgressReporter.js";
import type {
ElectronPageInspection,
@@ -7,7 +8,6 @@ import { BrowserObservationError } from "../domain/errors.js";
import type { CdpConnection, CdpEvent } from "./CdpConnection.js";
import type { CdpEndpointDiscovery, CdpEndpointTarget } from "./CdpEndpoint.js";
import { CdpCaptureCompleteness } from "./CdpCaptureCompleteness.js";
import { canonicalJsonDigest } from "./CdpCanonicalJsonDigest.js";
import {
delayWithCancellation,
numberValue,
@@ -289,7 +289,7 @@ const captureResources = async (
? null
: Math.max(0, numberValue(resource.contentSize) ?? 0),
};
const resourceKey = `electron_resource_${canonicalJsonDigest(item)}`;
const resourceKey = `electron_resource_${canonicalDigest(item, "CDP capture")}`;
if (seen.has(resourceKey)) continue;
seen.add(resourceKey);
resources.push({