From c72b391a8e9e320a33de363cb95074e78594b89f Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 10 Jan 2025 12:11:21 +0000 Subject: [PATCH 1/3] refactor(index): return directly in arrow function Signed-off-by: Frazer Smith --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index ba8e4d4..1582970 100644 --- a/index.js +++ b/index.js @@ -284,11 +284,9 @@ async function fastifyView (fastify, opts) { function readCallbackParser (page, html, localOptions) { if ((type === 'ejs') && viewExt && !globalOptions.includer) { - globalOptions.includer = (originalPath, parsedPath) => { - return { + globalOptions.includer = (originalPath, parsedPath) => ({ filename: parsedPath || join(templatesDir, originalPath + '.' + viewExt) - } - } + }) } if (localOptions) { for (const key in globalOptions) { From 57a1f9684f7dc6c9f43efc3d19ef1fee4561f36c Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 10 Jan 2025 12:16:20 +0000 Subject: [PATCH 2/3] Update index.js Signed-off-by: Frazer Smith --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1582970..462a59a 100644 --- a/index.js +++ b/index.js @@ -285,7 +285,7 @@ async function fastifyView (fastify, opts) { function readCallbackParser (page, html, localOptions) { if ((type === 'ejs') && viewExt && !globalOptions.includer) { globalOptions.includer = (originalPath, parsedPath) => ({ - filename: parsedPath || join(templatesDir, originalPath + '.' + viewExt) + filename: parsedPath || join(templatesDir, originalPath + '.' + viewExt) }) } if (localOptions) { From d083f8d8625d47a5b32b5852cef29eef0a46db21 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 10 Jan 2025 12:16:25 +0000 Subject: [PATCH 3/3] Update index.js Signed-off-by: Frazer Smith --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 462a59a..24e9e01 100644 --- a/index.js +++ b/index.js @@ -286,7 +286,7 @@ async function fastifyView (fastify, opts) { if ((type === 'ejs') && viewExt && !globalOptions.includer) { globalOptions.includer = (originalPath, parsedPath) => ({ filename: parsedPath || join(templatesDir, originalPath + '.' + viewExt) - }) + }) } if (localOptions) { for (const key in globalOptions) {