mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
We are hosting a [MoQ](https://quic.video) relay on a remote (bare metal) server on Hetzner With a lot of help from @victorpahuus
19 lines
451 B
TypeScript
19 lines
451 B
TypeScript
// Utility function to download a Uint8Array for debugging.
|
|
export function download(data: Uint8Array, name: string) {
|
|
const blob = new Blob([data], {
|
|
type: "application/octet-stream",
|
|
})
|
|
|
|
const url = window.URL.createObjectURL(blob)
|
|
|
|
const a = document.createElement("a")
|
|
a.href = url
|
|
a.download = name
|
|
document.body.appendChild(a)
|
|
a.style.display = "none"
|
|
a.click()
|
|
a.remove()
|
|
|
|
setTimeout(() => window.URL.revokeObjectURL(url), 1000)
|
|
}
|