refactor: 代码格式化

This commit is contained in:
digua
2026-01-31 10:06:44 +08:00
parent 58e18326d9
commit f6b4b6dc4c
114 changed files with 1276 additions and 985 deletions

View File

@@ -613,4 +613,3 @@ export function getCheckInAnalysis(sessionId: string, filter?: TimeFilter): any
totalDays,
}
}

View File

@@ -350,4 +350,3 @@ export function getMemeBattleAnalysis(sessionId: string, filter?: TimeFilter): a
totalBattles: battles.length,
}
}

View File

@@ -15,4 +15,3 @@ export { getMonologueAnalysis, getMemeBattleAnalysis } from './behavior'
// 社交分析:@ 互动、含笑量
export { getMentionAnalysis, getMentionGraph, getLaughAnalysis } from './social'
export type { MentionGraphData, MentionGraphNode, MentionGraphLink } from './social'

View File

@@ -80,7 +80,10 @@ export function getRepeatAnalysis(sessionId: string, filter?: TimeFilter): any {
const fastestRepeaterStats = new Map<number, { totalDiff: number; count: number }>()
const processRepeatChain = (chain: Array<{ id: number; senderId: number; content: string; ts: number }>, breakerId?: number) => {
const processRepeatChain = (
chain: Array<{ id: number; senderId: number; content: string; ts: number }>,
breakerId?: number
) => {
if (chain.length < 3) return
totalRepeatChains++
@@ -112,7 +115,13 @@ export function getRepeatAnalysis(sessionId: string, filter?: TimeFilter): any {
existing.firstMessageId = firstMsgId
}
} else {
contentStats.set(content, { count: 1, maxChainLength: chainLength, originatorId, lastTs: chainTs, firstMessageId: firstMsgId })
contentStats.set(content, {
count: 1,
maxChainLength: chainLength,
originatorId,
lastTs: chainTs,
firstMessageId: firstMsgId,
})
}
// 计算反应时间 (Fastest Follower)

View File

@@ -368,9 +368,9 @@ export function getMentionGraph(sessionId: string, filter?: TimeFilter): Mention
nameToMemberId.set(member.name, member.id)
// 查询历史昵称
const history = db
.prepare(`SELECT name FROM member_name_history WHERE member_id = ?`)
.all(member.id) as Array<{ name: string }>
const history = db.prepare(`SELECT name FROM member_name_history WHERE member_id = ?`).all(member.id) as Array<{
name: string
}>
for (const h of history) {
if (!nameToMemberId.has(h.name)) {