( argumentsList: ReadonlyArray<string>, functionCode: FunctionExpression | ArrowFunctionExpression, )
| 174 | * function (params) { code } => (function (params) { code })(argumentsText) |
| 175 | */ |
| 176 | export const functionToFunctionCall = ( |
| 177 | argumentsList: ReadonlyArray<string>, |
| 178 | functionCode: FunctionExpression | ArrowFunctionExpression, |
| 179 | ): CallExpression => ({ |
| 180 | type: 'CallExpression', |
| 181 | arguments: argumentsList.map(name => ({ type: 'Identifier', name })), |
| 182 | callee: functionCode, |
| 183 | optional: false, |
| 184 | }); |
| 185 | |
| 186 | /** |
| 187 | * statement => catchAndReturnErrors(return statement); |
no test coverage detected