Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version w/Uint8Array option? #293

Open
benrr101 opened this issue Feb 24, 2022 · 2 comments
Open

Version w/Uint8Array option? #293

benrr101 opened this issue Feb 24, 2022 · 2 comments

Comments

@benrr101
Copy link

I see in the master branch, the typings file allows for Buffer|Uint8Array. I'm currently working on refactoring some of the text decoding code in my project and would love to be able to use a Uint8Array with iconv-lite. Any chance we can get that change published? 😄

@ashtuchkin
Copy link
Owner

Hey Ben, do you need that for encoding or decoding? Current published version will happily decode Uint8Array even though the typings are not there. Publishing current master is tricky as it's not done yet.

@benrr101
Copy link
Author

Thanks for the response! I need it for decoding, so it's good to know that it will take Uint8Array even if the typings aren't there yet. I wanted to avoid the additional allocation of doing Buffer.from(myUint8Array). I'll give it a shot with an unsafe 'cast' in typescript and put a note in my code to remove the unsafe action once the new version is out.

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

No branches or pull requests

2 participants