Merge pull request #1591 from appsmithorg/fix/args
Fix for args not splitting correctly with empty values
This commit is contained in:
commit
08b755bdcb
|
|
@ -107,13 +107,21 @@ const JSToString = (js: string): string => {
|
||||||
|
|
||||||
const argsStringToArray = (funcArgs: string): string[] => {
|
const argsStringToArray = (funcArgs: string): string[] => {
|
||||||
const argsplitMatches = [...funcArgs.matchAll(FUNC_ARGS_REGEX)];
|
const argsplitMatches = [...funcArgs.matchAll(FUNC_ARGS_REGEX)];
|
||||||
return argsplitMatches
|
const arr: string[] = [];
|
||||||
.map(match => {
|
let isPrevUndefined = true;
|
||||||
return match[0];
|
argsplitMatches.forEach(match => {
|
||||||
})
|
const matchVal = match[0];
|
||||||
.filter(arg => {
|
if (!matchVal || matchVal === "") {
|
||||||
return arg !== "";
|
if (isPrevUndefined) {
|
||||||
});
|
arr.push(matchVal);
|
||||||
|
}
|
||||||
|
isPrevUndefined = true;
|
||||||
|
} else {
|
||||||
|
isPrevUndefined = false;
|
||||||
|
arr.push(matchVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return arr;
|
||||||
};
|
};
|
||||||
|
|
||||||
const textSetter = (
|
const textSetter = (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user