| 12345678910111213141516171819 |
- /** 语句:if 条件判断(解析在此,执行在 sequence-runner) */
- const types = ['if']
- function parse(action, parseContext) {
- const { parseActions } = parseContext
- const parsed = {
- type: 'if',
- condition: action.condition,
- then: (action.then || action.ture) ? parseActions(action.then || action.ture) : [],
- else: action.else ? parseActions(action.else) : [],
- }
- return Object.assign({}, action, parsed)
- }
- async function execute() {
- return { success: true }
- }
- module.exports = { types, parse, execute }
|