Add Modules

This commit is contained in:
kwaroran
2024-02-07 02:21:16 +09:00
parent 8bcae0864b
commit 68382cb38e
15 changed files with 527 additions and 20 deletions

View File

@@ -44,7 +44,11 @@ interface fetchLog{
let fetchLog:fetchLog[] = []
export async function downloadFile(name:string, data:Uint8Array|ArrayBuffer) {
export async function downloadFile(name:string, dat:Uint8Array|ArrayBuffer|string) {
if(typeof(dat) === 'string'){
dat = Buffer.from(dat, 'utf-8')
}
const data = new Uint8Array(dat)
const downloadURL = (data:string, fileName:string) => {
const a = document.createElement('a')
a.href = data