From a9b6a2c7fd124b03a860b5a8cc402bb696ad9f8f Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 16 Dec 2024 11:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 44e6362..a98c9fd 100644 --- a/main.js +++ b/main.js @@ -42,7 +42,9 @@ export function get_search(n = 10) { ex.set(key, (ex.get(key) || 0) + value) }) } - return [...ex.entries()].sort((a, b) => b[1] - a[1]).slice(0, n) + return [...ex.entries()].sort((a, b) => b[1] - a[1]).slice(0, n).map(([text, count]) => { + return { text, count } + }) } const 日期格式 = new Intl.DateTimeFormat('zh-CN', {