Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Dec 20, 2024
1 parent 0aa24ea commit 0d0d2f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/plugin-auto-nav-sidebar/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { logger } from '@rspress/shared/logger';
import { loadFrontMatter } from '@rspress/shared/node-utils';

/**
*
* @param rawPathWithExtension /usr/rspress-demo/docs/api.md
* @param extensions e.g: [".md"]
* @returns /usr/rspress-demo/docs/api.md or undefined
*/
export async function detectFilePathWithExtension(
rawPathWithExtension: string,
Expand All @@ -17,10 +16,10 @@ export async function detectFilePathWithExtension(
return undefined;
}
const stat = await fs.stat(rawPathWithExtension);
if (stat.isFile()) {
return rawPathWithExtension;
if (!stat.isFile()) {
return undefined;
}
return undefined;
return rawPathWithExtension;
}

/**
Expand Down

0 comments on commit 0d0d2f6

Please sign in to comment.