API View source
inspectOrderResult()
Builds a payload-agnostic inspection snapshot for a bounded orderEvents() result.
Signature
function inspectOrderResult<T>(
result: Readonly<OrderResult<T>>,
): OrderResultInspection<T>Use this when you want a compact operational snapshot of one bounded orderEvents() result without writing custom result-shaping code first.
Usage
import { inspectOrderResult, orderEvents } from "causal-order"
const result = orderEvents(events, {
strict: false,
detectAnomalies: true,
})
const inspection = inspectOrderResult(result)
console.log(inspection.stats)
console.log(inspection.anomalySummary)
console.log(inspection.ordered) Details
- Summarizes ordered-event counts by
orderBasisandconfidence. - Produces an anomaly summary without hiding the original
result.anomaliesarray. - Keeps the output payload-agnostic so it works as a lightweight operator-facing snapshot.