功能:更新消息中心和 YumiNail 模块

This commit is contained in:
xiaowang
2026-05-13 12:43:01 +08:00
parent 6b9eba5aca
commit 2074addc40
284 changed files with 21031 additions and 4533 deletions
+22
View File
@@ -0,0 +1,22 @@
export type IdType = string | number
export const isEmptyId = (value: unknown): value is undefined | null | '' => {
return value === undefined || value === null || `${value}`.trim() === ''
}
export const toIdString = (value: IdType) => String(value)
// 前端统一把雪花 ID 视为字符串语义处理,避免任何 Number 转换带来的精度污染。
export const toOptionalIdString = (value: unknown) => {
if (isEmptyId(value)) {
return undefined
}
return String(value).trim()
}
// 比较 ID 时统一做字符串归一化,兼容接口返回 string / number 两种情况。
export const sameId = (left: unknown, right: unknown) => {
const leftId = toOptionalIdString(left)
const rightId = toOptionalIdString(right)
return leftId !== undefined && leftId === rightId
}