1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-30 03:02:49 +08:00

refactor: change if...else to ternary operator

This commit is contained in:
qige2016 2020-06-15 10:27:06 +08:00
parent 862fa88e99
commit 617faf7052

View File

@ -1,9 +1,2 @@
exports.notEmpty = name => {
return v => {
if (!v || v.trim() === '') {
return `${name} is required`
} else {
return true
}
}
}
exports.notEmpty = name => v =>
!v || v.trim() === '' ? `${name} is required` : true