style: fix no-useless-concat

This commit is contained in:
Tony
2026-01-13 03:53:08 +08:00
parent 6dba3aa744
commit af2592b10a
7 changed files with 15 additions and 21 deletions

View File

@@ -11,27 +11,27 @@ const baseUrl = 'https://www.acfun.cn';
const categoryMap = {
184: {
title: '二次元画师',
realmId: 'realmId=18' + '&realmId=14' + '&realmId=51',
realmId: 'realmId=18&realmId=14&realmId=51',
},
110: {
title: '综合',
realmId: 'realmId=5' + '&realmId=22' + '&realmId=28' + '&realmId=3' + '&realmId=4',
realmId: 'realmId=5&realmId=22&realmId=28&realmId=3&realmId=4',
},
73: {
title: '生活情感',
realmId: 'realmId=50' + '&realmId=25' + '&realmId=34' + '&realmId=7' + '&realmId=6' + '&realmId=17' + '&realmId=1' + '&realmId=2' + '&realmId=49',
realmId: 'realmId=50&realmId=25&realmId=34&realmId=7&realmId=6&realmId=17&realmId=1&realmId=2&realmId=49',
},
164: {
title: '游戏',
realmId: 'realmId=8' + '&realmId=53' + '&realmId=52' + '&realmId=11' + '&realmId=43' + '&realmId=44' + '&realmId=45' + '&realmId=46' + '&realmId=47',
realmId: 'realmId=8&realmId=53&realmId=52&realmId=11&realmId=43&realmId=44&realmId=45&realmId=46&realmId=47',
},
74: {
title: '动漫文化',
realmId: 'realmId=13' + '&realmId=31' + '&realmId=48',
realmId: 'realmId=13&realmId=31&realmId=48',
},
75: {
title: '漫画文学',
realmId: 'realmId=15' + '&realmId=23' + '&realmId=16',
realmId: 'realmId=15&realmId=23&realmId=16',
},
};
const sortTypeEnum = new Set(['createTime', 'lastCommentTime', 'hotScore']);
@@ -106,13 +106,7 @@ async function handler(ctx) {
const url = `${baseUrl}/v/list${categoryId}/index.htm`;
const response = await got.post(
`${baseUrl}/rest/pc-direct/article/feed` +
'?cursor=first_page' +
'&onlyOriginal=false' +
'&limit=10' +
`&sortType=${sortType}` +
`&timeRange=${sortType === 'hotScore' ? timeRange : 'all'}` +
`&${categoryMap[categoryId].realmId}`,
`${baseUrl}/rest/pc-direct/article/feed?cursor=first_page&onlyOriginal=false&limit=10&sortType=${sortType}&timeRange=${sortType === 'hotScore' ? timeRange : 'all'}&${categoryMap[categoryId].realmId}`,
{
headers: {
referer: url,

View File

@@ -72,7 +72,7 @@ async function handler(ctx) {
item.description = content('#con_con')
.html()
.replaceAll(/(<iframe.*?src=")(.*?)(".*?>)/g, '$1' + rootUrl + '$2' + '$3');
?.replaceAll(/(<iframe.*?src=")(.*?)(".*?>)/g, '$1' + rootUrl + '$2$3');
return item;
})

View File

@@ -71,7 +71,7 @@ async function handler() {
item.description = content('#con_con')
.html()
.replaceAll(/(<iframe.*?src=")(.*?)(".*?>)/g, '$1' + rootUrl + '$2' + '$3');
?.replaceAll(/(<iframe.*?src=")(.*?)(".*?>)/g, '$1' + rootUrl + '$2$3');
return item;
})

View File

@@ -233,13 +233,13 @@ async function handler(ctx) {
let agTitle, agInfo;
if (feedsNumber > 2) {
agTitle = `MiniFlux | Aggregator For ${feedsNumber} Feeds`;
agInfo = 'An aggregator powered by MiniFlux and RSSHub. ' + 'This aggregator truthfully preserves the contents in ' + `${feedsNumber} feeds, including: ` + `<li>${feedsName.join('<li></li>')}</li>`;
agInfo = `An aggregator powered by MiniFlux and RSSHub. This aggregator truthfully preserves the contents in ${feedsNumber} feeds, including: <li>${feedsName.join('<li></li>')}</li>`;
} else if (feedsNumber) {
agTitle = `MiniFlux | ${feedsName.join(', ')}`;
agInfo = 'A RSS feed powered by MiniFlux and RSSHub ' + 'effortlessly republishes the contents in ' + `"${feedsName.join('" & "')}".`;
agInfo = `A RSS feed powered by MiniFlux and RSSHub effortlessly republishes the contents in "${feedsName.join('" & "')}".`;
} else {
agTitle = `MiniFlux | Feeds Aggregator`;
agInfo = 'An aggregator powered by MiniFlux and RSSHub ' + 'with empty content. If this is not your intention, ' + `please double-check your setting for parameters.`;
agInfo = 'An aggregator powered by MiniFlux and RSSHub with empty content. If this is not your intention, please double-check your setting for parameters.';
}
result = {

View File

@@ -70,7 +70,7 @@ async function handler(ctx) {
title: item.title,
link: item.site_url,
pubData: item.last_modified_header,
description: 'Feed URL: ' + `<a href=${item.feed_url}>${item.feed_url}</a>`,
description: `Feed URL: <a href=${item.feed_url}>${item.feed_url}</a>`,
});
}

View File

@@ -151,7 +151,7 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => {
if (widthOfPics <= 0 && heightOfPics <= 0) {
content += `width="${media.sizes.large.w}" height="${media.sizes.large.h}" `;
}
content += ` style="${style}" ` + `${readable ? 'hspace="4" vspace="8"' : ''} src="${originalImg}">`;
content += ` style="${style}" ${readable ? 'hspace="4" vspace="8"' : ''} src="${originalImg}">`;
if (addLinkForPics) {
content += `</a>`;
}

View File

@@ -72,7 +72,7 @@ async function handler(ctx) {
return {
title: newsTitle,
link: newsLink,
description: '温州大学' + ' - ' + newsTitle,
description: `温州大学 - ${newsTitle}`,
item: list.toArray().map(async (item) => {
const $ = load(item);
const $a1 = $('li>a');