MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getToCSubheadings

Function getToCSubheadings

packages/dev/s2-docs/src/searchUtils.tsx:142–150  ·  view source on GitHub ↗

* Gets all of the subheadings underneath a heading within the Table of Contents.

(TocNode: TocNode, headings: string[])

Source from the content-addressed store, hash-verified

140 * Gets all of the subheadings underneath a heading within the Table of Contents.
141 */
142function getToCSubheadings(TocNode: TocNode, headings: string[]): string[] {
143 headings.push(TocNode.title);
144
145 for (let node of TocNode.children) {
146 getToCSubheadings(node, headings);
147 }
148
149 return headings;
150}
151
152/**
153 * Transforms a page into a ComponentItem for search/display.

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected