Files
bitvid/bitvid-working-webtorrent/js/bufferPolyfill.js
T
2026-02-01 13:21:48 -05:00

18 lines
411 B
JavaScript

import { Buffer } from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";
const globalScope = typeof globalThis !== "undefined" ? globalThis : window;
if (globalScope && !globalScope.Buffer) {
globalScope.Buffer = Buffer;
}
if (globalScope && !globalScope.global) {
globalScope.global = globalScope;
}
if (globalScope && !globalScope.process) {
globalScope.process = { env: {} };
}
export { Buffer };