From dca26bac2c05fcfc9c7ed477b32a7fab1295a688 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 21 十月 2025 17:48:10 +0800
Subject: [PATCH] 2025.10.21 修改嫉妒报告生成逻辑

---
 src/utils/expand/expand.js |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/utils/expand/expand.js b/src/utils/expand/expand.js
index 6495211..cda8235 100644
--- a/src/utils/expand/expand.js
+++ b/src/utils/expand/expand.js
@@ -24,3 +24,24 @@
   }
   return fmt;
 };
+
+Array.prototype.lastCount = function (size) {
+  const l = this.length;
+  const s = size > this.length ? 0 : this.length - size;
+  return this.slice(s, l);
+};
+
+Array.prototype.groupBy = function (func) {
+  const groups = {};
+  this.forEach((item) => {
+    const key = func(item);
+    if (!groups[key]) {
+      groups[key] = [];
+    }
+    groups[key].push(item);
+  });
+  return Object.keys(groups).map((key) => ({
+    key,
+    values: groups[key]
+  }));
+};

--
Gitblit v1.9.3