(type, tasksOrFn, fn)
| 11 | var DEFAULT_TASK = 'default'; |
| 12 | |
| 13 | function _setupFlight(type, tasksOrFn, fn) { |
| 14 | var tasks; |
| 15 | |
| 16 | if(typeof tasksOrFn === 'string') { |
| 17 | tasks = [tasksOrFn]; |
| 18 | } else if(Array.isArray(tasksOrFn)) { |
| 19 | tasks = tasksOrFn; |
| 20 | } else { |
| 21 | tasks = [DEFAULT_TASK]; |
| 22 | fn = tasksOrFn; |
| 23 | } |
| 24 | |
| 25 | return { type: type, tasks: tasks, fn: fn }; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * A flightplan is a set of subsequent flights to be executed on one or more |