Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.getFilters = (filters = {}) => {
const filtersWithoutFLags = omitBy(filters, (_, key) => isFlag(key));
const flat = Object.keys(flattenObject.convert(filtersWithoutFLags));
if (flat.some(v => v.includes('$'))) throw new HttpError.BadRequest('unsafe query parameter');
const filterParsed = reduce(filtersWithoutFLags, filterParserReducer, {});
return filterParsed;
};