return getFilteredConditionsListWithParams((it) => it.selected)import type {…
- User
return getFilteredConditionsListWithParams((it) => it.selected)import type { ConditionMapItem, ConditionMessage, ConditionsListDto, ConditionsMap, CovenantDto, CovenantGroupId, } from '$conditions-core';
type GetFilteredConditionsListWithParamsProps = { conditionsListDto: ConditionsListDto; filterCallback: (condition: CovenantDto) => boolean | ConditionMessage | undefined; };
export const getFilteredConditionsListWithParams = ({ conditionsListDto, filterCallback, }: GetFilteredConditionsListWithParamsProps) => conditionsListDto.conditionsList.map((item) => { const filteredConditionsMap = Object.entries(item.conditionsMap).reduce( (acc, [key, conditionItem]: [CovenantGroupId, ConditionMapItem]) => { const filteredConditions = conditionItem.conditions.filter(filterCallback);
codeif (filteredConditions.length > 0) { acc[key] = { ...conditionItem, conditions: filteredConditions }; } return acc; }, {} as ConditionsMap<CovenantDto>, ); return { ...item, conditionsMap: filteredConditionsMap }; });Argument of type '(it: any) => any' is not assignable to parameter of type 'GetFilteredConditionsListWithParamsProps'
- Assistant
The error you're encountering suggests that the argument being passed to
getFilteredConditionsListWithParamsdoes not match the expected type structure defined byGetFilteredConditionsListWithParamsProps. The expected structure requires two properties: and . The error is specifically indicating that the lambda function is not conforming to the expected type of a , which should take a and return a boolean or a . - User
import type { ConditionMessage, ConditionsListDto } from 'ufs-common';
- Assistant