Add new lint to disallow use of confusing isNaN (#4999)

This commit is contained in:
Jonathan Tran
2025-01-11 00:28:12 -05:00
committed by GitHub
parent 013cb10961
commit c6fad2e2dc
3 changed files with 9 additions and 2 deletions

View File

@ -42,7 +42,7 @@ export default class StreamDemuxer extends Queue<Uint8Array> {
// try to parse the content-length from the headers
const length = parseInt(match[1])
if (isNaN(length))
if (Number.isNaN(length))
return Promise.reject(new Error('invalid content length'))
// slice the headers since we now have the content length