Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/eta/src/compile-string.ts>compileBody

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
Go to Latest
function compileBody
import { compileBody } from "https://deno.land/x/eta@v3.1.1/src/compile-string.ts";

Loops through the AST generated by parse and transform each item into JS calls

Example

let templateAST = ['Hi ', { val: 'it.name', t: 'i' }]
compileBody.call(Eta, templateAST)
// => "__eta.res+='Hi '\n__eta.res+=__eta.e(it.name)\n"

Parameters

this: Eta
buff: Array<AstObject>