Skip to content

Commit

Permalink
refactor: replaced the negation check with a positive check for clarity
Browse files Browse the repository at this point in the history
PR-URL: #203
  • Loading branch information
Ayoub-Mabrouk authored Nov 1, 2024
1 parent 2854e7d commit 0a10f23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ function chunkLength (chunk, encoding) {
return 0
}

return !Buffer.isBuffer(chunk)
? Buffer.byteLength(chunk, encoding)
: chunk.length
return Buffer.isBuffer(chunk)
? chunk.length
: Buffer.byteLength(chunk, encoding)
}

/**
Expand Down

0 comments on commit 0a10f23

Please sign in to comment.