Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
]
let result = groups.map(({ key, dishes }) => dishes.map((dish) => pokemon.dishWeight[key].map((value, index) => {
if (!value) {
return
}
return {
id: dish.id,
name: dish.name,
logo: dish.logo,
quality: QUALITIES[index],
weight: +value,
}
})))
result = flatten(result).filter(Boolean)
return {
...pokemon,
dishes: result,
}
})
export default function getRegexes(excludeServices = []) {
const includedRegexes = regexes.filter(
r => excludeServices.indexOf(r.name.toLowerCase()) === -1
)
const patterns = flatten(pluck(includedRegexes, "patterns"))
return new RegExp(patterns.join("|"), "gi")
}