@servable/server
Version:
Servable server
19 lines (17 loc) • 342 B
JavaScript
export default async (props) => {
const { operation, direction, taskProps } = props
switch (direction) {
case 'up':
case 'down': {
break
} default: {
return
}
}
const { up, down, } = operation
const task = (direction === 'up') ? up : down
if (!task) {
return
}
await task.default(taskProps)
}