UNPKG

javascript-binary-converter

Version:

A utility package to quickly handle and convert various Javascript binary objects

20 lines 571 B
export const isNode = typeof window === 'undefined'; export async function getBlobClass() { await Promise.resolve(); if (!isNode) { return Blob; } else { let prom = eval(`import('node:buffer')`); const { Blob: BlobClass } = await prom; return BlobClass; } } export function getSystemEndianness() { const uint16 = new Uint16Array([256]); const uint8 = new Uint8Array(uint16.buffer); if (uint8[0] === 1) return 'BIG'; return 'LITTLE'; } //# sourceMappingURL=crossPlatform.js.map