UNPKG

twing

Version:

First-class Twig engine for Node.js

22 lines (21 loc) 841 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.executeBaseNodeSynchronously = exports.executeBaseNode = void 0; const executeBaseNode = async (node, executionContext) => { const output = []; const { nodeExecutor: execute } = executionContext; for (const [, child] of Object.entries(node.children)) { output.push(await execute(child, executionContext)); } return output; }; exports.executeBaseNode = executeBaseNode; const executeBaseNodeSynchronously = (node, executionContext) => { const output = []; const { nodeExecutor: execute } = executionContext; for (const [, child] of Object.entries(node.children)) { output.push(execute(child, executionContext)); } return output; }; exports.executeBaseNodeSynchronously = executeBaseNodeSynchronously;