twing
Version:
First-class Twig engine for Node.js
19 lines (18 loc) • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.executeTextNodeSynchronously = exports.executeTextNode = void 0;
const executeTextNode = (textNode, executionContext) => {
const { template, outputBuffer, sourceMapRuntime } = executionContext;
sourceMapRuntime === null || sourceMapRuntime === void 0 ? void 0 : sourceMapRuntime.enterSourceMapBlock(textNode.line, textNode.column, textNode.type, template.source, outputBuffer);
outputBuffer.echo(textNode.attributes.data);
sourceMapRuntime === null || sourceMapRuntime === void 0 ? void 0 : sourceMapRuntime.leaveSourceMapBlock(outputBuffer);
return Promise.resolve();
};
exports.executeTextNode = executeTextNode;
const executeTextNodeSynchronously = (textNode, executionContext) => {
const { template, outputBuffer, sourceMapRuntime } = executionContext;
sourceMapRuntime === null || sourceMapRuntime === void 0 ? void 0 : sourceMapRuntime.enterSourceMapBlock(textNode.line, textNode.column, textNode.type, template.source, outputBuffer);
outputBuffer.echo(textNode.attributes.data);
sourceMapRuntime === null || sourceMapRuntime === void 0 ? void 0 : sourceMapRuntime.leaveSourceMapBlock(outputBuffer);
};
exports.executeTextNodeSynchronously = executeTextNodeSynchronously;