fix: ensure cross-platform compatibility with file exports (#4336)

This commit is contained in:
James George
2024-09-10 00:23:33 -07:00
committed by GitHub
parent 3b29a56ba0
commit a395643387
8 changed files with 114 additions and 107 deletions

View File

@@ -13,15 +13,17 @@ export const browserIODef: IOPlatformDef = {
const url = URL.createObjectURL(file)
a.href = url
a.download = pipe(
url,
S.split("/"),
RNEA.last,
S.split("#"),
RNEA.head,
S.split("?"),
RNEA.head
)
a.download =
opts.suggestedFilename ??
pipe(
url,
S.split("/"),
RNEA.last,
S.split("#"),
RNEA.head,
S.split("?"),
RNEA.head
)
document.body.appendChild(a)
a.click()