From 352379975ab91da916c1126fe5a3e5f9630719fd Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Wed, 17 Feb 2021 11:47:27 +0000 Subject: [PATCH] [CodeFactor] Apply fixes [ci skip] [skip ci] --- assets/radar-rules.js | 2 +- lib/router.js | 2 +- lib/routes/changelog.js | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 36794ad884..4728a78f34 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2718,5 +2718,5 @@ target: '/eagle/changelog', }, ], - }, + }, }); diff --git a/lib/router.js b/lib/router.js index aced6e6048..659380606a 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3964,7 +3964,7 @@ router.get('/furaffinity/journal_comments/:id', require('./routes/furaffinity/jo // 香港商报 router.get('/hkcd/pdf', require('./routes/hkcd/pdf')); -//Eagle +// Eagle router.get('/eagle/changelog', require('./routes/eagle/changelog')); module.exports = router; diff --git a/lib/routes/changelog.js b/lib/routes/changelog.js index 2a889530b3..da75a40e26 100644 --- a/lib/routes/changelog.js +++ b/lib/routes/changelog.js @@ -28,19 +28,19 @@ module.exports = async (ctx) => { // 源说明 description: `Eagle 更新日志`, - //遍历此前获取的数据 + // 遍历此前获取的数据 item: list && list.map((index, item) => { item = $(item); // 对获取的日期进行格式化处理 function getDate() { - var str = item.find('.date').text(); - var patt = /[0-9]\d*/g; - var result; + const str = item.find('.date').text(); + const patt = /[0-9]\d*/g; + let result; let date = ""; while ((result = patt.exec(str)) != null) { - date += result + '-' + date += result + '-'; } return date.replace(/\-$/g, ""); } @@ -53,5 +53,5 @@ module.exports = async (ctx) => { }; }) .get(), - } + }; };