Closed as not planned
Description
π Search Terms
Array.prototype.find
Something similar might be here
#19456
π Version & Regression Information
Currently migrating codebase strictNullChecks on 5.7.3. Potentially an old issue.
β― Playground Link
π» Code
function coalesce(...items: (string | null | undefined)[]): string | undefined {
return items.find(i => i !== null && i !== undefined && i != "");
}
π Actual behavior
Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.(2322)
π Expected behavior
null values are filtered out, so return type should exclude null
Additional information about the issue
No response