From 6a2cc1dfcf7634fea70d1bc5bd22db453df67b42 Mon Sep 17 00:00:00 2001 From: KEHyeon <60928176+KEHyeon@users.noreply.github.com> Date: Thu, 11 Jul 2024 05:56:03 +0900 Subject: [PATCH] chore: combine the if statements into one (#5785) --- src/.internal/createMathOperation.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/.internal/createMathOperation.ts b/src/.internal/createMathOperation.ts index d35ce6c3b..6923406fd 100644 --- a/src/.internal/createMathOperation.ts +++ b/src/.internal/createMathOperation.ts @@ -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)