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:
commit
c939edbb2b
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue