RuiSiang / PoW-Shield

Use for-of loop for array JS-0361
Anti-pattern
Minor
8 months ago8 months old
Expected a for-of loop instead of a for loop with this simple iteration
74  public triggerReset = async () => {
75    if (process.env.NODE_ENV === 'test') {
76      const reqKeys = await this.nosql.keys('req:*')
77      for (let i = 0; i < reqKeys.length; i++) {78        await this.nosql.del(reqKeys[i])79      }80    }
81  }
82}
Expected a for-of loop instead of a for loop with this simple iteration
30  public triggerReset = async () => {
31    if (process.env.NODE_ENV === 'test') {
32      const banKeys = await this.nosql.keys('ban:*')
33      for (let i = 0; i < banKeys.length; i++) {34        await this.nosql.del(banKeys[i])35      }36    }
37  }
38}