mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 11:05:46 +03:00
Render base64 string without btoa function to avoid error.
This commit is contained in:
parent
934846b697
commit
1ee6cef81e
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user