Add Buffer polyfill

This commit is contained in:
Alex Gleason committed 2025-10-18 12:11:32 -05:00
1 parent 49abb22471
commit 19ecfee4bf
3 files changed
+78

No files matched your search

+12
View File
@@ -1,3 +1,15 @@
import Buffer from 'buffer';
/**
* Polyfill for Buffer in browser environment
*
* Many Node.js libraries like isomorphic-git and bitcoinjs-lib expect Buffer to be globally available.
* This polyfill makes the buffer package's Buffer available globally.
*/
if (!globalThis.Buffer) {
globalThis.Buffer = Buffer.Buffer;
}
/**
* Polyfill for AbortSignal.any()
*