Replace vue-svg-loader dependency with simple JS file (fixes a security alert) (#389)

This commit is contained in:
Keavon Chambers
2021-11-01 00:14:31 -07:00
parent a6d1a2dd4b
commit c679e8fdc2
5 changed files with 244 additions and 15609 deletions

View File

@@ -1,8 +1,5 @@
export function download(filename: string, fileData: string) {
let type = "text/plain;charset=utf-8";
if (filename.endsWith(".svg")) {
type = "image/svg+xml;charset=utf-8";
}
const type = filename.endsWith(".svg") ? "image/svg+xml;charset=utf-8" : "text/plain;charset=utf-8";
const blob = new Blob([fileData], { type });
const url = URL.createObjectURL(blob);
const element = document.createElement("a");