Skip to content

Refactor toBuffer function to simplify buffer check logic#201

Merged
bjohansebas merged 1 commit intoexpressjs:masterfrom
Ayoub-Mabrouk:chore/toBuffer
Nov 2, 2024
Merged

Refactor toBuffer function to simplify buffer check logic#201
bjohansebas merged 1 commit intoexpressjs:masterfrom
Ayoub-Mabrouk:chore/toBuffer

Conversation

@Ayoub-Mabrouk
Copy link
Contributor

The function now directly returns the existing buffer if the input is already a buffer, eliminating the need for a negated condition. This improves code readability and maintains functionality by ensuring that non-buffer inputs are converted to a buffer using the specified encoding.

The function now directly returns the existing buffer if the input is already a buffer,
eliminating the need for a negated condition. This improves code readability and
maintains functionality by ensuring that non-buffer inputs are converted to a buffer
using the specified encoding.
Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bjohansebas
Copy link
Member

Can it still be included in this patch version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants