Skip to content

Commit

Permalink
chore: formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowtime2000 committed Dec 5, 2020
1 parent 74904fc commit b576e7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 6 additions & 1 deletion src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ export default function render(
}
}

export function renderAsync(template: string | TemplateFunction, data: object, config?: PartialConfig, cb?: CallbackFn): string | Promise<string> | void {
export function renderAsync(
template: string | TemplateFunction,
data: object,
config?: PartialConfig,
cb?: CallbackFn
): string | Promise<string> | void {
// Using Object.assign to lower bundle size, using spread operator makes it larger
return render(template, data, Object.assign({}, config, { async: true }), cb)
}

0 comments on commit b576e7c

Please sign in to comment.