Use startsWith over string index

This is considered more idiomatic than indexing a string for its first
character.
pull/1612/head
Tim Raymond 2017-06-22 11:33:52 -04:00
parent b0ef948585
commit 22ddcd513c
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ class DatabaseDropdown extends Component {
}
// system databases are those preceded with an '_'
const nonSystemDatabases = databases.filter((name) => name[0] !== '_')
const nonSystemDatabases = databases.filter((name) => !name.startsWith('_'))
this.setState({databases: nonSystemDatabases})
const selectedDatabaseText = nonSystemDatabases.includes(database)