@graphteon/juricode
Version:
We are forging the future with lines of digital steel
20 lines • 744 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.base64ToBlob = void 0;
const base64ToBlob = (base64) => {
const base64WithoutPrefix = base64.split(",")[1] || base64;
const bytes = atob(base64WithoutPrefix);
const chunkSize = 8192;
const chunks = [];
for (let i = 0; i < bytes.length; i += chunkSize) {
const chunk = bytes.slice(i, i + chunkSize);
const array = new Uint8Array(chunk.length);
for (let j = 0; j < chunk.length; j += 1) {
array[j] = chunk.charCodeAt(j);
}
chunks.push(array);
}
return new Blob(chunks, { type: "application/zip" });
};
exports.base64ToBlob = base64ToBlob;
//# sourceMappingURL=base64-to-blob.js.map