Render base64 string without btoa function to avoid error.

This commit is contained in:
Dillon Kearns 2022-02-01 11:07:24 -08:00
parent 934846b697
commit 1ee6cef81e

View File

@ -65,8 +65,8 @@ ${elmPagesJsMinified}
}
)}</script>
<script id="__ELM_PAGES_BYTES_DATA__" type="application/octet-stream">${Buffer.from(
_arrayBufferToBase64(contentDatPayload.buffer)
)}</script>
contentDatPayload.buffer
).toString("base64")}</script>
</head>
<body>
@ -77,16 +77,6 @@ ${elmPagesJsMinified}
`;
};
function _arrayBufferToBase64(buffer) {
var binary = "";
var bytes = new Uint8Array(buffer);
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return btoa(binary);
}
/**
* @param {string} route
*/