Skip to content

Commit

Permalink
修复node 8.x 提示URL未定义的bug(#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Jun 30, 2020
1 parent 362a825 commit 186f423
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var log = require('hexo-log')({
silent: false
});

if (typeof URL !== 'function') var _require = require('url'),
URL = _require.URL;
var options = {
options: [{
name: '-u, --update',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-bilibili-bangumi",
"version": "1.3.1",
"version": "1.3.2",
"description": "hexo bilibili番剧页",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const log = require('hexo-log')({
silent: false
});

if (typeof URL !== 'function') var { URL } = require('url')

let options = {
options: [
{ name: '-u, --update', desc: 'Update bangumi data' },
Expand Down Expand Up @@ -128,4 +130,4 @@ async function saveBangumiData(vmid) {
log.info("Bilibili bangumis data has been saved");
}
});
}
}

0 comments on commit 186f423

Please sign in to comment.