Skip to content

Commit

Permalink
Merge pull request #64 from shgysk8zer0/bug/uint8array-from-base64
Browse files Browse the repository at this point in the history
Fix bad decoding in `Uint8Array.fromBase64`
  • Loading branch information
shgysk8zer0 committed Jul 16, 2024
2 parents 0c0fe79 + a9142a9 commit a59a30b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.3.14] - 2024-07-16

### Fixed
- Fix bad decoding in `Uint8Array.fromBase64`

## [v0.3.13] - 2024-07-16

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion array.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ if (! (Uint8Array.fromBase64 instanceof Function)) {
// Already checked for valid `lastChunkHandling`
}
} else {
return new TextEncoder().encode(atob(str));
// return new TextEncoder().encode(atob(str));
return Uint8Array.from(atob(str), char => char.charCodeAt(0));
}
} else {
return Uint8Array.fromBase64(
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shgysk8zer0/polyfills",
"version": "0.3.13",
"version": "0.3.14",
"private": false,
"type": "module",
"description": "A collection of JavaScript polyfills",
Expand Down

0 comments on commit a59a30b

Please sign in to comment.