RuiSiang / PoW-Shield

Prefer that for-in loops should include an if statement JS-0051
Anti-pattern
Minor
8 months ago8 months old
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
 49      fs.readFileSync(path.join(process.cwd(), 'wafRules.json')).toString()
 50    )
 51
 52    for (const key in this.types) { 53      this.types[this.types[key]] = key 54    } 55    rulesJson.forEach((rule: _Rule) => {
 56      this.rules[rule.id] = {
 57        reg: new RegExp(rule.reg),