module.exports = { renderPartial: function(app, view, data = {}) { return new Promise((resolve, reject) => { app.render(view, data, (err, html) => { if (err) return reject(err); resolve(html); }); }); }, // objectTree: function(context, options) { // let ret = ''; // if (context === null || context === undefined) return ret; // if (Array.isArray(context)) { // context.forEach((item, index) => { // ret += options.fn({ key: index, value: item }); // }); // } else if (typeof context === 'object') { // for (const key in context) { // if (context.hasOwnProperty(key)) { // ret += options.fn({ key, value: context[key] }); // } // } // } else { // // primitive Werte // ret += options.fn({ key: null, value: context }); // } // return ret; // } }