When using filter function, TS 2.5 is giving an error:
Type '(recpt: Recipient) => boolean | undefined' has no properties in common with type 'Partial<Recipient>'
code looks like this:
const recipients: Comunication.Recipient[] = [
{
name: 'Prefeitura',
type: 'orgao',
groups: ['chat','contato','sms']
},
]
// ...
_.filter(recipients, (recpt) => (
recpt.type === 'orgao' && recpt.groups && recpt.groups.indexOf(req.params['group']) !== -1
))
same code is working fine in 2.4