feat: return worflow params if !null

This commit is contained in:
karishmas6
2024-06-08 00:43:34 +05:30
parent 702d720af2
commit 4fe4075972

View File

@@ -666,5 +666,30 @@ export class WorkflowGenerator {
return bestUrl;
}
/**
* Returns parameters if present in the workflow or null.
* @param workflow The workflow to be checked.
*/
private checkWorkflowForParams = (workflow: WorkflowFile): string[]|null => {
// for now the where condition cannot have any params, so we're checking only what part of the pair
// where only the args part of what condition can have a parameter
for (const pair of workflow.workflow) {
for (const condition of pair.what) {
if (condition.args) {
const params: any[] = [];
condition.args.forEach((arg) => {
if (arg.$param) {
params.push(arg.$param);
}
})
if (params.length !== 0) {
return params;
}
}
}
}
return null;
}
}