mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
This commit is contained in:
@@ -227,7 +227,7 @@ const LISTS_CREATE_WITH = {
|
||||
// Disconnect any children that don't belong.
|
||||
for (let i = 0; i < this.itemCount_; i++) {
|
||||
const connection = this.getInput('ADD' + i)!.connection!.targetConnection;
|
||||
if (connection && connections.indexOf(connection) === -1) {
|
||||
if (connection && !connections.includes(connection)) {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user