Fix no space no keyPairList (#1072)

fix(reactflowUtils.t): modify convertValuesToNumbers function to
correctly handle values that are numbers represented as strings
feat(reactflowUtils.ts): add check to convertValuesToNumbers function to
only convert values that are valid numbers represented as strings
This commit is contained in:
Cristhian Zanforlin Lousa 2023-10-18 23:31:53 -03:00 committed by GitHub
commit c939edbb2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -436,8 +436,8 @@ export function convertValuesToNumbers(arr) {
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
let value = obj[key];
if (/\s/g.test(value)) {
value = value.trim();
if (/^\d+$/.test(value)) {
value = value?.toString().trim();
}
newObj[key] =
value === "" || isNaN(value) ? value.toString() : Number(value);