support passing functions to the backend as parameters

This commit is contained in:
azivner
2018-02-18 09:53:36 -05:00
parent 08bc2afb49
commit ddc885066e
3 changed files with 20 additions and 7 deletions

View File

@@ -19,7 +19,14 @@ async function executeScript(dataKey, script, params) {
}
function getParams(params) {
return params.map(p => JSON.stringify(p)).join(",");
return params.map(p => {
if (typeof p === "string" && p.startsWith("!@#Function: ")) {
return p.substr(13);
}
else {
return JSON.stringify(p);
}
}).join(",");
}
module.exports = {