x/eta@v1.12.3/file-helpers.ts

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
GitHub Stars
590
Latest
import { includeFile } from "./file-handlers.ts";
/* TYPES */
import type { EtaConfig } from "./config.ts";
interface GenericData { [index: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any}
/* END TYPES */
/** * Called with `includeFile(path, data)` */
export function includeFileHelper( this: EtaConfig, path: string, data: GenericData,): string { const templateAndConfig = includeFile(path, this); return templateAndConfig[0](data, templateAndConfig[1]);}