2025.11.28.22.40
This commit is contained in:
@@ -58,10 +58,6 @@ if (!MONGODB_URI) {
|
||||
// ------------------------------------------------------------------
|
||||
const getRandomInt = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
const getRandomItem = <T>(arr: T[]): T => arr[Math.floor(Math.random() * arr.length)];
|
||||
const getRandomItems = <T>(arr: T[], count: number): T[] => {
|
||||
const shuffled = [...arr].sort(() => 0.5 - Math.random());
|
||||
return shuffled.slice(0, count);
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// 3. 主逻辑
|
||||
|
||||
Reference in New Issue
Block a user