@shopgate/pwa-common-commerce
Version:
Commerce library for the Shopgate Connect PWA.
9 lines • 499 B
JavaScript
/**
* Pipeline call adds $start$ and $end$ placeholders for higlighting purposes.
*
* Since the search autocomplete functionality doesn't highlight anything currently,
* it needs to be stripped out.
*
* @param {Array} suggestions An array of strings.
* @returns {Array}
*/var removeHighlightingPlaceholers=function removeHighlightingPlaceholers(suggestions){return suggestions.map(function(item){return item.replace(/\$start\$|\$end\$/g,'');});};export default removeHighlightingPlaceholers;