From 1655f7419d62dcb00cd0c677765fa7dc56eb3d2f Mon Sep 17 00:00:00 2001 From: mohamed yahia Date: Wed, 15 Nov 2023 13:49:00 +0200 Subject: [PATCH] Update src/lib/readLocalMarkdownFileToObject.ts Co-authored-by: Ola Rubaj <52197250+olayway@users.noreply.github.com> --- src/lib/readLocalMarkdownFileToObject.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/readLocalMarkdownFileToObject.ts b/src/lib/readLocalMarkdownFileToObject.ts index cc50993..466afee 100644 --- a/src/lib/readLocalMarkdownFileToObject.ts +++ b/src/lib/readLocalMarkdownFileToObject.ts @@ -27,12 +27,11 @@ export function readLocalMarkdownFileToObject( links: [], }; - // if not md or mdx return this - const isExtensionNotSupported = - !MddbFile.supportedExtensions.includes(extension); - if (isExtensionNotSupported) { - return fileObject; - } +const isExtensionSupported = MddbFile.supportedExtensions.includes(extension); + +if (!isExtensionSupported) { + return fileObject; +} // url_path const pathRelativeToFolder = path.relative(folderPath, filePath);