(currentPage: Page)
| 478 | } |
| 479 | |
| 480 | export function getOrderedLibraries(currentPage: Page) { |
| 481 | const allLibraries = (Object.keys(TAB_DEFS) as Library[]).map(id => ({id, ...TAB_DEFS[id]})); |
| 482 | const currentLibId = getLibraryFromPage(currentPage); |
| 483 | const currentIndex = allLibraries.findIndex(lib => lib.id === currentLibId); |
| 484 | if (currentIndex > 0) { |
| 485 | const currentLib = allLibraries.splice(currentIndex, 1)[0]; |
| 486 | allLibraries.unshift(currentLib); |
| 487 | } |
| 488 | return allLibraries; |
| 489 | } |
| 490 | |
| 491 | export function getResourceTags(library: Library): Tag[] { |
| 492 | if (library === 'react-spectrum') { |
no test coverage detected