(body, functionName)
| 222 | } |
| 223 | |
| 224 | function getFunctionDetails(body, functionName) { |
| 225 | return body.filter((node) => { |
| 226 | // console.log('getFunctionDetails', node) |
| 227 | if (node.type === 'FunctionDeclaration' || node.type === 'ExportDefaultDeclaration') { |
| 228 | return getName(node) === functionName |
| 229 | } |
| 230 | return false |
| 231 | }).reduce((acc, node) => { |
| 232 | const body = getBody(node) |
| 233 | if (body) { |
| 234 | const lookupBody = body.body || body // verify this logic |
| 235 | const foundThings = getReturnStatment(lookupBody) |
| 236 | acc = acc.concat(foundThings) |
| 237 | } |
| 238 | return acc |
| 239 | }, []) |
| 240 | } |
| 241 | |
| 242 | function getBody(node) { |
| 243 | if (node.type === 'ExportDefaultDeclaration') { |
no test coverage detected