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

Function sortOverview

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

Source from the content-addressed store, hash-verified

195}
196
197function sortOverview(pages: Page[]): Page[] {
198 return [...pages]
199 .filter(page => !page.exports?.isSubpage)
200 .sort((a, b) => {
201 let aIntro = a.url.endsWith('getting-started');
202 let bIntro = b.url.endsWith('getting-started');
203 if (aIntro && !bIntro) {
204 return -1;
205 }
206 if (!aIntro && bIntro) {
207 return 1;
208 }
209 return title(a).localeCompare(title(b));
210 });
211}
212
213function getDefaultExpandedKeys(currentPage: Page): string[] {
214 let keys = new Set<string>();

Callers 1

NavFunction · 0.85

Calls 3

titleFunction · 0.85
sortMethod · 0.65
filterMethod · 0.65

Tested by

no test coverage detected