fix(#1000): Convert too long numbers into String for collection vars (#1405)

This commit is contained in:
Timon 2024-01-17 23:08:57 +01:00 committed by GitHub
parent 4e34aba1ca
commit dbb5e912eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 + '`';