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
string logical disjunction type inference string logical inference type infer empty string logical operation type
string logical disjunction type inference
string logical inference type
infer empty string logical operation type
Playground link with relevant code
const str: string | undefined = '' const test = (str || undefined) && {some: 'thing'}
Inferred type of operation is
"" | { some: string; } | undefined
{ some: string; } | undefined
because (str || undefined) prevents empty string to be returned
(str || undefined)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
π Search Terms
string logical disjunction type inference
string logical inference type
infer empty string logical operation type
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Inferred type of operation is
π Expected behavior
Inferred type of operation is
because
(str || undefined)
prevents empty string to be returnedThe text was updated successfully, but these errors were encountered: