Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function findOperatorLabel(filter, appliedFilter) {
let operatorText = get(filter, 'operatorText');
if (
filter.type === FilterType.DateSelector &&
(get(appliedFilter, 'key') === get(filter, 'minKey') ||
get(appliedFilter, 'key') === get(filter, 'maxKey'))
) {
return '';
}
if (!operatorText || typeof operatorText === 'string') {
return operatorText;
}
let appliedOperator = operatorText.find((operator) => {
return get(operator, 'key') === get(appliedFilter, 'key');
});
if (appliedOperator) {
return (