UNPKG

twing

Version:

First-class Twig engine for Node.js

18 lines (17 loc) 852 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.executeSpreadNodeSynchronously = exports.executeSpreadNode = void 0; const iterator_to_hash_1 = require("../../helpers/iterator-to-hash"); const executeSpreadNode = (node, executionContext) => { const { iterable } = node.children; const { nodeExecutor: execute } = executionContext; return execute(iterable, executionContext); }; exports.executeSpreadNode = executeSpreadNode; const executeSpreadNodeSynchronously = (node, executionContext) => { const { iterable: iterableNode } = node.children; const { nodeExecutor: execute } = executionContext; const iterable = execute(iterableNode, executionContext); return (0, iterator_to_hash_1.iteratorToHash)(iterable); }; exports.executeSpreadNodeSynchronously = executeSpreadNodeSynchronously;