fix(reactflowUtils.ts): 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:
parent
5a1ddfb9b3
commit
a7eab9677f
1 changed files with 2 additions and 2 deletions
|
|
@ -436,8 +436,8 @@ export function convertValuesToNumbers(arr) {
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
if (obj.hasOwnProperty(key)) {
|
if (obj.hasOwnProperty(key)) {
|
||||||
let value = obj[key];
|
let value = obj[key];
|
||||||
if (/\s/g.test(value)) {
|
if (/^\d+$/.test(value)) {
|
||||||
value = value.trim();
|
value = value?.toString().trim();
|
||||||
}
|
}
|
||||||
newObj[key] =
|
newObj[key] =
|
||||||
value === "" || isNaN(value) ? value.toString() : Number(value);
|
value === "" || isNaN(value) ? value.toString() : Number(value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue