* Get the postponed state for a route. * * @param appDir - The app directory. * @param routeFileNoExt - The route file name without the extension. * @returns The postponed state for the route.
({
appDir,
routeFileNoExt,
}: {
appDir: string;
routeFileNoExt: string;
})
| 4745 | * @returns The postponed state for the route. |
| 4746 | */ |
| 4747 | function getHTMLPostponedState({ |
| 4748 | appDir, |
| 4749 | routeFileNoExt, |
| 4750 | }: { |
| 4751 | appDir: string; |
| 4752 | routeFileNoExt: string; |
| 4753 | }) { |
| 4754 | const metaPath = path.join(appDir, `${routeFileNoExt}.meta`); |
| 4755 | if (!fs.existsSync(metaPath)) { |
| 4756 | return null; |
| 4757 | } |
| 4758 | |
| 4759 | const meta: unknown = JSON.parse(fs.readFileSync(metaPath, 'utf8')); |
| 4760 | |
| 4761 | if ( |
| 4762 | typeof meta !== 'object' || |
| 4763 | meta === null || |
| 4764 | !('postponed' in meta) || |
| 4765 | typeof meta.postponed !== 'string' |
| 4766 | ) { |
| 4767 | return null; |
| 4768 | } |
| 4769 | |
| 4770 | return meta.postponed; |
| 4771 | } |
| 4772 | |
| 4773 | export async function getServerActionMetaRoutes( |
| 4774 | distDir: string |
no test coverage detected