You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When providing parameters to function mapping (ie: $F{sum:1,2}), if the parameter includes a : character, the rest of the parameter is cut off from being included in the arguments.
I am trying to create a function which will allow to give some ISO DateTime format to the method and generate a DateTime with the given format.
To Reproduce
Steps to reproduce the behavior:
Example: $F{CurrentDate:yyyy-MM-dd'T'HH:mm:ss}
Function: function currentDate(ctx){ some code here }
Adding Function Handler: handler.addDataFuncHandler('CurrentDate', (ctx) => {return currentDate(ctx)})
When reaching the function, the only value included in ctx.args[0] is yyyy-MM-dd'T'HH which is cutting off the mm and ss parts of the ISO format.
Expected behavior
The expected behavior in my case would be to allow the function args/parameters to include the : character and not be split when processing the input.
Potential Solution
In dataProcessor.js line 104, the FunctionName:param1,param2 string is being split up by the : character for all instances of the character, causing arguments which include a : to be split and not passed to the function when it is filtered out on line 106.
I was able to reach expected behavior by modifying the refValue.split(':') on line 104 to use a regex expression to only split by the first instance of the : character like so refValue.split(/:(.*)/)
If there is already some way to allow arguments to include the : character without any changes please let me know. Otherwise I think a change would be required to allow it.
The text was updated successfully, but these errors were encountered:
Describe the bug
When providing parameters to function mapping (ie:
$F{sum:1,2}
), if the parameter includes a:
character, the rest of the parameter is cut off from being included in the arguments.I am trying to create a function which will allow to give some ISO DateTime format to the method and generate a DateTime with the given format.
To Reproduce
Steps to reproduce the behavior:
Example:
$F{CurrentDate:yyyy-MM-dd'T'HH:mm:ss}
Function:
function currentDate(ctx){ some code here }
Adding Function Handler:
handler.addDataFuncHandler('CurrentDate', (ctx) => {return currentDate(ctx)})
When reaching the function, the only value included in
ctx.args[0]
isyyyy-MM-dd'T'HH
which is cutting off themm
andss
parts of the ISO format.Expected behavior
The expected behavior in my case would be to allow the function args/parameters to include the
:
character and not be split when processing the input.Potential Solution
In dataProcessor.js line 104, the
FunctionName:param1,param2
string is being split up by the:
character for all instances of the character, causing arguments which include a:
to be split and not passed to the function when it is filtered out on line 106.I was able to reach expected behavior by modifying the
refValue.split(':')
on line 104 to use a regex expression to only split by the first instance of the:
character like sorefValue.split(/:(.*)/)
If there is already some way to allow arguments to include the
:
character without any changes please let me know. Otherwise I think a change would be required to allow it.The text was updated successfully, but these errors were encountered: