From dbb5e912ebbaa806f338f01ead41f7b7b8394ea1 Mon Sep 17 00:00:00 2001 From: Timon <39559178+Its-treason@users.noreply.github.com> Date: Wed, 17 Jan 2024 23:08:57 +0100 Subject: [PATCH] fix(#1000): Convert too long numbers into String for collection vars (#1405) --- packages/bruno-js/src/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/bruno-js/src/utils.js b/packages/bruno-js/src/utils.js index a30ad8e8e0..e15ec09a7c 100644 --- a/packages/bruno-js/src/utils.js +++ b/packages/bruno-js/src/utils.js @@ -92,7 +92,12 @@ const evaluateJsTemplateLiteral = (templateLiteral, context) => { } if (!isNaN(templateLiteral)) { - return Number(templateLiteral); + const number = Number(templateLiteral); + // Check if the number is too high. Too high number might get altered, see #1000 + if (number > Number.MAX_SAFE_INTEGER) { + return templateLiteral; + } + return number; } templateLiteral = '`' + templateLiteral + '`';