RuiSiang / PoW-Shield

Consider using arrow functions for callbacks JS-0241
Anti-pattern
Minor
8 months ago8 months old
Unexpected function expression
 65  private parseNumString = (numString: string) => {
 66    const substrings = numString.split(',')
 67    const numArr: number[] = []
 68    substrings.forEach(function (item) { 69      if (item) { 70        const tmpArr = item.split('-') 71        if (tmpArr.length == 2) { 72          const low = parseInt(tmpArr[0]) 73          const high = parseInt(tmpArr[1]) 74          for (let i = low; i <= high; i++) { 75            numArr.push(i) 76          } 77        } else { 78          numArr.push(parseInt(tmpArr[0])) 79        } 80      } 81    }) 82    return numArr
 83  }
 84