Commit cb3c0bda by Jaxon

refactor(number): 简化 isZeroOrNumber 函数逻辑

使用空值合并运算符替换原有的复杂条件判断,使代码更简洁易读。
1 parent 98a87560
export function isZeroOrNumber(val) { export function isZeroOrNumber(val) {
const valid = (val === 0 || !Number.isNaN(val)) && val !== undefined && val !== null && val !== ""; return val ?? "-";
return valid ? val : "-";
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!