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

Function sortSectionPages

packages/dev/s2-docs/src/Nav.tsx:181–195  ·  view source on GitHub ↗
(pages: Page[])

Source from the content-addressed store, hash-verified

179}
180
181function sortSectionPages(pages: Page[]): Page[] {
182 return [...pages]
183 .filter(page => !page.exports?.isSubpage)
184 .sort((a, b) => {
185 let aIntro = isIntroduction(a);
186 let bIntro = isIntroduction(b);
187 if (aIntro && !bIntro) {
188 return -1;
189 }
190 if (!aIntro && bIntro) {
191 return 1;
192 }
193 return title(a).localeCompare(title(b));
194 });
195}
196
197function sortOverview(pages: Page[]): Page[] {
198 return [...pages]

Callers 1

NavFunction · 0.85

Calls 4

isIntroductionFunction · 0.85
titleFunction · 0.85
sortMethod · 0.65
filterMethod · 0.65

Tested by

no test coverage detected