facebook / facebook/flow

Inline if ignores object types

Open
#3,338 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

This will throw the expected error "property `responseCodeARGH`. Property not found in"
```
const isNotFound = res.apiActionResults[0].responseCodeARGH === 333;

return isNotFound ? [] : res.body.order_ids.split(',');
```

This will not:
```
return res.apiActionResults[0].responseCodeARGH === 333 ? [] : res.body.order_ids.split(',');
```

The only difference logically here is a variable substitution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.