refactor: add cross-environment decodeBase64 method#95
refactor: add cross-environment decodeBase64 method#95Phillip9587 wants to merge 2 commits intojshttp:masterfrom
Conversation
bee8698 to
e2854e0
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #95 +/- ##
============================================
- Coverage 100.00% 83.60% -16.40%
============================================
Files 1 1
Lines 48 61 +13
Branches 21 23 +2
============================================
+ Hits 48 51 +3
- Misses 0 10 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Will need rebasing too, but would you be able to add a benchmarks folder with the different ways to decode for posterity? That way we can quickly re-run benchmarks anytime and confirm we've got the right methods selected. |
e2854e0 to
fc15aff
Compare
|
@blakeembrey I added the benchmarks and switched the |
6cae752 to
2b6d3e0
Compare
|
@blakeembrey Any suggestions on how to fix the test coverage? |
Based on #93
This PR decouples the package from Node.js APIs and adds support for browser and other runtimes. Base64 decoding now uses runtime feature detection:
Uint8Array.fromBase64()when available (modern browsers/runtimes)Buffer.from(..., 'base64')in Node.js and compatible runtimesatob()andTextDecoderas a fallback