lib/associationProcessorService.js
async function renderComponentFromArray(definitionGroupName, definitionGroup) {

        const promises = definitionGroup.map((definintion) => renderOneComponent(definitionGroupName, definintion));
        const renderedComponents = await Promise.all(promises);

        const markup = [];
        const exported = {};

        renderedComponents.forEach(function (component) {
            merge(exported, component.exported || {});
            markup.push(component.markup);
        });

        const renderedComponentData = { markup: {}, exported};
        renderedComponentData.markup[definitionGroupName] = markup.join("\n");

        return renderedComponentData;
    }
async function renderComponentFromArray(definitionGroupName, definitionGroup) {

        const promises = definitionGroup.map((definintion) => renderOneComponent(definitionGroupName, definintion));
        const renderedComponents = await Promise.all(promises);

        const markup = [];
        const exported = {};

        renderedComponents.forEach(function (component) {
            merge(exported, component.exported || {});
            markup.push(component.markup);
        });

        const renderedComponentData = { markup: {}, exported};
        renderedComponentData.markup[definitionGroupName] = markup.join("\n");

        return renderedComponentData;
    }
async function renderComponentFromArray ( definitionGroupName , definitionGroup ) { const promises = definitionGroup . map ( ( definintion ) => renderOneComponent ( definitionGroupName , definintion ) ) ; const renderedComponents = await Promise . all ( promises ) ; const markup = [ ] ; const exported = { } ; renderedComponents . forEach ( function ( component ) { merge ( exported , component . exported || { } ) ; markup . push ( component . markup ) ; } ) ; const renderedComponentData = { markup : { } , exported } ; renderedComponentData . markup [ definitionGroupName ] = markup . join ( "\n" ) ; return renderedComponentData ; }
Renders an array of component definitions by aggregating them
into a single rendered component object

@param {string} definitionGroupName - They key where the definitions are found in their parent component's associations
@param {ComponentDefinition[]} definitionGroup - Array of configs for Windshield Components
@returns {Promise.<RenderedComponent>}
Renders an array of component definitions by aggregating them into a single rendered component object