Skip to content

Commit

Permalink
Merge pull request #151 from Caramel-Diode/main
Browse files Browse the repository at this point in the history
修复 isURL参数类型错误 (利用undefined值为假值特性删除默认值)
  • Loading branch information
chenbimo authored Sep 5, 2024
2 parents 512cb64 + 56ac44b commit 326c92d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libPend/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @param {string} [filename] 文件名 默认使用页面标题
* @param {boolean} [isURL] 传入的字符串是否为下载链接。(否则将作为文本内容下载) 默认为`false`
*/
export default (content, filename = document.title, isURL = 'false') => {
export default (content, filename = document.title, isURL) => {
if (content === void 0 || content === null) throw new TypeError('无下载内容!');
const anchor = document.createElement('a');
// 将数值类型与布尔类型转为字符串
Expand Down

0 comments on commit 326c92d

Please sign in to comment.