Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb3c0bda
authored
Apr 27, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refactor(number): 简化 isZeroOrNumber 函数逻辑
使用空值合并运算符替换原有的复杂条件判断,使代码更简洁易读。
1 parent
98a87560
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
src/libs/number.js
src/libs/number.js
View file @
cb3c0bd
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
:
"-"
;
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment