function base(obj, cb) { let result = ""; obj.contents.forEach((content) => { if (content.length === 0) return; if (content.active) { result = cb(content, result); } }); return result; } function banner(obj) { function createBanner(content, string) { return (string += `
`); } return base(obj, createBanner); } function colecao(obj, shelfs) { const shelf = shelfs.find((shelf) => shelf.name === obj.properties.layout); const shelfCount = obj.properties["number-of-items"]; const shelfItem = [...Array(shelfCount).keys()].map( (i) => `