2025-12-10 12:02:17 +08:00

20 lines
481 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.download = download;
exports.publicDownload = publicDownload;
function download(url, name) {
if (!url)
return;
const a = document.createElement('a');
a.href = url;
if (name !== undefined) {
a.download = name;
}
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
function publicDownload(url, name) {
download(url, name);
}