Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (shop) {
shopFilters = isStringArray(shop) ? shop.map(value => shopMapper(value)) : shopMapper(shop);
}
const sortingOptions = {
direction: constants.US_GET_GAMES_OPTIONS.direction,
sortBy: constants.US_GET_GAMES_OPTIONS.sort,
};
const body = {
body: JSON.stringify({
requests: [
{
indexName: `noa_aem_game_en_us${(sortingOptions.sortBy && sortingOptions.direction
? `_${sortingOptions.sortBy}_${sortingOptions.direction}` : '')}`,
params: stringify({
facetFilters: [
[ constants.US_GET_GAMES_OPTIONS.system ],
shopFilters
],
hitsPerPage: limit,
page,
}),
}
],
}),
headers: constants.US_ALGOLIA_HEADERS,
method: 'POST',
};
try {
if (hasProp(options, 'limit')) {