Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
case ACTION_RULE_TYPE_BOOLEAN: {
tmpResult = ruleData;
break;
}
case ACTION_RULE_TYPE_REGEX: {
const regexParts = ruleData.split('/');
let regexPattern = '';
let regexParam = '';
if (regexParts.length === 1) {
[regexPattern] = regexParts;
} else if (regexParts.length === 3) {
regexParts.shift();
[regexPattern, regexParam = ''] = regexParts;
} else {
logger.error(`Error: Invalid regex string in action rule in element ${element.id}`);
break;
}
const regex = new RegExp(regexPattern, regexParam);
tmpResult = regex.test(nextState.formData[rule.context]);
break;
}
default: break;
}
// Concat rules based on the rule concat method of the action
result = concatRules(result, tmpResult);
});
stop() {
logger.error('MediaProvider.stop() needs to be implemented within an inheriting class');
return this;
}
}
.catch((error) => {
logger.error(error);
dispatch(errorRootCategories());
});
};
.catch((error) => {
logger.error(error);
dispatch(errorProductMedia(productId, error.code));
});
};
.catch((error) => {
const requestsPending = request.hasPendingRequests();
dispatch(errorUpdateProductsInCart(updateData, undefined, requestsPending));
logger.error('updateProductsInCart', error);
});
};
.catch((error) => {
logger.error(error);
dispatch(errorFilters(hash));
});
};
.catch((error) => {
const { code } = error;
switch (code) {
case EACCESS:
dispatch(toggleLoggedIn(false));
break;
default:
logger.error(error);
break;
}
dispatch(errorUser());
});
};
.catch((err) => {
logger.error(err);
dispatch(errorProductRelations({ hash }));
});
const commitTemporaryFilters = (roundDisplayAmounts = true) => (dispatch, getState) => {
const state = getState();
const activeFilters = getActiveFiltersStack(state);
let temporaryFilters;
if (roundDisplayAmounts) {
temporaryFilters = getTemporaryFiltersWithRoundedDisplayAmounts(state);
} else {
temporaryFilters = getTemporaryFilters(state);
}
if (!activeFilters.length) {
logger.error('Tried to submit temporary filters, but no active filter stack was created.');
return;
}
if (!shallowEqual(temporaryFilters, activeFilters[activeFilters.length - 1].filters)) {
const categoryId = getCurrentCategoryId(state);
const searchPhrase = getSearchPhrase(state);
dispatch(setActiveFilters(temporaryFilters, {
...categoryId && { categoryId },
...searchPhrase && { searchPhrase },
}));
const params = {
...categoryId && { categoryId },
...searchPhrase && { searchPhrase },
limit: ITEMS_PER_LOAD,
.catch((error) => {
const requestsPending = request.hasPendingRequests();
dispatch(errorDeleteProductsFromCart(cartItemIds, undefined, requestsPending));
logger.error('deleteProductsFromCart', error);
});
};