-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
It is natural to use Array.prototype.filter
to filter items with missing information:
type Foo = { prop: string }
const a: Foo[] = [
{ prop: 'bar' },
{ prop: null },
{ prop: 'baz' }
]
a.filter(x => x.prop)
Unfortunately, this does not compile, as filter
definition requires the result of the filter function to be strictly boolean. Would it make sense to make the filter
definition less strict?
mjohnsonengr and luketannerkrzkaczor
Metadata
Metadata
Assignees
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript