Skip to content

Commit

Permalink
Support agile extension of Eta class (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
stdword committed Jul 27, 2023
1 parent 7e49013 commit 8b15b6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/compile-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export function compileToString(this: Eta, str: string, options?: Partial<Option
const config = this.config;
const isAsync = options && options.async;

const compileBody = this.compileBody;

const buffer: Array<AstObject> = this.parse.call(this, str);

// note: when the include function passes through options, the only parameter that matters is the filepath parameter
Expand Down Expand Up @@ -72,7 +74,7 @@ return __eta.res;
* ```
*/

function compileBody(this: Eta, buff: Array<AstObject>) {
export function compileBody(this: Eta, buff: Array<AstObject>) {
const config = this.config;

let i = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Cacher } from "./storage.ts";
import { compile } from "./compile.ts";
import { compileToString } from "./compile-string.ts";
import { compileToString, compileBody } from "./compile-string.ts";
import { defaultConfig } from "./config.ts";
import { parse } from "./parse.ts";
import { render, renderAsync, renderString, renderStringAsync } from "./render.ts";
Expand All @@ -26,6 +26,7 @@ export class Eta {

compile = compile;
compileToString = compileToString;
compileBody = compileBody;
parse = parse;
render = render;
renderAsync = renderAsync;
Expand Down

0 comments on commit 8b15b6b

Please sign in to comment.