Skip to content

Commit

Permalink
Add early return
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed May 9, 2024
1 parent b632252 commit d9a7302
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/vscode/src/providers/preview/preview-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ export function isQuartoShinyKnitrDoc(

}

export async function isRPackage() {
export async function isRPackage(): Promise<boolean> {
const descriptionLines = await parseRPackageDescription();
if (!descriptionLines) {
return false;
}
const packageLines = descriptionLines.filter(line => line.startsWith('Package:'));
const typeLines = descriptionLines.filter(line => line.startsWith('Type:'));
const typeIsPackage = (typeLines.length > 0
Expand Down

0 comments on commit d9a7302

Please sign in to comment.