From 6290e3b6fe40e19d8ceaf0f2ad7239b31c77c4dd Mon Sep 17 00:00:00 2001 From: jokj624 Date: Tue, 6 Aug 2024 02:36:14 +0900 Subject: [PATCH 1/2] fix: add optional chaining to prevent type error --- packages/bruno-lang/v2/src/jsonToBru.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-lang/v2/src/jsonToBru.js b/packages/bruno-lang/v2/src/jsonToBru.js index 4b6e6b9673..569ce05858 100644 --- a/packages/bruno-lang/v2/src/jsonToBru.js +++ b/packages/bruno-lang/v2/src/jsonToBru.js @@ -13,7 +13,7 @@ const stripLastLine = (text) => { }; const getValueString = (value) => { - const hasNewLines = value.includes('\n'); + const hasNewLines = value?.includes('\n'); if (!hasNewLines) { return value; @@ -261,7 +261,7 @@ ${indentString(body.sparql)} multipartForms .map((item) => { const enabled = item.enabled ? '' : '~'; - + console.log(item); if (item.type === 'text') { return `${enabled}${item.name}: ${getValueString(item.value)}`; } From a478c3cdc4eb530c7fedd82f1a89a4fcfd9ccaa3 Mon Sep 17 00:00:00 2001 From: jokj624 Date: Tue, 6 Aug 2024 02:44:43 +0900 Subject: [PATCH 2/2] fix: remove debug code --- packages/bruno-lang/v2/src/jsonToBru.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/bruno-lang/v2/src/jsonToBru.js b/packages/bruno-lang/v2/src/jsonToBru.js index 569ce05858..dd3be5947f 100644 --- a/packages/bruno-lang/v2/src/jsonToBru.js +++ b/packages/bruno-lang/v2/src/jsonToBru.js @@ -261,7 +261,6 @@ ${indentString(body.sparql)} multipartForms .map((item) => { const enabled = item.enabled ? '' : '~'; - console.log(item); if (item.type === 'text') { return `${enabled}${item.name}: ${getValueString(item.value)}`; }