We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array.prototype.find
Something similar might be here #19456
Currently migrating codebase strictNullChecks on 5.7.3. Potentially an old issue.
https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABBOBDANgUwM4UwCgDpiYpMBbbALkX2ygCcYwBzRAH0TBHXQ8XAATTMGaZBASgDaAXQk16TVvyEixgxAG8AUIj2IGmKCAZJSFbIVFhB+GIgC8APkT2AhA4dcefAGS-XRA8vVWtxRH9Aj0QAIhiJAG5tAF8gA
function coalesce(...items: (string | null | undefined)[]): string | undefined { return items.find(i => i !== null && i !== undefined && i != ""); }
Type 'string | null | undefined' is not assignable to type 'string | undefined'. Type 'null' is not assignable to type 'string | undefined'.(2322)
null values are filtered out, so return type should exclude null
No response
The text was updated successfully, but these errors were encountered:
https://github.com/Microsoft/typescript/issues?q=is%3Aissue%20state%3Aclosed%20array%20find%20in%3Atitle
Sorry, something went wrong.
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
π 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
https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABBOBDANgUwM4UwCgDpiYpMBbbALkX2ygCcYwBzRAH0TBHXQ8XAATTMGaZBASgDaAXQk16TVvyEixgxAG8AUIj2IGmKCAZJSFbIVFhB+GIgC8APkT2AhA4dcefAGS-XRA8vVWtxRH9Aj0QAIhiJAG5tAF8gA
π» Code
π Actual behavior
π Expected behavior
null values are filtered out, so return type should exclude null
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: