From db617adda3750eb7384aa9e2e2aa774a1b96c3a7 Mon Sep 17 00:00:00 2001 From: Anant Jain Date: Mon, 30 Oct 2023 12:43:19 +0530 Subject: [PATCH] chore: reduce cognitive complexity+1 --- src/v0/destinations/am/transform.js | 8 ++++---- src/v0/util/testdata/isValidInteger.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/v0/destinations/am/transform.js b/src/v0/destinations/am/transform.js index 29bbc1dfc3..080967d288 100644 --- a/src/v0/destinations/am/transform.js +++ b/src/v0/destinations/am/transform.js @@ -224,10 +224,10 @@ const handleMappingJsonObject = ( if (isDefinedAndNotNull(data)) { set(payload, outKey, data); delete message.traits[outKey]; - } else { - // get the destKey/outKey value from calling the util function - set(payload, outKey, AMUtils[funcName](message, sourceKey, Config)); - } + return; + } + // get the destKey/outKey value from calling the util function + set(payload, outKey, AMUtils[funcName](message, sourceKey, Config)); } } }; diff --git a/src/v0/util/testdata/isValidInteger.json b/src/v0/util/testdata/isValidInteger.json index f49d6d3fc5..869bc863ca 100644 --- a/src/v0/util/testdata/isValidInteger.json +++ b/src/v0/util/testdata/isValidInteger.json @@ -16,7 +16,7 @@ }, { "description": "Float string", - "input": "123.91", + "input": "123.00", "output": false }, {