Skip to content

refactor: add cross-environment decodeBase64 method#95

Open
Phillip9587 wants to merge 2 commits intojshttp:masterfrom
Phillip9587:remove-node
Open

refactor: add cross-environment decodeBase64 method#95
Phillip9587 wants to merge 2 commits intojshttp:masterfrom
Phillip9587:remove-node

Conversation

@Phillip9587
Copy link

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:

  1. Uint8Array.fromBase64() when available (modern browsers/runtimes)
  2. Buffer.from(..., 'base64') in Node.js and compatible runtimes
  3. custom implementation using atob() and TextDecoder as a fallback

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 90.16393% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@21a5f04). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/index.ts 90.16% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #95   +/-   ##
=========================================
  Coverage          ?   90.16%           
=========================================
  Files             ?        1           
  Lines             ?       61           
  Branches          ?       27           
=========================================
  Hits              ?       55           
  Misses            ?        6           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant