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

fix: update btoa boundary #59

Merged
merged 1 commit into from
Sep 18, 2023
Merged

fix: update btoa boundary #59

merged 1 commit into from
Sep 18, 2023

Conversation

BBboy01
Copy link
Contributor

@BBboy01 BBboy01 commented Sep 8, 2023

Hi, as the description of btoa for unicode string from MDN, one byte is the range of btoa accept.

const testString = 'Í'
console.log(testString.charCodeAt())  // 205
console.log(window.btoa('Í')) // zQ==

@michaelficarra
Copy link
Collaborator

This looks correct. Can you add some test cases?

@BBboy01
Copy link
Contributor Author

BBboy01 commented Sep 17, 2023

This looks correct. Can you add some test cases?

sorry for forgot this for so long, I just added the unit test with the range of whole 1 byte for atob and btoa

@davidchambers
Copy link
Owner

Thank you very much, @BBboy01! 👏

I updated the description of one test case to reflect the fact that btoa can now encode (some) non-ASCII characters. I also coalesced the new test cases. Are these changes okay with you, @BBboy01?

@BBboy01
Copy link
Contributor Author

BBboy01 commented Sep 18, 2023

Thank you very much, @BBboy01! 👏

I updated the description of one test case to reflect the fact that btoa can now encode (some) non-ASCII characters. I also coalesced the new test cases. Are these changes okay with you, @BBboy01?

yeah. it's more semantic now.

@davidchambers davidchambers merged commit 8bec771 into davidchambers:master Sep 18, 2023
3 checks passed
@davidchambers
Copy link
Owner

I released this change as 1.3.0. Thanks again for the contribution, @BBboy01. 🍻

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