From 25f6e623e51ccb9794933af2acd076894cd7ec6d Mon Sep 17 00:00:00 2001 From: Yuhei Yasuda Date: Thu, 5 Oct 2023 03:35:26 +0900 Subject: [PATCH] Revert "prefer `Array#toSorted` over `Array#sort`" This reverts commit 59ca7a5c8f2e38692f57cf429ee0fbabde3018fa. --- src/pages/index.astro | 2 +- src/pages/news/index.astro | 2 +- src/pages/work/index.astro | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 60e6340..847ad62 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -7,7 +7,7 @@ const title = 'ウェブサイト構築のためのモダンなフロントエ const description = 'sdenvは、ウェブアプリケーションではなくウェブサイトを開発するためのベストプラクティスに基づいて構成されたフロントエンド開発環境です。やりすぎないちょうどいい使い勝手の実現を念頭に置いて設計されている、より多くのウェブサイト開発者のためのツールキットです。'; -const newsEntries = (await getCollection('news')).toSorted( +const newsEntries = (await getCollection('news')).sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(), ); --- diff --git a/src/pages/news/index.astro b/src/pages/news/index.astro index 693d213..b4cfcf9 100644 --- a/src/pages/news/index.astro +++ b/src/pages/news/index.astro @@ -6,7 +6,7 @@ import Layout from '@/layouts/Layout.astro'; const title = 'お知らせ'; const description = ''; -const newsEntries = (await getCollection('news')).toSorted( +const newsEntries = (await getCollection('news')).sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(), ); --- diff --git a/src/pages/work/index.astro b/src/pages/work/index.astro index 92cb516..56b8fae 100644 --- a/src/pages/work/index.astro +++ b/src/pages/work/index.astro @@ -6,7 +6,7 @@ import Layout from '@/layouts/Layout.astro'; const title = '実績'; const description = ''; -const workEntries = (await getCollection('work')).toSorted( +const workEntries = (await getCollection('work')).sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(), ); ---