Files
lynchmark/tests/4_transpiler/outputs/minimax_minimax-m2.js
2025-12-02 15:05:25 +00:00

20 lines
662 B
JavaScript

export async function renderTemplate(template, data) {
const load = async () => {
try {
const src = 'https://cdn.jsdelivr.net/npm/handlebars@4.7.7/dist/handlebars.min.js'
const mod = await import(src)
return mod.default || mod.Handlebars || mod
} catch (e) {
const alt = 'https://unpkg.com/handlebars@4.7.7/dist/handlebars.min.js'
const mod2 = await import(alt)
return mod2.default || mod2.Handlebars || mod2
}
}
const hbs = await load()
const s = String(template)
const f = hbs.compile(s, { noEscape: false })
return f(data)
}
export default renderTemplate;
// Generation time: 13.350s
// Result: FAIL