Skip to content

Commit e8cd9ce

Browse files
derrekcolemanclaude
andcommitted
fix: handle both forward and backward slashes in getCategoryDisplayName
This aligns with the pattern used in isApiReferencePath and fixes incorrect category detection on Windows systems where paths normalized to forward slashes would fail to split correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f81eed1 commit e8cd9ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const DOCS_CATEGORIES = {
2121
export type CategoryType = keyof typeof DOCS_CATEGORIES;
2222

2323
export function getCategoryDisplayName(filePath: string): string {
24-
const pathParts = filePath.split(path.sep);
24+
const pathParts = filePath.split(/[/\\]/);
2525
const mainCategory = pathParts[0];
2626
if (mainCategory && mainCategory in DOCS_CATEGORIES)
2727
return DOCS_CATEGORIES[mainCategory as CategoryType];

0 commit comments

Comments
 (0)