Skip to content

Commit ac54eab

Browse files
authored
MIMEタイプ指定
1 parent 3c01883 commit ac54eab

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

downloadFile.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CONTENT_TYPE } from "https://code4sabae.github.io/js/CONTENT_TYPE.js";
22

3-
const downloadFile = (name, uint8arry) => {
3+
export const downloadFile = (name, uint8arry) => {
44
const ext = name.split('.').pop().toLowerCase();
55
const mime = CONTENT_TYPE[ext] || "application/octet-stream";
66
const blob = new Blob([uint8arry], { type: mime });
@@ -13,5 +13,3 @@ const downloadFile = (name, uint8arry) => {
1313
link.remove();
1414
URL.revokeObjectURL(url);
1515
};
16-
17-
export { downloadFile };

0 commit comments

Comments
 (0)