Skip to content

Commit

Permalink
fix(usebruno#1000): Convert too long numbers into String for collecti…
Browse files Browse the repository at this point in the history
…on vars (usebruno#1405)
  • Loading branch information
Its-treason authored Jan 17, 2024
1 parent 4e34aba commit dbb5e91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/bruno-js/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '`';
Expand Down

0 comments on commit dbb5e91

Please sign in to comment.