(buff, type)
| 1062 | }; |
| 1063 | |
| 1064 | const formatContent = function (buff, type) { |
| 1065 | if (type.startsWith("image")) { |
| 1066 | let dataURI = "data:"; |
| 1067 | dataURI += type + ";"; |
| 1068 | dataURI += "base64," + toBase64(buff); |
| 1069 | return "<img style='max-width: 100%;' src='" + dataURI + "'>"; |
| 1070 | } else { |
| 1071 | return `<pre>${Utils.escapeHtml(Utils.arrayBufferToStr(buff.buffer))}</pre>`; |
| 1072 | } |
| 1073 | }; |
| 1074 | |
| 1075 | const formatFile = async function(file, i) { |
| 1076 | const buff = await Utils.readFile(file); |
nothing calls this directly
no test coverage detected