Download frontend/node_modules/next/dist/esm/server/lib/app-dir-module.js from netzkontrast/rag-context-optimizer: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/netzkontrast/rag-context-optimizer/resolve/main/frontend/node_modules/next/dist/esm/server/lib/app-dir-module.js
- Command line
-
hf download hf://spaces/netzkontrast/rag-context-optimizer/frontend/node_modules/next/dist/esm/server/lib/app-dir-module.js
-
curl -L -o app-dir-module.js https://huggingface.co/spaces/netzkontrast/rag-context-optimizer/resolve/main/frontend/node_modules/next/dist/esm/server/lib/app-dir-module.js
1.16 kB
| import { DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'; | |
| export async function getLayoutOrPageModule(loaderTree) { | |
| const { layout, page, defaultPage } = loaderTree[2]; | |
| const isLayout = typeof layout !== 'undefined'; | |
| const isPage = typeof page !== 'undefined'; | |
| const isDefaultPage = typeof defaultPage !== 'undefined' && loaderTree[0] === DEFAULT_SEGMENT_KEY; | |
| let mod = undefined; | |
| let modType = undefined; | |
| let filePath = undefined; | |
| if (isLayout) { | |
| mod = await layout[0](); | |
| modType = 'layout'; | |
| filePath = layout[1]; | |
| } else if (isPage) { | |
| mod = await page[0](); | |
| modType = 'page'; | |
| filePath = page[1]; | |
| } else if (isDefaultPage) { | |
| mod = await defaultPage[0](); | |
| modType = 'page'; | |
| filePath = defaultPage[1]; | |
| } | |
| return { | |
| mod, | |
| modType, | |
| filePath | |
| }; | |
| } | |
| export async function getComponentTypeModule(loaderTree, moduleType) { | |
| const { [moduleType]: module } = loaderTree[2]; | |
| if (typeof module !== 'undefined') { | |
| return await module[0](); | |
| } | |
| return undefined; | |
| } | |
| //# sourceMappingURL=app-dir-module.js.map |