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

Function getCurrentPage

packages/dev/s2-docs/src/getPages.ts:76–92  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

74}
75
76export function getCurrentPage(page: Page): Page {
77 // Remove .html
78 let name = page.name.slice(0, -5);
79
80 // Prepend current build's library
81 let library = process.env.LIBRARY;
82 if (library) {
83 name = `${library}/${name}`;
84 }
85
86 return {
87 name,
88 url: getUrl(name),
89 exports: page.exports,
90 tableOfContents: page.tableOfContents
91 };
92}
93
94// console.log(await getPages());

Callers 2

LayoutFunction · 0.90
RouterWrapperServerFunction · 0.90

Calls 2

getUrlFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected