twing
Version:
First-class Twig engine for Node.js
12 lines (11 loc) • 405 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getKeyValuePairs = void 0;
const array_chunk = require('locutus/php/array/array_chunk');
const getKeyValuePairs = (node) => {
const chunks = array_chunk(Object.values(node.children), 2);
return chunks.map(([key, value]) => {
return { key, value };
});
};
exports.getKeyValuePairs = getKeyValuePairs;