Skip to content

Lodash definitions not working on TS 2.5 #18956

@pocesar

Description

@pocesar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions