diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cbd7ad..0987e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/array.js b/array.js index 44bdf30..13d37a5 100644 --- a/array.js +++ b/array.js @@ -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( diff --git a/package-lock.json b/package-lock.json index 9d23620..aed67ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@shgysk8zer0/polyfills", - "version": "0.3.13", + "version": "0.3.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@shgysk8zer0/polyfills", - "version": "0.3.13", + "version": "0.3.14", "funding": [ { "type": "librepay", diff --git a/package.json b/package.json index bf5756b..9530e4a 100644 --- a/package.json +++ b/package.json @@ -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",