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

Function seedRowCountsFromDom

src/patch-streaming-html.ts:682–695  ·  view source on GitHub ↗
(table: HTMLTableElement)

Source from the content-addressed store, hash-verified

680}
681
682function seedRowCountsFromDom(table: HTMLTableElement): void {
683 if (table.dataset.shTheadRowCount === undefined) {
684 const thead = table.querySelector("thead");
685 table.dataset.shTheadRowCount = String(
686 thead
687 ? thead.querySelectorAll("tr:not([data-sh-partial])").length
688 : 0,
689 );
690 }
691 if (table.dataset.shRowCount === undefined) {
692 const tbody = table.querySelector("tbody");
693 table.dataset.shRowCount = String(tbody ? countBodyRows(tbody) : 0);
694 }
695}
696
697function findActiveTable(container: HTMLElement): HTMLTableElement | null {
698 const tables = container.querySelectorAll("table");

Callers 1

patchTableRowsFunction · 0.85

Calls 1

countBodyRowsFunction · 0.85

Tested by

no test coverage detected