From b576e7cd8b17ca7b0c4a37c8ea5811348d6bdfd9 Mon Sep 17 00:00:00 2001 From: shadowtime2000 <66655515+shadowtime2000@users.noreply.github.com> Date: Sat, 5 Dec 2020 00:56:02 -0800 Subject: [PATCH] chore: formatted --- src/file-utils.ts | 6 +++--- src/render.ts | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/file-utils.ts b/src/file-utils.ts index c369b28..6f75908 100644 --- a/src/file-utils.ts +++ b/src/file-utils.ts @@ -24,9 +24,9 @@ import type { EtaConfig } from './config' */ function getWholeFilePath(name: string, parentfile: string, isDirectory?: boolean): string { - const includePath = path.resolve( - isDirectory ?parentfile : path.dirname(parentfile) - ) + (path.extname(name) || '.eta') + const includePath = + path.resolve(isDirectory ? parentfile : path.dirname(parentfile)) + + (path.extname(name) || '.eta') return includePath } diff --git a/src/render.ts b/src/render.ts index ab25dfe..e268212 100644 --- a/src/render.ts +++ b/src/render.ts @@ -86,7 +86,12 @@ export default function render( } } -export function renderAsync(template: string | TemplateFunction, data: object, config?: PartialConfig, cb?: CallbackFn): string | Promise | void { +export function renderAsync( + template: string | TemplateFunction, + data: object, + config?: PartialConfig, + cb?: CallbackFn +): string | Promise | void { // Using Object.assign to lower bundle size, using spread operator makes it larger return render(template, data, Object.assign({}, config, { async: true }), cb) }