Using polyfill for Buffer in browsers (#129)

This commit is contained in:
Pavel
2022-02-17 10:54:38 +03:00
committed by GitHub
parent 976cd0435c
commit d860ea6dec
7 changed files with 13 additions and 2 deletions

4
src/internal/Buffer.ts Normal file
View File

@ -0,0 +1,4 @@
import { isBrowser } from 'browser-or-node';
import { Buffer as BufferPolyfill } from 'buffer';
export default isBrowser ? BufferPolyfill : Buffer;