CONSUME-AS-DATA-06: Name two tables in one section
What it demonstrates
Section titled “What it demonstrates”A section’s content record yields several independently-named TableViews, each its own typed view.
Builds on: CONSUME-AS-DATA-05: Target rows with column / find / rowPos
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
const c = contract({ body: sections({}, [ section("Decision", { content: { components: table({ anchor: "components", columns: ["#", "Component", "Resolution"] }), risks: table({ anchor: "risks", columns: ["Risk", "Mitigation"] }), } }),])});
const d = c.read(src, { path: "README.md" }).body.decision;d.components.column("Component"); // ["projection", "grammar"]d.risks.find(r => r.Risk.includes("gfm"))?.Mitigation; // "pin in spike S6"Surfaces exercised
Section titled “Surfaces exercised”section() content record of named table() leavesper-field TableView access.column/.find