Skip to content

Commit d5b2fd0

Browse files
committed
fix: revert .entries() in d96ca62
1 parent 6dcec4f commit d5b2fd0

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

lib/routes-deprecated/lolapp/article.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ module.exports = async (ctx) => {
1010
const name = data[0].feedNews.footer.source;
1111
const newData = [];
1212
let pubDate = [];
13-
for (const [i, datum] of data.entries()) {
14-
newData[i] = datum.feedNews.body;
13+
for (let i = 0; i < data.length; i++) {
14+
newData[i] = data[i].feedNews.body;
1515
newData[i].link = 'https://mlol.qt.qq.com/go/mlol_news/varcache_article?is_lqt=true&docid=' + newData[i].commentID;
1616
pubDate[i] = getPublishedDate(newData[i].link);
1717
}

lib/routes/5eplay/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const getAcwScV2ByArg1 = (arg1) => {
1818
const res: string[] = [];
1919
for (let i = 0; i < str.length; i++) {
2020
const cur = str[i];
21-
for (const [j, element] of code.entries()) {
22-
if (element === i + 1) {
21+
for (let j = 0; j < code.length; j++) {
22+
if (code[j] === i + 1) {
2323
res[j] = cur;
2424
}
2525
}

lib/routes/jike/topic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ async function handler(ctx) {
6464
const links = upper.find('a').map((_, ele) => $(ele).attr('href'));
6565
const texts = upper.find('span.text').map((_, ele) => $(ele).text());
6666
let description = '';
67-
for (const [i, link] of links.entries()) {
68-
description += `${i + 1}、<a href="${link}">${texts[i]}</a><br>`;
67+
for (let i = 0; i < links.length; i++) {
68+
description += `${i + 1}、<a href="${links[i]}">${texts[i]}</a><br>`;
6969
}
7070
description = description.replace(/<br>$/, '');
7171
return description;

lib/routes/leetcode/dailyquestion-solution-en.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ async function handler() {
152152
return pngList.map((v) => `![pic](${path.resolve(`/problems/${questionTitle}/solution/`, v.image)})`).join('\n');
153153
};
154154
const strs = await Promise.all(matched.map((v) => fn(v)));
155-
for (const [i, element] of matched.entries()) {
156-
s = s.replace(element, strs[i]);
155+
for (let i = 0; i < matched.length; i++) {
156+
s = s.replace(matched[i], strs[i]);
157157
}
158158
return s;
159159
};
@@ -198,8 +198,8 @@ async function handler() {
198198
return code.map((c) => `###${c.langSlug}\n\r \`\`\`${c.langSlug}\n ${c.code}\n\`\`\``).join('\n\r');
199199
};
200200
const strs = await Promise.all(matched.map((v) => fn(v)));
201-
for (const [i, element] of matched.entries()) {
202-
s = s.replace(element, strs[i]);
201+
for (let i = 0; i < matched.length; i++) {
202+
s = s.replace(matched[i], strs[i]);
203203
}
204204
return s;
205205
};

scripts/workflow/test-issue/call-maintainer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default async function callMaintainer({ github, context, core }) {
125125
if (main.length > 0) {
126126
const pingStr = main
127127
.map((e) => {
128-
if (e in dndUsernames) {
128+
if (dndUsernames.has(e)) {
129129
return `\`@${e}\``; // Wrap in an inline code block to make sure no mention will be sent
130130
}
131131
return `@${e}`;

0 commit comments

Comments
 (0)