mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
fix linter error in platform script
This commit is contained in:
parent
6590245e8e
commit
adc9da4948
@ -64,15 +64,15 @@ export function pageExistsForPlatform(path: string, platform: Platform): boolean
|
||||
|
||||
// First try to find exact match
|
||||
let page = PLATFORM_PAGES.find(p => p.path === pathWithExt);
|
||||
|
||||
|
||||
// If not found and path doesn't end with index, try appending /index.mdx
|
||||
if (!page && !pathWithExt.includes('/index.mdx')) {
|
||||
const indexPath = normalizedPath.endsWith('.mdx')
|
||||
const indexPath = normalizedPath.endsWith('.mdx')
|
||||
? normalizedPath.replace('.mdx', '/index.mdx')
|
||||
: \`\${normalizedPath}/index.mdx\`;
|
||||
page = PLATFORM_PAGES.find(p => p.path === indexPath);
|
||||
}
|
||||
|
||||
|
||||
return page?.platforms.includes(platform) ?? false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user