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

Function registerPartials

apps/api/src/templates/email/preview.ts:27–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25};
26
27const registerPartials = (): void => {
28 if (!fs.existsSync(COMPONENTS_DIR)) {
29 return;
30 }
31
32 const partialFiles = fs.readdirSync(COMPONENTS_DIR);
33
34 for (const file of partialFiles) {
35 if (file.endsWith(".hbs")) {
36 const partialName = path.basename(file, ".hbs");
37 const partialContent = fs.readFileSync(
38 path.join(COMPONENTS_DIR, file),
39 "utf8"
40 );
41
42 Handlebars.registerPartial(partialName, partialContent);
43 }
44 }
45};
46
47const getDummyValue = (varName: string): string => {
48 const lowercased = varName.toLowerCase();

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected