Skip to content

glue/misc: Implement u8s2str and str2u8s #1

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

Merged
merged 1 commit into from
May 5, 2022
Merged

glue/misc: Implement u8s2str and str2u8s #1

merged 1 commit into from
May 5, 2022

Conversation

hyp3rflow
Copy link
Member

No description provided.

@hyp3rflow hyp3rflow requested a review from disjukr May 4, 2022 09:54
@hyp3rflow hyp3rflow self-assigned this May 4, 2022
return new Uint8Array(
Array.from(str).map((char) => {
const code = char.codePointAt(0);
if (code == null) throw new Error("Unexpected character");
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we throw an error in here?

Copy link
Member

Choose a reason for hiding this comment

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

umm maybe okay

@disjukr disjukr merged commit da263b9 into main May 5, 2022
@disjukr disjukr deleted the misc branch May 5, 2022 05:02
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.

2 participants