Comparing version 1.8.2 to 1.9.0
{ | ||
"name": "nodegate", | ||
"description": "API gateway made simple, fast and easy to configure.", | ||
"version": "1.8.2", | ||
"version": "1.9.0", | ||
"author": "Julien Martin <martin.julien82@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -8,4 +8,11 @@ /** | ||
module.exports = (condition, workflow) => async (container, request, executeChunk) => { | ||
if (condition(container, request)) await executeChunk(workflow, container, request); | ||
}; | ||
module.exports = (condition, workflow, elseWorkflow) => ( | ||
async (container, request, executeChunk) => { | ||
if (condition(container, request)) { | ||
await executeChunk(workflow, container, request); | ||
return; | ||
} | ||
if (!elseWorkflow) return; | ||
await executeChunk(elseWorkflow, container, request); | ||
} | ||
); |
22689
579