MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / assertMonotonicStable

Function assertMonotonicStable

tests/helpers/simulate-stream.ts:26–38  ·  view source on GitHub ↗
(
  snapshots: RehtmlResult[],
)

Source from the content-addressed store, hash-verified

24
25/** Assert stable block count never decreases during streaming */
26export function assertMonotonicStable(
27 snapshots: RehtmlResult[],
28): void {
29 let max = 0;
30 for (const snap of snapshots) {
31 if (snap.stable.length < max) {
32 throw new Error(
33 `Stable count regressed: ${snap.stable.length} < ${max}`,
34 );
35 }
36 max = snap.stable.length;
37 }
38}
39
40/** Count how many snapshots had incomplete trailing tags stripped */
41export function countIncompleteStrips(snapshots: RehtmlResult[]): number {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected