* Read a template file and render it with the given context. * Combines file loading and template rendering into a single helper. * @param {string} templatePath - Absolute path to the template file * @param {Record } context - Key-value pairs for replacemen
(templatePath, context)
| 138 | * @returns {string} Rendered template with placeholders replaced |
| 139 | */ |
| 140 | function renderTemplateFromFile(templatePath, context) { |
| 141 | const template = fs.readFileSync(templatePath, "utf8"); |
| 142 | return renderTemplate(template, context); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Convert context object keys to snake_case for template rendering. |
no test coverage detected