mirror of
https://github.com/morluto/rea.git
synced 2026-11-29 01:46:39 +00:00
25 lines
791 B
TypeScript
25 lines
791 B
TypeScript
import type { WebPageInspection } from "../../../src/domain/browserObservationSchemas.js";
|
|
import { compareWebCaptures } from "../../../src/domain/webCaptureDiff.js";
|
|
import {
|
|
compareWebCapturesInputSchema,
|
|
type WebCaptureDiff,
|
|
} from "../../../src/domain/webCaptureDiffSchemas.js";
|
|
|
|
export const compareInspections = (
|
|
before: WebPageInspection,
|
|
after: WebPageInspection,
|
|
) =>
|
|
compareWebCaptures(
|
|
compareWebCapturesInputSchema.parse({
|
|
before: { inspection: before },
|
|
after: { inspection: after },
|
|
}),
|
|
);
|
|
|
|
export const compareInspectionDimension =
|
|
<Dimension extends keyof WebCaptureDiff["dimensions"]>(
|
|
dimension: Dimension,
|
|
) =>
|
|
(before: WebPageInspection, after: WebPageInspection) =>
|
|
compareInspections(before, after).dimensions[dimension];
|