UNPKG

alapa

Version:

A cutting-edge web development framework designed to revolutionize the way developers build modern web applications.

19 lines (18 loc) 691 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.outPutVariable = outPutVariable; const misc_1 = require("./regex/misc"); function outPutVariable(template) { return template.replace(misc_1.outputRegex, (match, open, key, close) => { if (open.length == close.length) { if (open.length === 2 || open.length === 3) { let value = `{% addOutPutToTemplateEngine(\`$\{${key}}\`); %}`; if (open.length === 2) { value = `{% addOutPutToTemplateEngine(escapeHTML(\`$\{${key}}\`)); %}`; } return value; } } return match; }); }