MCPcopy Index your code
hub / github.com/adobe/react-spectrum / getLibraryFromUrl

Function getLibraryFromUrl

packages/dev/s2-docs/src/library.tsx:7–15  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

5export type Library = 'react-spectrum' | 'react-aria';
6
7export function getLibraryFromUrl(name: string): Library {
8 if (name.startsWith('react-aria/')) {
9 return 'react-aria';
10 }
11 if (name.startsWith('s2/')) {
12 return 'react-spectrum';
13 }
14 return 'react-spectrum';
15}
16
17export function getLibraryFromPage(page: {name: string}): Library {
18 return getLibraryFromUrl(page.name);

Callers 2

MarkdownMenuFunction · 0.90
getLibraryFromPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected