plane/web/helpers/filter.helper.ts
sriram veeraghanta 3d09a69d58
fix: eslint issues and reconfiguring (#3891)
* fix: eslint fixes

---------

Co-authored-by: gurusainath <gurusainath007@gmail.com>
2024-03-06 18:39:14 +05:30

16 lines
560 B
TypeScript

// types
import { IIssueFilterOptions } from "@plane/types";
export const calculateTotalFilters = (filters: IIssueFilterOptions): number =>
filters && Object.keys(filters).length > 0
? Object.keys(filters)
.map((key) =>
filters[key as keyof IIssueFilterOptions] !== null
? isNaN((filters[key as keyof IIssueFilterOptions] as string[]).length)
? 0
: (filters[key as keyof IIssueFilterOptions] as string[]).length
: 0
)
.reduce((curr, prev) => curr + prev, 0)
: 0;