Skip to content

Commit

Permalink
test(flow): fix flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
evansiroky committed Jul 3, 2019
1 parent 904f5b6 commit a9dec1f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
5 changes: 4 additions & 1 deletion lib/editor/util/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export function validate (
case 'GTFS_ID':
// Indices contains list of all indexes of occurrences of the ID value.
const indices = []
const idList = entities ? entities.map(e => e[name]) : []
const idList = entities ? entities.map(e => {
// $FlowFixMe too many unions for flow to handle
return name in e ? e[name] : null
}) : []
let idx = idList.indexOf(value)
while (idx !== -1) {
indices.push(idx)
Expand Down
1 change: 1 addition & 0 deletions lib/gtfsplus/components/GtfsPlusField.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ export default class GtfsPlusField extends Component<Props> {
value={stopValue} />
)
}
return null
}
}
5 changes: 4 additions & 1 deletion lib/public/components/UserAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export default class UserAccount extends Component<Props> {
render () {
const {activeComponent, projectId, projects, user} = this.props
const {profile} = user
if (!profile) return console.warn('User profile not found', user)
if (!profile) {
console.warn('User profile not found', user)
return null
}
const subscriptions: Array<Subscription> = profile.app_metadata.datatools
.find(dt => dt.client_id === process.env.AUTH0_CLIENT_ID).subscriptions
const ACCOUNT_SECTIONS = [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"express": "^4.16.4",
"express-http-proxy": "^1.5.1",
"extract-zip": "^1.6.7",
"flow-bin": "^0.77.0",
"flow-bin": "0.84",
"flow-coverage-report": "^0.3.0",
"fs-extra": "^6.0.1",
"istanbul-middleware": "^0.2.2",
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5368,16 +5368,11 @@ flatten@^1.0.2:
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"
integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=

[email protected]:
[email protected], [email protected].0:
version "0.84.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.84.0.tgz#4cb2364c750fb37a7840524fa62456b53f64cdcb"
integrity sha512-ocji8eEYp+YfICsm+F6cIHUcD7v5sb0/ADEXm6gyUKdjQzmSckMrPUdZtyfP973t3YGHKliUMxMvIBHyR5LbXQ==

flow-bin@^0.77.0:
version "0.77.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.77.0.tgz#4e5c93929f289a0c28e08fb361a9734944a11297"
integrity sha1-TlyTkp8omgwo4I+zYalzSUShEpc=

flow-coverage-report@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/flow-coverage-report/-/flow-coverage-report-0.3.0.tgz#a22d52fc9fa9c24ae0be02712a6fe1ac156f0d93"
Expand Down

0 comments on commit a9dec1f

Please sign in to comment.