Skip to content

Commit

Permalink
Use object (instead of a array) to access functions parameters using …
Browse files Browse the repository at this point in the history
…their predicate
  • Loading branch information
vemonet committed Aug 11, 2021
1 parent 4677547 commit 35849bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/function/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const findParameters = (data, predicateObjectMap, prefixes) => {
result.push({
type,
data: param[type],
predicate: predicate
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/input-parser/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const subjFunctionExecution = async (Parser, functionMap, prefixes, data, index,
};

const calculateParams = (Parser, parameters, index, options) => {
const result = [];
const result = {};
parameters.forEach((p) => {
let temp = [];
if (p.type === 'constant') {
Expand All @@ -25,7 +25,7 @@ const calculateParams = (Parser, parameters, index, options) => {
if (temp && temp.length === 1) {
temp = temp[0];
}
result.push(temp);
result[p.predicate] = temp;
});
return result;
};
Expand Down

0 comments on commit 35849bc

Please sign in to comment.