@nodescript/stdlib
Version:
Standard Node Definitions
30 lines (29 loc) • 711 B
JavaScript
export const module = {
version: '1.1.4',
moduleName: 'Flow / Sequence',
description: 'Runs the steps sequentialy and returns an array of their result.',
params: {
steps: {
deferred: true,
schema: {
type: 'array',
items: { type: 'any' },
},
},
},
result: {
async: true,
schema: {
type: 'array',
items: { type: 'any' },
},
}
};
export const compute = async (params, ctx) => {
const results = [];
for (const step of params.steps) {
const value = await ctx.resolveDeferred(step);
results.push(value);
}
return results;
};