chore: combine the if statements into one (#5785)

This commit is contained in:
KEHyeon
2024-07-11 05:56:03 +09:00
committed by GitHub
parent a67a085cc0
commit 6a2cc1dfcf

View File

@@ -14,11 +14,8 @@ function createMathOperation(operator, defaultValue) {
if (value === undefined && other === undefined) {
return defaultValue
}
if (value !== undefined && other === undefined) {
return value
}
if (other !== undefined && value === undefined) {
return other
if(value === undefined || other === undefined) {
return value || other
}
if (typeof value === 'string' || typeof other === 'string') {
value = baseToString(value)