MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / precompileToString

Function precompileToString

apps/api/src/templates/email/build.ts:13–21  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

11 * we can hand it to JSON.stringify safely.
12 */
13const precompileToString = (input: string): string => {
14 const result: unknown = Handlebars.precompile(input);
15
16 if (typeof result !== "string") {
17 throw new Error("Handlebars.precompile did not return a string");
18 }
19
20 return result;
21};
22
23const COMPONENTS_DIR = path.join(__dirname, "components");
24const TEMPLATES_DIR = path.join(__dirname, "templates");

Callers 2

precompilePartialsFunction · 0.85
buildTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected