diff --git a/lib/routes/18comic/album.ts b/lib/routes/18comic/album.ts index 01c81652b..646c9f866 100644 --- a/lib/routes/18comic/album.ts +++ b/lib/routes/18comic/album.ts @@ -89,7 +89,7 @@ async function handler(ctx) { }) ) ); - results = results.reverse(); + results = results.toReversed(); } return { diff --git a/lib/routes/agefans/detail.ts b/lib/routes/agefans/detail.ts index f43fbcb59..8f01abb80 100644 --- a/lib/routes/agefans/detail.ts +++ b/lib/routes/agefans/detail.ts @@ -44,7 +44,7 @@ async function handler(ctx) { link: a.attr('href').replace('http://', 'https://'), }; }) - .reverse(); + .toReversed(); return { title: `AGE动漫 - ${ldJson.name}`, diff --git a/lib/routes/aliyun/database-month.ts b/lib/routes/aliyun/database-month.ts index efcb7a67c..3fffe494e 100644 --- a/lib/routes/aliyun/database-month.ts +++ b/lib/routes/aliyun/database-month.ts @@ -61,6 +61,6 @@ async function handler() { return { title: $('title').text(), link: url, - item: result.reverse(), + item: result.toReversed(), }; } diff --git a/lib/routes/bilibili/danmaku.ts b/lib/routes/bilibili/danmaku.ts index 1bc137f10..334096374 100644 --- a/lib/routes/bilibili/danmaku.ts +++ b/lib/routes/bilibili/danmaku.ts @@ -62,7 +62,7 @@ async function handler(ctx) { danmakuList.push({ p: $(item).attr('p'), text: $(item).text() }); }); - danmakuList = danmakuList.reverse().slice(0, limit); + danmakuList = danmakuList.toReversed().slice(0, limit); return { title: `${videoName} 的 弹幕动态`, diff --git a/lib/routes/biquge/index.ts b/lib/routes/biquge/index.ts index 581d94db8..95e773f24 100644 --- a/lib/routes/biquge/index.ts +++ b/lib/routes/biquge/index.ts @@ -58,7 +58,7 @@ async function handler(ctx) { let items = $('dl dd a') .toArray() - .reverse() + .toReversed() .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 1) .map((item) => { item = $(item); diff --git a/lib/routes/cartoonmad/comic.ts b/lib/routes/cartoonmad/comic.ts index a72d7c44a..0cb816462 100644 --- a/lib/routes/cartoonmad/comic.ts +++ b/lib/routes/cartoonmad/comic.ts @@ -83,7 +83,7 @@ async function handler(ctx) { pages: item.next('font').text().match(/\d+/)[0], }; }) - .reverse(); + .toReversed(); const chapters = await getChapters(id, list, cache.tryGet); diff --git a/lib/routes/freexcomic/book.ts b/lib/routes/freexcomic/book.ts index 8355166cf..068904eee 100644 --- a/lib/routes/freexcomic/book.ts +++ b/lib/routes/freexcomic/book.ts @@ -30,7 +30,7 @@ const handler = async (ctx) => { const list = $('#detail-list-select > li > a') .toArray() - .reverse() + .toReversed() .slice(0, limit) .map((item) => { const $item = $(item); diff --git a/lib/routes/github/star.ts b/lib/routes/github/star.ts index 92206096e..b4cbcdec0 100644 --- a/lib/routes/github/star.ts +++ b/lib/routes/github/star.ts @@ -61,7 +61,7 @@ async function handler(ctx) { }, }); - const data = response.data.data.repository.stargazers.edges.reverse(); + const data = response.data.data.repository.stargazers.edges.toReversed(); return { allowEmpty: true, diff --git a/lib/routes/hotukdeals/index.ts b/lib/routes/hotukdeals/index.ts index ba133432d..eab022438 100644 --- a/lib/routes/hotukdeals/index.ts +++ b/lib/routes/hotukdeals/index.ts @@ -48,6 +48,6 @@ async function handler(ctx) { link: item.find('.cept-tt').attr('href'), }; }) - .reverse(), + .toReversed(), }; } diff --git a/lib/routes/kunchengblog/essay.ts b/lib/routes/kunchengblog/essay.ts index 3ec7c9090..7161c508b 100644 --- a/lib/routes/kunchengblog/essay.ts +++ b/lib/routes/kunchengblog/essay.ts @@ -47,7 +47,7 @@ async function handler(ctx) { const items = await SourceMapConsumer.with(response, null, (consumer) => consumer.sources .filter((s) => /routes\/essays/.test(s)) - .reverse() + .toReversed() .slice(0, limit) .map((item) => { const source = consumer.sourceContentFor(item).replaceAll(/\s\n/g, ''); diff --git a/lib/routes/manhuagui/comic.ts b/lib/routes/manhuagui/comic.ts index 96418ed24..02cfa3617 100644 --- a/lib/routes/manhuagui/comic.ts +++ b/lib/routes/manhuagui/comic.ts @@ -20,7 +20,7 @@ const getChapters = ($) => { if (!nextEle) { return; } - for (const ul of $(nextEle).children('ul').toArray().reverse()) { + for (const ul of $(nextEle).children('ul').toArray().toReversed()) { for (const li of $(ul).children('li').toArray()) { const a = $(li).children('a'); // 通过操作发布时间来对章节进行排序,如果是刚刚更新的单行本或者番外,保留最新更新时间 diff --git a/lib/routes/ntdm/video.ts b/lib/routes/ntdm/video.ts index 30047ae34..53188ffc4 100644 --- a/lib/routes/ntdm/video.ts +++ b/lib/routes/ntdm/video.ts @@ -47,7 +47,7 @@ async function handler(ctx) { link: `${rootUrl}${a.attr('href')}`, }; }) - .reverse(); + .toReversed(); return { title: `NT动漫 - ${dmtitle}`, link: `${rootUrl}/video/${id}.html`, diff --git a/lib/routes/pixiv/novel-api/series/sfw.ts b/lib/routes/pixiv/novel-api/series/sfw.ts index d9db33df4..d9e3d45ca 100644 --- a/lib/routes/pixiv/novel-api/series/sfw.ts +++ b/lib/routes/pixiv/novel-api/series/sfw.ts @@ -57,7 +57,7 @@ export async function getSFWSeriesNovels(seriesId: string, limit: number = 10): category: novelContent.tags, }; }) - .reverse() + .toReversed() ); return { diff --git a/lib/routes/sciencenet/user.ts b/lib/routes/sciencenet/user.ts index 9d4f79239..5e65a1c38 100644 --- a/lib/routes/sciencenet/user.ts +++ b/lib/routes/sciencenet/user.ts @@ -54,7 +54,7 @@ async function handler(ctx) { let items = $('item') .slice(-limit) .toArray() - .reverse() + .toReversed() .map((item) => { item = $(item); diff --git a/lib/routes/syosetu/index.ts b/lib/routes/syosetu/index.ts index 0779793e3..efa36951c 100644 --- a/lib/routes/syosetu/index.ts +++ b/lib/routes/syosetu/index.ts @@ -72,7 +72,7 @@ async function handler(ctx: Context): Promise { const item = await fetchChapterContent(chapterUrl, chapterNumber); return item; - }).reverse() + }).toReversed() ); return { diff --git a/lib/routes/telegram/channel.ts b/lib/routes/telegram/channel.ts index 179191099..0f814c5dd 100644 --- a/lib/routes/telegram/channel.ts +++ b/lib/routes/telegram/channel.ts @@ -752,6 +752,6 @@ async function handler(ctx) { }; }) .filter(Boolean) - .reverse(), + .toReversed(), }; } diff --git a/lib/routes/themoviedb/episodes.ts b/lib/routes/themoviedb/episodes.ts index 99fb2db74..d2ff3a3b1 100644 --- a/lib/routes/themoviedb/episodes.ts +++ b/lib/routes/themoviedb/episodes.ts @@ -36,7 +36,7 @@ async function handler(ctx) { description: seasonDetails.overview.trim(), image: `https://image.tmdb.org/t/p/original${seasonDetails.poster_path}`, link: `https://www.themoviedb.org/tv/${tvShowDetails.id}/season/${seasonDetails.season_number}`, - item: seasonDetails.episodes.reverse().map((item) => ({ + item: seasonDetails.episodes.toReversed().map((item) => ({ title: `${item.episode_number} ${item.name}`, link: `https://www.themoviedb.org/tv/${tvShowDetails.id}/season/${item.season_number}/episode/${item.episode_number}`, description: handleDescription(item), diff --git a/lib/routes/uptimerobot/rss.ts b/lib/routes/uptimerobot/rss.ts index fdbbe11fa..550aabd85 100644 --- a/lib/routes/uptimerobot/rss.ts +++ b/lib/routes/uptimerobot/rss.ts @@ -97,7 +97,7 @@ async function handler(ctx) { const monitors = {}; - const items = rss.items.reverse().map((item) => { + const items = rss.items.toReversed().map((item) => { const titleMatch = item.title.match(titleRegex); if (!titleMatch) { throw new InvalidParameterError('Unexpected title, please open an issue.'); diff --git a/lib/routes/x6d/index.ts b/lib/routes/x6d/index.ts index 180210f4c..b845333dc 100644 --- a/lib/routes/x6d/index.ts +++ b/lib/routes/x6d/index.ts @@ -69,7 +69,7 @@ export async function handler(ctx) { ? '' : firstResponse .match(/'([\w./=?]+)'/g) - .reverse() + .toReversed() .join('') .replaceAll("'", ''), rootUrl diff --git a/lib/routes/zimuxia/portfolio.ts b/lib/routes/zimuxia/portfolio.ts index 4a20c1d2a..1040f5ebe 100644 --- a/lib/routes/zimuxia/portfolio.ts +++ b/lib/routes/zimuxia/portfolio.ts @@ -69,7 +69,7 @@ async function handler(ctx) { guid: `${currentUrl}#${title}`, }; }) - .reverse(); + .toReversed(); return { title: `${$('.content-page-title').text()} - FIX字幕侠`, diff --git a/lib/utils/helpers.ts b/lib/utils/helpers.ts index 851dba769..3e4e820ea 100644 --- a/lib/utils/helpers.ts +++ b/lib/utils/helpers.ts @@ -50,7 +50,7 @@ export function parseDuration(timeStr: string) { const clean = timeStr.trim().replaceAll(/[^\d:]/g, ''); return clean .split(':') - .reverse() + .toReversed() .reduce((total, part, idx) => { const n = Number(part); if (Number.isNaN(n)) { diff --git a/package.json b/package.json index 195eefa68..fe1b24740 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "eslint-nibble": "8.1.0", "eslint-plugin-n": "17.21.0", "eslint-plugin-prettier": "5.5.3", - "eslint-plugin-unicorn": "59.0.1", + "eslint-plugin-unicorn": "60.0.0", "eslint-plugin-yml": "1.18.0", "fs-extra": "11.3.0", "globals": "16.3.0", @@ -198,7 +198,7 @@ "vitest": "2.1.9", "yaml-eslint-parser": "1.3.0" }, - "packageManager": "pnpm@10.12.2+sha512.a32540185b964ee30bb4e979e405adc6af59226b438ee4cc19f9e8773667a66d302f5bfee60a39d3cac69e35e4b96e708a71dd002b7e9359c4112a1722ac323f", + "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad", "engines": { "node": ">=22" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c32437aed..c46bfa2f1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -412,8 +412,8 @@ importers: specifier: 5.5.3 version: 5.5.3(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@9.31.0(jiti@2.4.2)))(eslint@9.31.0(jiti@2.4.2))(prettier@3.6.2) eslint-plugin-unicorn: - specifier: 59.0.1 - version: 59.0.1(eslint@9.31.0(jiti@2.4.2)) + specifier: 60.0.0 + version: 60.0.0(eslint@9.31.0(jiti@2.4.2)) eslint-plugin-yml: specifier: 1.18.0 version: 1.18.0(eslint@9.31.0(jiti@2.4.2)) @@ -1408,10 +1408,6 @@ packages: resolution: {integrity: sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.13.0': - resolution: {integrity: sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.15.1': resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1436,14 +1432,14 @@ packages: resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.8': - resolution: {integrity: sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.3.3': resolution: {integrity: sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/plugin-kit@0.3.4': + resolution: {integrity: sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@hono/node-server@1.17.1': resolution: {integrity: sha512-SY79W/C+2b1MyAzmIcV32Q47vO1b5XwLRwj8S9N6Jr5n1QCkIfAIH6umOSgqWZ4/v67hg6qq8Ha5vZonVidGsg==} engines: {node: '>=18.14.1'} @@ -2812,8 +2808,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001726: - resolution: {integrity: sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw==} + caniuse-lite@1.0.30001727: + resolution: {integrity: sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==} caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -2841,6 +2837,9 @@ packages: chance@1.1.13: resolution: {integrity: sha512-V6lQCljcLznE7tUYUM9EOAnnKXbctE6j/rdQkYOHIWbfGQbrzTsAXNW9CdU5XCo4ArXQCj/rb6HgxPlmGJcaUg==} + change-case@5.4.4: + resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} + character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} @@ -2875,8 +2874,8 @@ packages: peerDependencies: devtools-protocol: '*' - ci-info@4.2.0: - resolution: {integrity: sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==} + ci-info@4.3.0: + resolution: {integrity: sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==} engines: {node: '>=8'} city-timezones@1.3.1: @@ -3002,6 +3001,9 @@ packages: core-js-compat@3.43.0: resolution: {integrity: sha512-2GML2ZsCc5LR7hZYz4AXmjQw8zuy2T//2QntwdnpuYI7jteT6GVYJL7F6C2C57R7gSYrcqVW3lAALefdbhBLDA==} + core-js-compat@3.44.0: + resolution: {integrity: sha512-JepmAj2zfl6ogy34qfWtcE7nHKAJnKsQFRn++scjVS2bZFllwptzw61BZcZFYBPpUznLfAvh0LGhxKppk04ClA==} + core-js@2.6.12: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. @@ -3261,8 +3263,8 @@ packages: engines: {node: '>=14'} hasBin: true - electron-to-chromium@1.5.179: - resolution: {integrity: sha512-UWKi/EbBopgfFsc5k61wFpV7WrnnSlSzW/e2XcBmS6qKYTivZlLtoll5/rdqRTxGglGHkmkW0j0pFNJG10EUIQ==} + electron-to-chromium@1.5.189: + resolution: {integrity: sha512-y9D1ntS1ruO/pZ/V2FtLE+JXLQe28XoRpZ7QCCo0T8LdQladzdcOVQZH/IWLVJvCw12OGMb6hYOeOAjntCmJRQ==} ellipsize@0.1.0: resolution: {integrity: sha512-5gxbEjcb/Z2n6TTmXZx9wVi3N/DOzE7RXY3Xg9dakDuhX/izwumB9rGjeWUV6dTA0D0+juvo+JonZgNR9sgA5A==} @@ -3432,11 +3434,11 @@ packages: eslint-config-prettier: optional: true - eslint-plugin-unicorn@59.0.1: - resolution: {integrity: sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q==} - engines: {node: ^18.20.0 || ^20.10.0 || >=21.0.0} + eslint-plugin-unicorn@60.0.0: + resolution: {integrity: sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==} + engines: {node: ^20.10.0 || >=21.0.0} peerDependencies: - eslint: '>=9.22.0' + eslint: '>=9.29.0' eslint-plugin-yml@1.18.0: resolution: {integrity: sha512-9NtbhHRN2NJa/s3uHchO3qVVZw0vyOIvWlXWGaKCr/6l3Go62wsvJK5byiI6ZoYztDsow4GnS69BZD3GnqH3hA==} @@ -7117,10 +7119,6 @@ snapshots: '@eslint/config-helpers@0.3.0': {} - '@eslint/core@0.13.0': - dependencies: - '@types/json-schema': 7.0.15 - '@eslint/core@0.15.1': dependencies: '@types/json-schema': 7.0.15 @@ -7159,12 +7157,12 @@ snapshots: '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.2.8': + '@eslint/plugin-kit@0.3.3': dependencies: - '@eslint/core': 0.13.0 + '@eslint/core': 0.15.1 levn: 0.4.1 - '@eslint/plugin-kit@0.3.3': + '@eslint/plugin-kit@0.3.4': dependencies: '@eslint/core': 0.15.1 levn: 0.4.1 @@ -8600,8 +8598,8 @@ snapshots: browserslist@4.25.1: dependencies: - caniuse-lite: 1.0.30001726 - electron-to-chromium: 1.5.179 + caniuse-lite: 1.0.30001727 + electron-to-chromium: 1.5.189 node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.25.1) @@ -8663,7 +8661,7 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001726: {} + caniuse-lite@1.0.30001727: {} caseless@0.12.0: {} @@ -8698,6 +8696,8 @@ snapshots: chance@1.1.13: {} + change-case@5.4.4: {} + character-entities@2.0.2: {} chardet@0.7.0: {} @@ -8758,7 +8758,7 @@ snapshots: mitt: 3.0.1 zod: 3.25.76 - ci-info@4.2.0: {} + ci-info@4.3.0: {} city-timezones@1.3.1: dependencies: @@ -8871,6 +8871,10 @@ snapshots: dependencies: browserslist: 4.25.1 + core-js-compat@3.44.0: + dependencies: + browserslist: 4.25.1 + core-js@2.6.12: {} core-util-is@1.0.2: {} @@ -9109,7 +9113,7 @@ snapshots: minimatch: 9.0.1 semver: 7.7.2 - electron-to-chromium@1.5.179: {} + electron-to-chromium@1.5.189: {} ellipsize@0.1.0: {} @@ -9326,14 +9330,15 @@ snapshots: '@types/eslint': 9.6.1 eslint-config-prettier: 10.1.8(eslint@9.31.0(jiti@2.4.2)) - eslint-plugin-unicorn@59.0.1(eslint@9.31.0(jiti@2.4.2)): + eslint-plugin-unicorn@60.0.0(eslint@9.31.0(jiti@2.4.2)): dependencies: '@babel/helper-validator-identifier': 7.27.1 '@eslint-community/eslint-utils': 4.7.0(eslint@9.31.0(jiti@2.4.2)) - '@eslint/plugin-kit': 0.2.8 - ci-info: 4.2.0 + '@eslint/plugin-kit': 0.3.4 + change-case: 5.4.4 + ci-info: 4.3.0 clean-regexp: 1.0.0 - core-js-compat: 3.43.0 + core-js-compat: 3.44.0 eslint: 9.31.0(jiti@2.4.2) esquery: 1.6.0 find-up-simple: 1.0.1