Skip to content

Add transcode#29

Merged
yassernasc merged 1 commit intomainfrom
transcode
Mar 2, 2026
Merged

Add transcode#29
yassernasc merged 1 commit intomainfrom
transcode

Conversation

@yassernasc
Copy link
Contributor

No description provided.

@yassernasc yassernasc requested a review from a team March 2, 2026 14:13
Comment on lines +844 to +846
exports.transcode = function transcode(buffer, from, to) {
return Buffer.from(buffer.toString(from), to)
}
Copy link

Choose a reason for hiding this comment

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

I wonder if we should not handle the case where buffer is already a string. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Node.js doesn't cover receiving strings in this case, no need to add a divergence IMO.

Copy link
Contributor

@kasperisager kasperisager left a comment

Choose a reason for hiding this comment

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

Perfectly solid first iteration and then we can improve it later to reduce the memory overhead 👌🏼

@yassernasc yassernasc merged commit 7e393d9 into main Mar 2, 2026
3 checks passed
@yassernasc yassernasc deleted the transcode branch March 2, 2026 16:12
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