@factorypure/client-helpers 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -601,7 +601,8 @@ export const calculateHideReasons = (result, variant, variantScrapeOptions) => {
|
|
|
601
601
|
export const calculateHideOverrideReasons = (result, variant) => {
|
|
602
602
|
const hide_override_reasons = [];
|
|
603
603
|
// Match SKU as a whole word or inside parentheses/brackets
|
|
604
|
-
const
|
|
604
|
+
const escapedSku = variant.sku.replace(/\+/g, '\\+');
|
|
605
|
+
const skuRegex = new RegExp(`(?:\\b|[\\(\\[\\{])${escapedSku}(?:\\b|[\\)\\]\\}])`, 'gi');
|
|
605
606
|
if (skuRegex.test(result.title)) {
|
|
606
607
|
hide_override_reasons.push('SKU Match');
|
|
607
608
|
}
|