Open artola opened 1 year ago
I was reading the code to evaluate the usage, I found this line: https://github.com/rahulramesha/http2-express-bridge/blob/76b699e4385946b8c6fccacd45eac0577e24b66c/src/util.js#L7 The problem is that the return false does nothing more than finish the iteration and moving to the next element of the array.
return false
if (Array.isArray(arr)) { arr.forEach(item => { if(typeof item !== 'string'){ return false // <======= here } }) return true }
Probably it was intended this optimised version that will stop asap:
if (Array.isArray(arr)) { return arr.every(item => typeof item === 'string') }
I was reading the code to evaluate the usage, I found this line: https://github.com/rahulramesha/http2-express-bridge/blob/76b699e4385946b8c6fccacd45eac0577e24b66c/src/util.js#L7 The problem is that the
return false
does nothing more than finish the iteration and moving to the next element of the array.Probably it was intended this optimised version that will stop asap: