@factorypure/client-helpers 1.1.2 → 1.1.3
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 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -230,7 +230,7 @@ const handleVendorExclusions = (dataToSearch, options, variant) => {
|
|
|
230
230
|
const hasExclusion = nots.some((sku) => {
|
|
231
231
|
const escaped = sku.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
232
232
|
const matchRegex = new RegExp(`(?: |\/|\&|\=|"|'|\`)${escaped}(?: |\/|\&|\=|"|'|\`)`, 'gi');
|
|
233
|
-
const matches = item
|
|
233
|
+
const matches = item?.title?.match(matchRegex);
|
|
234
234
|
return matches && matches.length > 0;
|
|
235
235
|
});
|
|
236
236
|
if (!hasExclusion) {
|
|
@@ -265,7 +265,7 @@ const handleSkipSkuSearch = (dataToSearch, options, variant) => {
|
|
|
265
265
|
const escapedSku = sku.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
266
266
|
// this regex will pick up values from url eg. /product/sku12345/ without picking up partial matches and double counting eg. 15000 being counted twice in 15000 and xp15000
|
|
267
267
|
const skuRegex = new RegExp(`(?: |\/|\&|\=|"|'|\`)${escapedSku}(?: |\/|\&|\=|"|'|\`)`, 'gi');
|
|
268
|
-
const skuMatches = item
|
|
268
|
+
const skuMatches = item?.title?.match(skuRegex);
|
|
269
269
|
return skuMatches && skuMatches.length > 0;
|
|
270
270
|
});
|
|
271
271
|
if (!hasExclusion) {
|