UNPKG

@shopgate/engage

Version:
7 lines 573 B
import{getThemeConfig}from"./getThemeConfig";/** * This function reads the config of a page, given by its pattern. If no page is found, the result * is an empty object. * * @param {string} pagePattern The page to look for in the theme config * @returns {Object} */export function getPageConfig(pagePattern){var _getThemeConfig=getThemeConfig(),_getThemeConfig$pages=_getThemeConfig.pages,pages=_getThemeConfig$pages===void 0?[]:_getThemeConfig$pages;var config=pages.find(function(element){return element.pattern===pagePattern;});if(!config){return{};}return config;}