From ba8a7c2bf077475efcb6e1af8a957efc5434757e Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:10:37 +0000 Subject: [PATCH] refactor: remove unnecessary boolean casts In contexts such as an `if` statement's test where the result of the expression will already be coerced to a `Boolean`, casting to a `Boolean` via double negation (`!!`) or a `Boolean` call is unnecessary. --- script/moment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/moment.js b/script/moment.js index a9363815..f5950d06 100644 --- a/script/moment.js +++ b/script/moment.js @@ -1846,7 +1846,7 @@ } else { duration.milliseconds = input; } - } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { + } else if (match = aspNetTimeSpanJsonRegex.exec(input)) { sign = (match[1] === '-') ? -1 : 1; duration = { y: 0, @@ -1856,7 +1856,7 @@ s: toInt(match[SECOND]) * sign, ms: toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = isoDurationRegex.exec(input))) { + } else if (match = isoDurationRegex.exec(input)) { sign = (match[1] === '-') ? -1 : 1; parseIso = function (inp) { // We'd normally use ~~inp for this, but unfortunately it also