lib/services/composer.js
function composePage(pageData, locals) {
  const layoutReference = pageData.layout,
    pageDataNoConf = references.omitPageConfiguration(pageData);

  return components.get(layoutReference)
    .then(layoutData => mapLayoutToPageData(pageDataNoConf, layoutData))
    .then(fullData => resolveComponentReferences(fullData, locals));
}
function composePage(pageData, locals) {
  const layoutReference = pageData.layout,
    pageDataNoConf = references.omitPageConfiguration(pageData);

  return components.get(layoutReference)
    .then(layoutData => mapLayoutToPageData(pageDataNoConf, layoutData))
    .then(fullData => resolveComponentReferences(fullData, locals));
}
function composePage ( pageData , locals ) { const layoutReference = pageData . layout , pageDataNoConf = references . omitPageConfiguration ( pageData ) ; return components . get ( layoutReference ) . then ( layoutData => mapLayoutToPageData ( pageDataNoConf , layoutData ) ) . then ( fullData => resolveComponentReferences ( fullData , locals ) ) ; }
Compose a page, recursively filling in all component references with
instance data.
@param  {object} pageData
@param  {object} locals
@return {Promise} - Resolves with composed page data
Compose a page recursively filling in all component references with instance data .